Advanced · 15 lessons
Networking
Computer networking connects servers, clients, and services across the internet. Understanding TCP/IP, ports, routing, firewalls, and DNS is essential for hosting engineers, sysadmins, and anyone troubleshooting connectivity issues.
Key Concepts
Key Takeaways
- ✓ HTTP uses port 80, HTTPS uses 443, SSH uses 22, MySQL uses 3306.
- ✓ Firewalls control which ports and IPs can connect to your server.
- ✓ Private IPs (10.x, 192.168.x) are used inside data centers; public IPs face the internet.
- ✓ Latency matters — place servers close to your users or use a CDN.
Lessons in This Topic
TCP/IP & the OSI Model
How data travels across networks.
OSI has 7 layers; TCP/IP simplifies to 4: Link, Internet (IP), Transport (TCP/UDP), Application (HTTP/DNS). TCP guarantees delivery with handshakes; UDP is faster but unreliable. IP addresses route packets; MAC addresses work locally.
Ports, Protocols & Services
Which port does what service use.
Port 80=HTTP, 443=HTTPS, 22=SSH, 21=FTP, 25=SMTP, 53=DNS, 3306=MySQL, 5432=PostgreSQL, 6379=Redis, 27017=MongoDB. Only one service per port per IP. Use `netstat -tlnp` or `ss -tlnp` to see listening ports. Close unused ports in firewall.
Firewalls & Access Control
ufw, iptables, and security groups.
Firewalls filter traffic by IP, port, and protocol. Default deny: block everything, allow only needed ports. AWS security groups and cloud firewalls work similarly. Allow SSH only from your IP, not 0.0.0.0/0. Log dropped packets for analysis.
NAT, Private IPs & VPCs
How internal networks connect to the internet.
Private IP ranges (10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16) are not routable on the public internet. NAT translates private IPs to public IP for outbound traffic. VPCs isolate cloud resources with custom subnets and routing tables.
CDN & Network Performance
Reduce latency with edge delivery.
CDN caches content at 200+ global edge locations. Users connect to nearest edge, not distant origin. Reduces latency from 500ms to 50ms. Also provides DDoS protection and SSL termination. Purge cache when deploying updates.
