A Guide to Defining GSM/GPRS/UMTS/LTE Messages in TSN.1


Many of the GSM/GPRS/UMTS/LTE messages are defined using the tabular format with some of the information elements encoding specified in CSN.1. Since TSN.1 is a flexible bit-level notation, it is fairly straightforward to define these messages in TSN.1. We will use the GPRS ATTACH REQUEST message as an example for this guide, but the process is similar for other messages.

The picture below illustrates how the ATTACH REQUEST message is defined in the standard:

ATTACH REQUEST

Let's start from the beginning. The first octet of a GPRS Mobility Management message contains two fields: the skip indicator and the protocol discriminator. Each field is half octet long (4-bit), with the skip indicator occupying the most siginficant bits (bit 5-8). The second octet contains the message type. In TSN.1, the header fields are defined as simple bit fields.

ts24008_AttachRequest() ::=
{
 /*--------------------------------------------------------------
   Field name             Size(Bits)    Default value
   --------------------------------------------------------------*/
   SkipIndicator          4           = 0x0; // 0000
   ProtocolDiscriminator  4           = 0x8; // 1000
   MessageType            8           = 0x1; // 00000001

   // ...
}

All three fields have pre-set values as specified in the standard. These values are specified as default values for the bit fields in TSN.1. After the header fields come the imperative part of the message, or the mandatory fields.

ts24008_AttachRequest() ::=
{
 /*--------------------------------------------------------------
   Field name             Size(Bits)    Default value
   --------------------------------------------------------------*/
   SkipIndicator          4           = 0x0; // 0000
   ProtocolDiscriminator  4           = 0x8; // 1000
   MessageType            8           = 0x1; // 00000001

 /*--------------------------------------------------------------
   Field name                 Type
   --------------------------------------------------------------*/
   MSNetworkCapability      : ts24008_ie_MSNetworkCapability;
   CipheringKeySequence     : ts24008_ie_CipheringKeySequence;
   AttachType               : ts24008_ie_AttachType;
   DRXParameter             : ts24008_ie_DRXParameter;
   PTMSIorIMSI              : ts24008_ie_MobileIdentity;
   OldRoutingAreaId         : ts24008_ie_RoutingAreaId;
   MSRadioAccessCapability  : ts24008_ie_MSRadioAccessCapability;

  // ...
}

Let's use the first mandatory field, MS network capability, as an example. In the above definition, "MSNetworkCapability" is the name of the field. The colon after the field name indicates that this field is of another type, in this case, "ts24008_ie_MSNetworkCapability", which we will define next.

As indicated in the "Format" column of the original table, the MS network capability field is encoded using the "LV" format, with the value part of the IE specified in CSN.1:

MS network capability

Here is the TSN.1 definition for the same IE:

ts24008_ie_MSNetworkCapability() ::=
{
 /*--------------------------------------------------------------
   Field name  Size(Bits)
   --------------------------------------------------------------*/
   Length      8;
   Value       Length * 8  :
   {
    /*--------------------------------------------------------------
      Field name                           Size(Bits)
      --------------------------------------------------------------*/
      GEA1                                 1;
      SMCapabilitiesViaDedicatedChannels   1;
      SMCapabilitiesViaGPRSChannels        1;
      UCS2Support                          1;
      SSScreeningIndicator                 2;
      SoLSACapability                      1;
      RevisionLevelIndicator               1;
      PFCFeatureMode                       1;
      GEA2                                 1;
      GEA3                                 1;
      GEA4                                 1;
      GEA5                                 1;
      GEA6                                 1;
      GEA7                                 1;
      LCSVACapability                      1;

      optional REL_7 :
      {
         PSInterRATHOToUTRANluModeCapability  1;
      }
   }
}

The first octet of the information element is the length indicator. It is followed by the value part consisting of the CSN.1 defined bit fields. Note that we don't need to explicitly specify the spare bits at the end because the value part is constrained to "Length * 8" bits, which is always integer number of octets. The PSInterRATHOToUTRANluModeCapability is a REL-7 addition. It is put in an optional block for backward compatibility. It will be decoded only if there are enough bits in the Value part as indicated by the length indicator.

The other mandatory fields are defined similarly. We will give you the complete TSN.1 definition at the end, but now let's look at the non-imperative part of the message, or the optional fields.

