Show text-ads on your Website or Blog with BidVertiser. Sell your ad space with BidVertiser Make money from your Website or Blog with BidVertiser

Thursday, April 21, 2016

Load Sharing When Multihomed to Two ISPs Through a Single Local Router

In this scenario, load balancing is not an option in a multihomed environment, so you can only do load sharing. You cannot do load balancing because BGP selects only a single best path to a destination among the BGP routes that are learned from the different ASs. The idea is to set a better metric for the routes in the range 1.0.0.0 to 128.0.0.0 that are learned from ISP(A) and a better metric for the rest of the routes that are learned from ISP(B). 


Network Diagram

This section uses this network setup:
40e.gif

Configurations

This section uses these configurations:
RouterA
interface Serial 0
 ip address 160.20.20.1 255.255.255.0
 no ip route-cache
    
interface Serial 1
 ip address 150.10.10.1 255.255.255.0
 no ip route-cache
   
router bgp 11
neighbor 160.20.20.2 remote-as 10
neighbor 160.20.20.2 route-map UPDATES-1 in

!--- This allows only the networks up to 128.0.0.0.

neighbor 150.10.10.2 remote-as 12
neighbor 150.10.10.2 route-map UPDATES-2 in

!--- This allows anything above the 128.0.0.0 network.

auto-summary
  
route-map UPDATES-1 permit 10
match ip address 1
set weight 100
 
route-map UPDATES-1 permit 20
match ip address 2
  
route-map UPDATES-2 permit 10
match ip address 1
  
route-map UPDATES-2 permit 20
match ip address 2
set weight 100
  
access-list 1 permit 0.0.0.0  127.255.255.255
access-list 2 deny 0.0.0.0 127.255.255.255
access-list 2 permit any
RouterB
interface Loopback0
 ip address 2.2.2.2 255.255.255.0
int loopback 1
 ip address 170.16.6.5 255.255.255.0
 
interface Serial 0
 ip address 160.20.20.2 255.255.255.0
 no ip route-cache
  
router bgp 10
neighbor 160.20.20.1 remote-as 11
network 2.0.0.0
network 170.16.0.0
auto-summary
RouterC
interface Loopback0 
 ip address 170.16.6.6 255.255.255.0
 
interface Loopback1 
 ip address 2.2.2.1 255.255.255.0
  
interface Serial 1
 ip address 150.10.10.2 255.255.255.0
 no ip route-cache
  
router bgp 12
neighbor 150.10.10.1 remote-as 11
network 2.0.0.0 
network 170.16.0.0
auto-summary

Verify

Use this section to confirm that your configuration works properly.
The Output Interpreter Tool (registered customers only) (OIT) supports certain show commands. Use the OIT to view an analysis of show command output.
The output from the show ip route command and the output from the traceroute command show that any network lower than 128.0.0.0 exits RouterA through 160.20.20.2. This route is the next hop out of the serial 0 interface. The rest of the networks exit through 150.10.10.2, which is the next hop out of the serial 1 interface.
RouterA# show ip route

!--- Output suppressed.

Gateway of last resort is not set
B  170.16.0.0/16 [20/0] via 150.10.10.2, 00:43:43   
!--- This is the next hop out through serial 1.

B  2.0.0.0/8 [20/0] via 160.20.20.2, 00:43:43    
!--- This is the next hop out through serial 0.

    160.20.0.0/24 is subnetted, 1 subnets
C   160.20.20.0 is directly connected, Serial0
    150.10.0.0/24 is subnetted, 1 subnets
C   150.10.10.0 is directly connected, Serial1

RouterA# show ip bgp

BGP table version is 3, local router ID is 160.20.20.1
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal
Origin codes: i - IGP, e - EGP, ? - incomplete
 Network Next Hop Metric LocPrf Weight Path
   Network          Next Hop            Metric LocPrf Weight Path
*  2.0.0.0          150.10.10.2              0             0 12 i
*>                  160.20.20.2              0           100 10 i
*  170.16.0.0       160.20.20.2              0             0 10 i
*>                  150.10.10.2              0           100 12 i
  
RouterA# traceroute  2.2.2.2

Type escape sequence to abort.
Tracing the route to 2.2.2.2 

1   160.20.20.2 16 msec * 16 msec 

RouterA# traceroute  170.16.6.6

Type escape sequence to abort.
Tracing the route to 170.16.6.6

1   150.10.10.2 4 msec * 4 msec

Load Sharing When Dual-Homed to One ISP Through Multiple Local Routers

This scenario shows how to achieve load sharing when there are multiple connections to the same ISP through multiple local routers. The two eBGP peers are terminated on two separate local routers. Load balancing on the two links is not possible because BGP chooses the single best path among the networks that is learned from eBGP and internal BGP (iBGP). Load sharing among the multiple paths to AS 10 is the next-best option. With this type of load sharing, traffic to specific networks, on the basis of predefined policies, travels through both links. Additionally, each link acts as a backup to the other link, in case one link fails.
For simplicity, assume that the BGP routing policy for AS 11 is:
  • AS 11 accepts the local routes from AS 10, along with a default for the rest of the Internet routes.
  • The outbound traffic policy is:
    • All traffic that is destined to the Internet from R101 goes out through the R101-R103 link.
    • If the R101-R103 link fails, then all traffic to the Internet from R101 goes through R102 to AS 10.
    • Similarly, all traffic that is destined to the Internet from R102 goes through the R102-R104 link.
    • If the R102-R104 link fails, then all traffic to the Internet from R102 goes through R101 to AS 10.
  • The inbound traffic policy is:
    • Traffic that is destined for network 192.168.11.0/24 from the Internet should come from the R103-R101 link.
    • Traffic that is destined for network 192.168.12.0/24 from the Internet should come from the R104-R102 link.
    • If one link to AS 10 fails, then the other link should route the traffic that is destined for all networks back to AS 11 from the Internet.
In order to achieve this, 192.168.11.0 is announced from R101 to R103 with a shorter AS_PATH than is announced from R102 to R104. AS 10 finds the best path through the R103-R101 link. Similarly, 192.168.12.0 is announced with a shorter path through the R102-R104 link. AS 10 prefers the R104-R102 link for traffic that is bound to 192.168.12.0 in AS 11.
For outbound traffic, BGP determines the best path on the basis of routes that are learned through eBGP. These routes are preferable to routes learned through iBGP. So R101 learns 10.10.34.0 from R103 through eBGP and from R102 through iBGP. The external path is selected over the internal path. So, if you look at the BGP table in the R101 configuration, the route toward 10.10.34.0 would be through the R101-R103 link, with next hop 10.10.13.3. On R102, the route toward 10.10.34.0 would be through the R102-R104 link, with next hop 10.10.24.4. This achieves load sharing for traffic that is destined to 10.10.34.0. Similar reasoning applies to the default routes on R101 and R102. For more information on BGP path selection criteria, refer to BGP Best Path Selection Algorithm.

Network Diagram

 

 

This section uses this network setup:
40c.gif

Configurations

This section uses these configurations:
  • R101
  • R102
  • R103
  • R104
R101
hostname R101

!
interface Ethernet0/0
 ip address 192.168.11.1 255.255.255.0 secondary
 ip address 192.168.12.1 255.255.255.0
!
interface Serial8/0
 ip address 10.10.13.1 255.255.255.0
!
router bgp 11
 no synchronization
 bgp log-neighbor-changes
 network 192.168.11.0
 network 192.168.12.0
 neighbor 10.10.13.3 remote-as 10
 neighbor 10.10.13.3 route-map R101-103-MAP out

!--- The AS_PATH is increased for 192.168.12.0.

 neighbor 192.168.12.2 remote-as 11
 neighbor 192.168.12.2 next-hop-self
 maximum-paths 2
 no auto-summary
!
access-list 1 permit 192.168.12.0
access-list 2 permit 192.168.11.0
route-map R101-103-MAP permit 10
 match ip address 1
 set as-path prepend 11 11 11
