Explaining the IP Subnet Mask by Phil Hippensteel

Dear Professor Phil:
What is the purpose of the IP subnet mask and how does it work?
Scott, Charlotte, NC
Hello Scott.
The answer to this question has two parts. The first involves the interpretation of the IP address. IP addresses are 32 bits (four bytes) long. Devices interpret the address as two parts: . Consider the address 172.176.18.3. In the original class system, the first two bytes designate the network because the address starts with 172. Therefore, the computer’s network is 172.176.0.0 (zeroes are inserted for convenience.) We would say that the computer’s individual address is 18.3 within the network. The class system allows the boundary between the parts of the address to be at 8, 16 or 24 bits. As the Internet got larger, that became a problem. So the subnet mask was created.

  • If the mask 255.255.0.0 is used with the 172.176.18.3, the interpretation of the address remains the same as in the class system. Because 255.255.0.0 in binary is 11111111 11111111 00000000 00000000, devices use the positions in the binary representation of the address matching the ones as part of the network address and positions matching the zeroes as the designation of the individual computer in the network. They call this a 16-bit mask (meaning 16 ones). However, if the mask 255.255.255.0 were used, the binary representation of the mask has 24 ones: 11111111 11111111 11111111 00000000. Now the address 172.176.18.3 is interpreted as computer .3 on network 172.176.18.0. It is entirely possible and, in fact, quite common to use masks with 25 or 26 bits. In theory the mask can be almost any length. The critical factor is that all computers on a subnetwork must use the same mask. This is because the mask determines the size of the network and all devices need to agree on that size.

*Author Note: I think the binary strings (24 bits) should appear on the same line for clarity. One possibility in the layout is to center on a separate line.

Phil Hippensteel is a professor of Information Systems at Penn State Harrisburg. If you have a question for Professor Phil, email us at AVTintern@nbmedia.com.