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

BER length Encoding

2 views
Skip to first unread message

Praki

unread,
Jan 22, 2009, 5:50:34 AM1/22/09
to
Greetings All,

In the last few days i am studying the SNMP packets. I read about the
BER encoding. I have few doubts in that encoding plz i need you
peoples help.

Length Encoding:

I read many documents from the internet and i was trying out with some
snoops of snmp packets. I saw the length of the packet was given in
four formats.

Format 1. 30 27
This is direct value in hex.

Format 2. 30 81 dc
This is means that next byte also represents the length of the
packet. In this i tried to calculate the real length like ( (0x1 *
128) + 0xdc) is this correct ?

Format 3. 30 82 03 e0 how should i calculate the real length for this
type.

Format 4.30 82 00 43 . After checking in some document i got the
length as 0x43. How can i conclude that 43 as the length when Format 3
is also exits.

Then In the Representing the OID

1.3.6.1.2.1.10.166.3.2.8.1.4.93631.3

In this OID there two number more than 127.

166 and 93631

below is the encoded value of the above OID:

2b 06 01 02 01 0a 81 26 03 02 08 01 04 85 db 3f 03

i could correctly intercept for 166 and i could not for 93631
166 = 81 26=( (0x1*128) + 0x26)=166
93631 = 85 db 3f 03 = ? is this correct or something missing here.

Is both the calculation for length integer and OID is same ?

Thanks in Advance

Prakash

0 new messages