Skip to content

SNMP_Embedded v3.4.0 — Zero-Copy Packet Path, Exact-Pricing Pool, +64% Free Heap

Choose a tag to compare

@syntax1269 syntax1269 released this 07 Sep 03:33
· 6 commits to main since this release

SNMP_Embedded v3.4.0 — the zero-copy release.

What changed

Inbound SNMP packets are now parsed in place over the UDP receive buffer —
no per-varbind container copies, no dotted-string renders on the hot path.
Responses are written directly into the outgoing UDP buffer, with a
measured response-size fit check: tooBig is answered only when genuinely
true. Handler dispatch matches the request's raw encoded-OID bytes, which are
exactly the bytes that define SNMP's sort order — walk semantics are exact.

The pool formula is now exactly priced: every slot is charged to a named,
source-verified consumer (request tick = 2·VB value containers; trap tick = the
16-slot minimal v2c trap tree; + an explicit 4-slot idle margin; + permanent
handlers). Queued informs hold zero pool slots — proven on hardware with the
inform queue saturated under flood.

Measured on hardware (ESP8266 ESP-01, standardized flood harness)

Metric v3.3.6 v3.4.0 Delta
Free heap at boot, 768-B profile 28.6 KB 35.7 KB +7.1 KB (+25%)
Free heap at boot, 1400-B profile 21.4 KB 35.0 KB +13.6 KB (+64%)
Pool size (13-handler profile) 57 / 79 slots 33 / 33 −42% / −58%
Sustained request throughput 2.35 ops/s 2.91–3.03 ops/s +24–28%
Flash (768-B profile) 307.4 KB 301.9 KB −5.4 KB
Pool alarms / crashes / reboots 0 0 parity
SET round-trip integrity 100% 100% parity

Validated per profile with 1-minute, 5-minute, and 15-minute flood soaks
(bulkwalk, wide-walk tooBig, GETNEXT, SET, sysDescr mix) plus an
inform-queue-saturation stress profile — zero pool alarms, zero crashes,
zero reboots across the entire campaign.

Compatibility

  • No API changes. Existing sketches compile and behave identically.
  • Wire behavior is byte-verified identical to v3.3.6 (2,125-assertion host
    suite, byte-for-byte response comparison across GET / GETNEXT / GETBULK /
    SET / error paths).
  • SNMPPacket::parseFrom() keeps its owning-container contract.
  • New opt-in flag SNMP_TRAP_VB_RESERVE for sketches that attach varbinds to
    traps (3 pool slots each). Escape hatch: SNMP_ZERO_COPY=0 restores the
    classic container path.

Upgrade

No sketch changes required. Users who size pools manually via
SNMP_POOL_ASN_OBJECTS overrides keep full control; everyone else gets the
tighter derived arena automatically.