Open In App
Related Articles

Subnet Mask Cheat Sheet

Improve
Improve
Improve
Like Article
Like
Save Article
Save
Report issue
Report

A Subnet Mask is a numerical value that describes a computer or device’s how to divide an IP address into two parts: the network portion and the host portion. The network element identifies the network to which the computer belongs and the host part identifies the unique computer on that network. An IP address is made up of four digits separated by dots, for example, 255.255.255.0 and each number can be between 0 and 255, with higher values using more bits for the network and lesser values for the host. A subnet mask allows devices on the same network or across networks to interact with each other. Every system has a unquine IP address.


In this Subnetting Cheat Sheet, you’ll learn all the basic to advanced subnetting concepts, including CIDR notation, and IPv4 subnet masks ranging from XX.XX.XX.XX/0 to XX.XX.XX.XX/32, IPv4 wildcard mask values, classification of IPv4 addresses from Class A to Class E, and more.

Subnet-CheatSheet

Additionally, In this Subnetting Mask Cheat Sheet, you will also explore private IP addresses, special IP addresses, and bogon IP addresses, further enhancing your knowledge of network addressing.

What is Subnetting?

Subnetting is the technique of dividing one big network into multiple small networks. Subnet makes the network more efficient and easy to maintain. Subnets provide a shorter path to network traffic without passing through unnecessary routers to reach their destinations.Subnetting makes network routing much more efficient.


How Does Subnetting Work?

Let’s assume what happens when there is no subnetting in a Large network that has a million devices connected to them and they have their unique IP Address. Now, what happens when we send some information in that network from one device to another? In that case, our data/information passes through most of the unnecessary routers or devices until they find a destination device.

How Subnetting Works?

How Does Subnetting Works?

Now, think we divided the same network into smaller subnetworks. This helps make the routing of data more efficient. Instead of searching through millions of devices to find the right one, routers (check if the destination IP address falls within their range of subnet devices. If it does, they route the packet to the appropriate device. If it doesn’t, they forward the packet to another router) can use something called a subnet mask to determine which subnetwork a device belongs to.

What is Classful Addressing and Classless Addressing?

In Classful Addressing, we divided IPV4 Network into 5 classes(Class A, Class B, Class C, Class D, Class E) of fixed length. In Classful addressing IP addresses are allocated according to the classes- A to E. In this Scheme, Network ID and Host ID changes depend on the class.

On the Other Hand, CIDR or Class Inter-Domain Routing was introduced in 1993 to replace classful addressing. It allows the user to use VLSM or Variable Length Subnet Masks. So, there is no such restriction of class in classless addressing. The wastage of IP addresses has been improved after CIDR Addressing.

What is CIDR?

CIDR or Class Inter-Domain Routing allows the user to use VLSM or Variable Length Subnet Masks in order to make IP address allocation and IP routing that allows more efficient use of IP addresses.

Rules for forming CIDR Blocks:

  • All IP addresses must be contiguous or sequential.(NID=network ID , HID=host ID)
  • The block size must be the power of 2 (2n). If the size of the block is the power of 2, then it will be easy to divide the Network. Finding out the Block Id is very easy if the block size is of the power of 2. Example: If the Block size is 25 then, Host Id will contain 5 bits and Network will contain 32 – 5 = 27 bits.
What is CIDR?
  • The first IP address of the Block must be evenly divisible by the size of the block. in simple words, the least significant part should always start with zeroes in Host Id. Since all the least significant bits of Host Id are zero, then we can use it as the Block Id part.

Example: Let’s check whether the IP address block from 192.168.1.64 to 192.168.1.127 is a valid IP address block or not?

  • All the IP addresses in the block are contiguous.
  • Total number of IP addresses in the block is = 64 = 26
  • The first IP address in the block is 192.168.1.64. We can observe that the Host ID contains the last 6 bits, and in this case, the least significant 6 bits are not all zeros. Therefore, the first IP address is not evenly divisible by the size of the block.

As a result, this block does not satisfy the criteria for a valid IP address block, and therefore, it is not a valid IP block.

Working on IP Address Block

An IP address is a 32-bit unique address having an address space of 232. The IPv4 address is divided into two parts:

  1. Network ID
  2. Host ID.

For Example:- IP addresses belonging to class A are assigned to the networks that contain many hosts. 

  • The network ID is 8 bits long.
  • The host ID is 24 bits long.

The higher-order bit of the first octet in class A is always set to 0. The remaining 7 bits in the first octet are used to determine network ID. The 24 bits of host ID are used to determine the host in any network. The default subnet mask for Class A is 255.x.x.x. Therefore, class A has a total of:

