-->
🏠 🔍
SHAREOLITE

Using Seagull tool for diameter protocol simulation

This section explains, step by step procedure on how to use seagull tool for Diameter protocol emulation

Few prerequisites before configuring for tests.
•    Application under test – the node to which Seagull will be connected for exchanging operations for emulation
•    Diameter Base connection – whether the node where seagull is used will act as Server or Client
•    Scenario which has the set of operations exchanged between seagull and the application node under test

For example, to simulate the below flow of diameter session based charging scenario

Step 1 : Editing the configuration file /opt/seagull/diameter/config/conf-client.xml

By default seagull includes few sample configuration files for client and server modes in the installation package. One such file is the client configuration file.
This file includes various configuration parameters referred by seagull module during simulation. A sample file is pasted here for reference. Explanation comments are embedded within <!-- --> tags . Important parameters are highlighted for quick reference.


<?xml version="1.0" encoding="ISO-8859-1"?>
<configuration name="Simple IP Server Conf">
  <define entity="transport"
    name="trans-1"
        file="libtrans_ip.so"
 create_function="create_cipio_instance"
 delete_function="delete_cipio_instance"
    init-args="type=tcp">
  </define>
  <define entity="channel"
    name="channel-1"
    protocol="diameter-v1"
    transport="trans-1"
    open-args="mode=client;dest=10.20.30.40:3868">  <!-- Configure application server destination IP and port here -->
  </define>

  <define entity="traffic-param" name="call-rate" value="1"></define>
  <define entity="traffic-param" name="display-period" value="5"></define>
  <define entity="traffic-param" name="log-stat-period" value="0"></define>
  <define entity="traffic-param" name="log-stat-file" value="../logs/client-stat.csv"></define>
  <define entity="traffic-param" name="call-timeout-ms" value="10000"></define>
  <define entity="traffic-param" name="display-scenario-stat" value="true"></define>
  <define entity="traffic-param" name="display-protocol-stat" value="true"></define>
  <define entity="traffic-param" name="log-protocol-stat-period" value="0"></define>
  <define entity="traffic-param" name="log-protocol-stat-name" value="all"></define>
  <define entity="traffic-param" name="log-protocol-stat-file" value="../logs/client-protocol-stat.csv"></define>

  <define entity="traffic-param" name="max-send" value="500"></define>
  <define entity="traffic-param" name="max-receive" value="500"></define>
  <define entity="traffic-param" name="max-simultaneous-calls" value="10"></define>
  <define entity="traffic-param" name="select-timeout-ms" value="1"></define>
  <define entity="traffic-param" name="model-traffic-select" value="best-effort"> </define>
</configuration>

Step 2 :   Create a scenario file

By default seagull includes few sample scenario files for client and server modes in the installation package. Below is one such sample scenario file . Important sections are highlighted.


<?xml version="1.0" encoding="ISO-8859-1" ?>
<scenario>

<counter>
  <counterdef name="HbH-counter" init="13000000" min="13000000" max="99999999"></counterdef>
  <counterdef name="EtE-counter" init="13000000" min="13000000" max="99099999"></counterdef>
  <counterdef name="session-counter" init="2000000000" min="2000000000" max="9999999999"></counterdef>
  <counterdef name="msisdn-counter" init="17000022" min="17000022" max="17499999"></counterdef>
</counter>

<init>
  <send channel="channel-1">
  <command name="CER">
      <avp name="Origin-Host" value="shareolite-gy-client"> </avp>
      <avp name="Origin-Realm" value="shareolite.net"> </avp>
      <avp name="Host-IP-Address" value="0x00010a000a22"> </avp>
      <avp name="Vendor-Id" value="10415"> </avp>
      <avp name="Product-Name" value="PGW"> </avp>
      <avp name="Supported-Vendor-Id" value="10415"> </avp>
        <avp name="Vendor-Specific-Application-Id">
        <avp name="Vendor-Id" value="10415"></avp>
        <avp name="Auth-Application-Id" value="4"></avp>
      </avp>
      <avp name="Firmware-Revision" value="1030006"> </avp>
    </command>
  </send>

  <receive channel="channel-1">
    <command name="CEA">
    </command>
  </receive>
