Computer Networking
Members:
Usman Javed
Hammad Shafique
Khuzama Akram
Akrash Nadeem
Assignment 2
CIDR (Classless Inter-Domain Routing)
– Detailed Notes
1. Introduction
CIDR stands for Classless Inter-Domain Routing. It is a method used in computer
networking to allocate IP addresses and perform IP routing more efficiently. CIDR
was developed and introduced in 1993 by the Internet Engineering Task Force
(IETF) as a replacement for the classful IP addressing system (Class A, B, and C).
CIDR provides flexibility and efficiency in assigning IP addresses, helping to reduce
the wastage of IPs and the size of routing tables on the internet.
2. Why Was CIDR Introduced?
Before CIDR, IP addresses were divided into fixed classes:
- Class A: 16 million hosts (too large for most users)
- Class B: 65,000 hosts
- Class C: 254 hosts
This rigid system led to:
- Wastage of IP addresses
- Routing table bloat (too many entries)
CIDR solved this problem by:
- Removing the concept of fixed classes
- Allowing custom subnet sizes
- Aggregating multiple routes into a single one (route summarization)
3. CIDR Notation
CIDR uses a special notation to represent IP addresses and subnet masks:
<IP Address>/<Prefix Length>
For example:
192.168.1.0/24
- 192.168.1.0 → Network address
- /24 → First 24 bits are for network, remaining 8 bits for hosts
This is also called slash notation.
4. Subnetting in CIDR
CIDR allows creating subnets (small divisions of a network) with custom sizes. You
can adjust the subnet mask to fit the number of devices needed.
Example:
CIDR: 192.168.1.0/26
- Subnet mask: 255.255.255.192
- Total IPs: 2^(32-26) = 64
- Usable IPs: 64 - 2 = 62
CIDR Subnet Table:
CIDR Block Subnet Mask Total IPs Usable IPs
/30 255.255.255.252 4 2
/29 255.255.255.248 8 6
/28 255.255.255.240 16 14
/27 255.255.255.224 32 30
/24 255.255.255.0 256 254
/16 255.255.0.0 65,536 65,534
5. CIDR vs Classful Addressing
Comparison table:
Feature Classful Addressing CIDR
Fixed Network Classes Yes (A, B, C) No
Subnetting Flexibility Limited Highly flexible
IP Address Usage Wastes IPs Efficient usage
Routing Table Size Larger Smaller (due to
aggregation)
Introduced in 1980s 1993
6. Route Aggregation (Supernetting)
CIDR allows combining multiple small IP networks into a larger block, reducing the
number of entries in routing tables. This is called route summarization or
supernetting.
Example:
Instead of:
- 192.168.1.0/24
- 192.168.2.0/24
- 192.168.3.0/24
- 192.168.4.0/24
You can write:
192.168.0.0/22
This single route covers all four networks.
7. Importance of CIDR in Modern Networking
- Helps Internet Service Providers (ISPs) assign address blocks efficiently
- Reduces waste of IP addresses
- Helps in conserving IPv4 addresses
- Makes routing faster by reducing entries in routers
- Supports Variable Length Subnet Masking (VLSM) – different subnets of different
sizes
8. Practical Example
Suppose you are given a block: 192.168.10.0/25
- Total IPs: 2^(32–25) = 128
- Usable IPs: 128 – 2 = 126
- IP Range: 192.168.10.1 – 192.168.10.126
- Broadcast address: 192.168.10.127
9. Advantages of CIDR
- Better utilization of IP addresses
- Scalable and future-proof
- Reduces internet routing complexity
- Enables VLSM (networks of different sizes)
- Efficient for IPv4 and IPv6
10. Disadvantages of CIDR
- Slightly more complex to understand and calculate
- Misconfigured CIDR blocks can lead to routing errors
11. History and Evolution of CIDR
CIDR was introduced in response to the rapid expansion of the internet and the looming
exhaustion of IPv4 addresses. Before CIDR, the classful addressing system could not cope
with the demand for IP addresses. The Internet Engineering Task Force (IETF) proposed
CIDR as a way to provide more flexibility in IP address allocation and reduce the size of
routing tables by enabling route aggregation. CIDR was formally introduced in RFC 1519.
12. CIDR in IPv6
CIDR principles are also applicable to IPv6 addressing. In IPv6, CIDR enables hierarchical
allocation of addresses and efficient routing. IPv6 addresses are represented using CIDR
notation, such as 2001:db8::/32. Although IPv6 has a vastly larger address space, CIDR is
still essential for managing and delegating address blocks efficiently.
13. How to Calculate CIDR Blocks
To calculate CIDR blocks, one needs to understand binary representation of IP addresses.
For example, a /26 means the first 26 bits of the address are the network part, and the
remaining 6 bits are for host addresses. This gives 2^6 = 64 total addresses. Subtracting the
network and broadcast address gives 62 usable addresses. Calculations require conversion
between binary and decimal representations to determine the subnet mask and IP ranges.
14. CIDR and Network Design
CIDR plays a crucial role in designing scalable and efficient networks. Network architects
use CIDR to design hierarchical networks, grouping IP addresses logically and allocating
subnets based on organizational needs. CIDR also supports subnet planning tools and helps
ensure that each department or branch office has an appropriate number of IPs.
15. Tools for CIDR Calculation and Management
Several tools and utilities exist to help calculate and manage CIDR ranges. These include
online calculators, network planning tools like SolarWinds IP Address Manager, and
command-line utilities such as 'ipcalc' on Linux. These tools simplify the tasks of subnetting,
aggregation, and translating between different representations.
16. Real-World Applications of CIDR
CIDR is widely used in both enterprise and service provider networks. Examples include
ISPs allocating address blocks to customers, cloud providers managing IP ranges for virtual
networks, and organizations planning internal IP allocation. CIDR also facilitates firewall
rules, NAT configurations, and IP-based access controls.
17. CIDR Misconfigurations and Troubleshooting
Common CIDR misconfigurations include overlapping subnets, incorrect subnet masks, and
improper routing aggregation. These can lead to routing loops, unreachable hosts, and
security risks. Troubleshooting involves analyzing routing tables, using traceroute and ping
tools, and verifying address plans. Proper documentation and validation tools help prevent
such issues.
18. CIDR and Security Implications
CIDR can influence network security by defining the scope of IP-based access control lists
(ACLs) and firewall rules. Proper subnetting limits broadcast domains and improves
segmentation. Conversely, overly broad CIDR blocks in security rules may unintentionally
allow access to unintended addresses. Best practices include least-privilege subnet
allocation and regular review of CIDR usage in security policies.
19. Variable Length Subnet Masking (VLSM)
VLSM is a technique that allows network administrators to divide an IP address space into
subnets of different sizes, tailored to the specific needs of each network segment. Unlike
fixed-length subnetting, which assigns the same subnet size to every segment, VLSM
enables more granular control, conserving IP address space.
For example, suppose an organization has the 192.168.1.0/24 block and needs to allocate
IPs to four departments with varying requirements:
- Admin: 100 hosts
- Sales: 50 hosts
- HR: 25 hosts
- IT Support: 10 hosts
Using VLSM, you could assign:
- 192.168.1.0/25 to Admin
- 192.168.1.128/26 to Sales
- 192.168.1.192/27 to HR
- 192.168.1.224/28 to IT Support
20. CIDR and ISP Address Allocation
ISPs use CIDR to allocate IP address blocks to customers efficiently. For example, if an ISP
owns a large address block like 203.0.113.0/20, they might allocate subnets such as
203.0.113.0/24 to one customer and 203.0.114.0/23 to another. This method allows precise
control and prevents waste.
CIDR also facilitates hierarchical routing between ISPs and regional Internet registries
(RIRs), such as ARIN, RIPE, and APNIC.
21. CIDR and BGP (Border Gateway Protocol)
CIDR is essential in BGP, the protocol that manages routing between autonomous systems
(AS) on the internet. CIDR helps reduce the number of route advertisements in BGP by
allowing route aggregation. For instance, an AS might advertise a single 10.0.0.0/8 block
instead of hundreds of smaller /24 routes. This minimizes the size of global routing tables,
which is critical for Internet backbone stability.
22. CIDR and IPv4 Address Exhaustion
IPv4 exhaustion is the depletion of available IPv4 address blocks due to the limited size of
the 32-bit address space. CIDR played a critical role in delaying IPv4 exhaustion by allowing
more efficient use of address space. CIDR enabled ISPs and organizations to use smaller
blocks suited to their actual needs rather than assigning large classful blocks that went
underutilized.
23. CIDR and NAT (Network Address Translation)
CIDR works hand-in-hand with NAT in conserving IP address space. NAT allows multiple
private IP addresses to share a single public IP, and CIDR allows administrators to group
and manage these private address spaces more flexibly. Together, these technologies ensure
the efficient use of IPv4 addresses in modern networking environments.
24. Future of CIDR
Even though IPv6 offers a much larger address space, CIDR remains relevant. It continues to
be used for route aggregation and subnetting in IPv6, with similar notation (e.g.,
2001:db8::/48). CIDR is now a fundamental concept in network engineering and will
remain essential for address management, network design, and security policies well into
the future.
25. Conclusion
CIDR has fundamentally transformed how networks are designed and operated. It has
resolved many of the inefficiencies of classful addressing, provided scalability, supported
the rapid expansion of the internet, and laid the groundwork for better utilization of both
IPv4 and IPv6. Understanding CIDR is critical for network professionals involved in address
planning, subnetting, routing, and security.
Appendix: Subnet Planning Table
Department Required CIDR Block Subnet Mask Usable IPs
Hosts
Admin 100 192.168.1.0/25 255.255.255.128 126
Sales 50 192.168.1.128/26 255.255.255.192 62
HR 25 192.168.1.192/27 255.255.255.224 30
IT Support 10 192.168.1.224/28 255.255.255.240 14
26. CIDR and Network Security Policies
CIDR plays a crucial role in defining IP-based security policies. Firewalls, access control lists
(ACLs), and intrusion detection systems (IDS) often use CIDR notation to permit or deny
access to entire subnets. For example, an organization may block all traffic from 10.0.0.0/8
while allowing access from 192.168.1.0/24. CIDR makes such configurations scalable and
easily manageable.
27. CIDR in Cloud Networking
Cloud providers such as AWS, Azure, and Google Cloud heavily rely on CIDR blocks to define
virtual networks (VPCs), subnets, and security groups. When deploying infrastructure in the
cloud, users must specify CIDR blocks to define network boundaries. Efficient CIDR
planning in the cloud ensures scalability, isolation, and security of services.
28. CIDR and VPNs (Virtual Private Networks)
VPNs often use CIDR to define internal networks that remote users can access. CIDR helps
network administrators avoid IP address conflicts and manage route pushing effectively.
For example, a VPN might allow access to 10.1.0.0/16 while restricting access to other
internal blocks. CIDR also allows split tunneling configurations where only specific CIDR
ranges are routed through the VPN tunnel.
29. Designing a Corporate Network Using CIDR
Designing a corporate network using CIDR involves planning IP address space allocation
across departments, remote offices, and data centers. A well-designed CIDR-based plan
ensures minimal IP waste, effective routing, and clear segmentation. For instance, a
multinational company might assign 10.0.0.0/8 as the global range and then divide it into
/16 subnets for each country, /24 subnets for departments, and /28 for internal services.
30. CIDR Aggregation Algorithms
Route aggregation in CIDR uses algorithms to combine contiguous IP ranges into single
summarized routes. These algorithms check if multiple subnets share a common prefix and
if the number of addresses aligns with a power of two. For instance, combining
192.168.0.0/24 and 192.168.1.0/24 into 192.168.0.0/23 reduces the number of entries in a
routing table and improves performance.
31. CIDR Representation and Binary Analysis
CIDR requires understanding of binary addressing to calculate subnets correctly. For
example, the IP address 192.168.1.0/26 in binary is:
11000000.10101000.00000001.00000000
The first 26 bits represent the network part. This binary understanding allows for precise IP
planning, collision avoidance, and efficient subnet allocation.
32. Advanced CIDR Practice Problems
Problem 1: Given IP block 172.16.0.0/20, how many /24 subnets can be created?
Solution: A /20 block has 2^(24–20) = 16 /24 subnets.
Problem 2: What is the broadcast address of 10.0.5.0/26?
Solution: Total IPs = 64, so the last IP is 10.0.5.63. Broadcast = 10.0.5.63
Problem 3: Which CIDR block summarizes the following ranges:
- 192.168.8.0/24
- 192.168.9.0/24
- 192.168.10.0/24
- 192.168.11.0/24
Answer: 192.168.8.0/22
33. CIDR Summary Table for Subnet Sizes
CIDR Block Subnet Mask Total IPs Usable IPs
/25 255.255.255.128 128 126
/26 255.255.255.192 64 62
/27 255.255.255.224 32 30
/28 255.255.255.240 16 14
/29 255.255.255.248 8 6
/30 255.255.255.252 4 2
34. Advanced Subnetting Techniques
Advanced subnetting involves breaking a large CIDR block into several smaller subnets
based on varying requirements. Subnetting is used to create isolated broadcast domains,
enhance security, and improve performance. For example, given a /16 block, it can be
subnetted into 256 /24 networks or 1024 /26 networks, depending on the need.
35. Designing Enterprise Networks with CIDR
In an enterprise environment, CIDR allows IT architects to plan network segmentation
based on departments, locations, or application types. CIDR helps maintain a clean,
hierarchical IP scheme. For instance, HQ can use 10.1.0.0/16, while branches use
10.2.0.0/16 and 10.3.0.0/16. This simplifies route summarization and ACL configuration
across routers and firewalls.
36. Role of CIDR in Network Virtualization
Network virtualization platforms like VMware NSX and Cisco ACI use CIDR to allocate
address spaces to virtual networks, virtual machines, and tenant environments. CIDR
ensures address isolation and efficient space utilization, even when multiple virtual
networks coexist on the same hardware.
37. CIDR in Software-Defined Networking (SDN)
Software-Defined Networking abstracts the control plane from the data plane. CIDR plays a
critical role in defining forwarding rules, address segmentation, and tenant separation.
Controllers like OpenDaylight or ONOS leverage CIDR to apply policies and route definitions
dynamically across distributed environments.
38. IPv6 Subnetting with CIDR
IPv6 offers vast address space, and CIDR simplifies how subnets are allocated. A common
IPv6 allocation might use a /48 block for a site, further divided into multiple /64 subnets for
different segments. Even though each /64 supports 18 quintillion addresses, subnetting
with CIDR keeps the network manageable and secure.
39. CIDR Aggregation Strategies
When planning IP allocations, it is beneficial to design contiguous blocks that can later be
aggregated. For example, assigning 192.0.2.0/24, 192.0.3.0/24, and 192.0.4.0/24 enables
summarization into a larger 192.0.2.0/22 block. ISPs use these strategies to scale routing
tables efficiently.
40. CIDR Case Study: University Campus Network
A university may be allocated 172.16.0.0/16 for its internal use. This address block can be
subnetted into:
- 172.16.1.0/24 for Engineering
- 172.16.2.0/24 for Computer Science
- 172.16.3.0/24 for Administration
- 172.16.4.0/23 for Student Labs
CIDR allows network planners to allocate ranges based on population and device density,
avoiding wastage and ensuring scalability.
41. CIDR and Mobile Networks
Mobile carriers allocate IP addresses dynamically using DHCP and CIDR. For example, a /19
block (8192 addresses) may be assigned to a pool for users in a geographic region. This
helps manage IP assignment and conserve space in high-demand scenarios.
42. Tools to Simulate CIDR and Subnetting
Educational tools such as Cisco Packet Tracer, GNS3, and online subnet calculators help
learners practice CIDR planning. These tools visualize IP address ranges, subnet masks,
broadcast addresses, and CIDR aggregation in real time, reinforcing theoretical concepts.