Cloud concept · Updated

Classless Inter-Domain Routing (CIDR) - Classless Inter-Domain Routing (CIDR) represents IP address ranges using an address and prefix length, enabling flexible subnet allocation and route aggregation without fixed address classes.

In short

CIDR defines how many leading bits identify an IP network and how many remain for addresses within that network. Engineers use it to size subnets, conserve address space, summarize routes, and prevent overlapping networks from disrupting cloud and hybrid connectivity.

Cloud Concepts Hub →

6 key aspects of Classless Inter-Domain Routing (CIDR)

CIDR enables flexible address sizing and route aggregation, while effective cloud use requires nonoverlapping allocation, subnet-level capacity planning, and controlled expansion.

01
Variable-length address prefixes

A prefix specifies the fixed network bits and determines the address range size. For IPv4, a /24 contains 256 addresses and a /26 contains 64; usable workload capacity depends on platform reservations.

02
Hierarchical allocation and aggregation

Allocate address space in aligned blocks that can accommodate future networks and support route summarization. Summaries must reflect actual reachability, and their creation or advertisement depends on the routing platform.

03
Longest-prefix route selection

Among matching destination routes, the more specific prefix generally wins. A /24 route can therefore steer a subset of traffic differently from a covering /16 route.

04
Overlap-aware connectivity design

Use unique ranges for networks that require direct routed connectivity, including cloud networks and on-premises sites. Where overlaps already exist, evaluate renumbering, controlled address translation, or service-level connectivity rather than assuming a transit router resolves the ambiguity.

05
Subnet capacity and growth planning

Size subnets for platform reservations, infrastructure interfaces, workload scaling, deployment surges, and failover. Track available addresses at the subnet and Availability Zone level to identify localized exhaustion.

06
Expansion without in-place subnet resizing

Additional virtual-network CIDRs can support new subnets but do not expand existing ones. In AWS, address exhaustion in an existing subnet usually requires workload migration or redeployment into another subnet, with associated routing and policy updates.

Cloud services for Classless Inter-Domain Routing (CIDR)

Amazon VPC implements CIDR-based virtual networks and subnets, while VPC IPAM coordinates allocations and monitors address use across accounts and Regions. Transit Gateway provides centralized routing between networks whose addressing and route tables support the required connectivity. When existing networks overlap, engineers can renumber workloads or use a carefully designed private NAT path for selected connections. PrivateLink offers a different approach by exposing specific services without requiring general routed connectivity. These services complement an address plan; none makes overlapping prefixes uniquely routable simply by connecting the networks.

Amazon VPCAmazon VPC

Amazon VPC uses CIDR blocks for VPC address space, subnets, route destinations, and address-based security rules. Secondary IPv4 CIDRs provide space for additional subnets, but existing subnet CIDRs cannot be resized and overlapping VPC CIDRs prevent peering.

AWS Transit GatewayAWS Transit Gateway

Transit Gateway connects multiple VPCs and other networks using route tables with CIDR destinations. Overlapping VPC ranges are not a general routed-connectivity solution; overlapping routes are not propagated for a newly attached overlapping VPC, so address planning or a separate remediation design remains necessary.

AWS PrivateLinkAWS PrivateLink

PrivateLink exposes supported services through private endpoints without requiring general routing between consumer and provider networks. It can provide service access between networks with overlapping CIDRs, but it does not merge their address spaces or enable arbitrary bidirectional connectivity.

Classless Inter-Domain Routing (CIDR) exam questions

Real practice exam questions on Classless Inter-Domain Routing (CIDR), with the correct answer and its explanation. Answer them with every option in the exam simulator.

SAP-C03

A company runs Amazon EKS worker nodes in private IPv4 subnets across three Availability Zones. The Amazon VPC CNI plugin uses IPv4 prefix delegation to assign addresses to Pods. In one Availability Zone, new worker nodes cannot obtain prefixes, and Pods remain pending.

The affected /24 subnet has 140 available IPv4 addresses. However, other workloads have allocated addresses throughout the subnet, and every aligned /28 range contains at least one allocated address. The worker instance types support prefix delegation, and network interface quotas are sufficient. The VPC contains unused address space for additional subnets.

The company must restore Pod scaling in the affected Availability Zone without renumbering or interrupting the non-EKS workloads. The solution must also protect address capacity for future Pod prefixes from allocations of individual addresses.

Which solution meets these requirements?

Show answerCORRECT ANSWER

Create a new worker subnet in the affected Availability Zone from unused VPC address space. Before launching resources, create prefix-type subnet CIDR reservations for aligned /28 ranges. Launch replacement workers in the new subnet and drain the affected workers.

IPv4 prefix delegation requires contiguous, aligned /28 blocks, not merely enough free individual addresses. A new subnet provides unfragmented space, and prefix-type reservations protect selected ranges from individual address allocations while permitting prefix assignment. Replacement workers can use the new subnet without changing the non-EKS workloads.

SAA-C03

A company connects its data center to AWS Transit Gateway. Four application VPCs use the CIDR blocks 10.84.32.0/22, 10.84.36.0/22, 10.84.40.0/22, and 10.84.44.0/22. Next year, the company will add four VPCs using 10.84.48.0/22, 10.84.52.0/22, 10.84.56.0/22, and 10.84.60.0/22.

The transit gateway has individual routes for the existing VPCs, and the company will add routes for new VPCs when they are attached. The network team wants to configure one summary route on the data center router toward AWS that will support all eight VPCs without future changes. The summary must not include addresses outside the eight planned VPC CIDR blocks because adjacent address space is assigned to other networks.

