Multihoming Using BGP
Volume Number: 17
Issue Number: 4
Column Tag: Networking
Multihoming Your Network Using the Border
Gateway Protocol (BGP)
By Chris Kilbourn
Editied by Justin W. Newton, Senior Director, Networking and Telecommunications,
NetZero, Inc.
What is BGP?
BGP stands for Border Gateway Protocol and is generally used as an exterior gateway
network routing protocol. When it is used as an exterior protocol, it only passes
information about external network information it receives, and does not transmit any
information about internal network routes or structures to the outside world.
BGP is only useful if you are multihomed (have more than one Internet connection.) If
you only have one Internet connection, you only have one path to the Internet, and BGP
would only ever announce that one path to your network. If that one link goes down,
there is no failover that can be done via BGP. A network topology with only one path
would be much better served by using static IP routes.
BGP allows for the announcement to the rest of the Internet that you have more than
one path into your network. This means that any traffic destined for your network has
a redundant path and having redundant paths into your network unshackles you from a
single point of network transit failure.
This is generally accepted to be a Very Good Thing due to the increased uptime and
accessibility of your network when running BGP.
History of BGP
BGP had its roots in EGP (Exterior Gateway Protocol) as put forth in October of
1982[1] which introduced the key concepts of autonomous systems, network
neighbors, the routing core and routing updates.
EGP described a system of autonomous systems of networks which exchanged network
reachability information to network neighbors. This was done via routing updates
when the network status changed state (up/down) in the core as reported by
neighboring networks.
Since 1982, EGP and then BGP protocols have gone through several changes to support
new technologies and the challenges of scaling the Internet routing system. Currently,
BGP-4 is actively deployed in the 'core' of the Internet.
Today, the core of the Internet is considered to be network mesh of boundary routers
between autonomous networks.
Format and Workings of BGP
BGP is used to pass network route information between autonomous networks on the
Internet. Unlike active routing protocols like AppleTalk that periodically pass the
entire route table, BGP only passes network change information when it occurs.
BGP messages passed between network neighbors fall into one of four categories: open
messages, update messages, notification messages, and keep-alive messages.[2]
Open messages are used to establish a routing session between network neighbors, and
include the BGP version number being used, the ASN (Autonomous System Number) of
the originator, a hold time used to set session timing to prevent message flooding, a
BGP identifier which is set to an IP address of the sender and optional parameter
information which is generally used for security.
Update messages serve double duty by passing new route announcements with network
path information and by informing neighbors of withdrawn routes and networks.
Keep-alive messages are exchanged between neighbors to let neighbors know that they
are still there and routing. If a neighbor does not receive a keep-alive message, it will
back off sending data to that neighbor until a new open message is received and
withdraw those routes from the local routing table.
Notification messages are used to report errors to neighbors, and the BGP session is
then closed to prevent invalid data to be injected into the routing table.
BGP neighbors exchange network route information that are passed as belonging to a
particular ASN, and routing decisions are made on ASN reachability information. The
shortest ASN path is generally chosen when presented with multiple paths to a given
network.[3]
Migrating to BGP
Migrating your network to BGP routing can be a challenging process, and it is not for
everyone. In fact, the Internet community has stringent requirements before you can
send your first open message to your first BGP neighbor.
These requirements include being multi-homed, having a powerful enough router to do
BGP routing, being assigned your own block of IP address space, and having an ASN
number assigned to your organization.
Usually, the first BGP routing you will do will be to your upstream Internet transit
providers. Since each network that you connect to may have different requirements,
you should inquire with your future BGP peers to determine what requirements they
have.
The first step, becoming multi-homed, is the easiest. All you need to have is more than
one Internet connection from different Internet access providers who will exchange
BGP routes with you.
RAM - Routers Need It Too!
As you saw in the main part of the article, this and many other types of router
uses requires lots of RAM. And, this isn't just any RAM - it's the kind that can
get expensive quickly for several reasons.
First, the RAM needs to be high quality and relatively fast. Second, is the
configuration of the RAM module itself - it's not the same as what you'd buy
for your Mac or PC.
After checking around with router people "in the know", we came up with two
places to get router RAM. First, is to get it from a Cisco reseller. This is the
most expensive way to go. Second, we found Rocky Mountain RAM, in Boulder,
Colorado - and saved a considerable amount of money compared to the local
Cisco reseller. The rep we spoke to was Eric Thomas,
ethomas@ram-it.com, 800-543-0932 - and he knew quite a bit about
Cisco's.
Got the RAM, popped it in, and never thought about it again. Just as life should
be.
Acquiring a powerful enough router is a little harder due to cost issues. Currently, you
need at least 128MB of RAM in your router (if you use Cisco gear,) to accept the full
Internet BGP route table. Router RAM is expensive, and the more connections you have
to the Internet, the more processing power you will need. There is a fairly active used
market right now, so be sure to shop around, and compare vendors!
IP address space allocation is the hardest part of the process as networks must meet
stringent requirements to demonstrate need.[4],[5] There are two methods of
obtaining IP addresses: from a regional IP registry, or from one of your upstream
ISP's.
Unless your network is already utilizing 2,048 IP addresses internally or with
downstream clients, you will not qualify for your own address space allocation from a
registry and will need to request space from one of your ISP's.
Due to IP address depletion, you should only ask for the amount of IP space you really
need. While it used to be the case that only large IP blocks were routeable in BGP,
small blocks are now commonly routed so there is no need to ask for extra IP space any
more.
Once you have been allocated IP address space from a registry or your ISP and are
currently multihomed, you can begin the process of applying for an ASN.[6]
ASN's are defined by a 16 bit identification number assigned by ARIN[7] for North and
South American networks, RIPE[8] for European and African networks, and APNIC[9]
for Asian and Pacific networks. These organizations are also responsible for IP address
allocations for their respective regions.
It is possible to obtain an ASN without an IP network address allocation, but its utility
is somewhat limited. This is because ASN's obtained this way are limited to running
BGP in a closed system and are prevented from advertising their networks to the rest
of the Internet via BGP.
Since there are only 65,536 possible ASN's, it is important that you only request an
ASN if you are immediately about to multi-home. No one will think that you are 'cool'
if you have your own ASN and are not using it. Quite the opposite, in fact.
Once allocated your ASN[10], you are ready to begin BGP routing.
Getting Started With BGP Routing Commands
All of the following examples are based on Cisco's IOS command set, and show reserved
address space for route announcements and ASN's. Additionally, the examples shown
reflect a bare-bones configuration for simplicity's sake.
It is also assumed that you have already created your internal network routes and
defined interfaces.
You should perform your own research before copying these examples and deploying
them in your network.[11]
The author would also like to point out that there are many different ways to configure
BGP, and that best current practices are constantly evolving. Study, evaluate and
decide what configuration parameters, options and methods will be best for your
network.
Additionally, you will need to coordinate with your ISP's to begin BRP routing. Plan
ahead to make sure that they are ready to accept your BGP sessions, and that these
changes are done duing your normal maintenance window in case something goes wrong.
Enter command mode and tell your router what your ASN is:
autonomous-system 64512
Next, you need to tell the router that you want to enter some BGP commands, prevent
an arbitrary router from trying to synchronize with ours, and also tell our router
what networks are local to our ASN:
router bgp 64512
no synchronization
network 192.168.0.0 mask 255.255.224.0
network 192.168.145.0
network 192.168.225.0
network 10.4.0.0 mask 255.255.0.0