01-28-2022 07:28 AM
Hello.
If BGP uses AS_PATH attribute to detect routing loops by checking if there exists duplicate same autonomous systems, then how can the engineer successfully add additional ASs to the AS_PATH attribute as a technique to alter route selection?
I expect my issue lies in my unclear understanding of which duplicate ASs cause the router to expect routing loops.
Please clarify for me. Thank you!
01-28-2022 07:58 AM
I recall route selection, using prepended ASNs, is mainly done by increasing the number of AS hops, not, generally, to create a different AS path.
01-28-2022 08:01 AM
simply by add same as number not add other number,
For example as 100 we will prepend use
100,100,100 ...
This not broke loop rule and use the as prepend to prefere path.
01-29-2022 09:46 AM
The rule is if an EBGP peer sees it's own AS in the path then it would not accept the advertisement as this could cause a loop although you can override this behaviour if you want.
As you are prepending your own AS in an advertisement to another EBGP peer then that does not cause an issue.
Jon
01-29-2022 10:10 AM
I like the approach that Jon suggests. The loop detection is when you are looking at advertisements received from a neighbor. If you look into the advertisement and see your AS already in the path then this is an indication of a loop. The advertisement has been in your AS, has been through other ASes, and now is back to your AS. The fact that your AS would appear in the path in 2 different places in the path is the issue.
When you prepend you are manipulating what you advertise to a neighbor. And even though your AS would appear in the path more than once, the occurrences are contiguous and would not cause a loop.
02-01-2022 09:58 AM
Hello @MicJameson ,
many years ago I have worked on a software suite called "Matrix" for analyzing BGP internet tables.
Prepending your own AS path is the only safe way to prepend
A typical AS path attribute is treated like a string ordered from left to right:
"<my peer> ASx ASy ASN"
where the leftmost AS is your eBGP peer and ASN is the target AS owner of the public IP prefix you have received from your peer your upstream iSP.
From the point of view of your upstream ISP the prefixes that you send have the following aspect:
"<yourAS>"
or
"<yourAS> <yourAS> <yourAS"
or
"<yourAS> <yourAS> <yourAS> <yourCustomerASw> " in the case you are a small ISP
AS path prepending is used in an attempt (not guaranteed) to influence the return path traffic to your public prefixes.
Warning: for the way the BGP output RIB works the AS path prepending adds to the AS path attribute before the update is built, so if you prepend your own AS two times the upstream provider will see three instances of your AS number as one is added in the act of advertising routes. Exactly as in the examples above.
Hope to help
Giuseppe
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