fujiapple852 / trippy

A network diagnostic tool
https://trippy.cli.rs
Apache License 2.0
3.79k stars 81 forks source link

Equal Cost Multi-path Routing #274

Open fujiapple852 opened 2 years ago

fujiapple852 commented 2 years ago

Tracking issue for all Equal Cost Multi-path Routing work items.

We wish to support the following multi-path strategies:

We wish to support these for IPv4 & IPv6 for both UDP and TCP protocols.

Current support:

Strategy Family Protocol Status
Classic IPv4 / IPv6 UDP / TCP
Paris IPv4 UDP
Paris IPv6 UDP
Dublin IPv4 UDP
Dublin IPv6 UDP
Paris IPv4 TCP
Paris IPv6 TCP
Dublin IPv4 TCP
Dublin IPv6 TCP

Tasks

crisidev commented 1 year ago

In this tracking issue there is no mention of supporting Paris for IPv6. Is it something planned by any chance?

fujiapple852 commented 1 year ago

@crisidev I'd certainly like for Trippy to be able to support the Paris ECMP strategy for IPv6/UDP.

I'm struggling to recall the details now but I know that when I initially added IPv6/UDP support to Trippy I hit some issues with IPv6/UDP checksum on Linux (may have been related to hardware offloading).

As a reminder: the Paris ECMP strategy works by manipulating the UDP checksum (and payload) to encode the sequence number in the checksum. In order to do this we need to be able to specify (or manipulate) the IPv6/UDP header.

It might be possible to set IP_HDRINCL (or perhaps IPV6_HDRINCL?) on the IPv6/UDP raw socket such that the correct checksum could be set, I'd have to try it again to see as a lot has changed since then. At the time I opened this GH issue I likely believed it was not possible. Digging into the libparistraceroute src code may also help point at the right solution.

Is using the Paris ECMP strategy for IPv6/UDP something you have experience with? I'm curious as to your use case for it.

crisidev commented 1 year ago

Thanks a lot for the detailed answer. I unfortunately do not have a lot of experience with Paris ECMP for IPv6/UDP. I have a pretty complex IPv6 home network I am currently experimenting using the official Paris traceroute, but I am well versed and love Rust, hence I would like to rewrite my probe code and base it on Trippy.

I just started scratching the surface of your amazing project, but when I have a little bit of time, I could try to reintroduce this support, after properly understanding how Paris traceroute does it in their library.

fujiapple852 commented 1 year ago

@crisidev I managed to get it to work :)

Tested in Linux and macOS and seems to work. If you were able to try it out that would be great!

Issue #749 and WIP pr in #750

crisidev commented 1 year ago

Oh wow, that was fast! I'll try this out today!

fujiapple852 commented 8 months ago

@crisidev Dublin for IPv6 just merged and will be in 0.10.0 if that's of interest to you.