A primer on subnetting

Learn via video courses
Topics Covered

Overview

Welcome to this subnetting primer! Today, we delve deep into the world of IP addressing and subnetting. Designed for beginners but beneficial for seasoned professionals, this guide aims to help you grasp the concept and advantages of subnetting.

Introduction to Subnetting

What exactly is subnetting? In simple terms, subnetting is dividing a single network into smaller, more manageable pieces called subnets. This process allows for efficient IP address utilization and easier network management.

Here's an overview of subnetting and its key concepts:

  1. IP Addresses:
    IP addresses are numerical labels assigned to devices in a network to identify and locate them. They come in two formats: IPv4 (32-bit) and IPv6 (128-bit). In subnetting, we usually deal with IPv4 addresses.

  2. Subnet Mask:
    A subnet mask is a 32-bit value that separates an IP address into network and host portions. It comprises a sequence of 1s followed by 0s. The 1s denote the network portion, while the 0s represent the host portion.

  3. Subnet:
    A subnet is a logical segment of an IP network. It groups a range of IP addresses, forming a distinct network segment. Subnetting facilitates efficient IP address allocation and traffic management.

  4. CIDR Notation:
    Classless Inter-Domain Routing (CIDR) notation is a compact way to represent IP address ranges and subnet masks. It is expressed as "IP_address/Prefix_length," where the prefix length indicates the number of bits set to 1 in the subnet mask. For example, 192.168.0.0/24 represents a subnet with a 24-bit subnet mask.

subnetting overview

How Does Subnetting Work?

The operation of subnets begins by dividing a network into smaller subnets, each serving as a distinct segment within the network. To enable communication between these subnets, we use routers. Each subnet enables devices within its boundaries to communicate with each other, all while ensuring that subnetting does not disrupt the network's essential components.

For instance, let's consider the following example:

Example 1:
An organization is assigned a Class C network address of 193.1.2.0 with a subnet mask of 255.255.255.128. We will divide this network into two subnets:

Subnet-1:

  • The first bit chosen from the host id part is zero.
  • The range will be from 193.1.2.00000000 until you reach all 1's in the host ID part (i.e., 193.1.2.01111111).
  • Range of Subnet-1: 193.1.2.0 to 193.1.2.127.
  • Subnet ID of Subnet-1: 193.1.2.0.
  • Direct Broadcast ID of Subnet-1: 193.1.2.127.
  • Total number of possible hosts in Subnet-1: 126 (Out of 128, 2 IDs are used for Subnet ID & Direct Broadcast ID).
  • Subnet mask of Subnet-1: 255.255.255.128.

Subnet-2:

  • The first bit chosen from the host id part is one.
  • The range will be from 193.1.2.10000000 until you reach all 1's in the host ID part (i.e., 193.1.2.11111111).
  • Range of Subnet-2: 193.1.2.128 to 193.1.2.255.
  • Subnet ID of Subnet-2: 193.1.2.128.
  • Direct Broadcast ID of Subnet-2: 193.1.2.255.
  • Total number of possible hosts in Subnet-2: 126 (Out of 128, 2 IDs are used for Subnet ID & Direct Broadcast ID).
  • Subnet mask of Subnet-2: 255.255.255.128.

Here is the sequence diagram illustrating the process of subnetting in a Class C network: process of subnetting

By subnetting, we can efficiently allocate IP addresses and control network traffic within each subnet.

An important point is that subnetting reduces the total number of usable hosts. In the example provided, after subnetting, the number of usable hosts decreases from 254 to 252.

Note:

  • To divide a network into four (22)(2^2) parts, choose two bits from the host id part for each subnet (i.e., 00, 01, 10, 11).
  • To divide a network into eight (23)(2^3) parts, you need to choose three bits from the host id part for each subnet (i.e., 000, 001, 010, 011, 100, 101, 110, 111), and so on.
  • As the total number of subnets in a network increases, the total number of usable hosts decreases.

Advantages and Disadvantages of Subnetting

Subnetting is a powerful tool in network management, but like any technique, it has both advantages and disadvantages. Let's explore these aspects in our subnetting primer:

Advantages of Subnetting:

  1. Enhanced Security:
    Subnetting allows the isolation of one network from another. For example, it can prevent unauthorized access to sensitive departments within an organization, like the Developer's department.

  2. Prioritization:
    Subnetting makes it possible to allocate higher network priority to specific subnets. It is useful, for instance, when a department, like Sales, requires hosting webcasts or video conferences.

  3. Efficient Maintenance:
    In the case of smaller networks, maintenance becomes more straightforward, as managing a smaller number of devices and addressing issues is less complex.

Disadvantages of Subnetting:

  1. Complexity:
    Subnetting introduces complexity, as it requires managing multiple levels of addressing, including network, subnet, host, and process IDs. Before subnetting, you only need to find the network and host IDs.

  2. IP Address Wastage:
    A single network discards only two IP addresses representing network and broadcast addresses. However, subnetting entails the wastage of two IP addresses for each subnet, causing a notable increase in inefficiency in IP address utilization.

  3. Increased Costs:
    Implementing subnetting involves internal networking devices like routers, switches, hubs, and bridges, which can be costly. It increases the overall network infrastructure expenses. This subnetting primer emphasizes that the pros often outweigh the cons, especially in large networks.

In conclusion, while subnetting offers numerous advantages, including efficient use of IP addresses and improved network control, it does require a slightly more complex process for determining IP addresses.

Conclusion

As we wrap up this subnetting primer, it's important to summarize the key takeaways that make subnetting a valuable asset in network management. Here are the main points to remember:

  • Subnetting enables the logical division of a larger network into smaller, more manageable units.
  • It provides a more structured approach to allocating IP addresses, thereby optimizing the use of available address spaces.
  • By isolating different segments, subnetting enhances the overall security of the network.
  • While subnetting introduces an additional layer of complexity in network configuration, the multitude of benefits often justifies this added complexity.