Network Protocols
Protocols are the rules that govern how data is transmitted. Let's explore the most important ones through interactive visualizations.
TCP vs UDP
These are the two main transport protocols. They have very different approaches:
TCP vs UDP - Interactive Comparison
- Guarantees delivery
- Maintains order
- Error checking
- Higher latency
- No delivery guarantee
- No ordering
- Very fast
- Low overhead
When to Use Each?
The TCP 3-Way Handshake
Before TCP can send data, it establishes a connection using this handshake:
TCP 3-Way Handshake
No connection exists yet between client and server.
Why 3 steps? Both sides need to confirm they can send AND receive. The handshake ensures reliable two-way communication.
Port Numbers
Ports identify specific applications on a device. Think of IP as a building address and ports as apartment numbers.
Common Port Numbers
Port Ranges
- 0-1023: Well-known ports (reserved for standard services)
- 1024-49151: Registered ports (for specific applications)
- 49152-65535: Dynamic/private ports (temporary connections)
DNS: Domain Names to IP Addresses
When you type a URL, DNS translates it to an IP address your computer can use:
DNS Lookup Process
When you type a URL, your computer needs to find the server's IP address. Watch how the request bounces between servers!
DNS in Action
Try it yourself in the terminal:
nslookup google.com
# or
dig google.com
Other Important Protocols
DHCP (Dynamic Host Configuration Protocol)
Automatically assigns IP addresses to devices on your network.
The DHCP Process (DORA):
- Discover - Device broadcasts "I need an IP!"
- Offer - DHCP server offers an available IP
- Request - Device accepts the offer
- Acknowledge - Server confirms the assignment
ICMP (Internet Control Message Protocol)
Used for network diagnostics and error messages.
# Test if a host is reachable
ping google.com
# Trace the route to a destination
traceroute google.com # Mac/Linux
tracert google.com # Windows
SSH (Secure Shell)
Encrypted remote access to systems on port 22.
ssh [email protected]
Practice Tasks
DNS Practice: Open your terminal and run nslookup or dig on your favorite website. What IP address(es) do you get?
Port Quiz: Use the "Quiz Me!" button in the ports section above until you can correctly identify at least 5 common ports.
Ping Test: Ping google.com from your terminal. What's the average response time?
Summary
- TCP: Reliable, ordered delivery with connection handshake
- UDP: Fast, connectionless, accepts some packet loss
- Ports: Identify applications (80=HTTP, 443=HTTPS, 22=SSH)
- DNS: Translates domain names to IP addresses
- DHCP: Automatically assigns IP addresses
- ICMP: Network diagnostics (ping, traceroute)
Test Your Knowledge
Congratulations on completing Networking Basics! Move on to Advanced Networking for subnetting and routing protocols.