A config change does not move the clock, two fields answer "when did the board change", and show link state prints an instant as a duration #1331

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

Time in PacketForge is logical — runAtMs (the instant a question is asked at), link.stateSinceMs (when a cable
changed) and topo.lastChangeAtMs (when the board changed, the base of every convergence schedule). Three faults,
all measured:

1. A configuration change does not move the clock

topo.markChange() is called from exactly one place: setLinkState(). Shutting a port, enabling it, or moving it
between VLANs changes what the control plane must do — STP runs its timers again on every port behind it — and none
of them move the clock:

triangle of three CX 6000s, run time 40000
  before:                                  pending processes 0   (settled - correct)
  interface 1/1/1 -> shutdown, at 40000:    pending processes 0   (wrong: it must re-converge)
  lastChangeAtMs:                          0

So a ping crosses a port that should be listening, and _stillConverging() — the honest reason a packet went nowhere
— has nothing to say.

2. Two answers to "when did the board change"

Simulator.getConvergence() prefers this.reconvergeFromMs over topo.lastChangeAtMs. Nothing in the engine or the
server ever sets reconvergeFromMs — except setLinkState, which set both. Two fields for one instant is how a
schedule gets built from the wrong one, and one of them is dead:

topo.lastChangeAtMs = 7000   -> schedule from 7000
reconvergeFromMs = 100       -> schedule from 100   (lastChangeAtMs still 7000)

3. An instant wearing a duration's clothes, and an instant out of a dead run

run time 5000, cable went down at 1200
  console:  state: down since 1200 ms        <- reads as "1200 ms ago"; it was 3800 ms ago
saved board: doc.lastChangeAtMs = 9000
  reloaded tomorrow: schedule built from 9000, an instant in a session that had ended

lastChangeAtMs is run bookkeeping, like a MAC table: a run ends, and a reopened board inheriting an instant from a
dead one builds its schedule from evidence that no longer means anything. The cable's own stateSinceMs is board
state — that cable is down, and it went down at 9000 ms — and it must survive (#1323).

What must be true instead

  • every console command that changes the forwarding decision records the instant the operator is standing at
    (Simulator.markTopologyChange()), so the control plane re-converges from now;
  • one answer for the instant — topo.markChange — with the shadow field gone;
  • the console prints an instant as an instant, with the age when a run instant is known:
    state: down, changed at 1200 ms (3800 ms ago), and (not this run) when the instant is later than the run;
  • lastChangeAtMs is not written to the file; a reloaded board derives it from the newest cable fault it carries.
Time in PacketForge is logical — `runAtMs` (the instant a question is asked at), `link.stateSinceMs` (when a cable changed) and `topo.lastChangeAtMs` (when the board changed, the base of every convergence schedule). Three faults, all measured: ## 1. A configuration change does not move the clock `topo.markChange()` is called from exactly one place: `setLinkState()`. Shutting a port, enabling it, or moving it between VLANs changes what the control plane must do — STP runs its timers again on every port behind it — and none of them move the clock: ``` triangle of three CX 6000s, run time 40000 before: pending processes 0 (settled - correct) interface 1/1/1 -> shutdown, at 40000: pending processes 0 (wrong: it must re-converge) lastChangeAtMs: 0 ``` So a ping crosses a port that should be listening, and `_stillConverging()` — the honest reason a packet went nowhere — has nothing to say. ## 2. Two answers to "when did the board change" `Simulator.getConvergence()` prefers `this.reconvergeFromMs` over `topo.lastChangeAtMs`. Nothing in the engine or the server ever sets `reconvergeFromMs` — except `setLinkState`, which set both. Two fields for one instant is how a schedule gets built from the wrong one, and one of them is dead: ``` topo.lastChangeAtMs = 7000 -> schedule from 7000 reconvergeFromMs = 100 -> schedule from 100 (lastChangeAtMs still 7000) ``` ## 3. An instant wearing a duration's clothes, and an instant out of a dead run ``` run time 5000, cable went down at 1200 console: state: down since 1200 ms <- reads as "1200 ms ago"; it was 3800 ms ago saved board: doc.lastChangeAtMs = 9000 reloaded tomorrow: schedule built from 9000, an instant in a session that had ended ``` `lastChangeAtMs` is run bookkeeping, like a MAC table: a run ends, and a reopened board inheriting an instant from a dead one builds its schedule from evidence that no longer means anything. The cable's own `stateSinceMs` **is** board state — that cable is down, and it went down at 9000 ms — and it must survive (#1323). ## What must be true instead * every console command that changes the forwarding decision records the instant the operator is standing at (`Simulator.markTopologyChange()`), so the control plane re-converges from *now*; * one answer for the instant — `topo.markChange` — with the shadow field gone; * the console prints an instant as an instant, with the age when a run instant is known: `state: down, changed at 1200 ms (3800 ms ago)`, and `(not this run)` when the instant is later than the run; * `lastChangeAtMs` is not written to the file; a reloaded board derives it from the newest cable fault it carries.
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#1331
No description provided.