An Introduction to BGP – Border Gateway Protocol

Border Gateway Protocol-

BGP is the routing protocol of the internet. It is non-proprietary and has the ability to run on many different networking devices. This is typically ran on higher end routers, or even layer 3 switches. This is what the internet backbone routers use to make routing decisions for traffic traversing the internet.

BGP specifies how routers communicate with each other and share information which dictates the possible paths for traffic to take going in or out of a network.BGP is a path vector protocol, which means that its routing decisions are based on path, policies, and/or rule sets.

Path Selection:

The path is calculated using routing information and the BGP path selection algorithm. Different protocols use different metrics or attributes for best path selection. Below are some examples of common routing protocols  and how the information they use to make routing decisions.

RIP – Uses hop count

EIGRP- Bandwidth, load, delay, reliability, MTU, and hop count

BGP- Path, policies, and/or rule sets

IGP vs. EGP:

BGP is and EGP (Exterior Gateway Protocol) in most cases and requires that an IGP (Interior Gateway Protocol) run below it. However, on some very large networks, you can use BGP as an IGP.

BGPv4 was introduced in 1994, this is the current version that most anyone uses to peer with. However, there is also a version called MBGP, or multi-protocol BGP that can be used for multicast routing in conjunction with PIM.

-All older versions of EGP are considered obsolete

-BGPv4 supports CIDR, and route aggregation – RFC4271

BGP by nature is extremely stable and scalable. Slow to converge, slow to propagate changes, etc., but this is good in a very large network (ie.the internet) where constant reconvergence and chatter would cause major disruptions.

BGP is used by all Tier1 ISPs for connectivity to each other, and to customers. Below are some examples of Tier1 ISPs.

-Level3 Communications

-Zayo Communications

-Qwest Communications

More information about Tier 1 providers can be found here. A router with only one upstream internet connection can run BGP to peer with an upstream, but it is not required and can easily be done with static routes. BGP is almost required to multi-homed carriers, although it is possible to accomplish this with static routes, it’s difficult to setup and manage dynamically.

What does the term multi-homed mean?

This simply means that a router has more than a single path or connection to the internet. This can be in the form of a primary/backup link or when load balancing between ISPs.

To share BGP routing updates between 2 routers:

-Requires an AS (Autonomous System) number to be configured on each router

-Requires a neighbor IP and underlying physical connectivity

BGP routers connected to each other form ‘neighbors’ or ‘peers’

Terminology, Types of peers:

-eBGP peer – External peer to an AS with a different number than your own i.e. Edge router to Tier1 ISP

-iBGP peer- Internal peer between devices in the same AS i.e. Edge router to a secondary router owned by the same company

AS numbers and neighbors statements must be configured on both routers pointing to the router it wishes to peer with.

Miscellaneous BGP Facts:

There are an estimated 400,000+ ipv4 BGP routes on the internet

There are an estimated 6,000+ ipv6 BGP routes on the internet.

BGP allows the use of prefix-lists, that can be used to block or allow certain ranges or prefixes to be advertised of received from a BGP neighbor.

 ip prefix-list Advertise_v4_Out permit ip 10.25.0.0/16

Specific AS numbers can be blocked or allowed using AS path filters and regular expressions.

ip as path access-list 99 permit ^$
ip as-path access-list 99 permit ^65004$
ip as-path access-list 100 permit ^65004(_65004)*$

Routing attributes can be appended to certain prefixes or all prefixes in the routing update to affect routing decisions made by the BGP path selection algorithm.

-Weight – Manually sets the outbound traffic path of one neighbor to be higher than than a less preferred path outbound

-Local Preference – Manually sets the preference for an outbound path, these settings are shared among all iBGP peers

-Origin Code – Manuallys sets the origin code of a particular route

Prefix-lists, and as-path filters are applied with neighbor statements to the neighbor it is to affect.

Community attributes can be applied using route-maps, and then route map can then in turn be applied to a BGP neighbor. Communities are attributes that are appended to routes to influence how they are used, attributes can make a route looks farther away, more preferable, or even null the route all together so traffic destined for a particular range is dropped.

This general overview barely scratches the surface of BGP routing and what can be done with it. This was meant to be a general overview of the basics and some of the most common traits associated with any BGP setup. Look for future posts for a more in depth explanation of BGP along with full commands and setup notes to implement in a lab scenario.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s