DEFAULT SUBNET MASKS FOR CLASS A, CLASS B, AND CLASS C ADDRESSES | |
Here is how we write the subnet mask in binary bit form. If a certain bit is part of the network ID, we write a 1 in the corresponding bit of the subnet mask. If a certain bit is part of the host ID, we write a 0 in the corresponding bit of the subnet mask. Going back to examples 1 through 3, we have Example 1 The network ID might consist of the first 8 leftmost bits. Then the host ID consists of the remaining 24 bits. 01010001 . 00001010 . 00011110 . 00000010 (IP address in binary form) [---8 bits---] [-------------------24 bits--------------------] [---net ID--] [-------------------host ID--------------------] The subnet mask is therefore [11111111] [00000000 . 00000000 . 00000000] Note that the two IP addresses below are on the same network segment because their bits corresponding to a '1' in the subnet mask are identical. 01010001 . 00001010 . 00011110 . 00000010 (IP address 81.10.30.2) 01010001 . 10001010 . 00011110 . 00001010 (IP address 81.138.30.10) 11111111 . 00000000 . 00000000 . 00000000 (subnet mask 255.0.0.0)
For a Class A address, the default subnet mask is 255.0.0.0 Example 2 The network ID consists of the first 16 leftmost bits and the host ID consists of the next 16 bits. 10000001 . 00001010 . 00011110 . 0000010 (IP address in binary form) [-----------16 bits----------] [-----------16 bits----------] [-----------net ID-----------] [-----------host ID----------] The subnet mask is therefore [ 11111111. 11111111] [00000000. 00000000] Note that the two IP addresses below are on the same network segment because the bits corresponding to a '1' in the subnet mask are identical. 10000001 . 00001010 . 00011110 . 00000010 (IP address 129.10.30.2) 10000001 . 00001010 . 00011111 . 00010010 (IP address 129.10.31.18) 11111111 . 11111111 . 00000000 . 00000000 (subnet mask 255.255.0.0)
For a Class B address, the default subnet mask is 255.255.0.0 Example 3 The network ID consists of the first 24 leftmost bits and the host ID consists of the next 8 bits. 11000001 . 00001010 . 00011110 . 00000010 (IP address in binary form) [------------------24 bits--------------------] [---8 bits---] [------------------net ID---------------------] [---host ID--] The subnet mask is therefore [ 11111111. 11111111. 11111111] [00000000] Note that the two IP addresses below are on the same network segment because the bits corresponding to a '1' in the subnet mask are identical. 11000001 . 00001010 . 00011110 . 00000010 (IP address 193.10.30.2) 11000001 . 00001010 . 00011110 . 00000110 (IP address 193.10.30.6) 11111111 . 11111111 . 11111111 . 00000000 (subnet mask 255.255.255.0)
For a Class C address, the default subnet mask is 255.255.255.0
|