1

我在海鸥直径工作,这是我的海鸥服务器和海鸥客户端方案

客户端服务器

   ---- CER ----> 
   <--- CEA ----
   ---- AAR ---->
   <--- AAA ----
   ---- STR  --->
   <--- STA  ----

但结果: 在此处输入图像描述 所以它不符合我的场景,请帮助我如何配置服务器和客户端可以同步的东西?

这是客户端场景

<?xml version="1.0"?><scenario>

<init>

<send channel="channel-1">
<command name="CER">
</command>
</send>

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

<traffic>

<send channel="channel-1">
<command name="AAR">
<avp name="Session-Id" value="trandeptrai"> </avp>
</command>
</send>

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

<send channel="channel-1">
<command name="STR">
<avp name="Session-Id" value="trandeptrai"> </avp>
</command>
</send>

<receive channel="channel-1">
<command name="STA"> </command>
<action>
<store name="Session-Id" entity="Session-Id"> </store>
</action>
</receive> 

</traffic>
</scenario>

客户端配置:

<?xml version="1.0"?>
<configuration name="jpT DIAMETER client">
<define entity="transport" name="trans-ip-v4" 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-ip-v4" open-args="mode=client;dest=134.138.249.41:12340"> </define>
<define entity="traffic-param" name="call-timeout-ms" value="10000"> </define>
<define entity="traffic-param" name="files-no-timestamp" value="true"> </define>
<define entity="traffic-param" name="call-rate" value="1"> </define>

</configuration>

服务器场景:

<?xml version="1.0"?><scenario>
<init>
<receive channel="channel-1">
<action>
 </action>
<command name="CER">
</command>
</receive>

<send channel="channel-1">
<command name="CEA"> </command>
<action>
 </action>
</send>
</init>
<traffic>

<receive channel="channel-1">
<command name="AAR"> </command>
<action>

<store name="Session-Id" entity="Session-Id"> </store>
</action>
</receive>

<send channel="channel-1">
<action>
<restore name="Session-Id" entity="Session-Id"> </restore>
</action>
<command name="AAA">
<avp name="Session-Id" value="1"> </avp>
</command>
</send>

<receive channel="channel-1">
<command name="STR"> </command>
<action>
<store name="Session-Id2" entity="Session-Id"> </store>
</action>
</receive>

<send channel="channel-1">
<action>
<restore name="Session-Id2" entity="Session-Id"> </restore>
</action>
<command name="STA">
<avp name="Session-Id" value="1"> </avp>
</command>
</send>

<!-- <wait-ms value="100"> </wait-ms> -->

</traffic>

</scenario>

服务器配置:

<?xml version="1.0"?>
<configuration name="jpT DIAMETER client">
<define entity="transport" name="trans-ip-v4" 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-ip-v4" open-args="mode=client;dest=134.138.249.41:12340"> </define>
<define entity="traffic-param" name="call-timeout-ms" value="10000"> </define>
<define entity="traffic-param" name="files-no-timestamp" value="true"> </define>
<define entity="traffic-param" name="call-rate" value="1"> </define>

</configuration>
4

2 回答 2

2

E2E 和 H2H 对于发送请求的主机必须是唯一的(应答包含相同的 E2E 和 H2H)。以这个官方指南为例(你可以在scenario/sar-saa.client.xml中找到它):

<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=".;1096298391;$(session-counter)"></set-value>
    </action>
    <command name="SAR">
      <avp name="Session-Id" value="value_is_replaced"> </avp>
      <avp name="Vendor-Specific-Application-Id">
        <avp name="Vendor-Id" value="11"></avp>
        <avp name="Auth-Application-Id" value="167772151"></avp>
        <avp name="Acct-Application-Id" value="0"></avp>
      </avp>
      <avp name="Auth-Session-State" value="1"> </avp>
      <avp name="Origin-Host" value="seagull"> </avp>
      <avp name="Origin-Realm" value="ims.hpintelco.org"> </avp>
      <avp name="Destination-Realm" value="ims.hpintelco.org"> </avp>
      <avp name="Server-Name" value="seagull"> </avp>
      <avp name="Server-Assignment-Type" value="3"> </avp>
      <avp name="User-Data-Request-Type" value="0"> </avp>
      <avp name="Public-Identity" value="sip:olivierj@ims.hpintelco.org"> </avp>
      <avp name="Destination-Host" value="hss.ims.hpintelco.org"> </avp>
    </command>
    <action>
      <start-timer></start-timer>
    </action>
  </send>
  
  <receive channel="channel-1">
    <action>
      <stop-timer></stop-timer>
    </action>
    <command name="SAA">
    </command>
  </receive>
</traffic>

有两个actions before 和 aftercommand将在 before 和 after 运行send SAR。现在您使用相同的这些术语,这将导致“损坏”并且难以从包捕获中读取/识别,我相信这就是它们的顺序无序的原因。这是我使用 SEAGULL 的经验:

  1. 可以随时查看 seagull 日志,其路径在 conf 文件夹中的服务器/客户端描述文件中定义,以了解可能出现的问题。

  2. 中定义的任何命令<init>都只会运行一次。这意味着对于receive,第二次接收数据包将导致unrecognized xxx日志。例如,在示例中,如果接收到第二个 CER,则日志会显示received unrecognized CER。如果发生这种情况,我通常会重新启动 ksh 或将receiveCER 放入traffic.

  3. 场景按顺序运行。例如,如果一个场景是按顺序定义的receive CER send CEA receive DWR send DWA,没有进行中的 CER 的 DWR 将导致received unrecognized DWR. 这将是最常见的情况,当人们查找未从 seagul 服务器接收到 DWA 的原因时。

    顺便说一句,值得一提的是,除非 a sendorreceive在 中定义init,否则它会继续“乒乓”。

于 2018-04-06T09:17:48.890 回答
1

您可以尝试将同时通话设置为 1,这样您的客户将等到当前通话结束后再开始另一个通话。将此行添加到您的服务器和客户端配置中:

<define entity="traffic-param" name="max-simultaneous-calls" value="1"></define>

此属性的默认值为 100,所以这肯定是您的捕获显示不匹配的请求和答案的原因。

于 2017-06-13T04:19:24.280 回答