Subnetting is one of the most important networking concepts that every IT professional should understand. It is a technique used to divide a single network into smaller sub-networks to increase network efficiency and security. Subnetting is a skill that requires both practice and theoretical knowledge. This tutorial is intended to help you master the art of subnetting.
What is Subnetting?
Subnetting is the process of dividing a large network into smaller sub-networks. In a network, every device is given a unique IP address. The IP address is a combination of two parts: network ID and host ID. The network ID identifies the network to which the device belongs, and the host ID identifies the device itself.
Subnetting allows you to create smaller networks within a large network by manipulating the network ID and host ID. This enables network administrators to better manage their networks, providing better security, and higher efficiency.
Subnetting Concepts
Before you start subnetting, you should have a good understanding of some important subnetting concepts:
1. IP Address Classes: IP addresses are divided into five classes, A, B, C, D, and E. Classes A, B, and C are commonly used in LAN networks.
2. Subnet Mask: A subnet mask is a 32-bit number used to divide an IP address into network and host parts. It is represented in dotted-decimal notation, just like an IP address.
3. CIDR Notation: Classless Inter-Domain Routing (CIDR) notation is a compact representation of an IP address and its associated subnet mask.
4. Subnetting: Subnetting involves dividing an IP address into a network ID and a host ID. This is usually done by manipulating the subnet mask.
Step-by-Step Tutorial on Subnetting
Now that you have an understanding of the basic subnetting concepts let’s dive into the step-by-step process of subnetting.
Step 1: Determine the IP Address Class
The IP address classes are as follows:
Class A: 1.0.0.0 – 126.0.0.0
Class B: 128.0.0.0 – 191.255.0.0
Class C: 192.0.0.0 – 223.255.255.0
To subgroup an IP address, you need to know which class the IP address belongs to. This will determine the default subnet mask for the IP address. For example, if the IP address is 192.168.1.1, it belongs to Class C, and its default subnet mask is 255.255.255.0.
Step 2: Convert the Default Subnet Mask to Binary
To convert the subnet mask to binary, break down each octet into 8 bits. For example, for the subnet mask 255.255.255.0, you would convert each octet into binary:
255 = 11111111
255 = 11111111
255 = 11111111
0 = 00000000
The binary representation of the subnet mask is 11111111.11111111.11111111.00000000.
Step 3: Determine the Number of Subnets Needed
Calculate the number of subnets you need to create. You can do this by assessing the number of departments/divisions, floors, buildings, or other groups of devices that will exist on your network.
Step 4: Determine the Number of Hosts per Subnet
Determine the number of hosts per subnet by considering the maximum number of devices that will connect to each subnet.
Step 5: Determine the Number of Bits Required for Subnetting
To calculate the number of bits required for subnetting, count the number of subnets and hosts per subnet. The formula is:
S = log2 N
S is the number of bits required for subnetting, and N is the number of subnets/hosts per subnet. Round up the result to the nearest whole number.
Step 6: Determine the New Subnet Mask in Binary
To calculate the new subnet mask, add the required number of bits to the original subnet mask. For example, let’s say we need 3 subnets and 200 hosts per subnet. Based on step 5, we require a total of 8 bits (2^3 = 8) to provide 3 subnets and 8 bits to provide 256 hosts per subnet. The final subnet mask will be:
11111111.11111111.11111111.11100000
Step 7: Determine the Subnet ID
To determine the subnet ID, convert the IP address and subnet mask into binary and perform an AND operation on each octet of the IP address and subnet mask. The result will be the subnet ID. For example, if the IP address is 192.168.1.1 and the subnet mask is 255.255.255.240, the subnet ID would be:
IP address = 11000000.10101000.00000001.00000001
Subnet mask = 11111111.11111111.11111111.11110000
Subnet ID = 11000000.10101000.00000001.0000
Step 8: Determine the Host ID Range
To determine the host ID range, set aside the number of bits required for subnetting and find the range of host IDs that exist for each subnet. For example, if the network ID is 192.168.1.0, and the subnet mask is 255.255.255.240, the range of host IDs for each subnet would be:
Subnet 1: Hosts 1-14
Subnet 2: Hosts 15-30
Subnet 3: Hosts 31-46
Conclusion
Subnetting is a fundamental skill for anyone working with networks. By mastering the art of subnetting, you can better manage your networks, improve efficiency, and enhance security. In this tutorial, we have outlined a step-by-step process to subnet an IP address, culminating in determining the subnet ID and host ID range for each subnet. With these steps, you can master the art of subnetting and become a more proficient network administrator.