Content deleted Content added
add "for 32" for clarity. |
→IPv6 CIDR blocks: hyphen missing from compound modifier; grammatical number |
||
(12 intermediate revisions by 7 users not shown) | |||
Line 1:
{{Short description|Method for IP address allocation and routing}}
{{Redirect|CIDR}}
{{Copy edit |reason=direct links to RFCs (using {{tl|IETF RFC}} that its documentation says is not for that usage) rather than correctly citing these RFCs |date=August 2025}}
{{Use American English |date=August 2025}}
{{Use mdy dates |date=August 2025}}
'''Classless Inter-Domain Routing''' ('''CIDR''' {{IPAc-en|ˈ|s|aɪ|d|ər|,_|ˈ|s|ɪ|-}}) is a method for allocating [[IP address]]es for [[IP routing]]. The [[Internet Engineering Task Force]] introduced CIDR in 1993 to replace the previous [[classful network]] addressing architecture on the [[Internet]]. Its goal was to slow the growth of [[routing table]]s on [[router (computing)|routers]] across the Internet, and to help slow the rapid [[IPv4 address exhaustion|exhaustion of IPv4 addresses]].<ref name="RFC 1518">{{cite IETF |rfc=1518 |title=An Architecture for IP Address Allocation with CIDR |author1=Y. Rekhter |author2=T. Li |date=September 1993}}</ref><ref name="RFC 1519">{{cite IETF |rfc=1519 |title=Classless Inter-Domain Routing (CIDR): an Address Assignment and Aggregation Strategy |author1=V. Fuller |author2=T. Li |author3=J. Yu |author4=K. Varadhan |date=September 1993}}</ref>
IP addresses are described as consisting of two groups of [[bit]]s in the address: the [[most significant bit]]s are the [[network prefix]], which identifies a whole network or [[subnet]], and the [[least significant bit|least significant]] set forms the
Whereas classful network design for [[IPv4]] sized the network prefix as one or more 8-bit groups, resulting in the blocks of Class A, B, or C addresses, under CIDR address space is allocated to [[Internet service provider]]s and [[end user]]s on any address-bit boundary. In [[IPv6]], however, the interface identifier has a fixed size of 64 bits by convention, and smaller subnets are never allocated to end users.
{{Anchor|VLSM}}CIDR is based on
==Background==
Line 47 ⟶ 49:
The advantage of this system is that the network prefix could be determined for any IP address without any further information. The disadvantage is that networks were usually too big or too small for most organizations to use, because only three sizes were available. The smallest allocation and routing block contained 2<sup>8</sup> = 256 addresses, larger than necessary for personal or department networks, but too small for most enterprises. The next larger block contained 2<sup>16</sup> = {{gaps|65|536}} addresses, too large to be used efficiently even by large organizations. But for network users who needed more than {{gaps|65|536}} addresses, the only other size (2<sup>24</sup>) provided far too many, more than 16 million. This led to inefficiencies in address use as well as inefficiencies in routing, because it required a large number of allocated class-C networks with individual route announcements, being geographically dispersed with little opportunity for [[route aggregation]].
Within a decade after the invention of the [[Domain Name System]] (DNS), the classful network method was found not [[scalable]].<ref name="RFC 1517">{{cite IETF |rfc=1517 |title=Applicability Statement for the Implementation of Classless Inter-Domain Routing (CIDR) |editor=R. Hinden |date=September 1993}}</ref> This led to the development of [[subnet]]ting and CIDR. The formerly meaningful class distinctions based on the most-significant address bits were abandoned and the new system was described as
After a period of experimentation with various alternatives, Classless Inter-Domain Routing was based on variable-length subnet masking (VLSM), which allows each network to be divided into subnetworks of various power-of-two sizes, so that each subnetwork can be sized appropriately for local needs. Variable-length subnet masks were mentioned as one alternative in {{IETF RFC|950}}.<ref name="RFC 950 2.1">{{cite IETF |rfc=950 |title=Internet Standard Subnetting Procedure |editor1=J. Mogul |editor2=J. Postel |date=August 1985 |section=2.1}}</ref> Techniques for grouping addresses for common operations were based on the concept of cluster addressing, first proposed by Carl-Herbert Rokitansky.<ref>Carl-Herbert Rokitansky, "Internet Cluster Addressing Scheme and its Application to Public Data Networks", Proc. 9th International Conference on Computer Communication (ICCC' 88), pp. 482–491, Tel Aviv, Israel, October/November 1988</ref><ref>[http://www.ietf.org/mail-archive/web/ietf/current/msg24136.html Cluster Addressing and CIDR] in the mail archives of the IETF</ref>
Line 54 ⟶ 56:
==CIDR notation==
The address may denote a specific interface address (including a host identifier, such as {{IPaddr|10.0.0.1|8}}), or it may be the beginning address of an entire network (using a host identifier of 0, as in {{IPaddr|10.0.0.0|8}} or its equivalent {{IPaddr|10|8}}). CIDR notation can even be used with no IP address at all, e.g. when referring to a {{IPaddr||24}} as a generic description of an IPv4 network that has a 24-bit prefix and 8-bit host numbers.
For example:
* {{IPaddr|198.51.100.14|24}} represents the IPv4 address {{IPaddr|198.51.100.14}} and its associated network prefix {{IPaddr|198.51.100.0}}, or equivalently, its subnet mask {{IPaddr||24|netmask=dotted}}, which has 24 leading
* the IPv4 block {{IPaddr|198.51.100.0|22}} represents the 1024 IPv4 addresses from {{IPaddr|198.51.100.0}} to {{IPaddr|198.51.103.255}}.
* the IPv6 block {{IPaddr|2001:db8::|48}} represents the block of IPv6 addresses from {{IPaddr|2001:db8:0:0:0:0:0:0}} to {{IPaddr|2001:db8:0:ffff:ffff:ffff:ffff:ffff}}.
Line 66 ⟶ 68:
In IPv4, CIDR notation came into wide use only after the implementation of the method, which was documented using [[dotted-decimal]] subnet mask specification after the slash, for example, {{IPaddr|192.24.12.0|22|netmask=dotted}}.<ref name="RFC 1519" /> Describing the network prefix width as a single number ({{IPaddr|192.24.12.0|22}}) was easier for network administrators to conceptualize and to calculate. It became gradually incorporated into later standards documents<ref>{{cite ietf |rfc=1878 |title=Variable Length Subnet Table For IPv4 |author1=T. Pummill |author2=B. Manning |date=December 1995}}</ref><ref>{{cite ietf |rfc=2167 |title=Referral Whois (RWhois) Protocol V1.5 |author1=S. Williamson |author2=M. Kosters |author3=D. Blacka |author4=J. Singh |author5=K. Zeilstra |date=June 1997 |quote=IP networks are also lexically hierarchical labels using the Classless Inter-Domain Routing (CIDR) notation, but their hierarchy is not easily determined with simple text manipulation; for example, 198.41.0.0/22 is a part of 198.41.0.0/16, which is a part of 198.40.0.0/15.}}</ref> and into network configuration interfaces.
The number of addresses of a network may be calculated as 2<sup>address length − prefix length</sup>, where
==Subnet masks==
A subnet mask is a [[bitmask]] that encodes the prefix length associated with an IPv4 address or network in quad-dotted notation: 32 bits, starting with a number of
==CIDR blocks==
CIDR is principally a bitwise, prefix-based standard for the representation of IP addresses and their routing properties. It facilitates routing by allowing blocks of addresses to be grouped into single routing table entries. These groups, commonly called CIDR blocks, share an initial sequence of bits in the binary representation of their IP addresses. IPv4 CIDR blocks are identified using a syntax similar to that of IPv4 addresses: a dotted-decimal address, followed by a slash, then a number from 0 to 32, i.e., {{IPaddr|a.b.c.d|n}}. The dotted
An IP address is part of a CIDR block and is said to match the CIDR prefix if the initial
CIDR is also used for [[IPv6 address]]es and the syntax semantic is identical. The prefix length can range from 0 to 128, due to the larger number of bits in the address. However, by convention, a subnet on broadcast MAC layer networks always has 64-bit host identifiers.<ref>{{Cite IETF |rfc=7136|last=Carpenter |first=B. |last2=Jiang |first2=S. |date=February 2014 |title=Significance of IPv6 Interface Identifiers |language=en |doi-access=free }}</ref> Larger prefixes (/127) are only used on some point-to-point links between routers, for security and policy reasons.<ref>{{Cite IETF |rfc=6164 |last=Kohno |first=M. |last2=Nitzan |first2=B. |last3=Bush |first3=R. |last4=Matsuzaki |first4=Y. |last5=Colitti |first5=L. |last6=Narten |first6=T. |date=April 2011 |title=Using 127-Bit IPv6 Prefixes on Inter-Router Links |language=en}}</ref>[[File:IP Address Match.svg|400px|right]]
Line 386 ⟶ 388:
| style="text-align:right;" |256 A
|
| Entire IPv4 Internet, [[default route]]
|}
In routed subnets larger than {{IPaddr||31}} or {{IPaddr||32}}, the number of available host addresses is usually reduced by two, namely the largest address, which is reserved as the [[broadcast address]], and the smallest address, which identifies the network itself
In such usage, a {{IPaddr||31}} network, with one binary digit in the host identifier, is unusable, as such a subnet would provide no available host addresses after this reduction. {{IETF RFC|3021}} creates an exception to the "host all ones" and "host all zeros" rules to make {{IPaddr||31}} networks usable for point-to-point links. {{IPaddr||32}} addresses (single-host network) must be accessed by explicit routing rules, as there is no address available for a gateway.
Line 491 ⟶ 493:
| colspan="5" | '''T''' = 1,099,511,627,776
|}
The large address size of IPv6 permitted worldwide route summarization and guaranteed sufficient address pools at each site. The standard subnet size for IPv6 networks is a {{IPaddr||64}} block, which is required for the operation of [[IPv6 stateless address autoconfiguration|stateless address autoconfiguration]].<ref name="RFC 4862">{{IETF RFC|4862}}</ref> At first, the IETF recommended in {{IETF RFC|3177}} as a best practice that all end sites receive
This
2001:0db8:0123:4567:89ab:cdef:1234:5678
Line 516 ⟶ 518:
|||| |||| |||| |||64 Single LAN; default prefix size for [[IPv6#Stateless_address_autoconfiguration_(SLAAC)|SLAAC]]
|||| |||| |||| ||60 Some (very limited) [[6rd]] deployments (/60 = 16 /64 blocks)
|||| |||| |||| |56 Minimal end
|||| |||| |||| 52 /52 block = 4096 /64 blocks
|||| |||| |||48 Typical assignment for larger sites (/48 = 65536 /64 blocks)
Line 532 ⟶ 534:
==Numerical interpretation==
Topologically, the set of subnets described by CIDR represent a [[Cover (topology)|cover]] of the corresponding address space.
==Prefix aggregation==
|