snmp1Simple Network Management Protocol v11990s ColdStart Traps That Still Page the NOC at 3 AM (snmp1)
What It Does on the Wire
That 22-year-old UPS in the basement closet still only speaks RFC 1157 Trap-PDU. snmp1 encodes enterprise, agentip, gentrap 0..6, and BER varbind chains with zero MIB files.
Simple Network Management Protocol v1 (snmp1, RFC 1157) encodes ASN.1 BER version = 0 management PDUs (get, getnext, set, response on UDP 161) and legacy v1 Trap-PDU (0xa4 on UDP 162) carrying dedicated enterprise, agent-addr (agentip), generic-trap (gentrap 0..6), specific-trap (spectrap), and time-stamp (sysuptime) header fields.
FrameAssembly compiles valid ASN.1 BER lengths, base-128 variable-length OID sub-identifiers (40 * arc1 + arc2), and repeatable typed varbind sequences completely offline—zero external MIB files or Net-SNMP libraries required.
Legacy UPS, PDU & Printer Enterprise Trap Receiver Testing
Generate RFC 1157 Trap-PDU (gentrap 6 enterpriseSpecific + spectrap) packets to test Checkmk Event Console, Zabbix snmptrapd, and Logstash trap translators.
Default "public" / "private" Community String IDS Rules
Synthesize snmp1 get and snmp1 set packets with community "public" or "private" to validate SOC/Suricata cleartext SNMPv1 alert detections.
Dual-Stack RFC 3584 SNMPv1-over-IPv6 Coexistence
Run snmp1 trap across IPv6 endpoints—FrameAssembly automatically encodes 0.0.0.0 in the IPv4-only agent-addr BER field per RFC 3584 unless overridden with agentip.
Minimal Quickstart (snmp1_quickstart.frasm)
Hit Preview Packets to compile in-browser and eyeball timestamps + wire byte lengths, or ship it straight to the Playground.
host ups_01 { ip 10.10.50.12 }host nms_rx { ip 10.10.50.100 }compile { ups_01 -> nms_rx snmp1 trap community "public" enterprise 1.3.6.1.4.1.318 gentrap 6 spectrap 5 sysuptime 120500 varbind 1.3.6.1.2.1.1.5.0 string "ups-dc1-row4"}What the Compiler Calculates So You Don't Have To
- Selects UDP
dstport 162automatically fortrap(the default PDU) and UDP161(with161 -> ephemeralport reversal on<- response) forget,getnext,set, andresponse. - Encodes dotted numeric OIDs (
1.3.6.1.4.1.318or.1.3.6.1...) into compact ASN.1 BER base-128 VLQ octets (0x2b 0x06 0x01 ...) and computes nested SEQUENCE lengths. - Supports repeatable
varbind <oid> <type_val>entries acrossstring,int,oidval,ipval,counter32,gauge32,timeticks,counter64, andnull.
SNMPv1 System MIB Poll (sysDescr.0 / sysName.0) + ColdStart & Enterprise Traps
Polls sysDescr.0 on UDP 161, returns a multi-varbind response, and emits both a standard gentrap 0 (coldStart) and an enterpriseSpecific (gentrap 6) hardware alarm trap on UDP 162.
host poller { ip 172.16.40.10 }host legacy_sw { ip 172.16.40.25 }compile { // 1. Poll sysDescr.0 (1.3.6.1.2.1.1.1.0) on UDP 161 poller -> legacy_sw snmp1 get community "ops-ro" reqid 1001 oid 1.3.6.1.2.1.1.1.0 wait 2ms poller <- legacy_sw snmp1 response community "ops-ro" reqid 1001 varbind 1.3.6.1.2.1.1.1.0 string "Managed L2 Switch v4.2" varbind 1.3.6.1.2.1.1.3.0 timeticks 8640000 wait 5ms // 2. Generic coldStart trap (gentrap 0, spectrap 0) on UDP 162 legacy_sw -> poller snmp1 trap community "ops-ro" enterprise 1.3.6.1.4.1.9.1.516 agentip 172.16.40.25 gentrap 0 spectrap 0 sysuptime 120 wait 2ms // 3. Enterprise-specific PSU fault trap (gentrap 6, spectrap 42) with typed varbinds legacy_sw -> poller snmp1 trap community "ops-ro" enterprise 1.3.6.1.4.1.9.9.13 gentrap 6 spectrap 42 sysuptime 45000 varbind 1.3.6.1.2.1.1.5.0 string "sw-idf-03" varbind 1.3.6.1.4.1.9.9.13.1.5.1.3.1 int 4}# 1. Eyeball relative timestamps, ports & wire lengths in your terminal
frameassembly show snmp1_poll_and_traps.frasm
# 2. Compile .frasm -> classic .pcap (tcpdump/tcpreplay/Suricata) or nanosecond .pcapng
frameassembly snmp1_poll_and_traps.frasm snmp1_poll_and_traps.pcap
frameassembly snmp1_poll_and_traps.frasm snmp1_poll_and_traps.pcapng
# 3. Round-trip .pcap <-> .frasm whenever you want to scrub or tweak an existing capture
frameassembly reverse snmp1_poll_and_traps.pcap snmp1_poll_and_traps_edited.frasmAll snmp1 Keywords & Header Options
Every sub-keyword and header option is lowercase [a-z0-9]+ with zero underscores — mix and match them in any order after snmp1:
src_host -> dst_host snmp1 [trap | get | getnext | set | response] [community "<text>"] [enterprise <oid>] [agentip <ipv4>] [gentrap <0..6>] [spectrap <number>] [sysuptime <number>] [reqid <number>] [oid <oid>] [varbind <oid> <type_val> ...]| Keyword / Option | Accepted Value | Default | Effect on Packet |
|---|---|---|---|
| trap | get | getnext | set | response | SNMPv1 PDU type keyword | trap (PDU 0xa4 on UDP 162) | Selects ASN.1 BER PDU context tag (0xa0 GetRequest, 0xa1 GetNextRequest, 0xa2 GetResponse, 0xa3 SetRequest, 0xa4 v1 Trap). |
| community "<text>" | Double-quoted OCTET STRING | "public" | Sets the cleartext SNMPv1 community string. |
| enterprise <oid> | Dotted numeric OID (>= 2 arcs) | 1.3.6.1.4.1.8072.3.2.10 | Sets the enterprise OBJECT IDENTIFIER inside SNMPv1 trap PDUs. |
| agentip <ipv4> | IPv4 dotted-quad literal | Source IPv4 (or 0.0.0.0 on IPv6) | Sets the 4-byte NetworkAddress (agent-addr) inside SNMPv1 trap PDUs. |
| gentrap <0..6> | spectrap <number> | gentrap: 0..6, spectrap: u32 | gentrap 6, spectrap 1 | Sets generic-trap (0=coldStart, 1=warmStart, 2=linkDown, 3=linkUp, 4=authFailure, 5=egpNeighborLoss, 6=enterpriseSpecific) and specific-trap. |
| sysuptime <number> | reqid <number> | Whole number | sysuptime 1000, reqid 1 | Sets time-stamp (TimeTicks hundredths of a second) on trap or request-id on get/getnext/set/response. |
| oid <oid> | Dotted numeric OID | 1.3.6.1.2.1.1.1.0 | Shorthand that appends a NULL-valued varbind (<oid> = NULL) for get / getnext requests. |
| varbind <oid> <type_val> | Repeatable: string "<s >" | int <number> | oidval <oid> | ipval <ipv4> | counter32 <number> | gauge32 <number> | timeticks <number> | counter64 <number> | null | Omitted | Appends an ASN.1 BER VarBind (OID, SMI-value) pair to the VarBindList SEQUENCE. |
Cross-Layer Wrappers Valid with snmp1
802.1Q VLAN / QinQ / MPLS tags, IPv4/IPv6 QoS & TTL fields, wait gaps, and transport overrides allowed on this protocol
10 options
Cross-Layer Wrappers Valid with snmp1
802.1Q VLAN / QinQ / MPLS tags, IPv4/IPv6 QoS & TTL fields, wait gaps, and transport overrides allowed on this protocol
| Option | Range / Format | Default | Effect on Packet |
|---|---|---|---|
| wait <number><ns|us|ms|s|m> | Time gap (ns, us, ms, s, m) | 10ms | Advances the packet timestamp clock after sending this packet and before the next packet (wait 0ns sends back-to-back). |
| payload "<text>" | hexpayload "<hex>" | Quoted text or hex bytes (choose one) | Omitted | Appends or overrides raw payload bytes ("deadbeef" or "de:ad:be:ef") and updates packet lengths and checksums. |
| srcmac <mac> | dstmac <mac> | Colon, hyphen, or Cisco dot MAC | Host MAC / RFC multicast MAC | Overrides the 14-byte Ethernet II source or destination MAC address for this single packet. |
| vlan <0..4095> [pcp <0..7>] [dei <0|1>] | VLAN ID 0..4095, PCP 0..7, DEI 0..1 | Untagged | Wraps the packet in an IEEE 802.1Q VLAN tag (0x8100) with optional 802.1p QoS priority. |
| qinq <0..4095> [innervlan <0..4095>] | Outer S-VLAN 0..4095, Inner C-VLAN 0..4095 | Untagged (innervlan 1 when qinq is set) | Double-tags the packet with outer IEEE 802.1ad S-Tag (0x88a8) plus inner IEEE 802.1Q C-Tag (0x8100). |
| mpls <0..1048575> [exp|tc <0..7>] [bos <0|1>] [mplsttl <0..255>] | Label 0..1048575, exp/tc 0..7, bos 0..1, ttl 0..255 | Unlabeled (at most 1 mpls tag per packet) | Inserts a 32-bit MPLS label header (0x8847) ahead of the Layer 3 header. |
| ttl <0..255> [dscp <0..63>] [ecn <0..3>] | TTL/Hop Limit 0..255, DSCP 0..63, ECN 0..3 | ttl 64, dscp 0, ecn 0 | Sets IPv4 TTL or IPv6 Hop Limit plus DiffServ (DSCP) and ECN QoS markings. |
| ipid <0..65535> [df] [mf] [fragoffset <0..8191>] | IPv4 ID, DF/MF flags, fragment offset 0..8191 | ipid 1, flags 0, fragoffset 0 | Sets IPv4 Identification, Do-Not-Fragment (df), More-Fragments (mf), and fragment offset (ignored over IPv6). |
| flowlabel <0..1048575> | 20-bit IPv6 Flow Label (0..1048575) | 0 | Sets the 20-bit IPv6 Flow Label for ECMP routing tests (ignored when running over IPv4 hosts). |
| srcport <0..65535> | dstport <0..65535> | Port number 0..65535 | srcport 49152 (remembered), UDP 162 (trap) / UDP 161 (get/set) | Overrides source or destination port and remembers the port pair automatically on <- replies. |
Gotchas & Quick Fixes
Always Spell Out varbind <oid> string "<val>" (Never str)
ups_01 -> nms_rx snmp1 trap varbind 1.3.6.1.2.1.1.5.0 str "ups-01"ups_01 -> nms_rx snmp1 trap varbind 1.3.6.1.2.1.1.5.0 string "ups-01"The SMI OCTET STRING varbind type keyword in FrameAssembly v3.1.2 is strictly string (never str).
getbulk and inform Require snmp2 or snmp3
poller -> legacy_sw snmp1 getbulk maxrepetitions 10 oid 1.3.6.1.2.1.2.2.1poller -> legacy_sw snmp2 getbulk maxrepetitions 10 oid 1.3.6.1.2.1.2.2.1RFC 1157 SNMPv1 predates GetBulkRequest (0xa5) and InformRequest (0xa6); switch the protocol keyword to snmp2 or snmp3 for bulk table walks.