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., . 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 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 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. Larger prefixes (/127) are only used on some point-to-point links between routers, for security and policy reasons.
Assignment of CIDR blocks The
Internet Assigned Numbers Authority (IANA) issues to
regional Internet registries (RIRs) large, short-prefix CIDR blocks. However, a (with over sixteen million addresses) is the largest block IANA will allocate. For example, 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. For example, in the late 1990s, the IP address (since reassigned) was used by www.freesoft.org. An analysis of this address identified three CIDR prefixes. , a large CIDR block containing over 2 million addresses, had been assigned by
ARIN (the North American RIR) to
MCI. Automation Research Systems (ARS), a Virginia
VAR, leased an Internet connection from MCI and was assigned the block, capable of addressing just over 1000 devices. ARS used a block for its publicly accessible servers, of which was one. All of these CIDR prefixes would be used at different locations in the network. Outside MCI's network, the prefix would be used to direct to MCI traffic bound not only for , but also for any of the roughly two million IP addresses with the same initial 11 bits. Within MCI's network, would become visible, directing traffic to the
leased line serving ARS. Only within the ARS corporate network would the prefix have been used.
IPv4 CIDR blocks } In routed subnets larger than or , 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 and is reserved solely for this purpose. In such usage, a 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 networks usable for point-to-point links. addresses (single-host network) must be accessed by explicit routing rules, as there is no address available for a gateway.
IPv6 CIDR blocks 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 block, which is required for the operation of
stateless address autoconfiguration. At first, the IETF recommended in RFC 3177 as a best practice that all end sites receive address allocations, but criticism and reevaluation of actual needs and practices has led to more flexible allocation recommendations in RFC 6177 suggesting a significantly smaller allocation for some sites, such as a block for residential networks. This IPv6 subnetting reference lists the sizes for IPv6
subnetworks. Different types of network links may require different subnet sizes. 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. 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
SLAAC |||| |||| |||| ||60 Some (very limited)
6rd deployments (/60 = 16 /64 blocks) |||| |||| |||| |56 Minimal end-site assignment; 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 |8 4 ==Numerical interpretation==