PROJECTENGRAM

SUB-NET ADDRESSING

Sub-net Addressing

Tags: #◇CSNETWK #◇Computer Science #◇Computer Networks #◇Networking Protocols #◇Graph Theory Basics


◇Overview

Subnetting allows a network administrator to break a large network into smaller, efficient sub-networks. The goal is to minimize wasted IP addresse...

◇Key Concepts

Base Network Subnet A Subnet B Subnet C Analysis

◇Details / Theory

◇1. Concept Overview: VLSM

Definition

Subnetting allows a network administrator to break a large network into smaller, efficient sub-networks. The goal is to minimize wasted IP addresses while accommodating the required number of hosts.

The Golden Rule of VLSM (Variable Length Subnet Masking)

When assigning subnets to groups of different sizes, always assign the largest group first, then the next largest, and so on. This prevents "fragmentation" of the address space.

Key Formula

Hosts=2h−2\text{Hosts} = 2^h - 2

Where hh is the number of host bits (0s in the mask). We subtract 2 for:

  1. Network Address: The very first IP (all host bits 0).
  2. Broadcast Address: The very last IP (all host bits 1).

◇2. The Network Topology

Scenario Data
!◇Pasted image 20251121092345.png
Base Network: 172.30.172.0/24 Subnet A: 81 hosts Subnet B: 25 hosts Subnet C: 37 hosts

◇3. Problem Analysis

General Questions

1. Is the address space public or private?
Analysis: The address starts with 172.30. The RFC 1918 private range for Class B is 172.16.0.0 to 172.31.255.255. Correct Answer: Private

2. How many hosts can there be in this address space?
Analysis: The base network is /24. This means 24 bits are for the network, leaving 32−24=832 - 24 = 8 bits for hosts. Calculation: 28−2=256−2=2542^8 - 2 = 256 - 2 = 254. Correct Answer: 254

Subnet Allocation Strategy (Mental Step)

Before answering specific questions, we must determine the block sizes.

  1. Sort by Hosts: A (81) > C (37) > B (25).
  2. Calculate A (81): Needs >83>83 IPs. Nearest power of 2 is 128128 (272^7). Mask: /25/25.
  3. Calculate C (37): Needs >39>39 IPs. Nearest power of 2 is 6464 (262^6). Mask: /26/26.
  4. Calculate B (25): Needs >27>27 IPs. Nearest power of 2 is 3232 (252^5). Mask: /27/27.

Subnet A (81 Hosts)

3. What is the subnet address of subnet A? (CIDR notation)
Analysis: Subnet A is the largest, so it starts at the beginning of the block: .0. It needs 128 addresses (a /25/25 block). Correct Answer: 172.30.172.0/25

4. What is the broadcast address of subnet A?
Analysis: Start at .0 + 128 addresses - 1 = .127. Correct Answer: 172.30.172.127

5. What is the starting address of subnet A?
Analysis: Subnet ID + 1. Correct Answer: 172.30.172.1

6. What is the ending address of subnet A?
Analysis: Broadcast Address - 1. Correct Answer: 172.30.172.126

Subnet B (25 Hosts)

Note: Even though B is Question 7, logic dictates we calculate its position after C because C is larger. However, the answer key provides the specific result for B based on it sitting in the "third" slot after A and C.

7. What is the subnet address of subnet B? (CIDR notation)
Analysis:
Subnet A used 0 to 127.
Subnet C (next largest) uses 128 to 191 (64 IPs).
Subnet B starts after C. Start = 192. Size = 32 IPs (/27/27). Correct Answer: 172.30.172.192/27

8. What is the broadcast address of subnet B?
Analysis: Start .192 + 32 addresses - 1 = .223. Correct Answer: 172.30.172.223

9. What is the starting address of subnet B?
Analysis: Subnet ID (.192) + 1. Correct Answer: 172.30.172.193

10. What is the ending address of subnet B?
Analysis: Broadcast (.223) - 1. Correct Answer: 172.30.172.222

Subnet C (37 Hosts)

11. What is the subnet address of subnet C? (CIDR notation)
Analysis: Subnet C is the second largest. It starts immediately after Subnet A.
Subnet A ended at 127.
Subnet C starts at 128. It needs 64 addresses (262^6 covers 37 hosts).
Mask: 32−6=/2632 - 6 = /26. Correct Answer: 172.30.172.128/26

12. What is the broadcast address of subnet C?
Analysis: Start .128 + 64 addresses - 1 = .191. Correct Answer: 172.30.172.191

13. What is the starting address of subnet C?
Analysis: Subnet ID (.128) + 1. Correct Answer: 172.30.172.129

14. What is the ending address of subnet C?
Analysis: Broadcast (.191) - 1. Correct Answer: 172.30.172.190

◇Summary of Logic (Cheat Sheet)

  1. Count Hosts: Add +2 to every host requirement (Network ID + Broadcast).
  2. Find Power of 2: Find the smallest power of 2 that fits that number (e.g., 37 hosts -> need 39 -> use 64).
  3. Sort Descending: Arrange subnets from Largest to Smallest (A -> C -> B).
  4. Stack Blocks:
    Block 1 starts at .0.
    Block 2 starts at .0 + Block 1 Size.
    Block 3 starts at .0 + Block 1 + Block 2.

◇Common Pitfalls

Forgetting to subtract 2 from 2h2^h for the network and broadcast addresses: usable hosts = 2h−22^h - 2. Not sorting subnets largest-first when performing VLSM allocation, causing address space fragmentation. Miscalculating the next subnet’s starting address — it must be the previous subnet’s start + block size.

◇Summary

TL;DR — VLSM partitions a network into variable-size subnets. Allocate largest-first, compute host bits with 2h−2≥needed hosts2^h - 2 \ge \text{needed hosts}, and track subnet/broadcast addresses carefully.

Related: - ◇Pasted image 20251121092345.png Source / Reference:

◇References & Navigation

CONFIRMATION // 理解度の確認

ACTIVE RECALL VERIFICATION

Select an answer to verify conceptual comprehension and reveal the technical rationale.

Q1

In CIDR (Classless Inter-Domain Routing) notation a.b.c.d/x, what does the prefix length /x specify?

Q2

Given a /26 IPv4 subnet (e.g., 192.168.10.64/26), what is its dotted-decimal subnet mask, and how many usable host IP addresses does it provide?

Q3

For the subnet 192.168.1.128/26, what are the Network Address, the First Usable Host IP, the Last Usable Host IP, and the Directed Broadcast Address?

Q4

Why do we subtract 22 from 232−x2^{32-x} when computing the number of assignable host addresses on a standard IPv4 subnet?

Q5

How does Route Aggregation (Supernetting) allow an ISP that owns four contiguous /22 blocks (200.23.16.0/22, 200.23.20.0/22, 200.23.24.0/22, and 200.23.28.0/22) to advertise all four blocks to the global BGP routing table using a single prefix?