Movatterモバイル変換


[0]ホーム

URL:


Jump to content
WikipediaThe Free Encyclopedia
Search

Classless Inter-Domain Routing

From Wikipedia, the free encyclopedia
Method for IP address allocation and routing
"CIDR" redirects here. For other uses, seeCIDR (disambiguation).
This articlemay requirecopy editing for direct links to RFCs (using{{IETF RFC}} that its documentation says is not for that usage) rather than correctly citing these RFCs. You can assist byediting it.(August 2025) (Learn how and when to remove this message)

Classless Inter-Domain Routing (CIDR pronounced "cider" or/ˈsɪdər/SID-ər) is a method for allocatingIP addresses forIP routing. TheInternet Engineering Task Force introduced CIDR in 1993 to replace the previousclassful network addressing architecture on theInternet. Its goal was to slow the growth ofrouting tables onrouters across the Internet, and to help slow the rapidexhaustion of IPv4 addresses.[1][2]

IP addresses are described as consisting of two groups ofbits in the address: themost significant bits are thenetwork prefix, which identifies a whole network orsubnet, and theleast significant set forms thehost identifier, which specifies a particular interface of a host on that network. This division is used as the basis of traffic routing between IP networks and for address allocation policies.

Whereas classful network design forIPv4 sized the network prefix as one or more eight-bit groups, resulting in the blocks of Class A, B, or C addresses, under CIDR address space is allocated toInternet service providers andend users on any address-bit boundary. InIPv6, however, the interface identifier has a fixed size of 64 bits by convention, and smaller subnets are never allocated to end users.

CIDR is based onvariable-length subnet masking (VLSM), in which network prefixes have variable length (as opposed to the fixed-length prefixing of the previous classful network design). The main benefit of this is that it grants finer control of the sizes of subnets allocated to organizations, hence slowing the exhaustion of IPv4 addresses from allocating larger subnets than needed. CIDR gave rise to a new way of writing IP addresses known as CIDR notation, in which an IP address is followed by a suffix indicating the number of bits of the prefix. Some examples of CIDR notation are the addresses192.0.2.0/24 for IPv4 and2001:db8::/32 for IPv6. Blocks of addresses having contiguous prefixes may be aggregated assupernets, reducing the number of entries in the global routing table.

Background

[edit]

Each IP address consists of a network prefix followed by ahost identifier. In theclassful network architecture ofIPv4, the three most significant bits of the 32-bit IP address defined the size of the network prefix forunicast networking, and determined the network class A, B, or C.[3]

ClassMost-significant bitsNetwork prefix length
(bits)
Host identifier length
(bits)
Address range
A08240.0.0.0–127.255.255.255
B101616128.0.0.0–191.255.255.255
C110248192.0.0.0–223.255.255.255
D(multicast)1110224.0.0.0–239.255.255.255
E(reserved)1111240.0.0.0–255.255.255.255

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 28 = 256 addresses, larger than necessary for personal or department networks, but too small for most enterprises. The next larger block contained 216 =65536 addresses, too large to be used efficiently even by large organizations. But for network users who needed more than65536 addresses, the only other size (224) 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 forroute aggregation.

Within a decade after the invention of theDomain Name System (DNS), the classful network method was found notscalable.[4] This led to the development ofsubnetting and CIDR. The formerly meaningful class distinctions based on the most-significant address bits were abandoned and the new system was described as "classless", in contrast to the old system, which became known as "classful". Routing protocols were revised to carry not just IP addresses, but also their subnet masks. Implementing CIDR required every host and router on the Internet to be reprogrammed in small ways—no small feat at a time when the Internet was entering a period of rapid growth. In 1993, theInternet Engineering Task Force published a new set of standards,RFC 1518 andRFC 1519, to define this new principle for allocating IP address blocks and routing IPv4 packets. An updated version,RFC 4632, was published in 2006.[5]

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 inRFC 950.[6] Techniques for grouping addresses for common operations were based on the concept of cluster addressing, first proposed by Carl-Herbert Rokitansky.[7][8]

CIDR notation

[edit]

CIDR notation is a compact representation of anIP address and its associatedsubnet mask. The notation was invented byPhil Karn in the 1980s.[9][10] CIDR notation specifies an IP address, aslash character ⟨/⟩, and a decimal number. The decimal number is the count of consecutive leading1 bits (from left to right) in the network mask. Each1 bit denotes a bit of the address range which must remain identical to the given IP address. The IP address in CIDR notation is always represented according to the standards forIPv4 orIPv6.

