DML School of Technology
Menu

Open to everyone Reading, lesson 33 of 100, 2 min read

Network basics for defenders

Just enough networking

To defend a network you need a picture of how data moves. This lesson is a quick refresher; the Networking Foundations course goes much deeper.

Addresses and ports

  • An IP address identifies a device on a network, like 192.168.1.20 (IPv4) or 2001:db8::20 (IPv6).
  • A port identifies a service on that device. The pair address plus port is like a building and a flat number.

Ports you should know:

PortService
22SSH (secure remote command line)
25SMTP (sending email between servers)
53DNS (turning names into addresses)
80HTTP (web, not encrypted)
443HTTPS (web, encrypted)
3306MySQL and MariaDB databases
3389Remote Desktop (Windows)

TCP and UDP

  • TCP sets up a connection with a three-step handshake (SYN, SYN-ACK, ACK) and makes sure data arrives complete and in order. Web, email and SSH use TCP.
  • UDP just sends packets with no handshake. It is faster and used by DNS lookups, voice and video calls, and games.

Private and public addresses

Home and office networks use private ranges that are not reachable directly from the internet:

10.0.0.0/8      172.16.0.0/12      192.168.0.0/16

A router uses NAT (network address translation) to let many private devices share one public address. NAT hides internal addresses but is not a firewall by itself.

Layers

Network functions are described in layers. The ones security people mention most: the physical layer (cables, radio), the data link layer (MAC addresses, switches), the network layer (IP addresses, routers), the transport layer (TCP and UDP ports) and the application layer (HTTP, DNS, email).

Tip

When someone says a firewall works "at layer 4", they mean it looks at addresses and ports. A web application firewall works "at layer 7", reading the HTTP requests themselves.