Skip to content
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

Request for vrf support and configurable out interface #374

Open
bvlarsen opened this issue Jan 19, 2022 · 11 comments
Open

Request for vrf support and configurable out interface #374

bvlarsen opened this issue Jan 19, 2022 · 11 comments

Comments

@bvlarsen
Copy link

Hi,

Just started to use Jool_siit, great SW.

I wish there was vrf support, so Jool_siit would read out device from vrf instead of global routing table.
And it would also be nice if one could specify out interface in eamt, to manually control outbound interface.

Maybe no specification of interface means same behavior as today, then it will be backward compatible. And if vrf or specific interface is specified it will be used.

@ydahhrk
Copy link
Member

ydahhrk commented Jan 20, 2022

Note: VRF noob on the keyboard.

I wish there was vrf support, so Jool_siit would read out device from vrf instead of global routing table.

I don't know. I'm having trouble finding VRF-related API in the kernel. Do you have a rough idea of how this would work?

Eg. What's the VRF equivalent of ip_route_output()/ip6_route_output()? One of the first things those do is throw away the input interface, so I'm guessing they're dead ends.

@bvlarsen
Copy link
Author

bvlarsen commented Jan 21, 2022 via email

@hunbalazs
Copy link

hunbalazs commented Feb 1, 2022

Hi,

(not a kernel programming expert here)

On linux, vrf's are implemented using a special master interface which are called l3mdev (or something like that). As I know these are based on IP rules (like source based routing) so the problem here is that input interfaces must be set for it to work with jool.

Another issue is that ip_route_output/ip6_route_output are for host sourced packets which by default use main route table to find the destination (there are some hacks [ip vrf exec ...] but only for user space).

...
VRF's do use routing tables in Linux, and routing tables are a limited resource 252 available only. So in larger scale manual specification of out-interface might be more effective.
...

Routing table identifier type is uint32_t so it is MUCH more than 252 (docs are off at some places).
Also, please don't use oif because that will mean you can't use ECMP/UCMP either.

@bvlarsen
Copy link
Author

bvlarsen commented Feb 2, 2022 via email

@hunbalazs
Copy link

Hi,

I wanted to use linux's vrf implementation with jool because of FRR but it also supports namespaces as a vrf backend so I went that way instead.

FRR's zebra is a userspace implementation, it is totally different from a kernelspace implementation. Userspace can softfail if a kernel module is not available but a kernel module can only hard depend on kernel implementations (be it a module or built-in, correct me if I'm wrong here).

I'm not sure jool should do routing on its own, the user is perfectly capable of controlling it from standard kernel interfaces.
Per packet lookup must be done anyway, that's why the kernel has route caches, also context switches does not happen inside the kernel.

In my opinion the only thing needs to be done here is emulating a forwarded package because currently jool uses an API which creates host outbound packages.

@bvlarsen
Copy link
Author

bvlarsen commented Mar 9, 2022 via email

@hunbalazs
Copy link

Hi,

FRR 7.1 does not have namespace as a VRF backend feature, you have to use FRR repo for that (https://deb.frrouting.org/). I tried it, and it is working with any jool module.

Every packet is basically recreated by jool, no metadata is persisted (MARK, in interface, etc.)

Since jool uses netlink interface you can modify pyroute2 to talk with jool. Not an easy task but at least pyroute implements basic netlink API, you only have to add jool specific things.

@ydahhrk
Copy link
Member

ydahhrk commented Mar 14, 2022

Sorry; I wish I could help, but working up routing would be more of a feature than a fix, and the current status does not allow for new features.

Every packet is basically recreated by jool, no metadata is persisted (MARK, in interface, etc.)

You sure mark doesn't persist? The code seems to copy it: 0 1 2 3

@hunbalazs
Copy link

Every packet is basically recreated by jool, no metadata is persisted (MARK, in interface, etc.)

You sure mark doesn't persist? The code seems to copy it: 0 1 2 3

Indeed, sorry for the noise

@bvlarsen
Copy link
Author

bvlarsen commented Oct 11, 2022 via email

@cwmos
Copy link

cwmos commented Jan 15, 2024

If #140 was implemented, then VRFs would be supported directly - you would just need to set the VRF as master device of the Jool device.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants