What the tables say, once: MAC, ARP and LLDP rows come from the engine (#1327) #1328
No reviewers
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
jaylouisw/packetforge!1328
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/runtime-rows"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What the tables say, once: MAC, ARP and LLDP rows come from the engine.
Fixes #1327.
The runtime half of the state payload, after the config half (#1321, #1323, #1325). The console has printed honest
MAC, ARP and LLDP tables since #1253–#1255 — which port an entry was learned on, and whether that port can still carry
a frame — while the payload the browser reads published the raw maps:
Measured on a CX 6000 with two hosts, one port shut:
Same fault class as the Routes table (#1300): the fact is computed in the console, so every other surface is left to
restate it — or, as here, to not have it.
Fixes
Device.portCarrierNote(port, topo, extra)— the note, written once, fromifaceStatus(), the same rule thefront panel and console already use. The CLI's
_staleNotedelegates to it.Device.macRows(topo)/arpRows(topo)/lldpRows(topo)return the rows as data, sorted, so two callers neverdisagree.
show mac address-table,show arp,show lldpprint those rows instead of building their own — console output isbyte-identical after the change.
fullState()publishesruntime[d].mac,runtime[d].arpRows,runtime[d].lldpas arrays, empty rather thanabsent. The bare maps stay: "which port" is a fair question to ask without reading rows.
Evidence
test/runtime-agreement.test.js— 10 checks over a situation matrix (nothing wrong, port administratively down,far end shut down, port moved to another VLAN, port made a trunk that does not carry VLAN 1). For each, the engine's
row and the console's line must carry the same port and the same sentence — not a similar one — and the same fact
must appear in
show arpandshow lldp. Plus: a row carries its VLAN; an ARP row carries an honest age; a rowpointing at a port that is not on the device says
(gone); rows come back sorted; over HTTP every device hasmac/arpRows/lldparrays agreeing with the bare map's size.Recorded in the test so nobody rediscovers it:
link downis absent from the matrix because a link state changeflushes what was learned on that port (#1256) — the entry is gone, not stale.
With
server/index.jsandengine/device.jsreverted the suite cannot run at all:x.sw.macRows is not a function.docs/ARCHITECTURE.md: "What the tables say".Suite: 179 suites, 7,053 assertions, 0 failed.