💻 Computer Science · Networking

Networking tricks that make the OSI model stick

OSI model, TCP/IP, protocols, and subnetting — memorized.

🌐 Networking

Memory tricks

Proven mnemonics — fast to learn, hard to forget.

OSI Model
OSI (Open Systems Interconnection) model layers 7 to 1: All People Seem To Need Data Processing (A=Application, P=Presentation, S=Session, T=Transport, N=Network, D=Data Link, P=Physical)
OSI Model
Seven layers of the OSI networking model
7-Application (HTTP, DNS), 6-Presentation (encryption), 5-Session, 4-Transport (TCP/UDP), 3-Network (IP), 2-Data Link (MAC), 1-Physical (cables). Mnemonic top to bottom: All People Seem To Need Data Processing.
7
Application — HTTP, FTP, DNS
6
Presentation — encryption, compression
5
Session — connections
4
Transport — TCP/UDP, ports
3
Network — IP addressing
2
Data Link — MAC, switches
1
Physical — cables, signals
TCP vs UDP
TCP (Transmission Control Protocol): reliable, ordered, error-checked. UDP (User Datagram Protocol): fast, no guarantees.
TCP vs UDP
The two main transport-layer protocols — reliable vs fast
TCP: connection-oriented, guaranteed delivery and order — web, email, file transfer. UDP: connectionless, no guarantee, lower latency — video streaming, gaming, DNS.
DNS
DNS (Domain Name System): domain name to IP address — the internet's phone book
DNS
Domain Name System converts human-readable names to IP addresses
You type google.com → DNS resolver queries root → TLD → authoritative server → returns IP. Cached at multiple levels. Without DNS you'd memorize IP addresses.
IP Address Classes
IP classes: A (1-126 huge networks), B (128-191), C (192-223 small networks)
IP Address Classes
Class A, B, and C ranges and their uses
Class A: 1–126, up to 16M hosts (large orgs). Class B: 128–191, up to 65K hosts. Class C: 192–223, up to 254 hosts (small networks). 127.0.0.1 = localhost.
HTTP Methods
HTTP methods: GET (read), POST (create), PUT (update/replace), DELETE (delete) — REST basics
HTTP Methods
The four core HTTP verbs behind every REST API
GET: retrieve resource (safe, idempotent). POST: create new resource (not idempotent). PUT: update/replace resource (idempotent). DELETE: remove resource. PATCH: partial update. Memorize these for any web development or API work.
IPv4 vs IPv6
IP addressing: IPv4 = 32 bits (4.3 billion addresses). IPv6 = 128 bits (340 undecillion addresses).
IPv4 vs IPv6
Why we're running out of IP addresses — and the solution
IPv4: 32-bit addresses like 192.168.1.1 — only ~4.3 billion unique addresses. Running out since 1990s. NAT (Network Address Translation): multiple devices share one public IP. IPv6: 128-bit addresses like 2001:0db8:85a3::8a2e:0370:7334 — essentially unlimited. Adoption slow due to compatibility issues.
Subnetting
Subnetting: divide network into smaller networks. Subnet mask determines network vs host portion.
Subnetting
Dividing IP address space into smaller networks
Subnet mask: 255.255.255.0 = /24 means first 24 bits are network, last 8 bits are hosts (254 usable hosts). CIDR notation: 192.168.1.0/24. Subnetting: divide large network into smaller ones for security and efficiency. Calculate: network address, broadcast address, host range.
Firewalls
Firewall: filters network traffic based on rules. Stateful: tracks connection state. Stateless: each packet independent.
Firewalls
Network security devices that control traffic based on rules
Packet filtering: check source/destination IP and port against rules. Stateful inspection: tracks active connections — knows if packet is part of established session. Application layer: inspect content (Layer 7). DMZ (demilitarized zone): semi-trusted network between internet and internal network.
HTTP vs HTTPS
HTTP (HyperText Transfer Protocol) vs HTTPS: HTTPS = HTTP + TLS (Transport Layer Security) encryption. Port 80 vs 443. Certificate verifies server identity.
HTTP vs HTTPS
How web encryption works
HTTP: plaintext — anyone between you and server can read traffic. HTTPS: HTTP + TLS (Transport Layer Security). TLS handshake: client and server negotiate encryption, server presents certificate (signed by trusted CA), establish symmetric session key. Certificate: verifies server is who it claims to be. Always use HTTPS.
Latency vs Bandwidth
Latency vs bandwidth: latency = delay (milliseconds). Bandwidth = capacity (Mbps). Latency limits interactive apps.
Latency vs Bandwidth
Two different measures of network performance
Latency (RTT - round trip time): time for a packet to travel to destination and back. Affected by: physical distance, number of hops, congestion. Low latency critical for: gaming, video calls, trading. Bandwidth: maximum data transfer rate. Throughput: actual achieved rate. High bandwidth doesn't help if latency is high.
Content Delivery Networks
CDN (Content Delivery Network) — serve content from servers geographically close to users
Content Delivery Networks
How large websites serve content quickly worldwide
CDN: distributed network of servers that cache static content (images, CSS, JS, video) geographically near users. Request goes to nearest CDN edge server instead of origin server. Reduces latency, reduces load on origin, improves availability. Cloudflare, Akamai, AWS CloudFront. Used by Netflix, YouTube, Amazon.
SSH and Remote Access
SSH (Secure Shell) — encrypted remote access. Port 22. Public/private key authentication safer than passwords.
SSH and Remote Access
How developers securely connect to remote servers
SSH: encrypted protocol for remote command-line access. Replaced Telnet (plaintext). Key-based authentication: generate public/private key pair. Public key placed on server. Private key stays on client. More secure than passwords — can't be brute-forced if key is long enough. Port forwarding: tunnel other protocols through SSH.
Mnemonic
What it means
00📚 0 left

