WHEN AN IT DEPARTMENT IS NOT AVAILABLE |
57
IP Address Classes
Find, you say. That was mildly entertaining. But why muck about with subnet masks and binary operations? Why
can’t they just always use the first three bytes for the network ID and the last byte for the host ID?
That is a fair question. The answer is that not every subnet is the same. Some corporate subnets are very large and
have lots of hosts, while some small subnets may have only a handful. The number of bits allocated to the host ID
determines the maximum number of IP address you can have on the subnet. An 8-bit host ID would allow for a
subnet with a maximum of 255 hosts. That would not be enough in some cases.
The subnet mask solves this problem (although perhaps in an awkward way). On subnets with lots of hosts, you
can use fewer bits for the network ID and more bits for the host ID. On subnets with fewer hosts, you can use more
bits for the network ID and fewer bits for the host ID.
If you’re managing a private network, you’re free to select your subnet mask as you like. But on the internet, subnet
masks are assigned by IP address class.
There are three common IP address classes: A, B, and C. There is also a class D used for multicast classes, and a class
E reserved for future use, but here we’ll only look at the first three:
Class
IP Address Range
Subnet Mask
A
0.0.0.0 to
127.255.255.25
5
255.0.0.0
B
128.0.0.0 to
191.255.255.255
255.255.0.0
C
192.0.0.0 to
223.255.255.255
255.255.255.0
Class C is the most common IP address class, so most of the subnet masks you see will likely be 255.255.255.0.
It is possible to have different subnet masks in addition to the ones above. The one thing to remember is that when
converted to a binary number, subnet masks are always a continuous string of 1s followed by a string of 0s.
Windows Calculator can perform decimal, binary, hex, and octal number conversions as well as some binary operations, but
by default these capabilities are hidden. To reveal these function select ‘Programmer’ mode from the View menu.
Most of the time you will not have to give subnet masks much thought. But there may be times when you are given
an invalid subnet mask, and this information may help you to detect it, saving you some aggravation.
Gateways
We talked about networks having multiple subnets. Hosts on a subnet are able to communicate directly with each
other, but what happens when a host needs to communicate to another that is on a different subnet? Simple: It uses
the subnet mask to compare the network part of its address versus the network part of the other device’s address. If
they are different, it sends the packet to the gateway address instead.
The gateway is the router device that will take care of sending the packet on its way to the destination when the
packet cannot be delivered on the local subnet. In a way, it is similar to dropping off a piece of mail at the local post
office. They will take care of getting it to the destination for you.