What is a network?

Why networks, LAN, WAN and PAN, client-server and peer-to-peer.

F10.1NetworksGCSE15 min

Covers OCR J277 1.3.1 Networks and topologies · AQA 8525 3.5 Fundamentals of computer networks · Edexcel 1CP2 4.1.1 Why networks · Edexcel 1CP2 4.1.2 LAN and WAN

Do this lesson in the simulator

A network is two or more devices connected so they can share data. Your school's computers are a network, your phone joins one every time it connects to Wi-Fi, and the robots on the BugBot mat are a network too: every message one robot sends, the others receive. This module is about how networks work, from a single room to the whole internet.

Why connect computers?

Advantages Disadvantages
share files, printers and an internet connection the hardware, such as cables and switches, costs money
people can communicate: email, messages, video calls malware can spread from one computer to all the others
log in from any computer and find your own files files can be attacked by hackers from outside
back up everyone's work from one place if a central server fails, everyone is affected
install and update software on every computer at once a large network needs specialist staff to manage it

LAN, WAN and PAN

LAN WAN
Stands for local area network wide area network
Covers a small area: one building or site a large area: a country, or the world
Hardware owned by the organisation that uses it usually rented from telecoms companies
Example a school's network a bank connecting its branches; the internet

A WAN usually joins LANs together. The internet is the biggest WAN of all: a network of networks. A PAN, personal area network, is smaller still: the few devices around one person, such as a phone, earbuds and a smartwatch joined by Bluetooth.

A school's LAN of computers, a switch and a router, joined by WAN links to two other LANs, and a PAN of a phone, earbuds and a watchLAN: one schoolcomputercomputercomputerswitchrouterthe school owns all of itrouteranotherLANrouteranotherLANWANlinks rented fromtelecoms companiesPAN:one personphoneearbudswatchjoined by Bluetooth
The LAN covers one site and the school owns every part of it. The thick WAN links cover long distances and join LANs together. The internet is this idea on the largest scale: a network of networks.

Client-server and peer-to-peer

In a client-server network, one or more powerful computers called servers provide a service, and the other devices, the clients, ask them for it. A web server sends web pages; a file server stores everyone's work.

  • Files and backups are kept in one place, and security is managed centrally.
  • Servers are expensive, need specialist staff, and if one fails its clients cannot work.

In a peer-to-peer network, every device is equal. Each one shares its own files and resources directly with the others, with no server.

  • Cheap and easy to set up; no single point of failure.
  • Each device must be backed up and secured separately, and it gets hard to manage as it grows.

The robots on the mat are peers: no robot is in charge, and every robot hears every message.

On the left, four clients each ask one server for a service; on the right, four peers share directly with each other and there is no serverclient-serverserverclientclientclientclientrequestreplythe server provides the service;clients ask for itif the server fails, no client can workpeer-to-peerpeerpeerpeerpeerevery device is equal, and sharesits own files directly with the othersno server, so no single point of failure
A client-server network has a centre that everything depends on; a peer-to-peer network has none. The robots on the mat work the second way.

Who is on the network?

Ask the other robots on the mat to say who they are. Each one replies when it hears the question:

# the two lines every program starts with: the commands, then the robot
from bugbot import *
connect()

send("who is on the network?")
for tick in range(15):
    wait(0.1)                     # listen for 1.5 seconds
    for sender, text in messages():
        print(sender, "says:", text)

Run this in the simulator

Task: roll call

Send who is on the network?. Listen for 1.5 seconds and, for each reply, print found <name> using the name the reply gives after here:. Then print devices on the network: <n>, counting the devices you found.

# the two lines every program starts with: the commands, then the robot
from bugbot import *
connect()

Challenges

  1. Print the devices in alphabetical order.
  2. Ask twice, a second apart, and only count each device once.
  3. Is your school's network client-server or peer-to-peer? Give two pieces of evidence.