HewlettPackard / PacketRusher

High performance 5G UE/gNB Simulator and CP/UP load tester.
Apache License 2.0
100 stars 21 forks source link

[BUG] Three-digit MNCs are encoded incorrectly #84

Closed rjaksa closed 4 months ago

rjaksa commented 4 months ago

When configuring a 3-digit MNC in the config.yml, PacketRusher does not encode it correctly.

configuration in config.yml

gnodeb: controlif: ip: "xx.yy.zz.ww" port: 9487 dataif: ip: "xx.yy.zz.uu" port: 2152 plmnlist: mcc: "789" mnc: "123" ...

encoding in the NGSetupRequest message


> NG Application Protocol (NGSetupRequest)
>     NGAP-PDU: initiatingMessage (0)
>         initiatingMessage
>             procedureCode: id-NGSetup (21)
>             criticality: reject (0)
>             value
>                 NGSetupRequest
>                     protocolIEs: 4 items
>                         Item 0: id-GlobalRANNodeID
>                             ProtocolIE-Field
>                                 id: id-GlobalRANNodeID (27)
>                                 criticality: reject (0)
>                                 value
>                                     GlobalRANNodeID: globalGNB-ID (0)
>                                         globalGNB-ID
>                                             pLMNIdentity: 873921
>                                                 Mobile Country Code (MCC): Unassigned (789)
>                                                 Mobile Network Code (MNC): Unknown (312)
>                                             gNB-ID: gNB-ID (0)
>                                                 gNB-ID: 0f423d [bit length 24, 0000 1111  0100 0010  0011 1101 decimal value 999997]
>                         Item 1: id-RANNodeName
>                             ProtocolIE-Field
>                                 id: id-RANNodeName (82)
>                                 criticality: ignore (1)
>                                 value
>                                     RANNodeName: PacketRusher

You can see in the NGSetupRequest message that the MNC incorrectly becomes "312" instead of "123".
linouxis9 commented 4 months ago

Hi @rjaksa,

Thank you for opening this bug. I'll take a look and fix it!

Thanks a lot, Valentin