Classless Inter-Domain Routing (CIDR ) is a method for allocating
IP address
An Internet Protocol address (IP address) is a numerical label such as that is connected to a computer network that uses the Internet Protocol for communication.. Updated by . An IP address serves two main functions: network interface ident ...
es and for
IP routing
IP routing is the application of routing methodologies to IP networks. This involves not only protocols and technologies but includes the policies of the worldwide organization and configuration of Internet infrastructure. In each IP network nod ...
. The
Internet Engineering Task Force
The Internet Engineering Task Force (IETF) is a standards organization for the Internet and is responsible for the technical standards that make up the Internet protocol suite (TCP/IP). It has no formal membership roster or requirements and a ...
introduced CIDR in 1993 to replace the previous
classful network
A classful network is an obsolete network addressing architecture used in the Internet from 1981 until the introduction of Classless Inter-Domain Routing (CIDR) in 1993. The method divides the IP address space for Internet Protocol version 4 (IP ...
addressing architecture on the
Internet
The Internet (or internet) is the global system of interconnected computer networks that uses the Internet protocol suite (TCP/IP) to communicate between networks and devices. It is a '' network of networks'' that consists of private, pub ...
. Its goal was to slow the growth of
routing table
In computer networking, a routing table, or routing information base (RIB), is a data table stored in a router or a network host that lists the routes to particular network destinations, and in some cases, metrics (distances) associated with tho ...
s on
routers across the Internet, and to help slow the rapid
exhaustion of IPv4 addresses.
IP addresses are described as consisting of two groups of
bit
The bit is the most basic unit of information in computing and digital communications. The name is a portmanteau of binary digit. The bit represents a logical state with one of two possible values. These values are most commonly represente ...
s in the address: the
most significant bit
In computing, bit numbering is the convention used to identify the bit positions in a binary number.
Bit significance and indexing
In computing, the least significant bit (LSB) is the bit position in a binary integer representing the binar ...
s are the
network prefix
An Internet Protocol address (IP address) is a numerical label such as that is connected to a computer network that uses the Internet Protocol for communication.. Updated by . An IP address serves two main functions: network interface Identi ...
, which identifies a whole network or
subnet
A subnetwork or subnet is a logical subdivision of an IP network. Updated by RFC 6918. The practice of dividing a network into two or more networks is called subnetting.
Computers that belong to the same subnet are addressed with an identical ...
, and the
least significant set forms the ''host 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 for
IPv4
Internet Protocol version 4 (IPv4) is the fourth version of the Internet Protocol (IP). It is one of the core protocols of standards-based internetworking methods in the Internet and other packet-switched networks. IPv4 was the first version de ...
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
An Internet service provider (ISP) is an organization that provides services for accessing, using, or participating in the Internet. ISPs can be organized in various forms, such as commercial, community-owned, non-profit, or otherwise private ...
s and
end user
In product development, an end user (sometimes end-user) is a person who ultimately uses or is intended to ultimately use a product. The end user stands in contrast to users who support or maintain the product, such as sysops, system administrat ...
s on any address-bit boundary. In
IPv6
Internet Protocol version 6 (IPv6) is the most recent version of the Internet Protocol (IP), the communication protocol, communications protocol that provides an identification and location system for computers on networks and routes traffic ...
, 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 on variable-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 addresses for IPv4 and for IPv6. Blocks of addresses having contiguous prefixes may be aggregated as
supernet
A supernetwork, or supernet, is an Internet Protocol (IP) network that is formed by aggregation of multiple networks (or subnets) into a larger network. The new routing prefix for the aggregate network represents the constituent networks in a ...
s, reducing the number of entries in the global routing table.
Background
Each IP address consists of a network-identifying prefix followed by a
host
A host is a person responsible for guests at an event or for providing hospitality during it.
Host may also refer to:
Places
* Host, Pennsylvania, a village in Berks County
People
*Jim Host (born 1937), American businessman
* Michel Host ...
identifier. The question is how many bits of the address are in the network prefix, and how many are in the host identifier. In the previous
IPv4
Internet Protocol version 4 (IPv4) is the fourth version of the Internet Protocol (IP). It is one of the core protocols of standards-based internetworking methods in the Internet and other packet-switched networks. IPv4 was the first version de ...
classful network
A classful network is an obsolete network addressing architecture used in the Internet from 1981 until the introduction of Classless Inter-Domain Routing (CIDR) in 1993. The method divides the IP address space for Internet Protocol version 4 (IP ...
architecture, the top three bits of the 32-bit IP address defined how many bits were in the network prefix:
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 because only three sizes are available, networks were usually too big or too small for most organizations to use. The smallest allocation and routing block contained 2
8 = 256 addresses — larger than necessary for personal or department networks, but too small for most enterprises. The next larger block contained 2
16 = addresses—too large to be used efficiently even by large organizations. But for network users who needed more than addresses, the only other size (2
24) gave them 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
A supernetwork, or supernet, is an Internet Protocol (IP) network that is formed by aggregation of multiple networks (or subnets) into a larger network. The new routing prefix for the aggregate network represents the constituent networks in a ...
.
Within a decade after the invention of the
Domain Name System
The Domain Name System (DNS) is a hierarchical and distributed naming system for computers, services, and other resources in the Internet or other Internet Protocol (IP) networks. It associates various information with domain names assigned to ...
(DNS), it became apparent that the old classful network scheme was not
scalable.
This led to the development of
subnet
A subnetwork or subnet is a logical subdivision of an IP network. Updated by RFC 6918. The practice of dividing a network into two or more networks is called subnetting.
Computers that belong to the same subnet are addressed with an identical ...
ting and CIDR. The formerly meaningful class distinctions based on the top 3 address bits were removed, and the new system was described as being ''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 matching 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, the
Internet Engineering Task Force
The Internet Engineering Task Force (IETF) is a standards organization for the Internet and is responsible for the technical standards that make up the Internet protocol suite (TCP/IP). It has no formal membership roster or requirements and a ...
published a new set of standards, and , to define this new scheme for allocating of IP address blocks and routing IPv4 packets. An updated version, , was published in 2006.
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 various power-of-two-sized subnets, so that each network or subnet can be sized appropriately for local needs. Variable-length subnet masks were mentioned as one alternative in .
Techniques for grouping addresses for common operations were based on the concept of cluster addressing, first proposed by Carl-Herbert Rokitansky.
CIDR notation
CIDR notation is a compact representation of an IP address and its associated network mask. The notation was invented by
Phil Karn
Phil Karn (born October 4, 1956) is a retired American engineer from Lutherville, Maryland. He earned a bachelor's degree in electrical engineering from Cornell University in 1978 and a master's degree in electrical engineering from Carnegie Mel ...
in the 1980s.
CIDR notation specifies an IP address, a
slash
Slash may refer to:
* Slash (punctuation), the "/" character
Arts and entertainment Fictional characters
* Slash (Marvel Comics)
* Slash (''Teenage Mutant Ninja Turtles'')
Music
* Harry Slash & The Slashtones, an American rock band
* Nash ...
('/') character, and a decimal number. The decimal number is the count of consecutive leading ''1''-bits (from left to right) in the network mask. The number can also be thought of as the width (in bits) of the network prefix. The IP address in CIDR notation is always represented according to the standards for IPv4 or IPv6.
The address may denote a specific interface address (including a host identifier, such as ), or it may be the beginning address of an entire network (using a host identifier of 0, as in or its equivalent ). CIDR notation can even be used with no IP address at all, e.g. when referring to a as a generic description of an IPv4 network that has a 24-bit prefix and 8-bit host numbers.
For example:
* represents the IPv4 address and its associated network prefix , or equivalently, its subnet mask , which has 24 leading ''1''-bits.
* the IPv4 block represents the 1024 IPv4 addresses from to .
* the IPv6 block represents the block of IPv6 addresses from to .
* represents the IPv6
loopback
Loopback (also written loop-back) is the routing of electronic signals or digital data streams back to their source without intentional processing or modification. It is primarily a means of testing the communications infrastructure.
There are m ...
address. Its prefix length is 128 which is the number of bits in the address.
In IPv4, what is now called CIDR notation came into wide use only after the implementation of CIDR. It does not appear in the original CIDR standards, which instead used a
dotted-decimal subnet mask after the slash; for example, .
Describing the network prefix's width as a single number () was easier for network administrators to conceptualize and to mentally calculate, so it gradually became incorporated into later standards documents and into network configuration interfaces.
The number of addresses inside a network or subnet may be calculated as 2
address length − prefix length, where ''address length'' is 128 for IPv6 and 32 for IPv4. For example, in IPv4, the prefix length gives: 2
32−29 = 2
3 = 8 addresses.
Subnet masks
A subnet mask is a
bitmask
In computer science, a mask or bitmask is data that is used for bitwise operations, particularly in a bit field. Using a mask, multiple bits in a byte, nibble, word, etc. can be set either on or off, or inverted from on to off (or vice versa) in ...
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: . 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
to specify non-contiguous bits until
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., . 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
32−''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 for
IPv6 address
An Internet Protocol Version 6 address (IPv6 address) is a numeric label that is used to identify and locate a network interface of a computer or a network node participating in a computer network using IPv6. IP addresses are included in the ...
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. 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
The Internet Assigned Numbers Authority (IANA) is a standards organization that oversees global IP address allocation, autonomous system number allocation, root zone management in the Domain Name System (DNS), media types, and other Interne ...
(IANA) issues to
regional Internet registries
A regional Internet registry (RIR) is an organization that manages the allocation and registration of Internet number resources within a region of the world. Internet number resources include IP addresses and autonomous system (AS) numbers.
...
(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
RIPE NCC (''Réseaux IP Européens'' Network Coordination Centre) is the regional Internet registry (RIR) for Europe, the Middle East and parts of Central Asia. Its headquarters are in Amsterdam, Netherlands, with a branch office in Dubai, UAE.
...
, 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
The Internet Engineering Task Force (IETF) is a standards organization for the Internet and is responsible for the technical standards that make up the Internet protocol suite (TCP/IP). It has no formal membership roster or requirements and a ...
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
A provider-independent address space (PI) is a block of IP addresses assigned by a regional Internet registry (RIR) directly to an end-user organization. The user must contract with a local Internet registry (LIR) through an Internet service provi ...
directly from the appropriate RIR.
![CIDR Address](https://upload.wikimedia.org/wikipedia/commons/2/26/CIDR_Address.svg)
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
Var or VAR may refer to:
Places
* Var (department), a department of France
* Var (river), France
* Vār, Iran, village in West Azerbaijan Province, Iran
* Var, Iran (disambiguation), other places in Iran
* Vár, a village in Obreja commune, Ca ...
, 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 common usage, the first address in a subnet, all binary zero in the host identifier, is reserved for referring to the network itself, while the last address, all binary one in the host identifier, is used as a
broadcast address for the network; this reduces the number of addresses available for hosts by 2. As a result, a network, with one binary digit in the host identifier, would be unusable, as such a subnet would provide no available host addresses after this reduction. 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 room in such a network for a gateway.
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.
IPv6 CIDR blocks
![IPv6 CIDR table-en](https://upload.wikimedia.org/wikipedia/commons/3/38/IPv6_CIDR_table-en.svg)
The large address size used in IPv6 permitted implementation of 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
In computer networking, a link-local address is a unicast network address that is valid only for communications within the subnetwork that the host is connected to. Link-local addresses are most often assigned automatically with a process known a ...
.
At first, the IETF recommended in as a best practice that all end sites receive a address allocation,
however, criticism and reevaluation of actual needs and practices has led to more flexible allocation recommendations in
suggesting a significantly smaller allocation for some sites, such as a block for home networks.
This IPv6 subnetting reference lists the sizes for IPv6
subnetwork
A subnetwork or subnet is a logical subdivision of an IP network. Updated by RFC 6918. The practice of dividing a network into two or more networks is called subnetting.
Computers that belong to the same subnet are addressed with an identical ...
s. 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
Loopback (also written loop-back) is the routing of electronic signals or digital data streams back to their source without intentional processing or modification. It is primarily a means of testing the communications infrastructure.
There are m ...
, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , 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
Internet Protocol version 6 (IPv6) is the most recent version of the Internet Protocol (IP), the communications protocol that provides an identification and location system for computers on networks and routes traffic across the Internet. IPv ...
, , , , , , , , , , , , , , 60 Some (very limited)
6rd
6rd is a mechanism to facilitate IPv6 rapid deployment across IPv4 infrastructures of Internet service providers (ISPs).
It is derived from 6to4, a preexisting mechanism to transfer IPv6 packets over the IPv4 network, with the significant chan ...
deployments (/60 = 16 /64 blocks)
, , , , , , , , , , , , , 56 Minimal end sites assignment;
e.g.
home network
A home network or home area network (HAN) is a type of computer network that facilitates communication among devices within the close vicinity of a home. Devices capable of participating in this network, for example, smart devices such as netwo ...
(/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
A regional Internet registry (RIR) is an organization that manages the allocation and registration of Internet number resources within a region of the world. Internet number resources include IP addresses and autonomous system (AS) numbers.
...
(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
A regional Internet registry (RIR) is an organization that manages the allocation and registration of Internet number resources within a region of the world. Internet number resources include IP addresses and autonomous system (AS) numbers.
...
(RIR) allocations from IANA
, 8
4
Prefix aggregation
CIDR provides fine-grained
routing prefix aggregation. For example, if the first 20 bits of their network prefixes match, sixteen contiguous networks can be aggregated and advertised to a larger network as a single
routing table
In computer networking, a routing table, or routing information base (RIB), is a data table stored in a router or a network host that lists the routes to particular network destinations, and in some cases, metrics (distances) associated with tho ...
entry. This reduces the number of routes that have to be advertised.
See also
*
Internet protocol suite
The Internet protocol suite, commonly known as TCP/IP, is a framework for organizing the set of communication protocols used in the Internet and similar computer networks according to functional criteria. The foundational protocols in the suit ...
References
Further reading
*
* {{Cite IETF , rfc=1817 , title=CIDR and Classful Routing , date=August 1995
External links
CIDR Report(updated daily)
Internet Standards
Internet architecture
Routing
IP addresses
it:Supernetting#CIDR