Ateş Göral
Ateş Göral

Reputation: 140032

The reason for tagging of a non-OPTIONAL field in ASN.1

Looking at an ASN.1 module for 3GPP MAP (http://www.3gpp.org/ftp/specs/archive/29_series/29.002/ASN.1/), I'm confused about the use of the [0] tag for the first field (imsi). Since it's not an OPTIONAL field, and its type is also known (OCTET STRING) what would be the purpose of the tag here?

sendAuthenticationInfo OPERATION  ::=  {
   ARGUMENT     SEQUENCE {
      imsi                                  [0] IMPLICIT OCTET STRING ( SIZE( 3 .. 8 ) ),
      numberOfRequestedVectors              INTEGER ( 1 .. 5 ),
      segmentationProhibited                NULL OPTIONAL,
      immediateResponsePreferred            [1] IMPLICIT NULL OPTIONAL,

-- etc. --

One thing to note is that the imsi field is not directly interpreted as an octet string, but it holds the digits of an IMSI in semi-octet encoding (like BCD). Could that be the reason the field is tagged?

Upvotes: 0

Views: 377

Answers (1)

Paul Thorpe
Paul Thorpe

Reputation: 2060

In this particular case, the 3GPP MAP protocol specifies that BER is the encoding rule to be used, which means that tags are included in the encodings. This means that while it is not strictly necessary in this case to change the default octet string tag for a non-optional field in this context since there is no ambiguity, it is likely done for documentation purposes, indicating that the contents of this field is not just an octet string.

Upvotes: 1

Related Questions