Skip to content
HACKME

Level 3 · 3C Networks · Lesson 1 of 3

How data travels: IP, ports and DNS

2 min read · Free · From scratch

Everything you do on the internet travels in packets: little pieces of data with a source address and a destination address. Those addresses are IP addresses. So you don't have to remember numbers, DNS works like a phone book: it turns tienda-pampa.com into the server's IP.

Ports: each service's door

A single computer can run many services at once, and each one listens on a port, a number from 0 to 65535. The most common: 80 for the unencrypted web (HTTP), 443 for the encrypted web (HTTPS), 22 to log in to a server securely (SSH) and 53 for DNS. If the IP is the building's address, the port is the apartment number.

tienda-pampa.com  →  DNS  →  203.0.113.20
https://tienda-pampa.com  =  203.0.113.20 port 443
What this code does:
  • DNS turns the name into the server's IP.
  • With https the browser goes to that IP on port 443, the encrypted web's port.

Private and public IPs

At home, each device has a private IP (like 192.168.0.10) that only means something inside your network. Toward the internet, they all go out through your router's public IP. Private ones start with 10., with 192.168. or with 172.16. to 172.31.; the rest are public.

Going deeper

TCP and UDP

TCP is like a phone call: the connection is set up, each packet is confirmed and anything lost is sent again (the web, email and SSH use it). UDP is like sending postcards: fast and unconfirmed (video calls, online games and many DNS queries use it).

Review questions

What does DNS do?

Answer: It turns a name (like tienda-pampa.com) into an IP address. DNS is the internet's phone book: it turns names into IP addresses.

Which port does the encrypted web (HTTPS) normally use?

Answer: 443. 443 is HTTPS; 80 is unencrypted HTTP and 22 is SSH.

Which of these IPs is private?

Answer: 192.168.1.20. Addresses starting with 192.168. belong to private networks, like your home one.