September 21st, 2011, 12:29 AM
How does a web request physically work?
Although I've been a computer geek for a while, it just occurred to me that I don't actually know how the internet physically works. What I mean is this:
Let's say I'm in Indiana (which I am), and I browse to a website hosted in Thailand. How does the request initiated from my computer physically get to the server on which the Thai website is hosted?
I understand how it works logically: my ISP looks up the DNS of the website and pings the corresponding IP address for content. But how does it physically reach it, is what I want to understand.
I imagine it might work like this. In the highly likely scenario that I'm wrong, I would appreciate your correction.
First, I imagine the world of computers is all physically interconnected by cables and cable providers. I imagine my computer starts to send a signal through the cables of my neighborhood, which continues through the cables of the city, which flies through the cables of the state, which travels through the cables of the rest of the country, which then travels through the submarine cables across the Pacific Ocean, until it gets to the cable in Thailand, which carries my original signal to the web server and says "this guy in Indiana requests your content."
September 21st, 2011, 01:29 AM
Physically the data gets there as electromagnetic radiation propagated along some medium. The medium is generally something like copper wire, fiber or air. For a long distance connection it'll probably be transferred through several different mediums owned by many different companies. So basically as you suggested, everything is physically connected more or less.
The mediums transfer the signal by varying the radiation properties. For example, on a copper wire a voltage of +5 volts might indicate a "0" value, and a value of 0 volts might indicate a "1" value. Both ends of the connection are synchronized in some way so that the property can be varied very quickly over time. For example, perhaps the sender and receiver agree that every 8ns the sender should sample the wire to get the next value. This allows the data to be transferred in its binary form.
The internet is a packet based network (unlike a traditional telephone network). This means that your request for content is broken down into different chunks of data, each of which is sent independently to its destination. So you don't really "open a line" to the destination, your packets just jump into a stream along with many other packets that are going to many different destinations. Along the way there are many switching spots where packets come in on one wire and go out on one of many different possible wires, depending on their final destination. In that way packets get from one location to another. Of course, since each packet is independent, they may take different paths when going from the source to the destination and they may even arrive out of order. The switching stations may also choose to further fragment your packets into even smaller packets.
Each packet has either a fixed length or a length specifier, so that the receiver is able to determine what bits belong to what packet. Each packet also has an address, so that the switching stations know where the packet's final destination is and who sent it.
There are many different protocols for the actual routing and handling of packets. There are also many different layers to the internet and networking in general. The standard model has 7 different layers.
The Wikipedia articles on this particular subject are actually quite good.
Comments on this post
Last edited by E-Oreo; September 21st, 2011 at 01:31 AM.