Diameter agent connection

319 views
Skip to first unread message

Razhan Hameed

unread,
Sep 10, 2018, 3:59:19 AM9/10/18
to CGRateS
Hey Dan,

I am getting this message from the diameter client

2018/09/10 02:12:29 CGRateS <bc52098> [INFO] <DiameterAgent> Loading dictionary out of file /usr/share/cgrates/diameter/dict/huawei/base.xml
2018/09/10 02:12:29 CGRateS <bc52098> [INFO] <DiameterAgent> Loading dictionary out of file /usr/share/cgrates/diameter/dict/huawei/huawei.xml
2018/09/10 02:12:29 CGRateS <bc52098> [INFO] <DiameterAgent> Loading dictionary out of file /usr/share/cgrates/diameter/dict/huawei/nasreq.xml
2018/09/10 02:12:29 CGRateS <bc52098> [INFO] <DiameterAgent> Loading dictionary out of file /usr/share/cgrates/diameter/dict/huawei/nokia.xml
2018/09/10 02:12:29 CGRateS <bc52098> [INFO] <DiameterAgent> Loading dictionary out of file /usr/share/cgrates/diameter/dict/huawei/vodafone.xml
2018/09/10 02:12:34 CGRateS <bc52098> [ERROR] <DiameterAgent> StateMachine error: diameter error on 192.168.40.1:28473: Could not find preloaded Command with code 65536
2018/09/10 02:12:44 CGRateS <bc52098> [ERROR] <DiameterAgent> StateMachine error: diameter error on 192.168.40.1:22084: Could not find preloaded Command with code 65536

that IP address is the IP of the diameter client after an unsuccessful connection it retries with a different port which is a normal thing for client to do while trying to connect to a server.

I also captured the packets with tcpdump which I will include the pcap file with the post
what I am getting from the CER is that the diameter client tells me three supported vendors and some other vendor-specific applications.
One of the supported vendors in the AVP is threegpp which by default cgrates  have the dictionary for, the 3gpp.xml I mean,

But when cgrates answers the diameter client the AVP in the CEA have the value of "DIAMETER_NO_COMMON_APPLICATION" 

Frame 6: 194 bytes on wire (1552 bits), 194 bytes captured (1552 bits)
Ethernet II, Src: Vmware_b0:6c:27 (00:50:56:b0:6c:27), Dst: Cisco_39:07:9f (84:78:ac:39:07:9f)
Internet Protocol Version 4, Src: 192.168.40.2, Dst: 192.168.40.1
Transmission Control Protocol, Src Port: 3868, Dst Port: 27700, Seq: 1, Ack: 309, Len: 140
Diameter Protocol
   
Version: 0x01
   
Length: 140
   
Flags: 0x20, Error
   
Command Code: 257 Capabilities-Exchange
   
ApplicationId: Diameter Common Messages (0)
   
Hop-by-Hop Identifier: 0x09d9c1cd
   
End-to-End Identifier: 0x09d9c1cd
   
[Request In: 4]
   
[Response Time: 0.000155000 seconds]
    AVP
: Result-Code(268) l=12 f=-M- val=DIAMETER_NO_COMMON_APPLICATION (5010)
    AVP
: Origin-Host(264) l=24 f=-M- val=CGR.IQONLINE.COM
    AVP
: Origin-Realm(296) l=27 f=-M- val=nasreq.iqonline.com
    AVP
: Host-IP-Address(257) l=14 f=-M- val=192.168.40.2
    AVP
: Vendor-Id(266) l=12 f=-M- val=0
    AVP
: Product-Name(269) l=15 f=--- val=CGRateS
    AVP
: Firmware-Revision(267) l=12 f=--- val=918


is it a problem of not having a dictionary that matches the client standard? if so how do we solve it? 
and let's say I was not able to find the dictionary how can one get the messages from the diameter client  and create a dictionary based on those messages
a "walk through" for the last question is very appreciated.
 

new.pcap
cgrates.json

DanB

unread,
Sep 12, 2018, 2:38:16 PM9/12/18
to cgr...@googlegroups.com
Hey Razhan,

Sorry for delay, had quite some work to catch up with.

Please find answers inline ...