!         
route-map R101-103-MAP permit 20
 match ip address 2
R102
hostname R102
!

interface Ethernet0/0
 ip address 192.168.11.2 255.255.255.0 secondary
 ip address 192.168.12.2 255.255.255.0
!
interface Serial8/0
 ip address 10.10.24.2 255.255.255.0
!
router bgp 11
 no synchronization
 bgp log-neighbor-changes
 network 192.168.11.0
 network 192.168.12.0
 neighbor 10.10.24.4 remote-as 10
 neighbor 10.10.24.4 route-map R102-104-MAP out

!--- The AS_PATH is increased for 192.168.11.0.

 neighbor 192.168.12.1 remote-as 11
 neighbor 192.168.12.1 next-hop-self
 no auto-summary
!
access-list 1 permit 192.168.11.0
access-list 2 permit 192.168.12.0
route-map R102-104-MAP permit 10
 match ip address 1
 set as-path prepend 11 11 11
!         
route-map R102-104-MAP permit 20
 match ip address 2
!
R103
hostname R103
!
interface Ethernet0/0
 ip address 10.10.34.3 255.255.255.0
!
interface Serial8/0
 ip address 10.10.13.3 255.255.255.0
!
router bgp 10
no synchronization
 bgp log-neighbor-changes
 network 10.10.34.0 mask 255.255.255.0
 neighbor 10.10.13.1 remote-as 11
 neighbor 10.10.13.1 default-originate
 neighbor 10.10.34.4 remote-as 10
 neighbor 10.10.34.4 next-hop-self
 no auto-summary
 !
R104
hostname R104
!

interface Ethernet0/0
 ip address 10.10.34.4 255.255.255.0

!
interface Serial8/0
 ip address 10.10.24.4 255.255.255.0
!
router bgp 10
 no synchronization
 bgp log-neighbor-changes
 neighbor 10.10.24.2 remote-as 11
 neighbor 10.10.24.2 default-originate
 neighbor 10.10.34.3 remote-as 10
 neighbor 10.10.34.3 next-hop-self
 no auto-summary
!

Verify

This section provides information you can use to confirm your configuration is working properly.
Certain show commands are supported by the Output Interpreter Tool (registered customers only) , which allows you to view an analysis of show command output.

Verification When Both Links Between AS 11 and AS 10 Are Up

Verification of Outbound Traffic
Note: The greater-than sign (>) in the show ip bgp command output represents the best path to use for that network among the possible paths. Refer to BGP Best Path Selection Algorithm for more information.
The BGP table in R101 shows that the best path for all outgoing traffic to the Internet is through the R101-R103 link. The show ip route command output confirms the routes in the routing table.
R101# show ip bgp

BGP table version is 5, local router ID is 192.168.12.1
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal
Origin codes: i - IGP, e - EGP, ? - incomplete

   Network          Next Hop            Metric LocPrf Weight Path
* i0.0.0.0          192.168.12.2                  100      0 10 i
*>                  10.10.13.3                             0 10 i  
!--- This is the next hop of R103.

* i10.10.34.0/24    192.168.12.2                  100      0 10 i
*>                  10.10.13.3               0             0 10 i  
!--- This is the next hop of R103.

* i192.168.11.0     192.168.12.2             0    100      0 i
*>                  0.0.0.0                  0         32768 i
* i192.168.12.0     192.168.12.2             0    100      0 i
*>                  0.0.0.0                  0         32768 i

R101# show ip route

!--- Output suppressed.

Gateway of last resort is 10.10.13.3 to network 0.0.0.0

C    192.168.12.0/24 is directly connected, Ethernet0/0
C    192.168.11.0/24 is directly connected, Ethernet0/0
     10.0.0.0/24 is subnetted, 2 subnets
C       10.10.13.0 is directly connected, Serial8/0
B       10.10.34.0 [20/0] via 10.10.13.3, 00:08:53 
!--- This is the next hop of R103.

B*   0.0.0.0/0 [20/0] via 10.10.13.3, 00:08:53     
!--- This is the next hop of R103.

Here are the BGP and routing tables for R102. According to the policy, R102 should route all the traffic to AS 10 through the R102-R104 link:
R102# show ip bgp

BGP table version is 7, local router ID is 192.168.12.2
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal
Origin codes: i - IGP, e - EGP, ? - incomplete

   Network          Next Hop            Metric LocPrf Weight Path
*> 0.0.0.0          10.10.24.4                             0 10 i   
!--- This is the next hop of R104.

* i                 192.168.12.1                  100      0 10 i
*> 10.10.34.0/24    10.10.24.4                             0 10 i   
!--- This is the next hop of R104.

* i                 192.168.12.1             0    100      0 10 i
* i192.168.11.0     192.168.12.1             0    100      0 i
*>                  0.0.0.0                  0         32768 i
* i192.168.12.0     192.168.12.1             0    100      0 i
*>                  0.0.0.0                  0         32768 i

R102# show ip route

!--- Output suppressed.

Gateway of last resort is 10.10.24.4 to network 0.0.0.0

C    192.168.12.0/24 is directly connected, Ethernet0/0
C    192.168.11.0/24 is directly connected, Ethernet0/0
     10.0.0.0/24 is subnetted, 2 subnets
C       10.10.24.0 is directly connected, Serial8/0
B       10.10.34.0 [20/0] via 10.10.24.4, 00:11:21   
!--- This is the next hop of R104.

B*   0.0.0.0/0 [20/0] via 10.10.24.4, 00:11:21       
!--- This is the next hop of R104.

Verification of Inbound Traffic from AS 10 to AS 11
The networks 192.168.11.0 and 192.168.12.0 belong to AS 11. According to the policy, AS 11 should prefer the R103-R101 link for traffic that is destined to network 192.168.11.0 and the R104-R102 link for traffic that is destined to network 192.168.12.0.
R103# show ip bgp

BGP table version is 4, local router ID is 10.10.34.3
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal
Origin codes: i - IGP, e - EGP, ? - incomplete

   Network          Next Hop            Metric LocPrf Weight Path
*> 10.10.34.0/24    0.0.0.0                  0         32768 i
*> 192.168.11.0     10.10.13.1               0             0 11 i             
!--- The next hop is R101.

*  192.168.12.0     10.10.13.1               0             0 11 11 11 11 i   
*>i                 10.10.34.4               0    100      0 11 i             
!--- The next hop is R104.


R103# show ip route

!--- Output suppressed.

Gateway of last resort is not set

B    192.168.12.0/24 [200/0] via 10.10.34.4, 00:04:46  
!--- The next hop is R104.

B    192.168.11.0/24 [20/0] via 10.10.13.1, 00:04:46   
!--- The next hop is R101.

     10.0.0.0/24 is subnetted, 2 subnets
C       10.10.13.0 is directly connected, Serial8/0
C       10.10.34.0 is directly connected, Ethernet0/0
The best path for network 192.168.11.0 on R103 is through the R103-R101 link, and the best path for network 192.168.12.0 is through R104 to AS 11. In this case, the shortest path length determines the best path.
Similarly, on R104, the BGP and routing table resembles this:
R104# show ip bgp

BGP table version is 13, local router ID is 10.10.34.4
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal
Origin codes: i - IGP, e - EGP, ? - incomplete

   Network          Next Hop            Metric LocPrf Weight Path
*>i10.10.34.0/24    10.10.34.3               0    100      0 i
*>i192.168.11.0     10.10.34.3               0    100      0 11 i
*                   10.10.24.2               0             0 11 11 11 11 i
*> 192.168.12.0     10.10.24.2               0             0 11 i

R104# show ip route

!--- Output suppressed.

Gateway of last resort is not set

B    192.168.12.0/24 [20/0] via 10.10.24.2, 00:49:06    
!--- The next hop is R102.

B    192.168.11.0/24 [200/0] via 10.10.34.3, 00:07:36   
!--- The next hop is R103.

     10.0.0.0/24 is subnetted, 2 subnets