The address may denote a specific interface address (including ahost identifier, such as10.0.0.1/8), or it may be the beginning address of an entirenetwork (using a host identifier of 0, as in10.0.0.0/8 or its equivalent10/8). CIDR notation can even be used with no IP address at all, e.g. when referring to a/24 as a generic description of an IPv4 network that has a 24-bit prefix and 8-bit host numbers.

For example:

  • 198.51.100.14/24 represents the IPv4 address198.51.100.14 and its associated network prefix198.51.100.0, or equivalently, its subnet mask255.255.255.0, which has 24 leading1 bits.
  • the IPv4 block198.51.100.0/22 represents the 1024 IPv4 addresses from198.51.100.0 to198.51.103.255.
  • the IPv6 block2001:db8::/48 represents the block of IPv6 addresses from2001:db8:0:0:0:0:0:0 to2001:db8:0:ffff:ffff:ffff:ffff:ffff.
  • ::1/128 represents the IPv6loopback address. Its prefix length is 128 which is the number of bits in the address.

In IPv4, CIDR notation came into wide use only after the implementation of the method, which was documented usingdotted-decimal subnet mask specification after the slash, for example,192.24.12.0/255.255.252.0.[2] Describing the network prefix width as a single number (192.24.12.0/22) was easier for network administrators to conceptualize and to calculate. It became gradually incorporated into later standards documents[11][12] and into network configuration interfaces.

The number of addresses of a network may be calculated as 2address length − prefix length, where "address length" is 128 for IPv6 and 32 for IPv4. For example, in IPv4, the prefix length/29 gives: 232−29 = 23 = 8 addresses.

Subnet masks

[edit]

A subnet mask is abitmask that encodes the prefix length associated with an IPv4 address or network in quad-dotted notation: 32 bits, starting with a number of ones equal to the prefix length, ending with zeros, and encoded in four-part dotted-decimal format:255.255.255.0. 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 byRFC 950[6] to specify non-contiguous bits untilRFC 4632[5]: Section 5.1  stated that the mask must consist of only contiguous ones, if any, in the more significant bits and contiguous zeroes, if any, in the less significant bits. Given this constraint, a subnet mask and CIDR notation serve exactly the same function.

CIDR blocks

[edit]

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.,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 232−n 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.

CIDR is also used forIPv6 addresses 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.[13] Larger prefixes (/127) are only used on some point-to-point links between routers, for security and policy reasons.[14]

Assignment of CIDR blocks

[edit]

TheInternet Assigned Numbers Authority (IANA) issues toregional Internet registries (RIRs) large, short-prefix CIDR blocks. However, a/8 (with over sixteen million addresses) is the largest block IANA will allocate. For example,62.0.0.0/8 is administered byRIPE NCC, the European RIR. The RIRs, each responsible for a single, large, geographic area, such as Europe or North America, subdivide these blocks and allocate subnets to local Internet registries (LIRs). Similar subdividing may be repeated several times at lower levels of delegation. End-user networks receive subnets sized according to their projected short-term need. Networks served by a single ISP are encouraged byIETF recommendations to obtain IP address space directly from their ISP. Networks served by multiple ISPs, on the other hand, may obtainprovider-independent address space directly from the appropriate RIR.

For example, in the late 1990s, the IP address208.130.29.33 (since reassigned) was used by www.freesoft.org. An analysis of this address identified three CIDR prefixes.208.128.0.0/11, a large CIDR block containing over 2 million addresses, had been assigned byARIN (the North American RIR) toMCI. Automation Research Systems (ARS), a VirginiaVAR, leased an Internet connection from MCI and was assigned the208.130.28.0/22 block, capable of addressing just over 1000 devices. ARS used a/24 block for its publicly accessible servers, of which208.130.29.33 was one. All of these CIDR prefixes would be used, at different locations in the network. Outside MCI's network, the208.128.0.0/11 prefix would be used to direct to MCI traffic bound not only for208.130.29.33, but also for any of the roughly two million IP addresses with the same initial 11 bits. Within MCI's network,208.130.28.0/22 would become visible, directing traffic to theleased line serving ARS. Only within the ARS corporate network would the208.130.29.0/24 prefix have been used.

IPv4 CIDR blocks