The optional fields are a bit tricky not only because they are optional but also because they may appear in different order as well. To describe them in TSN.1, we use an unbounded array and the case of construct.

ts24008_AttachRequest() ::=
{
 /*--------------------------------------------------------------
   Field name             Size(Bits)    Default value
   --------------------------------------------------------------*/
   SkipIndicator          4           = 0x0; // 0000
   ProtocolDiscriminator  4           = 0x8; // 1000
   MessageType            8           = 0x1; // 00000001

 /*--------------------------------------------------------------
   Field name                 Type
   --------------------------------------------------------------*/
   MSNetworkCapability      : ts24008_ie_MSNetworkCapability;
   CipheringKeySequence     : ts24008_ie_CipheringKeySequence;
   AttachType               : ts24008_ie_AttachType;
   DRXParameter             : ts24008_ie_DRXParameter;
   PTMSIorIMSI              : ts24008_ie_MobileIdentity;
   OldRoutingAreaId         : ts24008_ie_RoutingAreaId;
   MSRadioAccessCapability  : ts24008_ie_MSRadioAccessCapability;

   OptionalIES[]  :
   {
      IEI_MSN  4; // IEI most significant nible

      if(IEI_MSN == 9) // TMSI Status
      {
         reserve   3;
         TMSIFlag  1;
      }
      else
      {
         IEI_LSN  4; // IEI least significant nible

         IE  : case (IEI_MSN << 4 | IEI_LSN)  of
         {
          /*--------------------------------------------------------------
            IEI     Field name             Type
            --------------------------------------------------------------*/
            0x19 => OldPTMSISignature    : ts24008_ie_PTMSISignature;
            0x17 => RequestedReadyTimer  : ts24008_ie_GPRSTimer;
            0x33 => PSLCSCapability      : ts24008_ie_PSLCSCapability;
               _ => UnknownIE            : ts24008_ie_UnknownIE;
         }
      }
   }
}

"OptionalIES" is the array that holds the optional fields. Note that an empty pair of brackets "[]" are used for the array, which means that the size of array is limited only by the number of bits available.

Each element of the array is an IE. For optional IE's, each IE starts with an octet containing the IEI. The IEI octet is divided in two nibbles and decoded separately: IEI_MSN and IEI_LSN. This is to handle type 1 IEs such as TMSIStatus. The value of the IEI determines which optional IE is present. This is expressed using the case of construct in TSN.1. For example, if IEI is 0x19, then the optional OldPTMSISignature IE is present in the message, and so on.

Here is the complete formulation of the ATTACH REQUEST message in TSN.1:

// Information elements used in the ATTACH REQUEST message
ts24008_ie_MSNetworkCapability() ::=
{
   Length  8;
   Value   Length * 8  :
   {
      GEA1                                 1;
      SMCapabilitiesViaDedicatedChannels   1;
      SMCapabilitiesViaGPRSChannels        1;
      UCS2Support                          1;
      SSScreeningIndicator                 2;
      SoLSACapability                      1;
      RevisionLevelIndicator               1;
      PFCFeatureMode                       1;
      GEA2                                 1;
      GEA3                                 1;
      GEA4                                 1;
      GEA5                                 1;
      GEA6                                 1;
      GEA7                                 1;
      LCSVACapability                      1;

      optional REL_7 :
      {
         PSInterRATHOToUTRANluModeCapability  1;
      }
   }
}

ts24008_ie_AttachType() ::=
{
   FollowOnRequest  1 enumerated
   {
      NO_FOLLOW_ON_REQUEST_PENDING,
      FOLLOW_ON_REQUEST_PENDING
   };

   TypeOfAttach  3 enumerated
   {
      GPRS_ATTACH (1),
      NOT_USED,
      COMBINED_GPRS_IMSI_ATTACH
   };
}

ts24008_ie_CipheringKeySequence() ::=
{
   reserve      1;
   KeySequence  3;
}

ts24008_ie_DRXParameter() ::=
{
   SplitPGCycleCode                     8;
   CNSpecificDRXCycleLenghtCoefficient  4;
   SplitOnCCCH                          1;
   NonDRXTimer                          3;
}


ts24008_ie_MobileIdentity() ::=
{
   Length                 8;
   MobileIdentityContent  Length * 8;
}

