A blocked port was painted green #1442
No reviewers
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
jaylouisw/packetforge!1442
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/stp-port-state"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #1441
A port the tree blocks cannot carry a frame, and the board painted it green while
show spanning-treesaid the frames were dropped.portState()inweb/faceplate.jsis the single rule the faceplate cell, the canvas tooltip and the inspector footer all ask (#1238). It knew about a shut port, an unplugged socket, a link-down cable and a shut peer — and nothing about the tree. The payload did not carry the tree either, so no view could have known.The change
The tree is published per bridge and per physical port, from the same computation the console reads:
runtime[id].stp)portState(facts)upblocked→blocking (traffic dropped)stp: null, not an empty treeThree decisions worth keeping:
blockedis its own state, notdown. A redundant lab blocks ports by design; painting 22 ports red on a healthy triangle reports a working tree as a broken board — the trapnotconnectavoids for empty sockets. Amber is the panel's "look here" colour; red stays for alarms.stpVerdict()answersundefinedfor a box or port the payload never mentioned andportState()treats that as "nothing to say", so an older payload leaves a view exactly as it was.A blocked physical port may be a member of a bundle the tree shut, so the payload marks every physical member (the ports the board draws) rather than the logical port name. The tree is also recomputed for the instant being read, for the same reason
show spanning-treedoes (#1335): a value left behind by a request at another instant describes a network that no longer exists.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 own verdicts,undefinedchanges nothing, and the canvas and the inspector both route through the shared rule (checked statically, so neither can drift back to askingenabledalone).Reverts: the payload change and the rule change each break the file outright; the two call sites failing back to the old code fails 4/31.
Docs:
docs/ARCHITECTURE.md§ "A blocked port was painted green".Three switches in a triangle, and the tree shuts one port to keep the loop out. The console said so: Port Role State Fa0/1 root forwarding Fa0/2 alternate blocking (traffic dropped) The board drew Fa0/2 exactly like Fa0/1: green, patched, healthy. portState() in web/faceplate.js - the one rule the faceplate cell, the canvas tooltip and the inspector footer all ask - knew about a shut port, an unplugged socket, a link-down cable and a shut peer, and nothing about the tree. The payload did not carry the tree either, so no view could have known. The tree is now published per bridge and per physical port (state, role, blocked, and the console's sentence), and portState() takes it as one more fact. Three decisions: * blocked is its own state, not down - a redundant lab blocks ports by design, so it gets amber and red stays for alarms; * the other facts keep their verdicts: a shut port is still administratively down, an unplugged socket still not connected, a shut peer still wins; * an unknown tree is not a forwarding tree - stpVerdict() answers undefined for a box or port the payload never mentioned. Evidence: test/stp-port-state.test.js, 31 checks. Suite 221 suites, 8258 assertions, 0 failed.