{"id":108,"date":"2023-12-20T17:40:00","date_gmt":"2023-12-20T17:40:00","guid":{"rendered":"https:\/\/www.ipv4.deals\/blog\/?p=108"},"modified":"2024-11-19T09:24:31","modified_gmt":"2024-11-19T03:54:31","slug":"what-is-cidr","status":"publish","type":"post","link":"https:\/\/www.alphainfolab.com\/blog\/what-is-cidr\/","title":{"rendered":"What is CIDR? Classless Inter Domain Routing explained"},"content":{"rendered":"\n<p>What is CIDR? Classless Inter Domain Routing, or CIDR, is a method used to allocate IP addresses and route IP packets flexibly and efficiently. Introduced by the <a href=\"https:\/\/www.ipv4.deals\/blog\/what-is-ietf\/\" data-type=\"link\" data-id=\"https:\/\/www.ipv4.deals\/blog\/what-is-ietf\/\" target=\"_blank\" rel=\"noreferrer noopener\">Internet Engineering Task Force (IETF)<\/a> in 1993, CIDR was designed to replace the previous addressing architecture of classful network design on the Internet. The primary goals of CIDR were to slow the growth of routing tables on routers across the Internet and to help slow the rapid <a href=\"https:\/\/www.ipv4.deals\/blog\/brief-overview-of-the-ipv4-market\/#ipv4-exhaustion\" target=\"_blank\" rel=\"noreferrer noopener\">exhaustion of IPv4 addresses<\/a>. But before we dive into the details of CIDR, let&#8217;s take a step back and understand the basics.<\/p>\n\n\n\n<div class=\"wp-block-rank-math-toc-block\" style=\"padding-top:var(--wp--preset--spacing--20);padding-right:var(--wp--preset--spacing--20);padding-bottom:var(--wp--preset--spacing--20);padding-left:var(--wp--preset--spacing--20);line-height:1.5\" id=\"rank-math-toc\"><h2>Table of Contents<\/h2><nav><ul><li><a href=\"#the-basics-ip-addresses\">The Basics: IP Addresses<\/a><\/li><li><a href=\"#the-problem-with-classful-networks\">The Problem with Classful Networks<\/a><\/li><li><a href=\"#the-solution-classless-inter-domain-routing-cidr\">The Solution: Classless Inter-Domain Routing (CIDR)<\/a><\/li><li><a href=\"#what-is-cidr-notation\">What is CIDR Notation?<\/a><\/li><li><a href=\"#benefits-of-cidr\">Benefits of CIDR<\/a><\/li><li><a href=\"#cidr-and-ip-routing\">CIDR and IP Routing<\/a><\/li><li><a href=\"#classful-vs-classless-routing\">Classful vs. Classless Routing<\/a><\/li><li><a href=\"#frequently-asked-questions\">Frequently Asked Questions<\/a><\/li><\/ul><\/nav><\/div>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"the-basics-ip-addresses\">The Basics: IP Addresses<\/h2>\n\n\n\n<p>An <a href=\"https:\/\/www.ipv4.deals\/blog\/what-is-ipv4-address\/\" target=\"_blank\" rel=\"noreferrer noopener\">IP (Internet Protocol) address<\/a> is a unique identifier for a device connected to a network. It&#8217;s like the postal address of your home but for your computer, smartphone, or any other device connected to the internet. IP addresses are fundamental to how the internet works, allowing devices to communicate with each other.<\/p>\n\n\n\n<p>There are two types of IP addresses: IPv4 and IPv6. IPv4 addresses are written as four sets of numbers from 0-255, separated by periods, like <strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-green-cyan-color\">192.168.0.1.<\/mark><\/strong> However, due to the growing number of devices connected to the internet, IPv4 addresses are running out. Hence, IPv6 was introduced, which uses a more complex system of alphanumeric characters, providing a much larger pool of addresses.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"the-problem-with-classful-networks\">The Problem with Classful Networks<\/h2>\n\n\n\n<p>Initially, IP addresses were divided into classes (Class A, B, C, D, and E) based on the first few bits of the address. This system, known as classful networking, was simple but had significant drawbacks. It was inefficient and led to wasted IP addresses. For example, a Class A network could support over 16 million hosts, far more than most organizations needed. This led to the rapid exhaustion of the available IP address space.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"the-solution-classless-inter-domain-routing-cidr\">The Solution: Classless Inter-Domain Routing (CIDR)<\/h2>\n\n\n\n<p><strong>What is CIDR? <\/strong><\/p>\n\n\n\n<p>To overcome the limitations of classful networking, CIDR was introduced in 1993. CIDR is a more flexible way to allocate IP addresses and route IP packets. So, how does CIDR work? Instead of segregating IP addresses into rigid classes, CIDR uses a method known as variable-length subnet masking (<a href=\"https:\/\/www.scaler.com\/topics\/vlsm\/\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">VLSM<\/a>).<\/p>\n\n\n\n<p>In CIDR notation, an IP address is followed by a slash (\/) and then a number, like <strong><span class=\"has-inline-color has-vivid-green-cyan-color\">192.168.0.0\/24<\/span><\/strong>. The number after the slash represents the number of bits used for the network portion of the address. This allows for more granular control over the IP address allocation, reducing the wastage of IP addresses.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"what-is-cidr-notation\">What is CIDR Notation?<\/h2>\n\n\n\n<p>CIDR notation is a compact representation of an IP address and its associated routing prefix. The notation is constructed from an IP address, a slash (&#8216;\/&#8217;) character, and a decimal number. The number is the count of leading 1 bits in the routing mask, often called the <a href=\"https:\/\/www.javatpoint.com\/subnet-mask\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">network mask<\/a>. CIDR notation is a syntax for representing a network or a subnet.<\/p>\n\n\n\n<p><strong>For example, CIDR notation might look something like this:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>IPv4: 192.0.2.0\/24<\/li>\n\n\n\n<li>IPv6: 2001:db8::\/32<\/li>\n<\/ul>\n\n\n\n<p>In these examples, the number after the slash represents the count of leading 1 bit in the routing mask, also known as the network mask.<\/p>\n\n\n\n<p><strong>Here&#8217;s a simple breakdown of a CIDR address:<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td><strong>CIDR Address<\/strong><\/td><td><strong>IP Address<\/strong><\/td><td><strong>Prefix Length<\/strong><\/td><\/tr><tr><td>203.0.113.0\/24<\/td><td>203.0.113.0<\/td><td>24<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>The number after the slash in CIDR notation is the prefix length. The prefix length specifies how many bits are used for the network prefix. For example, in the CIDR address 203.0.113.0\/24, the prefix length is 24. The IP address part, 203.0.113.0, is the network address, and the \/24 indicates that the first 24 bits are used for the network prefix.<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1400\" height=\"543\" src=\"https:\/\/www.alphainfolab.com\/blog\/wp-content\/uploads\/2023\/12\/1_t89Tb3VonOL8GQLs5Zm5wQ.webp\" alt=\"CIDR Notation\n\" class=\"wp-image-10409\" title=\"\" srcset=\"https:\/\/www.alphainfolab.com\/blog\/wp-content\/uploads\/2023\/12\/1_t89Tb3VonOL8GQLs5Zm5wQ.webp 1400w, https:\/\/www.alphainfolab.com\/blog\/wp-content\/uploads\/2023\/12\/1_t89Tb3VonOL8GQLs5Zm5wQ-300x116.webp 300w, https:\/\/www.alphainfolab.com\/blog\/wp-content\/uploads\/2023\/12\/1_t89Tb3VonOL8GQLs5Zm5wQ-1024x397.webp 1024w, https:\/\/www.alphainfolab.com\/blog\/wp-content\/uploads\/2023\/12\/1_t89Tb3VonOL8GQLs5Zm5wQ-768x298.webp 768w, https:\/\/www.alphainfolab.com\/blog\/wp-content\/uploads\/2023\/12\/1_t89Tb3VonOL8GQLs5Zm5wQ-150x58.webp 150w\" sizes=\"(max-width: 1400px) 100vw, 1400px\" \/><figcaption class=\"wp-element-caption\"><em>(Image credits: Michel Burnett, Medium)<\/em><\/figcaption><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"benefits-of-cidr\">Benefits of CIDR<\/h2>\n\n\n\n<p>CIDR offers several benefits:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Efficient use of IP address space:<\/strong> CIDR allows for close matching of the IP address to the number of hosts. This reduces the wastage of IP addresses.<\/li>\n\n\n\n<li><strong>Scalability:<\/strong> CIDR&#8217;s flexible allocation method supports more levels of hierarchy, improving the scalability of the internet.<\/li>\n\n\n\n<li><strong>Improved routing:<\/strong> CIDR supports route aggregation, also known as route summarization, which reduces the size of routing tables and makes routing more efficient.<\/li>\n<\/ol>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"cidr-and-ip-routing\">CIDR and IP Routing<\/h2>\n\n\n\n<p>CIDR plays a crucial role in IP routing. The routing table stores the destination network prefixes and the router&#8217;s next hop addresses. The router uses the longest prefix match rule to forward the packets. The longest prefix match means that out of all routes that match, the one with the longest prefix is chosen.<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"933\" height=\"494\" src=\"https:\/\/www.ipv4.deals\/blog\/wp-content\/uploads\/2024\/07\/Computer-Networks-Longest-Prefix-Matching-in-Routers.png\" alt=\"\" class=\"wp-image-9979\" title=\"\" srcset=\"https:\/\/www.alphainfolab.com\/blog\/wp-content\/uploads\/2024\/07\/Computer-Networks-Longest-Prefix-Matching-in-Routers.png 933w, https:\/\/www.alphainfolab.com\/blog\/wp-content\/uploads\/2024\/07\/Computer-Networks-Longest-Prefix-Matching-in-Routers-300x159.png 300w, https:\/\/www.alphainfolab.com\/blog\/wp-content\/uploads\/2024\/07\/Computer-Networks-Longest-Prefix-Matching-in-Routers-768x407.png 768w, https:\/\/www.alphainfolab.com\/blog\/wp-content\/uploads\/2024\/07\/Computer-Networks-Longest-Prefix-Matching-in-Routers-150x79.png 150w\" sizes=\"(max-width: 933px) 100vw, 933px\" \/><figcaption class=\"wp-element-caption\"><em>(Image source: GeeksforGeeks)<\/em><\/figcaption><\/figure>\n\n\n\n<p>In the above scenario, all packets within the range 192.24.12.0 to 192.24.15.255 are forwarded to the next hop B, as B has a longer prefix of 22 bits compared to D\u2019s 18 bits.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"classful-vs-classless-routing\">Classful vs. Classless Routing<\/h2>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td><strong>Feature<\/strong><\/td><td><strong>Classful Routing<\/strong><\/td><td><strong>Classless Routing<\/strong><\/td><\/tr><tr><td><strong>IP Address Structure<\/strong><\/td><td>Divided into fixed classes (A, B, C, D, E).<\/td><td>No fixed classes; uses CIDR.<\/td><\/tr><tr><td><strong>Subnetting<\/strong><\/td><td>Does not support variable length subnet masking (VLSM).<\/td><td>Supports VLSM, allowing more efficient use of IP addresses.<\/td><\/tr><tr><td><strong>Supernetting<\/strong><\/td><td>Does not support supernetting.<\/td><td>Supports supernetting, useful for aggregating multiple networks into a larger address block.<\/td><\/tr><tr><td><strong>Flexibility<\/strong><\/td><td>Less flexible due to fixed class structure.<\/td><td>More flexible in IP address allocation and management.<\/td><\/tr><tr><td><strong>Efficiency<\/strong><\/td><td>Less efficient in utilizing IP addresses.<\/td><td>More efficient, reducing the wastage of IP addresses.<\/td><\/tr><tr><td><strong>Routing Protocol Support<\/strong><\/td><td>Supported by older routing protocols (e.g., RIPv1, IGRP).<\/td><td>Supported by newer protocols (e.g., RIPv2, OSPF, EIGRP, BGP).<\/td><\/tr><tr><td><strong>Broadcast Domains<\/strong><\/td><td>Larger broadcast domains, leading to potential network inefficiencies.<\/td><td>Smaller and more controlled broadcast domains.<\/td><\/tr><tr><td><strong>Network Mask<\/strong><\/td><td>Default network masks based on class (e.g., 255.0.0.0 for Class A).<\/td><td>Custom subnet masks specified using CIDR notation (e.g., \/24).<\/td><\/tr><tr><td><strong>Route Summarization<\/strong><\/td><td>Less efficient, as it does not support CIDR.<\/td><td>More efficient due to CIDR, leading to simpler routing tables.<\/td><\/tr><tr><td><strong>Implementation<\/strong><\/td><td>Common in older, simpler networks.<\/td><td>Widely used in modern networking for better IP address management.<\/td><\/tr><tr><td><strong>Waste of IP Addresses<\/strong><\/td><td>More wastage due to rigid class structure.<\/td><td>Reduces wastage by allowing allocation based on need.<\/td><\/tr><\/tbody><\/table><figcaption class=\"wp-element-caption\">Key differences between Classful and Classless Routing<\/figcaption><\/figure>\n\n\n\n<p><strong>Also Read:<\/strong> <a href=\"https:\/\/www.ipv4.deals\/blog\/what-is-ipv4-address\/\" target=\"_blank\" rel=\"noreferrer noopener\">What is an IPv4 address?<\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"frequently-asked-questions\">Frequently Asked Questions<\/h2>\n\n\n<div id=\"rank-math-faq\" class=\"rank-math-block\">\n<div class=\"rank-math-list \">\n<div id=\"faq-question-1694338078943\" class=\"rank-math-list-item\">\n<p class=\"rank-math-question \"><strong>What is CIDR?<\/strong><\/p>\n<div class=\"rank-math-answer \">\n\n<p>CIDR is a method used to allocate IP addresses and route IP packets flexibly and efficiently. Introduced by the Internet Engineering Task Force (IETF) in 1993, CIDR was designed to replace the previous addressing architecture of classful network design on the Internet.<\/p>\n\n<\/div>\n<\/div>\n<div id=\"faq-question-1694338081548\" class=\"rank-math-list-item\">\n<p class=\"rank-math-question \"><strong>What was the problem with Classful Networks?<\/strong><\/p>\n<div class=\"rank-math-answer \">\n\n<p>Initially, IP addresses were divided into classes (Class A, B, C, D, and E) based on the first few bits of the address. This system, known as classful networking, was simple but had significant drawbacks. It was inefficient and led to wasted IP addresses, leading to the rapid exhaustion of the available IP address space.<\/p>\n\n<\/div>\n<\/div>\n<div id=\"faq-question-1694338087607\" class=\"rank-math-list-item\">\n<p class=\"rank-math-question \"><strong>What is the solution to the limitations of Classful Networks?<\/strong><\/p>\n<div class=\"rank-math-answer \">\n\n<p>To overcome the limitations of classful networking, CIDR was introduced in 1993. CIDR is a more flexible way to allocate IP addresses and route IP packets. Instead of segregating IP addresses into rigid classes, CIDR uses a method known as variable-length subnet masking (VLSM).<\/p>\n\n<\/div>\n<\/div>\n<div id=\"faq-question-1694338092032\" class=\"rank-math-list-item\">\n<p class=\"rank-math-question \"><strong>What is CIDR notation?<\/strong><\/p>\n<div class=\"rank-math-answer \">\n\n<p>CIDR notation is a compact representation of an IP address and its associated routing prefix. The notation is constructed from an IP address, a slash (\u2018\/\u2019) character, and a decimal number. The number is the count of leading 1 bits in the routing mask, often called the network mask. CIDR notation is a syntax for representing a network or a subnet.<\/p>\n\n<\/div>\n<\/div>\n<div id=\"faq-question-1694338096593\" class=\"rank-math-list-item\">\n<p class=\"rank-math-question \"><strong>What are the benefits of CIDR?<\/strong><\/p>\n<div class=\"rank-math-answer \">\n\n<p>CIDR offers several benefits including efficient use of IP address space, scalability, and improved routing. CIDR allows for close matching of the IP address to the number of hosts, reducing the wastage of IP addresses. CIDR\u2019s flexible allocation method supports more levels of hierarchy, improving the scalability of the internet. CIDR also supports route aggregation, which reduces the size of routing tables and makes routing more efficient.<\/p>\n\n<\/div>\n<\/div>\n<div id=\"faq-question-1694338103733\" class=\"rank-math-list-item\">\n<p class=\"rank-math-question \"><strong>What role does CIDR play in IP routing?<\/strong><\/p>\n<div class=\"rank-math-answer \">\n\n<p>CIDR plays a crucial role in IP routing. The routing table stores the destination network prefixes and the router\u2019s next hop addresses. The router uses the longest prefix match rule to forward the packets. The longest prefix match means that out of all routes that match, the one with the longest prefix is chosen.<\/p>\n\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n\n<div class=\"taxonomy-post_tag wp-block-post-terms\"><a href=\"https:\/\/www.alphainfolab.com\/blog\/tag\/cidr\/\" rel=\"tag\">cidr<\/a><span class=\"wp-block-post-terms__separator\">, <\/span><a href=\"https:\/\/www.alphainfolab.com\/blog\/tag\/cidr-guide\/\" rel=\"tag\">cidr guide<\/a><span class=\"wp-block-post-terms__separator\">, <\/span><a href=\"https:\/\/www.alphainfolab.com\/blog\/tag\/cidr-notation-explained\/\" rel=\"tag\">cidr notation explained<\/a><span class=\"wp-block-post-terms__separator\">, <\/span><a href=\"https:\/\/www.alphainfolab.com\/blog\/tag\/what-is-cidr\/\" rel=\"tag\">what is cidr<\/a><\/div>","protected":false},"excerpt":{"rendered":"<p>What is CIDR? Classless Inter Domain Routing, or CIDR, is a method used to allocate IP addresses and route IP packets flexibly and efficiently. Introduced by the Internet Engineering Task Force (IETF) in 1993, CIDR was designed to replace the previous addressing architecture of classful network design on the Internet. The primary goals of CIDR [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":10405,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"rank_math_lock_modified_date":false,"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[5],"tags":[208,475,218,476],"class_list":["post-108","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-internet-infrastructure","tag-cidr","tag-cidr-guide","tag-cidr-notation-explained","tag-what-is-cidr"],"_links":{"self":[{"href":"https:\/\/www.alphainfolab.com\/blog\/wp-json\/wp\/v2\/posts\/108"}],"collection":[{"href":"https:\/\/www.alphainfolab.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.alphainfolab.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.alphainfolab.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.alphainfolab.com\/blog\/wp-json\/wp\/v2\/comments?post=108"}],"version-history":[{"count":24,"href":"https:\/\/www.alphainfolab.com\/blog\/wp-json\/wp\/v2\/posts\/108\/revisions"}],"predecessor-version":[{"id":10410,"href":"https:\/\/www.alphainfolab.com\/blog\/wp-json\/wp\/v2\/posts\/108\/revisions\/10410"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.alphainfolab.com\/blog\/wp-json\/wp\/v2\/media\/10405"}],"wp:attachment":[{"href":"https:\/\/www.alphainfolab.com\/blog\/wp-json\/wp\/v2\/media?parent=108"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.alphainfolab.com\/blog\/wp-json\/wp\/v2\/categories?post=108"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.alphainfolab.com\/blog\/wp-json\/wp\/v2\/tags?post=108"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}