Sicher in 15 min.
CCNA (engl.)
Access Lists
Become Partner!

What is a Subnetmask?

When we write a Subnetmask in binary, we will see - no matter, which Subnetmask we use - that there are allways some "ones" followed by "zeros". For example

11111111.11111111.11111111.11100000 =

11111111.11111111.00000000.00000000 =

The number of the used "zeros" is a indicator, how many hosts can take place in that subnet, means how many IP-addresses are useable in that subnet for host-PCs.

If we take a look at the example network

We have here ONE network, with 254 useable IPs for Client-PCs.

If we write down the Subnetmask in binary, we will see why.

The Number 255 is in binary

11111111 = 128+64+32+16+8+4+2+1 = 255

The whole Subnetmask in the example is in binary


If we calculate all the 8 zeros as powers of 2, we will come to the result.


But - from this 256 IPs we must take one IP for the Broadcast-IP, and one for the Network-IP. So there are 254 IPs left, useable for Host-PCs in that Network.

This rule is also known as Formula


The IP Range of this network is

 First IP

 Last IP

So we can give PCs in that network IPs like  Host PC 1  Host PC 2  Host PC 3

and so on, till the end of the network is reached with


If we want to divide this network in two parts, we need two things: a router and some switches - and of cause someone, who can calculate subnets.

With Subnetmask we would divide the network in two parts. - -

The Subnetmask defines how big the subnet is. That means - how many Client-PCs will have place in that subnetwork.

A Subnetmask of means in binary


So, what do we see?

4 Blocks, divided with a ".". Each of these blocks is also called "octett". Because - each Block has 8 bits.

To be able to do subnet-calculation, we first must understand binary calculation.

Lets take a deeper view at the first octett.


The first "1" stands for a 128.

The second "1" stands for a 64.

The third "1" stands for a 32.

The fourth "1" stands for a 16.

The fifth "1" stands for a 8.

And so on. That means:




If we see something like "/24", that means that 24 bits are set to "1", from the left side.


/16 = = 11111111.11111111.00000000.00000000

/20 = = 11111111.11111111.11110000


Calculation of Subnetmask big enough for a specified number of Hosts

Question: "How to create a subnet with minimum 10 host IPs"

1. Step

calculate a power of two, that is minimum 10

2^3=8. That is not enough
2^4=16 That is higher than 10. Good.

2. Step

Now put the LAST 4 Bits of your subnetmask to 0.


That is in decimal

With THIS Subnetmask, you have minimum 10 Host-Ips for each Subnet, without wasting to much IP-Addresses.

Other example

"Create a subnet with minimum 70 Host-IPs"

1. Step

Calculate a Power of 2 that is MINIMUM 70

2^6=64. Not enough.
2^7=128. Thats higher than 70. Good.

2. Step

Put the LAST 7 Bits of your Subnetmask to 0.


That is in decimal

You have a Subnet, with more than 70 Host-IPs.

Calculation what is the Broadcast-IP of a Subnet

"There is subnet What is the BROADCAST ADDRESS of that Subnet?"

1. Step

/20 meens

2. Step

Now analyze the Subnet Oktett to find out the "network-jumps" or "increments".

240 means 11110000

The LAST of the 1s is under decimal 16. That are our "network jumps"

3. Step

Write down the network-jumps -
+16 -
+16 -
+16 -

Because the NEXT Subnet in the example is, the broadcast must be, cause THAT is the IP BEFORE the next Subnet starts = the BroadcastAddress.


Other example of Broadcast-IP calculation:

If it would be /26

Same procedure

/26 means

192 is binary 11000000
The LAST 1 stands under the 64.

That are in that example our "net-jumps". - <<<in this example THIS is the broadcastaddress of first subnet - -

Calculating first and last possible IP for a Host

Question: "You have Network /27
The very first IP is reserved for Default Gateway!
What is the first and last valid IP for a Host-PC?"


/27 is


224 means 11100000

The LAST 1 is under the 32. That are our "network-jumps" in this example

Valid IPs in that subnet: - is NOT useable, this is the very last IP and so the BROADCAST-IP. is the network-IP of the NEXT Subnet!

So, because the very first IP is reserved for Default Gateway, our first Host-PC IP would be
The very last Host-PC IP would be



duno-netze.de | info<at>duno-netze.de