BGP
Border Gateway Protocol

BGP (Border Gateway Protocol) – “eBGP”

BGP could be either external or internal to the AS.  However, the term is casually used, and almost always means an exterior routing protocol (eBGP).  Interior BGP  (iBGP) does exist – however, when someone says “BGP” they are assumed to be referring to eBGP.  Currently, everyone uses BGP4, which is a Cisco implementation of eBGP, and it is a set of rules on how to route between Autonomous Systems.  Speaking BGP to your provider(s) and/or peers lets you do two things:

·        Make (semi-)intelligent routing decisions (decide what is the "best" path for a particular route to take outbound from your network, as opposed to simply setting a default route from your border router(s) into your provider(s)), and, more importantly,

·        Announce your routes to those providers, for them to in turn to announce to others (transit) or just use internally (in the case of peers).

When BPG is required - and when it is NOT required

The large Internet access providers must use BGP4 because it they have numerous peering partners, connected to their AS. 

Single-homed customers should never use BGP4 !!!  There is no use for it.

Multi-homed customers fall into two groups:

iBGP

iBGP is rarely implemented, due to several drawbacks.  As stated, eBGP is used to exchange routes between different Autonomous Systems, while iBGP is used to exchange routes between the same Autonomous System. In fact, iBGP is one of the "interior routing protocols" that you can use to do "active routing" inside your network.  

iBGP is actually pretty difficult to get working because it tries like crazy not to redistribute routes - in fact, all iBGP-speakers inside your network actually have to peer with all other iBGP "speakers" in order to make it work. This is called a "routing mesh" and, as you can imagine, is quite a mess. If you have 20 routers, each router has to peer with every other router. The solution to this is "BGP confederations”.

Also, iBGP has major drawbacks as an IGP. The main one is the necessity to "peer up" every set of routers in your network (or in one POP if you're using confederations). Routing protocols like OSPF and IS-IS just "find" each other over serial and Ethernet interfaces (they're "broadcast" protocols). They can also be a pain, because by default, their broadcasts will be sent to adjacent AS’s.  However, turning off broadcasting on certain ports with OSPF, is easier than turning on peering sessions between a new router and every other router on your network with iGRP.  Also, iBGP doesn't do as good a job at "convergence" (closing the gap and re-routing around failed network segments) as OSPF and IS-IS.

 

BGP Path Selection

BGP selects only one path as the best path. When the path is selected, BGP puts the selected path in its routing table and propagates the path to its neighbors. BGP uses the following criteria, in the order presented, to select a path for a destination:

1.      If the path specifies a next hop that is inaccessible, drop the update.

2.      Prefer the path with the largest weight.

3.      If the weights are the same, prefer the path with the largest local preference.

4.      If the local preferences are the same, prefer the path that was originated by BGP running on this router.

5.      If no route was originated, prefer the route that has the shortest AS_path.

6.      If all paths have the same AS_path length, prefer the path with the lowest origin type (where IGP is lower than EGP, and EGP is lower than Incomplete).

7.      If the origin codes are the same, prefer the path with the lowest MED attribute.

8.      If the paths have the same MED, prefer the external path over the internal path.

9.      If the paths are still the same, prefer the path through the closest IGP neighbor.

10.  Prefer the path with the lowest IP address, as specified by the BGP router ID.