# Forums

Finding the range o...

# Finding the range of a subnet (@benpiper)
Joined: 6 years ago
Posts: 2
03/08/2019 1:00 pm
Just a quick walkthrough. Take 10.10.10.0/23 for example.

Each octet is 8 bits.

The /23 CIDR means the 23 leftmost bits in the subnet mask are 1, so:

`Binary: 11111111 11111111 11111110 00000000Decimal: 8       + 8      + 7     + 0      = 23`

That's the subnet mask. Now you need to convert the subnet itself into binary, like so:
`Binary:  00001010 00001010 00001010 00000000Decimal: 10       10       10       0`

Next you need to line up the subnet mask and the subnet, like this:
`Subnet mask: 11111111 11111111 11111110 00000000Subnet:      00001010 00001010 00001010 00000000             10       10       10       0`
Now here's how you determine the subnet range. To find the low end, for every bit where the subnet mask is 0, make the subnet 0. That's what's already written above, hence, 10.10.10.0 is the lowest address in the subnet.

To find the highest address, for every bit where the subnet mask is 0, make the subnet bit 1:

`Subnet mask:     11111111 11111111 11111110 00000000Highest address: 00001010 00001010 00001011 11111111                 10       10       11       255`

So the highest address would be 10.10.11.255.

Hence the range for 10.10.10.0/23 is 10.10.10.0-10.10.11.255.
This topic was modified 7 months ago 3 times by Ben Piper (@benpiper)
Joined: 6 years ago
Posts: 2
03/08/2019 1:28 pm

Another example: Find the range of 216.16.11.103/27

Start by writing out the subnet mask in binary:

`11111111 11111111 11111111 111000008       +8       +8        +3      = 27`

Now write the IP address out in binary

`216      16       11       10311011000 00010000 00001011 01100111`

`Subnet mask: 11111111 11111111 11111111 11100000IP address:  11011000 00010000 00001011 01100111`

To find the lowest (network) address, wherever the subnet mask bit is 0, set the IP address bit to 0:

`Subnet mask: 11111111 11111111 11111111 11100000IP address:  11011000 00010000 00001011 01100000`

`Subnet mask: 11111111 11111111 11111111 11100000IP address:  11011000 00010000 00001011 01111111`