IPv4 Addressing and Subnetting Made Easy: FLSM, VLSM & Step-by-Step Calculation Guide for TU BCA
Author: Bhuban Subedi | Subject: Computer Networks (CACS303) | Semester: Fifth Semester
In the Tribhuvan University (TU) BCA Fifth Semester Computer Networks (CACS303) board examination, IPv4 Subnetting numerical problems carry 8 to 10 full marks.
Subnetting is the mathematical process of partitioning a single large physical network into multiple smaller, logically segmented logical subnetworks to reduce broadcast congestion, optimize IP address allocation, and enforce network security boundaries.
In this guide, we will break down IPv4 Classful ranges, master CIDR (Classless Inter-Domain Routing) prefix calculations, and solve step-by-step numericals for both Fixed Length Subnet Masking (FLSM) and Variable Length Subnet Masking (VLSM).
1. Classful IPv4 Addressing Hierarchy
An IPv4 address is a 32-bit binary number written as four 8-bit octets separated by decimal points (W.X.Y.Z).
+-------+--------------------+-----------------------+-------------------+-------------------------------+
| Class | First Octet Range | Default Subnet Mask | Network / Host Bits| Total Usable Hosts per Network|
+-------+--------------------+-----------------------+-------------------+-------------------------------+
| **A** | `1.0.0.0` - `126` | `255.0.0.0` (/8) | 8 Net, 24 Host | $2^{24} - 2 = 16,777,214$ |
| **B** | `128.0.0.0` - `191`| `255.255.0.0` (/16) | 16 Net, 16 Host | $2^{16} - 2 = 65,534$ |
| **C** | `192.0.0.0` - `223`| `255.255.255.0` (/24) | 24 Net, 8 Host | $2^{8} - 2 = 254$ |
| **D** | `224.0.0.0` - `239`| Reserved for Multicast| N/A | N/A |
| **E** | `240.0.0.0` - `255`| Experimental / R&D | N/A | N/A |
+-------+--------------------+-----------------------+-------------------+-------------------------------+
Special Loopback Address:
127.0.0.1is reserved globally for local host loopback testing.
Private IPv4 Address Ranges (RFC 1918):
- Class A Private:
10.0.0.0to10.255.255.255 - Class B Private:
172.16.0.0to172.31.255.255 - Class C Private:
192.168.0.0to192.168.255.255
2. Fundamental Subnetting Mathematics
To subdivide a network, we borrow $s$ bits from the Host portion and assign them to the Network portion:
$$\mathbf{Number\ of\ Subnets\ Created} = 2^s$$
$$\mathbf{Total\ IP\ Addresses\ per\ Subnet\ (Block\ Size)} = 2^h$$
$$\mathbf{Usable\ Hosts\ per\ Subnet} = 2^h – 2$$
Why do we subtract 2? Because in every subnet:
1. The First Address is reserved as the Network ID (identifies the subnet).
2. The Last Address is reserved as the Directed Broadcast Address (sends data to all hosts in that subnet).
3. Solved Numerical 1: Fixed Length Subnet Masking (FLSM)
Board Question:
“Given the network IP address
192.168.10.0/24, divide this network into 4 equal subnets. For each subnet, find:
1. Subnet Mask
2. Network ID
3. First Usable IP Address
4. Last Usable IP Address
5. Broadcast Address” (TU BCA 10 Marks)
Step-by-Step Solution:
Step 1: Calculate Borrowed Bits ($s$)
We need 4 subnets:
$$2^s \ge 4 \implies s = 2 \text{ bits borrowed}$$
Step 2: Calculate Remaining Host Bits ($h$)
Original /24 network has 8 host bits.
$$h = 8 – 2 = 6 \text{ host bits remaining}$$
Step 3: Determine New Custom Subnet Mask
New prefix $= /24 + 2 = \mathbf{/26}$.
In binary (4th octet): 11000000 $= 128 + 64 = 192$.
$$\mathbf{Subnet\ Mask: 255.255.255.192}$$
Step 4: Calculate Block Size / Step Increment
$$\text{Block Size} = 2^h = 2^6 = 64$$
Step 5: Construct the Complete Subnet Allocation Table
+--------+------------------+------------------+------------------+------------------+---------------+
| Subnet | Network ID | First Usable IP | Last Usable IP | Broadcast ID | Usable Hosts |
+--------+------------------+------------------+------------------+------------------+---------------+
| **1** | `192.168.10.0` | `192.168.10.1` | `192.168.10.62` | `192.168.10.63` | 62 hosts |
| **2** | `192.168.10.64` | `192.168.10.65` | `192.168.10.126` | `192.168.10.127` | 62 hosts |
| **3** | `192.168.10.128` | `192.168.10.129` | `192.168.10.190` | `192.168.10.191` | 62 hosts |
| **4** | `192.168.10.192` | `192.168.10.193` | `192.168.10.254` | `192.168.10.255` | 62 hosts |
+--------+------------------+------------------+------------------+------------------+---------------+
4. FLSM vs. VLSM: The Critical Difference
+------------------------------------+------------------------------------+
| Fixed Length Subnet Mask (FLSM) | Variable Length Subnet Mask (VLSM) |
+------------------------------------+------------------------------------+
| All subnets have the **exact same | Subnets have **different sizes** |
| size and subnet mask**. | tailored to exact host requirements|
+------------------------------------+------------------------------------+
| Wastes IP addresses when branches | Maximum IP conservation and zero |
| have vastly different host counts. | wasted addresses. |
+------------------------------------+------------------------------------+
| Supported by legacy routing (RIPv1)| Requires classless routing (RIPv2, |
| without CIDR prefix propagation. | OSPF, EIGRP, BGP). |
+------------------------------------+------------------------------------+
Frequently Asked Questions (FAQ)
Q1: What does /28 mean in CIDR notation?
/28 means that the first 28 bits of the 32-bit IPv4 address represent the network portion, leaving $32 – 28 = 4$ bits for hosts. This yields $2^4 = 16$ total IP addresses ($16 – 2 = 14$ usable hosts per subnet).
Q2: Why is subnetting essential in modern IT infrastructure?
Subnetting prevents broadcast storms by limiting broadcast traffic to local subnets, improves routing lookup table efficiency, and allows network engineers to isolate departments (e.g., HR, Finance, Student Wi-Fi) with granular firewall Access Control Lists (ACLs).



