BGP(Border Gateway Protocol)

BGP uses TCP port 179.

Difference between eBGP and iBGP:

  • eBGP have AD of 20 and iBGP have AD of 200.
  • In eBGP nexthop get changed whereas in case of iBGP nexthop doesn’t changes.
  • Route receieved from one eBGP peer is advertised to another peer (either iBGP or eBGP) where as route recevied by one iBGP is not forwared to another iBGP peer.
  • By default TTL for eBGP peer is set to 1. In case if the eBGP peer are not directly connected we have to change this value.

BGP states:

  1. Idle: BGP starts from this state. BGP will initiate TCP three way handshake with BGP peer.
  2. Connect: In this state BGP is waiting for TCP three way handshake to complete. If three way handshake failes then BGP will move to active state. If three way handshake is complete then state will be changed to opensent.
  3. Active:BGP will try to initiate another TCP handshake. If three way handshake is successful then we will move to open sent state. If ConnectRetryTimer_Expires then BGP will fallback to connect state if something else goes wrong then BGP will go to Idle state.
  4. Open Sent: In this state BPG wait for open message from peer and once it receives open message it will check the parameters and if there are no error in the open message then it will send keepalive message and changes its state to open confirm. If there are errors in open sent message then a notification message is send and state is changed to idle.
  5. Open Confirm: In this state BGP waits for keepalive message from peer. If the keepalive message is received then the BGP state changes to established. If a notification message is received then state is changed to idle.
  6. Established:In the Established state, the BGP FSM can exchange UPDATE, NOTIFICATION, and KEEPALIVE messages with its peer.

BGP attribute:

  1. AS path
  2. Origin
  3. Local Preference
  4. MED
  5. Weight

BGP path selection:

  1. Highest weight: CISCO proprietary and is locally significant.
  2. Highest Local preference: Local preference is set while advertising the routes and the default value is 100. Local preference is significant only within an AS. Local preferecne is never advertised to an eBGP peer. Local preference is always advertised to iBGP peer. Local preference specifies how traffic exit out of you AS for specific destinstion.
  3. Origin: Locally originated route are preffered over redistributed routes.
  4. Shortest AS path: Route having shortest AS path are preffered.
  5. Lowest Origin code: IGP<EGP<redistributed.
  6. Lowest MED: MED is advertised to direclty connected eBGP peers and is used to influence how eBGP peer  reach a prefix. MED is optional attribute and it is represented by metric in the routing table. MED specifices how traffic come to your AS for specific destination.
  7. Path: eBGP are preffered over iBGP.
  8. Router ID: Lowest router ID is preffered.

BGP attribute category:

BGP have following four category of attrbibutes:

  1. Well-known mandatory: Should be understood by every BGP implementation and should be passed in all BGP update message.
  2. Well-known discretionary: Should be understood by every BGP implementation and May or may not be present in all BGP update message.
  3. Optional transitive: May or may not be understood by BGP implementation. These attribute should be passed to BGP peer. If a peer doesn’t understand a transitive attribute then it must mark it as partial.
  4. Optional non-transitive. May or may not be understood by BGP implementation. These attribute should be not passed to BGP peer.

How to check weight of a BGP route?

show ip bgp

This entry was posted in Routing. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s