Subnet Examples
 |
| |
In
the following examples, determine if the address/subnet pair is legal. If it is
legal, determine the network number and the range of host addresses for that
network. Also determine for the mask, the number of available networks and
available hosts per network. |
| |
 |
| |
1. |
|
IP
address = 193.144.233.130 |
| |
 |
| |
|
Subnet mask 5 255.255.255.192 |
| |
 |
| |
|
|
For
a Class C address, we only need to look at the last octet of the address and the
mask. |
| |
 |
| |
|
130
= 1000 0010 |
| |
 |
| |
|
192
= 1100 0000 |
| |
 |
| |
|
|
This
is a legal pair because neither the subnet nor the host is all zeros or all
ones. |
| |
 |
| |
Network equals 193.144.233.128 because the mask selects the upper two
bits of the address (130) and the rest of the bits are set to zero to identify
the network. |
| |
 |
| |
Range of hosts = 193.144.233.129—193.144.233.190. |
| |
 |
| |
The
host portion (last six bits) can have values ranging from 000001 to 111110
(remember they can’t be all zeros or all ones). Add in the subnet portion, which
is the upper two bits of the address (in this case, 1 0), and you have 10 000001
to 10 111110 for the host addresses. |
| |
 |
| |
|
From
Table 2-6, the number of available networks is 2 and the number of hosts is
62. |
| |
 |
| |
2. |
|
IP
address = 156.26.30.60 |
| |
 |
| |
|
Subnet Mask = 255.255.255.0 |
| |
 |
| |
This
is relatively easy because the entire third octet is used for the subnet and the
entire fourth octet is used for the host. This is a legal pair because neither
the subnet nor the host is all zeros or all ones. |
| |
 |
| |
|
Network = 156.26.30.0 |
| |
 |
| |
|
Range of hosts = 156.26.30.1—156.26.30.254 |
| |
 |
| |
|
From
Table 2-5, the number of networks is 254 and the number of hosts is
254. |
| |
 |
| |
3. |
|
IP
address = 199.200.201.50 |
| |
 |
| |
|
Mask
= 255.255.255.128 |
| |
 |
| |
This
is illegal because the subnet mask only borrows 1 bit from the host and that bit
has to be either zero or one. |
| |
 |
| |
4. |
|
IP
address = 191.200.201.50 |
| |
 |
| |
|
Mask
= 255.255.255.128 |
| |
 |
| |
|
|
This
is a legal pair because the address is Class B and we are borrowing 9 bits from
the host portion. |
| |
 |
| |
|
Network = 191.200.201.0 |
| |
 |
| |
|
Range of hosts = 191.200.201.1—191.200.201.126 |
| |
 |
| |
|
|
From
Table
2-5, the number of networks is
510 and the number of hosts is 126. |
| |
 |
| |
Subnetting can be viewed as creating a three-part hierarchical
address. The network portion of the address can be found by applying the
standard subnet mask to the IP address (refer to Figure
2-3). The subnet is determined
from the bits “borrowed” from the host portion and the host number is simply
those bits that are left over. For an example, we will examine the Class B
address/mask pair |
| |
 |
| |
144.223.0.0/255.255.255.0 |
| |
 |
| |
and
determine the network number, the subnetwork numbers, and the range of host
numbers. The network number is found by applying the standard Class B 16-bit
subnet mask, which yields the network |
| |
 |
| |
144.223.0.0 |
| |
 |
|
The subnet is the entire third octet, so the 254 subnets
are |
| |
 |
| |
144.223.1.0 |
| |
 |
| |
and
the range of hosts for each subnet is 1 to 254. Now let’s try a bit more
complicated example. Consider the address/mask pair |
| |
 |
| |
144.223.0.0/255.255.255.224 |
| |
 |
| |
The
network number is still 144.223.0.0. The subnet mask borrows 11 bits from the
host portion of the address. The first 8 bits borrowed include the entire third
octet, which has a value of 0 to 255. The 3 bits borrowed from the third octet
have the values |
| |
 |
| |
Why
are the values 0 (all zeros) and 255 (all ones) for the third octet, and 0 (all
zeros) and 224 (all ones) from the fourth octet included? The third octet can be
0 if the 3 bits in the fourth octet are not zero. The third octet can also be
all ones if the 3 bits in the fourth octet are not all ones. The 3 bits in the
fourth octet can be all zeros if the third octet is not all zeros, and the 3
bits from the fourth octet can be all ones if the third octet is not all ones.
In other words, the 11 subnet bits cannot be all zeros or all ones. Therefore,
the range of subnet numbers is |
| |
 |
| |
144.223.0.32 |
| |
 |
| |
Determining the range of host addresses for each subnet requires more
effort. The bit pattern for the fourth octet of network 144.223.0.32
is |
| |
 |
| |
001 hhhhh |
| |
 |
| |
where hhhhh represents the host number, which cannot be all zeros or
all ones. Therefore, the first legal host number is 00001, making the fourth
octet |
| |
 |
| |
00100001 = 33 |
| |
 |
| |
so
the first host address is |
| |
 |
| |
144.223.0.33 |
| |
 |
| |
and
the last legal host bit pattern for the fourth octet is |
| |
 |
| |
00111110 = 62 |
| |
 |
| |
which gives the range of hosts’ addresses for the first subnet
as |
| |
 |
| |
144.223.0.33—144.223.0.62 |
| |
 |
| |
The
broadcast address for each subnet is found by setting all the bits in the host
portion to 1. The broadcast address for subnet 144.223.0.32 is determined by
setting the last 5 bits of the fourth octet to 1 yielding |
| |
 |
| |
00111111 = 63 |
| |
 |
| |
Putting it all together gives us the broadcast address |
| |
 |
| |
144.223.0.63 |
| |
 |
| |
5. |
|
Determine all the subnet numbers for the address/mask pair
193.128.55.0/255.255.255.240. Also determine the range of host addresses and the
broadcast address for the fourth subnet. |
| |
 |
| |
Network |
| |
 |
| Hosts |
| |
|
 |
| |
193.128.55.0 |
| |
 |
| 1—14
(If IP subnet-zero is used) |
| |
|
 |
| |
193.128.55.16 |
| |
 |
| 17—30 |
| |
|
 |
| |
193.128.55.32 |
| |
 |
| 33—46 |
| |
|
 |
| |
193.128.55.48 |
| |
 |
| 49—62, Broadcast address = 193.128.55.63 |
| |
|
 |
| |
193.128.55.64 |
| |
 |
| 65—78 |
| |
|
 |
| |
193.128.55.80 |
| |
 |
| 81—94 |
| |
|
 |
| |
193.128.55.96 |
| |
 |
| 97—110 |
| |
|
 |
| |
193.128.55.112 |
| |
 |
| 113—126 |
| |
|
 |
| |
193.128.55.128 |
| |
 |
| 129—142 |
| |
|
 |
| |
193.128.55.144 |
| |
 |
| 145—158 |
| |
|
 |
| |
193.128.55.160 |
| |
 |
| 161—174 |
| |
|
 |
| |
193.128.55.176 |
| |
 |
| 177—190 |
| |
|
 |
| |
193.128.55.192 |
| |
 |
| 193—206 |
| |
|
 |
| |
193.128.55.208 |
| |
 |
| 209—222 |
| |
|
 |
| |
193.128.55.224 |
| |
 |
| 225—238 |
| |
|
 |
| |
193.128.55.240 |
| |
 |
| 241—254 | |
218 times read
|
Related news
|
| No matching news for this article |
|
Did you enjoy this article?
    (total 2 votes)
|