Master CCNA

How to Master CCNA Ebook

 

 Start your networking career and Master CCNA

Master CCNP SWITCH

How to master CCNP SWITCH ebook

 

 Become a switching guru and Master CCNP SWITCH

Master CCNP ROUTE

How to master CCNP ROUTE Ebook

 

 Dominate routing protocols and Master CCNP ROUTE

Master CCNP TSHOOT

How to Master CCNP TSHOOT

 

 Complete your CCNP R&S journey and Master CCNP TSHOOT

Print

BGP for Beginners

Written by Rene Molenaar on . Posted in Blog

 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.

 

BGP Autnomous Systems

 

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:

 

route-views.optus.net.au

 

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 203.202.125.6  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  * 1.0.4.0/22 202.139.124.145 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 1.0.4.0/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:

 

Transit AS

 

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:

 

AS100: 10.0.0.0/8

AS200: 20.0.0.0/8

AS300: 30.0.0.0/8

 

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! Internal BGP (IBGP)

 

Let's imagine the following situation: AS100 sends a packet meant for 30.0.0.0/8 towards AS200. AS200 has learned about the 30.0.0.0/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 30.0.0.0/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!

Only registered users can write comments!

Comments (21)

  • avatar
    ravan

    this one just awesome please post few more like this and real equipment access also to practice if possible

  • avatar
    ReneMolenaar

    I'm glad you like it. You don't need real equipment to practice BGP, just download GNS3 and use some routers. Check out the "BGP basic Lab" since this will let you configure the basic commands to setup BGP.

  • avatar
    ReneMolenaar

    You need to think BIG. There's no reason for a small company or ISP client to use BGP.

    If you have a large network but only a single connection to an ISP, you also don't need BGP.

    Let's say you have 2 different ISPS, if you wouldn't use BGP then you just advertise a default route in your IGP and send all traffic towards a single ISP. You could also advertise 2 default routes with a different cost or metric, if one router fails the other will take over.

    Now you want to load balance a bit more...20% of the traffic towards ISP1 and 80% towards ISP2...how are you going to do this with OSPF/EIGRP/RIP?

    Or...you got some public IP address space and you want to advertise this to 2 different ISPS...

    I got a really cool document which explains this, I think I should update my article to add this information.

  • avatar
    anubisg1

    Having bgp between ISP, or between AS that "creates" internet makes perfectly sense...

    what i don't get is why i should use bgp in my company (let's admit that for some reasons i MUST find the best path to reach a destination, if for example i have a branch somewhere in the world) i cannot understand why me, an ISP client, should use bgp to push routes into bgp... ip address are ultimately assigned to the customer by the ISP, than the ISP already know the ip(subnets) and she will push them into bgp routing updates.. so... why should i do that? am i still thinking to small or what (i'm actually studying ccnp route exam)

  • avatar
    anubisg1

    i perform load balancing using GLBP, but i guess i'm starting to understand... can't wait for your updates.. what to say.. lucky me, you wrote this in the moment i started to study gbp :)

  • avatar
    ReneMolenaar

    GLBP is also nice for load balancing, you could also use NAT.

    Let me put it in another way...without BGP everything outside of your AS is a "blind spot". You have no idea what's out there. Once you are running BGP you know about all those prefixes, which AS they belong to and through which paths you need to go in order to get there.

    Having "more" complete routing information will ensure you can make better routing decisions...does this make sense?

    I'll cook up another article for you.

  • avatar
    Andrea Fl

    yes.. it perfectly make sense...

    as a company and as a "read only user"

    what i don't exactly understand is why should me, as a company push routing updates into GBP, and update the internet. looking on what you wrote it make sense only if i have more than one ISP becuse, even if one ISP gave me my address pool, and that particular ISP only know how to reach me, i may want to inform the other ISPs to witch i am connected that another path (though them) exist to reach me.

    is that correct?

  • avatar
    zingonet

    Andrea,
    One major reason why a company will use eBGP is for incoming traffic. Let's say company A is hosting their own website and they have 2 ISP's. If they are using an IP that is assigned from ISP 1 for there web server then they will use BGP to advertise this address out ISP 2 as well. This way the internet will now see that there are 2 possible paths to their IP address rather than just the path from ISP 1. Therefore, if the connection between ISP1 and company A drops, the company A's IP address is still available from ISP2.

    Remember ISP2 is only going to advertise their networks that have been assigned to them from ARIN, therefore, company A needs to use eBGP to advertise this alternate route. This happens all the time with many companies that purchase dedicated internet access circuits.

  • avatar
    javedsher

    Great article on Basic Understanding of BGP, I ever read. Rene, I really appreciate your effort to share knowledge and experience. You are the "Rocks"; after reading this article I stated thinking BIG ;) I hope you will keep it up.
    I just started CCNP ROUTE preparation.

    Thanks

  • avatar
    gafoorcholayil

    Sorry yar, I made a mistake liking your comment, Actually i like

  • avatar
    ReneMolenaar

    I'm glad you like it. If you want to read a little more you can also check my BGP chapter from the "How to Master CCNP ROUTE" book for free:

    http://www.renemolenaar.nl/CCNPROUTE-SAMPLE.PDF

    Good luck!

  • avatar
    kash007

    Gr8 job.

  • avatar
    gafoorcholayil

    Don't know how to appreciate you!, You brought me back to ma college!
    Great, well done!
    gafoorcholayil
    INDIA, Kerala

  • avatar
    jesuszamora

    Rene,

    From a beginner point of view this article is awesome. I guess that the other articles will get into more details such as the need to use loopbacks to identify the iBGP routers and their associated configurations...

    Simply outstanding!

    JZ

  • avatar
    escott69

    Amazing
    Thank you you so very much for your time and effort.

  • avatar
    kchange07

    Do we expect any study Material/book fully on BGP coming soon?

  • avatar
    TrevorEnygma

    This article is awesome. This is my first time reading on BGP as I have not gotten to it yet in the ROUTE book. Its nice and concise, plus its easy to understand.

feedback