For example, the IP address 11000000.10101000.01110100.11010010 (192.168.116.210) when combined with a subnet mask of 11111111. 11111111. 11111111.00000000 (255.255.255.0) yields a 24-bit network address 192.168.116.0, the remaining 8-bit portion is used for host addresses. In this case, 192.168.116.1 – 254 can be used as host addresses. Similarly, if a subnet mask shows that 16 bits are used for the network portion of an IP address then the remaining 16 bits can be used as host portion.

Subnet masks were also used to clump IP addresses into three distinct classes, each of which provided different-sized blocks of network addresses for organizations to use on their internal networks. The only real difference between these network classes was the number of bits used in the subnet mask to identify the network portion of the addresses, which in turn dictated the number of hosts that could be used on that network. Shown below are the three classes A, B, and C with their default masks, also known as natural masks.

Class Network Portion Host Portion Mask
Class A 11111111 00000000 00000000 00000000 255.0.0.0
Class B 11111111 11111111 00000000 00000000 255.255.0.0
Class C 11111111 11111111 11111111 00000000 255.255.255.0

Classless Inter-Domain Routing (CIDR) introduced in 1993 replaced the prior addressing architecture of classful network design on the Internet. The motive behind was to slow down the rapid growth of routing tables on routers on the Internet and to slow the exhaustion of IPv4 address space. CIDR replaced the classful addressing scheme with a flexible and less wasteful scheme and also provided enhanced route summarization.

Classless Inter-Domain Routing is based on variable-length subnet masking (VLSM) which allows a network to be divided into different-sized subnets. This allows for efficient use of subnets and avoids wasting IP addresses.

CIDR specifies an IP address range using a combination of an IP address and its associated network mask. CIDR notation uses the following format

xxx.xxx.xxx.xxx/p

where p is the number of (leftmost) ‘1’ bits in the mask. For example,

192.168.116.0/24

applies a mask of 255.255.255.0 to the network 192.168.116.0

Since computers understand IP addresses and mask in terms of 32-bit binary numbers it is very important that we understand the process of conversion between an IP address or mask into the binary equivalent and vice versa. As discussed previously IP addresses and masks are 32-bit binary numbers which are represented in the dotted-decimal format with four numbers (each number in the range o 0 – 255) separated by periods, such as 192.168.116.210. These four numbers in an IP address are called an Octet with each octet being equal to 8 bits. Thus the IP address when written in binary is 32-bits separated by dots into 4 groups of 8-bits.

When converting from decimal to binary each decimal number presents 8 bits. So when converting the IP address 192.168.116.210 into the number 192 will be equal to 11000000. In the steps below we will learn to convert an IP address into binary.

Step 1 – Subtract 128 from the first decimal number in the IP address. If subtraction is not possible or answer is a negative number write a zero, if it possible write a one and keep track of the remainder of the subtraction.

Step 2 – Perform the same procedure using the remainder from Step 1, but use 64 instead of 128. Write the zero or one to the right of the zero or one you wrote in Step 1.

Step 3 – Repeat Step 2 using 32, 16, 8, 4, 2 and 1 each in place of 64, and write the ones or zeros in accordance with the results. You will get an eight-bit binary number.

Step 4 – Do Steps 1 through 3 with the other three IP address numbers, in order, until you have a 32-bit representation of the address.

So we apply the steps mentioned above on the IP address 192.168.116.210. First, we pick the number 192.

We subtract 128 from 192 which is 192 – 128 = 64 , subtraction is possible so we write 1 which is our left most binary digit.

We then subtract 64 from 64 (our remainder in the previous step) and we have 64 – 64 = 0, we write 1.

Now we will substract 0 from 32 which 0 – 32 = – 32, we will write 0.

Now we will subtract 16 from which will again be a negative and the following steps which involve subtracting 8 , 4, 2 and 1 from 0 will all result in negative numbers so we write 0 for all of them.

So the decimal number 192 when converted to binary will be 11000000.

We will repeat the whole process for the next number which is 168. Subtracting 128 from 168 results in 40 so we write a 1 then we subtract 64 from 40 which results in -24 so we write a 0, then we subtract 32 from 40 which results in 8 so we write a 1, then we subtract 16 from 8 which results in -8 so we write a 0, then we subtract an 8 from 8 which results in a 0 so we write a 1, then we subtract 4 from 0, 2 from 0 and 1 from 0 which all result in negative so we write three 000. The resulting binary of 168 will be 10101000

We then apply the process to 116 and 210 and finally The IP address 192.168.116.210 when converted to binary will be 11000000.10101000.01110100.11010010.

We can also convert an IP address in a binary format to decimal. For example, to convert 11000000.10101000.01110100.11010010 to decimal we will use the table below

1st bit 2nd bit 3rd bit 4th bit 5th bit 6th bit 7th bit 8th bit
128 64 32 16 8 4 2 1

Out first octet 11000000 can be converted to a decimal by picking the bits which are 1 and adding the corresponding decimal values shown in the table above. So 11000000 will be 128 + 64 = 192.

Similarly the second octet 10101000 will be 128 + 32 + 8 = 168, third octet 01110100 will be 64 + 32 +16 +4 = 116 and the finally the fourth octet 11010010 will be 128 + 64 + 16 + 2 = 210.

This results in the IP address 192.168.116.210.

This brings us to the end of this article in which we learn the architecture of IP addresses and also explained the purpose of a subnet mask. We also covered a very important tutorial on binary to decimal conversion and vice versa. It is very important to have firm concepts as these are the base for the entire upcoming CCNA lessons.