{"id":4392992,"date":"2024-03-19T20:16:38","date_gmt":"2024-03-19T20:16:38","guid":{"rendered":"https:\/\/www.lastopinion.io\/?p=4392992"},"modified":"2024-04-17T18:15:24","modified_gmt":"2024-04-17T18:15:24","slug":"bfd-over-lag-design","status":"publish","type":"post","link":"https:\/\/www.lastopinion.io\/index.php\/2024\/03\/19\/bfd-over-lag-design\/","title":{"rendered":"BFD over LAG Design"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">You might face a situation where you&#8217;re considering establishing a LAG port (whether using LACP, manual configuration, etc.), or perhaps you&#8217;re planning a maintenance window and considering shutting down a link within a LAG port, assuming it won&#8217;t affect the routing protocol due to the typically rapid convergence time of LAG. Well, it might be wise to think twice !<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Imagine the following scenarios, in which, we can consider two use cases:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Direct BFD sessions between two routers using a LAG port.<\/li>\n\n\n\n<li>BFD sessions established between two routers, with an L2 switch between them forming a LAG port.<\/li>\n<\/ul>\n\n\n<p><figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"526\" height=\"283\" class=\"wp-image-4393001\" style=\"width: 526px;\" src=\"https:\/\/www.lastopinion.io\/wp-content\/uploads\/2024\/03\/LAG_Routing.png\" alt=\"\" srcset=\"https:\/\/www.lastopinion.io\/wp-content\/uploads\/2024\/03\/LAG_Routing.png 526w, https:\/\/www.lastopinion.io\/wp-content\/uploads\/2024\/03\/LAG_Routing-480x258.png 480w\" sizes=\"(min-width: 0px) and (max-width: 480px) 480px, (min-width: 481px) 526px, 100vw\" \/><\/figure>\n<\/p>\n\n\n<p class=\"has-text-color has-link-color has-medium-font-size wp-elements-f052fc7764ebdd24018b453d2f8c34be wp-block-paragraph\" style=\"color:#e50055\"><strong>How BFD and LAG Works<\/strong> :<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The BFD protocol operates within Layer 4 of the network stack, employing common IP addresses and UDP ports. Therefore, when the router initializes a session, the &#8216;Load Balancing&#8217; algorithm determines the appropriate link for transmitting this session.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"893\" height=\"470\" src=\"https:\/\/www.lastopinion.io\/wp-content\/uploads\/2024\/03\/LAG_Routing_BFD-1.png\" alt=\"\" class=\"wp-image-4393003\" style=\"width:537px;height:auto\" srcset=\"https:\/\/www.lastopinion.io\/wp-content\/uploads\/2024\/03\/LAG_Routing_BFD-1.png 893w, https:\/\/www.lastopinion.io\/wp-content\/uploads\/2024\/03\/LAG_Routing_BFD-1-480x253.png 480w\" sizes=\"(min-width: 0px) and (max-width: 480px) 480px, (min-width: 481px) 893px, 100vw\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>To make things more interesting, each router may select a different link for its session (in a &#8220;non echo&#8221;\/asynchronous mode) :<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"934\" height=\"502\" src=\"https:\/\/www.lastopinion.io\/wp-content\/uploads\/2024\/03\/LAG_Routing_BFD_BIDI-1.png\" alt=\"\" class=\"wp-image-4393027\" style=\"width:557px;height:auto\" srcset=\"https:\/\/www.lastopinion.io\/wp-content\/uploads\/2024\/03\/LAG_Routing_BFD_BIDI-1.png 934w, https:\/\/www.lastopinion.io\/wp-content\/uploads\/2024\/03\/LAG_Routing_BFD_BIDI-1-480x258.png 480w\" sizes=\"(min-width: 0px) and (max-width: 480px) 480px, (min-width: 481px) 934px, 100vw\" \/><\/figure>\n\n\n\n<p class=\"has-text-color has-link-color has-medium-font-size wp-elements-3514ca778c0f01901723957d83453fdb wp-block-paragraph\" style=\"color:#e50055\"><strong>What is the issue<\/strong> :<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You probably began to guess where the issue lies here ^^<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The BFD protocol is generaly configured with more aggressive timers compared to LACP, enabling quicker detection of link abnormalities. Thus, if there&#8217;s an issue on link &#8220;3&#8221;, BFD might detect it and initiate a timeout prior to LACP&#8217;s detection of the problem. Consequently, the BFD client protocol could report adjacency down.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Also, deploying a BFD session across the aggregation without internal insight into the member links would render BFD incapable of ensuring detection of physical member link failures especialy if the LACP timer is high (30s for example). The objective is to confirm link continuity for each member link.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"897\" height=\"476\" src=\"https:\/\/www.lastopinion.io\/wp-content\/uploads\/2024\/03\/LAG_Routing_BFD_Incident.png\" alt=\"\" class=\"wp-image-4393004\" style=\"width:579px;height:auto\" srcset=\"https:\/\/www.lastopinion.io\/wp-content\/uploads\/2024\/03\/LAG_Routing_BFD_Incident.png 897w, https:\/\/www.lastopinion.io\/wp-content\/uploads\/2024\/03\/LAG_Routing_BFD_Incident-480x255.png 480w\" sizes=\"(min-width: 0px) and (max-width: 480px) 480px, (min-width: 481px) 897px, 100vw\" \/><\/figure>\n\n\n\n<p class=\"has-text-color has-link-color has-medium-font-size wp-elements-e01d1832b8196e8421a3b88871cad172 wp-block-paragraph\" style=\"color:#e50055\"><strong>The traditional approach to solving this problem<\/strong> :<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Simply accept it as it is; this may not pose a significant issue for you, especially if you have sufficient capacity on the backup link to handle traffic switching<\/li>\n\n\n\n<li>Remove the BFD if you don&#8217;t need it<\/li>\n\n\n\n<li>Increase the single interface capacity if feasible, and remove the LAG bundle<\/li>\n\n\n\n<li>Using ECMP involves employing multiple distinct interconnections instead of a single LACP link. However, depending on the scale and requirements of your network, it may be more advantageous to establish LAG bundle instead of relying on ECMP. This approach may helps mitigate platform-specific scaling challenges and prevents unnecessary interference with your IGP<\/li>\n\n\n\n<li>Set a more aggressive setting for LACP (.i.e. fast or short LACP), ensuring faster periodic updates, while allowing BFD timers to be slightly longer; however, this is sometimes not available or not tunable enough depending on the router vendor\/OS<\/li>\n<\/ol>\n\n\n\n<p class=\"has-text-color has-link-color has-medium-font-size wp-elements-2b411c4e6c434d7f5d3848e87a919a47 wp-block-paragraph\" style=\"color:#e50055\"><strong>RFC 7130 approach to resolve this<\/strong> :<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Micro-BFD<\/strong> : Integrating BFD across all LAG member links which necessitates the BFD code&#8217;s understanding of LAG configurations, enabling it to verify connectivity independently across each constituent link. It will depend on vendor, and their OS, if they did develop this functionality <a href=\"https:\/\/datatracker.ietf.org\/doc\/html\/rfc7130\" target=\"_blank\" rel=\"noopener\" title=\"\">Consulting RFC 7130 <\/a>offers additional information.)<\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"934\" height=\"502\" src=\"https:\/\/www.lastopinion.io\/wp-content\/uploads\/2024\/03\/LAG_Routing_BFD_Micro.png\" alt=\"\" class=\"wp-image-4393013\" style=\"width:526px;height:auto\" srcset=\"https:\/\/www.lastopinion.io\/wp-content\/uploads\/2024\/03\/LAG_Routing_BFD_Micro.png 934w, https:\/\/www.lastopinion.io\/wp-content\/uploads\/2024\/03\/LAG_Routing_BFD_Micro-480x258.png 480w\" sizes=\"(min-width: 0px) and (max-width: 480px) 480px, (min-width: 481px) 934px, 100vw\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Should even a single micro BFD session be Up, the port-channel session will reflect its state as Up.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Some vendors support the RFC<\/strong> <strong>7130<\/strong> :<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Juniper : https:\/\/www.juniper.net\/documentation\/us\/en\/software\/junos\/high-availability\/topics\/task\/bfd-protocol-configuring-micro-bfd-for-lag.html<\/li>\n\n\n\n<li>Cisco NX-OS and XE : https:\/\/www.cisco.com\/c\/en\/us\/td\/docs\/routers\/ios\/config\/17-x\/ip-routing\/b-ip-routing\/m-micro-bfd-sessions.html<\/li>\n\n\n\n<li>Cisco XR (named BLB &amp; BOB) : https:\/\/www.cisco.com\/c\/en\/us\/td\/docs\/routers\/asr9000\/software\/asr9k-r6-9\/routing\/configuration\/guide\/b-routing-cg-asr9000-69x\/implementing-bfd.html<\/li>\n\n\n\n<li>Arista : https:\/\/www.arista.com\/en\/um-eos\/eos-bidirectional-forwarding-detection<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Other still not :<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Palo Alto Firewalls : https:\/\/docs.paloaltonetworks.com\/pan-os\/11-1\/pan-os-networking-admin\/bfd\/bfd-overview\/non-supported-rfc-components-of-bfd<\/li>\n\n\n\n<li>Fortinet Firewalls not supported<\/li>\n<\/ul>\n\n\n\n<p class=\"has-text-color has-link-color has-medium-font-size wp-elements-23e3f632e933a06a931388cdf3ac9b1b wp-block-paragraph\" style=\"color:#e50055\"><strong>In conclusion<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Configuring BFD is simple, configuring LAG bundle is simple, but configuring both need some intereaction and anticipation, the more protocols you add together in your design, the more complexity and unexpected results you may have.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">So regarding micro-bfd, at the end, depending on your specific requirements, this may not be necessary, and simplicity could be prioritized since enabling micro-BFD may come with certain limitations, which can vary depending on the vendor (make sure to refer to the vendor configuration guide for specific details). Ultimately, as always, you have to consider the required resilience level and adherence to your SLA objectives.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Are you considering tuning your network or do you have any questions about it? We can assist you. You can reach out to us through the&nbsp;<a href=\"https:\/\/www.lastopinion.io\/index.php\/contact-us\/\" target=\"_blank\" rel=\"noreferrer noopener\">CONTACT-US<\/a>&nbsp;page or by emailing us at&nbsp;<a href=\"mailto:contact@lastopinion.io\">contact@lastopinion.io<\/a>&nbsp;for advise assistance.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/www.linkedin.com\/in\/mehdi-sfar-b4a42910\/\" target=\"_blank\" rel=\"noreferrer noopener\">Mehdi SFAR (CCDE 2021:3, CCIE #51583)<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>You might face a situation where you&#8217;re considering establishing a LAG port (whether using LACP, manual configuration, etc.), or perhaps you&#8217;re planning a maintenance window and considering shutting down a link within a LAG port, assuming it won&#8217;t affect the routing protocol due to the typically rapid convergence time of LAG. Well, it might be [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":4393004,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_et_pb_use_builder":"off","_et_pb_old_content":"","_et_gb_content_width":"","footnotes":""},"categories":[18],"tags":[36,13,16,38,37,39,17,14,40],"class_list":["post-4392992","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-blog","tag-bfd","tag-bgp","tag-ccde","tag-lacp","tag-lag","tag-micro-bfd","tag-network-architect","tag-network-design","tag-rfc-7130"],"_links":{"self":[{"href":"https:\/\/www.lastopinion.io\/index.php\/wp-json\/wp\/v2\/posts\/4392992","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.lastopinion.io\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.lastopinion.io\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.lastopinion.io\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.lastopinion.io\/index.php\/wp-json\/wp\/v2\/comments?post=4392992"}],"version-history":[{"count":29,"href":"https:\/\/www.lastopinion.io\/index.php\/wp-json\/wp\/v2\/posts\/4392992\/revisions"}],"predecessor-version":[{"id":4393089,"href":"https:\/\/www.lastopinion.io\/index.php\/wp-json\/wp\/v2\/posts\/4392992\/revisions\/4393089"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.lastopinion.io\/index.php\/wp-json\/wp\/v2\/media\/4393004"}],"wp:attachment":[{"href":"https:\/\/www.lastopinion.io\/index.php\/wp-json\/wp\/v2\/media?parent=4392992"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.lastopinion.io\/index.php\/wp-json\/wp\/v2\/categories?post=4392992"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.lastopinion.io\/index.php\/wp-json\/wp\/v2\/tags?post=4392992"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}