3.2 IPv4 Subnetting, CIDR, and VLSM
Key Takeaways
A prefix length counts network bits; a mask uses contiguous leading ones.
Conventional LAN host counts use 2^h−2, while /31 point-to-point and /32 host routes have different semantics.
VLSM assigns differently sized non-overlapping subnets from a parent block.
A valid exact summary must cover the intended components and begin on its own binary boundary.
Four /24s from 10.24.4.0 through 10.24.7.0 summarize exactly as 10.24.4.0/22.
3.2 IPv4 Subnetting, CIDR, and VLSM
Quick Answer: Subnetting divides a larger network into smaller, manageable subnets by borrowing host bits for the network portion. Classless Inter-Domain Routing (CIDR) uses prefix notation (
/n) to indicate how many bits represent the network prefix. The number of created subnets equals (where is borrowed bits), while usable hosts per subnet equals (where is remaining host bits). Specialized prefixes include/30(traditional point-to-point links with 2 usable hosts),/31(RFC 3021 point-to-point links with 2 usable hosts and zero waste), and/32(host routes for Nokia SR OS system interfaces). Variable Length Subnet Masking (VLSM) matches subnet mask sizes to actual host counts.
As internetworking expanded, the rigid boundaries of classful addressing led to severe address inefficiency. A company needing 300 host addresses was forced to request a Class B block (65,534 host addresses), wasting over 65,000 addresses. Conversely, assigning a Class C block provided only 254 addresses, insufficient for their needs. To solve this scalability crisis, the networking industry introduced Subnetting (RFC 950) and Classless Inter-Domain Routing (CIDR) (RFC 1519).
Subnet Masks and Classless Inter-Domain Routing (CIDR)
A subnet mask is a 32-bit value that informs network devices which portion of an IP address represents the network (and subnet) identifier and which portion represents the host identifier.
Binary Anatomy of a Subnet Mask
A valid subnet mask consists of a contiguous string of binary 1s followed by a contiguous string of binary 0s:
- The binary
1s designate the network and subnet portion. - The binary
0s designate the host portion. - A mask cannot have alternating or interleaved 1s and 0s (such as
11111111.11110000.11111111.00000000, which is invalid).
The Bitwise AND Operation
When a router (such as a Nokia 7750 SR) receives an IP packet, its forwarding silicon extracts the destination IP address and performs a bitwise logical AND operation with the configured subnet mask to determine the destination network address. In a bitwise AND operation, the result is 1 only if both corresponding input bits are 1; otherwise, the result is 0:
Destination IP: 192.168.10.75 -> 11000000.10101000.00001010.01001011
Subnet Mask (/26): 255.255.255.192 -> 11111111.11111111.11111111.11000000
Bitwise AND Result: -> 11000000.10101000.00001010.01000000
Network Address: 192.168.10.64
CIDR Prefix Notation
Rather than typing out long dotted-decimal masks like 255.255.255.224, CIDR introduces prefix notation (or slash notation). The prefix length /n specifies the exact number of contiguous high-order bits set to binary 1 in the mask. For instance:
/24represents 24 ones:255.255.255.0/26represents 26 ones:255.255.255.192/28represents 28 ones:255.255.255.240
CIDR also allowed route aggregation (supernetting), collapsing multiple contiguous Class C network prefixes into a single BGP route announcement (such as advertising sixteen /24 prefixes as a single /20 route), preventing global Internet routing tables from exploding.
Subnetting Mathematical Formulas
To compute subnet quantities and host capacities accurately, memorize two fundamental mathematical formulas:
1. Number of Subnets Created
Where is the number of bits borrowed from the host field of the default classful mask or previous parent prefix.
2. Number of Usable Host Addresses per Subnet
Where is the number of remaining host bits (calculated as ). The subtraction of 2 accounts for the two non-assignable addresses in any standard subnet:
- The Network Address (all host bits
0). - The Directed Broadcast Address (all host bits
1).
Common Prefixes Reference Table (/24 to /32)
| Prefix | Subnet Mask | Host Bits () | Total IPs () | Usable Hosts () | Magic Number (Block Size) | Primary Use Case |
|---|---|---|---|---|---|---|
| /24 | 255.255.255.0 | 8 | 256 | 254 | 256 () | Standard LAN segment |
| /25 | 255.255.255.128 | 7 | 128 | 126 | 128 () | Mid-size department LAN |
| /26 | 255.255.255.192 | 6 | 64 | 62 | 64 () | Medium user subnet |
| /27 | 255.255.255.224 | 5 | 32 | 30 | 32 () | Small office / branch |
| /28 | 255.255.255.240 | 4 | 16 | 14 | 16 () | Server cluster, DMZ subnet |
| /29 | 255.255.255.248 | 3 | 8 | 6 | 8 () | Firewall / router transit link |
| /30 | 255.255.255.252 | 2 | 4 | 2 | 4 () | Traditional point-to-point link |
| /31 | 255.255.255.254 | 1 | 2 | 2 (RFC 3021) | 2 () | Router point-to-point link |
| /32 | 255.255.255.255 | 0 | 1 | 1 | 1 () | Host route, Loopback/System IP |
Step-by-Step Subnet Calculation: The Magic Number Method
In certification exams like Nokia NRS I, calculating subnets mentally within 30 to 45 seconds is crucial. The fastest, most reliable technique is the Magic Number (Block Size) method.
The Four-Step Process
- Identify the Interesting Octet: Locate the octet in the subnet mask that contains a value other than
255or0. - Calculate the Magic Number: Subtract the decimal value of the interesting octet from
256:
- Determine the Network Address: Count upwards in multiples of the magic number (starting at
0, thenmagic number, , etc.) until reaching the highest multiple that is less than or equal to the IP address value in that octet. - Calculate Host Boundaries:
- First Usable Host: Network Address .
- Next Network Address: Current Network Address Magic Number.
- Directed Broadcast Address: Next Network Address .
- Last Usable Host: Directed Broadcast Address .
Worked Example 1: 192.168.10.138/27
- Target IP and Mask:
192.168.10.138with/27(255.255.255.224). - Interesting Octet: The fourth octet (
224). - Magic Number: .
- Multiples of 32:
0, 32, 64, 96, 128, 160, 192, 224. - The fourth octet value is
138, which falls between128and160. - Network Address:
192.168.10.128. - First Usable Host:
192.168.10.129. - Next Network Address:
192.168.10.160. - Directed Broadcast Address:
192.168.10.159(). - Last Usable Host:
192.168.10.158(). - Total Usable Hosts: .
Worked Example 2: 172.16.45.60/22
- Target IP and Mask:
172.16.45.60with/22(255.255.252.0). - Interesting Octet: The third octet (
252). The fourth octet mask value is0, meaning all fourth-octet host bits can vary from0to255. - Magic Number: in the third octet.
- Multiples of 4:
0, 4, 8, ..., 36, 40, 44, 48. - The third octet value is
45, which falls between44and48. - Network Address:
172.16.44.0. - First Usable Host:
172.16.44.1. - Next Network Address:
172.16.48.0. - Directed Broadcast Address:
172.16.47.255(). - Last Usable Host:
172.16.47.254. - Total Usable Hosts: .
Specialized Prefix Lengths in Service Provider Networks
In Nokia Service Router topologies and enterprise WAN designs, engineers encounter three specialized prefix lengths that diverge from standard user LAN requirements:
1. /30 Prefixes (Traditional Point-to-Point Links)
A /30 subnet mask is 255.255.255.252, leaving 2 host bits ( total addresses). Subtracting 2 gives exactly 2 usable host addresses:
- For example, in
10.1.1.0/30:- Network address:
10.1.1.0 - Router A interface:
10.1.1.1 - Router B interface:
10.1.1.2 - Directed broadcast:
10.1.1.3
- Network address:
- The Inefficiency Problem: A
/30wastes 50% of the allocated addresses (2 out of 4 addresses are consumed by network and broadcast overhead). In large telecommunications networks with tens of thousands of point-to-point links, this waste consumes significant IPv4 address space.
2. /31 Prefixes (RFC 3021 Point-to-Point Links)
To resolve /30 address waste, RFC 3021 (Using 31-Bit Prefixes on IPv4 Point-to-Point Links) was published:
- A
/31subnet mask is255.255.255.254, leaving 1 host bit ( total addresses). - On a dedicated point-to-point link connecting exactly two routers, there are no other hosts to hear broadcasts, nor is there any ambiguity about destination routing.
- Under RFC 3021, both addresses are usable as unicast host addresses: the address with host bit
0is assigned to one router endpoint, and the address with host bit1is assigned to the opposite router endpoint. - There is no dedicated network address and no directed broadcast address.
- For example, in
10.1.1.0/31, Router A receives10.1.1.0and Router B receives10.1.1.1. - Nokia SR OS Support: Nokia 7750 SR and 7705 SAR support /31 addressing on appropriate point-to-point interfaces; check the selected platform and release. Both addresses are usable under RFC 3021.
3. /32 Prefixes (Host Routes and System Interfaces)
A /32 subnet mask is 255.255.255.255, leaving 0 host bits ( address).
- A
/32specifies a single host without any subnet broadcast or network address overhead. - In Nokia SR OS, every router is configured with a logical loopback interface designated as the system interface (
interface "system"). - The system interface is assigned a
/32IPv4 address. - Because the system interface is logical and never tied to the physical state of any individual Ethernet port or MDA, it is independent of an individual physical port, subject to the router and interface’s own operational conditions. It is commonly used as the router's BGP Router ID, OSPF Router ID, LDP Transport Address, and management endpoint.
Variable Length Subnet Masking (VLSM) Design Principles
Under Fixed Length Subnet Masking (FLSM), every subnet in an organization uses the identical subnet mask. If the largest department requires 100 hosts, every subnet must be allocated a /25 (126 usable hosts)—even a point-to-point link that only needs 2 addresses, wasting 124 addresses per link.
Variable Length Subnet Masking (VLSM) allows engineers to apply different subnet masks across subnets carved from the same major network block, matching the prefix size directly to the specific host requirement of each segment.
The Golden Rule of VLSM Allocation
When designing a VLSM scheme from a parent address block, allocating the largest required blocks first is a useful planning method.
Allocating the largest subnets first ensures that large blocks align naturally on valid binary power-of-two boundaries, preventing address overlap and fragmentation.
Practical VLSM Allocation Scenario
An engineer must subnet the private block 192.168.1.0/24 to satisfy the following requirements:
- Engineering LAN: 50 hosts
- Sales LAN: 25 hosts
- Support LAN: 12 hosts
- WAN Link 1: 2 router interfaces
- WAN Link 2: 2 router interfaces
Step-by-Step Allocation:
-
Engineering LAN (50 hosts):
- Formula: ( usable hosts).
- Prefix length: (block size 64).
- Subnet allocated:
192.168.1.0/26(Range:.0to.63, usable.1–.62, broadcast.63).
-
Sales LAN (25 hosts):
- Formula: ( usable hosts).
- Prefix length: (block size 32).
- Next available boundary:
.64. - Subnet allocated:
192.168.1.64/27(Range:.64to.95, usable.65–.94, broadcast.95).
-
Support LAN (12 hosts):
- Formula: ( usable hosts).
- Prefix length: (block size 16).
- Next available boundary:
.96. - Subnet allocated:
192.168.1.96/28(Range:.96to.111, usable.97–.110, broadcast.111).
-
WAN Link 1 (2 hosts):
- Formula: ( usable hosts) using
/30(or/31). - Prefix length:
/30(block size 4). - Next available boundary:
.112. - Subnet allocated:
192.168.1.112/30(Range:.112to.115, usable.113–.114, broadcast.115).
- Formula: ( usable hosts) using
-
WAN Link 2 (2 hosts):
- Prefix length:
/30(block size 4). - Next available boundary:
.116. - Subnet allocated:
192.168.1.116/30(Range:.116to.119, usable.117–.118, broadcast.119).
- Prefix length:
-
Unassigned Address Space for Future Growth:
- Addresses
192.168.1.120through192.168.1.127(one unallocated/29). - Addresses
192.168.1.128through192.168.1.255(one unallocated/25block supporting 126 additional hosts).
- Addresses
Through VLSM, all five network segments are fully accommodated with zero address overlap, leaving 136 of the original 256 addresses unallocated for growth.
Worked route summarization
A correct summary contains the intended component prefixes and begins on its own binary boundary. Contiguous addresses alone are not enough.
The four /24s 10.24.4.0/24, 10.24.5.0/24, 10.24.6.0/24, and 10.24.7.0/24 form exactly 10.24.4.0/22. Their third octets are 00000100 through 00000111: the first six bits agree, which together with the first sixteen address bits gives /22. The summary spans 10.24.4.0 through 10.24.7.255, or 1,024 addresses.
By contrast, 10.24.5.0/24 and 10.24.6.0/24 do not form an exact /23. Valid /23 boundaries have even third octets. Their smallest single covering prefix is 10.24.4.0/22, which also includes the .4 and .7 networks. Either advertise the two specifics or explicitly accept that additional coverage and provide suitable discard handling for holes.
A summary reduces advertisements; it does not create reachability to every address it covers. Check the summary boundary, component coverage, overlap, and forwarding action for absent components.
Primary technical reference
Specification or Nokia manual, checked October 20, 2026. Examples are teaching scenarios, not captured router execution.
A network engineer configures a Nokia 7750 SR router interface with the IP address 10.50.180.75/21. What are the network address, directed broadcast address, and first usable host address for this subnet?
Network: 10.50.180.0, Broadcast: 10.50.187.255, First Usable: 10.50.180.1
Network: 10.50.176.0, Broadcast: 10.50.183.255, First Usable: 10.50.176.1
Network: 10.50.176.0, Broadcast: 10.50.180.255, First Usable: 10.50.176.1
Network: 10.50.180.0, Broadcast: 10.50.183.255, First Usable: 10.50.180.1
Under RFC 3021, how does a /31 subnet mask function on a point-to-point Ethernet link between two Nokia Service Routers?
It provides exactly 2 usable host addresses without allocating dedicated network or broadcast addresses
It provides 4 total addresses with 2 usable host addresses and 2 reserved addresses
It creates a single host address dedicated strictly to router system loopback interfaces
It is unsupported on Ethernet interfaces and can only be used on serial or ATM links
In Nokia SR OS, what is the standard subnet mask prefix assigned to the logical system interface, and what is its primary operational role?
A /30 prefix, providing a point-to-point management tunnel to adjacent routers
A /24 prefix, providing a local broadcast subnet for out-of-band management traffic
A /32 prefix, creating a unique loopback host route used as the router ID and signaling endpoint
A /31 prefix, conserving public IP address space for inter-chassis failover links
Sections you finish are checked off in the contents.