Example Problems IP Addressing

 

Question-1

An organization is given:

192.168.20.75/26

Find:

  1. Number of addresses
  2. Network address
  3. Last address
  4. Address mask

Solution

Step 1: Number of addresses

232−26=26=64

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:

  1. One subblock requiring 10 addresses
  2. One subblock requiring 60 addresses
  3. 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:

ItemAddress
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:

N=232−nN = 2^{32-n}

For 128 addresses:

128=27128 = 2^7

Therefore:





32−n=7
32-n=7
n=25n=25

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:

PropertyValue
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

64=2664=2^6

Therefore:


32−n=6
32-n=6
n=26n=26

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

PropertyValue
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

16=2416=2^4

Therefore:


32−n=4
32-n=4
n=28n=28

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

PropertyValue
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:

128+64+16=208128+64+16=208

Addresses remaining:

256−208=48256-208=48

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

SubnetRequired AddressesAllocated AddressesPrefixAddress Range
Subnet 1    120128/2514.24.74.0 – 14.24.74.127
Subnet 2    6064/2614.24.74.128 – 14.24.74.191
Subnet 3    1016/2814.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:

  1. The new subnet mask.
  2. The number of addresses in each subnet.
  3. The network address of each subnet.
  4. The broadcast address of each subnet.
  5. 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:

2n≥42^n \geq 4

Therefore:

22=42^2=4

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:

32−26=632-26=6

host bits.

Therefore:

26=642^6=64

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:

256−192=64256-192=64

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

SubnetNetwork AddressFirst HostLast HostBroadcastTotal Addresses
1192.168.10.0/26    192.168.10.1    192.168.10.62    192.168.10.63    64
2192.168.10.64/26    192.168.10.65    192.168.10.126    192.168.10.127    64
3192.168.10.128/26    192.168.10.129    192.168.10.190    192.168.10.191    64
4192.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:

  1. The number of addresses in the supernet.
  2. The supernet mask.
  3. The CIDR notation of the supernet.
  4. The first and last address of the supernet.
  5. 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:

4=224=2^2

we need to combine 4 equal-sized networks.

Each Class C network contains:

28=2562^8=256

addresses.

Therefore, the total number of addresses is:

4×256=10244\times256=1024

So the supernet contains 1024 addresses.


Step 2: Find the new prefix length

Each original network has:

/24

We are combining 4 networks.

Since:

4=224=2^2

we can reduce the prefix length by 2 bits:

24−2=2224-2=22

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:

256−252=4256-252=4

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

ItemAnswer
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

Popular posts from this blog

Computer Networks PCCST501 Semester 5 KTU CS 2024 Scheme - Dr Binu V P

Introduction to Computer Networks

TCP/IP Protocol Suite