I’m writing this article for everyone that is new to BGP. Perhaps you have passed your CCNA and have learned about all the IGP’s like OSPF, RIP and EIGRP but you still don’t know anything about BGP. Before we start talking about BGP, there’s something you need to keep in mind…
Forget everything you know about OSPF (link-state) or EIGRP/RIP (distance vector) routing protocols because BGP is totally different and called a “path vector” routing protocol. Now don’t feel frustrated 😉 We’ll have a look and see what BGP is all about! You are probably familiar using EIGRP or OSPF since these are IGP (Interior gateway protocols) and you are using them on your own network.
You should be familiar with the term AS (autonomous system), your own network is an example of an autonomous system. All the interior gateway protocols have one thing in common, they all want to find the “shortest” path to their destination network. They have a different view on what the shortest path is though:
- OSPF: Cost
- EIGRP: Bandwidth, Delay, Load and Reliability (also called the K-values)
- RIP: Hop count
BGP is not an interior gateway protocol but an EGP (exterior gateway protocol) and used to connect all the different autonomous systems. Now think big…..BIG! On an Internet scale we have a LOT of autonomous systems. With BGP we can see all the different networks, to which autonomous system they belong and which autonomous systems we have to cross to get there. BGP is what we use for routing on the Internet.
In the picture above we see multiple autonomous systems. These could be large networks from service providers who are connected to each other. Within each autonomous system we are running an Interior gateway protocol. AS100 might be running OSPF, perhaps AS200 is running EIGRP and AS300 and AS400 something else.
The routers that are connecting the different autonomous systems to each other are running BGP. Because we are setting up BGP between 2 different autonomous systems this is what we call “External BGP”. Now if you want to see what a real BGP router looks like, you can use one of the many looking glass servers that are found on the internet, try the following one by telnetting to this address:
So just type in “telnet route-views.optus.net.au” in your command line and you’ll have access to a Cisco router.
Type in “show ip bgp” to see an example of a BGP routing table:
BGP table version is 134443079, local router ID is 188.8.131.52 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 * 184.108.40.206/22 220.127.116.11 10 0 7474 7545 56203 i
If you look at the right side you see “Path” with the values 7474, 7545, 56203. These values are the autonomous systems that you have to go through in order to reach network 18.104.22.168/22. Pretty neat huh? Metric, LocPrf (Local Preference) and Weight are the attributes that BGP uses to influence routing decisions, you can forget about those for now but I will write another article on them in the future.
We just learned what external BGP is, this is when you run BGP on routers between different autonomous systems. But there’s also internal BGP so let’s see what it is and why we need it.
Take a look at the following picture:
Let me explain you what we have here: There are 3 different autonomous systems, AS100, AS200 and AS300. As you can see AS200 is running OSPF inside it’s autonomous system. We don’t care about what AS100 or AS300 is running inside it’s autonomous system for this scenario. We are using the following ip addressing scheme within the autonomous system:
BGP has been configured between the 3 autonomous systems, and since it’s between autonomous systems this is EBGP (external BGP). We have advertised the networks in BGP and life is good. However in this scenario there is a problem.
AS100 will advertise 10.0.0.0/8 towards the BGP router in AS200 on the left side.
How does the router on the right side in AS200 know about this information? We are only running OSPF within AS200 and we are not redistributing BGP information into OSPF. (An Internet routing table consists of roughly 350.000+ entries…no way you can have this many networks in OSPF).
The answer is simple…let’s configure BGP between the left and right router within AS200. Since they are in the same autonomous system this is called IBGP (internal BGP). Excellent so now both routers are running IBGP and they can exchange routing information.
So are we done? Is this going to work? Unfortunately….Nope!
Let’s imagine the following situation: AS100 sends a packet meant for 22.214.171.124/8 towards AS200. AS200 has learned about the 126.96.36.199/8 by BGP and knows where to send it. The router on the left side in AS200 will send it towards the router on the right side by using the router on the top or bottom in AS200.
What do you think these routers will do? Does OSPF know about the 188.8.131.52/8 network?
No they don’t….they have no clue where this network is so they will drop the packet and send it to IP packet heaven. The solution is that you need to configure BGP on ALL routers within AS200.
So do you always have to configure IBGP? You only have to do this when your autonomous system is a transit AS. A transit AS means that your autonomous system can be used to pass traffic to another autonomous system. In this case AS100 needs to pass AS200 in order to reach AS300.
Ok I think that’s enough BGP for now and to be honest I’ve been writing a bit more about BGP than I intended when I started this article. In the upcoming articles I will be writing about BGP attributes, this will show you how BGP will choose a certain path and how we can influence routing decisions.
So what do you think? Does this make sense to you? I’d like to hear what you think so leave a comment if you feel like!