chapter1: TCP/IP

TCP/IP — Complete Interactive Guide
Interactive course

TCP/IP Networking
— complete guide

Everything from network models to firewalls. Each section explains the purpose before the details, with interactive visuals throughout.

01
🗂
Foundations
Network models, OSI layers, encapsulation — the why behind the structure.
4 sections
02
🌐
Addressing
IPv4, IPv6, subnetting, MAC addresses and ARP.
4 sections
03
🔗
Transport layer
TCP deep dive — handshake, reliability, flow, flags, teardown, and UDP.
7 sections
04
📡
App protocols
DNS, HTTP/HTTPS, email protocols, DHCP — what runs on top of TCP.
4 sections
05
🔀
Infrastructure
Routing, switching, NAT, and network security fundamentals.
4 sections
06
📋
Reference & quiz
Full protocol port reference and 12-question final quiz.
2 sections
Foundations · 1 of 4

Network models

Models break networking into layers so engineers work on one piece without understanding all others. Two matter: OSI (theoretical) and TCP/IP (practical).

Why models exist

A layered model lets a Wi-Fi engineer work on signals without knowing HTTP, and a web developer write apps without knowing signal propagation. Each layer has one job and a defined interface to the layers above and below.

OSI vs TCP/IP — colour-coded mapping
OSI — 7 layers
7 · Application
6 · Presentation
5 · Session
4 · Transport
3 · Network
2 · Data Link
1 · Physical
TCP/IP — 4 layers
Application
Transport
Internet
Network access
OSI layers 5–7 collapse into TCP/IP Application. OSI layers 1–2 collapse into Network Access. Transport and Network map 1:1.
OSI lost the protocol war in the 1990s — nobody runs OSI protocols today. But it won the vocabulary war. “Layer 3 problem” or “Layer 2 switch” are spoken by every network engineer worldwide. OSI is taught because it carves the problem more precisely than TCP/IP’s 4 layers.
Foundations · 2 of 4

OSI & TCP/IP layers

Each layer solves exactly one problem. Click any row to understand what problem that layer was invented to solve.

The separation principle

Layers don’t need to know what’s inside the layers above or below them. IP doesn’t care that TCP is inside it. TCP doesn’t care that HTTP is inside it. This ignorance is intentional — it’s what lets you swap Ethernet for Wi-Fi without changing a single line of application code.

Click a layer to see its purpose
# Layer TCP/IP PDU Key protocols
7 Application Application Message HTTP, DNS, SMTP, FTP
6 Presentation Application Message TLS/SSL, JPEG, ASCII
5 Session Application Message NetBIOS, RPC
4 Transport Transport Segment/Datagram TCP, UDP
3 Network Internet Packet IP, ICMP, ARP
2 Data Link Network access Frame Ethernet, Wi-Fi, PPP
1 Physical Network access Bit Cables, signals, NICs
Foundations · 3 of 4

Encapsulation

Each layer wraps data with its own header before passing it down. Click any layer to see what it adds and why.

Why encapsulation?

Each layer reads only its own wrapper, strips it, and passes the rest up. The router reads the IP header — not the TCP segment inside. This separation means IPv6 can replace IPv4 without changing TCP or HTTP.

Sending “Hello!” — click each layer to inspect
Network access — Ethernet frame
MAC hdr
Internet — IP packet
IP hdr
Transport — TCP segment
TCP hdr
Application — HTTP
HTTP hdr “Hello!”
FCS
Click any layer above to see what it adds and why that header exists.
Addressing · 1 of 4

IPv4 addresses

Every device needs a unique logical address. IPv4 provides a 32-bit address — four 0–255 numbers separated by dots.

Why logical addresses?

MAC addresses identify hardware and can’t be organised hierarchically. IP addresses are logical and assignable — they can be grouped by network prefix, enabling routers to forward data efficiently across the entire internet.

Interactive — click an octet, drag the slider
192
.
168
.
1
.
5
192
Address classes
Class Range Mask Purpose
A 1–126.x.x.x /8 Large networks
B 128–191.x.x.x /16 Medium networks
C 192–223.x.x.x /24 Small networks
D 224–239.x.x.x N/A Multicast
Private ranges: 10.x.x.x · 172.16–31.x.x · 192.168.x.x — not routed on the public internet. Your home Wi-Fi uses 192.168.x.x.
Addressing · 2 of 4

Subnetting

Subnetting divides a network into smaller ones. A subnet mask tells you which bits identify the network and which identify the host.

Why subnet?

