A frame that died named the door that was shut #1438

Merged
jaylouisw merged 1 commit from fix/flood-refusal-reason into main 2026-11-11 23:22:02 +00:00
Owner

Closes #1437

A frame that left a switch by no port said one sentence whatever had refused it: no egress ports in VLAN <vid>. On a switch whose only other port the spanning tree had blocked, that is false twice — the port is in the VLAN, and the box already prints the truth in show spanning-tree:

s3> show spanning-tree                          s3> show interfaces
Fa0/1   alternate  blocking (traffic dropped)   Fa0/2 ... 1 drop (no egress ports in VLAN 1)

Two surfaces on one box, disagreeing about one frame. The counter is the one an operator acts on, so the VLAN gets re-checked and the VLAN was never the problem; it is also the sentence _lastDiscard() hands a failed ping.

The change

_forwardL2() already knew why each candidate was refused — it just threw the reason away. It now records it, and _noEgressReason() names the door that was shut:

refusal what the counter says now
the tree blocks it no egress ports: spanning tree blocks Fa0/1
the far member of the ingress port-channel no egress ports: the only other port is a member of the ingress port-channel
outside the VLAN no egress ports in VLAN 10 (kept — this was always true)

Where the reason sits in _lastDiscard() did not move. Naming the tree does not make it a different kind of cause: a block on a redundant path is not the reason a ping failed, so ranking it with the port causes (above silence and above policy) would have replaced one lie with another. The rank slot now matches both wordings (no egress ports) instead of only the VLAN one, so priority is byte-for-byte what it was.

Evidence

test/flood-refusal-reason.test.js, 24 checks:

  1. the premise — the box prints one port as alternate blocking;
  2. exactly one frame lost at the dead end, and the reason names the same port the tree table calls blocking;
  3. the reason no longer mentions a VLAN, and show interfaces carries it in the port's drop row;
  4. the payload's drops.byReason uses the same sentence as the console, counted once (not once per blocked candidate);
  5. a genuine VLAN refusal still says VLAN 10, with switchport: trunk beside it agreeing;
  6. the hairpin case names the port-channel;
  7. _lastDiscard() still prefers silence over it and still prefers it over policy — unchanged.

Reverting engine/simulator.js fails 11/24 (✗ the reason does not claim a VLAN problem, ✗ the payload counts the same sentence the console prints, ✗ the hairpin names the bundle, …).

Docs: docs/ARCHITECTURE.md § "A frame that died named the door that was shut".

Closes #1437 A frame that left a switch by no port said one sentence whatever had refused it: `no egress ports in VLAN <vid>`. On a switch whose only other port the spanning tree had blocked, that is false twice — the port *is* in the VLAN, and the box already prints the truth in `show spanning-tree`: ``` s3> show spanning-tree s3> show interfaces Fa0/1 alternate blocking (traffic dropped) Fa0/2 ... 1 drop (no egress ports in VLAN 1) ``` Two surfaces on one box, disagreeing about one frame. The counter is the one an operator acts on, so the VLAN gets re-checked and the VLAN was never the problem; it is also the sentence `_lastDiscard()` hands a failed `ping`. ### The change `_forwardL2()` already knew why each candidate was refused — it just threw the reason away. It now records it, and `_noEgressReason()` names the door that was shut: | refusal | what the counter says now | | --- | --- | | the tree blocks it | `no egress ports: spanning tree blocks Fa0/1` | | the far member of the ingress port-channel | `no egress ports: the only other port is a member of the ingress port-channel` | | outside the VLAN | `no egress ports in VLAN 10` (kept — this was always true) | Where the reason sits in `_lastDiscard()` did **not** move. Naming the tree does not make it a different kind of cause: a block on a redundant path is not the reason a `ping` failed, so ranking it with the port causes (above silence and above policy) would have replaced one lie with another. The rank slot now matches both wordings (`no egress ports`) instead of only the VLAN one, so priority is byte-for-byte what it was. ### Evidence `test/flood-refusal-reason.test.js`, **24 checks**: 1. the premise — the box prints one port as `alternate blocking`; 2. exactly one frame lost at the dead end, and the reason names the same port the tree table calls blocking; 3. the reason no longer mentions a VLAN, and `show interfaces` carries it in the port's drop row; 4. the payload's `drops.byReason` uses the same sentence as the console, counted once (not once per blocked candidate); 5. a genuine VLAN refusal still says `VLAN 10`, with `switchport: trunk` beside it agreeing; 6. the hairpin case names the port-channel; 7. `_lastDiscard()` still prefers silence over it and still prefers it over policy — unchanged. Reverting `engine/simulator.js` fails **11/24** (`✗ the reason does not claim a VLAN problem`, `✗ the payload counts the same sentence the console prints`, `✗ the hairpin names the bundle`, …). Docs: `docs/ARCHITECTURE.md` § *"A frame that died named the door that was shut"*.
A frame that died named the door that was shut (#1437)
All checks were successful
CI / Classify the change (pull_request) Successful in 12s
PR rebase / Rebase onto main and arm auto-merge (pull_request) Successful in 15s
CI / Test (Node 20) (pull_request) Successful in 2m55s
CI / Test (Node 18) (pull_request) Successful in 3m1s
CI / Server smoke test (pull_request) Successful in 34s
CI / Docker build (pull_request) Successful in 47s
CI / Test (Node 22) (pull_request) Successful in 2m52s
478fefc9bf
_forwardL2() filtered its flood candidates - blocked ports, ports outside
the VLAN, the ingress port-channel - and when nothing was left it emitted
one sentence whatever had refused: 'no egress ports in VLAN <vid>'.

On a switch whose only other port the spanning tree had blocked, that is
false twice. The port is in the VLAN, and the same box already prints
'Fa0/1 alternate blocking (traffic dropped)' in show spanning-tree while
show interfaces files the same frame as '1 drop (no egress ports in VLAN
1)'. The counter is the one an operator acts on, and the sentence is also
what _lastDiscard() hands to a failed ping.

Each refusal now names itself: 'no egress ports: spanning tree blocks
Fa0/1', '... the only other port is a member of the ingress port-channel',
and the VLAN wording where it was always true. The rank slot in
_lastDiscard() matches both wordings, so the priority did not move.

Evidence: test/flood-refusal-reason.test.js, 24 checks. Reverting
engine/simulator.js fails 11/24.
jaylouisw scheduled this pull request to auto merge when all checks succeed 2026-11-11 23:21:57 +00:00
Sign in to join this conversation.
No reviewers
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!1438
No description provided.