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

Issue with filter generation with aggregate #32

Closed
anuragbhatia opened this issue Apr 4, 2017 · 4 comments
Closed

Issue with filter generation with aggregate #32

anuragbhatia opened this issue Apr 4, 2017 · 4 comments

Comments

@anuragbhatia
Copy link

bgpq3 -Jl test AS54456 -A -E
policy-options {
 policy-statement test {
replace:
  from {
    route-filter 199.116.76.0/22 prefix-length-range /24-/24;
  }
 }
}

Shows wrong prefix length range. Should be /22 - /24. Same if I try to generate Cisco config:

bgpq3 -l test AS54456 -A
no ip prefix-list test
ip prefix-list test permit 199.116.76.0/22 ge 24 le 24

Should have been ge 22 le 24

@snar
Copy link
Owner

snar commented Apr 9, 2017 via email

@mahtin
Copy link

mahtin commented Apr 13, 2017

This is an interesting situation. The -A flag (or a request to aggregate) could be interpreted in two different ways.

  1. There's aggregation in the form of how the originating network decides it wants to aggregate.
  2. There's aggregation where it means "I (the operator of the filters) want to aggregate, independent of the originating network, in how I create filters.

Both of you are right. Presently the code and it's -A flag means the first item above. However, there's a case to be made for a second/different flag to implement the second case.

In fact there's even a case when aggregation should always be used; both for router optimization and for terseness of filter output. It took a while to find a good example of this; but I think this ASN could show a valid case (just ignore the /24 for now).

$ bgpq3 -JE -l foo AS201890
policy-options {
 policy-statement foo { 
replace:
  from {
    route-filter 188.123.112.0/22 exact;
    route-filter 188.123.112.0/23 exact;
    route-filter 188.123.113.0/24 exact;
    route-filter 188.123.114.0/23 exact;
  }
 }
}
$

wth the -A aggregate flag you get less output:

$ bgpq3 -JEA -l foo AS201890
policy-options {
 policy-statement foo { 
replace:
  from {
    route-filter 188.123.112.0/22 upto /23;
    route-filter 188.123.113.0/24 exact;
  }
 }
}
$

What I'm trying to show, with this ASN, is that because there's two /23's and one /22 one can always aggregate into one line (the upto /23 part).

Back to the question in hand.

I also believe there's a case (as shown by @anuragbhatia above) where a set of (lets say, his four /24's) could be aggregated by bgpq3 into a single /22 and accept any route within any of the /22 space. This is very much up to the operator of the filters vs. the originator of the routes. The automatic aggregation is very specific to the filter operator.

If this was implemented; I would vote for a different command line flag than the existing -A flag.

BTW: There's a good example of complex filtering based on mask length in the real world. The INEX Internet Exchange in Dublin Ireland has very strict filtering on it's route server. However many other Internet Exchanges are less strict and accept upto /24 automatically. Either way - the request above is more about filter optimization.

@snar
Copy link
Owner

snar commented Apr 13, 2017 via email

@snar
Copy link
Owner

snar commented Jun 12, 2017

close for inactivity

@snar snar closed this as completed Jun 12, 2017
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

No branches or pull requests

3 participants