Tag - peering

The Basics of BGP Route Reflection

Configuring Border Gateway Protocol (BGP) can be quite onerous, particularly with large numbers of peering sessions that must be configured manually. In fact, in a large network, the full-mesh requirement for IBGP can be a provisioning nightmare.

BGP’s answer to the IBGP pairing configuration nightmare that is the full mesh is called route reflection. Route reflection allows sharing of routing information among a group of routers without having to send the exact same information to each of them individually. It’s sort of like giving information to one person and having them distribute it to all their peers.

IBGP comes with a significant restriction: IBGP peers should not re-advertise IBGP-learned routes to other IBGP speakers, which is why they all need to be fully meshed. If you can’t re-advertise IBGP routes, you must be directly connected to the originator of the route, hence the full mesh requirement. Remember, IBGP has no dedicated loop prevention mechanism, and this is why you need route reflectors for large networks.

The concept of route reflection allows you to designate one or more of your routers as route reflectors. BGP relaxes the re-advertising restriction on these route reflectors, allowing them to accept and propagate IBGP routes to their clients.

 

A-16-Router-Network

 

Because of the IBGP full-mesh requirement, this topology would require 15 IBGP peering sessions per router, or 120 distinct IBGP sessions within the network. However, if you designate router 4 as a route reflector, you can start to minimize this requirement. For example, look at what happens in with the routers directly connected to router 4.

 

Router-4-sub-network

 

In this part of the topology, router 4 has three directly-connected routers. If just this part of the topology is running IBGP, you have to configure a full mesh between the 4 routers. However, if you designate router 4 as a route reflector, BGP only requires that every route reflector client have an IBGP connection to the route reflector (not to each other).

 

Route-Reflector

 

With the new configuration, the IBGP routes from routers 1, 2, and 3 are sent to the route reflector. Router 4, acting as the route reflector, re-advertises these routes to all of its clients.

In this way, router 1 and router 2 are connected via IBGP, through their shared route reflector, router 4. This group of routers is called a cluster, and each cluster is uniquely identified by its cluster ID (a 32-bit number similar to an IP address).

Looking back at the original 16-router network, if you make similar route reflectors with routers 8, 12, and 16, you can create four route reflectors and reduce the number of IBGP sessions.

Router-4-sub-network

 

The 16-router fully meshed route reflector network

However, all 16 routers are still in the same AS, which means that IBGP has to fully connect all 16 routers. How do you do this?

Ultimately, you must have connectivity somewhere. That connectivity occurs at the route reflector level. The route reflectors must be fully meshed, meaning that you must have IBGP peering sessions between each of the four route reflectors.

Essentially, you have drastically reduced the number of IBGP sessions in your network. Where you previously needed 120 sessions to fully mesh your network, you now need only three sessions from each route reflector to its clients and an additional six sessions to fully mesh the route reflectors (for a total of 18 IBGP sessions).

BGP Best Path Selection Process

According to BGP best Path Selection process, here is the order of BGP preference:

  1. Prefers the highest weight
  2. Prefer the Highest local preference
  3. Prefer Locally Originated routes
  4. Prefer the shortest AS path
  5. Prefer the lowest Origin Code
  6. Prefer the Lowest MED value
  7. Prefer the routes learned by EBGP over the routes learned by IBGP
  8. Prefer the routes learned with the lowest router ID

BGP path Selection

  • Keep in Mind the “Weight” attributes is locally significant and is Cisco proprietary, the default value for locally originated routes are 32678
  • The default Local preference attribute value for all learned routes is 100 “IF is not modified”
  • The default Origin Code is “IGP” if learned and advertised by Network Statement, while “Incomplvce” If the route is redistributed into BGP
  • The default MED value for all learned route is 0 “Unless modified”, bear in mind MED is compared by default from routed learned from the Same AS number

 

 

BGP Adjacency States

BGP Adjacency States

  1. Idle State
  2. Connect State
  3. Active State
  4. OpenSent State
  5. OpenConfirm State
  6. Established State