Which destination CIDR block should the network team configure for the summary route?

Show answerCORRECT ANSWER

10.84.32.0/19

A /19 contains 8,192 addresses and aligns on third-octet boundaries that are multiples of 32. This block covers exactly 10.84.32.0 through 10.84.63.255, encompassing all eight contiguous /22 VPC blocks without including adjacent address space.

ANS-C01

A company's VPC has a primary IPv4 CIDR block of 10.64.0.0/20. Existing subnets occupy the entire block, and several subnets are approaching IP address exhaustion. A VPC route table contains a route for 10.65.8.0/24 through a transit gateway to an on-premises network that uses that range.

The company needs one new application subnet in each of two Availability Zones. Each new subnet must provide at least 700 assignable private IPv4 addresses. Existing subnets and resource addresses must remain unchanged, and connectivity to 10.65.8.0/24 must be preserved. All address ranges proposed below are otherwise unused, and applicable service quotas have sufficient capacity.

Which plan meets these requirements?

Show answerCORRECT ANSWER

Associate 10.65.16.0/21 as a secondary VPC CIDR block. Create application subnets 10.65.16.0/22 and 10.65.20.0/22, and configure the required return routes.

The aligned /21 contains both proposed /22 subnets and does not overlap the primary VPC CIDR or the routed on-premises /24. Each /22 has 1,024 addresses, of which 1,019 are assignable after AWS reserves five. Creating new subnets from the secondary block leaves existing subnets and resource addresses unchanged.

Practice Classless Inter-Domain Routing (CIDR) in a full exam

Questions on Classless Inter-Domain Routing (CIDR) in each practice exam, with every answer option and an explanation for each:

Start a free practice exam

What is Classless Inter-Domain Routing (CIDR)

3 min read

Classless Inter-Domain Routing replaces fixed class-based network boundaries with variable-length prefixes. In IPv4, 10.20.0.0/16 identifies a network whose first 16 bits are fixed, leaving 16 bits for addresses. It contains 65,536 addresses. A /24 contains 256 addresses, while a /28 contains 16. A larger prefix number therefore means a smaller address range. IPv6 uses the same principle with 128-bit addresses rather than 32-bit addresses.

CIDR blocks must align with their prefix boundaries. For example, 10.20.4.0/23 covers 10.20.4.0 through 10.20.5.255. The adjacent /24 networks 10.20.4.0/24 and 10.20.5.0/24 can be summarized as that /23 because they are contiguous and correctly aligned. Arbitrary adjacent networks cannot always be combined into one exact prefix. Routers generally select the longest matching prefix, so a matching /24 route takes precedence over a matching /16 route. Aggregation reduces route counts, but an overly broad summary can attract traffic for networks that are not reachable through the advertising router.

In cloud networks, engineers allocate a parent address range to a virtual network and divide it into subnets. Plan ranges hierarchically across accounts, Regions, environments, and on-premises sites. For example, reserve 10.64.0.0/12 for a cloud estate and allocate distinct /16 blocks to individual VPCs. This creates room for growth and potential summarization, although cloud routing services do not necessarily generate summary routes automatically. A subnet's size should reflect workload density, availability-zone placement, scaling peaks, and infrastructure addresses rather than an arbitrary convention that every subnet must be a /24.

Address capacity is not the same as usable workload capacity. A standard AWS IPv4 subnet reserves its first four addresses and its last address, so a /24 normally provides 251 assignable addresses and a /28 provides 11. Network interfaces, interface endpoints, load balancers, and container networking can consume additional capacity. Monitor free addresses per subnet, not just unused space across the VPC. Free addresses in another Availability Zone do not help a deployment that must allocate interfaces in an exhausted subnet. Include headroom for rolling deployments, failover, and temporary scaling.

When an AWS VPC needs more IPv4 space, an additional, nonoverlapping secondary CIDR block can provide space for new subnets, subject to association rules and quotas. For example, a VPC using 10.20.0.0/16 might add 10.21.0.0/16 after checking the enterprise address plan and AWS restrictions. Existing subnet CIDRs cannot be resized: create larger or additional subnets and migrate or redeploy workloads. Update external routes, security rules, network ACLs, DNS dependencies, and connectivity advertisements as necessary. Adding a secondary block does not enlarge an existing subnet or automatically move resources into the new space.

Overlapping CIDRs create ambiguous destinations when networks are connected. Two independently isolated VPCs can both use 10.20.0.0/16, but direct routing cannot uniquely identify which instance of 10.20.1.10 is intended. AWS VPC peering rejects overlapping VPC CIDRs, and AWS Transit Gateway does not make overlapping address spaces transparently routable. Adding a nonoverlapping secondary block does not remove the original overlap; peering remains unavailable while any VPC CIDRs overlap. Durable solutions include renumbering and migrating workloads. Alternatives include translating selected traffic into unique ranges or exposing a specific service through AWS PrivateLink instead of providing general network connectivity.

Subnet optimization balances growth capacity against address conservation and operational complexity. Very small subnets can exhaust quickly, while oversized allocations can strand scarce private address space and complicate future interconnection. Centralized allocation and utilization tracking reduce accidental overlap across accounts and Regions. IPv6 can reduce dependence on scarce IPv4 addresses, but applications, connectivity paths, and security controls must support it. CIDR itself is neither encryption nor an access-control mechanism: a route establishes a forwarding choice, not permission to communicate.

Learn Classless Inter-Domain Routing (CIDR) in lessons

4 short lessons on Classless Inter-Domain Routing (CIDR) in 3 certification courses.

Open the lessons