Without subnetting, every device in a company would be on one giant broadcast domain — every ARP and discovery packet would hit every machine. Subnetting creates isolated segments, improves performance, and adds security boundaries between departments.

Subnet calculator
192.168.1.0 / 24
Network: 192.168.1.0 ← not assignable
First host: 192.168.1.1
Last host: 192.168.1.254
Broadcast: 192.168.1.255 ← not assignable
Hosts: 254 usable
Addressing · 3 of 4

IPv6

IPv4’s 4 billion addresses ran out. IPv6 provides 340 undecillion — enough for every grain of sand to have billions of addresses.

Why IPv6?

IPv4 was designed in 1981 for a small research network. IPv6 solves the exhaustion problem with 128-bit addresses, and also adds built-in IPSec, simpler routing headers, stateless autoconfiguration, and eliminates the need for NAT.

📏

128-bit addresses

Eight groups of four hex digits. e.g. 2001:0db8:85a3::8a2e:0370:7334. Consecutive zero groups compress to ::.

🔐

IPSec built in

IPv6 mandates IPSec support. Encryption and authentication are first-class features, not optional add-ons.

🚫

No NAT needed

Every device gets a globally unique address. NAT becomes unnecessary — end-to-end connectivity is restored.

📡

SLAAC

Stateless Address Autoconfiguration: devices generate their own IPv6 address from their MAC + network prefix. No DHCP server required.

Feature IPv4 IPv6
Address size 32 bits 128 bits
Total addresses ~4.3 billion ~3.4 × 10³⁸
Header size 20 bytes (min) 40 bytes (fixed)
Notation Dotted decimal Hex with colons
Fragmentation Routers & hosts Source hosts only
Addressing · 4 of 4

MAC addresses & ARP

IP identifies devices logically. MAC identifies their hardware physically. ARP is the bridge between them.

The two-address system

You know the IP of who you want to reach, but not their MAC. ARP broadcasts “Who has IP X? Tell me your MAC.” — and only the device with that IP replies. The result gets cached, so ARP doesn’t happen for every packet.

🏭

MAC structure

48 bits: first 3 bytes = OUI (manufacturer), last 3 bytes = device serial. Burned in at factory. e.g. AA:BB:CC:DD:EE:FF

📢

ARP request

Broadcast to 255.255.255.255: “Who has 192.168.1.1? Tell 192.168.1.5.” Every device on the LAN receives this.

↩️

ARP reply

Only the matching device responds: “192.168.1.1 is at AA:BB:CC:11:22:33.” Unicast directly to the requester.

🗃

ARP cache

Results cached for a few minutes. Check yours: arp -a. Stale entries can cause connectivity issues after IP changes.

Key insight: IP addresses stay the same across the entire journey. MAC addresses change at every router hop — each router strips the old frame and builds a new one addressed to the next hop's MAC. IP works globally; MAC works locally.
Transport · 1 of 7

TCP overview

TCP makes the internet reliable. IP delivers packets to the right machine — TCP ensures they arrive correctly, completely, and in order.

Why TCP exists

IP is deliberately "dumb" — it routes packets fast and drops them when the network is congested. This is a feature. TCP compensates on top, adding reliability, ordering, and flow control. The separation lets the internet scale: IP doesn't slow down for acknowledgments; TCP handles that at the endpoints.

🔗

Connection-oriented

TCP establishes a dedicated connection before data flows. Both sides maintain shared state throughout the session.

Reliable delivery

Every segment is numbered and acknowledged. Nothing is silently dropped — unacknowledged data is retransmitted.

🔢

Ordered data

Sequence numbers let the receiver reassemble segments in correct order, even if they arrive out of sequence.

🚦

Flow control

The receiver advertises its available buffer (receive window). The sender never overwhelms a slow receiver.

🌐

Congestion control

TCP detects network congestion via packet loss and slows transmission. This is why the internet doesn't collapse under load.

↔️

Full-duplex

Data flows both ways simultaneously. Each direction has its own sequence numbers and flow control window.

Transport · 2 of 7

The 3-way handshake

Before data moves, both sides must agree they're ready and synchronise sequence numbers. This 3-step ritual opens every TCP connection.

Why exactly 3 steps?

Two steps only confirm one direction. Three steps confirm both directions and let both sides exchange Initial Sequence Numbers simultaneously. You cannot accomplish this in fewer than three messages.

Step through the handshake
Client (browser)
CLOSED
Server
LISTEN
Press "Next step" to begin
Step 1 — SYN

Client: "I want to connect"

