What you need to know about BGP routing protocol
Perhaps you are thinking that you could care less about some routing protocol called BGP. Could it possibly have anything to do with your every day life? The answer is yes. BGP is the routing protocol of the Internet. BGP is how all Internet routers route your email and web requests across the Internet. Without BGP, no traffic would flow across the Internet and the Internet would be useless. Let’s learn about BGP…
What is BGP?
In the early days, the Internet used static routes, but very quickly network administrators couldn’t keep manually updating their routing tables. Later, Internet network admin’s used a protocol called EGP but EGP was not scaleable. BGP was introduced to solve all these problems and more. BGP stands for Border Gateway Protocol and the most current version is BGP4. BGP4 is based on RFC4271. BGP is a routing protocol (software) that runs on routers. BGP allows for fully decentralized management of the Internet. That means, if you have a BGP router on the Internet, you can tell all other routers what networks you have available to everyone in the world.
BGP calls each routing domain an autonomous system (AS). BGP is called a path vector routing protocol and its main metric is “shortest AS path”. That means that it selects the best path, through the Internet, by choosing the route that has to traverse the fewest autonomous systems.
Do I need to run BGP on my home or small business router?
The short answer to this question is NO. You do not need to run BGP on your home or small business router. All Internet Service Providers (ISPs) that have multiple connections to the Internet use BGP to communicate with those other providers. If you only have a single connection to the Internet, you don’t need BGP because you don’t have any other path to select from. Because of that, you don’t need a routing protocol to select the best path.
What if I want to run BGP?
If you want to run BGP, you will have to talk to your Internet Service Providers to see if they will agree to communicate with you via BGP. You will have to show your need to run BGP. There are no cable or DSL internet providers that will allow you to communicate with them via BGP. The only circuits that you will be using BGP on are T1 speeds and above. The only providers that will allow you to exchange BGP routes with them are major (Tier 1 or Tier 2) Internet Service Providers.
Let’s say that you have a T1 to Sprint and a T1 to AT&T. To run BGP, you will have to obtain an autonomous system number and block of public IP addresses to advertise. In the United States, both of these can be obtained from the American Registry of Internet Numbers (ARIN). Other countries have their own providers. You can find yours through the ARIN International Community webpage. These regional registries (like ARIN) are also places to turn to, to troubleshoot networking by looking up the owners and contact information for IP address blocks and AS numbers. There are BGP looking glass servers on the Internet that you can use to view the status and BGP routing tables of Internet BGP routers.
With BGP, your router will download a full list of Internet routes from your ISPs (BGP neighbors). A full list of Internet BGP routes is over 150,000 routes. That means, with two providers, you will have to download over 300,000 routes. Your router will put all those routes into memory and compare them to find the best route (the route with the shortest AS path). The best routes will be put into the routing table. As you might guess, you will need a strong router with a fast CPU and lots of RAM to process these BGP routes. I recommend at least a Cisco 3800 series router with 1GB of RAM.
How would I configure BGP?
Configuring BGP is really pretty simple if you understand what you are doing. However, because there are many different BGP designs, some BGP configurations can be complex. Let’s look at a common configuration: you want to multi-home your network to two Internet service providers. That way, if one provider goes down, your inbound and outbound Internet traffic won’t miss a beat. Here is the basic configuration to do this:
router bgp 123456 no synchronization ! network 18.104.22.168 ! neighbor 22.214.171.124 remote-as 18990 neighbor 126.96.36.199 description AT&T T1 to Internet ! neighbor 188.8.131.52 remote-as 1239 neighbor 184.108.40.206 description Sprint T1 to Internet ! no auto-summary
I have taken out some of the default statements and created spaces between important sections. Let’s examine these sections.
router bgp 123456 – this statement is the first statement you use to enter BGP router configuration mode. The 123456 represents your AS number that you obtained from ARIN.
no synchronization – this command tells BGP that to advertise routes to BGP neighbors, those routes don’t have to exist in the routing table.
neighbor X.X.X.X – the neighbor statements are used to configure your connections to your BGP neighbors. The X.X.X.X is the IP address for your neighbor. The “remote-as” statement is the remote AS number for that neighbor. You can see the optional description statement to help you identify that neighbor. In this example, we have two neighbors.
no auto-summary – tells BGP not to summarize IP addresses that you are advertising to neighbors as classful IP address boundaries.
The most common BGP commands used to look at BGP status are show ip bgp summary and show ip bgp. The show ip bgp summary command shows the status of BGP. The show ip bgp command shows the BGP routing table. Here are two examples:
Router# show ip bgp summary BGP router identifier 220.127.116.11, local AS number 22697 BGP table version is 32688303, main routing table version 32688303 195171 network entries using 22835007 bytes of memory 389176 path entries using 20237152 bytes of memory 69781/40422 BGP path/bestpath attribute entries using 8652844 bytes of memory 63075 BGP AS-PATH entries using 1683540 bytes of memory 0 BGP route-map cache entries using 0 bytes of memory 0 BGP filter-list cache entries using 0 bytes of memory BGP using 53408543 total bytes of memory Dampening enabled. 106 history paths, 18 dampened paths BGP activity 631768/436597 prefixes, 3135640/2746464 paths, scan interval 60 secs
Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd 18.104.22.168 4 18990 7936243 265288 32688303 0 0 8w4d 194625 22.214.171.124 4 1239 9226970 3607327 32688297 0 0 2d00h 194444 Router#
Router# show ip bgp BGP table version is 32688349, local router ID is 126.96.36.199 Status codes: s suppressed, d damped, h history, * valid, > best, i – internal, r RIB-failure, S Stale Origin codes: i – IGP, e – EGP, ? – incomplete Network Next Hop Metric LocPrf Weight Path * 0.0.0.0 188.8.131.52 1 0 1239 i *> 184.108.40.206 100 18990 i * 220.127.116.11 18.104.22.168 8 0 1239 701 703 80 i *> 22.214.171.124 100 18990 6395 701 703 80 i * 126.96.36.199/9 188.8.131.52 9 0 1239 3356 i *> 184.108.40.206 100 18990 3356 i * 220.127.116.11 18.104.22.168 9 0 1239 3356 i *> 22.214.171.124 100 18990 3356 i
In this article, we learned the following:
- BGP is the routing protocol of the Internet
- BGP is used by Internet service providers or companies that need to multi-home their network to two Internet service providers
- If you need to use BGP, you will find that BGP routing tables are huge and you will need a strong router to hold these tables
- BGP designs can be simple or complex
- Simple BGP configurations are not difficult to configure
- The two most common BGP show commands are show ip bgp summary and show ip bgp.