The PoE panel powers ports the engine has shut down, and denies the wrong one #1293

Closed
opened 2026-11-09 23:08:15 +00:00 by jaylouisw · 0 comments
Owner

The inspector panel powers devices the engine is not powering.

poeSummary() in web/app.js is a second implementation of Simulator.computePoe(), because the browser cannot
require the engine. The engine walks activeInterfaces(), so a shut-down PSE port serves no power. The panel
walked every port. Measured on a PSE with its only PSE port shut down and a powered device behind it:

engine:  { budget: 30, used: 0,     ports: [] }
panel:   { budget: 30, used: 12.95, ports: ['1/1/1/true'] }

And with the budget tight, the panel marked the wrong port denied, because it powered a port the engine had
skipped and then ran out of budget on the port the engine was actually powering:

one PSE port shut down, budget 20
engine: powers 1/1/2 (12.95 W, nothing denied)
panel:  powers 1/1/1, denies 1/1/2

test/ui-render.test.js already compared the two — on one lab, with two powered devices and a tight budget,
which is the one arrangement where both copies happen to agree. One comparison is not agreement.

What "done" looks like

  • the panel's power accounting follows the engine: only an enabled PSE port serves power;
  • the panel's PSE port count stays a hardware count — the ports exist whether or not they are up;
  • a device with no budget is still reported as "budget not modelled", and claims no watts;
  • the two implementations are compared port by port (not just totals) across every case a PSE meets:
    • both powered devices fit the budget, and a budget that cannot fit both;
    • one PSE port shut down (budget fine, and budget tight);
    • both PSE ports shut down;
    • a port whose peer is not a powered device;
    • a PSE port with nothing plugged in;
    • a device with no budget at all;
    • a sweep of twelve budgets, each also checked for drawing more than it has — a budget nobody can exceed is
      decoration;
  • and the inspector's rendered sentence matches the accounting: PoE in use 0 W when the only PSE port is
    shut down, with nothing flagged DENIED because nothing was asked for.
The inspector panel powers devices the engine is not powering. `poeSummary()` in `web/app.js` is a second implementation of `Simulator.computePoe()`, because the browser cannot `require` the engine. The engine walks `activeInterfaces()`, so a shut-down PSE port serves no power. The panel walked **every** port. Measured on a PSE with its only PSE port shut down and a powered device behind it: ``` engine: { budget: 30, used: 0, ports: [] } panel: { budget: 30, used: 12.95, ports: ['1/1/1/true'] } ``` And with the budget tight, the panel marked the **wrong** port denied, because it powered a port the engine had skipped and then ran out of budget on the port the engine was actually powering: ``` one PSE port shut down, budget 20 engine: powers 1/1/2 (12.95 W, nothing denied) panel: powers 1/1/1, denies 1/1/2 ``` `test/ui-render.test.js` already compared the two — on one lab, with two powered devices and a tight budget, which is the one arrangement where both copies happen to agree. One comparison is not agreement. ## What "done" looks like * the panel's power accounting follows the engine: only an **enabled** PSE port serves power; * the panel's PSE port *count* stays a hardware count — the ports exist whether or not they are up; * a device with no budget is still reported as "budget not modelled", and claims no watts; * the two implementations are compared **port by port** (not just totals) across every case a PSE meets: - both powered devices fit the budget, and a budget that cannot fit both; - one PSE port shut down (budget fine, and budget tight); - both PSE ports shut down; - a port whose peer is not a powered device; - a PSE port with nothing plugged in; - a device with no budget at all; - a sweep of twelve budgets, each also checked for *drawing more than it has* — a budget nobody can exceed is decoration; * and the inspector's rendered sentence matches the accounting: `PoE in use 0 W` when the only PSE port is shut down, with nothing flagged `DENIED` because nothing was asked for.
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#1293
No description provided.