C       10.10.24.0 is directly connected, Serial8/0
C       10.10.34.0 is directly connected, Ethernet0/0

Verification When the R101-R103 Link Fails

When the R101-R103 link fails, all traffic should reroute through R102. This diagram illustrates this change:
40d.gif
Shut down the R103-R101 link on R103 in order to simulate this situation.
R103(config)# interface serial 8/0
R103(config-if)# shutdown

*May 1 00:52:33.379: %BGP-5-ADJCHANGE: neighbor 10.10.13.1 Down Interface flap  
*May 1 00:52:35.311: %LINK-5-CHANGED: Interface Serial8/0, changed state to 
 administratively down
*May 1 00:52:36.127: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial8/0, changed 
 state to down
Verify the outbound route to AS 10.
R101# show ip bgp

BGP table version is 17, local router ID is 192.168.12.1
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal
Origin codes: i - IGP, e - EGP, ? - incomplete

   Network          Next Hop            Metric LocPrf Weight Path
*>i0.0.0.0          192.168.12.2                  100      0 10 i   
!--- This is the next hop of R102.

*>i10.10.34.0/24    192.168.12.2                  100      0 10 i   
!--- This is the next hop of R102.

* i192.168.11.0     192.168.12.2             0    100      0 i
*>                  0.0.0.0                  0         32768 i
* i192.168.12.0     192.168.12.2             0    100      0 i
*>                  0.0.0.0                  0         32768 i

R101# show ip route

!--- Output suppressed.

Gateway of last resort is 192.168.12.2 to network 0.0.0.0

C    192.168.12.0/24 is directly connected, Ethernet0/0
C    192.168.11.0/24 is directly connected, Ethernet0/0
     10.0.0.0/24 is subnetted, 1 subnets
B       10.10.34.0 [200/0] via 192.168.12.2, 00:01:34
B*   0.0.0.0/0 [200/0] via 192.168.12.2, 00:01:34      
!--- All outbound traffic goes through R102.

     
R102# show ip route

!--- Output suppressed.

Gateway of last resort is 10.10.24.4 to network 0.0.0.0

C    192.168.12.0/24 is directly connected, Ethernet0/0
C    192.168.11.0/24 is directly connected, Ethernet0/0
     10.0.0.0/24 is subnetted, 2 subnets
C       10.10.24.0 is directly connected, Serial8/0
B       10.10.34.0 [20/0] via 10.10.24.4, 00:13:22
B*   0.0.0.0/0 [20/0] via 10.10.24.4, 00:55:22         
!--- All outbound traffic on R102 goes through R104.

Verify the inbound traffic route when R101-R103 is down.
R103# show ip bgp

BGP table version is 6, local router ID is 10.10.34.3
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal
Origin codes: i - IGP, e - EGP, ? - incomplete

   Network          Next Hop            Metric LocPrf Weight Path
*> 10.10.34.0/24    0.0.0.0                  0         32768 i
*>i192.168.11.0     10.10.34.4               0    100      0 11 11 11 11 i
*>i192.168.12.0     10.10.34.4               0    100      0 11 i

R103# show ip route

!--- Output suppressed.

Gateway of last resort is not set

B    192.168.12.0/24 [200/0] via 10.10.34.4, 00:14:55      
!--- The next hop is R104.

B    192.168.11.0/24 [200/0] via 10.10.34.4, 00:05:46      
!--- The next hop is R104.

     10.0.0.0/24 is subnetted, 1 subnets
C       10.10.34.0 is directly connected, Ethernet0/0
On R104, the traffic for 192.168.11.0 and 192.168.12.0 goes through the R104-R102 link.
R104# show ip route

!--- Output suppressed.

Gateway of last resort is not set

B    192.168.12.0/24 [20/0] via 10.10.24.2, 00:58:35    
!--- The next hop is R102.

B    192.168.11.0/24 [20/0] via 10.10.24.2, 00:07:57    
!--- The next hop is R102.

     10.0.0.0/24 is subnetted, 2 subnets
C       10.10.24.0 is directly connected, Serial8/0
C       10.10.34.0 is directly connected, Ethernet0/0

Load Sharing When Dual-Homed to One Internet Service Provider (ISP) Through a Single Local Router


This scenario shows how to achieve load sharing when multiple links exist between a remote AS and a local AS. These links are terminated in one router at the local AS and on multiple routers at remote ASs in a single-homed BGP environment. The Network Diagram is an example of such a network.
This sample configuration uses the maximum-paths command. By default, BGP chooses one best path among the possible equal-cost paths that are learned from one AS. However, you can change the maximum number of parallel equal-cost paths that are allowed. In order to make this change, include the maximum-paths paths command under the BGP configuration. Use a number between 1 and 6 for the paths argument.

Network Diagram

This section uses this network setup:
40b.gif

Configurations

This section uses these configurations:
  • RouterA
  • RouterB
  • RouterC 
RouterA
interface Loopback0                   
 ip address 1.1.1.1 255.255.255.0
!
interface Serial 0
 ip address 160.20.20.1 255.255.255.0
!
!  
interface Serial 1
 ip address 150.10.10.1 255.255.255.0
!
! 
router bgp 11
neighbor 160.20.20.2 remote-as 10
neighbor 150.10.10.2 remote-as 10
network 1.0.0.0
maximum-paths 2
 
RouterB
interface Ethernet0 
 ip address 2.2.2.1 255.255.255.0
!
interface Serial 0
 ip address 160.20.20.2 255.255.255.0
!
!
router bgp 10
neighbor 160.20.20.1 remote-as 11
network 2.0.0.0
auto-summary

RouterC
interface Ethernet0 
 ip address 2.2.2.2 255.255.255.0
!
interface Serial 1
 ip address 150.10.10.2 255.255.255.0
!
!
router bgp 10
neighbor 150.10.10.1 remote-as 11
network 2.0.0.0 
auto-summary

Verify

Use this section to confirm that your configuration works properly.
The Output Interpreter Tool (OIT) supports certain show commands. Use the OIT to view an analysis of show command output.
The output of the show ip route command shows that both of the paths to the 2.2.2.0 network are learned via BGP. The output of the traceroute command indicates that the load is distributed between two serial links. In this scenario, load sharing occurs on a per-destination basis. The show ip bgp command gives the valid entries for the 2.0.0.0 network.
RouterA# show ip route

!--- Output suppressed.

Gateway of last resort is not set

     1.0.0.0/24 is subnetted, 1 subnets
C       1.1.1.0 is directly connected, Loopback0
B    2.0.0.0/8 [20/0] via 150.10.10.2, 00:04:23
               [20/0] via 160.20.20.2, 00:04:01
     160.20.0.0/24 is subnetted, 1 subnets
C       160.20.20.0 is directly connected, Serial0
     150.10.0.0/24 is subnetted, 1 subnets
C       150.10.10.0 is directly connected, Serial1
 
RouterA# traceroute 2.2.2.2 

Type escape sequence to abort.
Tracing the route to 2.2.2.2

1 160.20.20.2 16 msec
    150.10.10.2 8 msec * 

RouterA# show ip bgp

BGP table version is 3, local router ID is 1.1.1.1
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal
Origin codes: i - IGP, e - EGP, ? - incomplete 
 
Network  Next Hop  Metric  LocPrf  Weight Path    
*> 1.0.0.0  0.0.0.0           0  32768  i    
*> 2.0.0.0  160.20.20.2  0    0  10 i    
*               150.10.10.2  0    0  10 i

Load Sharing with BGP in Single and Multihomed Environments

Introduction

Load sharing allows a router to distribute the outgoing and incoming traffic among multiple paths. The paths are derived either statically or with dynamic protocols, such as:
  • Routing Information Protocol (RIP)
  • Enhanced Interior Gateway Routing Protocol (EIGRP)
  • Open Shortest Path First (OSPF) Protocol
  • Interior Gateway Routing Protocol (IGRP)
