<div dir="ltr">Hi all,<div><br></div><div>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. </div><div><br></div><div>The motivation behind <span class="gmail-il">selective</span> <span class="gmail-il">add</span> <span class="gmail-il">paths</span> is to reduce the number of routes that are shared in an <span class="gmail-il">add</span>-<span class="gmail-il">path</span> enabled BGP session on a per-prefix basis. Instead of sending all <span class="gmail-il">paths</span> to all destinations for an <span class="gmail-il">add</span>-<span class="gmail-il">path</span> session, we would like to specify prefixes (and/or other route attributes) for which all <span class="gmail-il">paths</span> are to be shared. Further, if there are thousands of ways to reach a destination, simply negotiating <span class="gmail-il">add</span> <span class="gmail-il">paths</span> for a prefix would result in sharing all additional <span class="gmail-il">paths</span> 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 <span class="gmail-il">paths</span> when desired. <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 <a href="http://172.16.0.0/16">172.16.0.0/16</a>, <a href="http://10.0.0.0/8{16,24}">10.0.0.0/8{16,24}</a> (regardless of best route status). In the case of <a href="http://8.8.8.0/24">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. </div><div><br></div><div><span style="font-variant-numeric:normal;font-variant-east-asian:normal;font-size:9pt;font-family:"Courier New";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:"Courier New";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:"Courier New";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:"Courier New";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:"Courier New";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:"Courier New";color:rgb(23,43,77);background-color:transparent;vertical-align:baseline;white-space:pre-wrap"><span class="gmail-il">add</span> <span class="gmail-il">paths</span> tx;</span></div><div><span style="font-variant-numeric:normal;font-variant-east-asian:normal;font-size:9pt;font-family:"Courier New";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:"Courier New";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">172.16.0.0/16</a>, <a href="http://10.0.0.0/8{16,24}">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:"Courier New";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">8.8.8.0/24</a> && (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:"Courier New";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:"Courier New";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:"Courier New";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:"Courier New";color:rgb(23,43,77);background-color:transparent;vertical-align:baseline;white-space:pre-wrap">}</span><br></div><div><br></div><div>Cheers,</div><div>Trisha</div><div><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> | 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> | <a href="https://twitter.com/fastly" rel="nofollow" style="color:rgb(59,115,175)" target="_blank">@fastly</a> | <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></div></div>