Expand description
Item 14: Trace mini-traceroute on the control stream + path asymmetry.
Two signals about the shape of the path, both read without a separate probe flow:
- Mini-traceroute. The sender emits a few
Tracecontrol datagrams at ascending IP TTL (1, 2, …). A datagram whose TTL expires at an intermediate router draws an ICMP TimeExceeded back; on Linux that error is delivered on the socket’s error queue (IP_RECVERR+recvmsg(MSG_ERRQUEUE)), carrying the offending router’s address and the timestamp machinery for a per-hop RTT - a traceroute riding the transport’s own socket, no second flow. The TTL that drew each reply is the hop index. - Path asymmetry. The forward hop count (how many hops the peer says our
packets crossed, from its
Pathframe) versus the reverse hop count (how many hops the peer’s feedback crossed, from our own received-TTL cmsg). A difference means the two directions are routed differently - which biases the per-hop RTT model, since a one-way delay no longer splits evenly.
The error-queue read is a Linux / BSD capability (the per-platform matrix
lists no Windows path), so the traceroute half is #[cfg(target_os = "linux")]; the asymmetry half is portable (it is pure hop-count arithmetic
over signals the control plane already carries).
Structs§
- Path
Asymmetry - Forward-vs-reverse path asymmetry. The forward hop count is what the peer reports about our packets; the reverse is what we observe about the peer’s.
- Trace
Hop - One discovered hop on the path to the peer.
Functions§
- drain_
icmp_ errors - Drain the socket’s error queue, returning, for each ICMP TimeExceeded found, the offending router address and the bytes of the original probe it expired (so the caller can read back the TTL it stamped and match the per-hop RTT). Linux only.
- enable_
icmp_ errors - Enable the ICMP error queue on a socket so an expired-TTL probe’s TimeExceeded is delivered (Linux). A no-op elsewhere.
- send_
at_ ttl - Send
payloadon the connected socketfdwith the IP TTL set tottlfor this one datagram (via anIP_TTLcmsg, so the socket’s default TTL is untouched). The socket must already be connected to the peer -msg_nameis left null, since a non-null name on a connected socket returnsEISCONN.peeris used only to skip an IPv6 peer (the hop-limit cmsg is a separate spelling not needed for the netns / LAN proof). Linux only; a no-op elsewhere.