How machines actually find and talk to each other — from a single packet's journey to subnets, ports and the attacks that target them. Read the theory, then use the live calculators and references below.
A network is just devices connected so they can exchange data. Each device (a host) splits its data into small packets and hands them off to be relayed, hop by hop, until they reach the destination — like posting thousands of tiny numbered postcards that get reassembled at the other end.
Connects devices within one local network (a LAN) and forwards frames by MAC address. Think: the wiring inside your house.
Connects different networks together and decides where packets go next by IP address. Your home router joins your LAN to the internet (a WAN).
A small chunk of data wrapped in headers (who it's from, who it's for, what kind). Big transfers are thousands of packets, reassembled in order.
An agreed set of rules so two machines understand each other — HTTP, TCP, IP, DNS. The OSI model (below) stacks them into layers.
Every device needs identities at two levels. A MAC address is burned into the network card (e.g. 02:42:0a:00:00:05) and identifies it on the local link. An IP address is assigned by the network and is used to route between networks. ARP is the protocol that maps "I know the IP, what's the MAC?" on a LAN.
| Type | Example | Range / note |
|---|---|---|
| IPv4 | 192.168.1.50 | 32 bits, ~4.3 billion addresses — now exhausted |
| IPv6 | 2001:db8::7334 | 128 bits, effectively unlimited |
| Private (LAN) | 10.x · 172.16–31.x · 192.168.x | Not routable on the internet; reused everywhere behind NAT |
| Loopback | 127.0.0.1 | "localhost" — this machine |
| MAC | 02:42:0a:00:00:05 | 48 bits; first half identifies the vendor (OUI) |
What happens when you type https://example.com and hit enter:
Connection-oriented. Guarantees every byte arrives, in order, with retransmission. Used for web, email, file transfer, SSH. Slower setup, rock-solid delivery.
Connectionless. Fire-and-forget, no guarantees, no handshake. Used for DNS, video calls, games, streaming — where speed beats perfection.
Before TCP sends data it sets up a connection with a 3-way handshake. Watch it:
An IP address has two parts: the network (which network you're on) and the host (which device). The subnet mask / CIDR prefix draws the line between them.
A /24 means the first 24 bits are the network, leaving 8 bits for hosts → 2⁸ = 256 addresses, minus the network address and broadcast address = 254 usable hosts. Smaller prefixes = bigger networks; larger prefixes = smaller. The network address is the first (all host-bits 0); the broadcast is the last (all host-bits 1) and reaches every host at once.
Translates human names (example.com) into IP addresses. Hierarchical: root → .com → example.com. Poisoning or spoofing it sends victims to attacker servers.
When you join a network, DHCP hands your device an IP, subnet mask, gateway and DNS server automatically. A rogue DHCP server can hijack clients.
Your router rewrites private LAN addresses to its one public IP and back. It's why dozens of home devices share a single internet address (and gives a little inbound protection).
| Attack | What it does | Defense |
|---|---|---|
| Sniffing | Reading traffic on the wire (easy on open Wi-Fi / hubs) | Encryption (TLS, VPN) |
| ARP spoofing / MITM | Faking ARP replies to sit between victim and gateway | Dynamic ARP inspection, static ARP, encryption |
| DNS spoofing | Forging DNS answers to redirect victims | DNSSEC, DoH/DoT |
| Port scanning | Probing which ports/services are open (recon) | Firewalls, rate-limiting, IDS |
| (D)DoS | Flooding a target so it can't serve real users | Filtering, rate limits, scrubbing services |
A small kit covers most networking work. Learn these and you can see, map and test almost any network:
The packet analyzer — capture and dissect every frame on the wire. Must-know. CLI sibling: tshark.
The network scanner — host discovery, port scanning, service & OS detection. Must-know. GUI: Zenmap.
Lightweight CLI packet capture — perfect on servers with no GUI.
The "TCP/IP swiss-army knife" — manual connections, listeners, quick transfers and banner grabbing.
Query DNS by hand — resolve names, inspect records, debug resolution.
Test reachability & latency, map the hops to a host, and measure real throughput.
Now the hands-on part — a live subnet calculator, the OSI/TCP-IP models, a searchable port table and a CIDR chart.
| Port | Service | Protocol | Description |
|---|