The spanning-tree bridge priority is honoured by the engine and unreachable from the console #1364

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

The spanning tree has honoured a bridge priority since STP was modelled, and nothing in the product could set it.

Simulator.computeStp() builds each bridge as:

priority: (dev.config && dev.config.stpPriority) || stpLib.STP_DEFAULT_PRIORITY,

config.stpPriority has no writer anywhere: no catalogue spec sets it, no CLI command sets it,
Device.serialize() did not carry it. So every switch in every lab ran 32768, the root was decided by MAC
address alone, and the first thing anyone does to a switched network — nominate the root — could not be done.
show spanning-tree did not print the priority either, so the report described a tree without explaining it.

There are two defects on top of that:

  • 0 was unreachable. Priority 0 is legal (0–61440 in 4096 steps) and is the best there is, and
    (dev.config && dev.config.stpPriority) || default turns it into the default. A box told "you must be
    root" read as "you must not".
  • The election named no bridge. runStp() returned root: {priority, mac} — a bridge ID, not a device —
    so nothing downstream could say which switch won.

What must be true instead

  1. a command reaches the priority: spanning-tree priority <0-61440>, no spanning-tree priority to restore
    the default and say what it is;
  2. a value the standard cannot express is refused, naming the rule and the two nearest valid values — never
    rounded, because rounding picks a root the operator did not ask for;
  3. IOS's per-VLAN spelling is refused with the reason (this model runs one spanning tree per device), not
    accepted and applied to everything;
  4. show spanning-tree prints the priority in force and names the root bridge;
  5. the priority survives a save, and is printed by show running-config so a restore keeps the election;
  6. 0 means 0.
The spanning tree has honoured a bridge priority since STP was modelled, and nothing in the product could set it. `Simulator.computeStp()` builds each bridge as: ```js priority: (dev.config && dev.config.stpPriority) || stpLib.STP_DEFAULT_PRIORITY, ``` `config.stpPriority` has **no writer anywhere**: no catalogue spec sets it, no CLI command sets it, `Device.serialize()` did not carry it. So every switch in every lab ran 32768, the root was decided by MAC address alone, and the first thing anyone does to a switched network — nominate the root — could not be done. `show spanning-tree` did not print the priority either, so the report described a tree without explaining it. There are two defects on top of that: * **`0` was unreachable.** Priority 0 is legal (`0`–`61440` in 4096 steps) and is the best there is, and `(dev.config && dev.config.stpPriority) || default` turns it into the default. A box told "you must be root" read as "you must not". * **The election named no bridge.** `runStp()` returned `root: {priority, mac}` — a bridge ID, not a device — so nothing downstream could say *which* switch won. ## What must be true instead 1. a command reaches the priority: `spanning-tree priority <0-61440>`, `no spanning-tree priority` to restore the default and say what it is; 2. a value the standard cannot express is refused, naming the rule and the two nearest valid values — never rounded, because rounding picks a root the operator did not ask for; 3. IOS's per-VLAN spelling is refused with the reason (this model runs one spanning tree per device), not accepted and applied to everything; 4. `show spanning-tree` prints the priority in force and names the root bridge; 5. the priority survives a save, and is printed by `show running-config` so a restore keeps the election; 6. `0` means `0`.
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#1364
No description provided.