Go-Diameter: how to determine data variable in NewAVP of TGPPUserLocationInfo to get desired value in Wireshark dump

904 views Asked by At

I would like to create diameter traffic simulation with Go-Diameter so that I get Wireshark dump with 3GPP-User-Location-Info value as shown in this screenshot

I already read documentation from Etsi TS 129 061, but I could not understand how to determine this variable in Go-Diameter so I will get the value that i mentioned before and the Geographic Location Type (130). Here is the sample snippet of my code

    m.NewAVP(avp.ServiceInformation, avp.Mbit, 10415, &diam.GroupedAVP{
    AVP: []*diam.AVP{
        diam.NewAVP(avp.PSInformation, avp.Mbit, 10415, &diam.GroupedAVP{
            AVP: []*diam.AVP{
                diam.NewAVP(avp.TGPPChargingID, avp.Mbit, 10415, cid),
                diam.NewAVP(avp.PDPType, avp.Mbit, 10415, datatype.Enumerated(0)),
                diam.NewAVP(avp.TGPPUserLocationInfo, avp.Mbit, 10415, datatype.OctetString("howToDetermineThisVar")),
            },
        }),
...
1

There are 1 answers

1
A.Y. Wicaksono On

separate value into two parts (TAI & ECGI) 8202f4808790 ---- 02f480003a0d21

ignore the first two digits, we start from '02..'

so we get value of TAI 02f4808790

based on Figure 8.21.4-1: TAI in TS 29.274 V8.11.0 (2011-12) enter image description here

MCC is 204 and MNC is f08. Consider 'f' is null, so MNC is 08.

The rest of the value, 8790, is TAC (Tracking Area Code) in hex format.

for ECGI, the value is 02f480003a0d21 we refer to this table enter image description here

where '02f480' is mcc-mnc, '0' as spare, and '03a0d21' is E-UTRAN Cell Identifier (ECI)

To get desired value as shown in Wireshark, we should use conversion from hexadecimal to text (utf-8) and use it as TGPPUserLocationInfo variable in Go-Diameter program. The conversion is performed in every two digits. For instance in the given example

82 02 f4 80 87 90 - 02 f4 80 00 3a 0d 21

we get variable

x82 c \xf4 \x80 \x87 \x90 - c \xf4 \x80 \x00 : \x0d !

prefix '\x' is for digits that cannot be converted into text

so the value of "howToDetermineThisVar" is "x82c\xf4\x80\x87\x90c\xf4\x80\x00:\x0d!"