Tuesday, January 20, 2009

AS_SET not used in AS Path length comparison

I was reading Chapter 3 today of Routing TCP/IP Volume 2 and it says that AS_SET is not considered when determining shortest AS_PATH. So I decided to lab it and see for myself. R4 is learning the 192.168.0.0/16 aggregate from R5 and R7 each with differing AS_SET lengths.

R4#sho ip bgp | be Net
Network Next Hop Metric LocPrf Weight Path
* 192.168.0.0/16 192.168.47.7 0 0 7 {8,900} i
*> 192.168.45.5 0 0 5 {6,600,6000,3033} i

The longest one is winning! AS_SET does count as 1 AS by the way.

R4#sho ip bgp 192.168.0.0
BGP routing table entry for 192.168.0.0/16, version 4
Paths: (2 available, best #2, table Default-IP-Routing-Table)
Flag: 0x820
Advertised to update-groups:
1
7 {8,900}, (aggregated by 7 192.168.78.7)
192.168.47.7 from 192.168.47.7 (192.168.78.7)
Origin IGP, metric 0, localpref 100, valid, external
5 {6,600,6000,3033}, (aggregated by 5 192.168.56.5)
192.168.45.5 from 192.168.45.5 (192.168.56.5)
Origin IGP, metric 0, localpref 100, valid, external, best
R4#
All other things being equal it looks like the most recent path is winning. If we clear BGP on R5, R7 would be the most recent:

R5#clear ip bgp *
R5#
R5#
*Mar 1 01:34:11.475: %BGP-5-ADJCHANGE: neighbor 192.168.45.4 Down User reset
*Mar 1 01:34:11.479: %BGP-5-ADJCHANGE: neighbor 192.168.56.6 Down User reset
*Mar 1 01:34:11.667: %BGP-5-ADJCHANGE: neighbor 192.168.56.6 Up
*Mar 1 01:34:12.287: %BGP-5-ADJCHANGE: neighbor 192.168.45.4 Up

R4#sho ip bgp | be Net
Network Next Hop Metric LocPrf Weight Path
* 192.168.0.0/16 192.168.45.5 0 0 5 {6,600,6000,3033} i
*> 192.168.47.7 0 0 7 {8,900} i
R4#
For more details, you can read this document which I am sure we have all seen by now. But little things like this may be forgotten:

BGP PATH SELECTION

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.