[edit]
Address
format
Difference
to last address
MaskAddressesRelative
to class
A, B, C
Restrictions
ona,b,c andd
(0..255 unless noted)
Typical use
Decimal2n
a.b.c.d/32255.255.255.2551201256 CHost route
a.b.c.d/31+0.0.0.1255.255.255.2542211128 Cd = 0 ... (2n) ... 254Point-to-point links (RFC 3021)
a.b.c.d/30+0.0.0.3255.255.255.252422164 Cd = 0 ... (4n) ... 252Point-to-point links (glue network)
a.b.c.d/29+0.0.0.7255.255.255.248823132 Cd = 0 ... (8n) ... 248Smallest multi-host network
a.b.c.d/28+0.0.0.15255.255.255.2401624116 Cd = 0 ... (16n) ... 240SmallLAN
a.b.c.d/27+0.0.0.31255.255.255.224322518 Cd = 0 ... (32n) ... 224
a.b.c.d/26+0.0.0.63255.255.255.192642614 Cd = 0, 64, 128, 192
a.b.c.d/25+0.0.0.127255.255.255.1281282712 Cd = 0, 128LargeLAN
a.b.c.0/24+0.0.0.255255.255.255.0256281 C
a.b.c.0/23+0.0.1.255255.255.254.0512292 Cc = 0 ... (2n) ... 254
a.b.c.0/22+0.0.3.255255.255.252.01,0242104 Cc = 0 ... (4n) ... 252Small business
a.b.c.0/21+0.0.7.255255.255.248.02,0482118 Cc = 0 ... (8n) ... 248SmallISP/ large business
a.b.c.0/20+0.0.15.255255.255.240.04,09621216 Cc = 0 ... (16n) ... 240
a.b.c.0/19+0.0.31.255255.255.224.08,19221332 Cc = 0 ... (32n) ... 224ISP/ large business
a.b.c.0/18+0.0.63.255255.255.192.016,38421464 Cc = 0, 64, 128, 192
a.b.c.0/17+0.0.127.255255.255.128.032,768215128 Cc = 0, 128
a.b.0.0/16+0.0.255.255255.255.0.065,536216256 C = B
a.b.0.0/15+0.1.255.255255.254.0.0131,0722172 Bb = 0 ... (2n) ... 254
a.b.0.0/14+0.3.255.255255.252.0.0262,1442184 Bb = 0 ... (4n) ... 252
a.b.0.0/13+0.7.255.255255.248.0.0524,2882198 Bb = 0 ... (8n) ... 248
a.b.0.0/12+0.15.255.255255.240.0.01,048,57622016 Bb = 0 ... (16n) ... 240
a.b.0.0/11+0.31.255.255255.224.0.02,097,15222132 Bb = 0 ... (32n) ... 224
a.b.0.0/10+0.63.255.255255.192.0.04,194,30422264 Bb = 0, 64, 128, 192
a.b.0.0/9+0.127.255.255255.128.0.08,388,608223128 Bb = 0, 128
a.0.0.0/8+0.255.255.255255.0.0.016,777,216224256 B = ALargestIANA block allocation
a.0.0.0/7+1.255.255.255254.0.0.033,554,4322252 Aa = 0 ... (2n) ... 254
a.0.0.0/6+3.255.255.255252.0.0.067,108,8642264 Aa = 0 ... (4n) ... 252
a.0.0.0/5+7.255.255.255248.0.0.0134,217,7282278 Aa = 0 ... (8n) ... 248
a.0.0.0/4+15.255.255.255240.0.0.0268,435,45622816 Aa = 0 ... (16n) ... 240
a.0.0.0/3+31.255.255.255224.0.0.0536,870,91222932 Aa = 0 ... (32n) ... 224
a.0.0.0/2+63.255.255.255192.0.0.01,073,741,82423064 Aa = 0, 64, 128, 192
a.0.0.0/1+127.255.255.255128.0.0.02,147,483,648231128 Aa = 0, 128
0.0.0.0/0+255.255.255.2550.0.0.04,294,967,296232256 AEntire IPv4 Internet,default route

In routed subnets larger than/31 or/32, the number of available host addresses is usually reduced by two, namely the largest address, which is reserved as thebroadcast address, and the smallest address, which identifies the network itself[15] and is reserved solely for this purpose.[16]

In such usage, a/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.RFC 3021 creates an exception to the "host all ones" and "host all zeros" rules to make/31 networks usable for point-to-point links./32 addresses (single-host network) must be accessed by explicit routing rules, as there is no address available for a gateway.

IPv6 CIDR blocks

