Interdomain Routing: Border Gateway Protocol
In this lesson, we'll study the 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:
- 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.
- 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.
Propagating Information
In order to propagate BGP information, both iBGP and eBGP links are used. In the example above, consider router advertising a prefix to and .
-
The gateway router will first send an eBGP message like " " to the gateway router . This message is in the form “via AS.” So it is essentially saying " is reachable via ."
-
The gateway router then will send the iBGP message "AS3 " to all of the other routers in AS2. This includes the gateway router .
-
The gateway router then sends the eBGP message “AS2 AS3 " to the gateway router . This message says " is reachable via AS2 then through AS3”.
-
Finally, the gateway router uses an iBGP session to send the message "AS2 AS3 " to all the routers in AS1.
-
Each router in the network now knows about the presence of 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!
What would be the AS path to the prefix P10 in AS1?
AS1 AS2 AS3 R10 P10
AS2 AS3 R10 P10
AS2 AS3 P10
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.