Topic 3 · Networks
Computer Science · Cheatsheet

Topic 3 · Networks

Chapter 2 · Protocols & layers

📋 Reference · always available
Protocol
Agreed RULES for communication. Specifies format + order + error handling.
Packet
Data fragment + header (src+dst addr, sequence) + footer (error-check).
Packet switching
Messages split into packets, each routed independently, reassembled by sequence.
Circuit switching
Dedicated line per call (old telephone). Wasteful + fragile compared to packet switching.
TCP
Reliable, ordered, slower. 3-way handshake (SYN/SYN-ACK/ACK). For web, email, files.
UDP
Fast, no guarantees. For video/voice/gaming/DNS — anywhere freshness beats reliability.
Common app protocols
HTTP (80) · HTTPS (443) · DNS (53) · FTP (21) · SMTP (25) · SSH (22).
OSI 7 layers
Physical · Data Link · Network · Transport · Session · Presentation · Application. (Please Do Not Throw Sausage Pizza Away.)
TCP/IP 4 layers
Link · Internet · Transport · Application. What the real Internet uses.
Encapsulation
Each layer wraps in own header (and sometimes footer). Reversed on receive.
Address scopes
MAC = same LAN. IP = whole Internet. Port = which app on the device.
Router vs Switch layer
Router = L3 (Network/IP). Switch = L2 (Data Link/MAC).