[edit]
IPv6 CIDR prefixes
Prefix sizeNumber of equivalent subnetsInterface ID bits
/48/56/64
/2416M4G1T104
/258M2G512G103
/264M1G256G102
/272M512M128G101
/281M256M64G100
/29512K128M32G99
/30256K64M16G98
/31128K32M8G97
/3264K16M4G96
/3332K8M2G95
/3416K4M1G94
/358K2M512M93
/364K1M256M92
/372K512K128M91
/381K256K64M90
/39512128K32M89
/4025664K16M88
/4112832K8M87
/426416K4M86
/43328K2M85
/44164K1M84
/4582K512K83
/4641K256K82
/472512128K81
/48125664K80
/4912832K79
/506416K78
/51328K77
/52164K76
/5382K75
/5441K74
/55251273
/56125672
/5712871
/586470
/593269
/601668
/61867
/62466
/63265
/64164
K = 1,024
M = 1,048,576
G = 1,073,741,824
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/64 block, which is required for the operation ofstateless address autoconfiguration.[17] At first, the IETF recommended inRFC 3177 as a best practice that all end sites receive/48 address allocations,[18] but criticism and reevaluation of actual needs and practices has led to more flexible allocation recommendations inRFC 6177[19] suggesting a significantly smaller allocation for some sites, such as a/56 block for residential networks.

This IPv6 subnetting reference lists the sizes for IPv6subnetworks. Different types of network links may require different subnet sizes.[20] The subnet mask separates the bits of the network identifier prefix from the bits of the interface identifier. Selecting a smaller prefix size results in fewer number of networks covered, but with more addresses within each network.[21]

2001:0db8:0123:4567:89ab:cdef:1234:5678|||| |||| |||| |||| |||| |||| |||| |||||||| |||| |||| |||| |||| |||| |||| |||128     Single end-points andloopback|||| |||| |||| |||| |||| |||| |||| |||127   Point-to-point links (inter-router)|||| |||| |||| |||| |||| |||| |||| ||124|||| |||| |||| |||| |||| |||| |||| |120|||| |||| |||| |||| |||| |||| |||| 116|||| |||| |||| |||| |||| |||| |||112|||| |||| |||| |||| |||| |||| ||108|||| |||| |||| |||| |||| |||| |104|||| |||| |||| |||| |||| |||| 100|||| |||| |||| |||| |||| |||96|||| |||| |||| |||| |||| ||92|||| |||| |||| |||| |||| |88|||| |||| |||| |||| |||| 84|||| |||| |||| |||| |||80|||| |||| |||| |||| ||76|||| |||| |||| |||| |72|||| |||| |||| |||| 68|||| |||| |||| |||64   Single LAN; default prefix size forSLAAC|||| |||| |||| ||60   Some (very limited)6rd deployments (/60 = 16 /64 blocks)|||| |||| |||| |56   Minimal end-site assignment;[19] e.g.home network (/56 = 256 /64 blocks)|||| |||| |||| 52   /52 block = 4096 /64 blocks|||| |||| |||48   Typical assignment for larger sites (/48 = 65536 /64 blocks)|||| |||| ||44|||| |||| |40|||| |||| 36   possible futurelocal Internet registry (LIR) extra-small allocations|||| |||32   LIR minimum allocations|||| ||28   LIR medium allocations|||| |24   LIR large allocations|||| 20   LIR extra large allocations|||16||12Regional Internet registry (RIR) allocations from IANA[22]|84

Numerical interpretation

[edit]

Topologically, the set of subnets described by CIDR represent acover of the corresponding address space. The interval described by the notationX/n{\displaystyle X/n} numerically corresponds to addresses of the form[x232n,x232n+232n1]{\displaystyle [x\cdot 2^{32-n},x\cdot 2^{32-n}+2^{32-n}-1]} (for IPv4) and[x2128n,x2128n+2128n1]{\displaystyle [x\cdot 2^{128n},x\cdot 2^{128n}+2^{128-n}-1]} (for IPv6), whereX=x232n{\displaystyle X=x\cdot 2^{32-n}} andX=x2128n{\displaystyle X=x\cdot 2^{128-n}} has the lowern{\displaystyle n} bits set to 0. For a fixedn{\displaystyle n}, the set of allX/n{\displaystyle X/n} subnets constitute apartition, that is a cover of non-overlapping sets. Increasingn{\displaystyle n} yields finer and finer subpartitions. Thus two subnetsX/n{\displaystyle X/n} andY/m{\displaystyle Y/m} are either disjoint or one is a subnet of the other.