ts24008_ie_RoutingAreaId() ::=
{
   MCCDigit2     4;
   MCCDigit1     4;
   MNCDigit3     4;
   MCCDigit3     4;
   MNCDigit2     4;
   MNCDigit1     4;
   LAC           16;
   RAC           8;
}

ts24008_ie_MSRadioAccessCapability() ::=
{
   Length  8;

   Value   Length * 8  :
   {
      ValuePart :
      {
         AccessTechnologyType  4  enumerated
         {
            GSM_P,
            GSM_E,
            GSM_R,
            GSM_1800,
            GSM_1900,
            GSM_450,
            GSM_480,
            GSM_850,
            GSM_750,
            GSM_T_380,
            GSM_T_410,
            GSM_T_900,
            GSM_710,
            GSM_T_810,
            ADDITIONAL (0xF)
         };

         if(AccessTechnologyType != ADDITIONAL)
         {
            Length  7;

            Content  Length :
            {
               RFPowerCapability  3;

               A5BitsIndicator  1;

               if(A5BitsIndicator == 1)
               {
                  A5_1  1;
                  A5_2  1;
                  A5_3  1;
                  A5_4  1;
                  A5_5  1;
                  A5_6  1;
                  A5_7  1;
               }

               ES_IND  1;
               PS      1;
               VGCS    1;
               VBS     1;

               MultislotCapabilityIndicator  1;

               if(MultislotCapabilityIndicator == 1)
               {
                  HSCSDMultislotClassIndicator  1;

                  if(HSCSDMultislotClassIndicator == 1)
                  {
                     HSCSDMultislotClass  5;
                  }

                  GPRSMulitslotClassIndicator  1;

                  if(GPRSMulitslotClassIndicator == 1)
                  {
                     GPRSMulitslotClass                       5;
                     GPRSExtendedDynamicAllocationCapability  1;
                  }

                  SMS_VALUEIndicator  1;

                  if(SMS_VALUEIndicator == 1)
                  {
                     SMS_VALUE  4;
                     SM_VALUE   4;
                  }

                  optional R99 :
                  {
                     ECSDMultislotClassIndicator  1;

                     if(ECSDMultislotClassIndicator == 1)
                     {
                        ECSDMultislotClass  5;
                     }

                     EGPRSMultislotClassIndicator  1;

                     if(EGPRSMultislotClassIndicator == 1)
                     {
                        EGPRSMultislotClass                       5;
                        EGPRSExtendedDynamicAllocationCapability  1;
                     }

                     DTMGPRSMultislotClassIndicator  1;

                     if(DTMGPRSMultislotClassIndicator == 1)
                     {
                        DTMGPRSMultislotClass  2;
                        SingleSlotDTM          1;

                        DTMEGPRSMultiSlotClassIndicator  1;

                        if(DTMEGPRSMultiSlotClassIndicator  == 1)
                        {
                           DTMEGPRSMultiSlotClass  2;
                        }
                     }
                  }

                  _8PSKPowerCapabilityIndicator  1;

                  if(_8PSKPowerCapabilityIndicator == 1)
                  {
                     _8PSKPowerCapability  2;
                  }

                  COMPACTInterferenceMeasurementCapability       1;
                  RevisionLevelIndicator                         1;
                  UMTSFDDRadioAccessTechnologyCapability         1;
                  UMTS384MCPSTDDRadioAccessTechnologyCapability  1;
                  CDMA2000RadioAccessTechnologyCapability        1;
               }

               optional REL_4 :
               {
                  UMTS128MCPSTDDRadioAccessTechnologyCapability  1;
                  GERANFeaturePackage                            1;

                  ExtendedDTMMultiSlotClassIndicator  1;

                  if(ExtendedDTMMultiSlotClassIndicator == 1)
                  {
                     ExtendedDTMGPRSMultiSlotClassIndicator   2;
                     ExtendedDTMEGPRSMultiSlotClassIndicator  2;
                  }

                  ModulationBasedMultiSlotClassSupport  1;
               }

               optional REL_5 :
               {
                  HighMultislotCapabilityIndicator  1;

                  if(HighMultislotCapabilityIndicator == 1)
                  {
                     HighMultislotCapability  2;
                  }

                  GERANIuModeCapabilityIndicator  1;

                  if(GERANIuModeCapabilityIndicator == 1)
                  {
                     GERANIuModeCapabilityLength  4;

                     GERANIuModeCapability  GERANIuModeCapabilityLength;
                  }

                  GMSKMultislotPowerProfile   2;
                  _8PSKMultislotPowerProfile  2;
               }

               optional REL_6 :
               {
                  MultipleTBFCapability                                1;
                  DownlinkAdvancedReceiverPerformance                  2;
                  ExtendedRLC_MACControlMessageSegmentationCapability  1;
                  DTMEnhancementsCapability                            1;

                  DTMGPRSHighMultiSlotClassIndicator  1;

                  if(DTMGPRSHighMultiSlotClassIndicator == 1)
                  {
                     DTMGPRSHighMultiSlotClass  3;

                     DTMEGPRSHighMultiSlotClassIndicator  1;

                     if(DTMEGPRSHighMultiSlotClassIndicator == 1)
                     {
                        DTMEGPRSHighMultiSlotClass  3;
                     }
                  }

                  PSHandoverCapability  1;
               }

               optional REL_7 :
               {
                  DTMHandoverCapability  1;

                  MultislotCapabilityReductionForDonwlinkDualCarrierInd  1;

                  if(MultislotCapabilityReductionForDonwlinkDualCarrierInd == 1)
                  {
                     MultislotCapabilityReductionForDonwlinkDualCarrier  3;
                     DownlinkDualCarrierForDTMCapability                 1;
                  }

                  FlexibleTimeslotAssignment  1;
                  GAN_PSHandoverCapability    1;
                  RLCNonPersistentMode        1;
                  ReducedLatencyCapability    1;
                  UplinkEGPRS2                2;
                  DownlinkEGPRS2              2;
               }
            }
         }
         else
         {
            Length  7;

            AdditionalAccessTechnologies  Length :
            {
               Technology  :
               {
                  NextIndicator 1;

                  if(NextIndicator == 1)
                  {
                     AccessTechnologyType  4;
                     GMSKPowerClass        3;
                     _8PSKPowerClass       2;

                     NextTechnology  : Technology;
                  }
               }
            }
         }

         NextValueIndicator  1;

         if(NextValueIndicator == 1)
         {
            NextValue  : ValuePart;
         }
      }
   }
}

