traceroute: a name is resolved first, and the target line carries both names (#1484) #1865

Merged
jaylouisw merged 1 commit from rev/1117-1530 into main 2026-11-17 15:52:45 +00:00
Owner

help has claimed traceroute|tracert <address|name> since the command landed, and _traceroute() put its one argument through net.isIp() - so traceroute srv.lab was refused as an invalid target while ping srv.lab, two lines above it in the same ticket, resolved through the lab DNS.

What a box prints (research/traceroute-name-target.md)

Router#traceroute google.com
Translating "google.com"...domain server (8.8.8.8) [OK]
Type escape sequence to abort.
Tracing the route to google.com (173.194.38.167)
1 59.90.253.1 16 msec 16 msec 12 msec

The order matters and is not obvious: the lookup precedes the abort line (as ping's does), and the target line carries both names - typed name first, resolved address in parentheses. The target line has vendor-documentation backing (Catalyst 9600 guide, Tracing the route to ABA.NYC.mil (26.0.0.73)); the position of the lookup line rests on two Cisco Community pastes, which the note records as a weaker class of evidence.

What changed

  • _traceroute() classifies its argument: IPv4 literal (isIpv4Literal(), ping's octet-range check lifted to module scope), digits-and-dots typo (ping's parenthetical), IPv6 literal (refused as an IPv4-only walk, not sent to the resolver), or a name.
  • A name is resolved via Simulator.resolveName(); the lookup line is printed with [OK] only on success; the target line becomes Tracing the route to <name> (<address>); the walk itself is unchanged.
  • _translationLine() and _resolveFailureLines() extracted from ping, shared by both commands - ping's output is byte-identical and its tests pass unchanged.
  • docs/CLI.md: the table row now reads <address|name>, a new "Tracing a name" section carries the transcripts, and the paragraph claiming the index row was not real now says only max <n> is not.

Tests

  • new test/traceroute-name.test.js, 23 assertions, including: every hop line, figure and verdict is identical to the trace the address form walks.
  • test/icmp-errors-traceroute.test.js updated: traceroute not-an-ip is now a name, refused by the resolver; a digits-and-dots target is still refused as an address.
  • Full suite: 318 suites, 11,077 assertions, 0 failed (one intermediate run hit a flaky native crash in faceplate-clipping; it passes standalone and the final run is green).

Not settled (recorded in the note)

The blank line after the lookup; the real box wording for an unresolvable name (this console prints its own resolver verdict); per-hop PTR names (the model holds no PTR records); and max <n>, still indexed and still swallowed.

`help` has claimed `traceroute|tracert <address|name>` since the command landed, and `_traceroute()` put its one argument through `net.isIp()` - so `traceroute srv.lab` was refused as an invalid target while `ping srv.lab`, two lines above it in the same ticket, resolved through the lab DNS. ## What a box prints (research/traceroute-name-target.md) ``` Router#traceroute google.com Translating "google.com"...domain server (8.8.8.8) [OK] Type escape sequence to abort. Tracing the route to google.com (173.194.38.167) 1 59.90.253.1 16 msec 16 msec 12 msec ``` The order matters and is not obvious: the lookup precedes the abort line (as `ping`'s does), and the target line carries **both** names - typed name first, resolved address in parentheses. The target line has vendor-documentation backing (Catalyst 9600 guide, `Tracing the route to ABA.NYC.mil (26.0.0.73)`); the position of the lookup line rests on two Cisco Community pastes, which the note records as a weaker class of evidence. ## What changed - `_traceroute()` classifies its argument: IPv4 literal (`isIpv4Literal()`, ping's octet-range check lifted to module scope), digits-and-dots typo (ping's parenthetical), IPv6 literal (refused as an IPv4-only walk, not sent to the resolver), or a name. - A name is resolved via `Simulator.resolveName()`; the lookup line is printed with `[OK]` only on success; the target line becomes `Tracing the route to <name> (<address>)`; the walk itself is unchanged. - `_translationLine()` and `_resolveFailureLines()` extracted from `ping`, shared by both commands - ping's output is byte-identical and its tests pass unchanged. - `docs/CLI.md`: the table row now reads `<address|name>`, a new "Tracing a name" section carries the transcripts, and the paragraph claiming the index row was not real now says only `max <n>` is not. ## Tests - new `test/traceroute-name.test.js`, 23 assertions, including: every hop line, figure and verdict is identical to the trace the address form walks. - `test/icmp-errors-traceroute.test.js` updated: `traceroute not-an-ip` is now a name, refused by the resolver; a digits-and-dots target is still refused as an address. - Full suite: **318 suites, 11,077 assertions, 0 failed** (one intermediate run hit a flaky native crash in `faceplate-clipping`; it passes standalone and the final run is green). ## Not settled (recorded in the note) The blank line after the lookup; the real box wording for an unresolvable name (this console prints its own resolver verdict); per-hop PTR names (the model holds no PTR records); and `max <n>`, still indexed and still swallowed.
traceroute: a name is resolved first, and the target line carries both names (#1484)
All checks were successful
CI / Classify the change (pull_request) Successful in 8s
PR rebase / Rebase onto main and arm auto-merge (pull_request) Successful in 14s
CI / Server smoke test (pull_request) Successful in 8s
CI / Docker build (pull_request) Successful in 23s
CI / Test (Node 20) (pull_request) Successful in 48s
CI / Test (Node 22) (pull_request) Successful in 51s
CI / Test (Node 18) (pull_request) Successful in 55s
CI / Arm auto-merge (pull_request) Successful in 6s
dd120f85d0
help has claimed `traceroute|tracert <address|name>` since the command landed, and `_traceroute()` put its one
argument through `net.isIp()`, so `traceroute srv.lab` was refused as an invalid target while `ping srv.lab` -
two lines above it in the same ticket - resolved through the lab's DNS. A name now goes to the same resolver before
a probe is sent: the `Translating "srv.lab"...domain server (10.0.2.2) [OK]` line precedes
`Type escape sequence to abort.`, the target line reads `Tracing the route to srv.lab (10.0.9.9)` (both names, in
that order), and the walk is the same call the address form makes.

The lookup line and the NXDOMAIN/NODATA/SERVFAIL verdict were both live inside `ping`; they are now
`_translationLine()` and `_resolveFailureLines()`, shared, so the echo and the trace in one ticket cannot describe
one failure two ways. An IPv6 literal is refused as an IPv4-only walk rather than handed to the resolver, and a
digits-and-dots typo keeps ping's parenthetical. `max <n>` remains unimplemented - that half of the index row is
still a promise (research/traceroute-name-target.md).

Test totals: 318 suites, 11,077 assertions, 0 failed.
jaylouisw force-pushed rev/1117-1530 from dd120f85d0
All checks were successful
CI / Classify the change (pull_request) Successful in 8s
PR rebase / Rebase onto main and arm auto-merge (pull_request) Successful in 14s
CI / Server smoke test (pull_request) Successful in 8s
CI / Docker build (pull_request) Successful in 23s
CI / Test (Node 20) (pull_request) Successful in 48s
CI / Test (Node 22) (pull_request) Successful in 51s
CI / Test (Node 18) (pull_request) Successful in 55s
CI / Arm auto-merge (pull_request) Successful in 6s
to 33e3ec648f
All checks were successful
CI / Classify the change (pull_request) Successful in 8s
PR rebase / Rebase onto main and arm auto-merge (pull_request) Successful in 7s
CI / Server smoke test (pull_request) Successful in 8s
CI / Docker build (pull_request) Successful in 22s
CI / Test (Node 20) (pull_request) Successful in 45s
CI / Test (Node 18) (pull_request) Successful in 53s
CI / Test (Node 22) (pull_request) Successful in 50s
CI / Arm auto-merge (pull_request) Successful in 16s
2026-11-17 15:50:43 +00:00
Compare
Sign in to join this conversation.
No reviewers
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!1865
No description provided.