Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Can someone help me verify this?

1 view
Skip to first unread message

ginseng

unread,
Sep 2, 2001, 2:22:17 PM9/2/01
to
I'm having trouble finding info on oid encoding, when a oid field spreads
into more than one octet.

By checking the pattern, I found the preceding octets are shifted left by
one and change bit 8 to one.

dper...@snmpinfo.com

unread,
Sep 2, 2001, 8:27:43 PM9/2/01
to
HI,

The encodings for ASN.1 values using the basic encoding rules are
specified in both CCITT (now ITU-T) X.209 and ISO 8825 (the 1987 versions).
This is specified in both RFC 1157 and RFC 1905.

The text from X.209 is below. (Note that in the description below,
bit 8 is the high order bit in an octet and bit 1 is the low order
bit).

22 Encoding of an object identifier value
22.1 The encoding of an object identifier value shall be primitive.
22.2 The contents octets shall be an (ordered) list of encoding of
subidentifiers (see 22.3 and 22.4) concatenated together.
Each subidentifier is represented as a series of (one or
more) octets. Bit 8 of each octet indicates whether it is the last in
the series: bit 8 of the last octet is zero; bit 8 of each preceding
octet is one. Bits 7-1 of the octets in the series collectively encoded
the subidentifier. Conceptually, these groups of bits are concatenated
to form an unsigned binary number whose most significant bit is bit 7
of the first octet and whose least significant bit is bit 1 of the
last octet. The subidentifier shall be encoded in the fewest possible
octets, that is, the leading octet of the subidentifier shall not have
the value 80 (hexadecimal).
22.3 The number of subidentifiers (N) shall be one less than the number
of object identifier components in the object identifier value being
encoded.
22.4 The numerical value of the first subidentifier is derived from the
values of the first two object identifier components in the object
identifier value being encoded, using the formula
(X * 40) + Y
where X is the value of the first object identifier component and Y is
the value of the second object identifier component.
Note - This packing of the first two object identifier components
recognises that only three values are allocated from the root node, and
at most 39 subsequent values from nodes reached by X = 0 and X = 1.

22.5 The numerical value of the i'th subidentifier, (2 * i * N) is that
of the (i + 1)'th object identifier component.
Example - An OBJECT IDENTIFIER value of
{joint-iso-ccitt 100 3}
which is the same as
{2 100 3}
has a first subidentifier of 180 and a second subidentifier of 3. The
resulting encoding is

OBJECT IDENTIFIER Length Contents
06(hex) 03(hex) 813403(hex)


Regards,
/david t. perkins

0 new messages