TCP/IP Explained: The Language of the Internet
TCP/IP is the set of rules that lets devices find each other and exchange data on the internet. Knowing its layers makes troubleshooting much easier.
The four layers
| Layer | Job | Examples |
|---|---|---|
| Application | Programs talking to each other | HTTP, HTTPS, DNS, SMTP, FTP |
| Transport | Reliable or fast delivery between programs | TCP, UDP |
| Internet | Addressing and routing between networks | IP, ICMP |
| Network access | Sending bits over the local link | Ethernet, Wi-Fi |
TCP versus UDP
TCP sets up a connection with a three-way handshake (SYN, SYN-ACK, ACK), numbers the data and resends anything that is lost. It suits web pages, email and file transfer. UDP sends data without a handshake or resend, which is faster and suits live video, voice calls and games, where a late packet is no use.Common port numbers
A port identifies the service on a device:
| Port | Protocol | Use |
|---|---|---|
| 22 | TCP | SSH (secure remote login) |
| 25 | TCP | SMTP (sending email) |
| 53 | UDP/TCP | DNS lookups |
| 80 | TCP | HTTP websites |
| 443 | TCP | HTTPS secure websites |
| 3389 | TCP | Remote Desktop |
What happens when you open a website
Your device uses DNS to find the site's IP address, opens a TCP connection to port 443, negotiates encryption, sends an HTTPS request and receives the page in packets that are reassembled in order. If your address came from the router, DHCP supplied it.
Troubleshooting commands on Windows
ping 8.8.8.8 test basic connectivity to an IP address
ping example.com test DNS plus connectivity
tracert example.com show the route and where delays happen
nslookup example.com check DNS resolution
netstat -an list connections and listening portsIf pinging an address works but pinging a name fails, the problem is DNS. See what to do when Windows shows no internet.
Frequently asked questions
Is TCP/IP the same as the OSI model?
They are different models. TCP/IP has four layers and describes the internet in practice; OSI has seven and is mainly used for teaching.
Why do some tools use UDP?
UDP avoids the delay of retransmission, which is better for real-time audio and video.
What is an IP address?
A number that identifies a device on a network, such as 192.168.1.10. See how to find yours.