Skip to content

Issue decoding NAS messages with variant FORCEOMIT

Dear Support,

In the context of ETSI TTF project, we are facing issues to decode NAS messages using variants. Here is an example:

  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 "FORCEOMIT(iei)";
  }

We add the FORCEOMIT(iei) variant to instruct the TITAN codec to force iei as omitted. Unfortunately, here is the decoded message we got:

    ngNasKSI := {
        iei := '0'H,
        tsc := '1'B,
        nasKeySetId := '001'B
    }

The 'iei' field was decoded.

I attached a small project to highlight the issue. In this project, we have the same kind of issue with the NG_MobileIdentity data structure:

  type record NG_MobileIdentity {                              // 24.501 cl. 9.11.3.4
    IEI8_Type            iei                   optional, /* present in case of TLV; omit in case of LV */
    Type6Length_Type     iel,
    BcdDigit_Bit         idDigit1,                // 1st identitity digit
    B1_Type              oddEvenInd,              // Odd/even indicator or Spare
    NAS_IdType           typeOfId,                // Type of identity
    octetstring          otherDigits length (1..infinity) optional  // Other identity digits, could be any length @sic R5-192389, @sic R5w190307 sic@ sic@
  } with { 
    variant "FIELDORDER(msb),FORCEOMIT(iei)";
    variant (iel) "LENGTHTO (idDigit1, oddEvenInd, typeOfId, otherDigits)";
  };

Here is the decoded NAS message using Wireshark:image.png

titan_5gnas_codec_issue.tbz2

Many thanks for your support,

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