Sends SYN with Initial Sequence Number, e.g. seq=100. Enters SYN_SENT state.

Step 2 — SYN-ACK

Server: "I hear you, I'm ready too"

Acknowledges (ACK=101) and picks its own ISN (seq=300). Enters SYN_RECEIVED.

Step 3 — ACK

Client: "Got it. Connection open."

Acknowledges server's ISN (ACK=301). Both sides enter ESTABLISHED. Data can now flow.

0 / 3
Why random ISNs? If sequence numbers started at 0 every time, an attacker could guess them and inject fake data into the stream. Random ISNs make this computationally infeasible.
Transport · 3 of 7

Reliability & ACKs

TCP guarantees every byte arrives exactly once, in order. Sequence numbers and acknowledgments are the machinery behind that promise.

The problem IP creates

IP may drop, duplicate, or reorder packets at any time. TCP detects all three failure modes: sequence numbers catch ordering and duplicates; ACK numbers catch losses. Anything not confirmed gets retransmitted.

Simulation — packet 2 is deliberately lost
Packet transmission
■ ACKed ■ Lost ■ Retransmit
Press Play to simulate...

Timeout (RTO)

No ACK within the Retransmission Timeout → sender retransmits. RTO is adaptive and grows with network latency.

3️⃣

Fast retransmit

3 duplicate ACKs = likely loss. Sender retransmits immediately without waiting for timeout — much faster recovery.

🔄

SACK

Selective ACK: receiver reports exactly which segments arrived. Sender retransmits only what's missing, not everything from the loss point onward.

Transport · 4 of 7

Flow control

TCP prevents a fast sender from overwhelming a slow receiver using a receive window advertised by the receiver.

The problem

A 10 Gbps server and a phone on slow mobile data have wildly different processing speeds. Without flow control, the server would fill the phone's buffer until packets drop — then TCP retransmits everything anyway, wasting bandwidth. Flow control avoids this entirely.

Adjust the window — watch what gets blocked
4
12
Sent & ACKed
In-flight (window)
Blocked
Zero window probe: if the receiver's buffer fills completely, it sends window=0. The sender stops and periodically probes to check if the window has reopened. This prevents deadlock.
Transport · 5 of 7

TCP flags

Single-bit flags in the TCP header tell the receiver what kind of segment this is. They're the vocabulary TCP uses to signal state.

Why flags?

TCP needs to signal many things — open a connection, acknowledge data, close gracefully, abort. Packing these into individual bits in the header means all this signalling adds zero overhead to data segments. The bits are always there anyway.

6 core flags — click any to expand
SYN
Synchronise
Opens connections. Carries the Initial Sequence Number.
ACK
Acknowledge
Confirms receipt. ACK number = next expected byte.
FIN
Finish
Signals no more data from this sender. Half-close.
RST
Reset
Immediately aborts the connection. No graceful close.
PSH
Push
Deliver buffered data to application immediately.
URG
Urgent
Data should jump the queue. Rarely used today.
SYN → open request (handshake step 1)
SYN+ACK → open accepted (step 2)
ACK → data delivery confirmation
PSH+ACK → deliver to app now
FIN+ACK → graceful close
RST+ACK → abrupt reset
Transport · 6 of 7

Connection teardown

Closing a TCP connection takes 4 steps. Each side must independently signal it's done sending.

Why 4 steps and not 2?

TCP is full-duplex — both sides send independently. A FIN from one side is a half-close: "I'm done sending, but I can still receive." The other side might still have data to send. The connection only fully closes when both sides have FIN'd and both FINs are acknowledged.

Step through the teardown

ESTABLISHED

Both sides communicating normally.

1

Client → FIN

Client done sending. Enters FIN_WAIT_1. Server can still send data.

2

Server → ACK

Acknowledges FIN. Client enters FIN_WAIT_2 and waits. Server finishes its remaining data.

3

Server → FIN

Server done sending. Enters LAST_ACK. Both sides now want to close.

4

Client → ACK — CLOSED

Client sends final ACK. Waits in TIME_WAIT (2×MSL) before fully closing port.

0 / 4
TIME_WAIT serves two purposes: (1) if the final ACK is lost, the client must still be alive to retransmit it; (2) old delayed packets from this connection must expire before a new connection reuses the same port pair.
Transport · 7 of 7

UDP & TCP comparison

UDP makes the opposite trade-off to TCP: no connection, no guarantees, maximum speed. Choose based on what failure looks like for your use case.

The core trade-off

