cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2387
Views
0
Helpful
2
Replies

bgp route selection, age of the route.

sarahr202
Level 5
Level 5

Hi everybody.

According to my book, a bgp router can  also break a tie by choosing older route over the newer one .

Below,R4 is advertising 40.0.0.0 to its ebgp peer R1 and R2 with default values.  R1,R2 and R3 are running RIP as igp.

R2 and R1 then advertise 40.0.0.0/8 to their common ibgp peer R3. R3  is receiving bgp updates from R2 and R3 with the same As path length.

According to my book( med is same,there is only ibgp), next tie breaker will be R3 igp metric to reach R2 and R3 which is same for R2. The next item to break the tie is age of the route.

For some reason, In my example R3 does not use this factor( i.e age of the route) to break the tie.

     

R3---AS1-199.199.199.0-R1---198.198.198.0----R4-(AS 2) 40.0.0.0/8
    |                                            |
    |                                            |
    |----AS1 196.196.196.0--R2---200.200.200.200.|

Above R1,R2 and R3 are in AS1 , using Rip as IgP.

R2 and R3 are peering with R4 in As 2. R4 is advertising 40.0.0.0/8 to its ebgp peers R1 and R2.

Above R3 is receiving up date with default values from R1 and R2.

R3 is using the following tie breakers to choose the best path:

1) weight, (2) Local pref (3) locally generated (4) As path (5) ebgp over ibgp (6) lower Igp metric to neighbor
7) older route (8) lower router id.


Above R3 will use (7) to break the tie because igp metric is same ( rip hop count is 1) to reach R2 and R1 from R1.


R3#show ip bgp
BGP table version is 3, local router ID is 3.3.3.3
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
              r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete

   Network          Next Hop            Metric LocPrf Weight Path
*>i40.0.0.0         198.198.198.4            0    100      0 2 i
* i                 200.200.200.4            0    100      0 2 i

I want to see if the route through 198.198.198.4 is indeed selected because it is an older route.

I will shutdown the interfaces on R3 connected to R2 and R1. Clear the bgp process. Then first enable the int connected to R2 this way the route  through 200.200.200.4 will be older . Then I will enable the int connected to R1 .I am expecting R3 to choose the path through R2 ( 200.200.200.4) over 198.198.198.4 because it is the older route.


R3#show ip bgp
BGP table version is 3, local router ID is 3.3.3.3
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
              r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete

   Network          Next Hop            Metric LocPrf Weight Path
* i40.0.0.0         200.200.200.4            0    100      0 2 i
*>i                 198.198.198.4            0    100      0 2 i


R3(config)#int f0/0
R3(config-if)#shutdown

R3(config-if)#int f0/1
R3(config-if)#shutdown

R3#clear ip bgp *

R3#show ip bgp


I am enabling f0/1 on R3 connected to R2 first thus route through R2 to 40.0.0.0/8 will be older.


R3(config)#int f0/1
R3(config-if)#no shutdown

R3#show ip bgp
BGP table version is 2, local router ID is 3.3.3.3
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
              r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete

   Network          Next Hop            Metric LocPrf Weight Path
*>i40.0.0.0         200.200.200.4            0    100      0 2 i

Next I enable the f0/0 on R3 connected to R1 thus making the route through R1 to 40.0.0.0/8 newer

R3(config)#int f0/0
R3(config-if)#no shutdown

R3#show ip bgp
BGP table version is 3, local router ID is 3.3.3.3
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
              r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete

   Network          Next Hop            Metric LocPrf Weight Path
*>i40.0.0.0         198.198.198.4            0    100      0 2 i
* i                 200.200.200.4            0    100      0 2 i


R3 should have chosen the path through R2 (200.200.200.4) because it is older route than through R1

I have attached the running configs at the end of this post.

Thanks and have a great weekend.

===========================================================================================

R1#show running-config
Building configuration...

Current configuration : 1204 bytes
!
version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname R1
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
memory-size iomem 5
ip cef

!
!
!
interface FastEthernet0/0
ip address 199.199.199.1 255.255.255.0
duplex auto
speed auto
!
interface FastEthernet0/1
ip address 198.198.198.1 255.255.255.0
duplex auto
speed auto
!
router rip
passive-interface FastEthernet0/1
network 198.198.198.0
network 199.199.199.0
!
router bgp 1
no synchronization
bgp router-id 1.1.1.1
bgp log-neighbor-changes
neighbor 198.198.198.4 remote-as 2
neighbor 199.199.199.3 remote-as 1
no auto-summary
!
ip forward-protocol nd
!
!

