Monday, June 10, 2013

[Overview] How routing updates/routes traverse through BGP routers

BGP - as like other routing protocols, perform the mainly tasks by propagating routing information from neighbors and itself to get the best information about routes. This post will provide some overview points to clarify how routing updates and routes traverse through BGP router.

1. Which kinds of route BGP deals with

Firstly, we should know which routes will be processed by (and not limited) BGP router.
  • _The received (updated) routes: these are routes coming from other neighbors to provide the newest information about network. 
  • _The locally sourced routes: these routes generated from router itself.
  • _The advertised routes: the routes which routers want to send out to their neighbors.

2. Where are places hold the routes

In BGP, there are several tables contain routing information. Those tables are called Routing Information Base - RIB. BGP maintains three RIB tables, include:
  • _Adj-RIB-In: this table holds all the routes coming from peers of BGP router. These routes still haven't treated by modifications yet and not stored in routing table right time they are received.
  • _Local RIB: best paths will be stored here and then submitted to routing table. It also contains BGP prefixes injected by the current router.
  • _Adj-RIB-Out: This holds all BEST routes will be advertised to peers.

3. How things occur when something named policy gets involved

BGP uses policies to modify and make some rules apply to routing flow. You can define inbound or outbound policies to affect to route/path selection. For example, inbound policies can be used to filter/modify routes coming from update sources before allowing them to get through router. Or you can define output policies to make sure about which routes should be advertised to outside inter-network.

Below figure shows what happening when routes come to in go from BGP router:


The steps as follow:
  • -Updated routes received from peers must go to input policies are put into Adj-RIB-In table first.
  • -Input policies decide whether these routes are allowed to continue or drop out.
  •  These information will be filtered by Input policies.
  • -Path selection will decide which routes are best and install them into Local-RIB. These routes then will be submitted into IP-RIB for local router.
  • -From Local-RIB table, some routes will be chosen to advertise to peer. These routes must be filtered by Output policies to ensure that they are exactly what is going to be sent out.
  • -These routes then stored in Adj-RIB-Out table and then advertised to peers.