What is the entire process of my connection to a website with a server halfway around the globe?

551 views

I know that we use radio waves to connect to the modem, but then do the wires run ALL THE WAY across the country, through the ocean, and to the country halfway around the world? And if so, how does that happen in 1-2 seconds?

In: Engineering

6 Answers

Anonymous 0 Comments

The internet, and all technology really, operates on layers of abstraction.

What this means is that when you do a complex thing, that complex thing is generally expressed at a high level in a simple way, and each component of that expression is itself explained at a slightly lower level in as simple a way as possible, and so on, down the hierarchy, until you get to the point of individual transistors and cables.

This sounds a bit abstract, which is sort of the point – when you operate in a higher level, you don’t really need to know about the lower levels *except* in abstract. Otherwise, it would be far too complicated to get any work done. When you write a recipe for cake, you don’t need to explain metallurgy for creating measuring cups, or how to grow wheat, for example, since you can assume those things are handled at a lower level of abstraction.

When you go to a website, a series of things happen, but where those things occur on their hierarchy vary; [there is the OSI model of networking](https://s7280.pcdn.co/wp-content/uploads/2018/06/osi-model-7-layers-1024×734.jpg) which has its hierarchy, but the actual way your keyboard, mouse, monitor, modem, etc, function are all their own hierarchies.

The very short answer is, you resolve the IP address of the server, connect to it, and request the resource. This sequence of requests is encapsulated into packets of information, basically like pieces of mail with a ‘from’ and ‘to’ field. The ‘from’ and ‘to’ fields correspond to your IP address and the server’s IP address, respectively, sort of like a street address.

These packets are further encapsulated into, for example, ethernet frames, which handle the case where your PC is plugged into the internet with an ethernet cable. These ethernet frames also have a ‘from’ and ‘to’ address, which is a MAC address, which basically represents your physical ethernet jack/network card.

The important thing to note is that your web browser doesn’t really need to know anything about ethernet – because it operates at a higher level of abstraction.

Wifi is similar too – different forms of encapsulation and different abstraction, but the browser doesn’t really care because it operates at a higher level.

Once the packets reach your router, they are de-encapsulated from their ethernet frame, or wifi, as the case may be. They then need to get onto the internet ‘proper’. This can occur via further encapsulation via the DOCSIS protocol over coaxial copper cable, if you have Comcast, though there are separate schemes for DSL, satellite, fiber, etc.

Eventually your packets reach your ISP, who then use a protocol called BGP to know where to send that packet. BGP is kind of like the “IP address of IP addresses”, in that the IP address of a given website is ‘advertised’ within a block of IP addresses according to an AS number. So if the website (like [google.com](https://google.com)) has an IP of [37.24.9.82](https://37.24.9.82), perhaps the whole range from [37.24.9.0](https://37.24.9.0)-37.24.9.254 is advertised through one AS number (basically identifying a router who has knowledge of where those IPs live).

Physically, getting from your local ISP’s AS (which knows where *you* are) to that AS (which knows where *they* are) will nearly always involve encapsulation within a fiber-based communication protocol. It’s a common misconception that the internet uses satellite for long-distance communication; in reality, satellite is only ever really used for “last mile” delivery of internet to individual subscribers, not the sort of ‘backbone’ connectivity between regions. Instead [we have many fiber cables ran on the ocean floor](https://www.submarinecablemap.com/) to connect countries and regions within countries.

So, tl;dr, in your case, your browser speaks IP packets, which your PC encapsulates for ethernet or wifi delivery, your router then de-encapsulates to get the original IP packets, uses a separate encapsulation to deliver those to your ISP, and your ISP repeats this process to get your packets to another ISP and eventually the particular business which hosts the server for the website you’re trying to access.

You may think about it in terms of how the postal system *could* work. Imagine you want to send a piece of mail to Google. You write your letter. Now what? Put it in an envelope, put on your return address, and use a phone book (DNS) to figure out what google’s street (IP) address is, and put put that as the ‘to’ address.

**This is sort of like an IP packet. This is what you ‘first’ send out, and ultimately what google’s server will receive in the end – but in between, it will be put in different containers/encapsulations depending on how it needs to be send next.**

Now let’s say you put it in your mailbox, which you might think like a router. The mail truck comes by and picks up your envelope. Here the mail truck is something like the secondary encapsulation used by your cable/comcast modem. Note that, writing your letter or putting it in an envelope, you don’t care about how a truck works or what road laws are. That’s another layer of abstraction; it’s not your problem to worry about.

The truck brings the letter to your local post office, like your ISP, who then remove the envelope from the truck and decide where to send it to. They find out what post office is nearest to Google’s street address – which post office handle’s Google’s mail, their AS number in BGP terminology – and then use some other method of encapsulation (an airplane, a train, a boat, etc) to send it to that post office. *This is almost always fiber cable on the internet.* Maybe it has to pass through several other post offices on the way there, but each one does basically the same thing – receive mail, figure out where to send it next and how to send it. Eventually a truck drives to google, drops off the mail, and then it is opened and the letter is read.

You are viewing 1 out of 6 answers, click here to view all answers.