</init>


<default behaviour="success">


<receive channel="channel-1">
    <command name="RAR">
    </command>

    <action>
        <store name="HbH" entity="HbH-id"></store>
        <store name="E2E" entity="EtE-id"></store>
        <store name="sid" entity="Session-Id"></store>
        <store name="rar" entity="Re-Auth-Request-Type"></store>
    </action>
  </receive>

  <send channel="channel-1">
    <action>
      <restore name="HbH" entity="HbH-id"> </restore>
      <restore name="E2E" entity="EtE-id"> </restore>
      <restore name="sid" entity="Session-Id"> </restore>
      <restore name="rar" entity="Re-Auth-Request-Type"></restore>
    </action>
    <command name="RAA">
      <avp name="Session-Id" value="value_is_replaced"> </avp>
      <avp name="Origin-Host" value="shareolite-server.epc.mnc000.mcc000.3gpp.org"> </avp>
      <avp name="Origin-Realm" value="shareolite.net"> </avp>
      <avp name="Destination-Host" value="epc.mnc000.mcc000.3gppnetwork.org"> </avp>
      <avp name="Auth-Application-Id" value="4"></avp>
      <avp name="Re-Auth-Request-Type" value="0"> </avp>
    </command>
  </send>



</default>


<traffic>
          <send channel="channel-1">
            <action>
              <!-- For each new call, increment the session-ID counter -->
              <inc-counter name="HbH-counter"> </inc-counter>
              <inc-counter name="EtE-counter"> </inc-counter>
              <inc-counter name="session-counter"> </inc-counter>
              <inc-counter name="msisdn-counter"> </inc-counter>
              <set-value name="HbH-id" format="$(HbH-counter)"></set-value>
              <set-value name="EtE-id" format="$(EtE-counter)"></set-value>
              <set-value name="Session-Id" format="Gy;$(session-counter)"></set-value>
               <set-value name="Subscription-Id-Data" format="$(msisdn-counter)"></set-value>
              <store name="SUBSCRIPTION-ID-DATA" entity="Subscription-Id-Data"></store>
              <store name="SESSION_ID" entity="Session-Id"></store>
            </action>
            <command name="CCR">
              <avp name="Session-Id" value="value_is_replaced"> </avp>
              <avp name="Destination-Realm" value="shareolite.net"> </avp>
              <avp name="Origin-Host" value="shareolite-client-gy"> </avp>
              <avp name="Destination-Host" value="shareolite-server-gy"> </avp>
              <avp name="Origin-Realm" value="shareolite.net"> </avp>
              <avp name="Auth-Application-Id" value="4"></avp>
              <avp name="Service-Context-Id" value="ggsn@huawei.com"></avp>
              <avp name="Event-Timestamp" value="0xe51a4076"></avp>
              <avp name="CC-Request-Number" value="0"> </avp>
              <avp name="CC-Request-Type" value="1"> </avp>
              <avp name="Supported-Features">
                <avp name="Feature-List-ID" value="1"></avp>
                <avp name="Feature-List" value="2"></avp>
              </avp>
              <avp name="Subscription-Id">
                <avp name="Subscription-Id-Data" value="will_be_replaced"></avp>
                <avp name="Subscription-Id-Type" value="0"></avp>
              </avp>
                <avp name="Subscription-Id">
                        <avp name="Subscription-Id-Data" value="404210000012345"></avp>
                        <avp name="Subscription-Id-Type" value="1"></avp>
                </avp>
                <avp name="Subscription-Id">
                        <avp name="Subscription-Id-Data" value="2003"></avp>
                        <avp name="Subscription-Id-Type" value="3"></avp>
                </avp>
              <avp name="Framed-IP-Address" value="0x0a000338"> </avp>
              <avp name="Called-Station-Id" value="shareolite"> </avp>
              
              <avp name="3GPP-SGSN-Address" value="0x0a0b0c04"> </avp>
              <avp name="RAT-Type" value="1004"> </avp>
              <avp name="3GPP-SGSN-MCC-MNC" value="919845"> </avp>
              <avp name="3GPP-MS-TimeZone" value="6100"> </avp>
              <avp name="User-Equipment-Info">
                       <avp name="User-Equipment-Info-Type" value="0"> </avp>
                       <avp name="User-Equipment-Info-Value" value="72057594037927935"> </avp>
              </avp>
            <!--  <avp name="Network-Request-Support" value="1"> </avp>
              <avp name="Bearer-Identifier" value="31"> </avp>
              <avp name="Bearer-Operation" value="1"> </avp> -->
    </command>
    <action>
      <start-timer></start-timer>
    </action>
  </send>

  <receive channel="channel-1">
    <action>
     <store name="SESSION_ID" entity="Session-Id"></store>
     <stop-timer></stop-timer>
     <check-value name="Result-Code" behaviour="error"></check-value>
    </action>
            <command name="CCA">
                <avp name="Result-Code" value="2001"></avp>
            </command>
  </receive>


