fortypoundhead.com

BGP Routing Protocol

Posted On 2007-07-11 by FortyPoundHead
Keywords: Border Gateway Protocol
Tags: Cisco Networking Tutorial 
Views: 1578


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.

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 12.12.12.0
!
neighbor 40.40.40.40 remote-as 18990
neighbor 40.40.40.40 description AT&T T1 to Internet
!
neighbor 50.50.50.50 remote-as 1239
neighbor 50.50.50.50 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 12.12.12.254, 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

40.40.40.40 4 18990 7936243 265288 32688303 0 0 8w4d 194625

50.50.50.50 4 1239 9226970 3607327 32688297 0 0 2d00h 194444

Router#

Router# show ip bgp
BGP table version is 32688349, local router ID is 12.12.12.254
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 40.40.40.40 1 0 1239 i
*> 50.50.50.50 100 18990 i
* 3.0.0.0 40.40.40.40 8 0 1239 701 703 80 i
*> 50.50.50.50 100 18990 6395 701 703 80 i
* 4.0.0.0/9 40.40.40.40 9 0 1239 3356 i
*> 50.50.50.50 100 18990 3356 i
* 4.0.0.0 40.40.40.40 9 0 1239 3356 i
*> 50.50.50.50 100 18990 3356 i

Summary
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.


About the Author

FortyPoundHead has posted a total of 1974 articles.

 


Comments On This Post

No comments on this post yet!


Do you have a thought relating to this post? You can post your comment here. If you have an unrelated question, you can use the Q&A section to ask it.

Or you can drop a note to the administrators if you're not sure where you should post.


Your IP address is:54.80.58.75

Before you can post, you need to prove you are human. If you log in, this test goes away.



Recent Forum Posts

List of Shady Characters
dwirch posted on April 25, 2017 at about 16:39 in Webmaster Stuff

Job Spammer: Bilal Uddin
dwirch posted on April 25, 2017 at about 11:00 in Spammers

Bug Fix: Contact Form Error
dwirch posted on April 21, 2017 at about 11:38 in Site News

Bug Fix: Ophion Time Tracker
dwirch posted on April 9, 2017 at about 11:30 in Site News

Job Spammer: Yogesh Kapadne
dwirch posted on March 31, 2017 at about 8:04 in Spammers

Job Spammer: Sathya Narayana
dwirch posted on March 15, 2017 at about 7:18 in Spammers