Skip to main content

The Internet ~ Concise and Simple

(As with all "concise and simple" articles I assume no prior knowledge of the subject and keep the length to less than 1500 words.)

Have you ever wondered what makes it possible to serve web pages like this one, deliver an email or join a video conference, all seemingly in an instant? The answer is the Internet, a decentralised global network of computers. This article explains what's involved.

Devices on the Internet communicate using different yet related protocols. A protocol is a set of rules and conventions that explain how to communicate information. For example, although nothing to do with the Internet, Morse code is a sort of communication protocol.

Strata - Coyote Buttes, Arizona

For the Internet to work, protocols are layered: each layer provides specific functionality needed to make the complete strata of layers work as a whole. Layers depend upon each other with lower levels providing services for the layers above.

At the very lowest layer are protocols concerning how information is physically sent from one device to another. At the very highest layer are protocols for information sharing systems such as the World Wide Web (WWW or just the "Web"), Email, Internet Relay Chat (IRC) and Voice Over IP to name but a few.

These layers have been formalised by the ISO (International Standards Organisation) as the Open Systems Interconnection model. It has seven layers:

  1. The physical layer describes the physical characteristics of communication. For example, protocols at this level specify voltages, layout of plugs and sockets, radio frequencies and so on depending on the physical medium of communication. A helpful transport based analogy is that it's like describing roads as being made of asphalt, traffic lights as having three colours and certain markings being painted where roads intersect.
  2. The data link layer concerns the transfer of information between neighbouring nodes in a network. Some protocols at this level detect and possibly correct errors that may occur in the physical layer. To continue the transport analogy, this layer is the traffic officer controlling and directing the flow of traffic between adjacent neighbourhoods or the practice of stopping at red traffic lights and understanding who has right of way at a roundabout.
  3. The network layer contains protocols that describe how information should be routed across a network including descriptions of how messages should be forwarded to their intended recipient. Its function is similar to that of a navigator reading a map and listening to traffic reports in order to find the route for a long car journey.
  4. The transport layer gives the impression of linking places on the network for a (usually reliable) exchange of information. This may include error detection and correction, flow control (how much information is sent at a time) and segmentation (how messages are split up in to their constituent parts and re-assembled at the receiving end). This is like being able to send letters: your post box and the recipient's letter box are connected together through the workings of the Post Office (the transport layer).
  5. The session layer defines how communication is opened, closed and managed between devices communicating over the network. For example, if an open line of communication between two devices is interrupted then the protocols in this layer will attempt to reconnect. The concept of "letter" would be defined in this layer along with conventions such as starting letters with "Dear So-and-so".
  6. The presentation layer translates raw data in to something that can be sent over the network. This may include serialising complex data structures into strings of characters or describing the characteristics of the message, such as its total size. It is often at this level that encryption takes place in order to secure communications. This layer is analogous to writing a letter on a piece of paper and putting it in an envelope with an address and stamp on the front.
  7. The application layer involves creating and consuming messages needed for applications that work via the Internet. This includes generating and checking data fields or ensuring the correct structure of the message. This is, perhaps, similar to filling in a tax return with the required information before posting it back to the revenue collector (where the "application" is collection of taxes).

Layers are not the end of the story. Messages are split in to chunks of data, sent over the network and then reassembled at the recipient. Each protocol has a different name for such chunks of data: for example, at the data link layer they are called "frames", at the network layer "packets" and at the transport layer they are called "segments" or "datagrams". Chunks of data from higher level protocols are wrapped within those of the lower levels.

Data chunks contain two types of information: control information and the payload (containing data from the higher level protocols). Control information is used by the protocol to fulfil its function while the payload is handed over to the next protocol up in the layers described above.

Furthermore, each connected device needs to have a unique address so it can be found on the network. These are unique numbers called IP addresses implemented in the network layer, most commonly by the Internet Protocol (IP) - hence the name.

Blocks of numbers are assigned to different "entities" (governments, educational institutions, organisations and companies) by the Internet Assigned Numbers Authority (IANA). Such entities further assign sub-blocks until we arrive at a single IP address assigned to an individual device on the network.

IP addresses generally come in two types reflecting the version of IP that they correspond to: IPv4 and IPv6. The maximum number of IPv4 addresses is 4,294,967,296. While this may sound like a lot of potential addresses I'm afraid we've already run out. As a result IPv6 caters for a huge number of addresses: 340,282,366,920,938,463,463,374,607,431,768,211,456 (that's 2128). The Internet is currently transitioning from IPv4 to IPv6.

Because humans are no good at remembering long numbers we refer to devices connected to the Internet with human-friendly domain names such as bbc.co.uk. Whenever we make a request to a domain we must use the Domain Name System (DNS) to map the domain name to the IP address of the correct device on the Internet (so, looking up the bbc.co.uk domain gives an IP address of a device owned by the BBC). DNS is a distributed lookup service that is organised and run by domain name registrars (with whom you register your ownership of a domain) and policed, via laws and legal interventions, by governments and business interests (such as the RIAA and BPI).

However, any single device may be running several different networked applications at the same time (for example, an email client, a web server or a chat service). Numbered ports on a connected device function in a similar way to numbered mail boxes in a block of flats: applications know to "listen" on specific port numbers for only their messages. Standards dictate how certain port numbers map to particular application protocols. For example, unencrypted requests on the web get sent to port 80.

It is because of the existence of ports that there are many more devices connected to the Internet than there are IPv4 addresses. The Internet is, in fact, a collection of many local networks. Within each local network devices are assigned unique IP addresses but the device that is connected to the wider Internet (called a router) only has a single external IP address. How can the router's single IP address be shared by all the devices on the local network?

The answer is Network Address Translation (NAT) - the router maps an external and unused port to an internal (local) device. For example, all requests to the router on port something-or-other could be simply forwarded to the device on the local network identified by a locally unique (internal) IP address.

Finally, network traffic is policed by firewalls using techniques such as IP address blocking. A firewall is like a border control checkpoint: every chunk of data is examined and either discarded or allowed to pass depending on a set of rules. IP address blocking is a specific example of a firewall rule: blacklist any traffic to or from a specific block of IP addresses (such as those from outside China).

Some firewalls are sophisticated enough to do deep packet inspection where the content of network traffic is examined for the purposes of security, data mining, eavesdropping or censorship. Chunks that are deemed bad are not allowed through. Encrypting messages at the higher levels of the Internet stack go some way to circumventing such measures although traffic analysis (an examination of network behaviour) can be used to infer the intent of a message.

Unfortunately, the details of specific protocols can't be explored in such a short introductory essay. However, if you're interested in finding out more you should investigate the Internet Engineering Task Force's (IETF) database of Requests for Comment (RFC) used to define the various protocols.

And remember, most of the above appears to happen instantaneously to connect computers that could be on opposite sides of the planet - something that fills me with amazement.

1499 words. Image credit: © 2007 rickz under a Creative Commons license.