TCP/IP Subnet Table
|Prefix||Subnet Mask||Number of Hosts||Networks (Class B) *||Networks (Class C) *||Inverse Mask +||Notes|
|/17||255.255.128.0||32766||0+1||0.0.127.255||In Class A networks, CIDR, or subnet-zero enabled networks only|
|/25||255.255.255.128||126||510+1||0+1||0.0.0.127||in class B or larger networks, CIDR, or subnet-zero enabled networks only|
|/31||255.255.255.254||0|| ||Invalid mask since it leaves no host bits|
|/32||255.255.255.255||1||0.0.0.0||Special single host mask|
* Generally, host bits, subnet bits, and network bits cannot consist of all ones or all zeroes without conveying special meaning to the address (network address, broadcast address, etc). This means that in classful addressing, the first and last subnets within a network are unusable, since all subnet bits would be zeroes or ones. However, on most newer routing and other networking equipment, you can specify that it use subnet zero (the command on a cisco is ip subnet-zero). In this case you get one extra subnet per classful network, with the slight drawback that the network address of the network becomes the network address of the first subnet instead. The +1 after each number indicates the extra subnet which can be reclaimed in this way.
+ The inverse mask is primarily used in Cisco access control lists (ACLs). The rationale behind an inverse mask is that logical ANDing an inverse mask and an IP address gives the host portion of the address instead of the network/subnet portion (as a standard subnet mask would), which is of more interest to certain TCP/IP functions. To calculate an inverse mask given a subnet mask, simply subtract each octet value from 255.