frr icon indicating copy to clipboard operation
frr copied to clipboard

Add interface altname support

Open kaffarell opened this issue 9 months ago • 11 comments

The linux kernel added interface altnames a few years back: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=7a56493f0620.

Now each interface can have multiple altnames, and all these names, including the primary ones, must be unique. While the normal interface names are limited to 16 bytes, altnames can be up to 128 bytes long.

This update allows FRR to configure interfaces using these altnames. Zebra uses a red-black tree (RB tree) to store interfaces, which allows for quick lookups using the primary interface name. However, with the addition of altnames, this method isn't sufficient because we now have extra names for each interface.

To handle this, the system first checks for the primary name by quickly traversing the RB tree. If no primary name matches, it then goes through all interfaces one by one to check for matching altnames. This way, we maintain efficiency while support altnames.

Fixes: #6786

kaffarell avatar Jul 08 '25 17:07 kaffarell

One question, though: why can't we use a tree and use a list instead?

No reason really, just didn't think of it. Pushed a new version storing altnames in a rbtree.

kaffarell avatar Jul 09 '25 17:07 kaffarell

Added a interface x and interface <altname of x> topotest. Also removed some character length limitations that prevented interface altnamelongerthan15chars to work with yang.

kaffarell avatar Jul 29 '25 09:07 kaffarell

@kaffarell -> Possible you can attend next weeks tech meeting? It's on tuesdays at 11 am Eastern. I think, in general, that the community would accept something like this but we would like to sit down and make sure we understand what is being proposed as well as having some restrictions on what is being done before proceeding and I don't see a great way to have this done via writing.

donaldsharp avatar Jul 29 '25 16:07 donaldsharp

@donaldsharp I'd be happy to join, but currently the Slack instance only allows email addresses from specific domains, so I can't create an account. Who would be the correct person to contact about this?

kaffarell avatar Jul 29 '25 16:07 kaffarell

send me an email at [email protected] with an email that you want to connect via slack with. I'll get you in.

donaldsharp avatar Jul 29 '25 16:07 donaldsharp

Just pushed a new version. As discussed in last weeks tech meeting, I added a configuration flag --enable-transparent-altnames (no hard feelings on the name) which enables or disables the lookup of altnames. I did not put the altname parsing and displaying (in show interface) behind the configuration flag as I think thats not really an issue.

Also split the topotest into two tests, one for showing altnames and one for configuring an interface using altnames (the second one needing the --enable-transparent-altnames flag). Added a short notice in the docs as well.

kaffarell avatar Aug 14 '25 14:08 kaffarell

CI:rerun

mwinter-osr avatar Aug 14 '25 21:08 mwinter-osr

The altname lookup topotest fails because we don't build frr with --enable-transparent-altnames in the topotest container. Do you want me to add the option here https://github.com/FRRouting/frr/blob/c01b3ad731790f1f63b122f7318b8a9f49f7447e/tests/topotests/docker/inner/compile_frr.sh#L71 and always run the topotests with altname support or comment out the topotest?

Edit: I just skipped the lookup test for now.

kaffarell avatar Aug 18 '25 11:08 kaffarell

What did we decide on this one?

riw777 avatar Sep 02 '25 15:09 riw777

ci:rerun

kaffarell avatar Sep 16 '25 11:09 kaffarell

This pull request has conflicts, please resolve those before we can evaluate the pull request.

github-actions[bot] avatar Nov 05 '25 17:11 github-actions[bot]