<wait-ms value="5000"></wait-ms>

  <send channel="channel-1">
        <action>
<!-- CCR-UPDATE -->
                <restore name="SESSION_ID" entity="Session-Id"></restore>
                <inc-counter name="HbH-counter"> </inc-counter>
                <inc-counter name="EtE-counter"> </inc-counter>
                <set-value name="HbH-id" format="$(HbH-counter)"></set-value>
                <set-value name="EtE-id" format="$(EtE-counter)"></set-value>
                <set-value name="Subscription-Id-Data" format="$(msisdn-counter)"></set-value>
        </action>
        <command name="CCR">
                <avp name="Session-Id" value="value_is_replaced"> </avp>
                <avp name="Destination-Realm" value="shareolite.net"> </avp>
                <avp name="Origin-Host" value="shareolite-gy-client"> </avp>
                <avp name="Origin-Realm" value="shareolite.net"> </avp>
                <avp name="Auth-Application-Id" value="4"></avp>
                <avp name="CC-Request-Number" value="1"> </avp>
                <avp name="CC-Request-Type" value="2"> </avp>
                <avp name="Supported-Features">
                        <avp name="Vendor-Id" value="10415"></avp>
                        <avp name="Feature-List-ID" value="1"></avp>
                        <avp name="Feature-List" value="2"></avp>
                </avp>
                <avp name="Subscription-Id">
                        <avp name="Subscription-Id-Data" value="will_be_replaced"></avp>
                        <avp name="Subscription-Id-Type" value="1"></avp>
                </avp>

                <avp name="Multiple-Services-Credit-Control">
                        <avp name="Requested-Service-Unit">
                                <avp name="CC-Service-Specific-Units" value="1"></avp>
                                <avp name="Rating-Group" value="100"></avp>
                        </avp>
                        <avp name="Service-Identifier" value="123"> </avp>
                </avp>

                <avp name="Framed-IP-Address" value="0x0a0b0c0d"> </avp>
                <avp name="Called-Station-Id" value="shareolite"> </avp>
                <avp name="3GPP-SGSN-Address" value="0x0a0b0c04"> </avp>
                <avp name="RAT-Type" value="1004"> </avp>
                 <avp name="3GPP-SGSN-MCC-MNC" value="919845"> </avp>
                <avp name="3GPP-MS-TimeZone" value="6100"> </avp>
                <avp name="Network-Request-Support" value="1"> </avp>

                <avp name="User-Equipment-Info">
                       <avp name="User-Equipment-Info-Type" value="0"> </avp>
                       <avp name="User-Equipment-Info-Value" value="72057594037927935"> </avp>
                </avp>
                <avp name="Bearer-Identifier" value="31"> </avp>
                <avp name="Bearer-Operation" value="1"> </avp>
        </command>
        <action>
                <start-timer></start-timer>
        </action>
        </send>

        <receive channel="channel-1">
            <command name="CCA">
                <avp name="Result-Code" value="2001"></avp>
           </command>
                <action>
            <stop-timer></stop-timer>
            <check-value name="Result-Code" behaviour="error"></check-value>
            <store name="SESSION_ID" entity="Session-Id"></store>
            </action>
        </receive>

