What Is Classless Inter-domain Routing in Networking?
Also known as: CIDR, Classless Inter-domain Routing, subnetting, VLSM, network prefix
This page mentions older exam versions. See the Current Exam Context and Legacy Exam Context sections below for the updated mapping.
On This Page
Quick Definition
CIDR is a way to divide up IP addresses more flexibly than the old system of classes. Instead of having only a few fixed sizes for networks, CIDR lets you create networks of almost any size. This helps save IP addresses and makes the internet's routing tables smaller and more manageable.
Must Know for Exams
CIDR is a core topic in both the CompTIA Network+ (N10-008 and later) and Cisco CCNA (200-301) exams. For Network+, CIDR appears in Domain 1.0 Networking Fundamentals, specifically under subnetting and routing. Exam objectives expect candidates to be able to calculate subnet masks, identify CIDR notation, and explain the advantages of CIDR over classful addressing. Network+ questions often present a scenario where a company needs to divide a given IP block into smaller subnets for different departments, and the candidate must determine the correct CIDR prefix lengths.
In the CCNA exam, CIDR is even more deeply integrated. It appears in sections on IP addressing, subnetting, VLSM, and routing. Candidates must be able to perform subnetting calculations quickly and accurately, design a VLSM scheme for a given topology, and understand how route summarization works. The CCNA also tests practical configuration skills: configuring and verifying IP addresses with CIDR notation on routers and switches, and configuring static routes that use CIDR prefixes. Troubleshooting questions may involve identifying misconfigured subnet masks that cause connectivity issues, or determining why a route is not being installed in the routing table due to a more specific prefix.
Exams may also test the concept of longest prefix match. For example, a router has routes for 10.0.0.0/8 and 10.0.1.0/24. A packet destined for 10.0.1.5 will match both routes, but the router will choose the /24 because it is more specific. Understanding this logic is critical for correct routing decisions.
Furthermore, both exams may ask about the history and purpose of CIDR, such as why it was created and how it helped slow IPv4 exhaustion. Candidates should also know that CIDR is used with both IPv4 and IPv6, although IPv6 had CIDR from the start. Finally, scenario-based questions are common: a given IP address and CIDR prefix like 192.168.5.0/27, and the candidate must find the subnet mask, network address, broadcast address, number of usable hosts, and the range of valid host addresses. Mastery of these calculations is non-negotiable for exam success.
Simple Meaning
Imagine you have a huge warehouse where you need to store boxes of different sizes. In the old way of organizing the warehouse, you could only use three standard box sizes: tiny, medium, and huge. If your item was too big for the tiny box, you had to use the medium box, wasting a lot of space.
If the item was too big for the medium box, you had to use the huge box, wasting even more space. This system was very wasteful. CIDR is like allowing you to choose a box that exactly fits your item.
You can have boxes of any size, with just a little padding. This means you use the warehouse space much more efficiently. In networking terms, the warehouse represents the total pool of available IP addresses.
The old system used fixed classes: Class A (huge networks), Class B (medium networks), and Class C (small networks). If an organization needed more addresses than a Class C provided, they had to take an entire Class B, which was often far too large, wasting most of those addresses. CIDR changed this by allowing network sizes to be defined by a subnet mask, which is like a measuring tape that tells you exactly how big the box is.
For example, a /24 network is like a medium box, a /23 is a slightly bigger one, and a /25 is a slightly smaller one. The routing part means that on the internet, instead of having to remember a specific route for every single tiny network, routers can group many smaller networks together into a single, larger block. This is like the post office knowing that all mail for a certain large region goes to one central sorting center, instead of having to know every single street in that region.
This grouping is called supernetting or route aggregation, and it is a core benefit of CIDR. By allowing flexible network sizes and route aggregation, CIDR has kept the internet from running out of space and has kept routing tables from becoming impossibly large.
Full Technical Definition
Classless Inter-domain Routing (CIDR), defined in RFC 1518 and RFC 1519 in 1993, is a fundamental architecture change to IP addressing and routing. It replaced the rigid classful addressing system (Class A, B, C) with a flexible, variable-length subnet masking (VLSM) scheme.
At the heart of CIDR is the CIDR notation, which uses a slash followed by a number, such as 192.168.1.0/24. This notation explicitly states the network prefix length, meaning the number of bits in the subnet mask that are set to 1. For example, /24 is equivalent to a subnet mask of 255.255.255.0, indicating that the first 24 bits of the IP address represent the network portion, and the remaining 8 bits represent the host portion. This notation is much more precise than the classful system, where the network portion was assumed based on the first octet of the IP address.
CIDR enables VLSM, which allows a network administrator to use different subnet masks within the same major network. For instance, a /24 network can be subnetted into two /25 networks, four /26 networks, or a mix of different sizes to fit the exact number of hosts needed in each subnet. This granular control drastically reduces IP address waste.
On the routing side, CIDR enables route aggregation, also known as supernetting. Routers in the core of the internet can combine multiple contiguous smaller network prefixes into a single, larger prefix in their routing tables. For example, instead of having separate entries for 192.168.0.0/24, 192.168.1.0/24, and 192.168.2.0/24, a router can aggregate them into a single 192.168.0.0/22 entry, provided all those networks are reachable through the same next-hop. This reduces the size of the global routing table, improving routing efficiency and switch performance.
CIDR relies on the Border Gateway Protocol (BGP) to exchange routes between autonomous systems on the internet. BGP carries the prefix and its length, allowing routers to make forwarding decisions based on the longest prefix match. When a router receives a packet, it checks its routing table for the destination address and chooses the route with the most specific (longest) prefix. This mechanism ensures that more specific routes, which may be used for traffic engineering or security, take precedence over aggregated routes.
In real-world IT environments, CIDR is used everywhere. From assigning IP addresses to home networks using DHCP to designing complex corporate network topologies and managing cloud VPCs in AWS, Azure, or GCP, CIDR is the standard. Network professionals must be fluent in calculating CIDR blocks, understanding subnet masks, and applying VLSM to design efficient addressing schemes. Routing protocols such as OSPF and EIGRP also support VLSM and CIDR, making them essential for modern network design.
Real-Life Example
Think of a large library that needs to assign shelf space to different departments. The old classful system was like the library having only three shelf sizes: small, medium, and large. A small shelf could hold 256 books, a medium shelf could hold 65,536 books, and a large shelf could hold 16,777,216 books. If the History department needed space for 300 books, they could not use the small shelf because it was too small. They had to take a medium shelf, wasting 65,236 book slots. If the Science department needed 50,000 books, they also had to take a medium shelf, wasting 15,536 slots. This was very inefficient.
CIDR is like the library introducing a system where shelves can be built to any size that is a power of two. Instead of three fixed sizes, the librarian can now assign a /23 shelf that holds 512 books to the History department, wasting only 212 slots, which is much better. For the Science department, a /16 shelf holds 65,536 books, which is still wasteful, but they could combine two /17 shelves, each holding 32,768 books, to get 65,536 total. Better yet, the librarian can create a /17 shelf for them, saving half a shelf of space.
The routing part of CIDR is like the library's internal mail system. If many small shelves are all in the same wing of the library, the mailroom can have a single rule: all mail for the Science wing goes to the Science wing's central desk. Without CIDR, the mailroom would need a separate rule for every individual shelf in the Science wing, even if they were all next to each other. CIDR allows the mailroom to say all mail for the /17 prefix goes to the Science wing. This makes the mailroom's directory much smaller and easier to manage. The library can also rearrange its shelves dynamically as departments grow or shrink, without having to change the fundamental building blocks. This flexibility is exactly what CIDR provides for IP address allocation on the internet and within private networks.
Why This Term Matters
CIDR matters because it directly addresses two critical problems that were threatening the growth of the internet: IP address exhaustion and routing table explosion. Under the old classful system, organizations were given far more IP addresses than they needed, because they had to take an entire Class B block even if they only needed a fraction of it. This wasted huge ranges of addresses, accelerating the depletion of the IPv4 address space. CIDR allowed Internet Service Providers (ISPs) to allocate just the right amount of addresses to customers, preserving the address pool for much longer. This is why we are still using IPv4 today, decades after the original prediction of exhaustion.
In practical IT work, CIDR is essential for network design. Network engineers use CIDR to plan subnets for VLANs, point-to-point links, and cloud virtual networks. For example, in AWS, when you create a VPC, you must specify a CIDR block (like 10.0.0.0/16). You then create subnets within that VPC using smaller CIDR blocks (like 10.0.1.0/24). Understanding CIDR is required to ensure subnets do not overlap and that you have enough IP addresses for your resources. Misunderstanding CIDR can lead to mistakes like creating overlapping subnets, which breaks routing.
For system administrators, CIDR is crucial for setting up firewalls and access control lists (ACLs). Firewall rules often use CIDR notation to allow or deny traffic from entire networks. Knowing how to correctly specify a CIDR range prevents security holes or accidentally blocking legitimate traffic. In cybersecurity, analyzing network traffic log scaused by scanning an IP range often involves CIDR calculations to identify attack patterns.
Moreover, CIDR is foundational for routing protocols. OSPF, EIGRP, and BGP all rely on VLSM and route summarization. Without CIDR, the internet's core routers would have millions of individual routes, causing memory exhaustion and slow convergence. Route aggregation with CIDR keeps the routing table manageable, ensuring fast and reliable data delivery. Simply put, CIDR is the reason the internet can function at its current scale.
How It Appears in Exam Questions
Exam questions use CIDR in several distinct patterns. The most common is the subnetting calculation question. For example: How many usable host addresses are in the subnet 192.168.10.0/26? The candidate must know the subnet mask is 255.255.255.192, and the number of host bits is 6 (32 – 26 = 6). This gives 2^6 = 64 total addresses, minus 2 for network and broadcast, resulting in 62 usable hosts.
Another pattern is the VLSM design question. The question might provide an IP block such as 172.16.0.0/16 and ask the candidate to subnet it to satisfy requirements for several LANs with different host counts. For example, LAN A needs 500 hosts, LAN B needs 200 hosts, and a WAN link needs 2 hosts. The candidate must determine the smallest subnet sizes (e.g., /23 for LAN A, /24 for LAN B, /30 for the WAN link) and assign non-overlapping address ranges.
Route aggregation or summarization questions are also common. The question might show multiple network prefixes and ask which single summary route covers all of them. For example, 192.168.0.0/24, 192.168.1.0/24, 192.168.2.0/24, and 192.168.3.0/24 can be summarized as 192.168.0.0/22.
Troubleshooting questions often involve a scenario where devices on the same subnet cannot communicate. The answer might be that one device has a misconfigured subnet mask or CIDR prefix length, causing it to think another device is on a different network. For instance, a host with IP 10.0.1.5/24 will try to directly communicate with 10.0.1.6, but if the subnet mask on that host is /16, it may try to send packets through the gateway when they should be local.
Additionally, exam questions may test the understanding of classless vs. classful addressing. A typical question might ask: Is 10.0.0.0/8 a classful or classless address? The answer is that it is a classless address because the /8 explicitly defines the prefix length, even though it matches the old Class A range.
Finally, conceptual questions ask why CIDR was created, what benefits it provides (reduced routing table size, efficient address allocation), or which protocol uses CIDR (BGP, OSPF, EIGRP). These ensure the candidate understands not just the mechanics, but the practical importance of CIDR in modern networking.
Practise Classless Inter-domain Routing Questions
Test your understanding with exam-style practice questions.
Example Scenario
Jane is a network administrator for a growing company called TechStar. TechStar currently uses the 192.168.0.0/24 network for its main office, which has 200 devices. The company is opening a new branch office that will only need 30 devices. Jane has two choices: she can use a classful approach and give the new office a whole other /24 subnet (wasting over 200 addresses), or she can use CIDR to create a smaller subnet that exactly fits the need.
Jane decides to use CIDR. She takes the 192.168.0.0/24 range and further subnets it. She keeps the original office on 192.168.0.0/25 (126 usable addresses, enough for the 200 devices is not enough, so she actually needs a larger block, but for illustration, let us scale down: assume the main office only has 100 devices). She assigns the main office 192.168.0.0/25 (hosts 1-126). For the new branch office needing 30 devices, she uses a /27 subnet, which provides 30 usable hosts. She assigns 192.168.0.128/27 (hosts 129-158). This leaves the rest of the 192.168.0.0/24 range unused for future expansion. By using CIDR, Jane saved addresses and avoided demanding a new IP block from her ISP. In a real exam question, Jane would have to calculate the correct subnet masks and ensure the subnets do not overlap. This scenario demonstrates how CIDR provides flexibility and efficiency in practical network planning.
Common Mistakes
Thinking that a /24 subnet has exactly 256 usable host addresses.
In any subnet, the first address is the network address and the last address is the broadcast address, so the number of usable hosts is total addresses minus 2. For /24, total addresses are 256, so usable hosts are 254, not 256.
Always subtract 2 from the total number of addresses in the subnet to get usable hosts. Remember one for the network ID and one for the broadcast.
Confusing CIDR notation with the subnet mask. For example, thinking /24 means 255.255.255.0 is the mask, but not understanding that /24 is the prefix length.
CIDR notation is the prefix length; it tells you how many bits are in the network part. The subnet mask is the dotted decimal representation of those bits set to 1. They are two different ways of saying the same thing, but the concept of prefix length is fundamental for calculating subnets.
Learn to convert between CIDR notation and subnet masks. Practice: /24 = 255.255.255.0, /25 = 255.255.255.128, /26 = 255.255.255.192, etc.
Assuming that IP addresses with the same first octet are in the same classful network, and forgetting that CIDR allows variable lengths.
With CIDR, the class of an address is irrelevant. Two addresses with the same first octet can be in completely different subnets if they have different prefix lengths. For example, 10.0.0.1/8 is different from 10.0.0.1/16, even though they share the same IP.
Always look at the prefix length or subnet mask to determine the network boundary, not the first octet of the IP address.
Incorrectly calculating the number of subnets when subnetting. For example, thinking that borrowing 3 bits from a /24 to create a /27 gives 3 subnets.
Borrowing 3 bits yields 2^3 = 8 subnets, not 3. Each borrowed bit doubles the number of subnets.
Use the formula: number of subnets = 2^(number of borrowed bits). Memorize powers of two.
Forgetting to subtract the network and broadcast addresses when calculating usable hosts for point-to-point links. Some think a /30 has 4 usable addresses.
A /30 subnet has 4 total addresses: network, two usable hosts, and broadcast. So only 2 usable hosts, not 4.
For point-to-point links, use /30 or /31. A /31 provides 2 usable addresses (no network or broadcast), but some legacy devices may not support it. Always subtract 2 unless using /31 or /32.
Exam Trap — Don't Get Fooled
In exam questions, a router is given with an IP address 192.168.1.5/26 and a destination address of 192.168.1.70. The question asks which subnet the destination belongs to. Learners often think the /26 subnet starts at 192.
168.1.0 because they assume that subnet boundaries always align with the last octet. Always calculate the subnet increment by subtracting the subnet mask from 256 (for IPv4). For /26, the mask is 255.
255.255.192, so 256 – 192 = 64. This means subnets start at 0, 64, 128, 192. The IP 192.168.1.5 is in the first subnet (0-63), and 192.168.1.70 is in the second subnet (64-127). Learn to quickly find the subnet mask and increment.
Commonly Confused With
CIDR is the overall system of classless addressing and routing. VLSM is a technique that is enabled by CIDR, allowing you to use different subnet masks within the same network. CIDR is the framework; VLSM is the practice.
CIDR is like having a flexible measuring system with different ruler lengths. VLSM is the act of using a different ruler for each room in a house to ensure each room gets the exact size it needs.
Classful addressing divides IP addresses into fixed classes (A, B, C) based on the first octet. CIDR removes these classes and uses a subnet mask to define the network boundary. Classful is rigid; CIDR is flexible.
Classful says 10.0.0.1 is always a Class A address with a /8 default mask. CIDR allows 10.0.0.1 to be used with a /16 mask if desired, meaning it is on a different network.
Supernetting is the process of combining multiple contiguous subnets into a larger single subnet to reduce routing table size. CIDR enables supernetting by allowing route aggregation with prefixes shorter than the default classful length.
Supernetting is like merging several small boxes into one big box, labeling it with a single address. CIDR is the system that allows you to choose the size of the big box and pack smaller boxes inside it.
Subnetting is the process of dividing a larger network into smaller subnetworks. CIDR is the system that makes subnetting flexible, but subnetting existed in a limited form even with classful addressing (using the same subnet mask across the whole network). CIDR made subnetting granular.
Subnetting is cutting a large pizza into slices. CIDR allows you to cut slices of different sizes from different pizzas, and also allows you to recombine slices from the same pizza into a larger slice.
Step-by-Step Breakdown
Understand IP Address and Mask
An IP address is a 32-bit number usually written as four octets like 192.168.1.0. The subnet mask determines which part of the address is the network and which is the host. For CIDR, we use the prefix length like /24 to mean 24 bits for the network.
Convert CIDR Notation to Subnet Mask
To find the subnet mask from a CIDR prefix, set that many bits to 1 from left to right. For example, /24 yields 24 ones and 8 zeros. Convert each octet: 11111111.11111111.11111111.00000000 = 255.255.255.0. This step is essential for calculations.
Determine the Subnet Increment
The increment is 256 minus the last non-zero octet of the subnet mask. For /26, mask is 255.255.255.192. 256 - 192 = 64. This means subnets start at multiples of 64 in that octet.
Find the Network Address
To find the network address, take the IP address and set all host bits to 0. For example, IP 192.168.1.5/26, the network address is 192.168.1.0 because 5 is between 0 and 63. This is the first address of the subnet.
Find the Broadcast Address
Set all host bits to 1. For 192.168.1.0/26, the broadcast address is 192.168.1.63. This is the last address in the subnet.
Calculate Usable Hosts
Usable hosts = total addresses minus 2 (network and broadcast). Total addresses = 2^(32 - prefix length). For /26, 2^6 = 64 total addresses, minus 2 gives 62 usable hosts.
Apply VLSM for Multiple Subnets
When designing a network with different size requirements, use VLSM. Start with the largest subnet requirement and assign the smallest prefix that fits. Then move to the next largest, ensuring no address overlap. This step optimizes address usage.
Practical Mini-Lesson
To master CIDR for both exams and real-world practice, you must internalize the binary math. The first step is to memorize powers of two: 2^0=1, 2^1=2, 2^2=4, 2^3=8, 2^4=16, 2^5=32, 2^6=64, 2^7=128, 2^8=256. These numbers will appear in every subnetting calculation.
When you see a CIDR prefix like /27, the number of host bits is 32 – 27 = 5. Therefore total addresses in that subnet = 2^5 = 32. Usable hosts = 32 – 2 = 30. The subnet mask is 255.255.255.224 because the last octet has 224 (128+64+32) for the network portion and 0 for the host bits? Actually, 128+64+32 = 224, so the last octet mask is 224. The increment is 256 – 224 = 32, so subnets start at 0, 32, 64, 96, etc. Practice with /26, /28, /29, and /30 until you can find the network address, broadcast, and usable range in under 15 seconds.
In practical configuration, when you assign an IP address to a router interface in Cisco IOS, you use the CIDR notation: ip address 192.168.1.1 255.255.255.0 or the more modern ip address 192.168.1.1/24. Both are equivalent. For static routes, you specify the destination network using CIDR notation: ip route 10.0.0.0 255.255.255.0 192.168.1.1 or ip route 10.0.0.0/24 192.168.1.1.
A common mistake in real environments is misconfiguring the subnet mask on a host, causing connectivity issues. For example, if a server is set to /24 but the gateway uses /16, the server may try to send traffic directly to devices it should send to the gateway. Additionally, when creating VPN tunnels, you must ensure that the remote networks do not overlap with the local network. This requires careful CIDR planning to avoid routing loops or hidden networks.
CIDR also connects to IPv6. IPv6 uses CIDR natively, with prefixes like /64 for a typical subnet and /48 for a site. Understanding CIDR for IPv4 will help you understand IPv6 addressing. In cloud environments, you define VPCs and subnets with CIDR blocks. If you choose a wrong prefix, you may run out of IP addresses or be unable to peer with other VPCs.
Finally, practice with subnetting calculators only after you can do the math manually. For exam and interview success, you need to be able to solve these under pressure. Use flash cards for powers of two and subnet mask conversions. Spend ten minutes a day practicing until it becomes second nature.
Memory Tip
Think of the slash in CIDR as a slide: the number after the slide tells you how many bits are slid to the network side. For /24, 24 bits are on the network side, leaving 8 for hosts.
Covered in These Exams
Current Exam Context
Current exam versions that test this topic — use these objectives when studying.
Legacy Exam Context
Older materials may mention these exam versions, but learners should use the current objectives for their target exam.
N10-008N10-009(current version)Related Glossary Terms
An A record is a DNS record that maps a domain name to the IPv4 address of the server hosting that domain.
802.1Q is the networking standard that allows multiple virtual LANs (VLANs) to share a single physical network link by tagging Ethernet frames with VLAN identification information.
Frequently Asked Questions
What is the difference between CIDR and subnetting?
Subnetting is the process of dividing a large network into smaller ones. CIDR is the system that allows subnetting to be done with variable-length masks, making it flexible. CIDR is the framework that enables modern subnetting.
How do I calculate the number of hosts in a /28 network?
A /28 network has 32 minus 28 = 4 host bits. 2^4 = 16 total addresses. Subtract 2 for the network and broadcast addresses, giving 14 usable hosts.
Why is CIDR considered classless?
Because it ignores the old classful boundaries (Class A, B, C) based on the first octet. Any IP address can have any subnet mask as long as it is a valid prefix length, making it classless.
Is CIDR used for IPv6?
Yes. IPv6 uses CIDR notation from the start, with prefixes like /64 for subnets and /48 for site-level aggregation. It works the same way as in IPv4.
What does the slash number mean in CIDR?
The slash number is called the prefix length. It tells you how many bits out of 32 (for IPv4) are used for the network portion. The rest are for hosts.
Can I use any subnet mask with CIDR?
Yes, CIDR allows any subnet mask as long as it is a contiguous set of 1 bits from left to right. Valid masks include 255.255.255.0, 255.255.255.128, 255.255.192.0, etc. Masks like 255.255.0.255 are invalid.
Why do we subtract 2 from total addresses?
The first address in a subnet is reserved for the network address, and the last address is reserved for the broadcast. They cannot be assigned to hosts. So we subtract 2 to get the number of usable host addresses.
Summary
Classless Inter-domain Routing (CIDR) is the foundational addressing system that replaced the rigid classful method, providing the flexibility needed to allocate IP addresses efficiently and keep the internet routing tables manageable. It uses a prefix length notation (e.g.
, /24) to indicate the network portion of an address, allowing for variable-length subnet masks and enabling techniques like VLSM and route aggregation. For IT professionals and certification candidates studying for exams like Network+ and CCNA, mastering CIDR is non-negotiable. It appears in calculation questions, design scenarios, troubleshooting, and conceptual understanding.
The key skills required include converting between CIDR notation and subnet masks, computing network addresses, broadcast addresses, and usable host counts, and applying VLSM to meet specific host requirements. Common mistakes include misinterpreting the prefix length, forgetting to subtract two for usable hosts, and confusing CIDR with classful addressing. The most important takeaway is that CIDR makes networking far more efficient and scalable.
By understanding and practicing CIDR solving techniques, you will build a solid foundation for network design, configuration, and troubleshooting in real-world environments. Remember that in every exam question and in every network you design, CIDR is the tool that lets you create exactly the right sized network for every situation.