[prev in list] [next in list] [prev in thread] [next in thread] 

List:       bird-users
Subject:    Re: [PATCH] Add 'preferred' route attribute for selective add-path
From:       Maria_Matějka <maria.matejka () nic ! cz>
Date:       2021-02-27 10:05:21
Message-ID: 29478472-E978-4301-B06F-3C8DD496A105 () nic ! cz
[Download RAW message or body]

Hello!
I have recently done some substantial changes in route exports (in separate \
branches). I'd like to summarize what we are looking for.

1) have 'primary' in the filter and decide based on it
2) export 'first N routes' with sorted table

I suppose this may be possible in the new code which is currently placed into the \
guernsey branch. I'll try to implement something of that while refactoring exports. 

Maria

On February 27, 2021 2:26:48 AM GMT+01:00, Trisha Biswas <tbiswas@fastly.com> wrote:
> Hi Ondrej,
> 
> Thanks for evaluating the patch. It makes sense to use rte->flags to
> store
> the preferred path and access that from the filter code to get around
> the
> first issue.
> 
> For the second issue, it almost feels like there should be a separate
> mode
> of route announcement called RA_SELECTIVE. This would be exactly the
> same
> as RA_ANY, but in addition it would announce when routes change their
> REF_BEST. The RA_SELECTIVE mode could be enabled with a config option
> such
> as 'add paths tx selective;', so that we don't end up with lots of
> unnecessary announcements for BGP add-path. Previously, we had tried
> this
> by making RA_SELECTIVE a clone of RA_OPTIMAL, but that did not work
> well.
> Do you see issues with this approach up front?
> 
> Thanks,
> Trisha
> --
> 
> *Trisha Biswas* | Sr. Software Engineer, Network Systems
> fastly.com | @fastly <https://twitter.com/fastly> | LinkedIn
> <http://www.linkedin.com/company/fastly>
> 
> 
> On Fri, Feb 26, 2021 at 3:53 PM Ondrej Zajicek <santiago@crfreenet.org>
> wrote:
> 
> > On Fri, Feb 26, 2021 at 01:56:42PM -0800, Trisha Biswas wrote:
> > > Hi all,
> > > 
> > > The attached patch adds a 'preferred' route attribute to check
> whether
> > the
> > > route being processed has been selected as the best-path for the
> network
> > it
> > > belongs to. This attribute does not take in a value, and returns a
> > boolean.
> > > This is useful for allowing selection in an add-path enabled BGP
> session.
> > 
> > Hi
> > 
> > I agree this may be a useful feature, but there are two issues with
> the
> > approach used in the patch:
> > 
> > First, we would like not to access rte->net from the filters (outside
> of
> > net_addr). We plan to remove this ptr and instead have ptr from rte
> > directly to net_addr.
> > 
> > Second, RA_ANY mode of route announcement (which is used by BGP
> add-path
> > and pipes) would not really work with this change in a way how you
> expect
> > - consider this scenario: route A is added, preferred and accepted
> for
> > export, then route B is added, not-preferred and not-accepted for
> export.
> > Then route A is withdrawn and B is selected as preferred. Protocols
> with
> > RA_OPTIMAL received update with route B as new-preferred (as they
> accept
> > only preferred one and that changed), but protocols with RA_ANY
> receive
> > just withdraw for route A (as they accept all routes and only route A
> was
> > changed, while route B is the same as was announced before), so they
> do
> > not get notification that route B became preferred and export filter
> for
> > B is not re-evaluated.
> > 
> > The one approach that avoids the first issue is to add REF_BEST flag
> > (in rte->flags) that would be added to mark preferred routes, and
> this
> > flag can be accessed from the filter code. But that does not fix the
> > second issue. We can add RA_ANY announcement for routes that changed
> > their REF_BEST, but that would add plenty of unnecessary
> announcements
> > (that are propagated as BGP updates) for BGP add-path that do not
> > use or care about this flag.
> > 
> > In general, BGP add-path in BIRD was developed with assumption that
> > routes within one network are handled independently and would need
> some
> > deeper redesign for other cases. That might be useful (in order to be
> > able to implement things like 'announce best 4 routes for given
> > network'), but i do not see an easy solution to this.
> > 
> > --
> > Elen sila lumenn' omentielvo
> > 
> > Ondrej 'Santiago' Zajicek (email: santiago@crfreenet.org)
> > OpenPGP encrypted e-mails preferred (KeyID 0x11DEADC3,
> wwwkeys.pgp.net)
> > "To err is human -- to blame it on a computer is even more so."
> > 
> 
> > On Fri, Feb 26, 2021 at 1:56 PM Trisha Biswas <tbiswas@fastly.com>
> wrote:
> > 
> > > Hi all,
> > > 
> > > The attached patch adds a 'preferred' route attribute to check
> whether
> > > the route being processed has been selected as the best-path for the
> > > network it belongs to. This attribute does not take in a value, and
> returns
> > > a boolean. This is useful for allowing selection in an add-path
> enabled BGP
> > > session.
> > > 
> > > The motivation behind selective add paths is to reduce the number of
> > > routes that are shared in an add-path enabled BGP session on a
> per-prefix
> > > basis. Instead of sending all paths to all destinations for
> > > an add-path session, we would like to specify prefixes (and/or other
> route
> > > attributes) for which all paths are to be shared. Further, if there
> are
> > > thousands of ways to reach a destination, simply negotiating add
> paths for
> > > a prefix would result in sharing all additional paths to the peer.
> This in
> > > turn would result in a flood of advertisements to be sent between
> the
> > > nodes, and a high memory footprint on the peer. To avoid this, we
> are
> > > considering a filter-based selection criteria that would unlock the
> > > potential of purposefully sending additional paths when desired.
> > > 
> > > Adding the 'preferred' keyword allows us to always send the
> best-path
> > > whether or not other criteria in the export filter match. In the
> following
> > > example, a route is exported when it is either the best route or one
> of
> > > 172.16.0.0/16, 10.0.0.0/8{16,24} <http://10.0.0.0/8%7B16,24%7D>
> (regardless
> > > of best route status). In the case of 8.8.8.0/24, we export it if
> it's
> > > the best route, or if it additionally has the specified extended
> community
> > > attached to the route.
> > > 
> > > protocol bgp {
> > > [....]
> > > add paths tx;
> > > export filter {
> > > if preferred || (net = [172.16.0.0/16, 10.0.0.0/8{16,24}
> > > <http://10.0.0.0/8%7B16,24%7D>]) then accept;
> > > if preferred || (net = 8.8.8.0/24 && (ro, 1, 2) ~ bgp_ext_community)
> > > then accept;
> > > #remaining filter code
> > > reject;
> > > }
> > > }
> > > 
> > > Cheers,
> > > Trisha
> > > --
> > > 
> > > *Trisha Biswas* | Sr. Software Engineer, Network Systems
> > > fastly.com | @fastly <https://twitter.com/fastly> | LinkedIn
> > > <http://www.linkedin.com/company/fastly>
> > > 
> > 

-- 
Sent from my Android device with K-9 Mail. Please excuse my brevity.


[Attachment #3 (text/html)]

<html><head></head><body>Hello!<br>I have recently done some substantial changes in \
route exports (in separate branches). I'd like to summarize what we are looking \
for.<br><br>1) have 'primary' in the filter and decide based on it<br>2) export \
'first N routes' with sorted table<br><br>I suppose this may be possible in the new \
code which is currently placed into the guernsey branch. I'll try to implement \
something of that while refactoring exports. <br><br>Maria<br><br><div \
class="gmail_quote">On February 27, 2021 2:26:48 AM GMT+01:00, Trisha Biswas \
&lt;tbiswas@fastly.com&gt; wrote:<blockquote class="gmail_quote" style="margin: 0pt \
0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"> <div \
dir="ltr"><div dir="ltr">Hi Ondrej,</div><div dir="ltr"><br></div><div \
dir="ltr">Thanks for evaluating the patch. It makes sense to use&nbsp;rte-&gt;flags \
to store the preferred path and access that from the filter code to get \
around&nbsp;the first issue.<br><br>For the second issue, it&nbsp;almost feels like \
there should be a separate mode of route announcement called RA_SELECTIVE. This would \
be exactly the same as RA_ANY, but in addition it would announce when routes change \
their REF_BEST. The RA_SELECTIVE mode could be enabled with a config option such as \
'add paths tx selective;', so that we don't end up with lots of unnecessary \
announcements for BGP add-path. Previously, we had tried this by making RA_SELECTIVE \
a clone of RA_OPTIMAL, but that did not work well. Do you see issues with this \
approach&nbsp;up front?</div><div \
dir="ltr"><br></div><div>Thanks,</div><div>Trisha</div><div dir="ltr"><div><div \
dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div \
dir="ltr"><span style="color:rgb(136,136,136)">--</span><br \
style="color:rgb(136,136,136)"><div dir="ltr" style="color:rgb(136,136,136)"><div \
dir="ltr"><div dir="ltr"><div dir="ltr"><div \
style="margin:0px;padding:0px;color:rgb(51,51,51);font-family:Arial,sans-serif;font-size:14px;line-height:20px"><img \
src="https://www.fastly.com/img/sig.png"><br></div><div \
style="margin:0px;padding:0px;color:rgb(51,51,51);font-family:Arial,sans-serif;font-size:14px;line-height:20px"><b>Trisha \
Biswas</b>&nbsp;| Sr. Software Engineer, Network Systems</div><div \
style="margin:0px;padding:0px;color:rgb(51,51,51);font-family:Arial,sans-serif;font-size:14px;line-height:20px"><a \
href="http://fastly.com/" rel="nofollow" style="color:rgb(59,115,175)" \
target="_blank">fastly.com</a>&nbsp;|&nbsp;<a href="https://twitter.com/fastly" \
rel="nofollow" style="color:rgb(59,115,175)" \
target="_blank">@fastly</a>&nbsp;|&nbsp;<a \
href="http://www.linkedin.com/company/fastly" rel="nofollow" \
style="color:rgb(59,115,175)" \
target="_blank">LinkedIn</a></div></div></div></div></div></div></div></div><br></div><br><div \
class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Feb 26, 2021 at 3:53 PM \
Ondrej Zajicek &lt;<a \
href="mailto:santiago@crfreenet.org">santiago@crfreenet.org</a>&gt; \
wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px \
0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Fri, Feb 26, 2021 \
at 01:56:42PM -0800, Trisha Biswas wrote:<br> &gt; Hi all,<br>
&gt; <br>
&gt; The attached patch adds a 'preferred' route attribute to check whether the<br>
&gt; route being processed has been selected as the best-path for the network it<br>
&gt; belongs to. This attribute does not take in a value, and returns a boolean.<br>
&gt; This is useful for allowing selection in an add-path enabled BGP session.<br>
<br>
Hi<br>
<br>
I agree this may be a useful feature, but there are two issues with the<br>
approach used in the patch:<br>
<br>
First, we would like not to access rte-&gt;net from the filters (outside of<br>
net_addr). We plan to remove this ptr and instead have ptr from rte<br>
directly to net_addr.<br>
<br>
Second, RA_ANY mode of route announcement (which is used by BGP add-path<br>
and pipes) would not really work with this change in a way how you expect<br>
- consider this scenario: route A is added, preferred and accepted for<br>
export, then route B is added, not-preferred and not-accepted for export.<br>
Then route A is withdrawn and B is selected as preferred. Protocols with<br>
RA_OPTIMAL received update with route B as new-preferred (as they accept<br>
only preferred one and that changed), but protocols with RA_ANY receive<br>
just withdraw for route A (as they accept all routes and only route A was<br>
changed, while route B is the same as was announced before), so they do<br>
not get notification that route B became preferred and export filter for<br>
B is not re-evaluated.<br>
<br>
The one approach that avoids the first issue is to add REF_BEST flag<br>
(in rte-&gt;flags) that would be added to mark preferred routes, and this<br>
flag can be accessed from the filter code. But that does not fix the<br>
second issue. We can add RA_ANY announcement for routes that changed<br>
their REF_BEST, but that would add plenty of unnecessary announcements<br>
(that are propagated as BGP updates) for BGP add-path that do not<br>
use or care about this flag.<br>
<br>
In general, BGP add-path in BIRD was developed with assumption that<br>
routes within one network are handled independently and would need some<br>
deeper redesign for other cases. That might be useful (in order to be<br>
able to implement things like 'announce best 4 routes for given<br>
network'), but i do not see an easy solution to this.<br>
<br>
-- <br>
Elen sila lumenn' omentielvo<br>
<br>
Ondrej 'Santiago' Zajicek (email: <a href="mailto:santiago@crfreenet.org" \
target="_blank">santiago@crfreenet.org</a>)<br> OpenPGP encrypted e-mails preferred \
(KeyID 0x11DEADC3, <a href="http://wwwkeys.pgp.net" rel="noreferrer" \
target="_blank">wwwkeys.pgp.net</a>)<br> "To err is human -- to blame it on a \
computer is even more so."<br></blockquote><div><div dir="auto"><blockquote \
class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid \
rgb(204,204,204);padding-left:1ex"><div dir="auto"><br></div><div \
class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Feb 26, 2021 at 1:56 PM \
Trisha Biswas &lt;<a href="mailto:tbiswas@fastly.com">tbiswas@fastly.com</a>&gt; \
wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px \
0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hi \
all,<div><br></div><div>The attached patch adds a 'preferred' route attribute&nbsp;to \
check whether the route being processed has been selected as the best-path for the \
network it belongs to. This attribute does not take in a value, and returns a \
boolean. This is useful for allowing selection in an add-path enabled BGP \
session.&nbsp;</div><div><br></div><div>The motivation \
behind&nbsp;selective&nbsp;add&nbsp;paths&nbsp;is to reduce the number of routes that \
are shared in an&nbsp;add-path&nbsp;enabled BGP session on a per-prefix basis. \
Instead of sending all&nbsp;paths&nbsp;to all destinations for \
an&nbsp;add-path&nbsp;session, we would like to specify prefixes (and/or other route \
attributes) for which all&nbsp;paths&nbsp;are to be shared. Further, if there are \
thousands of ways to reach a destination, simply \
negotiating&nbsp;add&nbsp;paths&nbsp;for a prefix would result in sharing all \
additional&nbsp;paths&nbsp;to the peer. This in turn would result in&nbsp;a flood of \
advertisements to be sent between the nodes, and a high memory footprint on \
the&nbsp;peer. To avoid this, we are considering a filter-based selection criteria \
that would unlock the potential of purposefully sending \
additional&nbsp;paths&nbsp;when desired.&nbsp;<br></div><div><br></div><div>Adding \
the 'preferred' keyword allows us to always send the best-path whether or not other \
criteria in the export filter match. In the following example, a route is exported \
when it is either the best route or one of&nbsp;<a href="http://172.16.0.0/16" \
target="_blank">172.16.0.0/16</a>,&nbsp;<a href="http://10.0.0.0/8%7B16,24%7D" \
target="_blank">10.0.0.0/8{16,24}</a>&nbsp;(regardless of best route status). In the \
case of&nbsp;<a href="http://8.8.8.0/24" target="_blank">8.8.8.0/24</a>, we export it \
if it's the best route, or if it additionally has the specified extended community \
attached to the route.&nbsp;</div><div><br></div><div><span \
style="font-variant-numeric:normal;font-variant-east-asian:normal;font-size:9pt;font-family:&quot;Courier \
New&quot;;color:rgb(23,43,77);background-color:transparent;vertical-align:baseline;white-space:pre-wrap">protocol \
bgp { </span><span style="font-variant-numeric:normal;font-variant-east-asian:normal;font-size:9pt;font-family:&quot;Courier \
New&quot;;color:rgb(23,43,77);background-color:transparent;vertical-align:baseline;white-space:pre-wrap"><br></span><span \
style="font-variant-numeric:normal;font-variant-east-asian:normal;font-size:9pt;font-family:&quot;Courier \
New&quot;;color:rgb(23,43,77);background-color:transparent;vertical-align:baseline;white-space:pre-wrap">[....]</span><span \
style="font-variant-numeric:normal;font-variant-east-asian:normal;font-size:9pt;font-family:&quot;Courier \
New&quot;;color:rgb(23,43,77);background-color:transparent;vertical-align:baseline;white-space:pre-wrap"><br></span><span \
style="font-variant-numeric:normal;font-variant-east-asian:normal;font-size:9pt;font-family:&quot;Courier \
New&quot;;color:rgb(23,43,77);background-color:transparent;vertical-align:baseline;white-space:pre-wrap">	</span><span \
style="font-variant-numeric:normal;font-variant-east-asian:normal;font-size:9pt;font-family:&quot;Courier \
New&quot;;color:rgb(23,43,77);background-color:transparent;vertical-align:baseline;white-space:pre-wrap">add \
paths tx;</span></div><div><span \
style="font-variant-numeric:normal;font-variant-east-asian:normal;font-size:9pt;font-family:&quot;Courier \
New&quot;;color:rgb(23,43,77);background-color:transparent;vertical-align:baseline;white-space:pre-wrap">	export \
filter {</span></div><div><span \
style="font-variant-numeric:normal;font-variant-east-asian:normal;font-size:9pt;font-family:&quot;Courier \
New&quot;;color:rgb(23,43,77);background-color:transparent;vertical-align:baseline;white-space:pre-wrap">		if \
preferred || (net = [<a href="http://172.16.0.0/16" \
target="_blank">172.16.0.0/16</a>, <a href="http://10.0.0.0/8%7B16,24%7D" \
target="_blank">10.0.0.0/8{16,24}</a>]) then accept;<br></span></div><div><span \
style="font-variant-numeric:normal;font-variant-east-asian:normal;font-size:9pt;font-family:&quot;Courier \
New&quot;;color:rgb(23,43,77);background-color:transparent;vertical-align:baseline;white-space:pre-wrap">		if \
preferred || (net = <a href="http://8.8.8.0/24" target="_blank">8.8.8.0/24</a> \
&amp;&amp; (ro, 1, 2) ~ bgp_ext_community) then accept;<br></span></div><div><span \
style="font-variant-numeric:normal;font-variant-east-asian:normal;font-size:9pt;font-family:&quot;Courier \
New&quot;;color:rgb(23,43,77);background-color:transparent;vertical-align:baseline;white-space:pre-wrap">		#remaining \
filter code</span></div><div><span \
style="font-variant-numeric:normal;font-variant-east-asian:normal;font-size:9pt;font-family:&quot;Courier \
New&quot;;color:rgb(23,43,77);background-color:transparent;vertical-align:baseline;white-space:pre-wrap">		reject;</span></div><div><span \
style="font-variant-numeric:normal;font-variant-east-asian:normal;font-size:9pt;font-family:&quot;Courier \
New&quot;;color:rgb(23,43,77);background-color:transparent;vertical-align:baseline;white-space:pre-wrap">	}<br></span><span \
style="font-variant-numeric:normal;font-variant-east-asian:normal;font-size:9pt;font-family:&quot;Courier \
New&quot;;color:rgb(23,43,77);background-color:transparent;vertical-align:baseline;whi \
te-space:pre-wrap">}</span><br></div><div><br></div><div>Cheers,</div><div>Trisha</div><div><div><div \
dir="ltr"><div dir="ltr"><span style="color:rgb(136,136,136)">--</span><br \
style="color:rgb(136,136,136)"><div dir="ltr" style="color:rgb(136,136,136)"><div \
dir="ltr"><div dir="ltr"><div dir="ltr"><div \
style="margin:0px;padding:0px;color:rgb(51,51,51);font-family:Arial,sans-serif;font-size:14px;line-height:20px"><img \
src="https://www.fastly.com/img/sig.png" class="gmail-CToWUd"><font \
color="#888888"><br></font></div><font color="#888888"><div \
style="margin:0px;padding:0px;color:rgb(51,51,51);font-family:Arial,sans-serif;font-size:14px;line-height:20px"><b>Trisha \
Biswas</b>&nbsp;| Sr. Software Engineer, Network Systems</div><div \
style="margin:0px;padding:0px;color:rgb(51,51,51);font-family:Arial,sans-serif;font-size:14px;line-height:20px"><a \
href="http://fastly.com/" rel="nofollow" target="_blank" \
style="color:rgb(59,115,175)">fastly.com</a>&nbsp;|&nbsp;<a \
href="https://twitter.com/fastly" rel="nofollow" target="_blank" \
style="color:rgb(59,115,175)">@fastly</a>&nbsp;|&nbsp;<a \
href="http://www.linkedin.com/company/fastly" rel="nofollow" target="_blank" \
style="color:rgb(59,115,175)">LinkedIn</a></div></font></div></div></div></div></div></div></div></div></div></blockquote></div></blockquote></div></div></div></div>
 </blockquote></div><br>-- <br>Sent from my Android device with K-9 Mail. Please \
excuse my brevity.</body></html>



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic