gpt4 book ai didi

linux - 海鸥直径中的客户端和服务器如何同步工作?

转载 作者:塔克拉玛干 更新时间:2023-11-02 23:46:16 24 4
gpt4 key购买 nike

我在seagull diameter工作,这是我的seagull server和seagull client的场景

客户端服务器

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

但是结果: enter image description here所以它不符合我的场景,请帮助我如何配置服务器和客户端可以同步的内容?

这是客户端场景

<?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>

最佳答案

E2E和H2H对于发送请求的主机来说必须是唯一的(answer包含相同的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>

有两个action前后command这将在 send SAR 之前和之后运行.现在这些术语相同,这会导致“损坏”并且难以从包捕获中读取/识别,我相信这就是它们的顺序困惑的原因。这是我使用 SEAGULL 的经验:

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

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

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

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

关于linux - 海鸥直径中的客户端和服务器如何同步工作?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44448959/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com