Traceroute (traceroute)
Finds the path to the target the way traceroute does, with probes that run out of time to live one hop further each time, and reports how many hops away the target is, whether it was reached, how long the last answer took, and whether the path differs from the one seen at the previous poll. It can also require that a named router is on the path.
Use it on a link where the route matters: a branch office that must go through the head office firewall, or a service reached over a provider that you want to hear about when it changes the way in. A change of path alone is only a warning for one poll; a target that is no longer reached, or a router that must be on the path and is not, is Down.
What it looks like

The sensor's page after a few polls. In the dark theme: the sensor's page. The form for adding it: light, dark.
Channels
| Key | Name | Unit | Default limits |
|---|---|---|---|
hop_count | Hops to the target | none | none |
reached | Target reached | none | none (0 Not reached, Down; 1 Reached) |
rtt_ms | Round-trip time to the last hop | ms | none |
silent_hops | Hops that did not answer | none | none |
path_changed | Path changed since the last poll | none | none (0 Unchanged; 1 Changed, a warning) |
expected_hop_in_path | Expected hop on the path | none | none (0 Missing, Down; 1 Present). Only when expected_hop is set |
The hop count is the number of the hop the target is at: 1 for a machine on the same network, 8 for a target eight routers away. When the target was not reached, it is the farthest hop that did answer (0 when none did), which is where the path was last seen. Many routers do not answer probes, so a hop that stays silent is counted in silent_hops and the trace goes on.
The path changed when the two traces differ in length, or when a hop that answered in both has a different address. A hop that was silent in one of them says nothing either way, so a router that answers only now and then does not make the path flap. Paths that load-balance over several routers can show as a change at the hop where they split; if you see that, the sensor is telling the truth about the network, and expected_hop is the better check. The path is compared with the previous poll's, so a change is reported once, and the new path is then the baseline.
Parameters
| Parameter | Default | Meaning |
|---|---|---|
method | icmp | icmp sends echo requests, the packets ping sends; the target answers with an echo reply. udp sends datagrams to a port nothing listens on; the target answers "port unreachable". |
max_hops | 30 | The largest number of hops to try, 1 to 64. |
hop_timeout_ms | 800 | How long to wait for the answer to each probe, 50 to 5000. Shortened when the poll timeout leaves less. |
max_silent_hops | 5 | Give up after this many hops in a row that did not answer, 1 to 30. |
udp_port | 33434 | Destination port of the UDP probes. |
expected_hop | none | An address that must be on the path. When it is missing the sensor is Down, although the target was reached. |
Suggested interval: 300 seconds. No credential.
One probe is sent per hop, one hop at a time, so a trace to a target ten hops away takes the time of ten round trips, and every hop that does not answer costs hop_timeout_ms. Keep the poll timeout above max_silent_hops times the hop timeout plus the round trips of the hops that answer, or the poll ends with what it has and the target counts as not reached ("the poll ran out of time").
On the target and the probe host
- Linux probe only. The probes need the kernel's own report of the ICMP errors that come back, which only Linux gives to an unprivileged socket. On a Windows probe the poll fails with "traceroute is only available on a Linux probe", a configuration failure.
- No raw socket. Both methods use ordinary datagram sockets with
IP_RECVERRset, so the binary needs no capability. Theicmpmethod uses the same unprivileged ICMP socket the ping sensor uses, and so the same setting: Linux allows it only for group ids insidenet.ipv4.ping_group_range. Where that is not set, usemethod: udp, which needs nothing. - The target must answer the kind of probe: an echo request for
icmp, and forudpan ICMP "port unreachable" from the target itself. A firewall that drops either makes the target unreachable for this sensor although it may answer everything else; try the other method before concluding anything. - A router that answers for the target (a firewall that says "port unreachable" for its own address, a NAT) ends the trace short of the target, and the sensor says which address answered.
- IPv6 targets are probed the same way.
Failures
A trace that ends short of the target is a successful poll that is Down, with the reason in the message. A poll fails only when the probe itself could not run.
| Message | Meaning |
|---|---|
<target> was not reached: N hops in a row did not answer; the farthest answer was hop K (<address>) | The path stops answering. The target, or a firewall before it, drops the probes. |
<target> was not reached: <address> said administratively prohibited (or host unreachable, network unreachable) | A router on the path refuses to deliver the probe. |
<target> was not reached: the poll ran out of time | The trace was cut at the poll timeout. Raise the timeout or lower hop_timeout_ms or max_silent_hops. |
<target> is N hops away, but <address> is not on the path | expected_hop is missing from an otherwise complete path. |
cannot open a socket for the trace ... (kind unreachable) | The probe cannot open the socket; for icmp see the sysctl above. |
no route to <target> / cannot send to <target> (kind unreachable) | The probe host has no route to the target. |
traceroute is only available on a Linux probe (kind config) | The probe runs on Windows. |
Verification
Run on the loopback interface with both methods (the target is one hop away, by ICMP and by UDP), with scripted paths for the path-change, silent-hop, expected-hop and blocked cases, and against a lab network by both methods: a neighbour one hop away, a neighbour whose replies are delayed by 50 ms (the round-trip time follows), and an address that drops everything (not reached, three silent hops, Down). A path of several routers can be run against an address a few hops away; that test needs one and is skipped without it. Not seen: a path that changes under the sensor, load-balanced paths, IPv6, and a router that answers "administratively prohibited" were not available; the answers of the last are classified by tests on hand-built values only.
The live tests read their targets from the environment and say so and return when they are not set:
| Variable | Meaning |
|---|---|
PROBEWARD_TEST_NETEM_CLEAN, PROBEWARD_TEST_NETEM_DELAY50, PROBEWARD_TEST_NETEM_BLACKHOLE | Addresses of a target on the probe's own network with no impairment, with a 50 ms delay on what it sends back, and one that sends back nothing. |
PROBEWARD_TEST_TRACE_FAR | Optional: an address a few routers away. |
cargo test -p probeward-sensors --test live_quality traceroute -- --nocapture