OSI layers 7→1: All People Seem To Need Data Processing
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: reliable, ordered, error-checked. UDP: 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 → 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.
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 vs HTTPS: HTTPS = HTTP + TLS 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 (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.