A port the spanning tree blocks is drawn on the board as a healthy port #1441

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

A port the spanning tree blocks is drawn on the board exactly like a port that is forwarding, while show spanning-tree says the frames are being dropped.

Measured on three switches cabled in a triangle (s1–s2, s2–s3, s3–s1):

s1> show spanning-tree
Spanning tree enabled protocol ieee
  Bridge priority 32768, root bridge s2 priority 32768
Port          Role          State
Fa0/1         root          forwarding
Fa0/2         alternate     blocking   (traffic dropped)      <- frames into this port go nowhere

The canvas, the device panel and the inspector footer all draw Fa0/2 exactly like Fa0/1: patched, up, green. The one rule all three views ask — portState() in web/faceplate.js — knows about a shut port, an unplugged socket, a link-down cable and a shut peer, and nothing about the tree. The state payload (GET /api/topologies/:id) does not carry the tree either, so no view could have known.

An operator watching the canvas while traffic dies therefore has one screen saying the port is fine and another saying the frames are being thrown away — the same class of bug #1238 fixed for an unplugged port, with a different cause.

What should be true

  1. the state payload publishes, per bridge and per physical port, what the tree decided: state, role, blocked, and the sentence the console prints;
  2. portState() takes that as one more fact and reports blocking (traffic dropped) — the console's words, not a second vocabulary;
  3. a blocked port is not painted as a fault: a redundant lab blocks ports by design, so it must not use the alarm colour that a shut port uses (the trap notconnect already avoids for empty sockets);
  4. the existing facts keep their own verdicts: a shut port is still administratively down, an unplugged socket still not connected, a shut peer still shutting the link — the tree must not overrule any of them;
  5. a payload that says nothing about a box or a port yields undefined, not blocked: false, so an older payload cannot make a view invent a verdict;
  6. a box that is not a bridge publishes no tree at all, rather than an empty one that reads as "nothing is blocked";
  7. the canvas and the inspector both route through the shared rule, so neither can drift back to asking enabled alone.

Evidence: test/stp-port-state.test.js, 31 checks — the payload names the single blocked port of a triangle and its role, the console row and the payload sentence match word for word, a router publishes no tree, all four fact combinations keep their verdicts, undefined changes nothing, and the two call sites are checked statically. Reverting the payload or the rule breaks the file outright; reverting the two call sites fails 4.

A port the spanning tree blocks is drawn on the board exactly like a port that is forwarding, while `show spanning-tree` says the frames are being dropped. Measured on three switches cabled in a triangle (`s1–s2`, `s2–s3`, `s3–s1`): ``` s1> show spanning-tree Spanning tree enabled protocol ieee Bridge priority 32768, root bridge s2 priority 32768 Port Role State Fa0/1 root forwarding Fa0/2 alternate blocking (traffic dropped) <- frames into this port go nowhere ``` The canvas, the device panel and the inspector footer all draw `Fa0/2` exactly like `Fa0/1`: patched, up, green. The one rule all three views ask — `portState()` in `web/faceplate.js` — knows about a shut port, an unplugged socket, a link-down cable and a shut peer, and nothing about the tree. The state payload (`GET /api/topologies/:id`) does not carry the tree either, so no view *could* have known. An operator watching the canvas while traffic dies therefore has one screen saying the port is fine and another saying the frames are being thrown away — the same class of bug #1238 fixed for an unplugged port, with a different cause. ### What should be true 1. the state payload publishes, per bridge and per physical port, what the tree decided: `state`, `role`, `blocked`, and the sentence the console prints; 2. `portState()` takes that as one more fact and reports `blocking (traffic dropped)` — the console's words, not a second vocabulary; 3. a blocked port is **not** painted as a fault: a redundant lab blocks ports by design, so it must not use the alarm colour that a shut port uses (the trap `notconnect` already avoids for empty sockets); 4. the existing facts keep their own verdicts: a shut port is still administratively down, an unplugged socket still not connected, a shut peer still shutting the link — the tree must not overrule any of them; 5. a payload that says nothing about a box or a port yields `undefined`, not `blocked: false`, so an older payload cannot make a view invent a verdict; 6. a box that is not a bridge publishes no tree at all, rather than an empty one that reads as "nothing is blocked"; 7. the canvas and the inspector both route through the shared rule, so neither can drift back to asking `enabled` alone. Evidence: `test/stp-port-state.test.js`, 31 checks — the payload names the single blocked port of a triangle and its role, the console row and the payload sentence match word for word, a router publishes no tree, all four fact combinations keep their verdicts, `undefined` changes nothing, and the two call sites are checked statically. Reverting the payload or the rule breaks the file outright; reverting the two call sites fails 4.
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#1441
No description provided.