| Lower layer | Selector | Value |
udp | dst_port / src_port | 161 (0x00a1) |
udp | dst_port / src_port | 162 (0x00a2) |
| Field | Type | Default | Auto | Description |
msg_tag | uint(8) | 48 | | BER tag octet (0x30 SEQUENCE, 0x02 INTEGER, 0x04 OCTET STRING). |
msg_length | uint(8) | | Length of the header and payload in octets (-2) | BER length of the SNMP message SEQUENCE (Auto; short form, below 128). |
version_tag | uint(8) | 2 | | BER tag octet (0x30 SEQUENCE, 0x02 INTEGER, 0x04 OCTET STRING). |
version_length | uint(8) | 1 | | BER length of the version INTEGER (1). |
version | enum(8) | 1 (v2c) | | SNMP version (0 = v1, 1 = v2c). |
community_tag | uint(8) | 4 | | BER tag octet (0x30 SEQUENCE, 0x02 INTEGER, 0x04 OCTET STRING). |
community_length | uint(8) | 6 | | BER length of the community string, in octets. |
community | bytes — community_length octets | 70 75 62 6c 69 63 | | Community string (e.g. “public”). |
| Value | Name |
| 0 (0x00) | v1 |
| 1 (0x01) | v2c |
The next layer is selected by version; when the field is Auto the builder writes the value of the protocol stacked above.
| Value | Protocol | Note |
| (any other value) | snmp_pdu | |
| Level | Rule |
| warning | msg_tag = 48 |
| warning | header and payload at most 129 octets |