Home > Border Gateway Protocol BGP Tutorial

Border Gateway Protocol BGP Tutorial

August 25th, 2016 Go to comments

Basic understanding about BGP

We really want to show you why we need BGP first but it is very difficult to explain without understanding a bit about BGP. So we will learn some basic knowledge about BGP first.

First we need to understand about the different between Interior Gateway Protocol and Exterior Gateway Protocol. The difference between them is shown below:


Interior Gateway Protocol (IGP): A routing protocol operating within an Autonomous System (AS) like OSPF, EIGRP… Usually routers running IGP are under the same administration (of a company, corporation, individual)
Exterior Gateway Protocol (EGP): A routing protocol operating between different AS. BGP is the only EGP used nowadays

In the topology above R1, R2 and R3 should run an IGP to communicate with each other because they are in the same AS. But to connect with other routers in another AS (like a different ISP), R1 and R3 must use an EGP.

With BGP, the term autonomous system (AS) refers to a network that operates separately from other networks and usually operates within a single administrative domain. Each AS is represented by an AS number. It is similar to EIGRP AS in this aspect. BGP is used mainly by the Internet Service Provider (ISP) all over the world. Each ISP usually has one BGP AS number (some very big ISP may have a few AS numbers). BGP AS numbers can be between 1 to 65,535.

In the topology above R1 and R3 are operating in BGP AS 1. If an AS connects to the public Internet using an EGP, then it must be assigned a unique AS number which is managed by the Internet Assigned Numbers Authority (IANA). IANA manages the AS numbers from 1 to 64,512 for public use (similar to public IP addresses) while 64,512 to 65,535 numbers are reserved for private use (similar to private IP addresses).

If we don’t want to show the routers inside each AS we can simply ignore them:


In fact, the Internet that we are going “online” everyday is a collection of interconnected autonomous systems and BGP is running to provide routing between them.

Other BGP terms that you should learn are listed below:
+ BGP speaker: a router running BGP
+ BGP peer or BGP neighbor: Any two routers that have formed a TCP connection to exchange BGP routing information (as BGP runs over TCP on port 179, not UDP)
+ Prefix: Maybe you learned the word “subnet”. In BGP world, it is usually called “prefix” because BGP usually does not advertise small subnets. It advertises blocks of large subnets so “prefix” is often used instead
+ Internal BGP (iBGP): refers to the BGP neighbor relationship within the same AS. The iBGP neighbor does not have to be directly connected
+ External BGP (eBGP): refers to the BGP neighbor relationship between two peers belongs to different AS. It is recommended that eBGP should be directly connected. Never run an IGP between eBGP peers.

In the below topology suppose all routers are running BGP then R1 is considered internal BGP to R2 and R3 (as they are running same AS 1) but is external BGP to R4. R5 is internal to R4 and R6 but external to R3.



Why do we need BGP?

Maybe you will raise a question: “Why can’t we only use OSPF or EIGRP instead?”

The most important reason is BGP greatly supports path control.

Maybe you learned and understood about EIGRP, OSPF routing protocols. They are different but both of them have the same purpose: find the most optimal path to the destination. But when we are working in ISP level we don’t care much about this. In ISP we really want to control the path, even it is not the most optimal path, to the destination. For example, how can you choose which path to go from AS 1 to AS 3 in the topology below?


Suppose an IGP (like OSPF) is using all the way. With default values and same bandwidth on all the links, OSPF will choose the path AS 1 -> AS 2 -> AS 3. In order to manipulate the path we will have to change the bandwidth of some interfaces on the edge routers of each AS. A few months later we want to change the path then we have to configure the bandwidth again. With BGP we can easily define the path like this: “to go from AS 1 to AS 3 we will go through AS 2 then AS 4 then AS 5”. Moreover we can easily control the ratio of traffic passing through each link. BGP can do this because it has a rich set of features to control the paths to the destination. One of the most popular features BGP uses to control the path is known as “attributes”. However, discussion about “attributes” is out of the scope of this tutorial, which is dedicated for CCNA learners.

In fact, BGP is a path vector protocol. Path vector protocol does not rely on the bandwidth of the links (like OSPF) or hop count (like RIP) or a group of parameters (like EIGRP). Path vector protocol relies on the number of autonomous systems it has to go through. In other words, it choose the path with least number of autonomous systems (shortest AS Path) to reach the destination, provided that the path is loop-free. Of course we can change the path easily for our purpose.

For example in the topology above, if all the values are default and same, BGP will choose the path AS 1 -> AS 2 -> AS 3 for traffic from AS 1 destined to AS 3 because it only has to go through one AS (AS 2).

Another reason to use BGP is BGP can handle very big routing tables. The ISP level of routing do had large number of routes, which IGP cannot handle. BGP handle such large routes between AS. Currently the global Internet routing table contains over 500,000 routes.

