Understanding networking is crucial for modern developers. Learn the basics of how the internet works.
The OSI Model
7 layers of networking:
- Physical: Cables, signals
- Data Link: MAC addresses
- Network: IP addresses, routing
- Transport: TCP/UDP
- Session: Connection management
- Presentation: Data formatting
- Application: HTTP, FTP, SMTP
TCP/IP Protocol
TCP (Transmission Control Protocol)
- Reliable delivery
- Ordered packets
- Error checking
IP (Internet Protocol)
HTTP Methods
GET - Retrieve data
POST - Create data
PUT - Update data
DELETE - Remove data
HTTP Status Codes
- 200: OK
- 201: Created
- 400: Bad Request
- 401: Unauthorized
- 404: Not Found
- 500: Server Error
DNS (Domain Name System)
Translates domain names to IP addresses:
google.com → 142.250.190.46
Practical Commands
bashping google.com # Test connectivity
traceroute google.com # Trace route
nslookup google.com # DNS lookup
curl https://api.example.com # HTTP request
Security
- HTTPS encrypts data
- Firewalls filter traffic
- VPNs protect privacy