Using BGP in Your Network

The Border Gateway Protocol (BGP), documented in RFC 4271, is the standard protocol for routing between administrative domains. BGP refers to an administrative domain as an Autonomous System (AS). BGP is an exterior gateway routing protocol (EGP). BGP exchanges routing information among neighboring routers in different autonomous systems. An autonomous system is a set of routers under a single administration. AS numbers supported are 1 to 4294967295.

An AS typically uses a single Interior Gateway Protocol (IGP), such as OSPF, to propagate routing information among its routers.

A BGP system establishes sessions with neighboring routers, or peers, and maintains a database of network reachability information that it exchanges with its neighbors via update messages. BGP uses the Transmission Control Protocol (TCP) and port 179 for establishing connections.

Path Attributes

BGP routing updates include the complete route to each destination, as well as other information related to the route. Route information is included in the path attributes. BGP uses path attributes to provide more information about each route. Path attributes can also be used to distinguish between groups of routes to determine administrative preferences, allowing greater flexibility in determining route preference to achieve a variety of administrative ends. Supported BGP attributes include IP next hop, Multi-Exit Discriminator (MED), and local preference. BGP also uses path attributes to maintain the AS path.

The AS path is a path attribute that provides a list of the AS numbers the route traverses. The AS path is used for loop detection. Its length is used as a route selection criteria in the event the same prefix is learned from multiple peers. BGP uses the AS path and the path attributes to determine the network topology. This, in turn, enables BGP to detect and eliminate routing loops and to make routing policy decisions.

Refer to Using AS-Path Regular Expressions for information about using regular expressions when configuring AS path preference in route-maps.

Peers and Peer Groups

A peer is the BGP router‘s next hop neighbor. Peers can be organized into peer groups. A peer group is a group of neighbors that share the same attributes. You assign neighbors to the peer group, and create attributes for the group. Peer groups enable you to reduce the time and effort needed for configuration. You can override a peer group‘s policy by configuring unique policies for a specific peer group member.

BGP Sessions

BGP supports two basic types of sessions between neighbors: internal (sometimes referred to as IBGP) and external (EBGP). Internal sessions are run between routers in the same autonomous system. External sessions run between routers in different autonomous systems. When a router routes to an external peer, the local AS number is prepended to the AS path. This means that routes received from an external peer are guaranteed to have the AS number of that peer at the start of the path. In general, routes received from an internal neighbor will not have the local AS number prepended to the AS path. Those routes will have the same AS path that the route had when the first internal neighbor received the route from an external peer. Routes with no AS numbers in the path may be legitimately received from internal neighbors. BGP considers these routes internal to the receiver's own AS.

External BGP sessions may or may not include the Multi-Exit Discriminator (MED) among its path attributes. BGP uses MED to break ties between routes with equal preference from the same neighboring AS.

Internal BGP sessions carry the local preference attribute. The larger the local preference value, the greater the route is preferred within an AS. Internal sessions can optionally include the MED, carried in from external sessions.

Routes

A route consists of a prefix, a prefix length, and a set of information indicating policies and preference to reach the destinations indicated by the prefix. A prefix is made up of a dotted decimal formatted network identifier that includes a length that specifies the number of significant bits in the network. The route prefix is contained in the Network Layer Reachability Information (NLRI) and the BGP next hop path attribute determines where packets matching the prefix should be forwarded. The BGP next hop may be non-directly connected. In this case, for the route to be installed in the routing table, the router must have a route to the BGP Next Hop.

You can redistribute routing information between BGP and another protocol, and use route-maps to control the route updates.

Routing Policy

Routing policies can be used to filter routes both on an import and export basis, based upon its IP prefix, community (RFC 1997), extended community (RFC 4260), AS path, source IP address, and IP next hop. Routing policy is configured in a route-map, which is then applied to the route.

Confederations and Route Reflectors

Confederations enable you to divide a large AS into several smaller ASs, or to create an AS out of members of multiple ASs. Confederations are still fully meshed but require only a single connection to other ASs, reducing the number of peering relationships. From the outside, the confederation of smaller ASs looks like a single AS. Confederations are defined in RFC 3065

Route reflection enables you to configure a BGP router to advertise the routes learned from clients to other clients. This eliminates the full mesh requirement. You can configure one or more routers in the AS to be reflectors. The other routers are configured as clients. Route reflection is defined in RFC 4456.

BGP Sub-Features

Supported BGP sub-features include:

  • Graceful restart – Provides for the continued processing of the data-forwarding plane of a router should the control plane fail (RFC 4724)
  • Outbound Route Filtering – Allows a BGP speaker to send to its BGP peer a set of Outbound Route Filters (ORFs), which the peer applies in addition to its locally configured outbound filters (if any), to constrain its outbound routing updates to the speaker (RFC 5291)
  • Route Refresh – Allows for the dynamic exchange of route refresh requests between BGP speakers and subsequent re-advertisement of the respective Adj-RIB-Out (RFC 2918)
  • Route-Flap Dampening – Treats routes that are being announced and withdrawn at a rapid rate as unreachable, based upon a route penalty for each route withdrawal, and reachable again, based upon a configurable decay over time of that route penalty (RFC 2439)
  • Multiprotocol BGP Extensions – Enable BGP to carry routing information for multiple Network Layer protocols such as IPv6 and IPX (RFC 2858)
  • 4-Octet AS numbers – Allows for the encoding of 4-octet AS numbers (RFC 4893)
  • TCP/MD5 Authentication – Enhances BGP security by defining a TCP option for carrying an MD5 digest in a TCP segment that acts like a signature for that segment, incorporating information known only to the connection end points (RFC 2385)
  • Conditional Advertisement – Provides for the sending of BGP announcements, in addition to normal announcements, when a route specified in the configured advertise map does not exist in the configured non-exist map
  • Aggregation – Provides for the aggregating of one or more specific routes into a single aggregate route, if a more specific route of the aggregate route exists in the BGP routing table.
  • Soft Reconfiguration – Speeds up the route installation process when an inbound policy change occurs by keeping a local copy of the routes for the specified peer or group

BGP Topology shows a sample BGP topology with four autonomous systems:

  • Autonomous system A displays a standard fully meshed AS
  • Autonomous system B displays a route reflected topology
  • Autonomous system C and D displays a confederation topology with two confederations
    Click to expand in new window
    BGP Topology
    Graphics/BGPTopology1.png