On Mon, 2018-09-10 at 00:59 -0700, Razhan Hameed wrote:
> Hey Dan,
>
> I am getting this message from the diameter client
>
> 2018/09/10 02:12:29 CGRateS <bc52098> [INFO] <DiameterAgent> Loading
> dictionary out of file
> /usr/share/cgrates/diameter/dict/huawei/base.xml
> 2018/09/10 02:12:29 CGRateS <bc52098> [INFO] <DiameterAgent> Loading
> dictionary out of file
> /usr/share/cgrates/diameter/dict/huawei/huawei.xml
> 2018/09/10 02:12:29 CGRateS <bc52098> [INFO] <DiameterAgent> Loading
> dictionary out of file
> /usr/share/cgrates/diameter/dict/huawei/nasreq.xml
> 2018/09/10 02:12:29 CGRateS <bc52098> [INFO] <DiameterAgent> Loading
> dictionary out of file
> /usr/share/cgrates/diameter/dict/huawei/nokia.xml
> 2018/09/10 02:12:29 CGRateS <bc52098> [INFO] <DiameterAgent> Loading
> dictionary out of file
> /usr/share/cgrates/diameter/dict/huawei/vodafone.xml
> 2018/09/10 02:12:34 CGRateS <bc52098> [ERROR] <DiameterAgent>
> StateMachine error: diameter error on 192.168.40.1:28473: Could not
> find preloaded Command with code 65536
> 2018/09/10 02:12:44 CGRateS <bc52098> [ERROR] <DiameterAgent>
> StateMachine error: diameter error on 192.168.40.1:22084: Could not
> find preloaded Command with code 65536
You should make sure you have the command in your dictionaries. You
have failed loading some dictionary with your requested command 65536.
>
> that IP address is the IP of the diameter client after an
> unsuccessful connection it retries with a different port which is a
> normal thing for client to do while trying to connect to a server.
Yes, on unsupported command, most probably the server will send
disconnect to your client.

> I also captured the packets with tcpdump which I will include the
> pcap file with the post
> what I am getting from the CER is that the diameter client tells me
> three supported vendors and some other vendor-specific applications.
> One of the supported vendors in the AVP is threegpp which by default
> cgrates have the dictionary for, the 3gpp.xml I mean,
Supported vendor is not enough, we should have at least Vendor-
Specific-Application-Id requested by CER and found in CEA.
>
> But when cgrates answers the diameter client the AVP in the CEA have
> the value of "DIAMETER_NO_COMMON_APPLICATION"
I would check again the dictionaries since if the server complains it
really means it could not find it.
You need to have at least one application supported by both client and
CGRateS in order for CER/CEA to complete. If no intersect is found, you
get the error with the DIAMETER_NO_COMMON_APPLICATION.

> and let's say I was not able to find the dictionary how can one get
> the messages from the diameter client and create a dictionary based
> on those messages
Before anything, make sure you have at least one application in common
(via your extra dictionaries or the default one hardcoded in the
library we use - you can find them here:

https://github.com/fiorix/go-diameter/blob/master/diam/dict/default.go#L19
)
> a "walk through" for the last question is very appreciated.

Let me know if the explanation was clear enough or you need any
additional info.

Thanks,
DanB
>

Razhan Hameed

unread,
Sep 13, 2018, 2:49:35 AM9/13/18
to CGRateS
Thanks for the answer,
But I have one application in common which is the  3gpp one,
but you say supported vendor is not enough so I need at least one vendor specific application
this is one of the vendor specific application Ids in the CER

AVP: Vendor-Specific-Application-Id(260) l=32 f=-M-
    AVP Code: 260 Vendor-Specific-Application-Id
    AVP Flags: 0x40, Mandatory: Set
    AVP Length: 32
    Vendor-Specific-Application-Id: 0000010a4000000c000028af000001024000000c00000001
        AVP: Vendor-Id(266) l=12 f=-M- val=10415
        AVP: Auth-Application-Id(258) l=12 f=-M- val=NASREQ Application (1)
            AVP Code: 258 Auth-Application-Id
            AVP Flags: 0x40, Mandatory: Set
            AVP Length: 12
            Auth-Application-Id: NASREQ Application (1)


I guess my last question was also about how to create a dictionary for those fields in the CER
where do I put the value of this line in the dictionary?
Vendor-Specific-Application-Id: 0000010a4000000c000028af000001024000000c00000001

and finally, I believe the go-diameter library have their own way to format the dictionary, they have few extra tags like <diamater> at the beginning of the file,
can you explain how to convert a typical dictionary to a dictionary that go-diameter understands?

