What Is the Purpose of a Subnet Mask in IP Addressing?

by Laura Gittins

An Internet Protocol address identifies a device on a computer network, specifying its location and identification. Internet Protocol Version 4 makes use of subnet masks that help to control network traffic by using identifiers in the IP address to specify on which subnet a host or group of hosts exist. A newer protocol, IPv6, does not make use of subnet masks because they have built-in subnet IDs.

IP Address

An IPv4 address is a 32-bit number divided into four sections, or octets, written in decimal numbers ranging from zero to 255 and separated by dots. For example, is an IP address. Each address is divided into two parts: the network and the host number. A subnet mask designates a subnet within a larger network and identifies a way to route external information to the proper hosts, or machines (such as your computer) on the subnet.


A subnet mask defines the IP addresses that can exist within a specific subnet, such as a local area network. It has a similar appearance to an IP address, but it "masks" the network part of the IP address. The values in the subnet mask identify how many hosts can exist on the subnet. The value of any octet will always be higher than that of the octet to its right, if there is one. Smaller values in an octet translates to a greater number of hosts that can connect to the subnet.


A subnet mask of indicates a network that can have up to 256 hosts, where the first three octets for each device's IP address are the same, and the final octet's value ranging from zero to 255. The IP addresses and can share the subnet mask, but and cannot because the third octet is different. The subnet mask will have up to 16 hosts on it, whereas the subnet mask can have as many as 8,388,608 hosts.


New devices continue to take up available addresses in IPv4, and eventually there will be none left. IPv6 was introduced in the mid-2000s, using 128 bits for the address and thereby vastly increasing the amount of available addresses for devices. While IPv4 will not be phased out for many years, its usage, as well as that of the subnet masks associated with its IP addresses, will gradually be replaced by IPv6 and its reserved space for subnet IDs.

About the Author

Laura Gittins has been writing since 2008 and is an expert in document design. She has a Bachelor of Science in English, Professional and Technical Writing. She has written education and document design articles for eHow.

Photo Credits

  • photo_camera Comstock Images/Comstock/Getty Images