Instiq
Chapter 1 · Network fundamentals and TCP/IP basics·v1.0.0·Updated 7/10/2026·~17 min

What's changed: Initial version

1.3IP addressing and subnet design

Key points

Covers the structure of IPv4 addresses and the classful concept, CIDR notation and the subnet mask, VLSM, which splits address space into variable-length blocks sized to the required host count, private addresses that must not leak externally, and the judgment skill of designing network segments while manually verifying subnet calculations.

Subnet design is not a "plug into the formula and get the answer" calculation exercise—it is genuine practical judgment work: allocating a limited address space without waste, sized to the required host count of each department or floor. This section builds an understanding of how CIDR/VLSM work, then practices deriving a subnet layout from actual requirements (the number of devices per department) and manually verifying the arithmetic.

1.3.1IPv4 address structure and classes

  • An IPv4 address is 32 bits, expressed in decimal as four 8-bit octets (e.g., 192.168.1.10). Historically, the leading bit pattern classified addresses into Class A/B/C (with a fixed 8/16/24-bit network portion respectively), but today CIDR makes a variable-length network portion, unconstrained by class, the mainstream approach.
  • CIDR (Classless Inter-Domain Routing) lets you freely specify the number of network-portion bits as a prefix length, such as /24. 192.168.1.0/24 means "the leading 24 bits are the network portion," and it reduces wasted address allocation by not being constrained by class.

1.3.2Subnet masks and VLSM

  • A subnet mask is a 32-bit value indicating how much of an IP address is the network portion (255.255.255.0 = /24). Within the host portion, the addresses actually assignable exclude "all bits 0" (the network address) and "all bits 1" (the broadcast address).
  • VLSM (Variable Length Subnet Mask) is the technique of splitting a single address block into subnets of different lengths sized to each department's required host count. Unlike fixed-length splitting that assigns the same size to every department, it minimizes wasted addresses.
Exam point

Most-tested: the network address (all-0) and broadcast address (all-1) cannot be assigned; the host count = 2^(number of host bits) - 2; and VLSM splits into variable lengths sized to actual need. Always manually verify subnet calculations by working through them, rather than relying solely on memorized formulas.

Suppose that, as a network designer, you are given the requirement to allocate 192.168.10.0/24 (256 addresses) across three departments using VLSM: Sales (100 hosts needed), Development (50 hosts needed), and General Affairs (20 hosts needed). First, since Sales needs to accommodate 100 devices, find the smallest n satisfying 2^n - 2 >= 100 for the host portion: 2^7-2=126 >= 100 (n=7 suffices; n=6 gives only 2^6-2=62, which falls short), so you assign a 7-bit host portion, i.e., a /25 prefix (255.255.255.128). Reserve 192.168.10.0/25 (192.168.10.0 through 192.168.10.127, of which .1 through .126—126 addresses—are assignable) for Sales, and verifying, 126 >= 100 satisfies the requirement. From the remaining 192.168.10.128/25 (128 addresses), carve out 50 hosts for Development. The smallest n satisfying 2^n-2 >= 50 is n=6 (2^6-2=62 >= 50), so assign a /26 prefix (255.255.255.192): 192.168.10.128/26 (.128 through .191, with .129 through .190—62 addresses—assignable). Finally, for General Affairs' 20 hosts, carve further out of the remaining 192.168.10.192/26 (64 addresses); the smallest n satisfying 2^n-2 >= 20 is n=5 (2^5-2=30 >= 20), so assign a /27 prefix (255.255.255.224): 192.168.10.192/27 (.192 through .223, with .193 through .222—30 addresses—assignable), satisfying the requirement while preserving the remaining 192.168.10.224/27 (30 addresses) for future expansion. Compared to a plan that assigns a fixed /26 (62 hosts) to every department, VLSM accommodates Sales' large demand of 100 hosts while minimizing surplus addresses at smaller departments—this is the rational judgment behind segment design.

DepartmentHosts neededAssigned prefixAssignable count
Sales100/25 (192.168.10.0/25)126
Development50/26 (192.168.10.128/26)62
General Affairs20/27 (192.168.10.192/27)30
Warning

Trap: "A /24 subnet can accommodate 256 hosts" is wrong—of the 2^8=256 addresses, 2 (the all-0 network address and the all-1 broadcast address) cannot be assigned, so the actual host capacity is 256-2=254. Also wrong: "VLSM is a technique that assigns the same subnet size to every department"—the essence of VLSM is assigning different lengths per department to reduce waste (splitting into equal-sized blocks is fixed-length subnetting).

IPv4, CIDR, subnetting.
Designing the address plan

1.3.3Section summary

  • CIDR specifies the network portion via prefix length. Host count = 2^(host bits) - 2 (excluding all-0/all-1)
  • VLSM splits subnets into variable lengths sized to each department's required host count, minimizing wasted addresses
  • Subnet design should be carried out as a judgment exercise grounded in manual verification plus requirements (host count needed, future expansion)

Sign in to track progress — Log in.

Quick check

(just a quick review)

Q1. A network designer wants to split `192.168.20.0/24` between department A (60 hosts needed) and department B (25 hosts needed), minimizing wasted addresses. Which prefix length is most appropriate to assign to department A?

Q2. For allocating `192.168.30.0/24` across three departments (Sales 50, Development 20, General Affairs 10) using VLSM, which policy is most rational?

Q3. For the subnet `172.16.5.0/25`, which is the correct number of IP addresses actually assignable to hosts?

Check your understandingPractice questions for Chapter 1: Network fundamentals and TCP/IP basics