Subnetting in Computer Networks

Learn via video courses
Topics Covered

Overview

When the IP system was first introduced, finding a network and sending data to it was easier because the number of users on the internet was limited. As the number of users on the internet is increasing, sending a data packet to the computer you want in a network is becoming quite difficult these days. When a network is large enough to support an organization, network performance becomes a significant concern.

An organization can use IP subnets to split more extensive networks for logical (firewalls, etc.) or physical reasons (smaller broadcast domains, etc.). In other words, routers make routing decisions based on subnets. In this article, we will learn these concepts more briefly.

What is Subnetting?

Subnetting is a method of dividing a single physical network into logical sub-networks (subnets). Subnetting allows a business to expand its network without requiring a new network number from its Internet service provider. Subnetting helps to reduce the network traffic and also conceals network complexity. Subnetting is necessary when a single network number must be assigned to several portions of a local area network (LAN).

We know subnetting splits networks into small subnets, and do you think what these subnets are? A subnet, sometimes known as a subnetwork, is a part of a larger network. Subnets are the logical division of an IP network into many smaller network parts. To reduce traffic, a subnet's purpose is to divide a huge network into a collection of smaller, interconnected networks. Subnets eliminate the need for traffic to pass through extraneous routs, resulting in faster network speeds. Subnets were created to alleviate the shortage of IP addresses on the internet.

The purpose of subnetting is to establish a computer network that is quick, efficient, and robust. As networks grow in size and complexity, traffic must find more efficient pathways. Bottlenecks and congestion would arise if all network traffic traveled across the system at the same time, utilizing the same path, resulting in slow and wasteful backlogs. By creating a subnet, you can limit the number of routers that network traffic must pass through. An engineer will effectively establish smaller mini-routes within a larger network to allow traffic to go the shortest distance possible.

What is the Use of Subnetting?

Large enterprises looking to expand technologically need to know how to organize a network efficiently. IP addresses can be kept geographically confined, allowing a subnet to be used to preserve efficiency and order. Let’s look at some of the major motivations for using subnetting.

  1. Reallocating IP Addresses:- A limited number of host allocations are available for each class; for example, networks with more than 254 devices require a Class B allocation. Suppose a network administrator works with a Class B or C network and needs to allocate 150 hosts across three physical networks in three different cities. In that case, they must either request more address blocks for each network or divide the network into subnets that allow administrators to use one block of addresses across multiple physical networks.
  2. Improves Network Speed:- Subnetting divides the large network into small subnets, and the purpose of these subnets is to divide a huge network into a collection of smaller, interconnected networks to reduce traffic. Subnets eliminate the need for traffic to pass through extraneous routs, resulting in faster network speeds.
  3. Improving Network Security:- Subnetting helps network administrators to reduce network-wide threats by quarantining compromised areas of the network and making it more complex for trespassers to travel throughout an organization's network.
  4. Reliving Network Congestion:- If a large portion of an organization's traffic is intended to be shared regularly across a group of computers, putting them all on the same subnet can help reduce network traffic. Without a subnet, data packets from every other computer on the network would be visible to all computers and servers.
  5. Efficiency:- Subnetting is used to simplify network traffic by eliminating the need for additional routers. This ensures that the data being sent can move as quickly as possible to its destination, avoiding any potential detours that can slow it down.

Unlock the secrets of computer networks with our Free Computer Network course. Join today and gain a deep understanding of networking concepts.

How Does Subnetting Work?

As we all know, subnetting divides the network into small subnets. Routers are used to communicate between subnets, whereas each subnet allows its linked devices to communicate with each other. The size of a subnet is determined by the network technology used and the connection needs. Within the restrictions of the address space available for its usage, each organization is responsible for determining the number and size of the subnets it generates.

Let's understand how subnetting splits a network into subnets.

  1. A Network Prefix (also known as the Network ID) and a Host ID are the two fields that make up an IP address. Whether the Network Prefix and the Host ID are separated depends on whether the address is Class A, B, or C. The figure given below shows a 172.16.37.5 IPv4 Class B address. The Host ID is 37.5, and the Network Prefix is 172.16.0.0.

Working of Subnetting in HTML

  1. Now, we generally fix MSB(Most Significant Bit) bits of the Host ID to generate the subnets. In the figure below, we fix one of the host's MSB(Most Significant Bit) bits to generate two network subnets. We cannot change network bits because if we change network bits, the whole network is changed.

Creating a subnetting

  1. To identify a subnet, we need a subnet mask which is calculated by putting ‘1’ in place of all Network ID bits and the number of bits we reserve in Host ID to generate the subnet. The subnet mask aims to route the data packet from the internet to its desired subnet network. A subnet mask also specifies which portion of an address should be utilized as the Subnet ID. A binary AND operation is used to apply the subnet mask to the whole network address. AND operations work by assuming that output is "true" if both inputs are "true." Otherwise, "false" is returned. Only when both bits are 1.

This yields the Subnet ID. Routers use the Subnet ID to find the optimum path between subnetworks.

Refer to the image of generating subnet Mask Generating Subnet Mask

  1. If we want to generate variable-length subnets, then we apply permutations on the number of bits reserved to create subnets. This subnetting is called Variable Length Subnet Masking (VLSM).

  2. The broadcast address of a subnet is calculated by making all the remaining bits as‘1’of Host Id after having some bits reserved to represent the subnet.The broadcast address is used to broadcast the message to all the network hosts.

Refer to the image of the Broadcast Address Broadcast Address

Examples of Subnetting

To understand subnetting better let's look at a simple scenario. A college has four departments: Information Technology, Computer Science, Mechanical, and Civil. There are 50 students in each department. The institution used a private class CIPnetwork(with network ID 192.168.1.0). All computers will work in a single huge network if there is no subnetting. It becomes complex for the institution admin to handle the task because if he broadcasts some message to the system, it will be forwarded to all the departments. To solve this type of problem, we use subnetting.

A single large class C IP Network

After subnetting, our network will look like this.

Network after Subnetting

Advantages of Subnetting

  • Subnetting divides broadcast domains, allowing data to be routed more efficiently, and boosting network performance and speed.
  • We can subnet a single large network into smaller networks via subnetting. It is simple to handle small networks.
  • Subnetting enhances the network's overall performance by removing redundant traffic.
  • Subnetting reduces the requirement of an IP range.
  • Subnets prevent devices from accessing the whole network, allowing businesses to control which gear and users have access to more sensitive data. It is possible to improve network security.

Disadvantages of Subnetting

  • Subnetting increases the network's complexity. An experienced network administrator must manage the subnetted network.
  • More subnets mean more IP addresses are wasted because each subnet has its own network address and broadcast address.
  • As we increase more subnets in the network, we require more routers which increases the overall cost and makes the maintenance process challenging.
  • Subnetting necessitates the purchase of expensive internal routers, switches, hubs, and bridges, among other items, which increases the overall network cost.

Conclusion

  • We use subnetting because it now becomes challenging to send a data packet to the machine you want on that network.
  • Subnetting is a method of dividing a single physical network into logical sub-networks (subnets).
  • Subnetting is aimed to achieve the following targets in the network.
    • Reallocating IP Addresses
    • Improving Network Security
    • Reliving Network Congestion
    • Improves Network Speed
    • Efficiency
  • A subnet, sometimes known as a subnetwork, is a part of a larger network and its purpose is to divide a huge network into a collection of smaller, interconnected networks to reduce traffic.
  • The subnet mask aims to route the data packet from the internet to its desired subnet network.