thanks again

DanB

unread,
Sep 14, 2018, 6:53:55 AM9/14/18
to cgr...@googlegroups.com
Hey Razhan,

Please find answers inline ...

On Wed, 2018-09-12 at 23:49 -0700, Razhan Hameed wrote:
> Thanks for the answer,
> But I have one application in common which is the 3gpp one,
> but you say supported vendor is not enough so I need at least one
> vendor specific application
> this is one of the vendor specific application Ids in the CER
>
> AVP: Vendor-Specific-Application-Id(260) l=32 f=-M-
> AVP Code: 260 Vendor-Specific-Application-Id
> AVP Flags: 0x40, Mandatory: Set
> AVP Length: 32
> Vendor-Specific-Application-Id:
> 0000010a4000000c000028af000001024000000c00000001
> AVP: Vendor-Id(266) l=12 f=-M- val=10415
> AVP: Auth-Application-Id(258) l=12 f=-M- val=NASREQ
> Application (1)
> AVP Code: 258 Auth-Application-Id
> AVP Flags: 0x40, Mandatory: Set
> AVP Length: 12
> Auth-Application-Id: NASREQ Application (1)
>
I think there must be something in the dictionaries you have loaded
within CGRateS (maybe an error or something else) since if I start with
the default ones provided in data/diameter sources I can pass CER/CEA
just fine (please find attached a simulation I did using your packet).
Would need to do some debugs I guess on your side once you are ready
with your setup.

> I guess my last question was also about how to create a dictionary
> for those fields in the CER
> where do I put the value of this line in the dictionary?
> Vendor-Specific-Application-Id:
> 0000010a4000000c000028af000001024000000c00000001
This is encoded version of the application Id. You need to add the
applications in the same way they are defined in our samples, ie here:

https://github.com/cgrates/cgrates/blob/master/data/diameter/dict/huawei/3gpp_vendor.xml#L3

>
> and finally, I believe the go-diameter library have their own way to
> format the dictionary, they have few extra tags like <diamater> at
> the beginning of the file,
> can you explain how to convert a typical dictionary to a dictionary
> that go-diameter understands?
I would use a text editor and modify the ones you have to be in the
same format as CGRateS expects them (again based on the sample I have
exemplified).

Fingers crossed ;).

DanB
>
> thanks again
>
> --
> You received this message because you are subscribed to the Google
> Groups "CGRateS" group.
> To unsubscribe from this group and stop receiving emails from it,
> send an email to cgrates+u...@googlegroups.com.
> To post to this group, send email to cgr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/cgrates/07371ee9-b88b-4126-ac5e-180137506ad4%40googlegroups.com
> .
> For more options, visit https://groups.google.com/d/optout.
diam.pcap

Razhan Hameed

unread,
Sep 16, 2018, 8:33:36 AM9/16/18
to CGRateS
That is what I wanna reach, how did you do that simulation? and put the id in the CEA?
and please explain how to do the troubleshooting.

DanB

unread,
Sep 16, 2018, 3:25:54 PM9/16/18
to cgr...@googlegroups.com
Hey Razhan,

Please see answers inline ...

On Sun, 2018-09-16 at 05:33 -0700, Razhan Hameed wrote:
> That is what I wanna reach, how did you do that simulation? and put
> the id in the CEA?
For the simulation I have done the following:
* Disabled the CER generation in GoDiameter, so I can generate in my
own packets (need to hack the sources for that).
* Started diameter server with sample config:
cgr-engine -config_dir=/usr/share/cgrates/conf/samples/dmtagent
* Grabbed the CGRateS sources and enable the test in
agents/dmtagent_it_test.go (TestDmtAgentConnectDiameterClientCER)
* Run the integration test generating the packet out of agents folder:
go test -tags=integration -run=TestDmtAgentConnectDiameterClientCER

The CEA was automatically generated based on common application found
with the CER.

> and please explain how to do the troubleshooting.

I will contact you tomorrow morning for live troubleshooting.

DanB


Razhan Hameed

unread,
Sep 18, 2018, 9:05:17 AM9/18/18
to CGRateS
Thanks dan the problem was from the client side, it sent vendor specific application id in field name of "Auth-Application-Id" but containing accounting information.
Thanks to you its all good now.


Reply all
Reply to author
Forward
0 new messages