{"id":1107,"date":"2026-05-02T09:11:35","date_gmt":"2026-05-02T09:11:35","guid":{"rendered":"https:\/\/www.exam-topics.info\/blog\/?p=1107"},"modified":"2026-10-20T09:54:25","modified_gmt":"2026-10-20T09:54:25","slug":"cidr-notation-explained-what-it-is-and-how-it-works","status":"publish","type":"post","link":"https:\/\/www.exam-topics.info\/blog\/cidr-notation-explained-what-it-is-and-how-it-works\/","title":{"rendered":"CIDR Notation Explained: What It Is and How It Works"},"content":{"rendered":"<div class=\"et-b01-editorial-v2\">\n<p>A CIDR prefix tells a router or administrator which leading bits of an IP address define the network. The familiar slash, as in <code>192.0.2.64\/26<\/code>, is not a decoration after the address: it determines the block&#8217;s size, the boundary between network and host bits, and which routing table entry best matches a packet&#8217;s destination. Once that boundary is understood, subnetting becomes a repeatable calculation instead of a collection of memorized address classes.<\/p>\n<p><strong>Classless Inter-Domain Routing (CIDR)<\/strong> also makes route aggregation possible. Instead of advertising hundreds of individual networks, a provider or enterprise can announce a correctly aligned summary prefix where the routing topology permits it. Addressing efficiency and routing scalability are connected, but allocating a prefix and safely summarizing it are different operational decisions.<\/p>\n<h2>Read the slash as a count of prefix bits<\/h2>\n<p>IPv4 addresses have 32 bits. A <code>\/26<\/code> prefix fixes the first 26 of those bits and leaves six host-position bits. The block therefore has <code>2^6 = 64<\/code> IPv4 address values. In a conventional IPv4 LAN subnet, the lowest value represents the network address and the highest is the directed broadcast address, leaving 62 conventional host addresses.<\/p>\n<p>Take <code>192.0.2.64\/26<\/code> as an example. Its mask is <code>255.255.255.192<\/code>; its block runs from <code>192.0.2.64<\/code> through <code>192.0.2.127<\/code>, and the next <code>\/26<\/code> begins at <code>.128<\/code>. The CIDR form is a compact way to communicate both the prefix and its boundary. An address such as <code>192.0.2.70\/26<\/code> describes a host within that block, not a different <code>\/26<\/code> network.<\/p>\n<table>\n<thead>\n<tr>\n<th>CIDR<\/th>\n<th style=\"text-align:right\">IPv4 block size<\/th>\n<th style=\"text-align:right\">Typical conventional host addresses<\/th>\n<th>Example aligned block<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><code>\/24<\/code><\/td>\n<td style=\"text-align:right\">256<\/td>\n<td style=\"text-align:right\">254<\/td>\n<td><code>198.51.100.0\u2013198.51.100.255<\/code><\/td>\n<\/tr>\n<tr>\n<td><code>\/25<\/code><\/td>\n<td style=\"text-align:right\">128<\/td>\n<td style=\"text-align:right\">126<\/td>\n<td><code>198.51.100.0\u2013198.51.100.127<\/code><\/td>\n<\/tr>\n<tr>\n<td><code>\/26<\/code><\/td>\n<td style=\"text-align:right\">64<\/td>\n<td style=\"text-align:right\">62<\/td>\n<td><code>198.51.100.64\u2013198.51.100.127<\/code><\/td>\n<\/tr>\n<tr>\n<td><code>\/27<\/code><\/td>\n<td style=\"text-align:right\">32<\/td>\n<td style=\"text-align:right\">30<\/td>\n<td><code>198.51.100.96\u2013198.51.100.127<\/code><\/td>\n<\/tr>\n<tr>\n<td><code>\/28<\/code><\/td>\n<td style=\"text-align:right\">16<\/td>\n<td style=\"text-align:right\">14<\/td>\n<td><code>198.51.100.112\u2013198.51.100.127<\/code><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>The last column uses documentation addresses only. Host-address counts in the table describe conventional multi-access IPv4 subnets, not every possible point-to-point or specialized use. For example, RFC 3021 specifies <code>\/31<\/code> use for supported IPv4 point-to-point links, and <code>\/32<\/code> denotes an individual IPv4 address or host route.<\/p>\n<h2>Calculate the boundary instead of guessing<\/h2>\n<p>To find the block for <code>10.20.30.139\/27<\/code>, start with the host bits: 32 minus 27 leaves five, so a block contains 32 addresses. The interesting final octet is grouped in increments of 32: <code>0, 32, 64, 96, 128, 160, 192, 224<\/code>. The value 139 lies in the block beginning at 128, so the network is <code>10.20.30.128\/27<\/code> and the last address is <code>.159<\/code>. In a conventional subnet, hosts are <code>.129<\/code> through <code>.158<\/code>.<\/p>\n<p>Binary reasoning gives the same answer. A <code>\/27<\/code> mask is <code>255.255.255.224<\/code>, whose final octet contains three leading network bits and five host bits. Bitwise AND of the IP address and mask clears the five host-position bits. This method works even when the prefix boundary is in the second or third octet and a memorized final-octet table becomes awkward.<\/p>\n<p><a href=\"https:\/\/www.exam-topics.info\/blog\/ipv4-subnetting-made-simple-learn-networking-fundamentals-fast\/\">IPv4 subnetting<\/a> teaches the block-boundary and host-count arithmetic. CIDR uses the same prefix notation for route aggregation and forwarding decisions, where the choice of boundary also affects network design.<\/p>\n<h2>Variable-length subnetting is a design choice<\/h2>\n<p><strong>VLSM<\/strong> allocates subnets of different prefix lengths inside a larger parent block. A department with 100 hosts might need a <code>\/25<\/code>, while a small management segment with a few devices can use a <code>\/28<\/code> or another appropriately sized prefix. Allocating identical <code>\/24<\/code> networks everywhere wastes addresses and often leaves poor growth boundaries.<\/p>\n<p>Work from the largest expected subnet downward, align each new block to its actual size, and leave headroom where the design requires it. A <code>\/26<\/code> cannot simply start at any convenient address: its network address must lie on a multiple-of-64 boundary in the relevant octet. Assigning <code>10.0.0.20\/26<\/code> as a <em>network<\/em> would obscure the fact that it belongs to <code>10.0.0.0\/26<\/code>.<\/p>\n<p>Document gateways, exclusions, reserved addresses and how DHCP scopes map to each prefix. For a <a href=\"https:\/\/www.exam-topics.info\/blog\/how-to-properly-design-vlan-subnets-for-efficient-network-performance\/\">VLAN-and-subnet design<\/a>, the IP plan should agree with the SVI\/router prefix, the DHCP pool and any firewall address objects. A VLAN ID does not itself encode a prefix length or range.<\/p>\n<h2>CIDR aggregation can simplify routing\u2014when it is truthful<\/h2>\n<p>Two contiguous <code>\/25<\/code> prefixes such as <code>203.0.113.0\/25<\/code> and <code>203.0.113.128\/25<\/code> combine into <code>203.0.113.0\/24<\/code> because they cover a correctly aligned, uninterrupted block. This is more than reducing two text entries to one: the summary route tells other routers that the summarizing router can forward traffic to <em>every address<\/em> within that <code>\/24<\/code> appropriately.<\/p>\n<p>If the lower and upper halves live behind unrelated next hops or a failure removes part of the block, advertising the summary without a plan can black-hole traffic. A router may need specific routes and an appropriate discard route to prevent forwarding loops for unused space within an aggregate. CIDR does not remove the need to verify reachability and policy boundaries.<\/p>\n<p>RFC 4632 identifies longest-prefix match as the forwarding rule. If a router knows both <code>203.0.113.0\/24<\/code> and the more specific <code>203.0.113.128\/25<\/code>, traffic to an address such as <code>203.0.113.200<\/code> follows the <code>\/25<\/code>, provided that route is otherwise usable in the relevant forwarding table. This decision is about prefix length, not merely which route was added most recently.<\/p>\n<h2>Distinguish an address allocation from a security boundary<\/h2>\n<p>Subnetting organizes addresses and routing. It does not by itself authorize or deny traffic. A router can forward between <code>10.10.0.0\/24<\/code> and <code>10.20.0.0\/24<\/code> if routes and forwarding controls permit it. An access control list or firewall policy enforces the allowed conversations; VLAN boundaries, identity and host security provide other relevant controls.<\/p>\n<p>Overlapping address plans create real operational friction. Two business units using <code>10.0.0.0\/16<\/code> may each work locally but collide during a VPN or cloud-network integration. CIDR notation makes the overlap visible; it does not magically fix it. Plan renumbering, address translation or deliberate routing isolation as separate measures after identifying the dependency.<\/p>\n<p>For IPv6, CIDR notation still expresses leading prefix bits, but IPv6 does not follow the same IPv4 network\/broadcast-reservation convention. A typical IPv6 LAN uses a <code>\/64<\/code>, although requirements vary by interface and protocol. Applying \u201csubtract two addresses\u201d from an IPv4 host-count table to IPv6 is not a useful design rule.<\/p>\n<h2>Verify a prefix before approving a change<\/h2>\n<p>Start with the proposed prefix and calculate its network boundary, total address count and any overlap with existing allocations. Compare it with the intended number of hosts and plausible growth. For routing changes, list every active more-specific route, next hop and failure domain before replacing them with a summary.<\/p>\n<p>If a system is unreachable after a prefix change, check the host mask and gateway first; then inspect ARP\/neighbor discovery, connected routes and longest-prefix forwarding choices. A wrong host mask can make a device attempt local delivery for an address that should be routed. A wrong summary can attract traffic that the announcing router cannot deliver.<\/p>\n<p>Finally, check the inventory: address management, cloud VNet\/subnet objects, on-prem DHCP scopes, VPN traffic selectors and firewall address groups may encode the same prefixes independently. Inconsistency among those systems is often the real source of post-migration incidents.<\/p>\n<p>CIDR is most powerful when used as a common language for addressing and routing. The slash defines a precise bit boundary; the architecture determines how that block should be allocated, advertised and protected. Correct calculations and verified reachability are equally necessary.<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>A CIDR prefix tells a router or administrator which leading bits of an IP address define the network. The familiar slash, as in 192.0.2.64\/26, is [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[20],"tags":[],"class_list":["post-1107","post","type-post","status-publish","format-standard","hentry","category-network-fundamentals"],"_links":{"self":[{"href":"https:\/\/www.exam-topics.info\/blog\/wp-json\/wp\/v2\/posts\/1107","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.exam-topics.info\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.exam-topics.info\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.exam-topics.info\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.exam-topics.info\/blog\/wp-json\/wp\/v2\/comments?post=1107"}],"version-history":[{"count":3,"href":"https:\/\/www.exam-topics.info\/blog\/wp-json\/wp\/v2\/posts\/1107\/revisions"}],"predecessor-version":[{"id":1001541,"href":"https:\/\/www.exam-topics.info\/blog\/wp-json\/wp\/v2\/posts\/1107\/revisions\/1001541"}],"wp:attachment":[{"href":"https:\/\/www.exam-topics.info\/blog\/wp-json\/wp\/v2\/media?parent=1107"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.exam-topics.info\/blog\/wp-json\/wp\/v2\/categories?post=1107"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.exam-topics.info\/blog\/wp-json\/wp\/v2\/tags?post=1107"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}