The console over HTTP has its own counters, takes no instant, and prints a spanning tree computed at another instant #1335
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
jaylouisw/packetforge#1335
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
The console driven over HTTP is not the same console as the one in the browser, in three ways. All measured
against
POST /api/topologies/:id/config/:devId.1. One board, two sets of counters
The session was built on
new Simulator(topo)— a second accounting, with its own flow state:Traffic counted by
/flowswas invisible to the console, and traffic the console generated (ping) was invisible tothe payload — one board, two sets of counters, and no way for an operator to tell which one they were reading.
2. Every answer is given at
Infinity:configtakes no instant, so the console always answers "once everything has settled". The cable endpoint takesatMsand reports a full convergence schedule, so the API could report a lab mid-convergence and could not ask theconsole about it.
3.
show spanning-treeprints whatever was computed lastdev.stpis written by whichever Simulator computed it last, and every HTTP request builds its own. After a cable wascut at 20000, a console asked at 25000 printed:
What must be true instead
publishes;
:configacceptsatMs, applies it on every request (a cached session must not pin a later caller to aninstant it did not ask for), and answers with
runAtMs(null= settled) andconvergence;show spanning-treerecomputes the tree at the attached simulator's instant before reading it.Fixed on
fix/sfp-plus-connectors(pushed,35ea271), all three parts, each measured against a real server.1. One board, one set of counters. Two causes, both at the session/simulator boundary:
/configbuilt its session onnew Simulator(topo)— its own flow table. It now uses the topology's(
simForFlows), re-attached on every request rather than only at creation.Mapowned by oneSimulator, so a/flowscall counted frames on a run nobody could ask about afterwards. They now live on the topology, like the flow table.Measured before → after on a PC + switch board:
The last line is the other direction: the data path counted only frames carrying an
l4, so an ICMP echomoved the port counters and nothing the payload published. Every IP frame is now counted, with payload
bytes 0 where there is no transport payload — which is what that table means.
2.
atMson every request.{ commands, atMs };"converged"/null/absent means settled; a negativenumber is
400 E_BAD_INSTANT. The answer carriesrunAtMs(null= settled) andconvergence, the sameschedule the cable endpoint returns. Applied per request, not at session creation, so a cached session
cannot pin the next caller to an instant they never asked for.
3.
show spanning-treeat the attached instant. The derived control planes are now keyed on a topologyrevision (
Topology.rev, bumped by device/link changes and bymarkChange), so a cable removed throughDELETE /links/:id— which touches no simulator at all — is in the next answer from a cached session.show spanning-tree at 25000recomputes at that instant rather than printing what a previous Simulator wrote.Test:
test/server-console-instant.test.js, 25 assertions against a real server on a free port. The twoguards that matter were proved able to fail: dropping the revision from the plane cache key fails "the
cached session re-derives the tree after a cable was removed elsewhere" (that request sends only the view,
because an
enablein the same request marks the planes stale and would otherwise hide the defect).Full suite on this commit: 212 suites, 8939 assertions, 0 failed.
Docs:
docs/ARCHITECTURE.mdrows for the endpoint, plus CHANGELOG.