The border gateway protocol (BGP) is one of the core routing protocols in the Internet. It works by maintaining a table of IP networks or 'prefixes' which designate network reachability between autonomous systems (AS). It is described as a path vector protocol.

BGP supports classless interdomain routing and uses route aggregation to decrease the size of routing tables. Since 1994, version four of the protocol has been in use on the Internet; all previous versions are considered obsolete.

Very large private IP networks can also make use of BGP; an example would be the joining of a number of large OSPF networks where OSPF by itself would not scale to size.

Most Internet users do not directly use BGP. However, as all internet service providers must use BGP to establish routing between one another, it is one of the most important protocols on the Internet. Compare and contrast with Signalling System 7, which is the core inter-provider call setup protocol on the PSTN.

BGP operation

BGP neighbours, or peers, are established by manual configuration between routers, creating a TCP session on port 179. BGP is unique among routing protocols in this respect by using TCP as its transport protocol.

BGP is comprised of two parts, the Interior Border Gateway Protocol and Exterior Border Gateway Protocol, respectively known as IBGP and EBGP. IBGP is used within a single autonomous system while EBGP is used between different autonomous systems. All routers within a single AS and participating in BGP routing must be configured in a full mesh; that is, every router must be configured as a peer of every other router. This causes obvious scaling problems, since the number of required connections grows quadratically with the number of routers involved; to get around this, two solutions are built into BGP, route reflectors and confederations.

Route reflectors reduce the number of connections required in a AS. One or two (for redundancy) routers are configured as route reflectors; other routers in the AS will then only have to peer to them.

Confederations are used in very large networks where a large AS can be configured to encompass smaller more manageable internal ASs. Confederations can be used in conjunction with route reflectors.

BGP problems and mitigation

A feature known as 'dampening' is built into BGP to mitigate the effects flapping routes. Flapping routes can be caused by physical interfaces or WAN links going up and down or misconfigured or mismanged routers. Without dampening routes can be rapidly injected and withdrawn from routing tables which can cause a heavy processing load on routers and therefore possibly effect overall routing stability. With dampening flapping routes are exponentially decayed. On the first instance a route if a route becomes unavailable and then suddenly reappears, for whatever reason, the dampening will not take effect to maintain the normal fail over times of BGP. On the second occurrence BGP will time out that prefix for a certain length of time and subsequent occurrences will be exponentially timed out. After the abnormalities have ceased and a suitable length of time has passed for the offending route, prefixes can be reinstated and the slate wiped clean. Dampening can also prevent malicious denial of service type attacks. Dampening timings are highly customisable.

One of the largest problems BGP faces and indeed the Internet infrastructure as a whole is the exponential growth of the Internet routing table. One of the many advantages of IP version 6's huge address space is to potentially solve this by better use of route aggregation.

BGP version four is specified in request for comment (RFC) 1771.

External links