<wait-ms value="500"></wait-ms>
   
           <send channel="channel-1">
        <action>
        <!-- CCR-TERMINATE -->

                <restore name="SESSION_ID" entity="Session-Id"></restore>
                <inc-counter name="HbH-counter"> </inc-counter>
                <inc-counter name="EtE-counter"> </inc-counter>
                <set-value name="HbH-id" format="$(HbH-counter)"></set-value>
                <set-value name="EtE-id" format="$(EtE-counter)"></set-value>
                <set-value name="Subscription-Id-Data" format="$(msisdn-counter)"></set-value>
        </action>
        <command name="CCR">
                <avp name="Session-Id" value="value_is_replaced"> </avp>
                <avp name="Destination-Realm" value="shareolite.net"> </avp>
                <avp name="Origin-Host" value="shareolite-gy-client"> </avp>
                <avp name="Origin-Realm" value="shareolite.net"> </avp>
                <avp name="Auth-Application-Id" value="4"></avp>
                <avp name="CC-Request-Number" value="10"> </avp>
                <avp name="CC-Request-Type" value="3"> </avp>
                <avp name="Supported-Features">
                        <avp name="Vendor-Id" value="10415"></avp>
                        <avp name="Feature-List-ID" value="1"></avp>
                        <avp name="Feature-List" value="2"></avp>
                </avp>
                <avp name="Subscription-Id">
                        <avp name="Subscription-Id-Data" value="will_be_replaced"></avp>
                        <avp name="Subscription-Id-Type" value="1"></avp>
                </avp>
                <avp name="Framed-IP-Address" value="0x0a000338"> </avp>
                <avp name="Called-Station-Id" value="shareolite"> </avp>
                <avp name="3GPP-SGSN-Address" value="0x0a0b0c04"> </avp>
                <avp name="RAT-Type" value="1004"> </avp>
                <avp name="3GPP-SGSN-MCC-MNC" value="919845"> </avp>
                <avp name="3GPP-MS-TimeZone" value="5100"> </avp>
                <avp name="Network-Request-Support" value="1"> </avp>

                <avp name="User-Equipment-Info">
                       <avp name="User-Equipment-Info-Type" value="0"> </avp>
                       <avp name="User-Equipment-Info-Value" value="72057594037927935"> </avp>
                </avp>
                <avp name="Termination-Cause" value="4"></avp>
                <avp name="Bearer-Identifier" value="31"> </avp>
                <avp name="Bearer-Operation" value="1"> </avp>
        </command>
        <action>
                <start-timer></start-timer>
        </action>
  </send>

        <receive channel="channel-1">
            <command name="CCA">
                <avp name="Result-Code" value="2001"></avp>
            </command>
            <action>
                <stop-timer></stop-timer>
                <check-value name="Result-Code" behaviour="error"></check-value>
            </action>
        </receive>


</traffic>
</scenario>

Step 3 : Configure the run script and execution

Final step before starting simulation is to configure the seagull run script. A run script has the seagull module command to read specific configuration file , scenario file , dictionary file to use for simulating traffic

seagull -conf ../config/conf-shareolite.client.xml -dico ../config/dic-shareolite.client.xml -scen /opt/seagull/diameter/scenario/BT-shareolite.client.xml -log ../logs/ccr-cca.client.log -llevel ET

The configuration file, scenario file created above are passed as arguments along with default available protocol dictionary file to seagull module in the run script. Executing this script seagull initializes the test environment as mentioned in the configuration file and on successful network connection to the application under test , starts initiating the operations defined inside the scenario file

Comments

–>