Skip to content

Warning: While RAW-decoding type '@NG_NAS_TypeDefs.NG_REGISTRATION_REQUEST': Can not decode type '@NG_NAS_TypeDefs.NG_REGISTRATION_REQUEST', because invalid message was received

Dear Support,

The data structure NG_REGISTRATION_REQUEST is defined as:

  type record NG_REGISTRATION_REQUEST {                            /* 24.501 cl. 8.2.6
                                                                   Significance:  dual
                                                                   Direction:     UE to network */
    ExtdProtocolDiscriminator           protocolDiscriminator,                  /* cl. 9.2       M V 1   */
    SpareHalfOctet                      spareHalfOctet,                         /* cl. 9.5       M V 1/2 */
    SecurityHeaderType                  securityHeaderType,                     /* cl. 9.3       M V 1/2 */
    MessageType                         messageType,                            /* cl. 9.7       M V 1   */
    NAS_KeySetIdentifier                ngNasKSI,                               /* cl. 9.11.3.32 M V 1/2 */
    RegistrationType                    registrationType,                       /* cl. 9.11.3.7  M V 1/2 Dec18 */
    NG_MobileIdentity                   ngMobileId,                             /* cl. 9.11.3.4  M LV-E 6-n  */
    NAS_KeySetIdentifier                nonCurrentNativeKSI           optional, /* cl. 9.11.3.32 O TV 1 IEI=C- */
    NG_GMM_Cap                          gmmCapability                 optional, /* cl. 9.11.3.1  O TLV 3-15 IEI=10 */
    NG_UE_SecurityCapability            ueSecurityCapability          optional, /* cl. 9.11.3.54 O TLV 4-10 IEI=2E */
    NSSAI                               requestedNSSAI                optional, /* cl. 9.11.3.37 O TLV 4-74 IEI=2F */
    ...
  } with { 
    variant "FIELDORDER(msb)";
    variant (ngNasKSI) "FORCEOMIT(iei)";
    variant (ngMobileId) "FORCEOMIT(iei)";
  }

The structure NAS_KeySetIdentifier is used twice. The first used is a mandatory field so 'NAS_KeySetIdentifier.iei' field shall be omitted. The second use is optional, so 'NAS_KeySetIdentifier.iei' field shall be present.

The structure KeySetIdentifier is defined as follow

  type record NAS_KeySetIdentifier {                            /* 24.301 cl. 9.9.3.21 */
    IEI4_Type                   iei                   optional, /* present in case of TV; omit in case of V */
    B1_Type                     tsc,                            // Type of security context: 0 = cached, 1 = mapped
    NAS_KsiValue                nasKeySetId
  } with {
    variant "FIELDORDER(msb)";
    variant "PRESENCE (iei = 'B'H)";
  }

where IEI4_Type is defined as:

type hexstring HalfOctet_Type length(1) with { variant "FIELDLENGTH(1)" };

The issue is on variant "PRESENCE (iei = 'B'H)". If I comment it, the message is decoded in a wrong way because of the codec try to decode nonCurrentNativeKSI field which is not present. If I use it, I got the issue.

Please, can you indicate me if it is a wrong usage of PRESENCE of there is an issue on codec side?

I attached the project.

titan_5gnas_codec_issue.tbz2

Many thanks a lot for your support

Best regards,

Yann Garcia
Senior Software Engineer

Microsoft MCAD.net Certified
**************************************
FSCOM SARL
Le Montespan B2
6,  Avenue des Alpes 
F-06600 Antibes, FRANCE
************************************************
Tel: +33 (0)4 92 94 49 08 (GMT+1)
Mobile: +33 (0)6 68 94 57 76 (GMT+1)
Email: yann.garcia@fscom.fr

Skype: yann.garcia

SlackID: U0263576GG3, U02T8HUD2KX

LinkedIn: linkedin.com/in/yann-garcia-b145944