2^7-2= 126 network ID(Here 2 address is subtracted because 0.0.0.0 and 127.x.y.z are special address. )

2^24 – 2 = 16,777,214 host ID

IP addresses belonging to class A range from 1.x.x.x – 126.x.x.x

How to Calculate CIDR Notation?

Here, step-by-step you can calculate the CIDR notation of any IP Address:

Step 1: First, find the IP address and the subnet mask. Ex:- 194.10.12.1(IP Address), 255.255.255.0 (Subnet Mask)

Step 2: Convert the subnet mask to binary. (255.255.255.0 -> 11111111.11111111.11111111.00000000)

Step 3: Count the number of consecutive 1s in the binary subnet mask.(11111111.11111111.11111111)

Step 4: Determine the CIDR prefix length.(24’ones)

Step 5: Write the CIDR notation. (194.10.12.1/24)

IPv4 Subnets (w/ Wildcard Mask Values)

Here in the below charts, we will see pre-defined subnet masks, followed by some explanations of what they mean.

CIDRSUBNET MASKWILDCARD MASK# OF IP ADDRESSES# OF USABLE IP ADDRESSES
/32255.255.255.2550.0.0.011
/31255.255.255.2540.0.0.122*
/30255.255.255.2520.0.0.342
/29255.255.255.2480.0.0.786
/28255.255.255.2400.0.0.151614
/27255.255.255.2240.0.0.313230
/26255.255.255.1920.0.0.636462
/25255.255.255.1280.0.0.127128126
/24255.255.255.00.0.0.255256254
/23255.255.254.00.0.1.255512510
/22255.255.252.00.0.3.25510241022
/21255.255.248.00.0.7.25520482046
/20255.255.240.00.0.15.25540964094
/19255.255.224.00.0.31.25581928190
/18255.255.192.00.0.63.25516,38416382
/17255.255.192.00.0.127.25532,76832766
/16255.255.0.00.0.255.25565,53665534
/15255.254.0.00.1.255.255131,072131070
/14255.252.0.00.3.255.255262,144262,142
/13255.248.0.00.7.255.255524,288524,286
/12255.240.0.00.15.255.2551,048,5761,048,574
/11255.224.0.00.31.255.2552,097,1522,097,150
/10255.192.0.00.63.255.2554,194,3044,194,302
/9255.128.0.00.127.255.2558,388,6088,388,606
/8255.0.0.00.255.255.25516,777,21616,777,214
/7254.0.0.01.255.255.25533,554,43233,554,430
/6252.0.0.03.255.255.25567,108,86467,108,862
/5248.0.0.07.255.255.255134,217,728134,217,726
/4240.0.0.015.255.255.255268,435,456268,435,454
/3224.0.0.031.255.255.255536,870,912536,870,910
/2192.0.0.063.255.255.2551,073,741,8241,073,741,822
/1128.0.0.0127.255.255.2552,147,483,6482,147,483,646
/00.0.0.0255.255.255.2554,294,967,2964,294,967,294

Classification of IPV4 Address

IPv4 addresses are classified into five classes: A, B, C, D, and E. The first octet(8 bits) of an IPv4 address determines the class of the address.

Classification of IP Addresses

Range

Number of Blocks

Representation in the subnet mask

Class A0.0.0.0-127.255.255.255128255.0.0.0/8
Class B128.0.0.0-191.255.255.25516,384255.255.0.0/16
Class C192.0.0.0-223.255.255.2552,097,152255.255.255.0/24
Class D224.0.0.0-239.255.255.255n/an/a
Class E240.0.0.0-255.255.255.255n/an/a

And here’s a table of the decimal to binary conversions for subnet mask and wildcard octets:

SUBNET MASK

WILDCARD
00000000025511111111
1281000000012701111111
192110000006300111111
224111000003100011111
240111100001500001111
24811111000700000111
25211111100300000011
2541111111010000001
25511111111000000000

Reserved IP Address

Reserved IP addresses are a set of IP addresses that are not assigned to any specific device or network. 

Here are some examples of reserved IP address ranges:

Reserved IP Addresses

0.0.0.0/8This network
10.0.0.0/8Private IPv4 Address Block
100.64.0.0/10Carrier-grade NAT
127.0.0.0/8Loopback
127.0.53.53Name collision occurrence
169.254.0.0/16Link local
172.16.0.0/12Private IPv4 Address Block
192.0.0.0/24IETF protocol assignments
192.0.2.0/24TEST-NET-1
192.168.0.0/16Private IPv4 Address Block
198.18.0.0/15Network benchmark testing
198.51.100.0/24TEST-NET-2
255.255.255.255Limited Broadcast address

