Routing TCP/IP Vol 2 Notes

13 Jul 2008

Chapter 2: Introduction to BGP4

Border Gateway Protocol (BGP) was developed to replace Exterior Gateway Protocol (EGP). The current incarnation of the protocol is version four, introduced in RFC 1771.

BGP is typically only required for Internet connectivity, and even then often only when peering with multiple service providers.

BGP behaves as a distance vector protocol, but uses an AS path instead of a single metric. For this reason, it is referred to as path vector.

Load balancing (by default, across a maximum of 6 paths) is only provided by eBGP; iBGP can only use one link.

BGP message types:

  • Open - Used to form peer relationships
  • Keepalive - Periodic maintenance of relationships
  • Update - Communicates routing information
  • Notification - Communicates an error

BGP neighbor states:

  • Idle
  • Connect - A TCP connection is being attempted
  • Active - A TCP connection has failed; the router is waiting to be contacted by its peer
  • OpenSent - TCP session established, open message sent
  • OpenConfirm - Waiting for a keepalive from the peer
  • Established

Path Attributes

Attribute classes:

  • Well-known mandatory attributes must be supported and included
  • Well-known discretionary attributes must be supported but may not be included
  • Optional transitive attributes don't have to be supported, but must be passed onto peers
  • Optional nontransitive attributes don't have to be supported, and can be ignored

Attributes:

  • Origin (WM) - The source of the route (IGP > EGP > unknown)
  • AS Path (WM) - An ordered list of the ASs the route has traversed
  • Next Hop (WM) - Specifies the next-hop address for the route
  • Local Preference (WD) - Communicated between iBGP peers to favor a route out of the AS
  • Multi Exit Discriminator (ON) - Advertised to eBGP peers to indicate a preferred entrance into the local AS
  • Atomic Aggregate (WD) - Notes that route summarization has been performed
  • Aggregator (OT) - Identifies the router and AS where summarization was performed
  • Community (OT) - Provides route tagging capability
  • Originator ID (ON) - Identifies a route reflector
  • Cluster List (ON) - Records the route reflector clusters the route has traversed

Administrative weight is a Cisco proprietary attribute, a 16-bit value referenced only by the local router.

An AS Path can be one of two types (as distinguished by its type code):

  • AS Sequence - An ordered list
  • AS Set - An unordered list

An AS Set is used to record AS numbers lost when aggregation is performed. The Atomic Aggregate attribute does not have to be included to indicate aggregation has been performed if an AS Set is included.

BGP Operation

Decision Process

  1. Prefer the route with the highest administrative weight
  2. If weights are equal, select highest local preference
  3. If local preferences are equal, prefer locally originated routes
  4. If origins are equal, prefer the shortest AS Path
  5. If AS Path lengths are equal, prefer the most favorable origin code (IGP > EGP > incomplete)
  6. If origin codes are equal, prefer lowest MED (only if all candidates routes are advertised from the same AS)
  7. If MEDs are equal, prefer eBGP > eBGP confederation > iBGP
  8. If the route types are equal, prefer the route with the lowest IGP metric to its next hop
  9. If IGP metrics are equal and are from the same AS, load balance
  10. If multipath is not enabled, select the route with the lowest BGP router ID

Route Dampening

Route dampening reduces the effects of flapping routes by preventing their propagation through a network.

A route is assigned a penalty when it flaps. This penalty increases with the rate of flapping.

The penalty is decreased gradually. The time it takes to decrease by half is its half-life.

When the accumulated penalty exceeds the suppress limit, the route is suppressed. The route is put back in use when the penalty drops below the reuse limit.

The maximum suppress limit defines a maximum suppress time.

iBGP Synchronization

iBGP peers must be fully meshed, as iBGP-learned routes are not passed to other iBGP peers.

The rule of synchronization requires that an iBGP-learned route must be known by an IGP before it enters the BGP routing table.

The synchronization requirement can be disabled with no synchronization.

Managing Large-Scale Peering

Peer groups can be defined to simplify assigning characteristics to similar BGP neighbors.

In addition to simplifying configuration, peer groups improve performance by requiring fewer consultations of the policy database.

Communities can be implemented to apply policies to a group of routes (by appending one or more Community attributes).

Route reflectors can alleviate the iBGP relationships needed within an AS by purposefully relaying routes between iBGP peers. A route reflector and its clients is referred to as a cluster.

Route reflectors employ the Originator ID and Cluster List attributes to avoid loops within the AS.

A confederation is an AS which has been divided into sub-autonomous systems (members).

Like regular ASs, confederations use two types of AS Path for loop avoidance:

  • AS Confed Sequence - An ordered list of member ASNs
  • AS Confed Set - An unordered list of member ASNs

These confederation-specific attributes are not communicated outside the confederation.

Within a confederation, eBGP routes external to the confederation are preferred over eBGP routes from another confederation member AS.

Leave a comment

(optional, will not be published)
(optional)

Comment Tips

  • You can use Markdown syntax for decoration. (Cheat sheet)
  • Links: [Google](http://google.com) or <http://google.com>
  • Use backticks around commands: `ip address 127.0.0.1`
  • Use indentations (tabs) for preformatted text (code blocks)