|
Subnetting
A subnet mask
is in fact another thirty two bits address divided in the same way
like an IP address (four blocks of eight bits represented in decimal).
Let's take a look to a classic Class C network address in decimal
format:
196.234.101.0
In binary format
this address is:
11000100.11101010.01100101.00000000
I assume you
know how to convert from binary to decimal and from decimal to binary,
if not just use the Windows calculator or better learn!
A network mask
specifies using a binary one that the corresponding bit in the IP
address is a network bit. The following network mask into binary
format:
11111111.11111111.11111111.11000000
tells us that
two bits have been borrowed from the Class C address and the total
numbers of bits in the network part of the address are 26.
This means that we separated the Class C address in 4 networks,
everyone with 64 hosts. The number of networks is 2^(number of borrowed
bits), the number of hosts is 2^(number of host bits, zero binary).
The first subnetwork
in the 196.234.101.0 subnetted address ranges between 0-63, the
second between 64-127, the third between 128-191 and the forth one
between 192-255. So that the address 196.234.101.201/26 is
in the forth subnetwork network address. The /xx representation
for subnets is more common for the networking world, operating systems
work with decimal address, so that /26 is similar to 255.255.255.192.
Keep in mind that subnetting does not affect performance and
it's not a sublevel of a network! The first address in a (sub)network
is the (sub)network address while the last one is the broadcast
address. In the example above the network address for the second
subnetwork is 196.234.101.64 and the broadcast address is 196.234.101.127.
You can ask how the networking devices treat subnet masks internally.
Well, the answer is quite simple. The networking device performs
a logical AND between the IP address and the network mask. The presence
of one in the network mask keeps the IP bit intact, the presence
of 0 changes the IP address in 0. So that the device learns the
network number, the host number being wiped.
There are several restrictions which apply to subnetting. First,
you have to borrow at least 2 bits from the host part and you have
to leave at least two bits to the host.
Right now you
have the knowledge to understand how networks are subnetted. It's
obvious that in most cases a Class C network needs to be subnetted,
but it's more obvious that there is not network so large to accommodate
16 million hosts as a Class A has. The solution for the problem
exposed above is very simple: the ISP gives to the company eight
IP addresses (six usable + 2 for network and broadcast). The subnetmask
for the Class C address is /29 or 255.255.255.248. Take care that
a /30 or 255.255.255.252 subnetwork is not suitable for the client
because the number of usable IP addresses is just two, although
the total number of addresses is four. |