In order for BGP to be able to perform its functions it stores this information is a special type of database called the BGP Routing Information Base (RIB).
For BGP RIB to learn BGP routes through its neighbors, store the best BGP routes and then advertise the best routes to neighbors/peers, there is need for multiple BGP tables
BGP Routing Information Base consists of three parts as explained below –
Adj-RIBs-In – This BGP information refers to routing prefix received from neighbor without applying any filtering or attribute manipulation. Attribute modifications or route filtering is applied after Adj-RIB-In.
Loc-RIB – BGP maintains its own master routing table called the Local Routing Information Base (Loc-RIB).Best routes is selected after applying routing policies on the routes available in Adj-RIBs-In. Whenever an Adj-RIB-In changes, the main BGP process decides if any of the neighbour’s new routes are preferred to routes already in the Loc-RIB and it replaces as required.
Adj-RIBs-Out – This table refers to Routes/NLRI selected from Loc-RIB after applying outbound routing/filtering policies. This table stores the routing information that was selected by the local BGP router and the advertised to its peers through BGP update messages.
Following are the commands to find output for 3 BGP tables (Adj-RIBs-Out,Loc-RIB andAdj-RIBs-In) –