Reliability costs time. Every ACK, retransmit, and handshake adds latency. For a video call, a 200ms delayed packet is worse than a dropped one — the moment is gone. For a file download, a single missing byte is catastrophic. The right protocol depends entirely on whether silence (no ACK) is worse than delay.

TCP
Transmission Control Protocol
Connection3-way handshake
ReliabilityGuaranteed + ordered
SpeedSlower (overhead)
Header20–60 bytes
Flow ctrlYes (rwnd)
HTTP/HTTPS, email, SSH
File transfer, databases
UDP
User Datagram Protocol
ConnectionNone
ReliabilityNo guarantees
SpeedFaster
Header8 bytes
Flow ctrlNone
Video calls, streaming, gaming
DNS, DHCP, NTP
QUIC (HTTP/3) implements reliability on top of UDP — getting UDP's speed plus per-stream loss recovery, without TCP's head-of-line blocking. It's the future of web transport.
App protocols · 1 of 4

DNS — Domain Name System

DNS translates human-readable names into IP addresses. It runs before every other protocol — every web request, email, and API call starts with a DNS lookup.

Why DNS?

Computers communicate using IPs (like 93.184.216.34) but humans remember names (like example.com). DNS is the translation layer. It also enables load balancing, failover, CDN routing, and email authentication — it's far more than just a lookup table.

What happens when you type a URL — step through
0

You type example.com

Browser checks its own DNS cache first. If found and not expired, done — no network trip needed.

1

OS cache & hosts file

OS checks its DNS cache, then /etc/hosts. Still nothing → asks the Recursive Resolver.

2

Recursive resolver

Your ISP's (or 8.8.8.8's) resolver does the hard work on your behalf. It checks its own cache first.

3

Root nameserver

"Who handles .com?" 13 root server clusters worldwide. Returns address of the .com TLD nameserver.

4

TLD nameserver

"Who handles example.com?" Returns the authoritative nameserver for that specific domain.

5

Authoritative nameserver

Returns the actual IP: 93.184.216.34. Resolver caches this result (TTL), sends it back to you.

6

Browser connects

TCP handshake → TLS → HTTP request. The whole DNS lookup took ~20ms and is now cached.

0 / 6
Key DNS record types
Record Purpose Example
A Hostname → IPv4 address example.com → 93.184.216.34
AAAA Hostname → IPv6 address example.com → 2606:2800:...
MX Mail server for domain @ → mail.example.com
CNAME Alias for another hostname www → example.com
TXT Arbitrary text (SPF, DKIM, verification) v=spf1 include:...
NS Authoritative nameservers for domain ns1.example.com
App protocols · 2 of 4

HTTP & HTTPS

HTTP is the language browsers and servers use to exchange web content. HTTPS is HTTP with TLS encryption wrapped around it.

Why a dedicated protocol for the web?

TCP delivers bytes reliably, but doesn't define what those bytes mean. HTTP defines the format and vocabulary: how to request a resource, how to describe the response, how to pass metadata. Without HTTP, every browser would need a custom agreement with every web server.

Request / response anatomy
GET /index.html HTTP/1.1 ← method + path + version
Host: example.com ← which server (virtual hosting)
Accept: text/html ← what formats I accept
Connection: keep-alive ← reuse TCP connection

── server responds ──

HTTP/1.1 200 OK
Content-Type: text/html
Content-Length: 1234

<html>...</html> ← the actual page body
Status code ranges
Range Meaning Common examples
1xx Informational 100 Continue
2xx Success 200 OK, 201 Created, 204 No Content
3xx Redirect 301 Moved Permanently, 302 Found
4xx Client error 400 Bad Request, 401 Unauthorized, 404 Not Found
5xx Server error 500 Internal Server Error, 503 Unavailable
1️⃣

HTTP/1.1

One request at a time per connection. Keep-alive added connection reuse. Still widely supported.

2️⃣

HTTP/2

Multiplexing — multiple requests over one TCP connection simultaneously. Binary protocol, header compression.

3️⃣

HTTP/3

Runs over QUIC (UDP-based). Eliminates TCP head-of-line blocking. Faster connection setup.

🔒

HTTPS / TLS

HTTP + TLS layer. Encrypts everything after the TCP handshake. TLS handshake happens before the first HTTP byte.

App protocols · 3 of 4

Email protocols

Email uses three protocols because sending and receiving are fundamentally different operations — each needs its own design.

Why three protocols?

