Border Gateway Protocol

Border Gateway Protocol (BGP) is an exterior routing protocol used widely in the Internet. It is commonly referred to as BGP4 (version 4).

BGP4 is defined in RFC 1771. BGP allows you to create an IP network free of routing loops between different autonomous systems.

An autonomous system (AS) is a set of routers under the same administrative control.

BGP is called a path vector protocol because it carries a sequence of AS numbers that indicates the path taken to a remote network. This information is stored so that routing loops can be avoided.

BGP uses TCP as its Layer 4 protocol (TCP port 179). No other routing protocol in use today relies on TCP. This allows BGP to make sure that updates are sent reliably, leaving the routing protocol to concentrate on gathering information about remote networks and ensuring a loopfree topology.

Routers configured for BGP are typically called BGP speakers, and any two BGP routers that form a BGP TCP session are called BGP peers or BGP neighbors.

BGP peers initially exchange full BGP routing tables. After the exchange, only BGP updates are sent between peers, ensuring that only useful data is sent unless a change occurs.

Four message are types used in BGP4 to ensure that peers are active and updates are sent:

• Open Messages—Used when establishing BGP peers.

• Keepalives—These messages are sent periodically to ensure connections are still active or established.

• Update messages—Any changes that occur, such as a loss of network availability, result in an update message.

• Notification—Only used to notify BGP peers of any receiving errors. Key BGP characteristics include the following:

• BGP is a path vector protocol.

• BGP uses TCP as the transport layer protocol.

• Full routing table is exchanged only during initial BGP session.

• Updates are sent over TCP port 179.

• BGP sessions are maintained by keepalive messages.

• Any network changes result in update messages.

• BGP has its own BGP table. Any network entry must reside in the BGP table first.

• BGP has a complex array of metrics, such as next-hop address and origin, which are called attributes.

• BGP supports VLSM and summarization (sometimes called Classless Interdomain Routing [CIDR]).

BGP4's ability to guarantee routing delivery and the complexity of the routing decision process mean that BGP will be widely used in any large IP routing environment, such as the Internet. The Internet consists of over 100,000 BGP network entries, and BGP is the only routing protocol available today that can handle and manage such a large routing table. The Internet (80,000+ routes) could not be functional today if BGP were not the routing protocol in use.

Before covering some simple examples, the next section describes BGP attributes. BGP Attributes

BGP has a number of complex attributes that determine a path to a remote network. These attributes allow a greater flexibility and complex routing decision to ensure a path to a remote network is taken by the best path possible.

The network designer can also manipulate these attributes. BGP, when supplied with multiple paths to a remote network, will always choose a single path to a specific destination. (Load balancing is possible with static routes.) BGP always propagates the best path to any peers.

BGP attributes are carried in update packets.

Table 2-14 describes the well-known and optional attributes used in BGP4.

Table 2-14 Well-Known and Optional Attributes

Attribute

Description

Origin

This attribute is mandatory, defines the source of the path, and can be three different values:

IGP—Originating from interior of the AS.

EGP—Learned through an External Gateway Protocol.

Incomplete—The BGP route was discovered using redistribution or static routers.

AS_Path

Describes the sequences of AS that the packet has traversed to the destination IP network.

Next Hop

Describes the next-hop address taken to a remote path, typically the eBGP peer.

Local Preference

Indicates the preferred path to exit the AS. A higher local preference is always preferred.

Multi Exit Discriminator (MED)

Informs BGP peers in other autonomous systems about which path to take into the AS when multiple autonomous systems are connected. A lower MED is always preferred.

continues continues

Table 2-14 Well-Known and Optional Attributes (Continued)

Attribute

Description

Weight

Cisco-defined, attribute-only attribute that is used in local router selection. Weight is not sent to other BGP peers, and higher weight value is always preferred. Weight is locally significant to the router and specifies a preferred path when more than one path exists. Cisco-only attribute.

Atomic Aggregate

Advises BGP routers that aggregation has taken place. Not used in router selection process.

Aggregator

The router ID responsible for aggregation; not used in the router selection process.

Community

Allows routes to be tagged and use a group of routes sharing the same characteristics. An ISP typically tags traffic from customers along with a route-map to modify the community attribute.

Originator ID

Prevents routing loops. This information is not used for router selection.

Cluster-List

Used in a route-reflectors environment. This information is not used for router selection.

There are two types of BGP sessions: internal BGP (IBGP) and external BGP (EBGP). IBGP is a connection between two BGP speakers in the same AS. EBGP is a connection between two BGP speakers in different autonomous systems.

IBGP peers also make sure that routing loops cannot occur by ensuring that any routes sent to another AS must be known via an interior routing protocol, such as OSPF, before sending that information. That is, the routers must be synchronized. The benefit of this added rule in IBGP TCP sessions is that information is not sent unless it is reachable, which reduces any unnecessary traffic and saves bandwidth. Route reflectors in IBGP ensure that large internal BGP networks do not require a fully meshed topology. Route reflectors are not used in EBGP connection. A BGP route reflector disseminates routing information to all route-reflector clients, and ensures that BGP tables are sent and that a fully meshed IBGP need not be configured.

The BGP routing decision is quite complex and takes several attributes into account. The attributes and process taken by a Cisco router running BGP4 are as follows:

1 If the next-hop address is reachable, consider it.

2 Prefer the route with the highest weight (Cisco IOS routers only).

3 If the weight is the same, prefer the largest local preference attribute.

4 If the local preference is the same, prefer the route originated by this local router (routes generated by network or redistribute commands).

5 Then prefer the route with the shortest AS Path.

6 If this is equal, prefer the route with origin set to originated (via BGP); IGP is preferred to EGP and then incomplete.

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

8 If the MED is the same, prefer EBGP over IBGP.

9 Then prefer the path that is the closest.

10 Finally, if all else is equal, prefer the path with the lowest BGP router ID.

0 0

Post a comment