Networking guide

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

LayerJobExamples
ApplicationPrograms talking to each otherHTTP, HTTPS, DNS, SMTP, FTP
TransportReliable or fast delivery between programsTCP, UDP
InternetAddressing and routing between networksIP, ICMP
Network accessSending bits over the local linkEthernet, 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:

PortProtocolUse
22TCPSSH (secure remote login)
25TCPSMTP (sending email)
53UDP/TCPDNS lookups
80TCPHTTP websites
443TCPHTTPS secure websites
3389TCPRemote 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 ports

If 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.

← Back to Networking