FujiApple
Joined 7 years ago
Joined 7 years ago
> NAT devices are detected by observing a difference in the expected and actual checksum of the UDP packet that is returned as the part of the Original Datagram in the ICMP Time Exceeded message. If they differ then it indicates that a NAT device has modified the packet. This happens because the NAT device must recalculate the UDP checksum after modifying the packet (i.e. translating the source port) and so the checksum in the UDP packet that is nested in the ICMP error may not, depending on the device, match the original checksum.
[1] https://github.com/fujiapple852/trippy/releases/tag/0.11.0
You may also find this [2] table useful, it shows which platforms allow the combination of IPPROTO_ICMP + IP_HDRINCL so it may be used without elevated privileges.
In general, my experience of raw sockets is that they are not very “raw” at all, the OS can and does still perform a variety of modifications and additions to what you send and receive, in highly platform specific and often poorly documented ways. In particular, TCP and raw sockets should generally be avoided.
[1] https://github.com/fujiapple852/trippy/blob/master/crates/tr...
[2] https://github.com/fujiapple852/trippy/issues/101#issuecomme...
[1] https://github.com/fujiapple852/trippy?tab=readme-ov-file#ud...
[1] https://github.com/ratatui/ratatui/blob/20c88aaa5b9eb011a522...
I have my head in this space at the moment as I’m trying to implement NAT detection (as pioneered by Dublin traceroute [2]) into Trippy [3].
[1] https://tailscale.com/blog/how-nat-traversal-works
Edit: to add a bit more detail, I maintain a cross platform tool [1] on GitHub and require a way to build and test it in CI for several platform not natively supported by GitHub.
Currently I use cargo-cross [2] to build it from a Linux OS but this doesn’t work for running the tests.
One option I’m aware of is running a qemu VM on Linux, which is the approach taken by postgres [3].
Another option is using an external CI provider such as Cirrus who claim to have native support [4] for various *BSD.
[1] https://github.com/fujiapple852/trippy
[2] https://github.com/cross-rs/cross
There is a plan [0] to add custom columns to Trippy and then to add various jitter measurements [1].
Thanks for pointing out the above RFCs, I'll take a look at those and see if they make sense to add to Trippy.
Trippy now includes [0] forward loss (Floss) and backward loss (Bloss) _heuristics_ to help surface such behaviour.
The idea was inspired by our previous discussion [1] on the topic on HN some time ago!
These columns are experimental and so not shown by default but can be enabled [2].
[0] https://github.com/fujiapple852/trippy/blob/master/RELEASES....
[1] https://news.ycombinator.com/item?id=38591827
[2] https://trippy.rs/reference/column