Вы находитесь на странице: 1из 2

Determining IP Ranges and Subnet Mask from CIDR Notations

Classless Inter-Domain Routing (CIDR) allocates address space on any bit boundary, instead of on 8-bit segments as
in Classful addressing. The following example demonstrates how to determine possible networks, IP ranges and
subnet mask from a CIDR Notation.
Considering the following CIDR notation value: 193.56.132.0/26
we may determine the following
Subnet Mask
A CIDR notation is constructed from an IP address and a prefix size equivalent to the number of leading 1 bits
in the subnet mask. Considering the CIDR notation above, the number of bits in the mask is 26. This can then
be represented as:
11111111.11111111.11111111.11000000
If we convert this number to Decimal, we get the following subnet mask: 255.255.255.192

Possible Subnetworks
From above, the IP: 193.56.132.0 Mask: 255.255.255.192
In binary this is:
11000001.00111000.10000100.00000000 (IP)
11111111.11111111.11111111.11000000 (Subnet Mask)
and since this is a class C address, only the last 8 bits are used to create sub networks (subnets) AND host
IPs. The Subnet Mask assigns two bits (highlighted in blue) to be used for the subnets while the remaining 6
(highlighted in green) can be used then for the hosts (as a host ID).
The number of possible networks can be calculated using 2^n where n is the number of bits. Hence, we can
have 2^2 = 4 possible networks as follows:
11000001.00111000.10000100.00000000 (193.56.132.0)
11000001.00111000.10000100.01000000 (193.56.132.64)
11000001.00111000.10000100.10000000 (193.56.132.128)
11000001.00111000.10000100.11000000 (193.56.132.192)
Now, the first and last subnets are special. The first one is reffered to as subnet zero (because all its assigned
bits are zeros) while the last one is an example of all-ones subnet (all its bits are ones). Traditionally, these
two special subnets are excluded because they are not supported by legacy network devices. As such, usable
networks will be
193.56.132.0
193.56.132.64
193.56.132.128
193.56.132.192
which changes the formula to calculate the number of possible subnets to: 2^n-2. Unless, you are dealing with
a modern network which would ideally support these two types of subnets.
IP Ranges and usable IPs
For each usable subnet we have 6 bits reserved for the hosts. Hence, the number of all possible IPs is
2^6 = 64 IP address.
We can determine the range of IP addresses as well. The first IP address of the first usable subnet
(193.56.132.64) will simply have the all hosts bits as zeros while the last IP will have all the hosts bits as ones.
Hence, the rage of all IPs will be
11000001.00111000.10000100.01000000 (193.56.132.64)
11000001.00111000.10000100.01000001 (193.56.132.65)
11000001.00111000.10000100.01000010 (193.56.132.66)
.
.
11000001.00111000.10000100.01111110 (193.56.132.126)
11000001.00111000.10000100.01111111 (193.56.132.127)
That is 193.56.132.64 to 193.56.132.127. However, while this is the range of all possible IPs which is equal to
2^6 = 64. The number of USABLE IPs always excludes the first IP (Host ID all zeros) because it represents the
network itself and last IP (Host ID all ones) because it will be used as the broadcast IP for that subnet.
As such, range of usable IPs for subnet 193.56.132.64/26 is 193.56.132.65 to 193.56.132.126.
Similarly, range of usable IPs for the second usable subnet 193.56.132.128/26 is 193.56.132.129 to
193.56.132.190.

Вам также может понравиться