snmptlvsmspdu

TLV encoding and Decoding


I'm new to TLV encoding format. Could someone please provide some pointers for how to encode and decode SNMP PDU's in TLV. I have a requirement to decode the TLV encoded smspdu and I'm really lost where to start.


Solution

  • SNMP uses ASN.1 BER to encode/decode PDUs,

    http://en.wikipedia.org/wiki/Type-length-value

    http://en.wikipedia.org/wiki/Basic_Encoding_Rules#BER_encoding

    Thus, to learn the algorithm you can refer to Wikipedia. That can get you started.

    SNMP has its own tags too for basic types, which you can find from related books and articles. But nothing is more reliable than source code of famous open source projects in this area, such as Net-SNMP