Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Classless Inter-Domain Routing
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==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. 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]] ===Assignment of CIDR blocks=== The [[Internet Assigned Numbers Authority]] (IANA) issues to [[regional Internet registries]] (RIRs) large, short-prefix CIDR blocks. However, a {{IPaddr||8}} (with over sixteen million addresses) is the largest block IANA will allocate. For example, {{IPaddr|62.0.0.0|8}} is administered by [[RIPE 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 by [[IETF]] recommendations to obtain IP address space directly from their ISP. Networks served by multiple ISPs, on the other hand, may obtain [[provider-independent address space]] directly from the appropriate RIR. [[File:CIDR Address.svg|right|400px]] For example, in the late 1990s, the IP address {{IPaddr|208.130.29.33}} (since reassigned) was used by www.freesoft.org. An analysis of this address identified three CIDR prefixes. {{IPaddr|208.128.0.0|11}}, a large CIDR block containing over 2 million addresses, had been assigned by [[ARIN]] (the North American RIR) to [[MCI Communications|MCI]]. Automation Research Systems (ARS), a Virginia [[Value-added reseller|VAR]], leased an Internet connection from MCI and was assigned the {{IPaddr|208.130.28.0|22}} block, capable of addressing just over 1000 devices. ARS used a {{IPaddr||24}} block for its publicly accessible servers, of which {{IPaddr|208.130.29.33}} was one. All of these CIDR prefixes would be used, at different locations in the network. Outside MCI's network, the {{IPaddr|208.128.0.0|11}} prefix would be used to direct to MCI traffic bound not only for {{IPaddr|208.130.29.33}}, but also for any of the roughly two million IP addresses with the same initial 11 bits. Within MCI's network, {{IPaddr|208.130.28.0|22}} would become visible, directing traffic to the leased line serving ARS. Only within the ARS corporate network would the {{IPaddr|208.130.29.0|24}} prefix have been used. ===IPv4 CIDR blocks=== {| class="wikitable" ! rowspan = 2 | Address<br />format ! rowspan = 2 | Difference<br />to last address ! rowspan = 2 | Mask ! colspan = 2 | Addresses ! rowspan = 2 | Relative<br />to class<br />A, B, C ! rowspan = 2 | Restrictions<br />on ''a'', ''b'', ''c'' and ''d''<br /><small>(0..255 unless noted)</small> ! rowspan = 2 | Typical use |- ! Decimal !2<sup>''n''</sup> |- |{{IPaddr|a.b.c.d|32}} | |{{IPaddr|255.255.255.255|}} | style="text-align:right;" |1 | style="text-align:right;" |2<sup>0</sup> | style="text-align:right;" |{{frac|1|256}} C | | Host route |- |{{IPaddr|a.b.c.d|31}} | +{{IPaddr|0.0.0.1|}} |{{IPaddr|255.255.255.254|}} | style="text-align:right;" |2 | style="text-align:right;" |2<sup>1</sup> | style="text-align:right;" |{{frac|1|128}} C |''d'' = 0 ... (2''n'') ... 254 | Point-to-point links ({{IETF RFC|3021}}) |- |{{IPaddr|a.b.c.d|30}} | +{{IPaddr|0.0.0.3|}} |{{IPaddr|255.255.255.252|}} | style="text-align:right;" |4 | style="text-align:right;" |2<sup>2</sup> | style="text-align:right;" |{{frac|1|64}} C |''d'' = 0 ... (4''n'') ... 252 | {{nowrap|Point-to-point links (glue network)}} |- |{{IPaddr|a.b.c.d|29}} | +{{IPaddr|0.0.0.7|}} |{{IPaddr|255.255.255.248|}} | style="text-align:right;" |8 | style="text-align:right;" |2<sup>3</sup> | style="text-align:right;" |{{frac|1|32}} C |''d'' = 0 ... (8''n'') ... 248 | Smallest multi-host network |- |{{IPaddr|a.b.c.d|28}} | +{{IPaddr|0.0.0.15|}} |{{IPaddr|255.255.255.240|}} | style="text-align:right;" |16 | style="text-align:right;" |2<sup>4</sup> | style="text-align:right;" |{{frac|1|16}} C |''d'' = 0 ... (16''n'') ... 240 | rowspan=3 | Small [[LAN]] |- |{{IPaddr|a.b.c.d|27}} | +{{IPaddr|0.0.0.31|}} |{{IPaddr|255.255.255.224|}} | style="text-align:right;" |32 | style="text-align:right;" |2<sup>5</sup> | style="text-align:right;" |{{frac|1|8}} C |''d'' = 0 ... (32''n'') ... 224 |- |{{IPaddr|a.b.c.d|26}} | +{{IPaddr|0.0.0.63|}} |{{IPaddr|255.255.255.192|}} | style="text-align:right;" |64 | style="text-align:right;" |2<sup>6</sup> | style="text-align:right;" |{{frac|1|4}} C |''d'' = 0, 64, 128, 192 |- |{{IPaddr|a.b.c.d|25}} | +{{IPaddr|0.0.0.127|}} |{{IPaddr|255.255.255.128|}} | style="text-align:right;" |128 | style="text-align:right;" |2<sup>7</sup> | style="text-align:right;" |{{frac|1|2}} C |''d'' = 0, 128 | rowspan=2 | Large [[LAN]] |- |{{IPaddr|a.b.c.0|24}} | +{{IPaddr|0.0.0.255|}} |{{IPaddr|255.255.255.0|}} | style="text-align:right;" |256 | style="text-align:right;" |2<sup>8</sup> | style="text-align:right;" |1 C | |- |{{IPaddr|a.b.c.0|23}} | +{{IPaddr|0.0.1.255|}} |{{IPaddr|255.255.254.0|}} | style="text-align:right;" |512 | style="text-align:right;" |2<sup>9</sup> | style="text-align:right;" |2 C |''c'' = 0 ... (2''n'') ... 254 | |- |{{IPaddr|a.b.c.0|22}} | +{{IPaddr|0.0.3.255|}} |{{IPaddr|255.255.252.0|}} | style="text-align:right;" |1,024 | style="text-align:right;" |2<sup>10</sup> | style="text-align:right;" |4 C |''c'' = 0 ... (4''n'') ... 252 |Small business |- |{{IPaddr|a.b.c.0|21}} | +{{IPaddr|0.0.7.255|}} |{{IPaddr|255.255.248.0|}} | style="text-align:right;" |2,048 | style="text-align:right;" |2<sup>11</sup> | style="text-align:right;" |8 C |''c'' = 0 ... (8''n'') ... 248 | rowspan=2 | Small [[ISP]]/ large business |- |{{IPaddr|a.b.c.0|20}} | +{{IPaddr|0.0.15.255|}} |{{IPaddr|255.255.240.0|}} | style="text-align:right;" |4,096 | style="text-align:right;" |2<sup>12</sup> | style="text-align:right;" |16 C |''c'' = 0 ... (16''n'') ... 240 |- |{{IPaddr|a.b.c.0|19}} | +{{IPaddr|0.0.31.255|}} |{{IPaddr|255.255.224.0|}} | style="text-align:right;" |8,192 | style="text-align:right;" |2<sup>13</sup> | style="text-align:right;" |32 C |''c'' = 0 ... (32''n'') ... 224 | rowspan=3 | [[ISP]]/ large business |- |{{IPaddr|a.b.c.0|18}} | +{{IPaddr|0.0.63.255|}} |{{IPaddr|255.255.192.0|}} | style="text-align:right;" |16,384 | style="text-align:right;" |2<sup>14</sup> | style="text-align:right;" |64 C |''c'' = 0, 64, 128, 192 |- |{{IPaddr|a.b.c.0|17}} | +{{IPaddr|0.0.127.255|}} |{{IPaddr|255.255.128.0|}} | style="text-align:right;" |32,768 | style="text-align:right;" |2<sup>15</sup> | style="text-align:right;" |128 C |''c'' = 0, 128 |- |{{IPaddr|a.b.0.0|16}} | +{{IPaddr|0.0.255.255|}} |{{IPaddr|255.255.0.0|}} | style="text-align:right;" |65,536 | style="text-align:right;" |2<sup>16</sup> | style="text-align:right;" |256 C = B | | |- |{{IPaddr|a.b.0.0|15}} | +{{IPaddr|0.1.255.255|}} |{{IPaddr|255.254.0.0|}} | style="text-align:right;" |131,072 | style="text-align:right;" |2<sup>17</sup> | style="text-align:right;" |2 B |''b'' = 0 ... (2''n'') ... 254 | |- |{{IPaddr|a.b.0.0|14}} | +{{IPaddr|0.3.255.255|}} |{{IPaddr|255.252.0.0|}} | style="text-align:right;" |262,144 | style="text-align:right;" |2<sup>18</sup> | style="text-align:right;" |4 B |''b'' = 0 ... (4''n'') ... 252 | |- |{{IPaddr|a.b.0.0|13}} | +{{IPaddr|0.7.255.255|}} |{{IPaddr|255.248.0.0|}} | style="text-align:right;" |524,288 | style="text-align:right;" |2<sup>19</sup> | style="text-align:right;" |8 B |''b'' = 0 ... (8''n'') ... 248 | |- |{{IPaddr|a.b.0.0|12}} | +{{IPaddr|0.15.255.255|}} |{{IPaddr|255.240.0.0|}} | style="text-align:right;" |1,048,576 | style="text-align:right;" |2<sup>20</sup> | style="text-align:right;" |16 B |''b'' = 0 ... (16''n'') ... 240 | |- |{{IPaddr|a.b.0.0|11}} | +{{IPaddr|0.31.255.255|}} |{{IPaddr|255.224.0.0|}} | style="text-align:right;" |2,097,152 | style="text-align:right;" |2<sup>21</sup> | style="text-align:right;" |32 B |''b'' = 0 ... (32''n'') ... 224 | |- |{{IPaddr|a.b.0.0|10}} | +{{IPaddr|0.63.255.255|}} |{{IPaddr|255.192.0.0|}} | style="text-align:right;" |4,194,304 | style="text-align:right;" |2<sup>22</sup> | style="text-align:right;" |64 B |''b'' = 0, 64, 128, 192 | |- |{{IPaddr|a.b.0.0|9}} | +{{IPaddr|0.127.255.255|}} |{{IPaddr|255.128.0.0|}} | style="text-align:right;" |8,388,608 | style="text-align:right;" |2<sup>23</sup> | style="text-align:right;" |128 B |''b'' = 0, 128 | |- |{{IPaddr|a.0.0.0|8}} | +{{IPaddr|0.255.255.255|}} |{{IPaddr|255.0.0.0|}} | style="text-align:right;" |16,777,216 | style="text-align:right;" |2<sup>24</sup> | style="text-align:right;" |256 B = A | | Largest [[IANA]] block allocation |- |{{IPaddr|a.0.0.0|7}} | +{{IPaddr|1.255.255.255|}} |{{IPaddr|254.0.0.0|}} | style="text-align:right;" |33,554,432 | style="text-align:right;" |2<sup>25</sup> | style="text-align:right;" |2 A |''a'' = 0 ... (2''n'') ... 254 | |- |{{IPaddr|a.0.0.0|6}} | +{{IPaddr|3.255.255.255|}} |{{IPaddr|252.0.0.0|}} | style="text-align:right;" |67,108,864 | style="text-align:right;" |2<sup>26</sup> | style="text-align:right;" |4 A |''a'' = 0 ... (4''n'') ... 252 | |- |{{IPaddr|a.0.0.0|5}} | +{{IPaddr|7.255.255.255|}} |{{IPaddr|248.0.0.0|}} | style="text-align:right;" |134,217,728 | style="text-align:right;" |2<sup>27</sup> | style="text-align:right;" |8 A |''a'' = 0 ... (8''n'') ... 248 | |- |{{IPaddr|a.0.0.0|4}} | +{{IPaddr|15.255.255.255|}} |{{IPaddr|240.0.0.0|}} | style="text-align:right;" |268,435,456 | style="text-align:right;" |2<sup>28</sup> | style="text-align:right;" |16 A |''a'' = 0 ... (16''n'') ... 240 | |- |{{IPaddr|a.0.0.0|3}} | +{{IPaddr|31.255.255.255|}} |{{IPaddr|224.0.0.0|}} | style="text-align:right;" |536,870,912 | style="text-align:right;" |2<sup>29</sup> | style="text-align:right;" |32 A |''a'' = 0 ... (32''n'') ... 224 | |- |{{IPaddr|a.0.0.0|2}} | +{{IPaddr|63.255.255.255|}} |{{IPaddr|192.0.0.0|}} | style="text-align:right;" |1,073,741,824 | style="text-align:right;" |2<sup>30</sup> | style="text-align:right;" |64 A |''a'' = 0, 64, 128, 192 | |- |{{IPaddr|a.0.0.0|1}} | +{{IPaddr|127.255.255.255|}} |{{IPaddr|128.0.0.0|}} | style="text-align:right;" |2,147,483,648 | style="text-align:right;" |2<sup>31</sup> | style="text-align:right;" |128 A |''a'' = 0, 128 | |- |{{IPaddr|0.0.0.0|0}} | +{{IPaddr|255.255.255.255|}} |{{IPaddr|0.0.0.0|}} | style="text-align:right;" |4,294,967,296 | style="text-align:right;" |2<sup>32</sup> | 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.<ref name="RFC 922">{{cite IETF |rfc=922 |title=Broadcasting Internet Datagrams in the Presence of Subnets |editor=J. Mogul |date=October 1984 |section=7}}</ref><ref name="RFC 1812">{{cite IETF |rfc=1812 |title=Requirements for IP Version 4 Routers |editor=F. Baker |date=June 1995 |section=4.2.3.1}}</ref> 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. ===IPv6 CIDR blocks=== {| class="wikitable" style="text-align: center; margin-left: auto; margin-right: auto; border: none;" |+ IPv6 CIDR prefixes |- ! rowspan="2" | Prefix size !! colspan="3" | Number of equivalent subnets !! rowspan="2" | Interface ID bits |- ! /48 !! /56 !! /64 |- | /24 || 16M || 4G || 1T || 104 |- | /25 || 8M || 2G || 512G || 103 |- | /26 || 4M || 1G || 256G || 102 |- | /27 || 2M || 512M || 128G || 101 |- | /28 || 1M || 256M || 64G || 100 |- | /29 || 512K || 128M || 32G || 99 |- | /30 || 256K || 64M || 16G || 98 |- | /31 || 128K || 32M || 8G || 97 |- | /32 || 64K || 16M || 4G || 96 |- | /33 || 32K || 8M || 2G || 95 |- | /34 || 16K || 4M || 1G || 94 |- | /35 || 8K || 2M || 512M || 93 |- | /36 || 4K || 1M || 256M || 92 |- | /37 || 2K || 512K || 128M || 91 |- | /38 || 1K || 256K || 64M || 90 |- | /39 || 512 || 128K || 32M || 89 |- | /40 || 256 || 64K || 16M || 88 |- | /41 || 128 || 32K || 8M || 87 |- | /42 || 64 || 16K || 4M || 86 |- | /43 || 32 || 8K || 2M || 85 |- | /44 || 16 || 4K || 1M || 84 |- | /45 || 8 || 2K || 512K || 83 |- | /46 || 4 || 1K || 256K || 82 |- | /47 || 2 || 512 || 128K || 81 |- | /48 || 1 || 256 || 64K || 80 |- | /49 || || 128 || 32K || 79 |- | /50 || || 64 || 16K || 78 |- | /51 || || 32 || 8K || 77 |- | /52 || || 16 || 4K || 76 |- | /53 || || 8 || 2K || 75 |- | /54 || || 4 || 1K || 74 |- | /55 || || 2 || 512 || 73 |- | /56 || || 1 || 256 || 72 |- | /57 || || || 128 || 71 |- | /58 || || || 64 || 70 |- | /59 || || || 32 || 69 |- | /60 || || || 16 || 68 |- | /61 || || || 8 || 67 |- | /62 || || || 4 || 66 |- | /63 || || || 2 || 65 |- | /64 || || || 1 || 64 |- | colspan="5" | '''K''' = 1,024 |- | colspan="5" | '''M''' = 1,048,576 |- | colspan="5" | '''G''' = 1,073,741,824 |- | 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 a {{IPaddr||48}} address allocation,<ref name="RFC 3177">{{cite IETF |rfc=3177 |title=IAB/IESG Recommendation on IPv6 Address Allocations to Sites |publisher=IAB/IESG |date=September 2001}}</ref> but criticism and reevaluation of actual needs and practices has led to more flexible allocation recommendations in {{IETF RFC|6177}}<ref name="RFC 6177">{{cite IETF |rfc=6177 |title=IPv6 Address Assignment to End Sites |author=T. Narten |author2=G. Huston |author3=L. Roberts |date=March 2011}}</ref> suggesting a significantly smaller allocation for some sites, such as a {{IPaddr||56}} block for residential networks. This '''IPv6 subnetting reference''' lists the sizes for IPv6 [[subnetwork]]s. Different types of network links may require different subnet sizes.<ref>{{cite web|url=http://www.getipv6.info/index.php/IPv6_Addressing_Plans |title=ARIN IPv6 Addressing Plans |publisher=Getipv6.info |date=2016-03-25 |access-date=2018-03-12}}</ref> 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.<ref>{{cite web |url=https://www.ripe.net/info/info-services/addressing.html |title=RIPE IP Allocation Rates |archive-url=https://web.archive.org/web/20110203130851/http://ripe.net/info/info-services/addressing.html |archive-date=2011-02-03}}</ref> 2001:0db8:0123:4567:89ab:cdef:1234:5678 |||| |||| |||| |||| |||| |||| |||| |||| |||| |||| |||| |||| |||| |||| |||| |||128 Single end-points and [[loopback]] |||| |||| |||| |||| |||| |||| |||| |||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 for [[IPv6#Stateless_address_autoconfiguration_(SLAAC)|SLAAC]] |||| |||| |||| ||60 Some (very limited) [[6rd]] deployments (/60 = 16 /64 blocks) |||| |||| |||| |56 Minimal end sites assignment;<ref name="RFC 6177"/> 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 future [[local Internet registry]] (LIR) extra-small allocations |||| |||32 LIR minimum allocations |||| ||28 LIR medium allocations |||| |24 LIR large allocations |||| 20 LIR extra large allocations |||16 ||12 [[Regional Internet registry]] (RIR) allocations from IANA<ref>{{cite web|url=https://www.iana.org/assignments/ipv6-unicast-address-assignments/ipv6-unicast-address-assignments.xml |title=IANA IPv6 unicast address assignments |publisher=Iana.org |access-date=2018-03-12}}</ref> |8 4
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)