Another good reason to use BGP is because the great benefits of MPLS-based virtual private networks (MPLS VPN). MPLS VPN is beyond the scope of this tutorial but in general MPLS VPN provides traffic separation and path isolation on a shared network infrastructure and BGP is the background layer so that VPN can operate well. For example your corporation is running Voice over IP (VoIP), Video on Demand (VoD), Internet service… on the same infrastructure then you can use MPLS VPN to separate these services as if they were running on theirs own infrastructure.

In the next part we will learn about how your edge routers of your company can connect to the ISP.

Comments (35) Comments
Comment pages
1 2 3 2820
  1. Anonymous
    September 27th, 2017

    Hi anyone can submit the latest dump please.
    My email id is {email not allowed}


  2. xxErmis
    September 27th, 2017

    Amazing tutorial

  3. Anonymous
    October 3rd, 2017

    Hi can someone please send me the latest dumps to iddemo777 @ gmail com

  4. Anonymous
    October 3rd, 2017

    Hi, can someone please send me the latest CCNA dumps to iddemo777 @ gmail com – Thank you in advance :D!

  5. halil
    October 6th, 2017

    Hello, My name is halil;
    I need CCNA questions, Could you help..

    halilalban at outlook dat com

  6. Soi
    October 13th, 2017

    Excellent tutorial!

  7. Hello, My name is Kalayu;
    November 7th, 2017

    I need new CCNA questions as industrial exam; Please could u help me;
    please send me the latest CCNA dumps to {email not allowed}

  8. KT
    November 8th, 2017

    Can someone send me some CCNP route and Switch Dumps please. kimdctorres @ gmail.com

  9. Baseer
    November 20th, 2017

    please any one send me the latest dumps …. ccnp routes. {email not allowed}

  10. JG
    November 21st, 2017

    anyone have the latest dump that can be emailed to me ejgoode @ gmail.com thks!

  11. Anonymous
    November 29th, 2017

    hi, can someone please send me the latest CCNA dumps to {email not allowed}

  12. Anonymous
    November 29th, 2017

    hi can someone please send me the latest CCNA dumps to selimaydin91 @ gmail com

  13. ploaded
    December 3rd, 2017

    please someone should send me the latest CCNA dumps. {email not allowed} thanks

  14. plaoded
    December 3rd, 2017

    ademolaao @ yahoo. com

  15. Anonymous
    December 4th, 2017

    Kindly send latest dump to {email not allowed}

  16. Anonymous
    December 4th, 2017

    Kindly send latest dump to ponfenjam4 @ gmail com

  17. Anonymous
    December 10th, 2017

    Please send me the latest dumps for CCNA 120-125 V3 at abhimanyu.singh32 @ gmail.com

  18. Jamil
    December 11th, 2017

    Please send me the latest dumps for CCNA 120-125 V3 at cemil.heyderov@ gmail.com

  19. Anonymous
    December 16th, 2017

    Please send CCNA 120-125 V3 at abbas.azhar @ outlook . com

  20. ANonymous
    February 3rd, 2018

    Hi Can Some1 please send me the latest dumps for CCNA 120-125 at {email not allowed}

  21. ANonymous
    February 3rd, 2018

    Please send me the latest dump at felisbertoluamba12 @ gmail .com

  22. Hggjtdb
    February 4th, 2018


  23. Pranav
    February 4th, 2018

    Hi All,

    Any one here to help me to provide me latest dump please.
    My email mswpranav at gmail com

    Kind Regards,

  24. OLR4C
    February 6th, 2018

    can someone please send a latest dump in my email carlobundalian @ gmail .com Thanks in advance

  25. Cybersky
    February 7th, 2018

    Hi All,

    Any one here to help me to provide me latest dump please.
    My email cybersky1900 @ gmail com

    Kind Regards,

  26. Das
    February 9th, 2018

    Hello Everyone

    Please help me to provide latest dump. this will be highly appreciated.
    My mail id is ( iremind_u @ hotmail com )

    Thanks in adv.


  27. rott
    February 13th, 2018

    Hi can you send me the latest dump, thanks.
    my email rotty at allcloudy dot ninja


  28. HAkem
    February 17th, 2018

    pleas any one have latest dump share me ( {email not allowed} )

  29. pawan
    February 20th, 2018

    plz send me latest Chinese dumps. pawanb861 AT Gmail dot com

  30. njeru
    February 20th, 2018

    hello can anyone with the latest dumps send them to my mail {email not allowed}

  31. njeru
    February 20th, 2018

    ericknjeruh at gmail dot com

  32. Anonymous
    February 20th, 2018

    Hi can anyone send CCNA (R&S) Dumps- on kasink34 @ gmail com

  33. Anonymous
    February 23rd, 2018

    Hi can anyone send CCNA (R&S) Manuel _ ipn .93@ Hotmail com

  34. Anonymous
    February 23rd, 2018

    Hi can anyone send CCNA (R&S) portermaniaco_981@ hotmail com

  35. Elina
    March 4th, 2018


    Can anyone please share the CCNA 200-125 R&S dumps with me. I’m writing my exam soon.

    My email address: elinanyakale @ gmail .com


Comment pages
1 2 3 2820
Add a Comment