OBJECT IDENTIFIER

The encoding of object identifier consists of packed sequence of numbers expressing the arc labels. The packaging is important, as it is expected, that object identifiers are carried frequently. Furthermore, as with the tag in multiple octet identifier, it is not necessary for receiver to recognize arc labels at run time, only to be able to compare them.

Let's have a following ASN.1 definition:

Then it is encoded into

How it is achieverd? The first two numbers, say m and n are combined into single number using formula 40m + n. This saves one octet from every value exploiting the fact, that n is a small number.

The next number, 6, was taken unmodified. But 247 is unable to encode in a single octet. That's why, it is divided into two of them, marking in the most significant bit by 1, that the number 'continues' in the next octet until MSB = 0 is reached. It is the same rule as used by multi-octet tags in identifier field.