Private IPv4 Addresses

Private IPv4 addresses are a range of IP addresses that are not routable on the public internet. They are reserved for use within private networks, such as homes, businesses, and organizations. 

The range of private IPv4 addresses is:

Private IPv4 Addresses

Class A10.0.0.0 – 10.255.255.255
Class B172.16.0.0 – 172.31.255.255
Class c192.168.0.0 – 192.168.255.255

Special IPv4 Addresses

Special IPv4 addresses are a set of IP addresses, that serve specific purposes. These addresses are used for special functions and are not assigned to individual devices. 

Here are some examples of special IPv4 addresses:

Special IPv4 Addresses

Local Host127.0.0.0 – 127.255.255.255
APIPA169.254.0.0 – 169.254.255.255

Bogon IPv4 Addresses

A bogon IP address is an IP address that are not assigned or allocated to any specific entity or organization. Bogon addresses are typically used to filter or block suspicious or illegitimate network traffic. 

Here are some examples of bogon IPv4 address ranges:

Bogon IPv4 Address Range

Description

0.0.0.0/8Reserved address space
10.0.0.0/8Private network (RFC 1918)
100.64.0.0/10Shared address space (CGN)
127.0.0.0/8Loopback address
169.254.0.0/16Link-local address (Autoconfiguration)
172.16.0.0/12Private network (RFC 1918)
192.0.0.0/24Reserved address space used for documentation
192.0.2.0/24Reserved address space used for documentation
192.168.0.0/16Private network (RFC 1918)
198.51.100.0/24Reserved address space used for documentation
203.0.113.0/24Reserved address space used for documentation
240.0.0.0/4Reserved for future use or experimental purposes

Why learning Subnetting is Important?

Learning to subnet is important for a number of reasons, including:

  • Conserving IP addresses: Subnetting allows for the efficient use of limited IPv4 addresses by dividing a larger network into smaller networks, conserving IP addresses and facilitating better management.
  • Improving network performance: Subnetting reduces the size of broadcast domains, reducing network congestion and improving performance by limiting the scope of broadcast messages.
  • Enhancing network security: Subnetting isolates different parts of a network, improving security by preventing unauthorized access to sensitive data.
  • Simplifying network management: Subnetting makes it easier to identify and troubleshoot problems by isolating issues to specific subnets, simplifying network management and troubleshooting processes.
  • Solitary organization: Gadgets on the equivalent subnet can speak with one another straightforwardly without going through a switch or other systems administration gadget.

By learning subnetting, you gain a comprehensive understanding of network design, management, and troubleshooting, making you a valuable asset in the field of networking.

Summary

Alright, wrapping it up, subnetting is pretty much a crucial skill for network admins and IT professionals. It’s all about managing and dishing out IP addresses in networks like a pro. This subnet cheat sheet? It’s your new best friend. It’s got everything you need to know about subnetting, from getting your head around IP addresses and subnet masks to the lingo like CIDR notation and VLSM. Just follow the guide, use the formulas and tables, and subnetting will be a walk in the park. Keep at it, and you’ll be a subnetting master in no time, creating slick network designs, using addresses like a boss, and boosting network performance.Limitations of subnetting. Communication between one subnet to another subnet requires a router. A poorly configured or fatally failed router can significantly impact your organization’s network.


Subnet Cheat Sheet – FAQs

1. How to Determine Usable Hosts?

To determine Usable host, You need to Subtract Subnet ID Address and BroadCast Address from Total Addresses. For Example:-

Usable hosts = Total Addresses – Subnet ID – Broadcast Address

Usable hosts = 256 – 1 – 1

Usable hosts = 254

2. What are the Reserved Ranges of IP Addresses?

Reserved Ranges

RFC191810.0.0.0 10.255.255.255
Localhost127.0.0.0 127.255.255.255
RFC1918172.16.0.0 172.31.255.255
RFC1918192.168.0.0 192.168.255.255

3. What if you had a 255.255 255.0 subnet?

A subnet mask of 255.255. 255.0 would give you lots of networks (2 16) and 254 hosts. A subnet of 255.255. 0.0 would give you lots of hosts (approx 216) and 256 networks



Last Updated : 08 Nov, 2023
Like Article
Save Article
Next
Share your thoughts in the comments
Similar Reads