The console over HTTP has its own counters, takes no instant, and prints a spanning tree computed at another instant #1336

Closed
opened 2026-11-10 11:21:04 +00:00 by jaylouisw · 0 comments
Owner

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 is built on new Simulator(topo) — a second accounting, with its own flow state:

POST /flows {src: host, dst: host, bytes: 100}     -> 201
GET  /api/topologies/default  runtime[host].counters.ports.eth0 = { packetsIn: 4, bytesIn: 114, packetsOut: 5, bytesOut: 209 }
POST /config/host {commands:['show interfaces eth0']}
     console prints:  0 packets input, 0 bytes
                      0 packets output, 0 bytes

Traffic counted by /flows is invisible to the console, and traffic the console generates (ping) is invisible to the
payload — one board, two sets of counters, no way for an operator to tell which one they are reading.

2. Every answer is given at Infinity

:config takes no instant, so the console always answers "once everything has settled". The cable endpoint takes
atMs and reports a full convergence schedule, so the API can report a lab mid-convergence and cannot ask the console
about it.

3. show spanning-tree prints whatever was computed last

dev.stp is written by whichever Simulator computed it last, and every HTTP request builds its own. After a cable is
cut at 20000, a console asked at 25000 prints:

1/1/1         designated    forwarding        <- it is still listening at 25000

What must be true instead

  • the console session shares the topology's flow state, so the counters it prints are the counters the payload
    publishes;
  • :config accepts atMs, applies it on every request (a cached session must not pin a later caller to an
    instant it did not ask for), and answers with runAtMs (null = settled) and convergence;
  • show spanning-tree recomputes the tree at the attached simulator's instant before reading it.
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 is built on `new Simulator(topo)` — a second accounting, with its own flow state: ``` POST /flows {src: host, dst: host, bytes: 100} -> 201 GET /api/topologies/default runtime[host].counters.ports.eth0 = { packetsIn: 4, bytesIn: 114, packetsOut: 5, bytesOut: 209 } POST /config/host {commands:['show interfaces eth0']} console prints: 0 packets input, 0 bytes 0 packets output, 0 bytes ``` Traffic counted by `/flows` is invisible to the console, and traffic the console generates (`ping`) is invisible to the payload — one board, two sets of counters, no way for an operator to tell which one they are reading. ## 2. Every answer is given at `Infinity` `:config` takes no instant, so the console always answers "once everything has settled". The cable endpoint takes `atMs` and reports a full convergence schedule, so the API can report a lab mid-convergence and cannot ask the console about it. ## 3. `show spanning-tree` prints whatever was computed last `dev.stp` is written by whichever Simulator computed it last, and every HTTP request builds its own. After a cable is cut at 20000, a console asked at 25000 prints: ``` 1/1/1 designated forwarding <- it is still listening at 25000 ``` ## What must be true instead * the console session shares the topology's flow state, so the counters it prints are the counters the payload publishes; * `:config` accepts `atMs`, applies it on **every** request (a cached session must not pin a later caller to an instant it did not ask for), and answers with `runAtMs` (`null` = settled) and `convergence`; * `show spanning-tree` recomputes the tree at the attached simulator's instant before reading it.
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#1336
No description provided.