Thursday, September 15, 2011

The layers of the Internet - Part 2

The Internet Layer
In the last post I explained the basics of Layer 1 of the Internet Protocol; the Link Layer.

The Link Layer is where all devices are physically connected, either by wireless (e.g. Wireless LAN or 3G) or by a wired (e.g. Ethernet "Blue String" or ADSL) connection.

Whilst this is a great concept, if every device were to receive all of the data transmitted on the Internet, then we would be slowing down the process beyond belief.

Enter Layer 2 - The Internet Layer


This is Layer 2

On a network drawing, a network was always drawn using standardised symbols. Since everything that was on the "Internet" was connected at Layer 1, it no longer mattered how things were connected. You only had to show that there was some kind of connection.
And so the network symbol for the "Internet" became a cloud. It was some ethereal entity, floating out of the reach of Network Administrators across the globe.

Unfortunately marketing departments caught hold of this analogy, and thus Cloud Computing was born. You can see the "Cloud", and it brings you good things (like shade, and rain for your crops) but you have little to no power over it. It's there whether you like it or not. 

So how does it work?

Packet-Switching Networks
In this previous blog post I explained the anatomy of a standard Internet Protocol (IP) Packet. Packets are the currency for IP networks, and indeed the entire Internet. Without repeating myself too much, they contain two main parts; a "Payload" (the data that you want to move around the network) and a "Header" (which contains the addresses relevant to the Data).

In order to understand how the Internet works, we are going to have to introduce our first specific piece of network hardware: the Switch.



The image above is that of a "Switch," and it is a common thing to be found in data centres across the world. However you are reading this blog, somewhere along the line you are connected to a Switch. It might be a little 4-port switch that came with your ADSL plan, or you might be connected to a commercial-grade switch (like the one above) at work.

Switches are the building blocks of the Internet, and they elevate matters from Layer 1 (Link Layer) to Layer 2 (Internet Layer).

Every blue or pink cable in the above image connects to a device; a telephone, a computer, a printer etc. This is the Layer 1 connection. You can tell they are working by the blinking green lights. The Orange cables connect those switches to other switches, which the connect to other switches... until they reach whatever destination they need to get to. These connections are called "Uplink Ports", as they are headed up towards the "Cloud".

When a packet is sent to a switch, it "opens" it up and reads the "Header" (not the "Payload"). In the "Header" is all of the addressing information that the Switch needs to send the packet to where it needs to go. If the destination address is connected directly to the switch, then the packet will be sent directly to that device. If not, then the switch will send the packet to the "Uplink" port, at which point the next Switch will repeat the same process until the packet arrives at its destination.

By doing this, Switches make sure that you only receive the packets that you need to read your emails, browse your websites, control your motors, or route audio. Switches don't care what your packet has in it, so long as the address in the Header is valid.

The address used by the Internet Layer is the Internet Protocol (IP) Address. I will go into (much) more details about IP Addresses in a later post as the topic is as broad as the Internet itself. Suffice to say, a common IP address is an 8-byte address, usually rendered in four groups of numbers from 0 to 255, e.g. 192.168.0.254.

Once two devices are connected at Layer 2 they are considered "Networked" and can now communicate as if they were in the same room. Layers 3 and 4 deal with how they communicate, and we will cover these in the next blog post.


No comments:

Post a Comment