1. Idle State:

Idle is the initial state of a BGP connection. The BGP speaker is waiting for a start event, generally either the establishment of a TCP connection or the re-establishment of a previous connection. Once the connection is established, BGP moves to the next state.

Attributes

  • Refuse all incoming BGP connections
  • Start the initialization of event triggers
  • Initiates a TCP connection with its configured BGP peer
  • Listens for a TCP connection from its peer
  • Changes its state to Connect

If an error occurs at any state of the FSM process, the BGP session is terminated immediately and returned to the Idle state. Some of the reasons why a router does not progress from the Idle state are:

  • TCP port 179 is not open
  • A random TCP port over 1023 is not open
  • Peer address configured incorrectly on either router
  • AS number configured incorrectly on either router

2. Connect State:

Connect is the next state of a BGP connection. If the TCP connection complvces, BGP will move to the OpenSent stage if the connection does not complvce, BGP goes to Active.

Attributes

  • Waits for successful TCP negotiation with peer
  • BGP does not spend much time in this state if the TCP session has been successfully established
  • Sends Open message to peer and changes state to OpenSent

If an error occurs, BGP moves to the Active state. Some reasons for the error are:

  • TCP port 179 is not open
  • A random TCP port over 1023 is not open
  • Peer address configured incorrectly on either router
  • AS number configured incorrectly on either router

3. Active State:

Active indicates that the BGP speaker is continuing to create a peer relationship with the remote router. If this is successful, the BGP state goes to OpenSent. You’ll occasionally see a BGP connection flap between Active and Connect. This indicates an issue with the physical cable itself, or with the configuration.

Attributes

  • If the router was unable to establish a successful TCP session, then it ends up in the Active state
  • BGP FSM tries to restart another TCP session with the peer and, if successful, then it sends an Open message to the peer
  • If it is unsuccessful again, the FSM is reset to the Idle state

Repeated failures may result in a router cycling between the Idle and Active states. Some of the reasons for this include:

  • TCP port 179 is not open
  • A random TCP port over 1023 is not open
  • BGP configuration error
  • Network congestion
  • Flapping network interface

4. OpenSent State:

OpenSent indicates that the BGP speaker has received an Open message from the peer. BGP will dvcermine whether the peer is in the same AS (iBGP) or a different AS (eBGP) in this state.

Attributes

  • BGP FSM listens for an Open message from its peer
  • Once the message has been received, the router checks the validity of the Open message
  • If there is an error it is because one of the fields in the Open message doesn’t match between the peers, e.g., BGP version mismatch, MD5 password mismatch, the peering router expects a different My AS, etc. The router then sends a Notification message to the peer indicating why the error occurred
  • If there is no error, a Keepalive message is sent, various timers are set and the state is changed to OpenConfirm

5. OpenConfirm State:

In OpenConfirm state, the BGP speaker is waiting for a keepalive message. If one is received, the state moves to Established, and the neighbor relationship is complvce. It is in the Established state that update packets are actually exchanged.

Attributes

  • The peer is listening for a Keepalive message from its peer
  • If a Keepalive message is received and no timer has expired before reception of the Keepalive, BGP transitions to the Established state
  • If a timer expires before a Keepalive message is received, or if an error condition occurs, the router transitions back to the Idle state

6. Established State:

In Established state, if one of keepalive message is received, the state moves to Established, and the neighbor relationship is complvce. It is in the Established state that update packets are actually exchanged.

Attributes

  • In this state, the peers send update messages to exchange information about each route being advertised to the BGP peer
  • If there is any error in the update message then a Notification message is sent to the peer, and BGP transitions back to the idle state
  • If a timer expires before a Keepalive message is received, or if an error condition occurs, the router transitions back to the Idle state

BGP-Adjacency-States

Copyright ©2010 - 2022 Ciscoforall.com | Privacy Policy | Terms & Conditions