Differences between current version and predecessor to the previous major change of SubnetAddressing.
Other diffs: Previous Revision, Previous Author, or view the Annotated Edit History
Newer page: | version 5 | Last edited on Thursday, February 23, 2006 12:14:03 pm | by DanielLawson | |
Older page: | version 4 | Last edited on Tuesday, December 3, 2002 10:17:54 am | by CraigMckenna | Revert |
@@ -26,57 +26,62 @@
!Class A Address Example
A class A address could be diagramed:
+<verbatim>
Network Host
+------+ +----------------------+
| | | |
-[
[0xxxxxxx][
[xxxxxxxxxxxxxxxxxxxxxxxx]
-
+[0xxxxxxx][xxxxxxxxxxxxxxxxxxxxxxxx]
+</verbatim>
which shows the eight network bits followed by the 24 host bits.
These 32-bit IP addresses are almost always written as four dot-separated decimal numbers, one for each byte of the address. Thus, our class A address would have a range of address numbers from 1.0.0.0 through 126.0.0.0 ( 0. x.x.x and 127. x.x.x are reserved). The number of host addresses per network is 16,777,214, which is two less than two raised to the 24th power because both host numbers 0.0.0 and 255.255.255 are reserved.
In practice, people don't really attach 16 million hosts to a network so administrators of a Class A site often divide the host address portion into a (sub)network and host portion. (Subnetting is now supported by most operating systems.) Each Class A network number can support up to 65,534 subnets (network numbers 0.0 and 255.255 are reserved) with each having 254 hos ts (host numbers 0 and 255 are reserved). This is done by using the 16 high -order bits of the host portion for the subnet number and the lower eight bits for the host as diagramed here:
+<verbatim>
Network Subnet Host
+------+ +--------------+ +------+
| | | | | |
-[
[0xxxxxxx][
[xxxxxxxxxxxxxxxx][
[xxxxxxxx]
-
+[0xxxxxxx][xxxxxxxxxxxxxxxx][xxxxxxxx]
+</verbatim>
!Class B Addresses
The first two bits of a Class B address are 1 and 0, the next fourteen bits identify the network and the last sixteen the host, as diagramed:
+<verbatim>
Network Host
+--------------+ +--------------+
| | | |
-[
[10xxxxxxxxxxxxxx][
[xxxxxxxxxxxxxxxx]
-
+[10xxxxxxxxxxxxxx][xxxxxxxxxxxxxxxx]
+</verbatim>
Thus, Class B addresses include the network numbers in the range from 128.1.0.0 through 191.254.0.0 for a total of 65,534 host addresses.
As with the Class A address, we can divide the host portion of a Class B address into subnet and host parts. For instance, let's spli t our Class B network number on the byte boundary, that is, the eight MSBs of the host portion identifies the subnet and the remaining bits the host, as diagramed:
+<verbatim>
Network Subnet Host
+--------------+ +------+ +------+
| | | | | |
-[
[10xxxxxxxxxxxxxx][
[xxxxxxxx][
[xxxxxxxx]
-
+[10xxxxxxxxxxxxxx][xxxxxxxx][xxxxxxxx]
+</verbatim>
This arrangement allows 254 subnets each with 254 hosts.
Other Address Classes
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:
+<verbatim>
Network Host
+----------------------+ +------+
| | | |
-[
[110xxxxxxxxxxxxxxxxxxxxx][
[xxxxxxxx]
-
+[110xxxxxxxxxxxxxxxxxxxxx][xxxxxxxx]
+</verbatim>
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.
@@ -88,68 +93,73 @@
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:
+<verbatim>
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%%%
-
+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
+</verbatim>
Here we employ a mask that divides the host portion into a subnet and host that are each eight bits wide:
+<verbatim>
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%%%
-
+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
+</verbatim>
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:
+<verbatim>
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%%%
-
+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
+</verbatim>
!The subnet-host number tradeoff
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:
+<verbatim>
# 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%%%
-
+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
+</verbatim>
!Class C Subnetting:
+<verbatim>
# 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%%%
-
+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
+</verbatim>
!The Subnet Advantage
Subnetting hides the internal network organization to external routers and thus simplies routing. For instance, a subnetted Class B address would require fewer routes than the equivalent number of Class C addresses. Shorter routing tables mean faster network transfers.