By default, Border Gateway Protocol (BGP) selects only a single best path and does not perform load balancing. This document shows how to perform load sharing in different scenarios with the use of BGP. For additional information about load balancing.

Requirements

Ensure that you meet these requirements before you attempt this configuration:

         Knowledge of BGP Best Path Selection Algorithm

Load Sharing with the Loopback Address as a BGP Neighbor

This scenario shows how to achieve load sharing when there are multiple (up to a maximum of six), equal-cost links. The links are terminated in one router at a local autonomous system (AS) and in another router at a remote AS in a single-homed BGP environment. The Network Diagram serves as an example.
Note: Use the Command Lookup Tool (registered customers only) to find more information on the commands used in this document.

Network Diagram

This section uses this network setup:
40a.gif

Configurations

This section uses these configurations:
  • RouterA
  • RouterB

RouterA
interface loopback 0
 ip address 1.1.1.1 255.255.255.0
 interface serial 0
 ip address 160.20.20.1 255.255.255.0
 no ip route-cache
  
interface serial 1
 ip address 150.10.10.1 255.255.255.0
 no ip route-cache
  
router bgp 11
neighbor 2.2.2.2 remote-as 10
neighbor 2.2.2.2 update-source loopback 0

!--- Use the IP address of the loopback interface for TCP connections.            

neighbor 2.2.2.2 ebgp-multihop

!--- You must configure ebgp-multihop whenever the


router eigrp 12
network 1.0.0.0
network 150.10.0.0
network 160.20.0.0
no auto-summary

RouterB
interface loopback 0
 ip address 2.2.2.2 255.255.255.0

interface serial 0
 ip address 160.20.20.2 255.255.255.0
 no ip route-cache

interface serial 1
 ip address 150.10.10.2 255.255.255.0
 no ip route-cache

router bgp 10
neighbor 1.1.1.1 remote-as 11
neighbor 1.1.1.1 update-source loopback 0

!--- Use the IP address of the loopback interface for TCP connections.


neighbor 1.1.1.1 ebgp-multihop

!--- You must configure ebgp-multihop whenever the eBGP connections !--           
- are not on the same network address.
router eigrp 12
network 2.0.0.0
network 150.10.0.0
network 160.20.0.0
no auto-summary
Note: You can use static routes in the place of a routing protocol in order to introduce two equal-cost paths to reach the destination. In this case, the routing protocol is EIGRP.

Verify

Use this section to confirm that your configuration works properly.
The Output Interpreter Tool (registered customers only) (OIT) supports certain show commands. Use the OIT to view an analysis of show command output.
The output of the show ip route command shows that both of the paths to the 2.2.2.0 network are learned via EIGRP. The output of the traceroute command indicates that the load is distributed between two serial links. In this scenario, load sharing occurs on a per-packet basis. You can issue the ip route-cache command on the serial interfaces to do load sharing on a per-destination basis. You can also configure per-packet and per-destination load balancing with Cisco Express Forwarding.
RouterA# show ip route

!--- Output suppressed.

Gateway of last resort is not set

     1.0.0.0/24 is subnetted, 1 subnets
C       1.1.1.0 is directly connected, Loopback0
     2.0.0.0/24 is subnetted, 1 subnets
D       2.2.2.0 [90/2297856] via 150.10.10.2, 00:00:45, Serial1
                [90/2297856] via 160.20.20.2, 00:00:45, Serial0
     160.20.0.0/24 is subnetted, 1 subnets
C       160.20.20.0 is directly connected, Serial0
     150.10.0.0/24 is subnetted, 1 subnets
C       150.10.10.0 is directly connected, Serial1

RouterA# traceroute 2.2.2.2 

Type escape sequence to abort.
Tracing the route to 2.2.2.2

1 160.20.20.2 16 msec
    150.10.10.2 8 msec *




BGP Best Path Selection Algorithm

Introduction

Border Gateway Protocol (BGP) routers typically receive multiple paths to the same destination. The BGP best path algorithm decides which is the best path to install in the IP routing table and to use for traffic forwarding.

Prerequisites

Requirements

There are no specific requirements for this document.

Components Used

This document is not restricted to specific software and hardware versions.

Why Routers Ignore Paths

Assume that all paths that a router receives for a particular prefix are arranged in a list. The list is similar to the output of the show ip bgp longer-prefixes command. In this case, some paths are not considered as candidates for the best path. Such paths typically do not have the valid flag in the output of the show ip bgp longer-prefixes command. Routers ignore paths in these circumstances:
  • Paths that are marked as not synchronized in the show ip bgp longer-prefixes output
    If BGP synchronization is enabled, there must be a match for the prefix in the IP routing table in order for an internal BGP (iBGP) path to be considered a valid path. BGP synchronization is disabled by default in Cisco IOS? Software.
    Note: Synchronization is enabled by default in Cisco IOS Software Release prior to 12.2(8)T. If the matching route is learned from an Open Shortest Path First (OSPF) neighbor, its OSPF router ID must match the BGP router ID of the iBGP neighbor. Most users prefer to disable synchronization with use of the no synchronization BGP subcommand.
  • Paths for which the NEXT_HOP is inaccessible
    Be sure that there is an Interior Gateway Protocol (IGP) route to the NEXT_HOP that is associated with the path.
  • Paths from an external BGP (eBGP) neighbor if the local autonomous system (AS) appears in the AS_PATH
    Such paths are denied upon ingress into the router and are not even installed in the BGP Routing Information Base (RIB). The same applies to any path that is denied by a routing policy that is implemented via access, prefix, AS_PATH, or community lists, unless you have configured neighbor soft-reconfiguration inbound for the neighbor.
  • If you enabled bgp enforce-first-as and the UPDATE does not contain the AS of the neighbor as the first AS number in the AS_SEQUENCE
    In this case, the router sends a notification and closes the session.
  • Paths that are marked as (received-only) in the show ip bgp longer-prefixes output
    The policy has rejected these paths. However, the router has stored the paths because you have configured soft-reconfiguration inbound for the neighbor that sends the path.

How the Best Path Algorithm Works

BGP assigns the first valid path as the current best path. BGP then compares the best path with the next path in the list, until BGP reaches the end of the list of valid paths. This list provides the rules that are used to determine the best path:
  1. Prefer the path with the highest WEIGHT.
    Note:  WEIGHT is a Cisco-specific parameter. It is local to the router on which it is configured.
  2. Prefer the path with the highest LOCAL_PREF.
    Note: A path without LOCAL_PREF is considered to have had the value set with the bgp default local-preference command, or to have a value of 100 by default.
  3. Prefer the path that was locally originated via a network or aggregate BGP subcommand or through redistribution from an IGP.
    Local paths that are sourced by the network or redistribute commands are preferred over local aggregates that are sourced by the aggregate-address command.
  4. Prefer the path with the shortest AS_PATH.
    Note: Be aware of these items:
    • This step is skipped if you have configured the bgp bestpath as-path ignore command.
    • An AS_SET counts as 1, no matter how many ASs are in the set.
    • The AS_CONFED_SEQUENCE and AS_CONFED_SET are not included in the AS_PATH length.
  5. Prefer the path with the lowest origin type.
    Note: IGP is lower than Exterior Gateway Protocol (EGP), and EGP is lower than INCOMPLETE.
  6. Prefer the path with the lowest multi-exit discriminator (MED).
    Note: Be aware of these items:
    • This comparison only occurs if the first (the neighboring) AS is the same in the two paths. Any confederation sub-ASs are ignored.
      In other words, MEDs are compared only if the first AS in the AS_SEQUENCE is the same for multiple paths. Any preceding AS_CONFED_SEQUENCE is ignored.
    • If bgp always-compare-med is enabled, MEDs are compared for all paths.
      You must disable this option over the entire AS. Otherwise, routing loops can occur.
    • If bgp bestpath med-confed is enabled, MEDs are compared for all paths that consist only of AS_CONFED_SEQUENCE.
      These paths originated within the local confederation.
    • THE MED of paths that are received from a neighbor with a MED of 4,294,967,295 is changed before insertion into the BGP table. The MED changes to to 4,294,967,294.
    • THE MED of paths that are received from a neighbor with a MED of 4,294,967,295 are considered valid and are inserted into BGP table with effect to Codes fixed for Cisco bug ID CSCef34800.
    • Paths received with no MED are assigned a MED of 0, unless you have enabled bgp bestpath med missing-as-worst .
      If you have enabled bgp bestpath med missing-as-worst , the paths are assigned a MED of 4,294,967,294.
      If you have enabled bgp bestpath med missing-as-worst , the paths are assigned a MED of 4,294,967,295 with effect to Codes fixed for Cisco bug ID CSCef34800.
    • The bgp deterministic-med command can also influence this step.
      Refer to How BGP Routers Use the Multi-Exit Discriminator for Best Path Selection for a demonstration.
  7. Prefer eBGP over iBGP paths.
    If bestpath is selected, go to Step 9 (multipath).
    Note: Paths that contain AS_CONFED_SEQUENCE and AS_CONFED_SET are local to the confederation. Therefore, these paths are treated as internal paths. There is no distinction between Confederation External and Confederation Internal.
  8. Prefer the path with the lowest IGP metric to the BGP next hop.
    Continue, even if bestpath is already selected.
  9. Determine if multiple paths require installation in the routing table for BGP Multipath.
    Continue, if bestpath is not yet selected.
  10. When both paths are external, prefer the path that was received first (the oldest one).
    This step minimizes route-flap because a newer path does not displace an older one, even if the newer path would be the preferred route based on the next decision criteria (Steps 11, 12, and 13).
    Skip this step if any of these items is true:
    • You have enabled the bgp best path compare-routerid command.
      Note: Cisco IOS Software Releases 12.0.11S, 12.0.11SC, 12.0.11S3, 12.1.3, 12.1.3AA, 12.1.3.T, and 12.1.3.E introduced this command.
    • The router ID is the same for multiple paths because the routes were received from the same router.
    • There is no current best path.
      The current best path can be lost when, for example, the neighbor that offers the path goes down.
  11. Prefer the route that comes from the BGP router with the lowest router ID.
    The router ID is the highest IP address on the router, with preference given to loopback addresses. Also, you can use the bgp router-id command to manually set the router ID.
    Note: If a path contains route reflector (RR) attributes, the originator ID is treated as the router ID in the path selection process.
  12. If the originator or router ID is the same for multiple paths, prefer the path with the minimum cluster list length.
    This is only present in BGP RR environments. It allows clients to peer with RRs or clients in other clusters. In this scenario, the client must be aware of the RR-specific BGP attribute.
  13. Prefer the path that comes from the lowest neighbor address.
    This address is the IP address that is used in the BGP neighbor configuration. The address corresponds to the remote peer that is used in the TCP connection with the local router.

Example: BGP Best Path Selection

