Lesson 2.6: IPv4 addresses, binary and the subnet mask
What an IPv4 address really is (32 bits written as four decimal numbers), how to read binary, how the subnet mask splits an address into a network part and a host part, the network and broadcast addresses, and how a host decides whether to deliver directly or hand a packet to the router. In the lab you take your own address apart with ipcalc and check which addresses are on your network and which are not.
19 min
You will learn to
- Read and write 8-bit binary numbers
- Explain the network and host parts of an IPv4 address
- Convert a subnet mask to CIDR notation
- Find the network address, broadcast address and number of hosts
- Decide whether an address is on the local network
Key terms
- IPv4 address
- A 32-bit number that identifies a network interface, written as four decimal numbers from 0 to 255 separated by dots.
- Binary
- Numbers written with only 0 and 1. Each position is worth twice the one to its right: 128, 64, 32, 16, 8, 4, 2, 1.
- Octet
- One group of 8 bits; an IPv4 address has four. Each can be 0 to 255.
- Network part and host part
- The left bits of an address name the network, the right bits name one host on it.
- Subnet mask
- Marks which bits are the network part: ones for network bits, zeros for host bits. Written dotted (255.255.255.0) or as a prefix length (/24).
- Network and broadcast address
- The first address of a network (all host bits 0) names the network itself; the last (all host bits 1) reaches every host on it. Neither can be given to a device.
← Command line arguments and options · All lessons · Threat actors and their motives →