Subnet masks produce more efficient networking and routing by creating subnets. In this article learn more about what subnets are and what they are used for.
A subnet mask separates large networks into smaller subnets. Every internet protocol (IP) address has a network prefix and a host number. In an IP address, a subnet mask is a number structured like an IP address that shows the start of the host number in the IP address. Before the use of classless inter-domain routing (CIDR) in 1993, there were only three subnet masks used with the three main IP (IPv4) address classes. Class-based routing breaks down like this:
Class A network prefix: 8 bits, host number: 24 bits
Class B network prefix: 16 bits, host number: 16 bits
Class C network prefix: 24 bits, host number: 8 bits
The subnet mask for each class is defined here:
Class A subnet mask: 255.0.0.0
Class B subnet mask: 255.255.0.0
Class C subnet mask: 255.255.255.0
professional certificate
Launch Your Career in Network Operations. Build job-ready skills and gain credentials to go from beginner to job-ready in 5 months or less. No degree or prior experience required.
4.7
(98 ratings)
9,103 already enrolled
Beginner level
Average time: 5 month(s)
Learn at your own pace
Skills you'll build:
Cisco Packet Tracer, SQL/NoSQL, DNS, Debugging techniques, Linux/Unix System Administration, Troubleshooting Skills, Debugging Techniques, Python, Basics of Databases, Security Management, Database Management, Managing Jobs and Processes, Managing the File System in Linux, User and Group Accounts, Managing Linux Permissions and Ownership, Performing Basic Linux Tasks, Using Subqueries, Working with SQL Queries and Functions, Relational Database Concepts, Organizing Data, Manipulating Table Data, Network Transmissions and Hardware, Network Architecture, Internet Protocol (IP) Suite, Network Theory, Network Management / Troubleshooting, Computer Security Incident Management, Risk Management, Network Security, Information Security (INFOSEC), Mobile Security, Using Databases and Interacting with Web Sites, Developing a Simple Application, Create user-defined functions, Exploring Programming Concepts, Structuring Code for Reuse
In class-based routing, there are a fixed amount of hosts and the number of the IP address. With the introduction of CIDR in 1993, subnet masks broke down networks further so that IP addresses could be more efficiently created without wasting network space for entities that don’t need large quantities of host numbers. This process is subnetting and is done by a network systems administrator.
Read more: Information Technology (IT) Terms: A to Z Glossary
The 255.255.255.0 subnet mask is widely used in IPv4 networks, particularly on home network routers. An IPv4 address consists of 32 bits, split into four parts of 8 bits each, with values ranging from 0 to 255.
Let’s take a closer look at how a subnet mask is used to break down classes in CIDR. In class-based routing, each class has a specific number of hosts that can connect to a network:
Class A for networks containing over 65,536 hosts
Class B for networks containing 256 to 65,534 hosts
Class C for networks containing less than 254 hosts
If your business has 1,000 devices that connect to the internet, you would need a class B but would be wasting IP addresses because of the limitation of the class system. Classless routing removes the need to restrict networks to the class divides and subnet masks are the tool used to carve IP address network prefixes and host numbers up in an efficient way.
Below is an example of how a subnet mask creates an IP address with a more efficient number of host numbers.
Take, for example, a typical class C IP address of 192.168.1.0 and subnet mask of 255.255.255.0. However, you don’t need 254 host devices, only half of that number, so you need to create a subnet mask to do this. In order to get to half, you will need to borrow one bit from the original subnet mask so the mask becomes 255.255.255.128 (11111111.11111111.11111111.10000000 in binary), which gives you two subnets and 128 minus two for the reserved IP addresses, so 126 hosts.
In CIDR notation, the IP address is: 192.168.1.0/25. The “slash 25” indicates that the IP address contains a subnet mask with 25 bits.
To learn more about how to use subnet masks to create and maintain subnets in an organization, consider the Google IT Support Professional Certificate on Coursera. This beginner-level course allows you to learn at your own pace and helps you acquire essential skills for an entry-level IT job. The Professional Certificate covers technical support fundamentals, operating systems, and system administration.
professional certificate
Get on the fast track to a career in IT. In this certificate program, you’ll learn in-demand skills, and get AI training from Google experts. Learn at your own pace, no degree or experience required.
4.8
(182,899 ratings)
1,746,149 already enrolled
Beginner level
Average time: 6 month(s)
Learn at your own pace
Skills you'll build:
Cybersecurity, Wireless Security, Cryptography, Network Security, Directory Service, Lightweight Directory Access Protocol (LDAP), Backup, Domain Name System (DNS), Ipv4, Network Model, Troubleshooting, Binary Code, Customer Support, Linux, Powershell, Linux File Systems, Command-Line Interface
Editorial Team
Coursera’s editorial team is comprised of highly experienced professional editors, writers, and fact...
This content has been made available for informational purposes only. Learners are advised to conduct additional research to ensure that courses and other credentials pursued meet their personal, professional, and financial goals.
Whether you're starting your career or trying to advance to the next level, experts at Google are here to help.
Build Agile skills to stay organized and complete projects faster.