← All lessons
Foundations · Beginner · 6 min
Networking basics
IP addresses, ports, DNS: the map every attacker and defender uses.
What it is
Every device on a network has an IP address, its street address. Ports are the doors on that address: web traffic uses 443 (HTTPS), remote shells use 22 (SSH), Windows remote desktop uses 3389. DNS is the internet's phone book, turning names like example.com into IPs. TCP sets up a reliable conversation with a three-way handshake (SYN, SYN-ACK, ACK); UDP just fires packets off. Firewalls decide which doors stay open.
See it: How a request leaves your network and comes back
- Your PC → Switch: Frame for the router. Your PC knows the site is on another network, so it sends the traffic to its default gateway, the router.
- Switch → Router: Forwarded to the right port. The switch delivers the frame only to the port the router is on.
- Router → Website: Routed onto the internet. The router swaps your private IP for its public one (NAT) and sends the packet towards the website's IP, found with DNS. Stopped by: A firewall here decides which traffic may pass.
- Website → Your PC: Reply comes back. The website answers to the router's public IP, and the router hands it back to your PC.
Step through the animated diagram in the app.
Real case · Ongoing
Exposed RDP
Remote Desktop (port 3389) left open to the internet with weak passwords is one of ransomware gangs' favourite ways in. Sophos found RDP abused in 90% of the attacks it investigated in 2023.
Source: Sophos: RDP abused in 90% of attacks (2024)
How defenders stop it
- Close every port you don't need
- Put remote access behind a VPN or zero-trust gateway with MFA
- Segment networks
- Monitor DNS. Malware has to phone home somehow.
Check yourself
1. Which port does HTTPS use by default?
- 22
- 53
- 443
- 3389
Show answer
443. 22 is SSH, 53 is DNS, 3389 is RDP.
2. What does DNS do?
- Blocks malware
- Encrypts web traffic
- Turns names like example.com into IP addresses
- Assigns MAC addresses
Show answer
Turns names like example.com into IP addresses. DNS is the internet's phone book: your device asks it for the IP address behind a name.
3. What are the three steps of a TCP handshake?
- HELLO, KEY, DONE
- DISCOVER, OFFER, ACK
- SYN, SYN-ACK, ACK
- GET, POST, PUT
Show answer
SYN, SYN-ACK, ACK. TCP opens a reliable conversation with SYN, SYN-ACK, ACK. (Discover, Offer, Request, Acknowledge is DHCP.)
Answer them in the app to earn XP.
Next: Wi-Fi & wireless security →