coding, programming, css @ Pixabay

Subnet Mask

Subnetting: What is Subnet Mask?

What is Subnetting and how does it work?
Subnetting is the technique of breaking a network into two or more smaller networks for the purpose of sharing resources. It improves the effectiveness of routing, which contributes to the improvement of network security while also reducing the size of the broadcast domain.

When using IP Subnetting, high-order bits from the host are designated as part of the network prefix. With this strategy, you can break down a large network into smaller subnets.

You will also benefit from it because it will enable you to lower the size of the routing tables that are stored in routers. This strategy also aids in the expansion of the existing IP address base as well as the restructuring of the IP address space. What is the purpose of subnetting?
Here are some of the most compelling arguments in favour of using subnetting:

Why Use Subnetting?

It assists you in increasing the efficiency of IP addressing.
IPV4’s lifespan should be extended.
IPV4 addresses that are available to the public are uncommon.
Due to the elimination of collision and broadcast traffic, IPV4 subnetting helps to reduce network traffic and thus increases overall performance.
By using this strategy, you can enforce network security regulations at the point of connecting between subnets.
Performance of the IP network has been improved.
It makes it possible to connect people across long distances.
The subnetting procedure aids in the allocation of IP addresses, preventing a significant number of IP network addresses from staying unused in the future.
Subnets are typically created geographically for certain offices or teams within a company to allow network traffic to remain within the confines of that location.

What is Subnet Mask?

If you have an IP address with a subnet mask, it is a 32-bit number that is used to distinguish between the network and the hosts on that IP address. A subnet mask is used to distinguish between the network address and the host address contained within an IP address. They are not visible within the data packets that travel across the Internet. They carry the destination IP address, which a router will match with a subnet if the destination IP address is in the same subnet.

network as a representation 0 represents the number of hosts
There are two types of subnet masks:

The default Subnet Mask is the number of bits that are reserved for the address class in the network configuration. The use of this default mask will allow for the inclusion of a single network subnet in the relevant class.
An administrator can define a Custom Subnet Mask to handle a large number of Network Interface Cards.
What is the proper way to use a subnet mask?
The subnet mask is used by the router to hide the network address from the rest of the network. It demonstrates which bits are utilised to identify the subnet in question.

How to Use a Subnet Mask?

Every network has its own unique address. For example, the class B network has the network address 172.20.0.0, which is comprised entirely of zeroes in the host section of the address.

11000001 is an example of an IP address. The first and second bits are both 1, while the third bit is 0; as a result, it is classified as class C.

Understanding IP address classification The preceding example illustrates how IP addresses should be decomposed, which makes it easier for Internet routers to determine which Network to route traffic into. However, there could be millions of linked devices in a Class A network, and it could take some time for the router to locate the correct device.

Methods of Subnet Masking

Subnet masking can be accomplished in several ways.
We have two options for subnetting the masking process: the straight route and the short-cut.

1) A straight forward approach

Using binary notation for both the address and mask, as well as the AND operation to obtain the block address, is the recommended technique.

2) The Short-Cut Approach

If the value of the mask byte is 255, you must transfer the value of the mask byte to the destination address.
For cases where the mask contains zero bytes, it is necessary to replace the zero bytes in the address.
When the byte in the mask is neither 255 nor 0, you should write the mask and the address in binary and use the AND operation to combine the two data sets together.
If the extracted network address corresponds to the local network ID and the destination is situated on the local network, the extraction is successful. It is necessary to route the message outside the local network if the two don’t match.

Class Default subnet mask No. of networks No. of host per network
A 255.0.0.0 256 16,777,214
B 255.255.0.0 65,536 65,534
C 255.255.255.0 16,77,216 126

Formulas that are important in determining the subnets
If any of the following conditions are met, the 2s – 2 formula should be used instead of the zero and broadcast ranges:

Important formulas to determine the subnets

It is possible to use the classful routing approach.
It is necessary to use RIP version 1.
If you have the no IP subnet-zero command installed on your router, you will be fine.
If any of the following conditions are met, the 2s formula and the zero and broadcast ranges should be used:

You can use a classless routing method or a VLM technique to accomplish this.
Either EIGRP or OSPF is used in place of RIP version 2.
Your router has been configured to use the IP subnet-zero command.

Summary:

IP subnetting is the method of separating a network into two or more smaller networks using the Internet Protocol (IP).
Subnetting is a technique for increasing the efficiency of IP addressing.
If you have an IP address with a subnet mask, it is a 32-bit number that is used to distinguish between the network and the hosts on that IP address.
The subnet mask is used by the router to hide the network address from the rest of the network. It demonstrates which bits are utilised to identify the subnet in question.
There are two methods for subnetting the masking process: 1) A straight forward approach 2) The Quick-Fix Method.