cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
748
Views
10
Helpful
5
Replies

AS_Path Prepend: Why doesnt this create a (false) routing loop hazard?

MicJameson
Level 1
Level 1

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!

5 Replies 5

Joseph W. Doherty
Hall of Fame
Hall of Fame

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.

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.

Jon Marshall
Hall of Fame
Hall of Fame

 

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

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. 

HTH

Rick

Giuseppe Larosa
Hall of Fame
Hall of Fame

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

 

 

Review Cisco Networking for a $25 gift card