display | more...
Acronym for Border Gateway Protocol.

Routing involves two basic activities: determination of optimal routing paths and the transport of packets through an internetwork. The transport of packets through an internetwork is relatively straightforward. Path determination, on the other hand, can be very complex. BGP is a protocol that addresses the task of path determination.

BGP performs interdomain routing in TCP/IP networks. BGP is an exterior gateway protocol (EGP), which means that it performs routing between multiple autonomous systems and exchanges routing and reachability information with other BGP systems.

BGP performs three types of routing: interautonomous system routing, intra-autonomous system routing, and pass-through autonomous system routing.

Interautonomous system routing occurs between two or more BGP routers in different autonomous systems. Peer routers in these systems use BGP to maintain a consistent view of the internetwork topology. BGP neighbors communicating between autonomous systems must reside on the same physical network. The Internet serves as an example of an entity that uses this type of routing because it is comprised of autonomous systems. Many of these represent the various institutions, corporations, and entities that make up the Internet. BGP is frequently used to provide path determination to provide optimal routing within the Internet.

Intra-autonomous system routing occurs between two or more BGP routers located within the same autonomous system. Peer routers within the same autonomous system use BGP to maintain a consistent view of the system topology. BGP also is used to determine which router will serve as the connection point for specific external autonomous systems. Once again, the Internet provides an example of interautonomous system routing. An organization, such as a university, could make use of BGP to provide optimal routing within its own administrative domain or autonomous system. The BGP protocol can provide both inter- and intra-autonomous system routing services.

Pass-through autonomous system routing occurs between two or more BGP peer routers that exchange traffic across an autonomous system that does not run BGP. In a pass-through autonomous system environment, the BGP traffic did not originate within the autonomous system in question and is not destined for a node in the autonomous system. BGP must interact with whatever intra-autonomous system routing protocol is being used to successfully transport BGP traffic through that autonomous system.

I had a rather odd dream, where I was helping a troop of Girl Scouts debug some problems with BGP. The neighbor keeps toggling between idle and active, see. I figure either the AS number is wrong, or the update-source command is missing. It turns out, instead, that the Cisco is configured to act as a scented candle. I explain this, and they thank me.

BGP is a protocol designed to ease the interactions of large-scale IP networks (ex. The Internet). Much more information is available if you Google for Avi Freedman.

The Border Gateway Protocol performs routing services internal to and between autonomous systems. An autonomous system is, in this discussion, an IP network under the control of a single individual or organization. BGP is, as other noders have said, the glue that holds the Internet together. It is responsible for all hierarchical routing on the Internet and is the protocol used by Internet providers to exchange dynamic routing information with each other.

BGP advertises routes to neighbors (also called peers). These routes consist of the IP prefix and length (also called mask - yes, the same as a subnet mask). Attached to these routes are attributes that define details about the route. BGP primarily uses an attribute called the AS_PATH in its path determination algorithm, but it can (and does) use several additional attributes.

Types of routes

You may often hear network engineers talking about a full or partial route table. "Full routes" mean routes for the whole Internet; "partial routes" may mean routes only to certain destinations. You can further classify (or use similar terminology) routes into peering and transit routes. Transit routes offer you connectivity to the whole Internet; peering routes only to a certain network. When someone talks about peering, they're usually talking about finding themselves preferential access to certain network(s).

What kind of protocol is it?

Since BGP uses an AS_PATH for path determination, it is described as a path vector protocol. This is similar to a distance vector protocol, like RIP or EIGRP - hop count is used as the metric there. BGP's hops are autonomous systems that the route (and the data) will transit. If you advertise a route to your peer, you are promising that you have the ability to deliver the data. This promise will be repeated, given certain criteria, to all your peers, and they will repeat it to their peers. Each "promise" will be tagged with information which supports it.

How does it work?

When BGP is operating to do inter-autonomous system routing (eBGP), it tries to advertise routes wherever possible. When it is operating within an autonomous system, it will never readvertise routes -- although there are ways to get around this rule, such as route reflectors and confederations. This means that for BGP to work within an autonomous system (iBGP) your BGP relationships have to be fully meshed. So, be aware of this when you are speaking BGP to people outside your internetwork: BGP, the protocol, will allow you to make gross misconfigurations and you will advertise those misconfigurations to your peers. It does not protect you from yourself. This has led to several Internet routing collapses. Make sure you know what you're doing.

BGP maintains copies of two databases when its process is running. These databases are called Adj-RIB-In and Adj-RIB-Out. They contain incoming and outgoing routes, respectively. When a route is selected by BGP, it is inserted into the forwarding table of the router.

BGP uses the following criteria as part of its determination process, as well as some additional information:

  • WEIGHT. Prefer the path with the largest. Weight is a Cisco-specific parameter, local to the router upon which it is configured.
  • LOCAL_PREF. Prefer the path with the largest.
  • Origination point. If the path was originated locally, or via redistribution from an IGP, prefer this path. Paths sourced by the network or redistribute commands are preferred above paths generated via the aggregate-address command.
  • AS_PATH. Prefer the path with the shortest AS_PATH. This can be turned off on some BGP implementations.
  • Origin type. IGP, EGP, and incomplete, in that order. Lowest first.
  • Multi-exit discriminator. Prefer the path with the lowest. Typically, this is only compared for paths that originate from the same autonomous system, but it can be utilized for somewhat effective routing control as long as a good relationship exists between your multiple transit providers
  • .
  • External over internal. Since BGP is primarily used as an external routing protocol, prefer externally-originated path over internally-originated paths.
  • Lowest metric to next hop. The next hop in BGP is generated by the advertising router. You must be able to reach this router in some way for your packet to be delivered appropriately; typically you know how to reach this router via a static route or a route advertised by an IGP.
  • Multiple paths. BGP can insert multiple paths for a given route into the routing table if you tell it to.
  • Multiple paths, part II. Use the path that you got first if they're both equal. This allows you to reduce churn.
  • Use the router ID as a tiebreaker.

So, what about route reflectors and confederations?

A route reflector is a tool in BGP used to get around the full mesh behavior of iBGP. Routes are sent to a single route server or machine, and "reflected" or rebroadcasted to route reflector clients. This allows every router to peer with the reflector, as opposed to peering with every other router on the internetwork.

Confederations are a tool for creating clouds of private autonomous systems which communicate with each other. This allows you to keep internetwork size down and control routing advertisements in a manner similar to the area concept in OSPF.

Policy control

BGP includes several mechanisms for control of incoming and outgoing routes. These include communities, prefix maps, route maps, etc. A detailed discussion of these mechanisms is better left to a face-to-face discussion with another network engineer, or by reading Bassam Halabi's excellent book, Internet Routing Architectures, Cisco Press.


BGP is a protocol used for IP routing within or external to an autonomous system. It is the sole protocol used to perform interdomain hierarchical routing. It allows control over path distribution, both incoming and outgoing, and a highly evolved route selection mechanism. It is not without its problems, but until something better comes along, it's all we've got.

(Some information derived from the Cisco TAC sections on BGP.)

Log in or register to write something here or to contact authors.