Visual lab
Learn subnetting visually
11 short lessons, from binary to IPv6. Change the inputs and watch every value update.
Lesson 1 of 11Beginner
Binary basics
Why binary?
An IPv4 address is 32 bits, written as four 8-bit octets in decimal, like 192.168.1.10. Subnetting is deciding which of those bits name the network and which name the host, so it helps to read one octet in binary first.Flip the bits
An octet is 8 bits. Each bit has a place value. Add up the place values of the bits that are on.
128 + 32 + 4 =164
Binary 10100100 is decimal 164. The largest octet is 11111111 = 255, which is why IPv4 numbers stop at 255.
Decimal to binary: the subtraction method
Walk the place values from 128 down. If the value fits, write 1 and subtract it. If not, write 0.
- 128172 ≥ 128, so 172 − 128 = 441
- 6444 < 64, skip0
- 3244 ≥ 32, so 44 − 32 = 121
- 1612 < 16, skip0
- 812 ≥ 8, so 12 − 8 = 41
- 44 ≥ 4, so 4 − 4 = 01
- 20 < 2, skip0
- 10 < 1, skip0
Result10101100
The 8 mask values
A subnet mask fills bits from the left. Each new bit adds the next place value, so only eight numbers can ever appear in a mask octet.
| Bits on | Binary | Built from | Value |
|---|---|---|---|
| 1 | 10000000 | 128 | 128 |
| 2 | 11000000 | 128 + 64 | 192 |
| 3 | 11100000 | 192 + 32 | 224 |
| 4 | 11110000 | 224 + 16 | 240 |
| 5 | 11111000 | 240 + 8 | 248 |
| 6 | 11111100 | 248 + 4 | 252 |
| 7 | 11111110 | 252 + 2 | 254 |
| 8 | 11111111 | 254 + 1 | 255 |
Memorize this row
128 192 224 240 248 252 254 255. If a mask octet is any other number, the mask is not valid.Try it
Three quick conversions. Nothing is saved; this is just a self-check.
Lock it in
Drill the “Binary and decimal” skill until it is automatic.
Lesson 1 of 11
Next: The 7 attributes