TCP/IP Subnet Masking
This is taking a large network block and breaking into pieces of equal size. Routers requires this logical segmentation to be able to address different logical subnets. Clients require a default gateway IP address (the router interface) to get off their local subnet. The subnet address is more important to a router than the TCP/IP value. The number of bits used in the subnet mask determine how many logical subnets you get.
The rules in subnet masking:
| Binary Mask | Decimal Mask | Binary Hosts | Bits Used | Number of Subnets | Valid Host Increments |
| 00000000 | 0 | 00000000 | 0 | Net ID | Not a subnet |
| 10000000 | 128* | 00000001 | 1 | 1 | 128 |
| 11000000 | 192 | 00000011 | 2 | 2 | 64 |
| 11100000 | 224 | 00000111 | 3 | 6 | 32 |
| 11110000 | 240 | 00001111 | 4 | 14 | 16 |
| 11111000 | 248 | 00011111 | 5 | 30 | 8 |
| 11111100 | 252 | 00111111 | 6 | 62 | 4 |
| 11111110 | 254* | 01111111 | 7 | 126 | 2* |
| 11111111 | 255* | 11111111 | 8 | 254 | 1* |
* 7 subnets valid for Class A or B in first octet. Class C has only 5 valid, the last 2 are binary of 1.