ts24008_ie_PTMSISignature() ::=
{
   Signature  24;
}

ts24008_ie_GPRSTimer() ::=
{
   Unit   3 enumerated
   {
      TWO_SECOND,
      MINUTE,
      DECIHOURS,
      DEACTIVATED (7)
   };

   Value  5;
}

ts24008_ie_PSLCSCapability() ::=
{
   Length  8;

   Value  Length * 8 :
   {
      reserve   2;
      APC       1;
      OTD_A     1;
      OTD_B     1;
      GPS_A     1;
      GPS_B     1;
      GPS_C     1;
   }
}

ts24008_ie_UnknownIE() ::=
{
   Length   8;
   Content  Length * 8;
}

ts24008_AttachRequest() ::=
{
   SkipIndicator          4           = 0x0; // 0000
   ProtocolDiscriminator  4           = 0x8; // 1000
   MessageType            8           = 0x1; // 00000001

   MSNetworkCapability      : ts24008_ie_MSNetworkCapability;
   CipheringKeySequence     : ts24008_ie_CipheringKeySequence;
   AttachType               : ts24008_ie_AttachType;
   DRXParameter             : ts24008_ie_DRXParameter;
   PTMSIorIMSI              : ts24008_ie_MobileIdentity;
   OldRoutingAreaId         : ts24008_ie_RoutingAreaId;
   MSRadioAccessCapability  : ts24008_ie_MSRadioAccessCapability;

   OptionalIES[]  :
   {
      IEI_MSN  4; // IEI most significant nible

      if(IEI_MSN == 9) // TMSI Status
      {
         reserve   3;
         TMSIFlag  1;
      }
      else
      {
         IEI_LSN  4; // IEI least significant nible

         IE  : case (IEI_MSN << 4 | IEI_LSN)  of
         {
            0x19 => OldPTMSISignature    : ts24008_ie_PTMSISignature;
            0x17 => RequestedReadyTimer  : ts24008_ie_GPRSTimer;
            0x33 => PSLCSCapability      : ts24008_ie_PSLCSCapability;
               _ => UnknownIE            : ts24008_ie_UnknownIE;
         }
      }
   }
}