Networking
🌐

AP Networking — Cheatsheet

Formulas, exam-day tips, and key terms on one page.

On the exam

How to get a 5

Key terms

OSI layers (1–7)Physical, Data Link, Network, Transport, Session, Presentation, Application. Mnemonic: Please Do Not Throw Sausage Pizza Away.
TCP/IP model layersLink, Internet, Transport, Application. Fewer layers than OSI and maps to what is actually implemented.
EncapsulationEach layer adds its own header to the payload from the layer above: transport header, then IP header, then link frame. The receiver strips them in reverse.
Which layer uses which addressLayer 2 uses MAC addresses (local segment, changes each hop). Layer 3 uses IP addresses (end to end, unchanged across hops).
Switch vs. routerA switch forward frames by MAC within one broadcast domain (layer 2). A router forward packets by IP between networks (layer 3) and separates broadcast domains.
Hub vs. switchA hub repeats every bit to every port — one collision domain. A switch learns MACs and forward only to the correct port.
Broadcast domainThe set of devices a broadcast reaches. Bounded by routers, and by VLANs on a switch. Oversized broadcast domains waste bandwidth on every host.
VLANLogically splits one physical switch into separate broadcast domains. Inter-VLAN traffic must cross a router, which is where access control can be enforced.
TCP vs. UDPTCP is connection-oriented, ordered, reliable, with flow and congestion control. UDP is connectionless and best-effort, with lower latency and less overhead.
TCP three-way handshakeSYN → SYN-ACK → ACK. Synchronizes initial sequence numbers in both directions and confirms both hosts are willing before data flows.
How TCP achieves reliabilitySequence numbers (ordering, duplicate detection), acknowledgements with retransmission on timeout, checksums (corruption), sliding window (flow control).
Head-of-line blockingTCP delivers strictly in order, so a lost segment stalls everything behind it. This is why real-time media prefers UDP — a late frame is useless anyway.
Port numbersIdentify the application endpoint within a host. Well-known: 22 SSH, 25 SMTP, 53 DNS, 80 HTTP, 443 HTTPS, 67/68 DHCP.
DHCPAutomatically assigns addressing to clients: IP address, subnet mask, default gateway and DNS servers. Without it every device is configured by hand.
DORADiscover, Offer, Request, Acknowledge — the four DHCP messages, in that order. The client broadcasts first because it has no address yet.
DNS resolution on a cache missResolver queries root → TLD server → authoritative server, then caches the answer for its TTL. Root servers delegate; they do not hold the record.
Reaching a site by IP but not by nameIsolates the fault to DNS. Connectivity, routing, and the server are all proven working by the successful IP test.
Default gatewayThe router address a host sends traffic to when the destination is not on its own subnet. Wrong or missing gateway is the classic "local works, internet does not" fault.
Subnet maskMarks which bits of an address are network and which are host. Tells a host whether a destination is local or must go via the gateway.
Usable hosts in a subnet2^(host bits) − 2. The all-zeros host address is the network ID and the all-ones is the broadcast address, so neither can be assigned.
/24, /26, /30 host counts/24 → 254 usable · /25 → 126 · /26 → 62 · /27 → 30 · /28 → 14 · /30 → 2 (the classic point-to-point link).
Longer prefix means whatFewer host bits, so fewer hosts per subnet but more subnets. The two trade directly against each other.
Private address ranges (RFC 1918)10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16. Not routable on the public internet; NAT translates them at the boundary.
NATRewrites private addresses to a public one at the boundary, letting many internal hosts share one public address. It also incidentally hides internal structure.