snar / bgpq3

bgpq3
BSD 2-Clause "Simplified" License
363 stars 53 forks source link

Output as-set blocks for OpenBGPD current #43

Closed cjeker closed 5 years ago

cjeker commented 6 years ago

Similar to bird OpenBGPD now support as-sets. These are lookup tables for AS numbers which then can be used inside the filter logic. Output an as-set when using -f the passed asnum is now unused instead -l name is used for the as-set name. The -G mode is unaltered.

cjeker commented 6 years ago

As mentioned in https://github.com/snar/bgpq3/pull/44#issuecomment-426359424 this is a new feature in OpenBGPD. Now we have a bit of a chicken vs egg issue here. The next release of OpenBSD is very close and I would love to include a bgpq3 version that is able to output as-set since they are a major improvement over the current solution.

I know that this breaks backwards compat so what kind of other options are there? I currently see only adding a new argument (e.g. -a) to generate AS number tables (bird could benefit from this as well) as an option that does not break with the past. Would that be acceptable?

snar commented 6 years ago

On Wed, Oct 03, 2018 at 08:01:04AM -0700, Claudio Jeker wrote:

As mentioned in #44 (comment) this is a new feature in OpenBGPD. Now we have a bit of a chicken vs egg issue here. The next release of OpenBSD is very close and I would love to include a bgpq3 version that is able to output as-set since they are a major improvement over the current solution.

In order to use this improvement, existing setups has to migrate to OpenBSD 6.4+ first, else the change you proposed will break their operations.. I do not think that breaking someone else operations can be considered as acceptable.

I know that this breaks backwards compat so what kind of other options are there? I currently see only adding a new argument (e.g. -a) to generate AS number tables (bird could benefit from this as well) as an option that does not break with the past. Would that be acceptable?

Yes, this approach is acceptable. And, btw, commit adding flag -t was just pushed to github:

snar@host:~/compile/tmp/bgpq3>./bgpq3 | grep -- -t -t : generate as-sets for OpenBGPD (OpenBSD 6.4+) and JSON formats

can I ask you to check if it works as expected ?

Also, can you point me to bird documentation about their as-set format, so that I can add bird support too ?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.*

cjeker commented 6 years ago

Tested and the -t flags works nicely. Produces same output as with my diff so :+1:

About bird, look at bgpq3_print_bird_aspath(). bgpq3 -b -f 1 AS-SWITCH produces an output like:

NN = [559, 2047, 2534, 8235, 8674, 12654, 23456, 25021, 29216];

This is just an array of integers and is very similar to what OpenBGPD has with as-set.

This is why I think it would make sense to move this generator also to the -t option and not "abuse" -f for this.

Thanks a lot for pushing this in. Also do you plan to do a official release soon?

snar commented 5 years ago

Implemented in a bit different way. Request is closed for inactivity.