Have you ever tried to open a website and got an error message that says the site is unavailable? Chances are, the site is just down for maintenance. But what if it's not? What if the site is actually up, but your computer can't find it because it's hidden behind a firewall or a router? In order to understand how websites work, we need to start with some basics about networking. In this blog post, we will discuss the Border Gateway Protocol and how it helps routers communicate with each other.
Why Is This Important?
While many people believe that the internet is this centralized thing, the internet is made up of hundreds of thousands of separate networks identified by an autonomous system number, or ASN. For example, the coffee shop down the street might have an ASN of 123 (in reality AS123 belongs to the US Air Force). If you are on their Wi-fi and wanted to watch a YouTube video, your computer would most likely need to connect to Google's servers which are part of AS15169. For your computer to do so, it needs to know how to get there. That's where BGP comes in. BGP is a protocol that allows networks to share routes with each other. By sharing routes, networks can tell each other where they can find specific addresses.
How Does BGP Work?
BGP uses a process called peering in order to function. Peering is when two networks connect with each other and exchange information about their routes. In order for peering to happen, both networks need to have BGP configured on their routers. BGP uses something called an Autonomous System Number, or ASN, to identify different networks. ASNs are assigned by regional internet registries or RIRs.
Once BGP is configured on both routers and they have exchanged ASNs, the router will send periodic updates to its neighbor about any changes in the routes it knows about. If there are no changes, then no updates are sent. BGP uses a process called routing policies to decide which route is the best one to take. Routing policies can be based on many factors such as cost, latency, or reliability.
BGP Is Not Perfect
Unfortunately, BGP is not perfect and it has been known to cause some major problems. In 2008, a typo in an update caused YouTube to be inaccessible for two hours. In 2015, another BGP issue caused large portions of the internet to be unavailable in China. While BGP is an essential part of how the internet works, it is clear that there is room for improvement.
What do you think about BGP? Do you think it's a good system or do you think it needs to be improved? Let us know in the comments!