SNMP service Windows7 in the message type GetResponse-PDU encodes byte 0xa2==10100010 . Where does this value come from? If I correctly understood rfc1157 page 30 should be 0x02==00000010 .

    1 answer 1

    The SNMP protocol, for data transfer, uses the X.690 standard. SNMP messages include protocol data units

      -- protocol data units PDUs ::= CHOICE { get-request GetRequest-PDU, get-next-request GetNextRequest-PDU, get-response GetResponse-PDU, set-request SetRequest-PDU, trap Trap-PDU } 

    Which should also be presented in X.690 standard. Thus, byte 0xa2 should be considered as a variable type identifier in the sense of the X.690 standard.

     0xa2 == 10 1 00010 

    This means that the variable has a class: Context-specific , type Constructed, and GetResponse tag .

    For example, the SNMPv1 package:

     0x30 0x28 //Начало последовательности включающей все сообщение 0x02 0x01 0x00 //Версия 0x04 0x04 0x74 0x65 0x73 0x74 //Строка comunity == "test" 0xa2 //идентификатор PDU-type 0x1d //длинна PDU-type 0x02 0x01 0x02 //Request ID 0x02 0x01 0x00 //error-status 0x02 0x01 0x00 //error-index 0x30 0x12 //Последовательность содержащая variable bindings 0x30 0x10 //Последовательность содержащая одну переменную 0x06 0x09 0x2b 0x06 0x01 0x02 0x01 0x19 0x02 0x02 0x00//OID 0x02 0x03 0x1f 0xfd 0xf8//Значение