We are independent & ad-supported. We may earn a commission for purchases made through our links.
Advertiser Disclosure
Our website is an independent, advertising-supported platform. We provide our content free of charge to our readers, and to keep it that way, we rely on revenue generated through advertisements and affiliate partnerships. This means that when you click on certain links on our site and make a purchase, we may earn a commission. Learn more.
How We Make Money
We sustain our operations through affiliate commissions and advertising. If you click on an affiliate link and make a purchase, we may receive a commission from the merchant at no additional cost to you. We also display advertisements on our website, which help generate revenue to support our work and keep our content free for readers. Our editorial team operates independently of our advertising and affiliate partnerships to ensure that our content remains unbiased and focused on providing you with the best information and recommendations based on thorough research and honest evaluations. To remain transparent, we’ve provided a list of our current affiliate partners here.
Networking

Our Promise to you

Founded in 2002, our company has been a trusted resource for readers seeking informative and engaging content. Our dedication to quality remains unwavering—and will never change. We follow a strict editorial policy, ensuring that our content is authored by highly qualified professionals and edited by subject matter experts. This guarantees that everything we publish is objective, accurate, and trustworthy.

Over the years, we've refined our approach to cover a wide range of topics, providing readers with reliable and practical advice to enhance their knowledge and skills. That's why millions of readers turn to us each year. Join us in celebrating the joy of learning, guided by standards you can trust.

What is a Subnet Mask?

By Kurt Inman
Updated: May 16, 2024

A subnet mask is a pattern of bits that can be used to isolate specific portions of an Internet Protocol (IP) address. When it is applied to an IP address, the network interface's host address and network routing prefix are produced. The routing prefix is also known as the subnet or subnetwork. Subnet masks are used by network software and hardware to isolate and manage portions of the network.

When a subnet mask is logically ANDed or added with a network interface's IP address, the result is the starting address of the subnet that interface belongs to. The remaining part of the IP network address is the interface's host identifier. An IP Version 4 (IPv4) subnet mask is usually expressed by four octets in dotted decimal notation. As an example, one can consider a 32-bit IP address of 192.164.178.5 with a mask of 255.255.255.0. In this case, the subnet starting address or routing prefix is 192.164.178.0, and the host interface identifier is 5.

A routing prefix is usually expressed in Classless Inter-Domain Routing (CIDR) notation. This entails following the prefix with a slash and the number of significant bits in the prefix. For example, a subnet mask of 255.255.255.0 has 24 significant bits—all ones in this case. If this subnet mask is applied to IPv4 address 192.164.178.5, the resulting prefix in CIDR notation is 192.164.178.0/24. CIDR notation is also used with IP Version 6 (IPv6) addresses.

In IPv4 networks, all addresses with the same routing prefix are on the same subnet. They are usually on the same link or physical network behind a single router. The subnet can consist of multiple network segments, bridges and switches, however. IP packets destined for a different routing prefix are forwarded by the router attached to the current routing prefix. In IPv6 networks, addresses with identical routing prefixes are not necessarily on the same link.

The concept of a subnet mask was introduced in the early 1990s along with CIDR. Before that, the four high-order bits of an IP address determined which class of addresses it belonged to. The class determined the number of bits in the routing prefix and the host identifier, as well as the subnet starting and ending addresses. No subnet mask was needed because the IP address implied all the necessary information by itself. This type of architecture is known as a classful network.

The process of utilizing a subnet mask to divide a network is known as subnetting. With limited address space available in IPv4 networks, subnetting can be used to efficiently organize larger networks. IPv6 networks provide vast address spaces in comparison. IPv6 subnets are more often used to separate local networks from the Internet or to organize networks on a worldwide scale.

EasyTechJunkie is dedicated to providing accurate and trustworthy information. We carefully select reputable sources and employ a rigorous fact-checking process to maintain the highest standards. To learn more about our commitment to accuracy, read our editorial process.
Discussion Comments
Share
https://www.easytechjunkie.com/what-is-a-subnet-mask.htm
EasyTechJunkie, in your inbox

Our latest articles, guides, and more, delivered daily.

EasyTechJunkie, in your inbox

Our latest articles, guides, and more, delivered daily.