🎯 By the end of this module you should be able to…
- Explain why networks are built in layers, and name all seven OSI layers in order.
- Say what each layer adds to the data, and name the PDU at each level — data, segment, packet, frame, bits.
- Compare the OSI model with the four-layer TCP/IP model that the internet actually runs on.
- Choose between copper, fibre and wireless media, and explain attenuation, noise and bandwidth.
- Recognise the common topologies and know why star topology won.
- Tell a hub from a switch from a router, and match each to its OSI layer.
- Describe the main WAN and remote-connectivity options and where each is still used.
Why networks are built in layers
A message going from your laptop to a server crosses several completely different problems at once: which application should receive it, which machine on the planet is it for, which cable or radio link carries it next, and how do you turn it into electricity or light. Solving all of that in one piece of software would be unmaintainable.
So networking is split into layers. Each layer solves one problem, and only talks to the layer directly above and below it. That gives three big wins:
- 🔧You can swap one layer without touching the others Move from Wi-Fi to Ethernet and Layers 3 to 7 do not change at all.
- 🧩Vendors can interoperate A Cisco router and a TP-Link switch work together because both obey the same layer boundaries.
- 🔍Troubleshooting has an order Is the cable in? Is there an IP? Is the port open? You debug bottom-up, one layer at a time.
The rules come from organisations, not from one company. ISO published the OSI reference model. IEEE defines 802.3 (Ethernet) and 802.11 (Wi-Fi). IETF publishes the RFCs that define IP, TCP and HTTP. ANSI and TIA/EIA define the cabling.
The seven layers of OSI
Read it from the top down when you are sending, and from the bottom up when you are receiving.
| Layer | Name | Main responsibility | Address / control info | PDU |
|---|---|---|---|---|
| 7 | Application | Network services for applications | HTTP, DNS, SMTP protocol data | Data |
| 6 | Presentation | Format, encoding, encryption, compression | Depends on protocol (TLS, JPEG, ASCII) | Data |
| 5 | Session | Establish, manage and end sessions | Session-control information | Data |
| 4 | Transport | Process-to-process delivery | TCP / UDP header — port | Segment / Datagram |
| 3 | Network | Host-to-host delivery across networks | IP header — IP address | Packet |
| 2 | Data Link | Node-to-node delivery on the local link | Ethernet header + trailer — MAC | Frame |
| 1 | Physical | Put bits on the medium | No header — voltage, light, radio | Bits |
Layers 5, 6 and 7 do not each stamp a fixed header the way TCP and Ethernet do. Their functions are carried out by application protocols and libraries. Teaching "Layer 6 always adds a presentation header" is misleading — TLS, for example, does not map cleanly onto OSI Layer 6 at all.
Top-down: All People Seem To Need Data Processing.
Bottom-up: Please Do Not Throw Sausage Pizza Away.
The TCP/IP model — what the internet really uses
OSI is the teaching model. The internet was built on the TCP/IP model, which collapses the seven layers into four. Both are correct; they are describing the same journey at different resolutions.
| TCP/IP layer | Maps to OSI | Examples |
|---|---|---|
| Application | 7, 6, 5 | HTTP, HTTPS, DNS, SMTP, FTP, SSH, DHCP |
| Transport | 4 | TCP, UDP |
| Internet | 3 | IP, ICMP, ARP |
| Network Access (Link) | 2, 1 | Ethernet, Wi-Fi, PPP, fibre, copper |
TCP versus UDP — the one comparison you must know
| TCP | UDP | |
|---|---|---|
| Connection | Connection-oriented — three-way handshake first | Connectionless — just send |
| Reliability | Acknowledged, retransmitted, ordered | Best effort; loss is not detected |
| Speed / overhead | Slower, 20-byte header, more chatter | Faster, 8-byte header |
| Good for | Web, email, file transfer, SSH, databases | DNS lookups, video and voice, gaming, DHCP |
Ports you should recognise on sight
Every security group rule you will ever write is a combination of protocol + port + source. Allowing 22 from your own IP, 80 and 443 from anywhere, and nothing else, is the standard starting point for a web server. You cannot write that rule without knowing these ports.
Transmission media
Whatever the layer above believes, something physical carries the signal. Three families, three trade-offs.
| Medium | How it carries data | Typical distance | Strengths | Weaknesses |
|---|---|---|---|---|
| Twisted pair (UTP/STP) | Electrical signal on copper pairs | 100 m per run | Cheap, easy to terminate, everywhere | Distance limit, EMI, eavesdropping |
| Coaxial | Electrical, single core with shield | Hundreds of metres | Well shielded, long runs | Bulky, largely legacy in LANs |
| Fibre optic | Pulses of light in glass | 2 km multimode, 40 km+ single-mode | Huge bandwidth, immune to EMI, secure | Costly, fragile, needs skill to splice |
| Wireless | Radio waves through air | Tens of metres indoors | No cabling, mobility | Shared medium, interference, security |
Copper cable categories
| Category | Speed | Bandwidth | Where you see it |
|---|---|---|---|
| Cat 5e | 1 Gbps | 100 MHz | Older offices, still very common |
| Cat 6 | 1 Gbps / 10 Gbps to 55 m | 250 MHz | Current standard for new buildings |
| Cat 6a | 10 Gbps to 100 m | 500 MHz | Data centres, high-density Wi-Fi uplinks |
| Cat 7 / 8 | 10–40 Gbps | 600 MHz – 2 GHz | Short data-centre runs |
The three enemies of a signal
📉 Attenuation
The signal weakens with distance. This is why a copper run is capped at 100 m and why repeaters exist.
⚡ Noise & EMI
Motors, fluorescent lights and power cables inject interference. Twisting the pairs cancels most of it; shielding and fibre remove the rest.
🔀 Crosstalk
One pair leaking into its neighbour. Higher cable categories are defined largely by how well they suppress it.
Duplex
Simplex is one direction only, like a broadcast. Half duplex is both directions but only one at a time, like a walkie-talkie — this is what a hub forces. Full duplex is both directions at once, which is what a switch gives every port and why switches ended the era of collisions.
Topologies and Ethernet
⭐ Star
Every device has its own cable to a central switch. One failed cable affects one device. This is what essentially all modern LANs use.
➡️ Bus
One shared backbone cable. Cheap, but one break kills the whole segment and every device shares the bandwidth. Historic.
🔄 Ring
Each device connects to two neighbours. Data travels in one direction. Token Ring and FDDI used it; largely gone.
🕸️ Mesh
Many redundant paths. Expensive, but the most resilient — which is exactly why the internet backbone and AWS Region interconnects are meshed.
Ethernet, CSMA/CD and why collisions stopped mattering
On a shared medium two devices could transmit at the same moment and corrupt each other's signal. Ethernet handled that with CSMA/CD: listen before you send, and if a collision happens, back off a random amount of time and retry. A hub put every port in the same collision domain, so the more devices you added, the worse it got.
A switch gives every port its own collision domain and runs full duplex, so on a modern switched network collisions essentially do not occur. CSMA/CD remains examinable history.
| Standard | Speed | Medium | Max length |
|---|---|---|---|
| 10BASE-T | 10 Mbps | Cat 3+ twisted pair | 100 m |
| 100BASE-TX | 100 Mbps | Cat 5 twisted pair | 100 m |
| 1000BASE-T | 1 Gbps | Cat 5e/6 twisted pair | 100 m |
| 10GBASE-T | 10 Gbps | Cat 6a twisted pair | 100 m |
| 1000BASE-LX | 1 Gbps | Single-mode fibre | 5–10 km |
Network hardware and WANs
| Device | OSI layer | Decides using | What it actually does |
|---|---|---|---|
| Hub | 1 | Nothing | Repeats every signal to every port. One collision domain. Obsolete. |
| Switch | 2 | MAC address | Learns which MAC is on which port and forwards only there. |
| Router | 3 | IP address | Moves packets between different networks using a routing table. |
| Firewall | 3–7 | IP, port, sometimes content | Permits or denies traffic against a rule set. |
| Access point | 1–2 | MAC | Bridges wireless clients onto the wired LAN. |
| Load balancer | 4 or 7 | Connection or HTTP request | Spreads traffic over several servers. |
Switches work inside one network. Routers work between networks. A packet leaving your subnet always goes to a router — in AWS, that router is the VPC route table plus an internet gateway.
LAN, MAN, WAN
A LAN covers one building and you own the cable. A MAN spans a city. A WAN spans regions or countries and you almost always rent the link from a carrier.
| WAN / remote option | Typical speed | Notes |
|---|---|---|
| Leased line (T1/E1, MPLS) | 1.5 Mbps – 10 Gbps | Dedicated, predictable, expensive. Still used for branch offices. |
| DSL | 1–100 Mbps | Over telephone copper; speed falls with distance from the exchange. |
| Cable broadband | 10–1000 Mbps | Shared with the neighbourhood, so it slows at peak times. |
| Fibre to the premises | 100 Mbps – 10 Gbps | The modern default where it is available. |
| Cellular 4G / 5G | 10–1000 Mbps | Mobile, and a good backup link for a branch site. |
| Satellite | 10–200 Mbps | Reaches anywhere; geostationary links add noticeable latency. |
| VPN over the internet | Link speed | Encrypted tunnel. This is AWS Site-to-Site VPN. |
| AWS Direct Connect | 50 Mbps – 100 Gbps | A private circuit into AWS that never touches the public internet. |
A VPC is a LAN you rent. Subnets are its segments, route tables are its routers, security groups are its firewalls, and Direct Connect or Site-to-Site VPN is its WAN link back to your office. Everything on this page reappears there with an AWS name on it.
Key takeaways
- ✅Layering exists so one problem can be solved without disturbing the others.
- ✅Seven OSI layers; four TCP/IP layers; the same journey at different resolutions.
- ✅Segment → Port, Packet → IP, Frame → MAC, Bits → signals.
- ✅TCP is reliable and ordered; UDP is fast and best-effort.
- ✅Hub = Layer 1, Switch = Layer 2, Router = Layer 3. Switches inside a network, routers between them.
- ✅Star topology and full-duplex switching made collisions a historical topic.