A new feature added in our recent ASN1C v6.6 release is the capability to encode/decode 3GPP layer 3 messages such as those used in the Non-Access Stratum layer. In conjunction with this release, we have added a new web service that allows analysis and testing of messages of this type.  This service is available at the following URL:

http://www.obj-sys.com/nas_decoder.php

The service allows for entering or pasting hexadecimal text that describes a binary message to be decoded.  There are a few rules that need to be followed on the format of this text:

  • It must contain an even number of characters with 2 hexadecimal character per octet
  • The characters that make up each octet may be space separated or contiguous; however, use of comma as a separator is currently not allowed
  • The hexadecimal octets may not be preceded by a '0x' prefix

Once entered, the service will attempt to decode the message and present the results in the text box below.  Two formats are presented:

  1. A bit trace showing the actual bit patterns that make up the individual fields, and
  2. The decoded data in a brace text format

The bit trace display shows a message slice up to 32-bits across and the relative position of the message field within.  For example:

PDU.l3HdrOpts.skipInd INTEGER
bit offset: 0   bit count: 4    next bit offset: 4
0000---- -------- -------- --------    --------    ----
PDU.protoDiscr ENUMERATED
bit offset: 4   bit count: 4    next bit offset: 8
----0101 -------- -------- --------    05------    .---
PDU.msgType INTEGER
bit offset: 8   bit count: 8    next bit offset: 16
-------- 00010100 -------- --------    --14----    -.--

In this display, the hyphens (-'s) are placeholders that show unused space within the 32-bit slice.  The 1's and 0's show the actual bit pattern of the field.  x's may also be present to denote "don't care" fields which correspond to spare or padding bits.  In addition to bit patterns, the display also shows the field name, associated ASN.1 type, and bit offset and count values.

Decoded data is shown in a brace text display as follows:

PDU {
   l3HdrOpts {
      skipInd = 0
   }
   protoDiscr = mobMgmt
   msgType = 20
   data {
      obj_AuthenticationResponse {
         respParam = 0xabfb454c
      }
   }
}

The service accepts messages defined in 3GPP TS 24.008 (Core Network Protocols), TS 24.011 (Point-to-point Short Message Service), and TS 24.301 (LTE NAS Protocol).

We encourage developers to try it out and welcome feedback as to whether the decoding results are as expected or not.


Published

Category

Web Tools

Tags