An Internet Service Provider (ISP) has the following chunk of CIDR-based IP addresses available with it: 245.248.128.0/20. The ISP wants to give half of this chunk of addresses to Organization A, and a quarter to Organization B, while retaining the remaining with itself. Which of the following is a valid allocation of addresses to A and B?
The correct answer is
245.248.136.0/21 and 245.248.128.0/22
Understanding ISP CIDR Allocation and Subnetting
This question involves an Internet Service Provider (ISP) dividing a large block of IP addresses, given in CIDR (Classless Inter-Domain Routing) notation, among different organizations. We need to determine a valid allocation of addresses to Organization A and Organization B based on the specified proportions.
Analyzing the Original CIDR Block
The ISP has the chunk of addresses: 245.248.128.0/20.
The /20 indicates that the first 20 bits of the IP address represent the network portion, and the remaining $32 - 20 = 12$ bits are available for host addresses.
The total number of addresses in this block is $2^{12}$.
Let's look at the binary representation of the network address 245.248.128.0 and the /20 mask:
Octet
Decimal
Binary
/20 Mask Bits
1st
245
11110101
Network
2nd
248
11111000
Network
3rd
128
10000000
First 4 bits Network, Last 4 bits Host
4th
0
00000000
Host
The network prefix is 245.248.1000xxxx.xxxxxxxx, where 'x' represents host bits. The network ID is 245.248.128.0.
The range of addresses in 245.248.128.0/20 is from 245.248.128.0 (10000000.00000000 in the last two octets) to 245.248.143.255 (10001111.11111111 in the last two octets). This is because the first 4 bits of the 3rd octet are fixed (1000), and the remaining 4 bits of the 3rd octet and all 8 bits of the 4th octet are host bits (ranging from 0000 to 1111 in the 3rd octet, and 00000000 to 11111111 in the 4th octet).
Determining Required Subnet Sizes for Organizations
The ISP wants to give:
Half of the chunk to Organization A. Half of $2^{12}$ addresses is $2^{11}$ addresses. A block with $2^{11}$ addresses corresponds to a CIDR prefix of /21 ($32 - 11 = 21$). So, A needs a /21 block.
A quarter of the chunk to Organization B. A quarter of $2^{12}$ addresses is $2^{10}$ addresses. A block with $2^{10}$ addresses corresponds to a CIDR prefix of /22 ($32 - 10 = 22$). So, B needs a /22 block.
The remaining quarter is retained by the ISP, which is also $2^{10}$ addresses, corresponding to another /22 block.
Thus, the original /20 block must be partitioned into one /21 block (for A) and two /22 blocks (one for B and one for the ISP). Note that a /21 block is equivalent in size to two /22 blocks ($2^{11} = 2 \times 2^{10}$).
This means the original /20 block must be split into two /21 blocks first. One of these /21 blocks will be allocated to A, and the other /21 block will be further split into two /22 blocks for B and the ISP.
Finding Valid Subnets within the Original Block
The two possible /21 subnets derived from 245.248.128.0/20 are:
These two /21 blocks together cover the entire 245.248.128.0/20 range.
The possible /22 subnets within 245.248.128.0/20 are:
245.248.128.0/22: Network prefix 245.248.100000xx.xxxxxxxx. Range: 245.248.128.0 - 245.248.131.255 (This is a subnet of 245.248.128.0/21)
245.248.132.0/22: Network prefix 245.248.100001xx.xxxxxxxx. Range: 245.248.132.0 - 245.248.135.255 (This is a subnet of 245.248.128.0/21)
245.248.136.0/22: Network prefix 245.248.100010xx.xxxxxxxx. Range: 245.248.136.0 - 245.248.139.255 (This is a subnet of 245.248.136.0/21)
245.248.140.0/22: Network prefix 245.248.100011xx.xxxxxxxx. Range: 245.248.140.0 - 245.248.143.255 (This is a subnet of 245.248.136.0/21)
Evaluating the Allocation Options
We need to find an option where A gets a /21 block and B gets a /22 block, and these blocks are within the original /20 block and do not overlap.
Option 1: A gets 245.248.136.0/21 and B gets 245.248.128.0/22
A's allocation (245.248.136.0/21): This is one of the two /21 subnets of the original /20 block. Size is correct for A. Range is 245.248.136.0 - 245.248.143.255.
B's allocation (245.248.128.0/22): This is one of the four /22 subnets of the original /20 block. Size is correct for B. Range is 245.248.128.0 - 245.248.131.255.
Overlap Check: A's range (136-143) and B's range (128-131) do not overlap.
Fit Check: Both blocks are entirely within the original 245.248.128.0/20 range (128-143).
Partition Check: If A gets 245.248.136.0/21, the remaining block is 245.248.128.0/21. This remaining /21 block (245.248.128.0 - 245.248.135.255) can be split into two /22 blocks: 245.248.128.0/22 and 245.248.132.0/22. If B gets 245.248.128.0/22, then the ISP can retain 245.248.132.0/22. This partition (one /21 and two /22s) fits the distribution requirement.
Option 1 represents a valid, non-overlapping allocation that meets the size requirements and is contained within the parent block.
Option 2: A gets 245.248.128.0/21 and B gets 245.248.128.0/22
A needs /21, B needs /22. The sizes are correct.
However, the block 245.248.128.0/22 (range 245.248.128.0 - 245.248.131.255) is entirely contained within the block 245.248.128.0/21 (range 245.248.128.0 - 245.248.135.255). This indicates overlap, which is invalid for allocation.
Option 3: A gets 245.248.132.0/22 and B gets 245.248.132.0/21
The required sizes are /21 for A and /22 for B. This option proposes giving A a /22 and B a /21, which is incorrect based on the required proportions (half for A, quarter for B).
Option 4: A gets 245.248.136.0/24 and B gets 245.248.132.0/21
The required sizes are /21 for A and /22 for B. This option proposes giving A a /24 and B a /21, which is incorrect based on the required proportions.
Therefore, only Option 1 provides a valid allocation that satisfies the size requirements for A and B and ensures their blocks are within the original ISP chunk and do not overlap.
Revision Table: CIDR Allocation Concepts
CIDR Prefix (e.g., /20)
Number of Host Bits
Total Addresses ($2^{\text{host bits}}$)
Relative Size (compared to /20)
/20
$32-20=12$
$2^{12}$
1 (Whole Chunk)
/21
$32-21=11$
$2^{11}$
1/2 (Half)
/22
$32-22=10$
$2^{10}$
1/4 (Quarter)
Additional Information on CIDR and Subnetting
CIDR allows for more efficient use of IP addresses compared to the old class-based system (Class A, B, C). It achieves this by allowing network administrators to define network prefixes of arbitrary length using a subnet mask or the CIDR notation (the '/').
Subnetting: This is the process of dividing a large network block into smaller subnetworks. When you subnet, you borrow bits from the host portion of the IP address and add them to the network portion. Increasing the network prefix length (e.g., from /20 to /21 or /22) creates smaller subnets.
Supernetting: This is the opposite process, combining multiple smaller network blocks into a larger one with a shorter prefix.
IP Address Range: The range of usable IP addresses in a subnet is between the network address (first address) and the broadcast address (last address). The network address has all host bits set to 0, and the broadcast address has all host bits set to 1. These two addresses are typically not assigned to hosts.
Non-overlapping Allocation: When allocating IP addresses from a parent block to different sub-networks or organizations, the allocated blocks must not have any addresses in common. Overlapping allocations would lead to routing conflicts.
Hierarchical Structure: CIDR allocation often follows a hierarchical structure. A large block is split into smaller blocks, and those smaller blocks can be split further. In this problem, the /20 block is split into /21s, and one of the /21s is further split into /22s.
Was this answer helpful?
Important Questions from IPv4
A classless address is given as 167.199.170.82/27. The number of addresses in the network is