BGP Route reflector routing loop arise in IP networks. In this post, I will illustrate the topology which will loop the IP packets between the routers and I will describe multiple possible solution and share a best practice to design BGP Route Reflector in an IP network.
I am explaining this topic in deep detail in my Live/Webex “BGP Zero to Hero” course. Click here for our Special Offer.
BGP Route Reflector Routing loop problem arise in an IP network. Let’s look at the above topology.
R3 is the Route Reflector Client of R1, R2 is route reflector client of R4.
Dashed lines are the IBGP peering links and there is no cross-connect links between R2-R4 and R3-R1.
When IP packet comes to R3 let’s say, R3 does the IP destination based lookup for the BGP prefixes.
BGP prefixes are installed in the IP routing table as BGP route and BGP next hop should be known and reachable for the BGP prefixes.
When R3 does IP destination based lookup for the BGP prefixes, it finds R1 as BGP next hop. Second IP lookup is done R3 to find how to reach R1, of course, R1 is reachable via R2 which is the IGP next hop of R3 to reach R1.
Packet is sent to R2 by R3.
When R2 gets the packet, it does exactly the same things.
IP routing lookup for the BGP destination prefix and find the BGP next hop. This time the BGP next hop is R4, and second lookup is done by R2 to find how to reach R4. R4 as a BGP next hop of R2 , is reachable via R3.
And R2 sends the IP packet back to R3.
When R3 gets the packet, you know what will happen anymore I think. It will do double lookup and sends the packet to R2.
This is a routing loop.
And it is permanent. It will continue forever. Yes there is TTL and that packet will be eventually dropped.
But new packet will come for another BGP prefix and this process will start again.
What are the solutions to prevent BGP routing loop ?
- If in the first place, R2 would be BGP Route Reflector client of R1 and R3 would be BGP Route Reflector client of R4, this problem wouldn’t happen.
Because, when the packet comes to R3 for the first time, BGP next hop would be R4 and second loop for reaching to BGP next hop would be done and R4 would be found as an IGP next hop and packet would be sent to R4 directly. No loop, packet reaches to destination.
This is called, BGP Route Reflector logical topology follows physical topology. And this is an important design best practice in IP network when BGP Route Reflector is used.
2. Let’s say, we don’t follow the best practice design, in that case if we would have R3-R1 and R2-R4 cross-connect physical links, when the R3 does the IP destination lookup for BGP prefix, R1 would still be found as a BGP next hop but IGP next hop for the BGP next hop would be direct physical link.
3. Another solution would be any type of tunneling between the edge device and the BGP next hop. GRE, L2TPv3, MPLS.
If you would have MPLS LSP between R3 and R1 let’s say, when packet comes the R3, R3 would do the IP destination based lookup and for the BGP next hop, it would have an MPLS Label assigned by R2.
Thus R3 would forward the MPLS packet to R2, when R2 receives the packet, R2 would do MPLS label switching , not the IP destination based lookup for the BGP prefix. If PHP is enabled, R2 would POP the label and sent the packet to R1.
BGP Route Reflector topology should follow the physical topology, otherwise routing loop may occur. This wouldn’t be a problem in MPLS networks.
BGP Route Reflector routing loop is a permanent loop, not a micro loop and cause severe damage for the applications.