by Chris Woodford. Last updated: December 10, 2013.
Thank goodness for computer networks! If they'd never been invented, you wouldn't be
reading this now (using the Internet) and
I wouldn't be writing it
either (using a wireless home
network to link up my computer
equipment). There's no doubt that computer networking is extremely
complex when you delve into it deeply, but the basic concept of
linking up computers so they can talk to one another is pretty
simple. Let's take a closer look at how it works!
Photo: Testing a small computer network linked to the Internet. Photo courtesy of NASA Glenn Research Center (NASA-GRC).
What is a computer network?
You can do lots of
things with a computer but, connect it up to other computers and
peripherals (the general name given to add-on bits of computer
equipment such as modems, inkjet and laser
printers, and scanners) and you can do
awful lot more. A computer network is simply a collection of computer
equipment that's connected with wires, optical
fibers, or wireless
links so the various separate devices (known as nodes) can
to one another and swap data (computerized information).
Photo: From the outside, a computer network looks like
nothing more than a bundle of wires. Photo courtesy of
Research Center (NASA-GRC).
Types of networks
Not all computer networks are the same. The network I'm using to
link this laptop to
my wireless router, printer, and other equipment is the smallest
imaginable. It's an example of what's sometimes called a PAN
(personal area network)—essentially a convenient, one-person
network. If you work in an office, you probably use a LAN (local
area network), which is typically a few separate computers linked to one
or two printers, a scanner, and maybe a single, shared connection to
the Internet. Networks can be much bigger than this. At the opposite
end of the scale, we talk about MANs (metropolitan area networks),
which cover a whole town or city, and WANs (wide area networks),
which can cover any geographical area. The Internet is a WAN that
covers the entire world but, in practice, it's a network of networks
as well as individual computers: many of the machines linked to the
Net connect up through LANs operated by schools and businesses.
Photo: A wireless router like this one, made by Netgear, is the heart
of many home PANs.
Computers are all
about logic—and logic is all about following rules. Computer
networks are a bit like the army: everything in a network has to be
arranged with almost military precision and it has to behave
according to very clearly defined rules. In a LAN, for example, you
can't connect things together any old how: all the nodes (computers
and other devices) in the network have to be connected in an orderly
pattern known as the network topology. You can connect nodes in
a simple line (also called a daisy chain or bus), with each connected to the next in
line. You can connect them in a star shape with the various machines
radiating out from a central controller known as the network server.
Or you can link them into a loop (generally known as a ring). All the
devices on a network also have to follow clearly defined rules
(called protocols) when they communicate to ensure they
understand one another—for example, so they don't all try to send messages at
exactly the same time, which causes confusion.
Artwork: The three best-known computer network topologies: line (chain/bus), ring, and star.
Permissions and security
Just because a machine
is on a network, it doesn't automatically follow that every other
machine and device has access to it (or can be accessed by it). The
Internet is an obvious example. If you're online, you get access to
billions of Web pages, which are simply files stored on other
machines (servers) dotted all over the network. But you can't access
every single file on every single computer hooked up to the Internet:
you can't read my personal files and I can't read yours, unless we
specifically choose for that to happen.
security are central to the idea of networking: you can access files
and share resources only if someone gives you permission to do so.
Most personal computers that connect to the Internet allow outgoing
connections (so you can, theoretically, link to any other computer),
but block most incoming connections or prohibit them completely.
Servers (the machines on the Internet that hold and serve up Web
pages and other files) operate a more relaxed policy to incoming
connections. You've probably heard of hacking, which, in one
the word, means gaining unauthorized access to a computer network by
cracking passwords or defeating other security checks. To make a
network more secure, you can add a firewall (either a physical
or a piece of software running on your machine, or both) at the point
where your network joints onto another network or the Internet to
monitor and prohibit any unauthorized, incoming access attempts.
What makes a network?
To make a network, you
need nodes and connections (sometimes called links) between them.
Linking up the nodes means making some sort of a temporary or
permanent connection between them. In the last decade or so, wireless
connections have become one of the most popular ways of doing this,
especially in homes. In offices, wired connections are still more
commonplace—not least because they are generally faster and more
secure and because many newer offices have network cabling already in
Photo: If your laptop doesn't have a network card, you
can simply plug in a PCMCIA adapter like this one. The adapter has a network card
built into it.
Apart from computers,
peripherals, and the connections between them, what else do you need?
Each node on a network needs a special circuit known as a network
card (or, more formally, a network interface card or NIC) to tell
how to interact with the network. Most new computers have network
cards built in as standard. If you have an older computer or laptop,
you may have to fit a separate plug-in circuit board (or, in a
laptop, add a PCMCIA card) to make your machine talk to a network.
Each network card has its own separate numeric identifier, known as a
MAC (media access control) code or LAN MAC address. A MAC code
bit like a phone number: any machine on the network can communicate
with another one by sending a message quoting its MAC code. In a
similar way, MAC codes can be used to control which machines on a
network can access files and other shared resources. For example,
I've set up my wireless link to the Internet so that only two MAC
codes can ever gain access to it (restricting access to the network
cards built into my two computers). That helps to stop other people
in nearby buildings (or in the street) hacking into my connection or
using it by mistake.
The bigger you make a
network, the more extra parts you need to add to make it function
efficiently. Signals can travel only so far down cables or over
wireless links so, if you want to make a big network, you have to add
in devices called repeaters—effectively signal boosters. You
also need bridges, switches, and routers—devices
that help to link
together networks (or the parts of networks, which are known as
segments), regulate the traffic between them, and forward traffic
from one part of a network to another part.
How Ethernet works
Photo: A typical ethernet networking cable.
Not so long ago, computers were all made by different companies,
worked in different
ways, and couldn't communicate with one another. Often, they didn't
even have the same sorts of plugs and sockets on their cases! During
the 1980s and 1990s, everything became much more standardized and
it's now possible to connect virtually any machine to any other and
get them exchanging data without too much effort. That's largely
because most networks now use the same system, called Ethernet.
was developed in May 1973 by US computer engineer Dr Robert ("Bob")
Metcalfe (1946–), who went on to found 3Com and later became a
well-known computer-industry pundit (perhaps, somewhat unfairly, best
known for predicting a spectacular collapse of the Internet in 1995
that never actually occurred).
As Metcalfe originally
designed it, Ethernet was based on three very simple ideas. First,
computers would connect through the "ether" (a semi-serious,
semi-scientific name for the void of emptiness that separates them)
using standard coaxial cable (wires like the ones used in a television
antenna connection, made up of concentric metal layers). In
Ethernet-speak, the physical connection between the nodes (computers
and other devices) on the network is also known as the medium.
have moved on quite a bit since the early 1970s and the medium is now
just as often a wireless radio link (you've probably heard of Wi-Fi,
which is the wireless version of Ethernet). Second, all the computers
and devices on a network would stay silent except for when they were
sending or receiving messages. Finally, when they wanted to
communicate, they'd do so by breaking up messages into small packets
of data and sending them around the network by a highly efficient
method known as packet switching (discussed in much more detail
in our article on the Internet).
If one machine wants
to send a message to another machine on an Ethernet network, it goes
through a process a bit like sending a letter. The message has to be
packaged in a standard format called a frame (a bit like the
that contains a letter). The frame includes a standard header, the
address of the device on the network it's intended for (like the
address on an envelope), the address of the machine that sent it
(like an envelope's return-to or sender's address), an indication of
how much data it contains, the data itself, some padding, and some
error checking information at the end (used to do a quick check on
whether the data has transmitted correctly). Unlike a letter, which
goes only to the recipient, the frame goes to every machine and
device on the network. Each machine reads the destination address to
figure out whether the frame is intended for them. If so, they act on
it; if not, they ignore it. Any machine on the network can transmit
messages through the ether at any time, but problems will occur if
two or more machines try to talk at once (known as a collision). If
that happens, the machines all fall silent for a random period of
time before trying again. Eventually, one will find the ether is
clear and get its message out first, followed by the other, so all
messages will get through eventually. Typical Ethernet equipment can
handle thousands of frames per second. In tech-speak, this method of
using the network is called carrier sense multiple access with
collision detection (CSMA/CD): that's a fancy way of saying that
the nodes do their best to transmit when the ether is clear ("carrier
sense"), they can all theoretically send or receive at any time
("multiple access"), and they have a way of sorting out the problem if
two happen to transmit at exactly the same time ("collision detection").
How do computer networks detect errors?
Suppose you order a book by mail order and it arrives, a few days later, with the packaging ripped and
the cover slightly creased or torn. That's a kind of error of transmission. Fortunately, since a book
is analog information, a bit of damage to the cover
doesn't stop you appreciating the story the book tells or the information it contains. But what if
you're downloading an ebook (electronic book) and there's a blip in
transmission so some of the data goes astray. Maybe you won't be able to open the
book file at all, rendering the whole thing useless. Or what if a bank is sending an electronic payment
to someone and the data it transmits across its network is corrupted so the account number or
the amount to be paid gets scrambled? What if a military control center sends a signal to
a nuclear missile installation and a blip on the network alters the data it contains so, instead
of "power down," the rocket is told to "launch immediately"? The point is a simple one: when
we send data over computer networks, we need to be absolutely certain that the information
received is identical to the information transmitted. But how we can do this
when vast amounts of data are being sent around the world all the time?
Computers and computer networks have all kinds of ingenious ways of checking the information
they send. One simple method is to send everything twice and compare the two sets of data that
are received; if they don't match, you can ask for all the data to be resent.
That's laborious and inefficient—doubling the time it takes to transmit information—and there are far better methods of keeping data straight. One of the simplest is called parity checking (or parity bit checking). Suppose you're sending strings of binary digits (bits, made up of zeros and ones) over a network. Every time you send seven bits, you add up the number of ones you've sent. If you've sent an odd number of ones (1, 3, 5, or 7 of them), you then send an extra 1 to confirm this; if you've sent an even number of ones (0, 2, 4, or 6), you send a zero instead. The receiver can do the same sums with the data it sees, check the parity bit, and so detect if a mistake has been made. Unfortunately, with simple parity checking, it's not possible to say where an error has been made or to correct it on the spot, but the receiver can at least spot a batch of incorrect data and ask for it to be sent again.
More sophisticated ways of detecting errors are usually variants of checksums where, every so often, you add together the numbers you've previously sent and then transmit the total (the sum) as a check. The receiver does the same calculation and compares it with the checksum. But what if multiple errors occur (say, the checksum is transmitted incorrectly as well as some of the original data), so they cancel one another out and go undetected? There are much more sophisticated versions of checksums where, instead of simply adding the data you've transmitted, you process it in more complex ways that make it far harder for errors to slip through. When you download large files, for example, you'll sometimes be given what's called an MD5 hash code to check, which is a long number (often in hexadecimal or base 16 format, made up of the numbers 0–9 and the letters A–F) computed from the original file by a complex mathematical algorithm. A typical MD5 hash code would be 7b7c56c74008da7d97bd49669c8a045d or ef6a998ac98a440b6e58bed8e7a412db. Once you've downloaded your file, you simply run it against a hash-checking program to generate a code the same way. Comparing the codes, you can see if the file downloaded correctly and, if not, try again. Some forms of error checking not only allow you to detect errors but make it possible to correct them without retransmitting all the data. Among the best known are Hamming codes, invented in 1950 by US mathematician Richard Hamming to improve the accuracy and reliability of all kinds of data transmissions. They work by using more error detection bits so that the position of an error in transmitted data can be figured out and not just the simple fact that an error has occurred.
Artwork: Checking the integrity of a large download with an MD5 code: If you've ever downloaded a linux distribution, you've probably done this—or you certainly should have done! On the original download page, you'll be given an MD5 checksum code matching the file you want to download. Once your download is complete, you simply run the file through an MD5 calculator program (here I'm using winMd5sum) to calculate the MD5 code from the data you've downloaded. If the two MD5 codes match, you can be reasonably confident your file downloaded without any mistakes.
On this website
- Computer Networks by Andrew S. Tanenbaum. Prentice Hall Professional, 2003. One of the best-known and most popular textbooks on networking.
- Networking All-in-One For Dummies by Doug Lowe. For Dummies, 2010. Covers topics such as how to build and secure a network, wireless and mobile devices, and everyday administration.