Interdomain Routing: Border Gateway Protocol

Introduction

Just the way packets need to move around within a domain or autonomous system, packets need to move across them too. To enable all domains to communicate with each other, they need to be talking in the same language, in other words, they need to be using the same protocol. Hence, there exists just one interdomain routing protocol and it’s called the Border Gateway Protocol (BGP). We’ll spend a bit of time on this one as it is essentially the glue that holds the Internet together!

The Role of BGP

BGP routers have two key responsibilities:

  1. To make each domain announce its presence to other domains. If it weren’t for this, no domain would know about the existence of other domains, and each domain would be an isolated island. This is done by each domain obtaining prefix reachability information from neighboring domains.
  2. To determine the best route to each prefix.

Let’s study how each objective is achieved.

Advertising BGP Route Information

Internal Routers & Gateway Routers

  • An internal router is only connected to routers within the domain it resides in.
  • A gateway router is connected directly to one or many routers in one or many domains.
  • For a domain to advertise its existence with BGP, gateway routers establish a TCP connection on port 179.

  • In BGP, each domain is identified by a unique Autonomous System (AS) number.

  • The BGP routers exchange routing information with each other over this TCP connection. The connection and the information exchange is known as a BGP session.

  • A BGP session across two domains is called an eBGP session.

  • A BGP session within a domain is called an iBGP session.

Press + to interact
external & internal border gateway protocol sessions
external & internal border gateway protocol sessions

Propagating Information

In order to propagate BGP information, both iBGP and eBGP links are used. In the example above, consider router R12R12 advertising a prefix P12P12 to AS1AS1 and AS2AS2.

  • The gateway router R9R9 will first send an eBGP message like "AS3AS3 P12P12" to the gateway router R7R7. This message is in the form “via AS.” So it is essentially saying "P12P12 is reachable via AS3AS3."

  • The gateway router R7R7 then will send the iBGP message "AS3 P12P12" to all of the other routers in AS2. This includes the gateway router R5R5.

  • The gateway router R5R5 then sends the eBGP message “AS2 AS3 P12P12" to the gateway router R3R3. This message says "P12P12 is reachable via AS2 then through AS3”.

  • Finally, the gateway router R3R3 uses an iBGP session to send the message "AS2 AS3 P12P12" to all the routers in AS1.

  • Each router in the network now knows about the presence of P12P12 and how to reach it.

Lastly, only a few routers in a network might speak BGP. Others can be dedicated to intra-domain routing. Routes learned through the intradomain routing protocol such as OSPF are injected into the BGP process on a BGP speaking router, which passes it on. Also unlike OSPF border routers, BGP neighbors don’t need to be physically connected directly.

Quick Quiz!

1

What would be the AS path to the prefix P10 in AS1?

A)

AS1 AS2 AS3 R10 P10

B)

AS2 AS3 R10 P10

C)

AS2 AS3 P10

Question 1 of 20 attempted

In real life, however, many different paths exist from each router to all other routers. How do we pick the best one? We’ll look at how BGP does that in the next lesson!

Get hands-on with 1400+ tech skills courses.