!
line con 0
exec-timeout 0 0
privilege level 15
logging synchronous
line aux 0
exec-timeout 0 0
privilege level 15
logging synchronous
line vty 0 4
login
!
!
end

R1#

=========================================================================================================

R2#show running-config
Building configuration...

Current configuration : 1204 bytes
!
version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname R2
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
memory-size iomem 5
ip cef
!
!
!
!
no ip domain lookup
ip domain name lab.local
ip auth-proxy max-nodata-conns 3
ip admission max-nodata-conns 3
!
multilink bundle-name authenticated

!
interface FastEthernet0/0
ip address 196.196.196.2 255.255.255.0
duplex auto
speed auto
!
interface FastEthernet0/1
ip address 200.200.200.2 255.255.255.0
duplex auto
speed auto
!
router rip
passive-interface FastEthernet0/1
network 196.196.196.0
network 200.200.200.0
!
router bgp 1
no synchronization
bgp router-id 2.2.2.2
bgp log-neighbor-changes
neighbor 196.196.196.3 remote-as 1
neighbor 200.200.200.4 remote-as 2
no auto-summary
!

!
line con 0
exec-timeout 0 0
privilege level 15
logging synchronous
line aux 0
exec-timeout 0 0
privilege level 15
logging synchro

====================================================================


R3#show running-config
Building configuration...

Current configuration : 1169 bytes
!
version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname R3
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
memory-size iomem 5
ip cef
!
!
!
!
no ip domain lookup
ip domain name lab.local
ip auth-proxy max-nodata-conns 3
ip admission max-nodata-conns 3
!
multilink bundle-name authenticated

!
interface FastEthernet0/0
ip address 199.199.199.3 255.255.255.0
duplex auto
speed auto
!
interface FastEthernet0/1
ip address 196.196.196.3 255.255.255.0
duplex auto
speed auto
!
router rip
network 196.196.196.0
network 199.199.199.0
!
router bgp 1
no synchronization
bgp router-id 3.3.3.3
bgp log-neighbor-changes
neighbor 196.196.196.2 remote-as 1
neighbor 199.199.199.1 remote-as 1
no auto-summary
!

line con 0
exec-timeout 0 0
privilege level 15
logging synchronous
line aux 0
exec-timeout 0 0
privilege level 15
logging synchronous
line vty 0 4
login
!
!
end

R3#

======================================================================================================

R4#show running-config
Building configuration...

Current configuration : 1184 bytes
!
version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname R4
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
memory-size iomem 5
ip cef
!
!
!
!
no ip domain lookup
ip domain name lab.local
ip auth-proxy max-nodata-conns 3
ip admission max-nodata-conns 3
!
multilink bundle-name authenticated
!
archive
log config
  hidekeys
!
interface Loopback40
ip address 40.40.40.4 255.0.0.0
!
interface FastEthernet0/0
ip address 198.198.198.4 255.255.255.0
duplex auto
speed auto
!
interface FastEthernet0/1
ip address 200.200.200.4 255.255.255.0
duplex auto
speed auto
!
router bgp 2
no synchronization
bgp router-id 4.4.4.4
bgp log-neighbor-changes
network 40.0.0.0
neighbor 198.198.198.1 remote-as 1
neighbor 200.200.200.2 remote-as 1
no auto-summary
!
ip forward-protocol nd
!
!
no ip http server
no ip http secure-server
!
control-plane
!
!
line con 0
exec-timeout 0 0
privilege level 15
logging synchronous
line aux 0
exec-timeout 0 0
privilege level 15
logging synchronous
line vty 0 4
login
!
!
end

R4#

1 Accepted Solution

Accepted Solutions

Raju Sekharan
Cisco Employee
Cisco Employee

Hi

if you look at the BGP best path Algorithm

"When both paths are external, prefer the path that was received first           (the oldest one)."

But in your case both paths are IBGP. So it goes to next step

"Prefer the route that comes from the BGP router with the lowest           router ID."

http://www.cisco.com/en/US/tech/tk365/technologies_tech_note09186a0080094431.shtml

Thanks

Raju

View solution in original post

2 Replies 2

Raju Sekharan
Cisco Employee
Cisco Employee

Hi

if you look at the BGP best path Algorithm

"When both paths are external, prefer the path that was received first           (the oldest one)."

But in your case both paths are IBGP. So it goes to next step

"Prefer the route that comes from the BGP router with the lowest           router ID."

http://www.cisco.com/en/US/tech/tk365/technologies_tech_note09186a0080094431.shtml

Thanks

Raju

Good Catch Raj