Skip to content

MPLS + multipath support #104

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 29, 2025
Merged

MPLS + multipath support #104

merged 3 commits into from
May 29, 2025

Conversation

rwestphal
Copy link
Contributor

Opening this as a draft PR, as it depends on #90 being merged first.

CI is expected to fail, as this PR also depends on netlink-packet-route v0.24 being published (the code needs rust-netlink/netlink-packet-route#166).

@rwestphal rwestphal changed the title route: add support for MPLS routes and nexthop label stacks MPLS + multipath support May 11, 2025
@rwestphal
Copy link
Contributor Author

Just pushed a new commit that introduces support for multipath routes. Both the MPLS and multipath additions were tested successfully using the Holo routing stack.

One thing I'm not too happy about is requiring an AddressFamily parameter in RouteNextHopBuilder::new(). It's necessary because the type of some attributes, like the nexthop address and labels, depend on the address family of the associated route. Still, having the user supply the address family feels a bit error-prone, but I couldn't come up with anything better. I'm open to suggestions!

@rwestphal
Copy link
Contributor Author

Update:

  • MPLS routes are now manipulated using RouteMessageBuilder<MplsLabel>, which is cleaner and less intrusive than the previous approach. (This PR also no longer depends on route: allow IPv6 gateway in IPv4 route #90)
  • The multipath() method is now available in the blanket implementation of RouteMessageBuilder<T>.

This PR still depends on netlink-packet-route 0.24 being published first.

@cathay4t
Copy link
Member

The patch looks good to me, could you add an example code for this RouteMessageBuilder<MplsLabel>?

I will tag netlink-packet-route 0.24 soon

@cathay4t
Copy link
Member

netlink-packet-route 0.24.0 published.

rwestphal added 2 commits May 21, 2025 20:40
Extend `RouteMessageBuilder` to support the creation of MPLS routes
and nexthops with MPLS label stacks. This enables configuration of
IP-to-MPLS, MPLS-to-MPLS, and MPLS-to-IP routes.

Signed-off-by: Renato Westphal <[email protected]>
Add support for configuring multipath (ECMP) routes. This includes a
new `RouteNextHopBuilder` for creating nexthop entries with various
attributes.

`RouteMessageBuilder` now has a `multipath()` method to attach multiple
nexthops using the `RTA_MULTIPATH` attribute.

Signed-off-by: Renato Westphal <[email protected]>
@rwestphal rwestphal marked this pull request as ready for review May 21, 2025 23:43
@rwestphal
Copy link
Contributor Author

The patch looks good to me, could you add an example code for this RouteMessageBuilder<MplsLabel>?

Done!

I will tag netlink-packet-route 0.24 soon

Thank you! I see the CI passed this time, so I've moved the PR out of draft.

@cathay4t cathay4t merged commit 0236751 into rust-netlink:main May 29, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants