Networks Horizon

share

Monday, 27 February 2012


Continue....
Border Gateway Protocol 
BGP-version 4- Part 5



BGP Next Hop and AS PATH processing.


BGP Next Hop: BGP by default take whole AS as single entity and therefore, as already discussed, BGP next hop does not change in iBGP updates assuming that all the routers are in same subnet (shared multi-access domain or Ethernet). For eBGP updates, next hop is changed to make inter-AS reach-ability which is the primary goal of BGP.


AS PATH: As far as BGP updates travel through the Autonomous Systems hop-by-hop( here hop means one AS), AS PATH is another attribute which travels along with that BGP update. It means, once a BGP update NLRI (prefix) leaves the autonomous system, AS number is pre-pended to AS PATH. When an AS receive an update with its AS number in AS PATH, it discards the route. This is an inbuilt loop prevention mechanism in eBGP.


Network Layer Reachability Information (NLRI): It is BGP terminology for prefix and a field in BGP update message.


below example will dictate the things in pretty simple way.








We will see default next hop and AS path processing for prefix 172.16.1.0/24.


Router R1 which is residing in AS 100, will process this prefix in its routing table. Prefix will have next hop address 0.0.0.0 because route is originated in same AS where R1 belongs. Here AS PATH will be empty (^$).


Router R2 will receive the prefix from R1. As this is inter-AS routing, now next hop will be changed to 1.1.1.1. It means 1.1.1.1 is the gateway to reach the prefix 172.16.1.0/24. AS PATH will have 100 in the list indicating that route is originated in AS 100.


Router R3 is in same AS where R2 is residing, therefore, it will not change next hop for this prefix assuming that both the routers are in same subnet. Here next hop will remain 1.1.1.1.
AS PATH also will remain same.


Router R4 receives the prefix from R3 which is eBGP neighbor, therefore, Next Hop will be changed now to 2.2.2.2. Now router 2.2.2.2 is the gateway for the prefix. AS PATH list will prepend AS 200. Now AS path will be 200,100.


Similarly, Router R5 will not change next hop and AS path . Next hop will remain 2.2.2.2 and AS path 200,100.


On Router R6, new Next hop will be 3.3.3.3 and AS PATH will be 300,200,100. This AS path concludes that route has processed AS 300, AS 200 and AS 100 through the path and AS 100 is the originator.


Update Source


As already stated, BGP neighbors do not need to be directly connected and can use their loopback interfaces to form the peer relationships. 
Sometimes, it can be beneficial to use loopbacks to form peer relationships rather than the actual interface facing the potential neighbor. For example losing one of the physical connections does not necessarily mean the BGP peering is lost; as long as the routers have reachability to each other´s loopback addresses, the BGP peer relationship will remain up.
For example, consider a router that has two paths to a BGP speaker. The interfaces are numbered like this: 


Router1: Serial0, 192.16.1.1 /24, Serial2, 172.16.1.1 /24, loopback0, 1.1.1.1
Router2: Serial0, 192.16.1.2/24, Serial2 172.16.1.2/24, loopback0, 2.2.2.2 


We could configure Router1 like this: 


router bgp 200 
neighbor 192.16.1.2 remote-as 200 


In this case, BGP would automatically use 192.16.1.1 as the update source but if the remote peer´s serial0 interface is shut down or goes down for another reason, the peer relationship would be lost even though Router2 is still available via some other means.


Instead of using one of the physical interfaces, we can use the loopbacks on each router to establish the BGP neighborship, we can use "update-source" command.


neighbor <loopback ip> update-source <loopback_interface>


The configurations would look like this: 


Router1: 
router bgp 200 
neighbor 2.2.2.2 remote-as 200 
neighbor 2.2.2.2 update-source loopback0 


Router2: 
router bgp 200 
neighbor 1.1.1.1 remote-as 200 
neighbor 1.1.1.1 update-source loopback0 


In this case, BGP peer relationship will remain in place in spite of any physical link goes down because router is somehow reachable.




                          Please read BGP-version 4- Part 6 for more information.

No comments:

Post a Comment