Life of a Packet – A Journey trough the vast net
Posted in Science on July 6th, 2010 by moodyInternet. How information gets from one place to another? You fire up your browser and stuff appears pretty much right away. Lot of us take that for granted. Well, it’s not that simple really. It’s actually quite complex. So since the Internet, network engineering and security are part of my daily job, I decided to write up little story describing the whole process as simply as I could for a different perspective that you actually see in books . After I’ve finished this article, I’ve come to realize; Internet is even more fascinating than I originally though. Hopefully you’ll get something useful out of it, or at least kill some time.
Let’s say there’s guy named Michael who lives somewhere in Germany and who is an avid internet user. Michael gets up before the work, makes his coffee and sits on his computer to check the latest news. Michael wants to go to yahoo.com. He fires up his browser (IE, Firefox, Safari etc…) and lets say Google home page pops up. But since Micheal wants to go to yahoo.com, he types www.yahoo.com in his address bar and then he hits enter. What happens next? You might say: “well yahoo’s main page shows up.” True, but it’s not that simple really. Think about this; servers (computers with lots of storage and power) where yahoo pages physically reside, are located in Sunnyvale, CA and Michael is all the way in Germany. So Michael’s request will have to go from Germany all the way to USA. Once Michael’s request reaches Yahoo’s servers in California, Yahoo will have to send their front page to Michael. That main page will have to cross the western Europe, Atlantic and whole USA to reach it’s destination.
Here’s the whole journey step by step form Michael’s keyboard to yahoo’s home page and back.
- Michael types www.yahoo.com letters into his browser .
- Keyboard sends characters (letters) in forms of electrical signals via wire trough USB (or PS/2) port to a keyboard controller, which resides on Michael’s motherboard in his desktop unit on the floor.
- From the keyboard controller letters go to Operating System (OS) which could be Windows, OS X, Linux etc..Lets say Michael uis using Windows 7. Windows 7 takes those letters and passes it to application which in our case is Michael’s browser.
- Michael’s browser sees this request and says to the Windows 7: “oh you want to go to www.yahoo.com. Ok here’s what Instructions I need from you to display this page. Browser then sends these instructions back to the Windows 7“
- Windows 7 sees the request and goes: I recognize this type of request. I need to send this down to my hardware and out. But before I do that let me pack it up for the long trip”. We will refer to this packaged request from now on simply as packet.” Windows 7 sends this packet down to its hardware or a Network Card. Network card is the place where you plug in your telephone or Ethernet jack, usually found in the back of your PC. That’s the final exit from Michael’s PC.
- Network card sees the packet coming and says: “This packet is too big and I have no ability to send this as a whole, so let me chop it up to pieces first. Also, I really have no idea where this is supposed to go. All I know is that I need to label it and send it out to the next device. So network card splits our packet into smaller packets, adds destination address (yahoo) to each individual packet and sends the whole thing in streams to the closest device. Which is Michaels’ cable modem. Packets don’t leave network card at the same time. They go one by one. For the time being we’re going to follow only one packet.
- Cable modem that is connected to Michael’s PC receives our packet, looks at destination address and says: “I really don’t care what’s in this packet and I cannot read it anyway, but maybe my owner knows so let me send it to him. That’s Michael’s local ISP (Internet Service provider). So cable modem sends out little packet on their way to Michael’s local ISP.
- Our packet goes out of the modem trough coaxial cable, trough the walls, out of the Michael’s house, underneath his lawn, up to the telephone pole on his street, trough his neighborhood. Then our packet roams trough his city streets bouncing from pole to pole, going underground, above ground, until it finally reaches his local ISP’s headend. Headend si the place with antennas and where his ISP keeps all gear.
- At local ISP’s headend, a router receives and inspects the packet and thinks to itself: Judging by destination address I know that yahoo.com is not here in the city so let me send this packet to my neighbor (another router connected to it) maybe it knows. So, router unpacks original packet and then repacks the packet in its own little suitcase and sends it on its way.Router does this for each packet it receives. It’s important to spend little more time on describing what routers are. Routers are quite fascinating little (or big) fellas. Routers are hardware based devices that ISP’s use to direct (route) traffic in and out of their networks. They act as a traffic cops. They get millions and billions of packets like these every minute, so they’re work extremely hard and they’re always busy. No breaks. They also have their own language that we call protocols, which they use to communicate with each other. Once setup, they get mind on their own. They use complex algorithms to decide where and how to route traffic, they do their own maintenance, they communicate with neighboring routers all the time, they notice when path gets invalid so they automatically choose next best path to destination. They can also recover from failures on their own. Routers are pretty much backbone of the whole Internet. They’re spread out all over the world. Every company and ISP has them.
- Neighboring router will do the same. It will inspect our packet and send it to its closest neighboring router until our packet reaches the edge of Michael’s Local ISP’s network. Edge is where his local ISP ends, and larger ISP begins. Just like Michael’s smaller ISP provides internet connection to him, larger ISP provides Internet connection to smaller ISP and so on.This larger ISP could be medium sized ISP like Roadrunner or huge like Comcast or AT&T in US, or T-Online in Europe. Moving on.
- Large ISP receives Michael’s packet and inspects it. It thinks: Ohh destination is not in Germany, it needs to go to USA, so let me send it to one of USA large ISP’s. Large ISP’s have reciprocal agreements between themselves. Meaning: I will forward your traffic if you forward mine. European Large ISP will choose shortest and quickest path to one of the USA large ISP’s. Lets say that it picked AT&T. What happens next is quite a journey for our packet.
- In order for our little packet to go from Europe’s largest ISP to USA’s largest ISP it will first need to bounce from router to router, from ISP to ISP, from country to country. Juts like you would if you were to go on foot. It will go across France’s ISP’s and their routers. It will bounce across France’s countryside, from smallest to largest ISP’s just like it did in Germany. It will go trough English Channel all the way to Great Britain. It will never rest or take any breaks. If it runs into a broken path or no path at all, it will go around it and try another path.
- Our packet will reach British ISP’s and will bounce around trough their picturesque country side, busy streets of London and other English cities. Always looking for shortest and quickest way out. If one path is blocked, packet will be routed to an alternate path by routers. In the end, Brits will send our little friend across the Atlantic via trans Atlantic cables.
- It will travel via Cross Atlantic cables laid down approximately 60 years ago. Cables have been upgraded to a higher speed many times, and are getting upgrades all the time to keep up with demand.
- Journey trough the underwater cables will be undisturbed and lot less chaotic than when packet traveled trough the cities. After Atlantic journey our little packet will finally arrive at AT&T somewhere on the coast of US. AT&T’s big routers will inspect the packet and its destination and will say: I don’t know exactly where yahoo.com is located but looking at the destination address I do know that it needs to go to Sunnyvale, CA. So let me send it to Comcast because I sent all my previous packets destined to yahoo via Comcast. Comcast apparently knows where this yahoo is, so I’ll do same with this packet too. Packet will then get forwarded trough AT&T’s huge network bouncing from router to router, from city to city, until it reaches Comcast.
- Comcast routers will receive the packet and say: I am actually not Yahoo’s ISP but I do know who is. It is ISP called Level 3. So let me send it to Level 3 so they can send it directly to yahoo.
- Level 3 will receive packet and say: Ohh I know exactly where this needs to go. It needs to go to one of our customers; yahoo. Yahoo is located at so and so street address, so let me send it to them directly.
- Yahoo’s modem (or some other terminating device) will receive our packet and will think: Someone is requesting our front page. This needs to go to one of our servers that it’s connected directly to me. So modem will forward the packet to the server where yahoo web pages reside.
- Yahoo’s server (which is essentially PC with lots of storage space and some fast processors) will receive the packet but will not do anything with it until receives all other packets. It will wait. Remember point 5 above: network card in Michael’s PC chopped original packet into lots of smaller packets before sending them out. Not all packets took the same trip. Some went trough different lines, different ISP, even different countries possibly, but all packets have to arrive in order for yahoo’s server to know what the message is. Once all packets arrive at Yahoo’s server, only then, network card will assemble it into one entity that will be understandable and readable. From there it will see that yahoo’s front page (www.yahoo.com) is requested so it will dig into their database and find yahoo’s front page and will package the page into similar packets like ours and send it back to Level 3.
- Packets will have to make the similar trip back. All the way from Sunnyvale, Ca trough out the USA, across Atlantic, over the hills and valleys, back to Germany and finally back to Michael. It might not take the same path back, but it will be very similar.
- Once the packet reaches Micheal’s modem, network card will wait again for all packets to arrive, assemble it into one entity and it will travel up to Windows 7 and into his browser and yahoo’s front page will be displayed to Michael so he can finally read his news and finish his morning coffee. Think about how many entities and devices were needed for all this. All of those ISP’s, routers, lines, under-ocean cables, different countries were engaged just because Micheal decided to click on Yahoo’s front page. Lets think about that little more.
Now you see that this process is very similar to process of how Post Office delivers their mail. Instead of physical address with street, city, ZIP, country, computers and routers use IP addresses and MAC addresses to communicate. But principal is the same.
Here’s interesting part: The whole journey above is for when Michael wanted to view yahoo’s front page only. So what would happen if Michael start clicking trough other yahoo’s pages? The whole thing repeats for every link, every page he clicks on yahoo. If he would to click on yahoo autos, packet has to make the same trip. If Michael would to click on yahoo shopping, packet would have to make the same trip in both direction, and the whole journey repeats on and on almost without a glitch. Things get even more complex when Michael tries to download or upload an image, movie or piece of music. I don’t even want to go into HD streaming and describe what happens there. Too mind boggling. Think about that for little bit.
And that is not even the most fascinating part. The really spooky part is that process I described above is extremely simplified of course, and usually fills up volumes and volumes to describe and understand properly. There’s a 1500 page book that basically describes the whole process above. Think about that: It takes 1500 pages to fully describe the whole journey. Now, here’s fascinating part: the whole process of our packet going back and forth (both direction) takes less than one second. Everything I said above, everything that is written in that huge book happens in milliseconds. Michael doesn’t even think about what needs to happen in order for him to get to the yahoo’s page. For him it’s almost instant. Reason that is almost instant is that our little packet travels really fast. How fast? Close to the speed of light fast. That fast! To put that in perspective, our packet can circle the whole earth, 8 times, in one second.
Our example was dealing with Yahoo which is a big company with army of servers and employees. But each of us can host web pages on our own computers or servers so others can find it. That’s what the Internet really is. Bunch of computers and servers connected together in a huge network sharing information. Information gets from one place to another via routers. They’re ultimate traffic cops. There’s no Internet owner. It just is.
