Sending a Diameter message multiple times using seagull

Richard C

I am trying to automate the sending of a Diameter message using seagull. I am able to send a single message successfully but I now need to be able to send multiple messages.

See below the config and scenario files I am using.

Using the below I can set the number of calls but regardless of what is set I am only seeing the first message sent, after this all remaining messages are blank.

Any help in setting this up correctly is greatly appreciated

Config XML.

    <?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>
    <configuration name=\"SimpleIPClientCon\">
       <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={self.identity_listener_host}:{self.identity_listener_port}\">
       </define>

      <define entity=\"traffic-param\" name=\"call-rate\" value=\"1\"></define>
      <define entity=\"traffic-param\" name=\"display-period\" value=\"1\"></define>
      <define entity=\"traffic-param\" name=\"log-stat-period\" value=\"1\"></define>
      <define entity=\"traffic-param\" name=\"log-stat-file\" value=\"/opt/seagull/diameter/logs/client-stat.csv\"></define>
      <define entity=\"traffic-param\" name=\"call-timeout-ms\" value=\"30\"></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=\"5\"></define>
      <define entity=\"traffic-param\" name=\"log-protocol-stat-name\" value=\"all\"></define>
      <define entity=\"traffic-param\" name=\"log-protocol-stat-file\" value=\"/opt/seagull/diameter/logs/client-protocol-stat.csv\"></define>

      <define entity=\"traffic-param\" name=\"max-send\" value=\"1\"></define>
      <define entity=\"traffic-param\" name=\"max-receive\" value=\"1\"></define>
      <define entity=\"traffic-param\" name=\"max-simultaneous-calls\" value=\"1\"></define>
      <define entity=\"traffic-param\" name=\"select-timeout-ms\" value=\"30\"></define>


      <define entity=\"traffic-param\" name=\"number-calls\" value=\"{number_of_calls}\"></define>

    </configuration>

Scenario XML

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

        <counter>
          <counterdef name=\"HbH-counter\" init=\"1000\"> </counterdef>
          <counterdef name=\"EtE-counter\" init=\"2000\"> </counterdef>
          <counterdef name=\"session-counter\" init=\"0\"> </counterdef>
        </counter>

        <init>
          <send channel=\"channel-1\">
            <command name=\"CER\">
              <avp name=\"Session-Id\" value=\"test-seesion\"> </avp>
              <avp name=\"Auth-Application-Id\" value=\"16777238\"> </avp>
              <avp name=\"Origin-Host\" value=\"sp-test-host\"> </avp>
              <avp name=\"Origin-Realm\" value=\"sp-test-host-realm\"> </avp>
              <avp name=\"Destination-Realm\" value=\"sp-test-dest-realm\"> </avp>
              <avp name=\"CC-Request-Type\" value=\"{str(self.request_type_value_dict[message])}\"> </avp>
              <avp name=\"CC-Request-Number\" value=\"0\"> </avp>
              <avp name=\"Destination-Host\" value=\"sp-test-dest-host\"> </avp>
              <avp name=\"Origin-State-Id\" value=\"1505899589\"> </avp>
              <avp name=\"Subscription-Id\">
                <avp name=\"Subscription-Id-Type\" value=\"0\"> </avp>
                <avp name=\"Subscription-Id-Data\" value=\"{self.subscriber_id}\"> </avp>
              </avp>
              <avp name=\"Subscription-Id\" value=\"\">
                <avp name=\"Subscription-Id-Type\" value=\"1\"> </avp>
                <avp name=\"Subscription-Id-Data\" value=\"250016371458760\"> </avp>
              </avp>
              <avp name=\"Framed-IP-Address\" value=\"{self.ip_address[1]}\"> </avp>
              <avp name=\"Vendor-Id\" value=\"11\"> </avp>
              <avp name=\"Product-Name\" value=\"HP\"> </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>

        </init>

        <!-- Traffic -->
        <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>
              <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=\"seagull.mydomain.com;1096298391;\$(session-counter)\"></set-value>
            </action>
            <command name=\"CCR\">
              <avp name=\"Session-Id\" value=\"value_is_replaced\"> </avp>
              <avp name=\"Origin-Host\" value=\"seagull.mydomain.com\"> </avp>
              <avp name=\"Origin-Realm\" value=\"ExampleRealm\"> </avp>
              <avp name=\"Destination-Realm\" value=\"ExampleRealm\"> </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=\"Auth-Application-Id\" value=\"4\"></avp>
              <avp name=\"Service-Context-Id\" value=\"[email protected]\"> </avp>
              <avp name=\"CC-Request-Type\" value=\"0x00000001\"> </avp>
              <avp name=\"CC-Request-Number\" value=\"0\"> </avp>
            </command>
            <action>
              <start-timer></start-timer>
            </action>
          </send>

        </traffic>

        </scenario>
Oded Itzhaky

As I wrote in the last answer a correct flow should start with CER/CEA scenario. You are (as a client) sending CER should accept CEA (from the server). Only then send all other messages.

Im guessing that now you are sending CER+CCR, you receive back CEA but only now server is ready to receive CCR.

You should send CER and wait for CEA and only than send the CCR. Here is your CER with waiting for CEA:

      <init>
      <send channel=\"channel-1\">
        <command name=\"CER\">
          <avp name=\"Session-Id\" value=\"test-seesion\"> </avp>
          <avp name=\"Auth-Application-Id\" value=\"16777238\"> </avp>
          <avp name=\"Origin-Host\" value=\"sp-test-host\"> </avp>
          <avp name=\"Origin-Realm\" value=\"sp-test-host-realm\"> </avp>
          <avp name=\"Destination-Realm\" value=\"sp-test-dest-realm\"> </avp>
          <avp name=\"CC-Request-Type\" value=\"{str(self.request_type_value_dict[message])}\"> </avp>
          <avp name=\"CC-Request-Number\" value=\"0\"> </avp>
          <avp name=\"Destination-Host\" value=\"sp-test-dest-host\"> </avp>
          <avp name=\"Origin-State-Id\" value=\"1505899589\"> </avp>
          <avp name=\"Subscription-Id\">
            <avp name=\"Subscription-Id-Type\" value=\"0\"> </avp>
            <avp name=\"Subscription-Id-Data\" value=\"{self.subscriber_id}\"> </avp>
          </avp>
          <avp name=\"Subscription-Id\" value=\"\">
            <avp name=\"Subscription-Id-Type\" value=\"1\"> </avp>
            <avp name=\"Subscription-Id-Data\" value=\"250016371458760\"> </avp>
          </avp>
          <avp name=\"Framed-IP-Address\" value=\"{self.ip_address[1]}\"> </avp>
          <avp name=\"Vendor-Id\" value=\"11\"> </avp>
          <avp name=\"Product-Name\" value=\"HP\"> </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>

One more option(that I like less) is just wait. You can add between requests:

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

This will cause your script to wait before sending the requests

Even though it looks like you already are working with Diameter protocol I recommend to go through a Diameter tutorial (or better RFC 3588) since you can also encounter with other issues like WDR from the server or wrong hop-by-hop/end-to-end headers

Good Luck

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related