Example Problems IP Addressing
Question-1
An organization is given:
192.168.20.75/26
Find:
- Number of addresses
- Network address
- Last address
- Address mask
Solution
Step 1: Number of addresses
So:
64 addresses
Step 2: Mask
/26 means:
11111111.11111111.11111111.11000000
Therefore:
255.255.255.192
Step 3: Find the block
A /26 has blocks of 64:
0–63 64–127 128–191 192–255
75 belongs to:
64–127
Therefore:
Network address = 192.168.20.64 Last address = 192.168.20.127
Final answer
Address : 192.168.20.75/26 Mask : 255.255.255.192 Addresses : 64 Network : 192.168.20.64 Last address : 192.168.20.127
Question-2
An organization is granted the following block of IPv4 addresses:
Beginning address: 14.24.74.0/24
The organization needs three subblocks for three different subnets:
- One subblock requiring 10 addresses
- One subblock requiring 60 addresses
- One subblock requiring 120 addresses
Design the three subblocks.
Solution
Step 1: Find the total number of addresses available
The given prefix is /24.
The number of host bits is:
32 − 24 = 8 bits
Therefore, the total number of addresses is:
2⁸ = 256 addresses
So the organization's complete address block is:
| Item | Address |
|---|---|
| First address | 14.24.74.0 |
| Last address | 14.24.74.255 |
| Total addresses | 256 |
The organization therefore has:
14.24.74.0 – 14.24.74.255
Step 2: Allocate addresses starting with the largest requirement
A very important rule in this problem is:
Allocate the largest subblock first, then the next largest, and finally the smallest.
Why?
Because each subblock must contain a power of 2 number of addresses.
The requirements are:
- 120 addresses
- 60 addresses
- 10 addresses
We handle them in this order.
Subblock 1 — Requirement: 120 Addresses
The organization needs 120 addresses.
Since 120 is not a power of 2, we must allocate the next higher power of 2:
120 → 128
So, we allocate 128 addresses.
Find the prefix length
We know:
For 128 addresses:
Therefore:
So the subnet is:
/25
Address range
We start with:
14.24.74.0
A block of 128 addresses occupies:
14.24.74.0 – 14.24.74.127
Therefore:
| Property | Value |
|---|---|
| Required | 120 |
| Allocated | 128 |
| Prefix | /25 |
| First address | 14.24.74.0 |
| Last address | 14.24.74.127 |
Subblock 1
14.24.74.0/25
Subblock 2 — Requirement: 60 Addresses
The next requirement is 60 addresses.
Again, 60 is not a power of 2.
The next higher power of 2 is:
60 → 64
So we allocate 64 addresses.
Find the prefix length
Therefore:
So the subnet prefix is:
/26
The first subblock used addresses up to:
14.24.74.127
Therefore, the next available address is:
14.24.74.128
A block of 64 addresses occupies:
14.24.74.128 – 14.24.74.191
| Property | Value |
|---|---|
| Required | 60 |
| Allocated | 64 |
| Prefix | /26 |
| First address | 14.24.74.128 |
| Last address | 14.24.74.191 |
Subblock 2
14.24.74.128/26
Subblock 3 — Requirement: 10 Addresses
The final requirement is 10 addresses.
10 is not a power of 2.
The next higher power of 2 is:
10 → 16
So we allocate 16 addresses.
Find the prefix length
Therefore:
So the subnet prefix is:
/28
The next available address after 14.24.74.191 is:
14.24.74.192
A block of 16 addresses occupies:
14.24.74.192 – 14.24.74.207
| Property | Value |
|---|---|
| Required | 10 |
| Allocated | 16 |
| Prefix | /28 |
| First address | 14.24.74.192 |
| Last address | 14.24.74.207 |
Subblock 3
14.24.74.192/28
Step 4: Find the Remaining Addresses
The organization originally had:
256 addresses
Allocated:
- First subnet = 128
- Second subnet = 64
- Third subnet = 16
Therefore:
Addresses remaining:
The unused addresses start immediately after 14.24.74.207.
Therefore:
Remaining range:
14.24.74.208 – 14.24.74.255
So, 48 addresses remain in reserve.
Final Answer
| Subnet | Required Addresses | Allocated Addresses | Prefix | Address Range |
|---|---|---|---|---|
| Subnet 1 | 120 | 128 | /25 | 14.24.74.0 – 14.24.74.127 |
| Subnet 2 | 60 | 64 | /26 | 14.24.74.128 – 14.24.74.191 |
| Subnet 3 | 10 | 16 | /28 | 14.24.74.192 – 14.24.74.207 |
| Reserve | — | 48 | — | 14.24.74.208 – 14.24.74.255 |
Address allocation visually
Key idea for students
This is an example of classless subnetting using CIDR/VLSM. The important steps are:
Requirement → next power of 2 → calculate prefix → allocate continuously → repeat
For example:
-
120 → 128 → /25 -
60 → 64 → /26 -
10 → 16 → /28
Notice that the subnets have different prefix lengths. This is the major advantage of classless addressing: the organization does not have to give every subnet the same number of addresses.
Question -3
An organization has been assigned the following network address:
192.168.10.0/24
The organization wants to divide this network into 4 equal-sized subnets.
Find:
- The new subnet mask.
- The number of addresses in each subnet.
- The network address of each subnet.
- The broadcast address of each subnet.
- The range of host addresses in each subnet.
Solution
Step 1: Identify the class
The first octet is 192.
Class C addresses have the first octet from 192 to 223.
Therefore:
192.168.10.0 is a Class C network.
The default Class C prefix is:
/24
or
255.255.255.0
Initially, there are 8 host bits.
Step 2: Determine the number of bits to borrow
We need 4 subnets.
We know:
Therefore:
So, we need to borrow 2 bits from the host portion.
Originally:
Network portion Host portion 11111111.11111111.11111111.00000000 /24
After borrowing 2 bits:
Network portion Subnet Host 11111111.11111111.11111111.11000000 ↑↑ 2 borrowed bits
The new prefix becomes:
/26
Step 3: Find the new subnet mask
/26 means 26 bits are 1:
11111111.11111111.11111111.11000000
Converting to decimal:
255.255.255.192
Therefore:
New subnet mask = 255.255.255.192 (/26)
Step 4: Find the number of addresses per subnet
There are now:
host bits.
Therefore:
Each subnet contains 64 addresses.
Of these, normally:
- 1 address = network address
- 62 addresses = usable host addresses
- 1 address = broadcast address
So each subnet has 62 usable host addresses.
Step 5: Find the Subnets
The interesting part is the last octet.
The subnet mask is:
255.255.255.192
The block size is:
Therefore, the subnet addresses occur in increments of 64:
0 64 128 192
So we get four subnets.
Subnet 1
Network address:
192.168.10.0
Broadcast address:
192.168.10.63
Usable hosts:
192.168.10.1 – 192.168.10.62
Subnet 2
Network address:
192.168.10.64
Broadcast address:
192.168.10.127
Usable hosts:
192.168.10.65 – 192.168.10.126
Subnet 3
Network address:
192.168.10.128
Broadcast address:
192.168.10.191
Usable hosts:
192.168.10.129 – 192.168.10.190
Subnet 4
Network address:
192.168.10.192
Broadcast address:
192.168.10.255
Usable hosts:
192.168.10.193 – 192.168.10.254
Final Answer
| Subnet | Network Address | First Host | Last Host | Broadcast | Total Addresses |
|---|---|---|---|---|---|
| 1 | 192.168.10.0/26 | 192.168.10.1 | 192.168.10.62 | 192.168.10.63 | 64 |
| 2 | 192.168.10.64/26 | 192.168.10.65 | 192.168.10.126 | 192.168.10.127 | 64 |
| 3 | 192.168.10.128/26 | 192.168.10.129 | 192.168.10.190 | 192.168.10.191 | 64 |
| 4 | 192.168.10.192/26 | 192.168.10.193 | 192.168.10.254 | 192.168.10.255 | 64 |
Easy way to remember
Class C Network 192.168.10.0/24 ↓ Borrow 2 bits ↓ 192.168.10.0/26 ↓ 4 subnets ↓ 64 addresses/subnet
Subnet ranges:
0 ─────── 63 64 ─────── 127 128 ────── 191 192 ────── 255
Question -4
Problem
An organization has been assigned the following four contiguous Class C networks:
-
192.168.4.0/24 -
192.168.5.0/24 -
192.168.6.0/24 -
192.168.7.0/24
The organization wants to combine these four networks into one supernet.
Find:
- The number of addresses in the supernet.
- The supernet mask.
- The CIDR notation of the supernet.
- The first and last address of the supernet.
- Explain how the four original networks are represented by the single supernet.
Solution
Step 1: Number of networks to combine
We have 4 networks.
Since:
we need to combine 4 equal-sized networks.
Each Class C network contains:
addresses.
Therefore, the total number of addresses is:
So the supernet contains 1024 addresses.
Step 2: Find the new prefix length
Each original network has:
/24
We are combining 4 networks.
Since:
we can reduce the prefix length by 2 bits:
Therefore, the supernet has:
/22
Step 3: Find the supernet mask
A /22 address has:
11111111.11111111.11111100.00000000
Converting to decimal:
255.255.252.0
Therefore:
Supernet mask = 255.255.252.0
Step 4: Find the supernet address
The four networks are:
192.168.4.0/24 192.168.5.0/24 192.168.6.0/24 192.168.7.0/24
They are contiguous, meaning there are no gaps between them.
Together they form:
192.168.4.0 ↓ 192.168.5.0 ↓ 192.168.6.0 ↓ 192.168.7.0
The combined supernet starts at:
192.168.4.0
and ends at:
192.168.7.255
Therefore:
Supernet
192.168.4.0/22
Step 5: Verify Using the Mask
The supernet mask is:
255.255.252.0
The block size in the third octet is:
Therefore, /22 networks begin at multiples of 4 in the third octet:
0, 4, 8, 12, 16, ...
Our network starts at 4, which is a valid boundary.
Thus:
192.168.4.0/22
covers:
192.168.4.0 – 192.168.4.255 192.168.5.0 – 192.168.5.255 192.168.6.0 – 192.168.6.255 192.168.7.0 – 192.168.7.255
Final Answer
| Item | Answer |
|---|---|
| Original networks | 4 |
| Addresses per network | 256 |
| Total addresses | 1024 |
| Original prefix | /24 |
| Supernet prefix | /22 |
| Supernet mask | 255.255.252.0 |
| First address | 192.168.4.0 |
| Last address | 192.168.7.255 |
| Supernet | 192.168.4.0/22 |
Comments
Post a Comment