L31 — Computer Networks
How do computers talk to each other? We cover network types (LAN, WAN, Internet), topologies, and the client-server model. We visualise real networks using draw.io.
🎯Learning Objectives
- Explain what a computer network is and why we need them
- Tell the difference between LAN, WAN, and the Internet
- Identify the three most common network topologies (star, ring, bus)
- Explain the client-server model with an everyday example
- Draw a simple network diagram in draw.io
📖Theory
1. What Is a Computer Network?
A computer network is two or more computers connected to share information and resources.
Without networks:
- You'd carry files on a USB drive between computers
- Every computer would need its own printer
- Email, web browsing, streaming — impossible
With networks:
- Any file on the school server is available at any computer
- One printer shared by 30 computers
- The entire Internet — one giant global network
One-sentence definition: a computer network is a system of connected devices that can send and receive data with each other.
2. Types of Networks
Networks are classified by their size:
| Type | Full name | Coverage | Example |
|---|---|---|---|
| PAN | Personal Area Network | ~1–5 m | Your phone connected to your earbuds via Bluetooth |
| LAN | Local Area Network | One building | School computer lab, home Wi-Fi |
| MAN | Metropolitan Area Network | One city | City government network, university campus |
| WAN | Wide Area Network | Country or world | Company offices in different cities connected |
| Internet | — | The whole world | The network of all networks |
The Internet is not one big network — it's millions of smaller networks (school LANs, company WANs, home networks) connected together by cables under the ocean and satellites in space.
3. Network Topologies
A topology is the pattern of connections between devices in a network. Think of it as the "shape" of the network.
Star topology — all devices connect to a central switch or router.
Code
PC1 PC2
\ /
HUB
/ \
PC3 Printer- Pros: one broken cable only disconnects that one device
- Cons: if the hub breaks, the whole network goes down
- Used in: almost all modern home and office networks
Bus topology — all devices share one cable.
Code
PC1 --- PC2 --- PC3 --- PC4
|_________________________|
shared cable- Pros: simple, cheap to install
- Cons: if the cable breaks, everything stops; slow when many devices transmit at once
- Used in: older networks, no longer common
Ring topology — devices form a closed loop.
Code
PC1 → PC2 → PC3
↑ ↓
PC4 ← ← ← ← ←- Pros: predictable performance
- Cons: one broken link breaks the whole ring
- Used in: industrial networks, some fibre networks
4. Wired vs Wireless
Networks transmit data either through cables or through radio waves:
| Wired (Ethernet) | Wireless (Wi-Fi) | |
|---|---|---|
| Speed | Up to 10 Gbps | Up to 9.6 Gbps (Wi-Fi 6) |
| Reliability | Very high — no interference | Lower — walls, microwaves interfere |
| Security | Harder to intercept | Easier to intercept if not encrypted |
| Mobility | Tied to the cable | Move freely |
| Cost | Cables + ports needed | Just a router |
Most networks use both: desktops and servers use wired Ethernet for reliability; phones and laptops use Wi-Fi for mobility.
5. The Client-Server Model
Almost everything on the internet follows the client-server model:
- The client is the device that asks for something (your phone, your browser)
- The server is the computer that provides the answer (a website, a video)
Code
Your phone (client)
|
| "GET youtube.com/watch?v=abc"
↓
YouTube server
|
| "Here's the video data"
↓
Your phone plays the videoWhen you open YouTube, your phone sends a request to YouTube's server. The server sends back the response — the video data. Your phone plays it.
The server doesn't know or care whether it's talking to your phone, your laptop, or your smart TV. It just responds to requests. This is why the same website works on all your devices.
6. Bandwidth and Latency
Two important numbers when talking about network speed:
Bandwidth — how much data can flow per second. Like the width of a pipe.
- Measured in Mbps (megabits per second) or Gbps
- Your home internet might be 100 Mbps download / 20 Mbps upload
Latency — how long it takes a packet to travel from client to server and back. Like how long it takes to throw a ball and catch the return.
- Measured in milliseconds (ms)
- Good gaming connection: < 30 ms. Satellite internet: 600+ ms — bad for games.
Analogy: a wide highway (high bandwidth) moves many cars, but each car still takes time to travel (latency). A narrow road with very fast cars has low latency but low bandwidth.
💻Code Examples
Example A — Pinging a server to measure latency
Open the Command Prompt (press Windows + R, type cmd, press Enter) and type:
ping google.com
You'll see something like:
Code
Reply from 142.250.74.46: bytes=32 time=12ms TTL=116
Reply from 142.250.74.46: bytes=32 time=11ms TTL=116
Reply from 142.250.74.46: bytes=32 time=13ms TTL=116
Reply from 142.250.74.46: bytes=32 time=12ms TTL=116time=12msis the latency — how long it took for a small packet to go to Google and come back- 12 ms is very good. 200+ ms would feel slow in a game.
Example B — Network diagram in draw.io
A typical school LAN:
Code
[ Teacher's PC ]
|
[ Switch ]
/ | \
[PC1][PC2][PC3] ← student computers
|
[ Router ]
|
[ Internet ]
|
[ School Server ]We'll draw this in draw.io using network shape icons.
✏️Practice Tasks
Open the Command Prompt (Windows + R → cmd):
- Run
ping google.com— record the average time in ms - Run
ping 127.0.0.1— this pings your own computer (loopback). Record the time. - Run
ping 8.8.8.8— this is Google's DNS server. Record the time.
Answer in your notebook:
- Which ping was fastest? Why?
- What does a 0 ms ping to 127.0.0.1 tell you?
- What would happen if you ping a server on another continent?
💡 Hint
Open app.diagrams.net → New diagram → Network template (or blank).
Draw a network for a small office with:
- 1 router (connects to the internet)
- 1 switch (connects local devices)
- 3 computers (employees)
- 1 server (file storage)
- 1 printer
- Wi-Fi access point (for phones and laptops)
Use the Network shape category in draw.io (left panel → search "network", or use More Shapes → Networking). Label each device.
💡 Hint
You are setting up a network for a hospital:
- 10 nurse workstations in one ward
- 1 central server with patient records
- 2 doctor's offices
- 1 pharmacy
- All must stay connected even if one cable breaks
- Which topology (star, bus, ring) would you choose and why?
- What would happen in each topology if one cable connecting a workstation breaks?
- What would happen if the central switch breaks in a star topology? How would you prevent that?
- Draw your recommended topology in draw.io.
💡 Hint
⚠️Common Mistakes
Confusing Wi-Fi with the Internet
Wi-Fi is how your device connects to the router (Local Area Network). The router then connects to the Internet through your ISP. If the ISP is down, you still have Wi-Fi — but no Internet.
Confusing bandwidth and speed
Bandwidth is the maximum data rate. Actual speed depends on network load, distance, interference. 100 Mbps internet doesn't mean every download runs at 100 Mbps.
Thinking the server "visits" the client
In the client-server model, the client always initiates. The server waits and responds. The server never spontaneously sends data to a client — unless a connection was established first (like with push notifications).
🎓Instructor Notes
⚡ How to run this lesson (~80 min)
- [5 min] Hook. Ask: how many devices in this room are connected to the school network right now? (Count computers, phones, the printer, maybe a smart board.) That's a LAN.
- [15 min] Theory. Cover types (LAN/WAN/Internet) and topologies. Draw each topology on the board — star first, since it's what they're sitting in.
- [10 min] Client-server demo. Open the browser, go to any site. Open DevTools (F12) → Network tab → reload the page. Show the list of requests the browser made. Each row is one client request → server response.
- [10 min] Ping demo. Run
ping google.comon the projector. Discuss the numbers. - [30 min] Tasks 1 + 2 in class. Task 1 = everyone runs ping in cmd. Task 2 = draw.io network diagram.
- [5 min] Preview L32. IP addresses and DNS — how does the network know where to send data?
💬 Discussion questions
- "When you type 'youtube.com', who is the client and who is the server?"
- "Would you rather have 1000 Mbps bandwidth with 200 ms latency, or 50 Mbps with 5 ms latency? Why? (Depends on the use case!)"
- "Why is the school using a star topology instead of putting all computers on one long cable?"