The Journey of a Network Engineer

Dec 3 2010   2:10AM GMT

How BGP selects the best route?



Posted by: Sulaiman Syed
Tags:
Attribute
CCNP
Cisco
eBGP
iBGP
NEXT_HOP
Path
route
router
routing
weight

Since, i started studying for CCIE, i would start writing technical topics that are either difficult or interesting, and present them in easy way.

BGP is one of the most interesting routing protocols out there. The interesting part lies in the way routes can be manipulated. There are many Path Attributes (PA) that play part in the way BGP build the routing table from the route updates.

Routes can be manipulated by omitting or filters routes based on prefixes or AS_PATH segments (this will be discussed in next entry)

The main Path Attributes (PAs) are

  • Weight (Cisco proprietary)
  • Local Pref
  • Locally injected routes
  • Autonomous System (AS) Path
  • Origin PA
  • Multi-Exit Discriminator (MED)
  • Neighbor Type
  • IGP metric for reaching NEXT_HOP

These are the main PAs that can be manipulated to change the way the routing table is built. The Decision of BGP to include a route into a routing table takes the following process.

0- Add the route, if the NEXT_HOP is reachable.  so if there is no route to NEXT_HOP address, the route will be automatically rejected. Although this is not a PA, but it is the first and most important factor for a route to be added to Routing Table.

1-Highest administrative weight, the higher the value the better the route is. This can only be modified locally (on router) and cant be communicated to other routers.

2-Highest local pref, it can be distributed insight the AS. the higher the value the better.

3-Locally injected routes, this will cause BGP to use routes that were injected locally through Network, redistribution or route summarization.

4-Shortest AS_PATH length. the shorter the path, the better the route. It will treat AS_SET as one ASN regardless of the number of ASNs in the variable.

5-ORIGIN PA, IGP (I)> EGP (E) > incomplete (?)

6- Smallest MED. This allows the ISP to let the costumer know which exit to choose in multi-homing designs for reaching particulate Network.

7- Neighbor type, it would prefer eBGP routes over iBGP.

8- IGP metric for reaching the NEXT_HOP, the smaller the value the better the route is.

If all of those fail to decide which route to add in the routing table. then the following tiebreakers will be used.

9- Keep oldest eBGP route. This will give more stability and stop route flops.

10-choose the smallest neighbor RID.

11 smallest neighbor ID. the local router will have to neighbor relationships with a single router (one router, to another router with two links and two neighbor commands) . the lower ID is the better.

One last point to know, with maximum-path BGP will allow more than one route to be added to routing table. BUT, it will always use one BEST route when advertising to neighbors.

2  Comments on this Post

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when other members comment.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • angelnegro
    Weight (Cisco proprietary) is not a PA, is only for local desition.
    10 pointsBadges:
    report
  • Sulaiman Syed
    You are correct, it is for local router use. But it is one of the attributes that the router will use to select the best route. 
    Can we call it local PA? as it wont be shared with other routers, but it is used never the less. 
    90 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to: