What is a subnet mask?
The subnet mask is a 32-bit address used to distinguish between the network address and the host address in the IP address. The subnet mask determines which part of the IP address is the network address and the host address.
What is a subnet mask?
The subnet mask is a 32-bit address used to distinguish between the network address and the host address in the IP address. The subnet mask determines which part of the IP address is the network address and the host address. They are not displayed inside data packets traveling over the Internet. They carry the destination IP address that the router will match to a subnet.
There are two types of subnet masks:
- The default subnet mask is the number of bits reserved by the address layer. Using this default mask will provide a unique network subnet in the relative layer.
- Custom subnet masks can be defined by the administrator to provide multiple networks
How to use subnet mask?
The subnet mask is used by the router to hide the network address. It indicates which bit is used to identify the subnet.
Each network has its own unique address, Like here, the Class B network has network address 172.20.0.0, which has all zeros in the host part of the address.
Example IP address: 11000001. Here the first and second bits are 1 and the third bit is 0; so it's Class C.
The example above shows how to interpret the IP address structure, which makes it easier for Internet routers to find the right network to route data in. However, in a Class A network there can be millions of devices connected, and it can take a while for the router to find the right device.
Methods of subnet mask
The subnet mask process can be divided into two methods: Direct or reduced.
1. Directly
You should use the binary notation method for both the address and the mask, and then apply the AND function to get the block address.
2. Shorten
- In case the byte in the mask is 255, you need to copy the byte in the destination address.
- When the byte in the mask is 0, then you need to replace the byte in the address with 0.
- When the byte in the mask is neither 255 nor 0, then you should write the mask and address in binary and use the AND function.
- Use in case if extracted network address matches local network ID and destination is on local network. However, if they do not match, the information must be routed outside the local network.
Class | Default Subnet Mask | Number of networks | Number of hosts per network |
---|---|---|---|
A | 255.0.0.0 | 256 | 16,777,214 |
REMOVE | 255.255.0.0 | 65,536 | 65,534 |
OLD | 255.255.255.0 | 16,77,216 | 126 |
Important formulas for determining subnet
Use the formula 2s – 2, do not use range 0 and broadcast if:
- You can use the full routing method.
- RIP version 1 is used
- The no IP subnet-zero command is configured on your router.
Use the 2s formula, range 0 and broadcast if:
- You can use the VLM approach or classless routing.
- RIP version 2. EIGRP. or OSPF is used
- The IP subnet-zero command is configured on your router.
What is Subnetting?
Subnetting is a way of dividing a network into two or more smaller networks. It increases routing efficiency, enhances network security, and reduces the size of broadcast domains.
IP Subnetting specifies high-order bits from the host as part of the network prefix. This method divides a network into smaller subnets.
It also helps you to reduce the size of the routing tables, which are stored in the routers. This method also helps you to expand your existing IP address base and restructure IP addresses.
Why Use Subnetting?
Here are important reasons to use Subnetting:
- It helps you maximize IP address efficiency.
- Extend the life of IPV4.
- Public IPV4 addresses are scarce.
- IPV4 Subnetting reduces network traffic by eliminating conflicting and broadcast traffic, thus improving overall performance.
- This method allows you to apply network security policies at the connection point between subnets.
- Optimize IP network performance.
- Facilitating large geographical distances.
- Subnetting helps to allocate IP addresses to prevent a large number of IP network addresses from being used.
- Subnets are often geographically set up for specific offices or groups within a business, allowing their network traffic to reside within that area.
You should read it
- How to divide the subnets and the benefits of subnetting
- Free online subnet exercises
- How to Find the Subnet Mask
- How to Find Your Subnet Mask
- 10 things to know about Mask in Photoshop
- Advanced Subnet Calculator - Download Advanced Subnet Calculator here.
- How to Calculate Network and Broadcast Address
- Set up the LAN by dividing the subnet
- How to Make a Mask Using the Olsen Mask Pattern
- IP, Subnet mask, installation and configuration for 1 server
- Configure a Mac VLAN
- Why is Localhost's IP address 127.0.0.1?