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

160 views

[ad_1]

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
[ad_2]

[removed]

There are cables under the oceans that can communicate using light. The speed of light is able to circle 7.5 times around earth in 1 second and that’s how it is able to communicate in seconds.

An simplified overview would be

Your computer WiFi-> LAN to your Internet provider -> underwater cable to the Internet provider for the website -> LAN to the Website’s building -> Website’s WiFi

Edit: Typos

There are many thousands of wires that go hundreds or even thousands of kilometers around the world these have to connect to something. This is called a switch and works the same way to how different devices in your home work. The switch knows what’s connected to each port and it can ask each decide at the other end of each cable what it knows. These switches communicate directly with each other using MAC addresses and can only be used to communicate directly, whereas an ip can be used to identify anybody on the Internet

When you ask for a website let’s say http://www.google.com that’s fine but who is http://www.google.com how do I find them. You have to ask a domain name server like he one at the ip 1.1.1.1 so your computer sends a message to your network who has http://www.google.com tell me (in this case me will be 192.168.1.2 on your network likely nobody knows so you ask the domain name server the same question and it tells you it’s at 172.217.25.132.

Fantastic we know where we are going but how do we get there well that’s not your problem. You send a message to 172.217.25.132 saying I’d like to connect that’s gets sent to your router and your router says does anyone have 172.217.25.132. but this time we get a different type of response from a5:93:67:fa:6d:91 saying I can get it there so your router remembers this and sends the message there. This process repeats along every node until it reaches 172.217.25.132.

Then 172.217.25.132 sends a message to 192.168.1.2(you) saying yes. Then you say ok I’m connecting. Then you request http://www.google.com and the server sends a message full of text to you.( You can. Look at this text by clicking inspect element.) This text is read by your web browser is displayed on the screen. Around these paragraphs sould be <p> and </p> for paragraph your browser knows these are paragraphs

I’m no professional so this may not be 100% accurate and it brushes over a LOT but it is the general prodcess of how it works

The speed of electricity through cables is close to the speed of light. This is why latency (the delay between your signal and the recipient, and back to you) is within the tens of milliseconds, even when communicating across the globe.

When you’re sending and receiving huge amounts of data (like watching a 4K video on YouTube), this miniscule latency adds up, which is why a bunch of smart folks from MIT came up with Content Delivery Networks (CDNs). Half the internet’s traffic is delivered through CDNs, whether you’re surfing facebook, watching YouTube videos, buying Gamestock stock, or spamming the chat in your favorite Twitch stream. CDNs help people avoid *needing* to send and receive data across the globe. Instead, they are huge servers that are constantly synced up with copies of the internet, and located around the world. For instance, if you’re someone from Boston, MA trying to load your Parisian friend’s vacation pictures from Instagram, chances are they’ve been copied (cached) to a CDN server located either directly in Boston, or in NYC. This is done constantly, and your friend’s pictures can be cached within a few hours or a few days of her posting them.

CDNs are also located near internet backbones, which are hubs that data travel through before moving off content, or between major cities. This allows them to download, copy, and upload data super fast.

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.

Yes, there is a network of wires that connect all the computers and smart devices on the internet around the world. (The last few meters can be wireless in many cases.)

Signals from you to some computer on the other side of the world can travel there and back in a small fraction of a second, since the signal travels at a sizeable fraction of the speed of light.

Thanks to the whole cloud thing however, you rarely end up talking to a computer that far away when communicating with a popular website. There most likely is a copy of the website hosted on a server much closer to you.

(For example I can get a reply back from the website of the Sidney Morning Herald in only 12 milliseconds which would only get me a quarter of the way to Australia from where I live if I traveled at the speed of light. This works because there is a copy of that website hosted closer to me than Australia.)

The actual process of getting the contents of the website to your computer involves quite a bit of back and forth between your computer an theirs.

There is also a bit of work involved in your computer finding out which computer they need to talk to and how all the computers between you and them decide which direction to pass messages on.