The first three bits of a Class C address are 1, 1, and 0, the next 21 bits
identify the network and the last eight the host, as diagramed:
Network Host
+----------------------+ +------+
| | | |
[110xxxxxxxxxxxxxxxxxxxxx][xxxxxxxx]
Thus, Class C addresses include the network numbers in the range
192.0.1.0 through 223.255.254.0 for a total of 254 host
addresses per network address.
Finally, we have Class D and Class E addresses. Class D address start at
224.0.0.0 and are used for multicast purposes. Class E addresses
start at 240.0.0.0 and are currently used only for experimental
purposes.
The Subnet Mask
A subnet mask (or number) is used to determine the number of bits used for
the subnet and host portions of the address. The mask is a 32-bit value that
uses one-bits for the network and subnet portions and zero-bits for the host
portion.
Let's look at an example. Here we have a Class B address of
191.70.55.130 and apply some different subnet masks. A logical AND
operation is performed between the IP address and the subnet mask as shown:
Here we use a mask that retains the default 16 network and host bits for a
Class B address:
191 70 55 130
1011 1111 1000 0110 0011 0111 1000 0010 IP address
1111 1111 1111 1111 0000 0000 0000 0000 Subnet mask
1011 1111 1000 0110 0000 0000 0000 0000 Result
Here we employ a mask that d ivides the host portion into a subnet and host
that are each eight bits wide:
191 70 55 130
1011 1111 1000 0110 0011 0111 1000 0010 IP address
1111 1111 1111 1111 1111 1111 0000 0000 Subnet mask
1011 1111 1000 0110 0011 0111 0000 0000 Result
This division allows 254 (256-2 reserved) subnets, each with 254 hosts.
This division on a byte boundary makes it easy to determine the subnet and
host from the dotted-decimal IP address. However, the subnet-host boundary can
be at any bit position in the host portion of the IP address. Here, we use a
mask that allows more subnets (512-2 reserved), but with the trade-off of fewer
hosts (128-2) per subnet:
191 70 55 130
1011 1111 1000 0110 0011 0111 1000 0010 IP address
1111 1111 1111 1111 1111 1111 1000 0000 Subnet mask
1011 1111 1000 0110 0011 0111 1000 0000 Result
The subnet-host number t radeoff
Here's a table that let's you see at a glance the trade off between the
number of subnets and hosts with different subnet masks for both Class B and
Class C addresses. We've already subtracted two from the results in the last two
columns to take the reserved network and host numbers into account:
Class B Subnetting:
# Mask Bits Subnet Mask # Subnets # Hosts
2 255.255.192.0 2 16382
3 255.255.224.0 6 8190
4 255.255.240.0 14 4094
5 255.255.248.0 30 2046
6 255.255.252.0 62 1022
7 255.255.254.0 126 510
8 255.255.255.0 254 254
9 255.255.255.128 510 126
10 255.255.255.192 1022 62
11 255.255.255.224 2046 30
12 255.255.255.240 4094
14
13 255.255.255.248 8190 6
14 255.255.255.252 16382 2
Class C Subnetting:
# Mask Bits Subnet Mask # Subnets # Hosts
2 255.255.255.192 2 62
3 255.255.255.224 6 30
4 255.255.255.240 14 14
5 255.255.255.248 30 6
6 255.255.255.252 62 2
|