Sending (SMTP) is a push operation to a server that may be temporarily unavailable. Retrieval (IMAP/POP3) is a pull operation that needs to manage folder state. IMAP and POP3 have entirely different philosophies: where mail lives and whether multiple devices should stay in sync.

📤

SMTP (25 / 587)

Sending. Port 587 = authenticated submission (your client → your server). Port 25 = server-to-server relay. STARTTLS encrypts the connection.

📥

IMAP (143 / 993)

Receiving. Mail stays on the server. Multiple devices see identical folder and read/unread state. Port 993 = IMAP over TLS. The modern standard.

💾

POP3 (110 / 995)

Receiving. Downloads mail to your device and deletes from server. Offline-first, single-device model. Port 995 = POP3 over TLS.

🔐

SPF / DKIM / DMARC

Authentication. DNS-based records that prove mail genuinely came from the domain it claims. Stop spoofing and improve deliverability.

Journey: sender → recipient

Your client → SMTP:587 → your mail server (MUA→MTA)
Your server → SMTP:25 → recipient's mail server (MTA→MTA)
stored in recipient mailbox
Recipient → IMAP:993 → downloads / syncs to client
App protocols · 4 of 4

DHCP

DHCP automatically assigns IP addresses, subnet masks, gateways, and DNS servers to devices when they join a network.

Why automatic assignment?

Before DHCP, every device required a manually configured IP, subnet mask, gateway, and DNS server. In a company with thousands of machines — or a café with daily visitors — that doesn't scale. DHCP makes joining a network a zero-configuration experience.

The DORA process — 4 steps to get an IP
📢

D — Discover

New device broadcasts to 255.255.255.255: "Is there a DHCP server? I need an IP." Has no IP yet, so must broadcast.

🎁

O — Offer

DHCP server responds with an offer: "You can have 192.168.1.42 for 24 hours." Multiple servers may reply.

R — Request

Device broadcasts: "I'd like the offer from server X." Broadcasting notifies all servers which offer was accepted.

A — Acknowledge

Server confirms: "192.168.1.42 is yours for 24 hours. Gateway: 192.168.1.1. DNS: 8.8.8.8." Done.

Why UDP? The device doesn't have an IP address yet when it first connects — so TCP's connection establishment is impossible. DHCP uses UDP (ports 67/68), sending from 0.0.0.0 to 255.255.255.255 as a broadcast.
Infrastructure · 1 of 4

Routing & routers

Routers forward IP packets between networks. They read the destination IP, consult a routing table, and forward the packet one hop closer to its destination.

Why routers?

Switches connect devices on the same network. Routers connect different networks together — including your home network to the internet. Every time a packet crosses from one IP subnet to another, it passes through a router. The internet is, at its core, a massive mesh of routers sharing routing information.

📋

Routing table

Every router has a table of known networks and the interface/next-hop to use. The most specific matching route wins — longest prefix match.

Default gateway

The catch-all route: 0.0.0.0/0. "If no specific route matches, send it here." Your home router is the default gateway for your devices.

📡

Dynamic routing

Protocols like OSPF and BGP let routers share route information automatically and adapt to failures. BGP holds the internet together.

🔢

TTL countdown

Each router decrements IP TTL by 1. At 0, the packet is dropped and an ICMP Time Exceeded is sent back. Traceroute exploits this deliberately.

Destination: 192.168.1.55

Routing table:
0.0.0.0/0 → WAN (default, least specific)
192.168.0.0/16 → LAN interface
192.168.1.0/24 → eth1 ← wins (most specific)

Longest prefix (most specific) match always wins.
Infrastructure · 2 of 4

Switching & VLANs

Switches connect devices on the same network at Layer 2 using MAC addresses. VLANs create logical network segments on the same physical hardware.

Switch vs hub

A hub broadcasts every frame to every port — everyone sees everything. A switch learns which MAC address lives on which port (MAC address table) and forwards frames only to the correct port. This dramatically reduces unnecessary traffic and gives you basic isolation between devices.

📚

MAC address table

Switch learns by observing source MACs on each port. Known destinations → forwarded directly. Unknown destinations → flooded to all ports.

🌊

Flooding

Unknown MAC or broadcast frames are copied to every port except the incoming one. This is how ARP requests propagate across a LAN.

🏷

VLANs

Virtual LANs segment a physical switch into isolated logical networks. VLAN 10 and VLAN 20 can't communicate directly — even on the same switch. Routing is required to cross VLANs.

🔗

Trunk ports

Carries traffic for multiple VLANs between switches. Frames are tagged with an 802.1Q header indicating their VLAN membership.

