A reopened lab announces nothing, so every cable looks silent #1467

Closed
opened 2026-11-12 03:19:40 +00:00 by jaylouisw · 0 comments
Owner
sw> show lldp neighbors            save the lab, reopen it, ask again
Neighbour  Local port  Port ID  Mgmt address     Neighbour  Local port  Port ID  Mgmt address
Router-r1  Fa0/1       Gi0/0    10.0.0.1         (none - no LLDP has been heard on any port)
PC-p1      Fa0/3       eth0     10.0.0.12

Cause

Neighbour rows are not stored state — they are announced. The board announces when a cable is plugged (refreshNeighbours(), the call the UI makes after addLink), and a load is that same event: every cable in the document is being added right now. Topology.fromJSON() marked nothing, so the simulator built on a reopened lab never announced, and every port claimed its far end had never been heard from with the cables all in place. That is the #1457 symptom — a list that blinded both ends of a cable — arriving by a different road.

What should be true

  1. Topology.fromJSON() marks the board it built (loadedFromDocument), and the Simulator constructor announces once for such a board: PoE budgets, LLDP to the far end, router advertisements — the same three things plugging a cable does.
  2. A reopened lab shows the same neighbour rows, port for port, as before the save — with nothing plugged and no ping sent, on both ends of a cable and across a trunk carrying one VLAN.
  3. A board built in code is untouched: still not marked, still announcing nothing until something asks it to.
  4. Save → load → save is byte-identical — the announcement touches the run's counters, and the document carries neither the announcement nor the neighbours.

Two things deliberately not invented: the MAC table is not restored (an entry is learned from a frame, so a reopened board holds exactly the table a live board holds after the same announcement, and a board that announced nothing holds none — the test asserts that equality, not a fixed list), and counters stay a fresh run (they belong to a run, not to a lab; the announcement is counted on the wire as #1457 settled).

Evidence

test/neighbours-on-load.test.js, 20 checks. Reverting engine/ fails 7.

Neighbours green: lldp 27, show-lldp 23, lldp-across-trunk 32, flows-survive-save-load 16, spec-survives-load 32, dhcp-leases-survive-save 32, state-payload-complete 16, examples-generated 21, counters-agreement 32, link-state 69, stp-port-state 31, poe 18, config-roundtrip 46, pon-splitter 33.

``` sw> show lldp neighbors save the lab, reopen it, ask again Neighbour Local port Port ID Mgmt address Neighbour Local port Port ID Mgmt address Router-r1 Fa0/1 Gi0/0 10.0.0.1 (none - no LLDP has been heard on any port) PC-p1 Fa0/3 eth0 10.0.0.12 ``` ### Cause Neighbour rows are not stored state — they are *announced*. The board announces when a cable is plugged (`refreshNeighbours()`, the call the UI makes after `addLink`), and a load is that same event: every cable in the document is being added right now. `Topology.fromJSON()` marked nothing, so the simulator built on a reopened lab never announced, and every port claimed its far end had never been heard from with the cables all in place. That is the #1457 symptom — a list that blinded both ends of a cable — arriving by a different road. ### What should be true 1. `Topology.fromJSON()` marks the board it built (`loadedFromDocument`), and the `Simulator` constructor announces **once** for such a board: PoE budgets, LLDP to the far end, router advertisements — the same three things plugging a cable does. 2. A reopened lab shows the same neighbour rows, port for port, as before the save — with nothing plugged and no ping sent, on both ends of a cable and across a trunk carrying one VLAN. 3. A board built in code is untouched: still not marked, still announcing nothing until something asks it to. 4. Save → load → save is **byte-identical** — the announcement touches the run's counters, and the document carries neither the announcement nor the neighbours. Two things deliberately not invented: the **MAC table is not restored** (an entry is learned from a frame, so a reopened board holds exactly the table a live board holds after the same announcement, and a board that announced nothing holds none — the test asserts that equality, not a fixed list), and **counters stay a fresh run** (they belong to a run, not to a lab; the announcement is counted on the wire as #1457 settled). ### Evidence `test/neighbours-on-load.test.js`, **20 checks**. Reverting `engine/` fails 7. Neighbours green: `lldp` 27, `show-lldp` 23, `lldp-across-trunk` 32, `flows-survive-save-load` 16, `spec-survives-load` 32, `dhcp-leases-survive-save` 32, `state-payload-complete` 16, `examples-generated` 21, `counters-agreement` 32, `link-state` 69, `stp-port-state` 31, `poe` 18, `config-roundtrip` 46, `pon-splitter` 33.
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#1467
No description provided.