No saved cards yet — click ☆ Save on any memory trick.

🎓 Common Exam Questions
Q: Name all 7 OSI layers and their functions.
A: Mnemonic 7 to 1: All People Seem To Need Data Processing. Layer 7 Application: HTTP, HTTPS, FTP, SMTP, DNS. Layer 6 Presentation: formatting, encryption, compression. Layer 5 Session: establishes and manages sessions. Layer 4 Transport: TCP and UDP, port numbers. Layer 3 Network: IP addresses, routing. Layer 2 Data Link: MAC addresses, Ethernet, Wi-Fi. Layer 1 Physical: actual bits over wire or radio. TCP/IP model simplifies to 4 layers: Application, Transport, Internet, Network Access.
Q: Compare TCP and UDP — when is each appropriate?
A: TCP (Transmission Control Protocol): 3-way handshake, reliable with acknowledgments and retransmission, ordered, flow control, about 20 byte header. Use for web, email, file transfer, SSH — where data integrity matters. UDP (User Datagram Protocol): connectionless, no guarantees, no ordering, 8 byte header. Use for DNS, video streaming, gaming, VoIP — where speed matters more than reliability. Applications can implement their own reliability on top of UDP as QUIC does for HTTP/3.
Q: How does DNS resolution work step by step?
A: DNS (Domain Name System) resolution for google.com: browser checks local cache, queries OS resolver, sends to recursive resolver (ISP or 8.8.8.8), recursive resolver queries root nameserver getting .com TLD server address, queries .com TLD nameserver getting google.com authoritative server address, queries authoritative nameserver getting IP address, caches result per TTL and returns to browser. Full lookup about 100ms. Cached lookup near-instant. DNSSEC adds cryptographic signatures to prevent spoofing.
Q: What is HTTPS and how does the TLS handshake work?
A: HTTPS equals HTTP over TLS (Transport Layer Security). TLS handshake: client sends supported versions and cipher suites, server sends certificate signed by Certificate Authority, client verifies certificate, client generates session key and encrypts it with server public key, both now have symmetric session key for fast data encryption. Asymmetric encryption solves key distribution; symmetric handles bulk data. TLS 1.3 simplified and further secured this process.
Q: What is SSH and how does public key authentication work?
A: SSH (Secure Shell) provides encrypted remote access on port 22, replacing unencrypted Telnet. Public key authentication: user generates key pair — private key stays on client, public key placed on server in authorized_keys. Server sends challenge encrypted with public key. Only the private key can decrypt it, proving identity without private key ever leaving the client. Connection then uses symmetric encryption. SSH also enables SCP and SFTP file transfer, port forwarding, and X11 forwarding.
Live group chat — up to 8 students per room