The command that knew why and said "timed out" #1486
No reviewers
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
jaylouisw/packetforge!1486
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/ping-says-why"
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 symptom
pingis the first command anyone types in a lab, and the one that most often fails. On a lab where the router's port is shut:That is everything the console says. This is everything the engine knew, and returned:
Simulator.ping()has recorded a reason for every lost echo since #1431 ranked the causes by earliness —no route to 10.0.0.99,no ARP reply from 10.91.0.10,peer port shut (R1 Gi0/0/0),ACL 101 denied (in)._pingReplyLines()printed the timeout and threw the reason away.So the most-used command in the simulator answered something went wrong to the question what went wrong — for exactly the beginner mistakes a simulator exists to teach: no address, no route, cable down, VLAN not allowed.
What was actually wrong
Not a missing fact. A missing sentence. The engine computed the reason, carried it in the answer, and the surface that a person reads dropped it. Same species as #1475 (the packet log printing
flow-closeinstead of which flow ended) and #1473 (one ARP row where two boxes had answered): the model was right and the translation layer was silent, which is the hardest kind to notice because a plausible-looking line hides a missing one.What changed
pingLossSentence()inengine/simulator.jscounts the lost echoes by the reason already recorded, and hands them todropsSentence()— theN drops (reasons)phrasingshow interfaceshas used since #1417, lifted out ofcli.jsinto the engine so the two callers reach one function instead of two copies:Longest reason first,
xNfor a repeat, reasons past the third counted rather than hidden, and a reason carrying its own brackets (ACL 101 denied (in)) quoted — a reason printed inside the summary's brackets nests for a reader and closes the list early for a parser, which is what #1417 fixed one layer up.The browser's Simulate dialog draws the same sentence from a mirror of the rule, next to the success rate.
Three deliberate silences, each a rule rather than an omission:
% Still converging: stp on s1 (ready at 30000 ms)and gets no loss line, no0%;Evidence
test/ping-loss-reason.test.js, 32 checks:It covers: the reason appears verbatim and after the per-echo lines in the console's
%voice; a four-echo failure produces one line and still four timeout lines; a shut port is named with its brackets quoted; a device with no address at all explains itself; a converged path gets no loss line; a reasonless failure and a blank reason invent nothing;show interfacesstill reaches the phrasing through one function (asserted against the source, so a copy would fail); and the console and browser agree on ten cases including bracketed reasons, five distinct reasons, mixed success/loss, converging and empty.Docs:
docs/CLI.mdnew### Why an echo never came back(before/after transcripts, the phrasing rules, the three silences);docs/ARCHITECTURE.mdnew### The command that knew why and said "timed out".Adding the helpers moved three citations in the docs by 41 lines —
ethFrame(),openFlow(),_deliver()— so the numbers were moved with the code and now land exactly on the definitions their sentences name;npm run check:citationsis back to its single documented false positive.Full suite: 239 suites, 8880 assertions, 0 failed. Syntax 308 files OK.
5e2059f573b27ac789d2b27ac789d2c28b1d4ccd