Subnetting, FLSM & VLSM in networking — An Analysis
Subnetting, FLSM & VLSM in networking — An Analysis
Subnetting is the process of dividing a larger network (IP address range) into smaller, more manageable sub-networks (subnets). This is often used in IP networking to improve security, efficiency, and performance by isolating network traffic and reducing broadcast domains. IP addresses can be considered the grammar of networking as it plays a role in almost every protocol of networking. Both FLSM (Fixed Length Subnet Masking) and VLSM (Variable Length Subnet Masking) are methods used to divide IP address space into subnets, but they differ significantly in their approach.
First, let us look at an example of Subnetting for Class C IP addresses.
Suppose you have an IP address 192.168.1.0/24. (Each octet in 8 bits.)
11111111.11111111.11111111.00000000
This means out of 32 bits, 24 bits for the network and 8 bits for the hosts, allowing for 256 IP addresses (including network and broadcast addresses).
If you want to divide this into four subnets, (256/4 = 64) you must borrow 2 bits from the host portion. The number 256 is significant because it represents the range of values (0 to 255) that can be represented by an 8-bit octet in IP addresses.
11111111.11111111.11111111.11000000
So, ²² = 4 subnets. The new subnet mask would be /26. (8+8+8+2) (i.e., 255.255.255.192) 192 because ²⁷ + ²⁶ = 192.
64 indicates 64 devices per network allocated.
2 IP addresses cannot be used for all 4 subnets. That is because they are taken by the network address and the broadcast address.
- Subnet 1: (Hosts: 192.168.1.1 to 192.168.1.62) (.63 and .64)
- Subnet 2: (Hosts: 192.168.1.65 to 192.168.1.126) (.127 and .128)
- Subnet 3: (Hosts: 192.168.1.129 to 192.168.1.190) (.191 and .192)
- Subnet 4: (Hosts: 192.168.1.193 to 192.168.1.254) (.255 and .256)
FLSM (Fixed Length Subnet Masking)
- Fixed subnet size: All subnets created within a network have the same size.
- Inefficient address allocation: Can lead to wasted IP addresses, especially in networks with varying densities of devices.
- Simpler implementation: Easier to understand and implement due to its fixed nature.
VLSM (Variable Length Subnet Masking)
- Variable subnet size: Subnets can have different sizes based on the specific needs of a network segment.
- Efficient address allocation: Allows for more precise allocation of IP addresses, minimizing waste.
- Complex implementation: Requires more careful planning and configuration.
Consider a network with 100 hosts. In FLSM, you might divide the network into 4 subnets of equal size, each with 25 hosts. In this case, if one network has only 10 devices, there is wastage of 15 IP addresses. However, for instance, if only one subnet needs 50 hosts, and the others need fewer, VLSM would allow you to create a subnet with 50 hosts and smaller subnets for the others, reducing wasted IP addresses.
Hence, FLSM allows you to have equal number of IP addresses in a subnet. This can create wastage of IP addresses. On the other hand, VLSM allows each subnet to have different sizes. This means you can create smaller subnets for networks with less hosts and the opposite as well. This is advantageous as there will be less wastage of IP addresses and will make room for efficiency. Routing protocols can also be simplified.
Now, let us get to Class C IP addresses for a FLSM concept.
256 — Total number of IP addresses than can be in one group.
This is an example. 192.168.10.0/25 (Class C)
/25 will create 2 groups, which mean 256 /2 = 128 IP addresses per group.
/26 will create 4 groups, which mean 256 /4 = 64 IP addresses per group.
/27 will create 8 groups, which mean 256 /8 = 32 IP addresses per group.
/28 will create 16 groups, which mean 256 /16 = 16 IP addresses per group.
/29 will create 32 groups, which mean 256 /32 = 8 IP addresses per group.
/30 will create 64 groups, which mean 256 /64 = 4 IP addresses per group.
— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — —
Let us look at an example of Subnetting for Class B IP addresses for FLSM in detail.
Class B IP Address Overview
Range: Class B addresses range from 128.0.0.0 to 191.255.255.255.
In the above scenario, the highlighted portion is the network portion and the remaining 2 octets are the host portion.
Default Subnet Mask: 255.255.0.0 or /16 (which means the first 16 bits are used for the network portion, leaving 16 bits for host addresses).
Example Scenario:
Assume you have the IP address 172.16.0.0 and you want to subnet it into smaller networks. Let’s say you need 8 subnets for your organization. The first understanding should be 256/8 =32 IP addresses per network.
Steps to Subnet:
Determine the New Subnet Mask:
A Class B address with a /16 subnet mask provides ²¹⁶ host addresses.
To create 8 subnets, ²³ = 8. So, you need 3 additional bits (16+3=19)
List the Subnets: (32 IP addresses per network)
Subnet 1: Network: 172.16.0.0/19
Range: 172.16.0.1 to 172.16.30.254)
Broadcast: 172.16.31.255
Subnet 2: 172.16.32.0/19
Range: 172.16.32.1 to 172.16.62.254
Broadcast: 172.16.63.255
Subnet 3: 172.16.64.0/19
Range: 172.16.64.1 to 172.16.94.254
Broadcast: 172.16.95.255
Subnet 4: 172.16.96.0/19 (Range: 172.16.96.1 to 172.16.126.254, Broadcast: 172.16.127.255)
Subnet 5: 172.16.128.0/19 (Range: 172.16.128.1 to 172.16.158.254, Broadcast: 172.16.159.255)
Subnet 6: 172.16.160.0/19 (Range: 172.16.160.1 to 172.16.190.254, Broadcast: 172.16.191.255)
Subnet 7: 172.16.192.0/19 (Range: 172.16.192.1 to 172.16.222.254, Broadcast: 172.16.223.255)
Subnet 8: 172.16.224.0/19 (Range: 172.16.224.1 to 172.16.254.254, Broadcast: 172.16.255.255)
Summary:
Original Network: 172.16.0.0/16
New Subnet Mask: /19 (or 255.255.224.0) Here, 224 = 256 minus 19.
Number of Subnets: 8
Size of Each Subnet: 8192 addresses (8190 usable for hosts)
That’s because 2^(32–19), 2(13), so, 8192.
Thus, you correctly divide the original network into smaller subnets, each containing 8192 addresses. This remaining space (IP addresses) can be used for future subnets or other purposes.
— — — — — — — — — — — — — — — — — — — — — — — — — — — — —
An example of subnetting for Class C IP addresses for VLSM in detail.
Scenario:
Suppose you have a Class C IP address 192.168.1.0/24 and you need to create subnets for different departments in an organization. The departments have the following requirements:
Sales Team : 50 hosts
Accounts Team : 30 hosts
Training Team : 10 hosts
HR : 5 hosts
Steps for VLSM Subnetting:
Determine Required Subnet Sizes:
Sales Team (50 hosts): Needs at least 52 IP addresses (50 hosts + 2 for network and broadcast). The smallest subnet size that fits this requirement is /26 (which provides 64 IP addresses).
Admin (30 hosts): Needs at least 32 IP addresses (30 hosts + 2). The smallest subnet size is /27 (which provides 32 IP addresses).
Training Team (10 hosts): Needs at least 12 IP addresses (10 hosts + 2). The smallest subnet size is /28 (which provides 16 IP addresses).
HR (5 hosts): Needs at least 7 IP addresses (5 hosts + 2). The smallest subnet size is /29 (which provides 8 IP addresses).
Now, let’s assign the subnets:
Sales Team (50 hosts):
Subnet Mask: /26 (255.255.255.192)
Number of Addresses: 64
Network Address: 192.168.1.0
Usable IP Range: 192.168.1.1 to 192.168.1.62
Broadcast Address: 192.168.1.63
Admin (30 hosts):
Subnet Mask: /27 (255.255.255.224)
Number of Addresses: 32
Network Address: 192.168.1.64
Usable IP Range: 192.168.1.65 to 192.168.1.94
Broadcast Address: 192.168.1.95
Training Team (10 hosts):
Subnet Mask: /28 (255.255.255.240)
Number of Addresses: 16
Network Address: 192.168.1.96
Usable IP Range: 192.168.1.97 to 192.168.1.110
Broadcast Address: 192.168.1.111
HR (5 hosts):
Subnet Mask: /29 (255.255.255.248)
Number of Addresses: 8
Network Address: 192.168.1.112
Usable IP Range: 192.168.1.113 to 192.168.1.118
Broadcast Address: 192.168.1.119
Verify Address Space Usage:
After allocating the subnets, the remaining address space in the original 192.168.1.0/24 network is the following.
Network Address: 192.168.1.120
Usable IP Range: 192.168.1.121 to 192.168.1.254
Broadcast Address: 192.168.1.255
This remaining space (IP addresses) can be used for future subnets or other purposes.
Summary of Subnet Allocation:
Sales Team:
Address Range: 192.168.1.0/26
Usable IPs: 192.168.1.1–192.168.1.62
Admin:
Address Range: 192.168.1.64/27
Usable IPs: 192.168.1.65–192.168.1.94
Training Team:
Address Range: 192.168.1.96/28
Usable IPs: 192.168.1.97–192.168.1.110
HR:
Address Range: 192.168.1.112/29
Usable IPs: 192.168.1.113–192.168.1.118
By applying VLSM, you can efficiently utilize IP address space, creating subnets of various sizes according to specific needs while conserving address space.
Keep reading!!
“Education is the most powerful weapon which you can use to change the world.” — Nelson Mandela
Comments
Post a Comment