Networks Horizon

share

Monday 27 February 2012


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

BGP "Next Hop Self" Command



Please take the fact into consideration where we discussed BGP next hop processing in iBGP advertisement. As we already discussed that in iBGP route advertisement, next hop address do not change. But with this command: "next-hop-self", we will be able to change  next hop address to BGP source address rather than letting the protocol choose the nexthop. 


for example:
Suppose we have two potential IBGP neighbors Router1 (172.16.1.1) and Router 2 (172.16.1.2). When we use below commands on Router 1, it means that Router1 has been configured to change the next hop address of the routes before updating them to Router 2. 


R1#router bgp 100 
neighbor 172.16.1.2 remote-as 100 
neighbor 172.16.1.2 next-hop-self


For every prefix that is being advertised by Router 1 to Router 2 will have a next hop address 172.16.1.1 no matter which AS it is originated from.



BGP Routing Policy (Path Selection Criteria)


Below BGP route selection criteria will apply when we have same route with different Next hop addresses.


BGP route selection
1. Next Hop should be reachable.
2. Highest Weight is preferred (local to router)
3. Higher local preference is preferred(global within autonomous system)
4. Origin (Routers self originated routes are preferred)
5. Shortest AS-PATH (compare length only)
6. Origin Code --IGP< EGP <Incomplete(?)
7. lowest MED is preferred
8. Prefer eBGP path over iBGP
9. Prefer path through closest iBGP neighbor
10.Prefer oldest (most stable) route in eBGP neighbors.
11.Lowest BGP router ID
12.Lowest IP address


The best BGP routes are then copied into the IP routing table


Mnemonic


We Love Others And Original MECORI


We=Highest Weight
Love=Highest local preference
Others=Originated locally(router originated)
And=Shortest AS path
Original=Origin code (AS originated routes)
M=Lowest MED
E=Prefer eBGP
C=Closest iBGP neighbor
O=oldest eBGP neighbor
R=Lowest router ID
I=Lowest IP address


Administrative Distance ( to identify the routing protocol that is to be preferred)

    Based on BGP route selection criteria, only one best route is taken into consideration and then best route is put into routing table on the basis of AD value(compare BGP and IGP).




BGP Table structure and process tree.


BGP has three tables to maintained Neighbor Table, BGP table and local-rib(bgp routing table) but BGP routing process has further three parts. Sometimes, these parts are reffered as table. One for storing incoming routes from neighbours, one for sending the routes to neighbours and one for installing the routes where you actually find the routes with next-hop address. The tables are given below:-
a) Adj-RIB-in
b) Adj-RIB-out
c) Loc-RIB


Decision Process


Adj-RIB-in--->inbount policy--->BGP decision process--->Local-RIB--->Outbound policy--->Adj-RIB-out




Adj-RIB-in stores the unprocessed information received from its peers. Here the best path selection occurs as per BGP attributes and after conformation path is entered into the local bgp table i.e Loc-RIB. From the local RIB table it conform the next-hop address if it reachable by IGP then the route is entered into the main routing table. 


Or more logically we describe the process this way. 


1.All the routes from peer BGP neighbor are included in Adj-RIB-in table. Each BGP peer has its own Adj-RIB-in table.lets see the Adj-RIB-in:


R6#show ip bgp neigh 100.5.5.5 received-routes




2.After applying inbound policy and BGP decision process tree, prefixes are including in Local-RIB table.
lets see the Local-RIB:


R6#show ip route bgp


3.After applying outbound policy, prefix are kept in Adj-RIB-out table and will be sent to specific bgp peer. It means that router has a adj-RIB-out table for each bgp peer. lets see the Adj-RIB-out table:


R6#show ip bgp neigh 100.5.5.5 advertised-routes








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

No comments:

Post a Comment