Three surfaces ask what a ping destination is, and answer it three ways #1377

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

Three surfaces ask "is this a ping destination?" and answer it three ways.

surface behaviour
engine/cli.js ping refused every hostname; accepted 10.0.0.999, because net.isIp() only checks the shape (three dots, one to three digits)
POST /api/topologies/:id/ping passed the string straight to the engine, so 10.0.0.999 threw inside Simulator.ping() and came back as a 500 — a mistyped octet presented as a server fault
web/app.js ping dialog /^(\d{1,3}\.){3}\d{1,3}$/ — accepted 10.0.0.999 (and got the 500), refused every hostname

After #1376 the console resolves a name through the lab's DNS servers. The other two surfaces were not changed with
it, so the same lab answers differently depending on which door you come through.

Also: POST /ping never returns what the resolver said. A name that does not resolve sends no packet at all,
yet the answer is only replies: [{ success: false }] — indistinguishable from four lost echoes, so the UI draws a
0% success rate for something that was never sent.

What must be true instead

  1. One rule, applied at every surface: an address (four octets, each 0-255) or a name (no whitespace, no
    address-shaped rubbish).
  2. A destination that is not a destination is a 400 with a code and a message naming the problem — not a 500.
  3. The source device is looked up first: {src:"nobody"} stays a 404 about the device it named.
  4. POST /ping returns the resolver verdict ({ ok, status, address, serverIp }, or null for an address) so a
    resolution failure can be told from packet loss.
  5. The inspector's Simulate tab accepts a name and shows the resolution, or says the name did not resolve and that
    nothing was sent.
Three surfaces ask "is this a ping destination?" and answer it three ways. | surface | behaviour | |---|---| | `engine/cli.js` `ping` | refused every hostname; accepted `10.0.0.999`, because `net.isIp()` only checks the *shape* (three dots, one to three digits) | | `POST /api/topologies/:id/ping` | passed the string straight to the engine, so `10.0.0.999` threw inside `Simulator.ping()` and came back as a **500** — a mistyped octet presented as a server fault | | `web/app.js` ping dialog | `/^(\d{1,3}\.){3}\d{1,3}$/` — accepted `10.0.0.999` (and got the 500), refused every hostname | After #1376 the console resolves a name through the lab's DNS servers. The other two surfaces were not changed with it, so the same lab answers differently depending on which door you come through. Also: `POST /ping` never returns what the resolver said. A name that does not resolve sends **no packet at all**, yet the answer is only `replies: [{ success: false }]` — indistinguishable from four lost echoes, so the UI draws a 0% success rate for something that was never sent. ## What must be true instead 1. One rule, applied at every surface: an address (four octets, each 0-255) or a name (no whitespace, no address-shaped rubbish). 2. A destination that is not a destination is a `400` with a code and a message naming the problem — not a `500`. 3. The source device is looked up **first**: `{src:"nobody"}` stays a `404` about the device it named. 4. `POST /ping` returns the resolver verdict (`{ ok, status, address, serverIp }`, or `null` for an address) so a resolution failure can be told from packet loss. 5. The inspector's Simulate tab accepts a name and shows the resolution, or says the name did not resolve and that nothing was sent.
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#1377
No description provided.