Why VLANs? Security and performance. Finance and HR devices on the same switch shouldn't be able to see each other's traffic. VLANs enforce that without needing separate physical infrastructure.
Infrastructure · 3 of 4

NAT & PAT

Network Address Translation lets many private IP addresses share one public IP. Without it, IPv4 would have run out even sooner.

The IPv4 shortage workaround

IPv4 has ~4 billion addresses. There are ~15 billion internet-connected devices. NAT bridges this gap: your home router presents one public IP to the internet while your 10 devices use private addresses internally. The router tracks which internal device made each request and maps responses back correctly.

🔄

Static NAT

Maps one private IP to one public IP, 1:1. Used for servers that need a consistent, predictable public address.

🔀

PAT (overload)

Many private IPs share one public IP, distinguished by port numbers. What your home router does. Also called NAT overload or masquerade.

📋

NAT table

Router tracks: private IP:port ↔ public IP:port mappings. Inbound responses are matched and forwarded to the correct internal host.

⚠️

Limitations

Breaks end-to-end connectivity — external hosts can't initiate connections to NATted devices. Port forwarding works around this. IPv6 eliminates the need entirely.

PAT — multiple hosts, one public IP

192.168.1.10:54321 → google.com:443
192.168.1.11:54322 → google.com:443
Both appear to Google as:
203.0.113.1:54321 → google.com:443
203.0.113.1:54322 → google.com:443
Router maps responses back to the right internal IP
Infrastructure · 4 of 4

Firewalls & network security

Firewalls filter traffic based on rules. Understanding them means understanding the layers they operate at and what they can and cannot see.

Why firewalls?

Every open port is a potential entry point. Firewalls enforce a policy: which traffic is allowed, from where, to where, on which ports. Without them, any internet device could attempt connections to your services. They're the primary tool for enforcing network boundaries.

📋

Packet filter (L3/L4)

Inspects IP headers and TCP/UDP ports. Fast but simple — allows/blocks based on source IP, destination IP, and port number alone.

🔗

Stateful firewall

Tracks connection state. Knows a response packet belongs to an established connection. Blocks unsolicited inbound even if it looks like a valid response.

🔍

Application (L7) firewall

Inspects application-layer content — HTTP headers, DNS queries, TLS certs. Can block specific URLs, detect SQL injection, enforce policies.

🛡

IDS / IPS

Intrusion Detection/Prevention Systems watch for attack patterns. IDS alerts; IPS actively blocks. Uses signature matching and anomaly detection.

Defence in depth: no single control is sufficient. Layer a stateful firewall + application inspection + IDS/IPS + network segmentation (VLANs) + endpoint security. Each layer catches what others miss.
Reference

Protocol reference

Every major TCP/IP protocol — sorted by layer, with ports and transport.

Application layer
Protocol Port(s) Transport Purpose
HTTP 80 TCP Web pages (unencrypted)
HTTPS 443 TCP Web pages (TLS encrypted)
DNS 53 UDP / TCP Name resolution
SMTP 25, 587 TCP Send email
IMAP 143, 993 TCP Retrieve email (server-side sync)
POP3 110, 995 TCP Retrieve email (download & delete)
SSH 22 TCP Encrypted remote shell access
FTP 20, 21 TCP File transfer (unencrypted)
SFTP 22 TCP Encrypted file transfer (via SSH)
DHCP 67, 68 UDP Automatic IP address assignment
NTP 123 UDP Network time synchronisation
SNMP 161, 162 UDP Network device monitoring & management
RDP 3389 TCP Remote desktop (Windows)
LDAP 389, 636 TCP Directory services (Active Directory)
Transport & network layer
Protocol Layer Purpose
TCP Transport (4) Reliable, ordered, connection-oriented delivery
UDP Transport (4) Fast, connectionless, best-effort delivery
IP Network (3) Logical addressing and routing across networks
ICMP Network (3) Error messages and diagnostics (ping, traceroute)
ARP Link / Network Resolve IP address → MAC address on a LAN
OSPF Network (3) Dynamic interior routing (within an org)
BGP Application / Network Internet inter-domain routing — the backbone protocol
IPSec Network (3) Encryption and authentication at the IP layer (VPNs)
Port number ranges: 0–1023 = Well-known (assigned by IANA, require root) · 1024–49151 = Registered (common apps) · 49152–65535 = Dynamic/ephemeral (client-side, auto-assigned by OS).
Test yourself

Final quiz

12 questions across all five modules. Each one tests the purpose behind the concept, not just the name.