The state payload publishes bare MAC/ARP maps and no LLDP, while the console knows which entries are stale and why #1327

Closed
opened 2026-11-10 03:25:48 +00:00 by jaylouisw · 0 comments
Owner

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:

runtime[d].macTable = { "02:00:00:00:01:00": "1/1/1" }     <- no port state, no note
runtime[d].arp      = { "10.0.0.2": "02:00:00:00:02:00" }  <- no port, no reason, no age
runtime[d].lldp     = undefined                            <- not published at all

So a switch with one live entry and one entry whose port was shut gave a client the same two strings, and the
neighbours the device has heard from were not in the payload at all. Measured on a CX 6000 with two hosts:

console: 1  02:00:00:00:01:00  DYNAMIC  1/1/1 (administratively down)
payload: {"02:00:00:00:01:00": "1/1/1"}

This is the Routes-table fault (#1300) in a different table: the fact is computed in the console, not in the engine,
so every other surface is left to restate it — or, as here, to not have it.

What must be true instead

  • the note is written once, in the engine (Device.portCarrierNote()), from ifaceStatus() — the same rule the
    front panel and the console already use for a port's state;
  • Device.macRows(topo) / arpRows(topo) / lldpRows(topo) return the rows as data: VLAN, MAC, port, note;
    address, MAC, port, honest age; neighbour, port, port ID, management address;
  • the console prints those rows rather than building its own, so the two surfaces cannot drift;
  • fullState() publishes them as runtime[d].mac, runtime[d].arpRows, runtime[d].lldp — arrays, empty rather
    than absent, so a client does not have to test for existence;
  • the bare maps stay, because "which port" is a fair question to ask without reading rows.

One consequence worth recording: a link state change flushes what was learned on that port (#1256), so
(down: link down) is unreachable in the MAC table — the entry is gone, not stale. The test says so, so nobody
rediscovers it.

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**: ``` runtime[d].macTable = { "02:00:00:00:01:00": "1/1/1" } <- no port state, no note runtime[d].arp = { "10.0.0.2": "02:00:00:00:02:00" } <- no port, no reason, no age runtime[d].lldp = undefined <- not published at all ``` So a switch with one live entry and one entry whose port was shut gave a client the same two strings, and the neighbours the device has heard from were not in the payload at all. Measured on a CX 6000 with two hosts: ``` console: 1 02:00:00:00:01:00 DYNAMIC 1/1/1 (administratively down) payload: {"02:00:00:00:01:00": "1/1/1"} ``` This is the Routes-table fault (#1300) in a different table: the fact is computed in the console, not in the engine, so every other surface is left to restate it — or, as here, to not have it. ## What must be true instead * the note is written **once**, in the engine (`Device.portCarrierNote()`), from `ifaceStatus()` — the same rule the front panel and the console already use for a port's state; * `Device.macRows(topo)` / `arpRows(topo)` / `lldpRows(topo)` return the rows as data: VLAN, MAC, port, note; address, MAC, port, honest age; neighbour, port, port ID, management address; * the console prints those rows rather than building its own, so the two surfaces cannot drift; * `fullState()` publishes them as `runtime[d].mac`, `runtime[d].arpRows`, `runtime[d].lldp` — arrays, empty rather than absent, so a client does not have to test for existence; * the bare maps stay, because "which port" is a fair question to ask without reading rows. One consequence worth recording: a link state change flushes what was learned on that port (#1256), so `(down: link down)` is unreachable in the MAC table — the entry is gone, not stale. The test says so, so nobody rediscovers it.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
jaylouisw/packetforge#1327
No description provided.