One aspect of IP addressing that is extremely important to how IP addressing works is the use of subnet masks. An IP address without the appropriate subnet mask is like Laurel without Hardy. The subnet mask for a particular IP address is actually used by the router to resolve which part of the IP address is providing the network address and which part of the address is providing host address.
The basic subnet masks for each class are shown below. Subnet masks also consist of four octets of information. A router matches up the information in the subnet mask with the actual IP
address and determines the network address and the node address.
| Class | Subnet Mask |
| A | 255.0.0.0 |
| B | 255.255.0.0 |
| C | 255.255.255.0 |
In the basic subnet masks (where no subnetting has been done) the octet either has all the bits turned on (represented by 1s) or all the bits turned off (represented by Os). When all the bits are turned on the decimal equivalent is 255. When all bits are set to binary 0, the decimal equivalent is 0. The question is how does a router use the subnet mask to determine which part of an IP address refers to the network address. It actually uses a process called anding where it "ands" the bits in the subnet mask with the bits in the IP address to determine the network address.
Example
Subnet-Mask: 255.255.0.0
IP-Address: 180.20.5.9
Network-Address: ?
Subnet Mask: 11111111 11111111 00000000 00000000
IP-Address: 10110100 00010100 00000101 00001001
--------------------------------------------------------
Network-Address: 10110100 00010100 00000000 00000000
Network-Address: 180.20.0.0
So ,if your IP-Address is 180.21.x.x with Subnet-Mask 255.255.0.0 ,yours not in the network.
Subnetting IP Addresses
