A ping over HTTP cannot be asked at an instant, and its packets are counted nowhere #1381

Closed
opened 2026-11-10 20:42:19 +00:00 by jaylouisw · 0 comments
Owner

POST /api/topologies/:name/ping takes {src, dst, count} and nothing else. Two things are missing from that.

1. The instant. Simulator.ping() has honoured opts.atMs since convergence was modelled, and the console
spells it ping <address> at <ms>. The endpoint never read it, so every HTTP ping was asked at Infinity: on a lab
that is still converging you cannot ask, through the API or the UI, "will this work in five seconds?" — the one
question the convergence model exists to answer. Measured on a switch whose access ports listen for 30 s:

asked at API answers
t=0 success (should be converging, settling at 30000)
t=60000 success

2. The accounting. The endpoint ran new Simulator(topo) — a second simulator with its own flow state — so the
frames a ping sent were invisible to /flows, while the same ping typed into the console was counted. This is
defect #1335, fixed for the console endpoint in #1337 and left standing here.

What must be true instead

  1. atMs is accepted, validated (400 E_BAD_INSTANT for anything that is not a time at or after 0), and passed
    to the engine; the answer reports runAtMs so it cannot be mistaken for an answer about another moment.
  2. The ping runs on simForFlows(topo), so its frames land in the same counters /flows reports and
    show interfaces prints.
  3. The answer carries those counters back, rather than a second set.
`POST /api/topologies/:name/ping` takes `{src, dst, count}` and nothing else. Two things are missing from that. **1. The instant.** `Simulator.ping()` has honoured `opts.atMs` since convergence was modelled, and the console spells it `ping <address> at <ms>`. The endpoint never read it, so every HTTP ping was asked at *Infinity*: on a lab that is still converging you cannot ask, through the API or the UI, "will this work in five seconds?" — the one question the convergence model exists to answer. Measured on a switch whose access ports listen for 30 s: | asked at | API answers | |---|---| | t=0 | success (should be `converging`, settling at 30000) | | t=60000 | success | **2. The accounting.** The endpoint ran `new Simulator(topo)` — a second simulator with its own flow state — so the frames a ping sent were invisible to `/flows`, while the same ping typed into the console was counted. This is defect #1335, fixed for the console endpoint in #1337 and left standing here. ## What must be true instead 1. `atMs` is accepted, validated (`400 E_BAD_INSTANT` for anything that is not a time at or after 0), and passed to the engine; the answer reports `runAtMs` so it cannot be mistaken for an answer about another moment. 2. The ping runs on `simForFlows(topo)`, so its frames land in the same counters `/flows` reports and `show interfaces` prints. 3. The answer carries those counters back, rather than a second set.
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#1381
No description provided.