BGP
BGP
BGP states
1) IDLE -
once you config BGP on it it will strt intitiating TCp connection with BGP config
peer and start listening TCP connection from peer
if any error occur at any stage, BGp session is terminated and returned into IDle.
***************************************
* TCP 179 not open
* AS no. configuration incorrect
* peer address config incorrect
2) connect -
completes 3 way hand shakes
after successful TCP connection establishment with the peer device sends open msg
to its peer
3) Active state -
if rtr not able to estb a successful TCP session then it ends up in Active state
* it tried to restart another TCP session with the peer, if that is succesful then
is sends an open msg to the peer and jumps to opensent state
4) opensent state
* RTR sends an open msg and receives and open msg from its peer
once it receives and open msg it checks it's validity Like ( BGP Ver No., AS no,
Nbr statement )
5) if everything is ok, then it sends and keep alive msg and jumps to openconfirm
state
BGP messages
* All BGP msgs are unicast to its peer over TCP connection
* TCP is responsible for retransmission, fragmentation, and ACkmnt
1) OPen msg - RTR uses this msgs to identify itself and validate the attributes of
its peer
open msg is always sent after the TCP connection estblised
* version, AS, Hold time, BGP identifier, opetional parameter lenght, opentional
parameter
2) keep Alive - if router accepts the abpove parameter of its peer then it sends a
keep alive msg
* After connection estb, BGP sends Keep alive messages after every 60 seconds.
* after missing 3 keep alive msgs from peer BGP goes down
3) Update - RTR advertise the NLRI ( network layer reachability information, NLRI
is ad of new prefixes )
* it sends and update msgs after every change, wheather, to advertise the
router the route ot for withdran parameter.
unfeasable route lenght, withdrawn routes, Total path attribution lenght, path
attributes,, network layer reachability information
5) route refresh - The BGP (Border Gateway Protocol) Route Refresh message is used
to update BGP routers about changes in routing information without tearing down the
entire BGP session. This message is particularly useful when changes occur in the
network, such as new routes being added or existing routes being withdrawn.
Two Types: There are two types of BGP Route Refresh messages: "soft" and "hard."
The "soft" option allows a BGP speaker to request updates for a specific address
family, while the "hard" option requests updates for all address families.
1) Next Hop – It is used to list the next-hop IP address that can be used to reach
the prefix. The router can’t use this router if no route is available to reach the
next-hop.
2) Weight – It is used to give advantage to the path with the highest weight. It is
locally significant to the router and is Cisco proprietary.
3) Local Preference – It is used to give advantage to the path with highest local
preference. It is used within an AS and exchanged between iBGP routers. Default is
set to ***100***.
4) Locally injected routes – Routes that are injected using network command are
called Locally injected routes. These routes are better than iBGP/eBGP learned.
5) AS Path – It is applied to outbound routes. It helps in deciding the best
inbound path. With the AS-Path attribute, two things can be accomplished that are:
prepend or filter. Smaller is preferred.
6) Origin – This attribute is used to identify the originating source of the route.
The origin codes are as follows (listed in order of preference for route
selection):
7) i (IGP) – It is emerged from an IGP (interior gateway protocol), such as OSPF.
This usually indicates that network command under the BGP process was used to
inject the route into BGP. An origin code that has “i” is most desired.
8) e (EGP) – It is originated from an EGP (external gateway protocol).
? (incomplete) – It means the origin of it is Unknown. This specifies that the
route was redistributed into BGP from either connected, static, or IGP routes. An
origin code that has “?” is the least desired.
9) Multi-Exit Discriminator (MED) – This attribute is applied to the outbound
routes. It finds the best inbound path into the AS. When viewing the BGP routing
table, MED is seen as the BGP metric.
By default, the MED value is 0 and a smaller/lower value is preferred.
BGP commands
1) Show ip BGP ( shows all BGP details
2) ip bgp 1.1.1.1 soft in ( to soft reset BGP )
3) traceroute x.x.x.x source loopback 0 ( to trace route the BGP )
- Weight
- Local preference
- AS path
- MED
Route-map
Filter-list
Prefix-list
distribute-list
The following is the order of preference for outgoing updates:
Filter-list
Route-map | unsuppressed-map
Advertise-map (conditional-advertisement)
Prefix-list
distribute-list.
trouble shooting :: -
1) intermittent issue :: -
1.1) first we will ping / trace to exact where the drops are happening.
1.2) Neighbor - sh ip bgp summary ( is bgp up / down or stable ) if stable then
Route - sh ip bgp ( is route are stable in bgp database ) if routes are not
available because of ACL, prefix list....etc.
1.3) we can also check timers if timers are not matching Like keep alive / whole
timers are not correct
1.4) Route selection - route map - to influence the incoming/ outgoing traffic.
1.5) Routing Loop :: - No routing loops are there.
1.6) network conjunction :: - due to traffic conjunction ( tool - SNMP, net flow )
1.7) Any hardware / Software failure is there or not. CPU utilization etc...