08-13-2010 02:48 PM - edited 03-04-2019 09:25 AM
I have a possible scenario where i think we may get a routing loop due to BGP but I'm not 100% certain this will happen. As this is a theorectical design right now I can't test it but I wanted to propose it here first before labing it.
We have a customer who is multi-homed to 2 different AS's. They are prepending their network advertisements to AS"2" so to prefer AS"1" for incomming traffic.
They also are asking to change the Local Preference for the routes they advertise to AS"2" within AS"2" using a community $ that has been established by AS"2". This works. The customer advertises their networks to AS"2" with community $ 2:90 and this is matched by AS"2" and these routes are set to Local-Pref 90. Routes from AS"1" are recieved from AS"xxx" who peers with AS"1" and AS"2" and default to Local-Preference 100 on AS"2".
What this means now is that AS"2" is recieving prefered routes from AS"1" - via AS"xxx" and these would be prefered anyway due to the pre-pending and shortest match rule of AS_PATH attribute, however now that the Local-Pref is set within AS"2" it is this that is the initial decision maker as to the Route from AS"1" being prefered.
This all works fine and yes there really there is no need for this Local-Pref but that's not the question. The question is, is it just pointless to do this, or could it actually cause a problem.
Here's the proposed...
Given the above, let's say that now AS"1"'s path to AS"2" all of a sudden becomes 10 hops (someone killed half the internet), now when AS"xxx" is trying to get to the customers advertised networks, they would now see the advertisement from AS"2" as being less AS_Path hops, and thus preffered. Traffic would route to AS"2", but when it hits AS"2", AS"2" still has this Local-Preference set lower for the route it's learning from the customer and thus AS"1" route is prefered on AS"2", thus the traffic would route back to AS"xxx" and start looping in a blackhole.
Normal condition:
_______________AS"1"_____________________
/ \
Customer AS AS"xxx"
pre-pend x 5 \__local-pref 90___AS"2"_____local-pref 100_____/
Path to customer AS from AS"2" is via AS"xxx" as loca-pref 100 wins. Without local-pref path would be to AS"xxx" anyway due to AS_Path.
Fault condition
______AS"n*10"_________ (as_path now 10 hops)
______AS"1"____/ \
/ \
Customer AS AS"xxx"
pre-pend x 5 \__local-pref 90___AS"2"_____local-pref 100_____/
Traffic from AS"xxx" to Customer AS networks would take the AS"2" route due to AS_PATH, but would they hairpin back at AS"2" due to the preference of the AS"xxx" path in Local-Preference ?
I'm thinking that this is not the case and there is something I'm missing here that would stop this but I can't put my finger on it.
Solved! Go to Solution.
08-15-2010 03:04 PM
Hello Richard,
Actually, thanks to you asking further, I have discovered that I was incorrect in my original assesment of the situation. The ASxxx will continue using the longer path without going through AS2. I originally stated that the ASxxx will start using the AS2 to reach the customer - I was wrong. I apologize sincerely for misleading you. Please read further for the rationale behind all of this.
Let's break things down in simple steps. Before "the internet disaster", let's go over the sequence of steps as the network converges:
Now, when the "internet disaster" ensues, the following will happen:
As you can see here, introducing the local preference into the configuration actually changed the expected behavior - the AS2 will remain stuck to ASxxx as long as it gets, and as a result, ASxxx will never consider using the AS2 as a better route towards the customer.
If, however, the local preference was not modified, the sequence of events after the "internet disaster" would be as follows:
I hope this clarifies the things. In any case, you are welcome to ask further!
Best regards,
Peter
08-13-2010 03:22 PM
Hello Richard,
The routing loop should not form. Note that in the case that "half of the internet get killed", you are stating quite correctly that the AS "xxx" would use the AS 2 to reach the customer, obviously because of the shorter AS_PATH from AS "xxx" through AS 2 towards the customer.
However, in order for the AS 2 to loop back to AS "xxx", it requires that the AS 2 receives and accepts the route advertisement from AS "xxx". This is not possible because when AS "xxx" advertises the customer routes back to the AS 2, the AS_PATH attribute already contains the AS 2. Such a route would be immediately discarded by AS 2 routers without being processed or installed into the BGP database, so no loop can be formed.
Best regards,
Peter
08-14-2010 08:37 AM
Thanks Peter,
Doesn't this mean that traffic will be backholed though as it will be sent to ASxxx but not accepted ?
08-14-2010 06:25 PM
Hello Richard,
Don't confuse data traffic with routing updates. What I was talking about were the BGP routing updates. AS 2 will simply not accept any routing update that already traversed through AS 2, therefore it is impossible for AS 2 and AS xxx to mutually point to each other.
The data traffic will not be blackholed. If the AS xxx receives a routing update from AS 2 about the customer networks then the AS 2 already knows the path towards the customer. In other words, when AS 2 advertises the customer networks to its neighboring ASes, it is already ready to route the packets towards the customer.
Does this answer your question? Please ask further if there is any thing unclear!
Best regards,
Peter
08-15-2010 01:16 PM
Thanks Peter,
I apreciate you taking the time to respond here.
I understand that when AS2 advertises the the route back to ASxxx it won't be accepted by ASxxx as it's own AS will be present in the AS_Path list.
However, when the traffic comes to AS2, due to the "half the internet died" issue. i.e. the route from AS2 is now a smaller AS_Path count than that advertised via AS1, the prefered route inside AS2 is still going to point to the recieved route from AS1, regardless of the AS_Path hop count as AS2 has set the local-preference on the route from the CustomerAS to 90 vs the route it is still getting from AS1 being 100.
I'm concerned that traffic will take the route to AS2 and then loop back to ASxxx when it hit AS2 due to this inconsitancy between the locally prefered route on AS2 and the rest of the internet as Local Pref is not transative over an eBGP peer. Obviously ASxxx will then try sending it back to AS2.
Thoughts?
08-15-2010 03:04 PM
Hello Richard,
Actually, thanks to you asking further, I have discovered that I was incorrect in my original assesment of the situation. The ASxxx will continue using the longer path without going through AS2. I originally stated that the ASxxx will start using the AS2 to reach the customer - I was wrong. I apologize sincerely for misleading you. Please read further for the rationale behind all of this.
Let's break things down in simple steps. Before "the internet disaster", let's go over the sequence of steps as the network converges:
Now, when the "internet disaster" ensues, the following will happen:
As you can see here, introducing the local preference into the configuration actually changed the expected behavior - the AS2 will remain stuck to ASxxx as long as it gets, and as a result, ASxxx will never consider using the AS2 as a better route towards the customer.
If, however, the local preference was not modified, the sequence of events after the "internet disaster" would be as follows:
I hope this clarifies the things. In any case, you are welcome to ask further!
Best regards,
Peter
08-15-2010 03:41 PM
Exellent, thank you.
The key piece I was missing was that AS2(edit) would never advertise it's direct route to CustomerAS as it's only advertises the best route which would always be the route from AS2.
Thanks for working through this with me. This was a quite a comlex issue and although I knew there was something I wasn't considering it was only through talking it through here that it came clear.
FYI - I am AS2 and I will be advising our customer not to apply this local-preference as it would only be of use if the AS_Path becomes excessive. In such a scenario it would be benefical to utilize the inherant nature of BGP here to re-route traffic away from such an "internet disaster". So long as AS_Path is prepended correctly and with enough hops to cope with smaller issues this is surely the way to go.
Thnaks again for your quick responses here. I've very much enjoyed the discussion.
R./
08-15-2010 11:22 PM
Richard,
The pleasure was mine. I have also enjoyed our discussion here very much.
Regarding that local preference - I agree with you, the customer should be advised against using it. The local preference is the second tiebreaker in the BGP best path algorithm (the first being the weight attribute) while the AS_PATH length is the fourth step. Thus, having a higher local preference will suffice to select the best path without taking the legth of AS_PATH into consideration. In your scenario, the resulting routing would not be optimal.
Thank you again for discussing this issue here on NetPro, and please feel yourself welcome to continue participating in the discussions here :-)
Best regards,
Peter
02-07-2013 10:13 PM
Hello Richard,
My company Diagram below. both site is configured with e-BGP & PFR (MC/BR), problem is packet send on 1 link and receive 2nd link. how to resolve.
Mahadev Patil
02-08-2013 05:45 AM
Hi Mahadev,
From the little info you gave here it look like you've created yourself a nice layer2 loop. I don't think this is related to the thread so if you want more advice I suggest you create a new one if what I'm saying here doesn't help you.
If what you've drawn here is one giant layer2-broadcast domain with the LAN links on either side being in the same vlan and the MPLS links being p2p or VPLS layer2 then the behavior you mentioned is to be expected albeit not what you want.
What confuses me is you're saying you have eBGP here so maybe I'm missing something. Where is the layer2/3 boundary here. Are you peering eBGP with the service-providers here or are they just handing you a vlan or a layer2 port?
02-13-2013 09:20 PM
Hi Richard,
This is the layer3 topology. Our company have use BGP routing protocol to communicate both ISP.
The PFR techonology use to load balancing traffic on both ISP.
02-14-2013 05:37 AM
Hey Mahadev,
I recommend that you start a new thread on this. You'll get more input from the rest of the folks here this way and right now I have limited time. Try explaining this in terms of packet flow with a specific example. Also if you post your router configs this will help but remove any passwords or interface descriptions that could be a security concern.
R./
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide