Skip to content

Issue decoding NAS messages with variant LENGTHTO

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 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)";
    variant (iel) "LENGTHTO(idDigit1, oddEvenInd, typeOfId, otherDigits)";
  };

The iel field is decoded in reverse order (value shall be '000D'O):

Here is the issue: .iel := '0D00'O with '000D'O

The iel field is declared as:

type octetstring              O2_Type         length(2) with { variant "FIELDLENGTH(2)" };

I tried to use NAS_EPS_Types.ttcn as a model to set my variants but I still facing to the issue.

I have attached a small project file to highlight the issue.

Many thanks 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

titan_5gnas_codec_issue.tbz2