Classless Inter-Domain Routing: Difference between revisions

Content deleted Content added
Reverted 1 edit by 182.62.158.123 (talk) to last revision by GKNishimoto
Tags: Twinkle Undo Mobile edit Mobile web edit Advanced mobile edit Disambiguation links added
+at
Tags: Mobile edit Mobile app edit iOS app edit App full source
 
(2 intermediate revisions by the same user not shown)
Line 1:
{{Short description|Method for IP address allocation and routing}}
{{Redirect|CIDR}}
{{Copy edit |reason=formatting of numbers (why italicise them), direct links to RFCs, correct citing of 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>
 
Line 69 ⟶ 71:
 
==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 ''1''-bits equal to the prefix length, ending with ''0''-bits, and encoded in four-part dotted-decimal format: {{IPaddr||24|netmask=dotted}}. A subnet mask encodes the same information as a prefix length but predates the advent of CIDR. In CIDR notation, the prefix bits are always contiguous. Subnet masks were allowed by {{IETF RFC|950}}<ref name="RFC 950 2.1"/> to specify non-contiguous bits until {{IETF RFC|4632}}<ref name="RFC 4632"/>{{rp|at=Section 5.1}} stated that the mask must be left contiguous. Given this constraint, a subnet mask and CIDR notation serve exactly the same function.
 
==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 -decimal portion is the IPv4 address. The number following the slash is the prefix length, the number of shared initial bits, counting from the most-significant bit of the address. When emphasizing only the size of a network, the address portion of the notation is usually omitted. Thus, a /20 block is a CIDR block with an unspecified 20-bit prefix.
 
An IP address is part of a CIDR block and is said to match the CIDR prefix if the initial ''n'' bits of the address and the CIDR prefix are the same. An IPv4 address is 32 bits so an ''n''-bit CIDR prefix leaves 32 − ''n'' bits unmatched, meaning that 2<sup>32−''n''</sup> IPv4 addresses match a given ''n''-bit CIDR prefix. Shorter CIDR prefixes match more addresses, while longer prefixes match fewer. In the case of overlaid CIDR blocks, an address can match multiple CIDR prefixes of different lengths.