subnet mask working:
Communication between a node on a local subnetwork
and a node on a different subnetwork is like communication between nodes on two
different networks. To a user, routing between subnetworks is transparent.
Internally, however, the IP software recognizes any IP addresses that are
destined for a subnetwork and sends those packets to the gateway for that
subnetwork.
When subnet masks are used, an IP address is interpreted as follows:
[IP address] = [Network address][Subnetwork address][Host address]
This shows that when a network is divided into
subnetworks, the host address portion of the IP address is divided into two
parts, the subnetwork address and the host address.
For example, if a network has the Class B IP
network address portion 129.47, the remainder of the IP address can be divided
into subnetwork addresses and host addresses. This division is controlled by
the network administrator to allow the most flexibility for network development
at the site.
A subnet mask is the mechanism that defines how the
host portion of the IP address is divided into subnetwork addresses and local
host address portions. The subnet mask is a 32-bit, (four byte) number, just as
an IP address is.
To understand the mechanics of the subnet mask, it
is important to know a little of binary arithmetic.