In this example, 9 paths are available for the network 10.30.116.0/23. The show ip bgp network command displays the entries in the BGP routing table for the given network.
Router R1#show ip bgp vpnv4 rd 1100:1001 10.30.116.0/23
BGP routing table entry for 1100:1001:10.30.116.0/23, version 26765275
Paths: (9 available, best #6, no table)
  Advertised to update-groups:
     1          2          3         
  (65001 64955 65003) 65089, (Received from a RR-client)
    172.16.254.226 (metric 20645) from 172.16.224.236 (172.16.224.236)
      Origin IGP, metric 0, localpref 100, valid, confed-internal
      Extended Community: RT:1100:1001
      mpls labels in/out nolabel/362
  (65008 64955 65003) 65089
    172.16.254.226 (metric 20645) from 10.131.123.71 (10.131.123.71)
      Origin IGP, metric 0, localpref 100, valid, confed-external
      Extended Community: RT:1100:1001
      mpls labels in/out nolabel/362
  (65001 64955 65003) 65089
    172.16.254.226 (metric 20645) from 172.16.216.253 (172.16.216.253)
      Origin IGP, metric 0, localpref 100, valid, confed-external
      Extended Community: RT:1100:1001
      mpls labels in/out nolabel/362
  (65001 64955 65003) 65089
    172.16.254.226 (metric 20645) from 172.16.216.252 (172.16.216.252)
      Origin IGP, metric 0, localpref 100, valid, confed-external
      Extended Community: RT:1100:1001
      mpls labels in/out nolabel/362
  (64955 65003) 65089
    172.16.254.226 (metric 20645) from 10.77.255.57 (10.77.255.57)
      Origin IGP, metric 0, localpref 100, valid, confed-external
      Extended Community: RT:1100:1001
      mpls labels in/out nolabel/362
  (64955 65003) 65089
    172.16.254.226 (metric 20645) from 10.57.255.11 (10.57.255.11)
      Origin IGP, metric 0, localpref 100, valid, confed-external, best
      Extended Community: RT:1100:1001
      mpls labels in/out nolabel/362

!--- BGP selects this as the Best Path on comparing 
!--- with all the other routes and selected based on lower router ID.

  (64955 65003) 65089
    172.16.254.226 (metric 20645) from 172.16.224.253 (172.16.224.253)
      Origin IGP, metric 0, localpref 100, valid, confed-internal
      Extended Community: RT:1100:1001
      mpls labels in/out nolabel/362
  (65003) 65089
    172.16.254.226 (metric 20645) from 172.16.254.234 (172.16.254.234)
      Origin IGP, metric 0, localpref 100, valid, confed-external
      Extended Community: RT:1100:1001
      mpls labels in/out nolabel/362
  65089, (Received from a RR-client)
    172.16.228.226 (metric 20645) from 172.16.228.226 (172.16.228.226)
      Origin IGP, metric 0, localpref 100, valid, confed-internal
      Extended Community: RT:1100:1001
      mpls labels in/out nolabel/278
BGP selects the best path out of these 9 paths by considering various attributes that are explained in this document. In the output shown here, BGP compares the available paths and selects Path# 6 as the best path based on its lower router-ID.
Comparing path 1 with path 2:
 Both paths have reachable next hops
 Both paths have a WEIGHT of 0
 Both paths have a LOCAL_PREF of 100
 Both paths are learned
 Both paths have AS_PATH length 1
 Both paths are of origin IGP
 The paths have different neighbor AS's so ignoring MED
 Both paths are internal
   (no distinction is made between confed-internal and confed-external)
 Both paths have an IGP metric to the NEXT_HOP of 20645
Path 2 is better than path 1 because it has a lower Router-ID.

Comparing path 2 with path 3:
 Both paths have reachable next hops
 Both paths have a WEIGHT of 0
 Both paths have a LOCAL_PREF of 100
 Both paths are learned
 Both paths have AS_PATH length 1
 Both paths are of origin IGP
 Both paths have the same neighbor AS, 65089, so comparing MED.
 Both paths have a MED of 0
 Both paths are confed-external
 Both paths have an IGP metric to the NEXT_HOP of 20645
Path 2 is better than path 3 because it has a lower Router-ID.

Comparing path 2 with path 4:
 Both paths have reachable next hops
 Both paths have a WEIGHT of 0
 Both paths have a LOCAL_PREF of 100
 Both paths are learned
 Both paths have AS_PATH length 1
 Both paths are of origin IGP
 Both paths have the same neighbor AS, 65089, so comparing MED.
 Both paths have a MED of 0
 Both paths are confed-external
 Both paths have an IGP metric to the NEXT_HOP of 20645
Path 2 is better than path 4 because it has a lower Router-ID.

Comparing path 2 with path 5:
 Both paths have reachable next hops
 Both paths have a WEIGHT of 0
 Both paths have a LOCAL_PREF of 100
 Both paths are learned
 Both paths have AS_PATH length 1
 Both paths are of origin IGP
 Both paths have the same neighbor AS, 65089, so comparing MED.
 Both paths have a MED of 0
 Both paths are confed-external
 Both paths have an IGP metric to the NEXT_HOP of 20645
Path 5 is better than path 2 because it has a lower Router-ID.

Comparing path 5 with path 6:
 Both paths have reachable next hops
 Both paths have a WEIGHT of 0
 Both paths have a LOCAL_PREF of 100
 Both paths are learned
 Both paths have AS_PATH length 1
 Both paths are of origin IGP
 Both paths have the same neighbor AS, 65089, so comparing MED.
 Both paths have a MED of 0
 Both paths are confed-external
 Both paths have an IGP metric to the NEXT_HOP of 20645
Path 6 is better than path 5 because it has a lower Router-ID.

Comparing path 6 with path 7:
 Both paths have reachable next hops
 Both paths have a WEIGHT of 0
 Both paths have a LOCAL_PREF of 100
 Both paths are learned
 Both paths have AS_PATH length 1
 Both paths are of origin IGP
 Both paths have the same neighbor AS, 65089, so comparing MED.
 Both paths have a MED of 0
 Both paths are internal
   (no distinction is made between confed-internal and confed-external)
 Both paths have an IGP metric to the NEXT_HOP of 20645
Path 6 is better than path 7 because it has a lower Router-ID.

Comparing path 6 with path 8:
 Both paths have reachable next hops
 Both paths have a WEIGHT of 0
 Both paths have a LOCAL_PREF of 100
 Both paths are learned
 Both paths have AS_PATH length 1
 Both paths are of origin IGP
 Both paths have the same neighbor AS, 65089, so comparing MED.
 Both paths have a MED of 0
 Both paths are confed-external
 Both paths have an IGP metric to the NEXT_HOP of 20645
Path 6 is better than path 8 because it has a lower Router-ID.

Comparing path 6 with path 9:
 Both paths have reachable next hops
 Both paths have a WEIGHT of 0
 Both paths have a LOCAL_PREF of 100
 Both paths are learned
 Both paths have AS_PATH length 1
 Both paths are of origin IGP
 The paths have different neighbor AS's so ignoring MED
 Both paths are internal
   (no distinction is made between confed-internal and confed-external)
 Both paths have an IGP metric to the NEXT_HOP of 20645
Path 6 is better than path 9 because it has a lower Router-ID.

The best path is #6

Customize the Path Selection Process

The extended community attribute, which is called BGP Cost Community, provides a way to customize the best path selection process. An additional step, in which cost communities are compared, is added to the algorithm that the How the Best Path Algorithm Works section describes. This step comes after the required step (point of insertion) in the algorithm. The path with the lowest cost value is preferred.
Note: Be aware of these items:
  • This step is skipped if you have issued the bgp bestpath cost-community ignore command.
  • The cost community set clause is configured with a cost community ID number (0 to 255) and cost number value (0 to 4,294,967,295). The cost number value determines the preference for the path. The path with the lowest cost number value is preferred. Paths that are not specifically configured with the cost number value are assigned a default cost number value of 2,147,483,647. This value is the midpoint between 0 and 4,294,967,295. These paths are then evaluated accordingly by the best path selection process. If two paths are configured with the same cost number value, the path selection process prefers the path with the lowest community ID. If the paths have unequal pre-bestpath cost communities, the path with the lower pre-bestpath cost community is selected as the best path.
  • The ABSOLUTE_VALUE is considered the first step in determining the degree of preference of a path. For example, when EIGRP is redistributed to BGP VPNv4, the ABSOLUTE_VALUE type is used for cost community. The IGB_Cost is considered after the interior (IGP) distance to the next hop has been compared. This means that cost communities with the IGP_COST point of insertion are considered after step 8 of the algorithm in How the Best Path Algorithm Works.

BGP Multipath

BGP Multipath allows installation into the IP routing table of multiple BGP paths to the same destination. These paths are installed in the table together with the best path for load sharing. BGP Multipath does not affect bestpath selection. For example, a router still designates one of the paths as the best path, according to the algorithm, and advertises this best path to its neighbors.
These are the BGP Multipath features:
  • eBGP Multipath—maximum-paths n
  • iBGP Multipath— maximum-paths ibgp n
  • eiBGP Multipath— maximum-paths eibgp n
In order to be candidates for multipath, paths to the same destination need to have these characteristics equal to the best-path characteristics:
  • Weight
  • Local preference
  • AS-PATH length
  • Origin
  • MED
  • One of these:
    • Neighboring AS or sub-AS (before the addition of the eiBGP Multipath feature)
    • AS-PATH (after the addition of the eiBGP Multipath feature)
Some BGP Multipath features put additional requirements on multipath candidates.
These are the additional requirements for eBGP multipath:
  • The path should be learned from an external or confederation-external neighbor (eBGP).
  • The IGP metric to the BGP next hop should be equal to the best-path IGP metric.
These are the additional requirements for iBGP multipath:
  • The path should be learned from an internal neighbor (iBGP).
  • The IGP metric to the BGP next hop should be equal to the best-path IGP metric, unless the router is configured for unequal-cost iBGP multipath.
BGP inserts up to n most recently received paths from multipath candidates in the IP routing table. The maximum value of n is currently 6. The default value, when multipath is disabled, is 1.
For unequal-cost load balancing, you can also use BGP Link Bandwidth.
Note: The equivalent next-hop-self is performed on the best path that is selected among eBGP multipaths before it is forwarded to internal peers.

Understanding BGP Best Path Selection & Manipulation


Introduction

This document outlines the BGP best path selection algorithm, and covers specific configuration examples on how to manipulate BGP’s best path decision based on different attributes.


Initial Topology


The following topology will be referenced for the entirety of this document unless otherwise stated. EIGRP is being used as the underlying IGP for basic connectivity.
BGP Best Path Visio.png

In the topology above R1 is receiving a similar BGP route (172.16.1.0/24) via R2 and R3. Prior to any user manipulation, R1 prefers the path advertised from R2 over the path advertised from R3. This can be seen in the following output:

R1#sh ip bgp
BGP table version is 2, local router ID is 13.13.13.1
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
              r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter,
              x best-external, a additional-path, c RIB-compressed,
Origin codes: i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found

      Network               Next Hop            Metric      LocPrf      Weight      Path
*  172.16.1.0/24          13.13.13.3                                     0          200 300 i
*>                        12.12.12.2                                     0          200 300 i

The '>' shown in the output above indicates that the path with a next hop of 12.12.12.2 (R2) is the current best path.

R1#sh ip bgp 172.16.1.0/24
BGP routing table entry for 172.16.1.0/24, version 2
Paths: (2 available, best #2, table default)
  Advertised to update-groups:
     1
  Refresh Epoch 1
  200 300
    13.13.13.3 from 13.13.13.3 (34.34.34.3)
      Origin IGP, localpref 100, valid, external
  Refresh Epoch 1
  200 300
    12.12.12.2 from 12.12.12.2 (24.24.24.2)
      Origin IGP, localpref 100, valid, external, best
R1#

The above output further illustrates that the path with a next hop address of 12.12.12.2 is currently being chosen as 'best', as well as the BGP path attributes associated to the paths that are being compared.

Once R1 has selected the best path it performs a recursive routing lookup on the associated next hop address. In this case the next hop address is 12.12.12.2, so the lookup will result in a next hop interface of FastEthernet0/0.

R1#sh ip route 12.12.12.2
Routing entry for 12.12.12.0/24
  Known via "connected", distance 0, metric 0 (connected, via interface)
  Redistributing via eigrp 1
  Routing Descriptor Blocks:
  * directly connected, via FastEthernet0/0
      Route metric is 0, traffic share count is 1


Once the lookup has been done for the Next Hop Address we now have the associated next hop interface which is installed for the CEF entry:

R1#sh ip cef 172.16.1.0/24
172.16.1.0/24
  nexthop 12.12.12.2 FastEthernet0/0

Determining Which Path is Best

BGP compares multiple path attributes when choosing which path is best. The list of steps that are performed in the comparison can also be found in the Best Path Selection Algorithm.

The default Best Path Selection Algorithm includes the following steps:
1. Compare Weight
The path with the highest weight is preferred. If the weight is identical, move on to step 2.

This path attribute is only locally significant. If you change the weight on one router, it will not affect any other router within the Autonomous System. This is a Cisco Proprietary feature.
2. Compare Local Preference   
The path with the highest local preference is preferred. If the local preference is identical, move on to step 3.

This path attribute is not locally significant. If you change the local preference on one router, it will affect other routers within the Autonomous System.
3. Is the Path Locally Originated?
Any path that has been originated on a local router will be preferred over any paths learned from a BGP Peer. If no locally originated prefix exists in the BGP table for the paths being compared, move on to step 4.

In Cisco IOS this step is implemented by associating a weight of 32768 to any prefixes advertised into BGP on the local router.

For example, when R4 advertised the 172.16.1.0/24 prefix into BGP with the command network 172.16.1.0 mask 255.255.255.0 it automatically added a weight of 32768 to that prefix in the BGP table. This can be seen from the following output:

R4#sh ip bgp 172.16.1.0/24
BGP routing table entry for 172.16.1.0/24, version 2
Paths: (1 available, best #1, table default)
  Advertised to update-groups:
     1
  Refresh Epoch 1
  Local
    0.0.0.0 from 0.0.0.0 (172.16.1.1)
      Origin IGP, metric 0, localpref 100, weight 32768, valid, sourced, local, best

This means that R4 will prefer its next hop address for the 172.16.1.0/24 subnet, regardless of similar paths learned via its BGP peers.

4. Compare AS Path
The path with the shortest AS Path is preferred. If the AS Path is identical in length, move on to step 5.

5. Compare Origin
This step in the Best Path Selection process compares how BGP learned about a path originally. There are 3 origin codes:

IGP - the path was learned by BGP via the network statement and is interior to the originating Autonomous System

INCOMPLETE - the path was learned BGP in an unknown fashion, typically via Redistribution.

IGP  >  INCOMPLETE

If the origin is identical, move on to step 6.
6. Compare the Multi-Exit Discrimiator (MED)
The path with the lowest MED is preferred. This check is only done if the first hop AS is identical in the paths being compared. If the first hop AS is different or the MED is identical, move on to step 7.
7. Compare Neighbor Type
Paths learned from eBGP peers are preferred over paths learned from iBGP peers. If all paths were learned from the same type of peer, move on to step 8. If the best path is selected during this step, skip step 8 and move on to step 9.
8. IGP Metric
BGP advertises a prefix and a next hop address with any path. The path with the lower IGP metric to the associated next hop address is preferred. If the IGP metrics are identical on all paths, move on to step 9.
9. Are Multiple Paths Allowed?
BGP by default will only install one path as best. If you configure the maximum-paths command to allow more than one path to be installed, BGP will use the IGP to load balance to the associated destination prefix.

At this point if the best path has not been selected, move on to step 10.
10. Compare Route Age
When both paths are learned from eBGP peers, BGP prefers the route that was learned first.

The logic is that the longer a route has been in the BGP Table, the more stable that path must be. This does not apply to iBGP routes.
11. Compare Neighbor's Router-ID
Prefer the path that is learned from the peer with the lower BGP Router-ID. If the Router-ID is identical, move on to step 12.
12. Compare Cluster List Length
The path with the minimum Cluster List Length is preferred. (This only comes into play in BGP Route-Reflector environments)

If the Cluster List Length is identical, move on to step 13.
13. Compare the Neighbor Address
This is the catch-all rule in the best path selection process. The path with the lower peer address (the IP address configured with the neighbor statement) is preferred. You cannot configure multiple neighbors with the same IP address, so it is impossible for this step to result in a tie.

Manipulating the Best Path

This section covers how to manipulate BGP Path Attributes to alter which path BGP chooses is best. The following Path Attributes will be illustrated:

- Weight
- Local Preference
- AS Path
- MED
- Installing Multiple Paths

NOTE: All best path manipulation covered in this section will be done on a per neighbor basis. Altering path attributes per prefix is not discussed to reduce complexity.

In each of the following examples BGP has chosen R2 as the preferred next hop to the 172.16.1.0/24 subnet prior to any user configuration.

R1#sh ip bgp 172.16.1.0/24
BGP routing table entry for 172.16.1.0/24, version 2
Paths: (2 available, best #2, table default)
  Advertised to update-groups:
     1
  Refresh Epoch 1
  200 300
    13.13.13.3 from 13.13.13.3 (34.34.34.3)
      Origin IGP, localpref 100, valid, external
  Refresh Epoch 1
  200 300
    12.12.12.2 from 12.12.12.2 (24.24.24.2)
      Origin IGP, localpref 100, valid, external, best


Manipulating WEIGHT

R1's weight can be altered to prefer the next hop address of 13.13.13.3 for the 172.16.1.0/24 prefix. The following example uses the weight keyword to do so, instead of setting the value with a route-map.
On R1:
Here we configure a WEIGHT of 1 to all prefixes learned from the neighbor 13.13.13.3:

R1#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
R1(config)#router bgp 100
R1(config-router)#neighbor 13.13.13.3 weight 1
R1(config-router)#end
R1#

The Prefixes learned from R3 must be updated for this configuration to take affect. You can request a route refresh from R3 to accomplish this with the command clear ip bgp 13.13.13.3 soft in.

Now when BGP goes to compare the Best Path Attributes of the two known paths the first thing that is checked is weight. Since the weight of the R3 path is 1, and the weight of the R2 path is 0 (by default) R1 prefers the path with a next hop address of 13.13.13.3.

R1#sh ip bgp 172.16.1.0/24
BGP routing table entry for 172.16.1.0/24, version 5
Paths: (2 available, best #1, table default)
  Advertised to update-groups:
     1
  Refresh Epoch 2
  200 300
    13.13.13.3 from 13.13.13.3 (34.34.34.3)
      Origin IGP, localpref 100, weight 1, valid, external, best
  Refresh Epoch 2
  200 300
    12.12.12.2 from 12.12.12.2 (24.24.24.2)
      Origin IGP, localpref 100, valid, external
R1#

Weight is only illustrated in the show ip bgp output when a value is present. The Path with a next hop of 12.12.12.2 does not illustrate the weight in this example because no value has been set by the user.

The next hop interface for traffic destined to the 172.16.1.0/24 prefix is now updated to FastEthernet0/1.

R1#sh ip cef 172.16.1.0/24
172.16.1.0/24
  nexthop 13.13.13.3 FastEthernet0/1
R1#

Manipulating LOCAL PREFERENCE

R1's local preference can be altered to prefer the next hop address of 13.13.13.3  for the 172.16.1.0/24 prefix. The following example uses a route-map to set the value.
On R1:
Here we configure a Local Preference of 101 (the default is 100) to all prefixes learned from the neighbor 13.13.13.3:

R1#
R1#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
R1(config)#route-map RM_LOCAL_PREF permit 10
R1(config-route-map)#set local-preference 101
R1(config-route-map)#exit
R1(config)#
R1(config)#router bgp 100
R1(config-router)#neighbor 13.13.13.3 route-map RM_LOCAL_PREF in  (can only be set inbound)
R1(config-router)#end
R1#clear ip bgp 13.13.13.3 soft in
R1#

Since the weight of both paths are identical, BGP then checks the local preference to determine which path is best. Since the path learned from R3 now has a higher local preference, it is preferred:

R1#sh ip bgp 172.16.1.0/24
BGP routing table entry for 172.16.1.0/24, version 3
Paths: (2 available, best #2, table default)
  Advertised to update-groups:
     3
  Refresh Epoch 2
  200 300
    12.12.12.2 from 12.12.12.2 (24.24.24.2)
      Origin IGP, localpref 100, valid, external
  Refresh Epoch 3
  200 300
    13.13.13.3 from 13.13.13.3 (34.34.34.3)
      Origin IGP, localpref 101, valid, external, best
R1#

The next hop interface for traffic destined to the 172.16.1.0/24 prefix is now updated to FastEthernet0/1.

R1#sh ip cef 172.16.1.0/24
172.16.1.0/24
  nexthop 13.13.13.3 FastEthernet0/1
R1#

Manipulating the AS PATH

R1's AS Path can be altered to prefer the  next hop address of 13.13.13.3 for the 172.16.1.0/24 prefix.The following example uses a route-map to prepend additional hops onto the AS Path of the path learned from R2.
On R1:
Here we configure an AS Path with 2 additional hops for all of prefixes learned from the neighbor 12.12.12.2:

R1#
R1#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
R1(config)#route-map RM_AS_PATH_PREPEND
R1(config-route-map)#set as-path prepend 200 200
R1(config-route-map)#exit
R1(config)#router bgp 100
R1(config-router)#neighbor 12.12.12.2 route-map RM_AS_PATH_PREPEND in (could be done inbound or outbound)
R1(config-router)#end
R1#clear ip bgp 12.12.12.2 soft in
R1#

Now the path learned from R2 will have 2 additional hops associated to it. This will make the path from R3 more preferred since it is shorter:

R1#sh ip bgp 172.16.1.0/24
BGP routing table entry for 172.16.1.0/24, version 3
Paths: (2 available, best #1, table default)
  Advertised to update-groups:
     4
  Refresh Epoch 2
  200 300
    13.13.13.3 from 13.13.13.3 (34.34.34.3)
      Origin IGP, localpref 100, valid, external, best
  Refresh Epoch 3
  200 200 200 300
    12.12.12.2 from 12.12.12.2 (24.24.24.2)
      Origin IGP, localpref 100, valid, external
R1#

The next hop interface for traffic destined to the 172.16.1.0/24 prefix is now updated to FastEthernet0/1.

R1#sh ip cef 172.16.1.0/24
172.16.1.0/24
  nexthop 13.13.13.3 FastEthernet0/1
R1#

Manipulating MED

R1's MED can be  altered to prefer the next hop address of 13.13.13.3  for the 172.16.1.0/24 prefix. The following example uses a route-map to set the  value.
On R2:
MED can only be configured outbound to influence which path is the preferred entry point into an Automonous System. We want to influence R1 to prefer the path via R3, so we configure a higher MED value to be advertised from R2 to R1 than from R3 to R1.

R2#

R2#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
R2(config)#route-map RM_MED permit 10
R2(config-route-map)#set metric 1 (In Cisco IOS, you use the metric keyword to alter MED for BGP)
R2(config-route-map)#exit
R2(config)#router bgp 200
R2(config-router)#neighbor 12.12.12.1 route-map RM_MED out
R2(config-router)#end
R2#clear ip bgp 12.12.12.1 soft out
R2#

Now when R1 reaches step 6 in the best path selection process, it will choose the path learned from R3 since the MED is lower (a default of 0) than what is advertised by R2:

R1#sh ip bgp 172.16.1.0/24
BGP routing table entry for 172.16.1.0/24, version 3
Paths: (2 available, best #2, table default)
  Advertised to update-groups:
     5
  Refresh Epoch 2
  200 300
    12.12.12.2 from 12.12.12.2 (24.24.24.2)
      Origin IGP, metric 1, localpref 100, valid, external
  Refresh Epoch 3
  200 300
    13.13.13.3 from 13.13.13.3 (34.34.34.3)
      Origin IGP, localpref 100, valid, external, best
R1#

If a MED value has not been set by the BGP peer, we will not show the value of 0 in the show ip bgp output.

The next hop interface for traffic destined to the 172.16.1.0/24 prefix is now updated to FastEthernet0/1.

R1#sh ip cef 172.16.1.0/24
172.16.1.0/24
  nexthop 13.13.13.3 FastEthernet0/1
R1#

Installing Multiple Paths

By default BGP will only choose one path as best. If multiple paths are learned to a destination subnet the user can configure BGP to load balance with the underlying IGP.

On R1:
Adjusting the number of paths that BGP is allowed to install can be done as follows:

R1#
R1#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
R1(config)#router bgp 100
R1(config-router)#maximum-paths 2
R1(config-router)#end
R1#

With this configuration in place BGP can now install 2 paths to the 172.16.1.0/24 subnet. The path that R2 and R3 advertise are identical in the best path selection process up to step 9, so they're both candidates for installation in the Routing Table.

R1#sh ip bgp 172.16.1.0/24
BGP routing table entry for 172.16.1.0/24, version 4
Paths: (2 available, best #2, table default)
Multipath: eBGP
  Advertised to update-groups:
     5
  Refresh Epoch 4
  200 300
    12.12.12.2 from 12.12.12.2 (24.24.24.2)
      Origin IGP, localpref 100, valid, external, multipath(oldest)
  Refresh Epoch 3
  200 300
    13.13.13.3 from 13.13.13.3 (34.34.34.3)
      Origin IGP, localpref 100, valid, external, multipath, best
R1#

Now when BGP does the recursive routing lookup for the Next Hop addresses of each path it will use both next hop interfaces to load balance traffic via the IGP (in this case EIGRP):

R1#sh ip cef 172.16.1.0/24
172.16.1.0/24
  nexthop 12.12.12.2 FastEthernet0/0
  nexthop 13.13.13.3 FastEthernet0/1
R1#

Now both interfaces are used to forward traffic.

Final Thoughts

The advantage that BGP has over all other routing protocols is the ability to control path selection based on different routing policies. The policy to apply to influence traffic into and out of your network should be based on what fits within your existing deployment and what you find easiest to manage.

Friday, April 15, 2016

Download Subway Surfer's Game Free for Windows PC



Download Subway Surfer's Game Free for Windows PC
Subway Surfer's that claims to beat the popularity of Temple Run 2 that was released earlier by making a more fun environment in that same chase and run gameplay. Normally you are a funky sprayer who is chased by a fat police man and his loyal dog, well you need to surf the whole subway streets by finding your path and just running in the whole game, you have boost up's and that same coin collecting strategy that you might have seen in Temple Run 2, but the best thing is that this game has some free gameplay environment that makes it much more cooler. 



Subway Surfers Game for Windows PC Free Download
Well officially this game was not available for windows PC but somehow I think someone has managed to design its whole setup for Windows PC and now this game is live and its working perfect. So now Subway Surfers graphics on Windows machine is just awesome, and the gameplay is same too, so you can run and control your buddy using simple mouse clicks and drags.

Installing Subway Surfers Game on Windows PC
After you have successfully downloaded the game using the above link, you follow below instructions to install the game on your windows computer with ease.
Update According to one of our reader Shabeer V P K - You might need to install Microsoft Visual C++ software on your PC and according to him this is working, so if you do not have a graphic card installed try installing Visual C++ software. Thanks to him :)
  1. After downloading the game, extract the .ZIP package.
  2. Now you will see simple Subway Surfer's folder double click on it.
  3. Now to play, click on the Subway Surfer's .exe file.
  4. You can choose the display size & hit Play!
  5. For any further instructions you can see the Instruction's text file.
Subway Surfers PC Game Control's
So control's for this game is dam! simple, you are not going to use any keyboard keys or something but simple mouse will work just fine.
  • Movements – movements of your character can be controlled using just the mouse. For sliding to left drag your mouse to left and for right drag your mouse to right.
  • Jump – Just swipe your mouse in upward direction and your character will jump instantly.
  • Slide – sliding under ramps could be done by sliding your mouse in downward direction.
  • Power Boost Up - just double click mouse button and it will activate that thing.