Goal. You can explain how TCP/IP, DNS, HTTP, TLS, proxies and firewalls fit together, follow a web request from end to end, and read basic network traffic.
Why it matters#
Almost every attack crosses a network: the phishing link, the download, the remote control channel, the stolen data. If you cannot tell a DNS lookup from a file transfer, or an inbound connection from an outbound one, network evidence is noise to you.
What you will learn#
Layers#
Networking is built in layers, each doing one job and relying on the one below.
| Layer | Job | Examples | An address or unit |
|---|---|---|---|
| Link | Move frames on the local network | Ethernet, Wi-Fi | MAC address |
| Internet | Move packets between networks | IP, ICMP | IP address |
| Transport | Deliver data between programs | TCP, UDP | Port number |
| Application | Do something useful | DNS, HTTP, SMTP, SSH | Names, URLs |
You may also meet the seven-layer OSI model. "Layer 7" means the application layer in that numbering.
IP addresses and subnets#
An IPv4 address is four numbers from 0 to 255, such as 192.0.2.15. IPv6 addresses are longer and
written in hexadecimal. A subnet is a block of addresses, written in CIDR form: 192.0.2.0/24 means
the first 24 bits are fixed, giving 256 addresses.
Some ranges are private and used inside organisations: 10.0.0.0/8, 172.16.0.0/12 and
192.168.0.0/16. They are not routed on the internet. A router doing NAT (network address translation)
lets many private machines share one public address, which is why a public address in a log may stand for
hundreds of people. A default gateway is the router a machine sends traffic to when the destination is
not local. DHCP hands out addresses automatically, so the same address may belong to different machines
on different days. Keep DHCP logs if you want to know which.
TCP, UDP and ports#
A port is a number that picks the program on a machine. TCP sets up a connection with a three-step handshake (SYN, SYN-ACK, ACK), numbers the data and resends what is lost. UDP just sends, with no connection, which suits short questions and live media.
A connection is described by five values: source IP, source port, destination IP, destination port and protocol. The client usually picks a high, temporary source port, and the server listens on a known one.
| Port | Service | Why defenders care |
|---|---|---|
| 22 | SSH | Remote administration, brute force |
| 25, 587 | SMTP | Mail, and abuse of it |
| 53 | DNS | Used by nearly everything, including malware |
| 80, 443 | HTTP, HTTPS | Most traffic, so a good place to hide |
| 88 | Kerberos | Windows domain sign-in |
| 389, 636 | LDAP, LDAPS | Directory queries |
| 445 | SMB | Windows file sharing and lateral movement |
| 3389 | RDP | Remote Desktop, a common way in |
A port number is a convention, not a guarantee. Anything can listen anywhere.
DNS#
DNS turns names into addresses. Your machine asks a resolver, which asks other servers on your
behalf and caches the answer for a set time (the TTL). Common record types: A (IPv4), AAAA (IPv6),
CNAME (alias), MX (mail server), TXT (free text) and NS (name servers).
For defence, DNS is a diary of where machines wanted to go. Watch for newly registered or random-looking domains, many failed lookups, and unusually long query names, which can carry hidden data.
HTTP and TLS#
HTTP is a request and a response. A request has a method (GET fetches, POST sends), a path,
headers (such as Host and User-Agent) and sometimes a body. The response has a status code:
2xx success, 3xx redirect, 4xx your error, 5xx server error.
TLS wraps the connection so others cannot read or change it, and uses a certificate to show the server holds the right key for the name. HTTPS is HTTP inside TLS. The padlock does not mean the site is honest: criminals get valid certificates too. Without decryption, a defender usually still sees addresses, ports, timing, volume and often the server name (the SNI field), but not the path or content.
Firewalls, proxies and other devices#
- A firewall allows or denies connections by rules. Inbound rules limit what can reach you; outbound (egress) rules limit what compromised machines can reach.
- A web proxy fetches pages on a user's behalf, so it can log the full URL and block categories.
- A VPN is an encrypted tunnel into a network.
- A load balancer or reverse proxy sits in front of servers. Logs behind it may show its address, not the visitor's, unless it passes it on in a header.
- An IDS/IPS inspects traffic for known bad patterns and alerts on or blocks them.
- Segmentation splits a network so a compromise in one part cannot freely reach the rest.
Following one request#
You type https://www.example.com/report:
- The machine asks DNS for the address of
www.example.com. - It opens a TCP connection to that address on port 443 (or uses QUIC, a UDP-based alternative many sites offer).
- TLS is negotiated and the certificate checked.
- An HTTP
GET /reportis sent inside the encrypted channel. - The server answers with a status code and content.
Each step can leave a record: DNS log, firewall connection log, proxy log, web server log.
Reading traffic#
A packet capture records the traffic itself; flow records record only who talked to whom, when and how much. Wireshark reads captures. Useful starting filters:
dns
tcp.flags.syn == 1 && tcp.flags.ack == 0
http.request
ip.addr == 192.0.2.15Commands worth knowing: ipconfig /all (Windows) or ip addr (Linux) for your addresses, nslookup or
dig for DNS, netstat -ano or ss -tunap for current connections and the process behind each, and
curl -v to watch a web request.
Do this#
- Map your own machine (45 minutes). Record your IP address, subnet, gateway and DNS server. List the current connections and identify three of the processes that own them.
- Look up names (30 minutes). Query the
A,MXandTXTrecords of a few well-known domains. Note the TTLs and what the TXT records are for. - Capture a web visit (1–2 hours). On your own machine, start Wireshark, visit
http://example.com/and thenhttps://example.com/, and stop. Find the DNS query, the TCP handshake and the difference in what you can read. - Analyse a public capture (2 hours). Work through a beginner exercise from Wireshark's sample captures and write down who talked to whom and why you think so. Capture only traffic you are allowed to see.
Resources#
Free first
- Cloudflare Learning Center: DNS - a clear, short explanation of lookups.
- MDN: an overview of HTTP - requests, responses and headers.
- Wireshark User's Guide - the official manual.
- Wireshark sample captures - captures to practise on.
- RFC 1918 - the standard that defines the private ranges; short.
- Practical Networking - patient, diagram-led lessons on how packets move.
Paid or needs an account
- None needed for this stage.
Checkpoint#
You are ready to move on when you can:
Go deeper (optional)#
- Learn how email authentication (SPF, DKIM and DMARC) uses DNS; it matters for phishing.
- Read about Zeek, which turns traffic into structured logs: Zeek documentation.