- What is an Internet Protocol subnet mask (IP subnet mask)?
- What is an IP Subnet?
- What is a binary mask?
- What does an IP subnet mask do? What is it used for?
- Where are subnet masks used?
An IP subnet mask is a binary masking value used to identify and describe IP subnets.
That is the short definition but this short definition probably makes no sense, so we will explain what an IP subnet is first, and then look at how a subnet mask is used to create a subnet. From these two definitions we'll get a better idea of what an IP subnet mask really is. After we define what a subnet mask is, we'll look at what a subnet mask does, what it is used for and where it is used.
An IP subnet is a subnetwork. Subnetworks are smaller portions of larger networks that have been separated by breaking a larger range of IP addresses into two or more smaller ranges of addresses. To really understand what a subnet is, you need to understand the original IP addressing scheme called 'classful addressing'. The original classful IP addressing scheme created networks of varying sizes and identified the class, and therefore the size of the network using the first four bits of the IP address. This was not very efficient because some networks did not use all the IP addresses available in the range provided to them.
Breaking a larger network into subnets allows you to restrict certain kinds of network traffic such as broadcasts. Broadcasts are when a single computer sends data to all equipment on the network. This type of communication is necessary for functions such as ARP, RARP, WINS etc.
Breaking a larger network into subnets also allows the network to grow (to 'scale') more efficiently and wastes fewer IP addresses.
A binary mask is a string of zeroes and ones that is used to filter or mask the values of specific bits in a second binary value. A logical operation is performed which uses the bits from the value to be masked and bits from the mask itself. The resulting output is then used for various purposes. See our tutorial about binary masks elsewhere on this site for more information.
The IP subnet mask allows a computer to mask out the host portion of an IP address. But why would you want to do this? A host needs to know if the computer it is communicating with is on the same network or on a different network.
This leaves only the network portion of the original IP address. Knowing which network an IP address is part of is very important in IP communication. Hosts on the same subnet can talk to each other directly. Hosts on different subnets need a router to communicate with each other.
One IP address and subnet mask is always configured on each network interface installed on a piece of network-capable computing equipment.
Hosts are configured with a unique IP address and subnet mask for each interface on the network. Nearly all hosts have a single network interface, so only a single IP address and subnet mask are used. Hosts receive their IP address and subnet mask from DHCP or the IP address and subnet mask are set manually by the network administrator when the computer is first installed.
Routers are configured by the network administrator with a unique IP address and subnet mask pairing for each interface that is connected to an active network.