Lesson 1 of 7
Binary and the Dotted Quad
An IPv4 address is 32 bits written as four decimal numbers. Subnetting is easy once you can see the bits behind each number, so we start there.
Training is free for members. We are checking whether you are signed in; if you are not, we will take you to sign in and bring you straight back here. Nothing happening? Register or sign in with a code we email you.
Eight Bits, Eight Place Values
Each of the four numbers in an address is an octet: eight bits, so a value from 0 to 255. Reading left to right, the bits are worth:
| 128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 |
|---|
A 1 means "count this value", a 0 means "skip it". Add the ones up and you have the number.
Worked Example: 172
Take the largest value that fits and carry on with what is left. 172 is 128 + 32 + 8 + 4, so those positions are 1 and the rest are 0:
172 = 10101100
Going the other way, add the place values under each 1. 10101100 gives 128 + 32 + 8 + 4 = 172.
The Nine Numbers a Mask Octet Can Be
A subnet mask is a run of 1s followed by a run of 0s, so each octet of a mask can only take nine values. Learn them and half of subnetting is recognition:
| Decimal | Binary | Network Bits in the Octet |
|---|---|---|
| 0 |
00000000
|
0 |
| 128 |
10000000
|
1 |
| 192 |
11000000
|
2 |
| 224 |
11100000
|
3 |
| 240 |
11110000
|
4 |
| 248 |
11111000
|
5 |
| 252 |
11111100
|
6 |
| 254 |
11111110
|
7 |
| 255 |
11111111
|
8 |
Practice
5 questions, new each time. Every answer is worked out by the same library as our subnet calculator, so if one looks wrong, check your working first and then tell us.