Networking Protocols
TCP vs UDP deep understanding
- TCP guarantees ordered delivery via sequence numbers, ACKs, retransmits.
- TCP congestion control adapts send rate based on loss/latency; affects throughput.
- UDP is “send and hope”; apps implement reliability if needed (or accept loss).
- Choosing between them is about latency tolerance, ordering needs, and network conditions.
ICMP
- Used for control/error messages (e.g., destination unreachable, TTL exceeded).
- Tools:
ping (echo request/reply), traceroute (TTL exceeded along path).
- ICMP may be rate-limited or blocked, so failures aren’t always definitive.
SSH, FTP, SFTP
- SSH: secure remote shell + tunneling (typically TCP 22).
- FTP: legacy file transfer; multiple channels; tricky with NAT/firewalls.
- SFTP: file transfer over SSH (different protocol than FTPS).
WebSocket basics
- Upgrades an HTTP connection to a long-lived, bidirectional channel.
- Good for real-time updates; needs heartbeat/ping and reconnect logic.