Prefix aggregation

[edit]

CIDR provides fine-grainedrouting prefix aggregation. For example, if the first 20 bits of their network prefixes match, sixteen contiguous/24 networks can be aggregated and advertised to a larger network as a single/20routing table entry. This reduces the number of routes that have to be advertised.

See also

[edit]

References

[edit]
  1. ^Y. Rekhter; T. Li (September 1993).An Architecture for IP Address Allocation with CIDR.doi:10.17487/RFC1518.RFC1518.
  2. ^abV. Fuller; T. Li; J. Yu; K. Varadhan (September 1993).Classless Inter-Domain Routing (CIDR): an Address Assignment and Aggregation Strategy.doi:10.17487/RFC1519.RFC1519.
  3. ^J. Reynolds; J. Postel, eds. (April 1985).Assigned Numbers.doi:10.17487/RFC0943.RFC943.
  4. ^R. Hinden, ed. (September 1993).Applicability Statement for the Implementation of Classless Inter-Domain Routing (CIDR).doi:10.17487/RFC1517.RFC1517.
  5. ^abV. Fuller; T. Li (August 2006).Classless Inter-domain Routing (CIDR): The Internet Address Assignment and Aggregation Plan.doi:10.17487/RFC4632.RFC4632.
  6. ^abJ. Mogul; J. Postel, eds. (August 1985).Internet Standard Subnetting Procedure. sec. 2.1.doi:10.17487/RFC0950.RFC950.
  7. ^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
  8. ^Cluster Addressing and CIDR in the mail archives of the IETF
  9. ^Brian Kantor (December 2018)."Re: Stupid Question maybe?". North American Network Operators Group./24 is certainly cleaner than 255.255.255.0. I seem to remember it was Phil Karn who in the early 80's suggested that expressing subnet masks as the number of bits from the top end of the address word was efficient, since subnet masks were always a series of ones followd by zeros with no interspersing, which was incorporated (or independently invented) about a decade later as CIDR a.b.c.d/n notation in RFC1519.
  10. ^William Simpson (December 2018)."Re: Stupid Question maybe?". North American Network Operators Group.Actually, Brian is correct. Phil was w-a-y ahead of the times. But I don't remember him talking about it until the late '80s.
  11. ^T. Pummill; B. Manning (December 1995).Variable Length Subnet Table For IPv4.doi:10.17487/RFC1878.RFC1878.
  12. ^S. Williamson; M. Kosters; D. Blacka; J. Singh; K. Zeilstra (June 1997).Referral Whois (RWhois) Protocol V1.5.doi:10.17487/RFC2167.RFC2167.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.
  13. ^Carpenter, B.; Jiang, S. (February 2014).Significance of IPv6 Interface Identifiers.doi:10.17487/RFC7136.RFC7136.
  14. ^Kohno, M.; Nitzan, B.; Bush, R.; Matsuzaki, Y.; Colitti, L.; Narten, T. (April 2011).Using 127-Bit IPv6 Prefixes on Inter-Router Links.doi:10.17487/RFC6164.RFC6164.
  15. ^J. Mogul, ed. (October 1984).Broadcasting Internet Datagrams in the Presence of Subnets. sec. 7.doi:10.17487/RFC0922.RFC922.
  16. ^F. Baker, ed. (June 1995).Requirements for IP Version 4 Routers. sec. 4.2.3.1.doi:10.17487/RFC1812.RFC1812.
  17. ^RFC 4862
  18. ^IAB/IESG Recommendation on IPv6 Address Allocations to Sites. IAB/IESG. September 2001.doi:10.17487/RFC3177.RFC3177.
  19. ^abT. Narten; G. Huston; L. Roberts (March 2011).IPv6 Address Assignment to End Sites.doi:10.17487/RFC6177.RFC6177.
  20. ^"ARIN IPv6 Addressing Plans". Getipv6.info. March 25, 2016. RetrievedMarch 12, 2018.
  21. ^"RIPE IP Allocation Rates". Archived fromthe original on February 3, 2011.
  22. ^"IANA IPv6 unicast address assignments". Iana.org. RetrievedMarch 12, 2018.

Further reading

[edit]

External links

[edit]
Retrieved from "https://en.wikipedia.org/w/index.php?title=Classless_Inter-Domain_Routing&oldid=1326552851"
Categories:
Hidden categories:

[8]ページ先頭

©2009-2025 Movatter.jp