An Introduction to Computer Networking
Created | Updated Sep 7, 2004
Note: This entry is (as is probably obvious) work in progress, and far from complete - if you have any comments or suggestions on sections that look complete (or half complete!), please don't hesitate to add comments!
Last update: 12 Aug 2003
Computers have evolved in many ways over the decades, but perhaps one of the most important innovations was to connect them together. Linking computers into networks has multiplied the ways in which they can be used, and has had a significant impact on many aspects of society. Computers now assist in rapid communication and make distributing information to a large audience far easier than ever before. Networking can also be used to allow computers to co-operate on certain difficult tasks, solving them in a fraction of the time it would take a single machine.
This article aims to describe some of the most popular mechanisms which allow computers to communicate with each other, firstly in a general fashion and then exploring more specific details. It is intended for a computer-literate audience without any particular knowledge of networking, though general readers may find some sections interesting. In general the computer-literacy required increases as the sections progress, and more technical readers may wish to skim or skip the first section.
A Note on Terminology
Please note that the term computer is almost exclusively used in this article when referring to devices that can be connected to a network. It is becoming more common to network different devices, however, such as printers or cameras. The term computer is used only for clarity, as it represents the most common example, and is not intended to exclude other devices.
Also the term data is typically used here to refer to general information that is to be sent between computers. Where the type of information (e.g. an e-mail) makes a difference to the discussion, the term data is not used. It is also important to note that where computers are concerned, data can always be considered to be a list of numbers, since computers deal only with numbers at a fundamental level.
Introduction To Networking
This section explains the basic principles that are common to most forms of networking in use today.
Hardware vs. Software
Ultimately networking, the process of linking computers into a network, relies on physical connections between the computers which need to communicate. The physical connection is only part of the system, however, and much care is put into deciding how the data itself should be sent over the connections, whether they be wires, satellite broadcasts or some other form of transmission.
The two aspects to the solution are known as hardware and software - these terms are common to discussion of computers in general, not just networking. In short, hardware is any part of the computer you can physically touch - monitors, disks, circuit boards, cables and the like. Software is the term used for the programs that run on the computer in any form. Taking a book of poetry as a rough analogy, the covers, pages and ink would be the hardware, and the poems themselves would be the software - you can't actually touch a poem (though perhaps it can touch you).
Networking relies on both aspects of the solution. Without the hardware, there would be nothing to send the data over. Without the software, there would be no data to send. A modern example of hardware and software working together is receiving an e-mail over the Internet. The software on the computer sending the e-mail works out where the e-mail needs to go first and passes it to the hardware, roughly equivalent to a human putting a letter in a postbox. The hardware then sends it, perhaps down a telephone line, to another computer. The hardware on that computer receives the e-mail, and passes it to the software to deal with. The software looks at the destination, and then sends it back down to the hardware to pass on somewhere else (similar to the task performed by a postal sorting office). Eventually the e-mail will arrive at its intended destination, and the software on the machine presents it to the user. The key point to note is that software usually handles the complicated tasks of directing data to where it needs to go, and the hardware handles the job of actually getting it there.
Local and Wide Area Networks
The different types of physical connection that link computers each have their own limitations. Sending data very rapidly down electrical cables, for example, is very difficult over great distances. Because of these limitations computers are usually clustered into small groups which are all connected to each other. These groups are usually relatively close to each other (e.g. in the same office building) to satisfy the restrictions of the physical connection used to link them. One of these groups is often known as a local area network or LAN for short.
Limiting the number of computers in a LAN makes it much easier and cheaper to link them together, and also has other benefits:
Maintainance: smaller networks make it easier to track down the inevitable problems which occur.
Performance: fewer computers on a network means less data is being passed around - since the rate at which data can be passed is limited, this means the computers can communicate faster.
Security: it's easier to restrict access to information when you can contol which computers can physically connect to your network.
It is often desirable, however, to link many computers that are a large distance apart, often into larger groups than those that make up a LAN. A group of computers connected in this way is perhaps predictably known as a wide area network or WAN. A WAN will typically use different technologies to a LAN, as the need for a cheap and fast system is replaced by the need to transmit data reliably over long distances. A WAN might run over telephone lines, satellite links or long-distance fibre-optic cables. The Internet is an example of a WAN - the largest on the planet, in fact.
So, a typical network structure (often known as the network topology) for a company might consist of one or more LANs at each of its offices around the world, all connected into a single WAN so they can send information to each other quickly.
Networking Challanges
Despite the variety of different systems that have been developed to transfer data between devices, there are several fundamental problems that they must all overcome. Some of these are briefly discussed below as a prelude to explaining how different systems solve them in later sections.
Perhaps the most fundamental task to perform is alerting another computer that you wish to start communicating with it. Depending on the physical connection involved, this can present several challanges. A common example is found where many machines share only a single physical connection, known as a shared media network. This occurs, for example, if they are all linked by a single electrical cable. In a shared media network, all machines can listen for data from other machines all the time, but only a single machine can send data at a time. Furthermore, it is impossible to know which machine is sending you the data. This means the system used must somehow ensure that only a single machine sends data at a time, and also the data transmitted must identify the machine from which it is being sent.
Other types of physical connection may not share these problems, but may introduce challanges of their own. An alternative system is a switched network, where data is directed through the network by pieces of equipment called switches (not the sort you use to turn on a light!). Computers communicate over a switched network in a similar way to people communicating by telephone - the end user sends information and leaves it to special equipment to make sure it is sent to the correct destination. A shared media network, on the other hand, is closer to lots of people in a room shouting at each other, where each person is expected to identify themselves and make sure they don't shout at the same time as someone else.
Another problem common to all types of networking is error detection. All forms of physical connection will sometimes fail for brief periods, and data that is sent may be corrupted. Even though this may not happen often, it could potentially cause large problems if important data is being sent. The typical solution to this is to send extra information about the data so the recipient can decide if the data was corrupted. An analogy to this is someone who has taken notes in a lecture reading through them later and realising that some of the words must have been copied down incorrectly since they don't make sense compared to the rest of the sentence they are in. Once the recipient has realised the data is corrupted they can discard it and either ask for another copy, or simply report an error to the user.
Some systems choose to ignore this problem entirely - this is typically in cases where transmitting data quickly is far more important than it being reliable (since transmitting the extra information to check for errors takes more time). A good example is sending video across the network - if an error occurs, it will only show up as a brief corruption of the screen, which is a minor annoyance. Failing to send data fast enough, however, could lead to the video stuttering or playing more slowly, which is considerably more irritating.
A third problem, which was touched upon in the first section, is scalability. Technologies designed for a LAN can perform very badly when scaled up to very large numbers of computers, but typically will be much cheaper than large-scale solutions. This is main driving force motivating the separation of networks into LANs connected by a WAN.
Finally it's worth noting that the various solutions to the above problems may impact performance, i.e. the amount of data that can be transmitted between computers in a fixed amount of time. The speed at which data can be transmitted is also referred to as bandwidth. Performance is also often at odds with perhaps the most practically important consideration: cost. An increase in bandwidth is nearly always matched by some increase in cost.
Protocols, Stacks and the Layer Model
This section describes in more detail the processes which occur on a computer to send or receive data from others connected to the network.
Protocols
For two computers to communicate there must first be an agreed procedure for sending data to each other, just as two people communicating must both be speaking the same language. A method for organising and sending data is known as a protocol. A real-world analogy of a protocol is the way we send a letter. In this case the protocol specifies the following steps:
Place the sheets of the letter into an envelope.
On the front of the envelope write the name of the recipient on the first line, followed by their address on the second and remaining lines.
Place the envelope in a postbox.
The envelope is then transported to the nearest post office.
The post office examines the address (starting with the second line) and determines the nearest post office to that address.
The envelope is transported to the target post office.
The post office then examines the address, notices it is within their delivery area and delivers the envelope through the door.
The recipient first checks the name on the envelope is their name - if it is, they remove the letter from the envelope.
The process is complete - the letter has been successfully sent to its destination.
The example above is described in more detail than most people would need to post a letter, but humans have common sense and intelligence to decide the best course of action in case of ambiguity. Computers do not have such luxury, so networking protocols must be defined in precise detail to ensure computers act in a way that other computers can predict. Imagine a sorting office receiving an envelope where the recipients name had been written after the address instead of before it:
123 Some Street
Nowheresville
Exampleshire
Mr J. Random
A human would have little trouble understanding what was meant, but a computer following the above procedure to the letter*would interpret the address as:
Nowheresville
Exampleshire
Mr J. Random
and, as a result, probably return the letter to the sender as being sent to a non-existant address.
Protocols can manipulate data in any way they wish provided it eventually gets to its destination. One of the most common operations is to split the data into small chunks called packets which are handled individually by the network, and then stuck back together by the destination computer to re-create the original data. This makes it much easier to have lots of computers all sending information at once, in the same way that it's easier to split 100 tonnes of grain over several lorries than design a specially large lorry to carry it all at once.
Protocol Stacks
In reality, several separate protocols are usually involved in transmitting a piece of data across the network. This is as a result of the different types of physical connection used, and the different types of data transmitted. Since many parts of the process are the same for any type of physical connection, these are separated into separate protocols. To illustrate this, compare sending a letter to your bank in the same town as you to sending a letter to a relative on another contininent. The procedure you follow in sending the letter is essentially the same, but the procedure the post office follow is very different - one involves taking your letter to the airport, the other simply handing it to a postal worker to deliver locally. Imagine if the postal company had to build two sets of postboxes, one for international deliveries - this would be time-consuming and costly.
In the same way, different protocols are devised to cope with different types of physical connection, but these are designed so that any data can be sent over them. Similarly, different protocols are used to transport different types of data (e-mails, web pages, etc.) but these are designed so that they can work across any type of physical connection.
The best way to visualise this is as a pile of protocols, with the physical connection at the bottom and the program being run by the user at the top - this pile is known as a protocol stack*. Data arrives from the network at the bottom of the stack, and gets passed up through the various protocol layers. Each layer examines the data and then passes it on to the layer above. Each layer is free to alter the data to match what the layer above would have sent out (and hence will be expecting back from the same layer on another computer).
The layers of the stack can be illustrated by a line of people playing a game of pass the parcel. A present (the data) is passed into the first layer, wrapped in paper and passed onto the second layer. The second layer sticks sellotape around the parcel, and passes it to the third layer who wraps it in string. The parcel can then be passed to an identical line of people, who get it in reverse order. The third layer unwraps the string and passes it to the second layer, and so forth, until the original present is delivered to the receiver. If the wrapped parcel had been delivered directly to the second layer, for example, it wouldn't have been in a form the second layer expected - since it didn't know how to unwrap string, it probably would have thrown the parcel away as useless, or sent it back to the sender.
The above example, while trivial, illustrates the typical operation of a layer in the protocol stack - wrapping the data up in some way on the way down through the stack (towards the physical connection), and unwrapping it on the way up (towards the user). This wrapping is usually added to the start of the data, and is known as a header. After the data has been through several layers, it will usually have several headers all piled on top of each other, but lower layers can just treat the extra headers as more data to send - crucially they do not need to be able to understand the headers, or even know they exist, for the data to be sent out.
These headers are used by the various protocols to overcome some of the challanges mentioned in the first section - their role for data is similar to an envelope's role for a letter. They can contain addresses, to make sure the data gets to the correct destination, and also extra information for error-correction and other more advanced purposes.
The key point to note about protocol stacks is that the protocols are kept independent of each other - the top layer of the sending computer doesn't care what the lower layers do to its data as long as the top layer on the destination computer gets back the same data that the sender passed downwards. Similarly, the bottom layer doesn't care what data it gets sent from above - it just promises that whatever it gets sent from the layer above on the sending system, it will pass that same data up to the layer above on the destination system.
The OSI Layer Model
The OSI* is a standards organisation for networking protocols - their role is to assist those creating software or hardware in making sure their products use the networking protocols correctly, and to ensure the protocols themselves are adequate for the task. To this end, they have created a standard model for discussing and comparing protocols stacks.
This model takes the form of a hypothetical stack with seven layers, each with a defined purpose. In reality most protocol stacks do not conform precisely to this model - for example, many stacks combine several of the OSI layers into a single protocol. The model is still a useful way of looking at protocol stacks, however, to see at a glance the basic functions each layer performs. Briefly the layers of the OSI model, from the bottom (physical connection) up, are mentioned below - a much more detailed description can be found in the article A593624.
Layer | Name | Purpose |
---|---|---|
1 | Physical | The physical layer defines exactly how the numbers that makeup the data are transmitted between one place and another - e.g. the electrical signals that get sent along a wire, or the signals broadcast to a satellite. |
2 | DataLink | The datalink layer performs two basic functions. The first is logical link control, which involves splitting the constant stream of data from the physical layer into the individual packets that were sent by other computers. The second is media access control, which is to prevent multiple computers all sending data to a shared media network simultanesouly. The datalink layer only handles passing data to computers on the same physical link (e.g. on the same LAN). |
3 | Network | The network layer is the lowest of the layers which handle the full end-to-end connection. It is this layer which directs the data over potentially many different links to get to its final destination. |
4 | Transport | The transport layer is user to provide a more useful service than the network layer can provide. Among other things, this layer can ensure that packets arrive in the same order they were sent, errors in the packets are corrected and the data ends up being sent to the correct program on the destination machine. Note that different protocols at this layer may only perform a subset of these tasks depending on which are required for the data being sent. |
5 | Session | The session layer is often not used (i.e. data is often passed straight from the transport layer to the presentation layer). It is designed to organise and synchronise data from different applications or devices. If the soundtrack and video for a film were arriving as two separate streams of data, for example, this layer would be responsible for making sure they were passed up to the presentation layer synchronised with each other. |
6 | Presentation | The presentation layer translates between the data from lower layers, which all treat it as a list of numbers, and the useful data which programs on the computer use. In some cases this layer may not need to do anything, but tasks it could perform are encryption, compression and converting strings (e.g. between ASCII and Unicode). |
7 | Application | The application layer handles all other tasks, which are typically highly dependent on the data being sent. HTTP* is an application-layer protocol used to transmit web pages, for example. |
It is worth noting that the OSI model is based on one created by IBM in the mid-1970's, and some claim it is becoming outdated as protocols develop. It still remains probably the most widely used standard model for comparing protocol stacks, however.
Details of several common protocols for the layers described above can be found in the following sections.
Link-Layer Protocols
This section describes the lowest-level protocols in the stack which are used to send data over physical links.
Ethernet
The ethernet protocol is probably the most common link-layer protocol in use today for LANs. It is a shared-media network, so all computers attached to it are linked into a single cable.
Today it is almost exclusively used with UTP*cable.
Sections To Be Completed
Pages planned:
- Conectionless Link-layer Protocols
- Connection-oriented Link-layer Protocols
- TCP/IP and Related Protocols
- Other Network-layer Protocols
- Routing and Gateway Protocols
- Application-layer Protocols