What is a computer network?
A network is a group of devices (computers, phones, printers) linked so they can share data and resources. The link can be a wire (Ethernet cable, optical fibre) or wireless (Wi-Fi, mobile data).
Types by size
- PAN: around one person, e.g. phone + Bluetooth earbuds.
- LAN: one home, school or office.
- MAN: across a city.
- WAN: across countries. The Internet is the biggest WAN: a network of networks.
Key devices
- Switch: joins devices inside one LAN.
- Router: joins different networks and chooses paths.
- Modem / ONT: connects your home to your Internet provider.
- Access point: gives Wi-Fi.
IP addresses and packets
Every device on a network has an IP address. An IPv4 address has 4 numbers from 0 to 255, e.g. 192.168.1.5. That gives about 4.3 billion addresses, which is not enough, so the newer IPv6 uses much longer addresses written in hexadecimal.
Addresses starting 192.168 or 10. are private: used only inside a home or office LAN. Your router shares one public address with the outside world.
Data is sent as packets: small pieces, each with a header (from-address, to-address, packet number) and some of the data. This is called packet switching.
Routing and the TCP/IP layers
A router reads the to-address of each packet and sends it one step (a hop) closer, using a routing table. If a link breaks, routers pick another path, so the Internet has no single weak point.
Rules for talking are called protocols. The Internet uses a stack of layers:
- Application: HTTP/HTTPS (web), SMTP (email), DNS.
- Transport: TCP (reliable: numbers packets, checks, re-sends) or UDP (fast, no checks; used for live video and games).
- Internet: IP (addresses and routing).
- Link: Ethernet, Wi-Fi (the actual cable or radio).
DNS, servers and clients
A client asks for something; a server answers. Your browser is a client; a web server sends the page. Other services: email servers, file servers, print servers, game servers, DHCP (gives each new device an IP address automatically) and DNS.
DNS (Domain Name System) is the Internet's phone book. You type a name; your computer asks a DNS server for the IP; then it contacts that IP. In peer-to-peer networks there is no main server: every device shares with the others.
Keeping a network safe
- Firewall: checks packets and blocks those that break rules.
- Strong passwords and two-step login.
- Encryption: HTTPS and WPA2/WPA3 Wi-Fi scramble data so snoopers cannot read it.
- Updates and antivirus: close holes that malware uses.
- Access control: users get only the rights they need.
Try it: open a command prompt and type ping example.com. You will see the IP address DNS found and how many milliseconds each packet takes to go and come back.
Key formulas and definitions
- Network: devices linked to share data
- IP address: the unique number of a device on a network
- Packet: small piece of data with a header
- Router: sends packets between networks
- DNS: turns names into IP addresses
- Protocol: agreed rules for communication (TCP, IP, HTTP)
- Bandwidth: how much data per second a link carries (bit/s)
- Latency: time delay for a packet (ms)
Worked examples
1. A school has 40 computers in one building connected with cables and switches. What type of network is this?
It covers one building, so it is a LAN (Local Area Network).
2. Is 192.168.1.300 a valid IPv4 address?
No. Each of the four numbers must be from 0 to 255, and 300 is too big.
3. A file is 3 MB and each packet carries 1,500 bytes of data. About how many packets are needed? (1 MB = 1,000,000 bytes)
3,000,000 ÷ 1,500 = 2,000 packets.
4. Trace what happens when you type www.example.org in a browser.
1) The browser asks a DNS server for the IP of www.example.org. 2) DNS replies with the IP. 3) The browser sends an HTTPS request, cut into packets, to that IP. 4) Routers forward the packets hop by hop. 5) The web server sends back the page in packets. 6) TCP puts them in order and the browser shows the page.
5. A link has a bandwidth of 100 Mbit/s. How long does it take, ideally, to send a 50 MB file? (1 byte = 8 bits)
50 MB = 400 Mbit. Time = 400 ÷ 100 = 4 s.
Common mistakes
- Thinking the Internet and the Web are the same: the Web is one service (web pages) that runs on the Internet.
- Thinking a message travels as one block: it is split into packets that may take different paths.
- Mixing up a switch (inside one LAN) and a router (between networks).
- Thinking Wi-Fi is the Internet: Wi-Fi is only the wireless link to your router.