TCP-IP Intro Subnetting
TCP-IP Intro Subnetting
September–October 2000
EXTENSION
Introduction to
Industrial Ethernet, Part 5.
INTRODUCTION TO SUBNETTING
How to maximize network addresses.
By George Thomas,
Contemporary Controls
1
class A address, the left most bit SUBNETTING mask. Only those bits that are set as
must be a zero. For a class B a 1 will be considered when
address, the first two bits must be a Subnetting creates additional defining a network address. In this
10. For a class C address, the first network IDs at the expense of host case, all the bits in the first byte of
three bits must be a 110. For a IDs and can be used with either A, the IP address will be considered.
class D address, the first four bits B or C class addresses. If you look The natural mask for a class B
must be a 1110. For a class E at figure 2, you will notice that a address is 255.255.0.0 and for a class
address, the first four bits must be a class B address uses 14 bits for C address it is 255.255.255.0. In
1111. Therefore, it is only necessary network addressing and 16 bits for order to create more network
to observe the first byte of the IP host addressing. By simply addresses (subnets) we need to
address to determine its class. reassigning one of the host bits to a move the mask bits to the right
Figure 1 shows the decimal value of network bit, you would double the (changing 0 bits into 1s) in order to
the first byte for each class. number of available network convert host bits into network bits.
addresses but halve the number of The best way to understand the
host addresses. Carrying the concept is to use an example.
Reserved Addresses argument further, move eight of the
host bits (actually the complete third
There are some reserved IP address byte) to the network side. The result
besides those identified as classes D is 22 bits for network addressing Class A 1-126
and E. For example, the class A and eight bits for host addressing Class B 128-191
network address 0.X.X.X cannot be which is quite similar to a class C
Class C 192-223
used since it is used to indicate address. These additional network
“this” network. Class A address addresses are called subnets and not Class D 224-239
127.X.X.X is reserved for loop back networks because to the Internet, Class E 240-254
testing. With the host portion of the the original address is still a class B
address, you cannot have an all 0s network address but locally the Figure 1. The class of an IP address
host, which refers to the network class B network address can be can be quickly identified by
address where the hosts reside. broken down to manageable observing only the first byte.
Likewise you cannot use the all 1s subnets that function as actual
host address because that indicates network addresses. Why use
a broadcast which is a message to subnets? Subnets are interconnected
all hosts on the network. Therefore, using routers, and routers improve Assume we begin with IP address
with any host addressing on either a network performance by reducing 165.10.0.0. From figure 1 we know
class A, B or C network, you lose 2 traffic and minimizing disruption that this is a class B address with a
host addresses. Still with 4 billion due to broadcast messages. Large network address of 165.10 with the
possible addresses from a 32-bit networks become more manageable capability of assigning up to 65,534
address space, you would think when subnets are deployed. hosts. We do not want 65,534 hosts
there are plenty of addresses even on one network but would like to
with reserved addresses. The have up to 500 hosts on each
problem is that there was much subnet. In order to have 500 hosts
MASKING on one subnet, we need to have 9
waste when addresses were
originally assigned. For example, a To create subnets you need a bits of host addressing. Currently,
class A address can handle 16 subnet mask that defines which bits we have 16 bits of host addressing
million hosts per one network ID. will be used to create the new since we possess a class B address.
That is an enormous amount of network address out of the 32-bit IP That means that we can reassign 7
hosts for just one network. Even a addresses. By “ANDing” the 32-bit of those bits to signify subnet bits.
class B address can handle 65 IP address with a 32-bit mask, we Therefore, the subnet mask would
thousand hosts per network ID. A create a 32-IP address that be 255.255.254.0. In binary it
class C address can handle only 254 represents <netid, subnetid> would be:
hosts per network ID which may be becoming our new network address. 11111111.11111111.11111110.00000000
too little for some networks. A What do these masks look like? If
scheme was needed to obtain a we start with a basic class A address The natural mask for a class B
better balance between network and and do not define any subnets, the address is 255.255.0.0 so in order to
host assignments and that is called mask would look like 255.0.0.0 create subnets we moved mask bits
subnetting. which is called a natural or default to the right in order to convert more
2
host bits to network bits. It must be Address Network Address Host Address
remembered that these mask bits Identifier
must be contiguous from the left. 7 bits of network address 24 bits of host address
Class A 0
For example, the above mask allows First byte Last three bytes
3
addresses at the expense of host SUMMARY
addresses. With supernetting we
create more host addresses at the Although a 32-bit IP address offers
expense of network addresses. an extremely large number of
Supernetting is not for users since it addresses, the A, B, C, class
would be difficult for users to be structure does not make efficient
granted a range of contiguous use of <netid, hostid> assignments.
network addresses. Supernetting is Subnetting improves the situation by
for Internet Service Providers (ISPs) allowing a finer split between
who are attempting to obtain the network and host assignments while
most efficient allocation of IP improving the performance and
addresses using the A, B, C class maintainability of large networks.
scheme.
REFERENCES
Illustrated TCP/IP, Matthew Naugle, 1998, Wiley Computer Publishing
www.ccontrol.com