# Q2 · Allocate three VLSM blocks

Subject: Computer Networks

Exam: M2

Reader: https://deep-learning-study-room.vercel.app/cn/#m2/mocks/mock-b/q2

Canonical: https://deep-learning-study-room.vercel.app/read/cn/m2/mocks/mock-b--q2/

Q1(a)+Q1(b) compulsory; choose any two of Q2/Q3/Q4 · 10 marks attempted

### Question. Allocate non-overlapping VLSM subnets inside 192.168.40.0/24 for A: 60 usable hosts, B: 30 usable hosts, C: 12 usable hosts. Allocate largest requirements first. Give all ranges and unallocated addresses. [3 practice marks]

#### Answer

## Given

| Department | Usable hosts |
| --- | --- |
| A | 60 |
| B | 30 |
| C | 12 |

## To find

An aligned subnet for each department, usable ranges, broadcasts and remaining addresses.

## Formula and why



$$
2^h-2\geq H,\quad p=32-h
$$



Choose the smallest sufficient subnet per requirement. Align each start to its block size and never overlap a previously assigned range.

## Step-by-step solution

#### Step 1. Sort the host requirements

A (60) → B (30) → C (12)

#### Step 2. A · choose and allocate

60 hosts require 26−2=62 usable; a smaller /27 would give 30. Choose /26. The next aligned block is 192.168.40.0/26; it ends at 192.168.40.63.

#### Step 3. B · choose and allocate

30 hosts require 25−2=30 usable; a smaller /28 would give 14. Choose /27. The next aligned block is 192.168.40.64/27; it ends at 192.168.40.95.

#### Step 4. C · choose and allocate

12 hosts require 24−2=14 usable; a smaller /29 would give 6. Choose /28. The next aligned block is 192.168.40.96/28; it ends at 192.168.40.111.

#### Step 5. Write the complete allocation

| Group | Hosts | Network/prefix | Mask | Usable range | Broadcast | Spare usable |
| --- | --- | --- | --- | --- | --- | --- |
| A | 60 | 192.168.40.0/26 | 255.255.255.192 | 192.168.40.1–192.168.40.62 | 192.168.40.63 | 2 |
| B | 30 | 192.168.40.64/27 | 255.255.255.224 | 192.168.40.65–192.168.40.94 | 192.168.40.95 | 0 |
| C | 12 | 192.168.40.96/28 | 255.255.255.240 | 192.168.40.97–192.168.40.110 | 192.168.40.111 | 2 |

#### Step 6. Count addresses reserved and left

Reserved=64+32+16=112. Parent total=256. Unallocated=256−112=144.

**Final answer:** 112 total addresses reserved; 144 unallocated. The table gives one valid complete allocation.

#### What this result means

Unused usable capacity inside assigned subnets is different from unallocated address space outside those subnets.
