Jump to content

CIDR notation

From Wikipedia, the free encyclopedia

This is an old revision of this page, as edited by 129.171.233.74 (talk) at 15:40, 6 February 2013. The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

CIDR notation is a compact specification of an Internet Protocol address and its associated routing prefix. Classless Inter-Domain Routing (CIDR) is an Internet Protocol (IP) address allocation and route aggregation methodology[1] used within the Internet addressing architecture that replaced the IPv4 classful network organization of the IP address space. It is used also for IPv6 networking, the next generation of the IP addressing architecture.

CIDR notation is constructed from the IP address and the prefix size, the latter being equivalent to the number of leading 1 bits in the routing prefix mask. The IP address is expressed according to the standards of IPv4 or IPv6. It is followed by a separator character, the slash (/) character, and the prefix size expressed as a decimal number.

The address may denote a single, distinct, interface address or the beginning address of an entire network. In the latter case the CIDR notation specifies the address block allocation of the network. The maximum size of the network is given by the number of addresses that are possible with the remaining, least-significant bits below the prefix. This is often called the host identifier.

For example:

  • 198.51.100.1/24 represents the given IPv4 address and its associated routing prefix 198.51.100.0, or equivalently, its subnet mask 255.255.255.0.
  • the IPv4 block 198.51.100.0/22 represents the 1024 IPv4 addresses from 198.51.100.0 to 198.51.103.255.
  • the IPv6 block 2001:db8::/48 represents the IPv6 addresses from 2001:db8:0:0:0:0:0:0 to 2001:db8:0:ffff:ffff:ffff:ffff:ffff.
  • ::1/128 represents the IPv6 loopback address. Its prefix size is 128, i.e. the size of the address itself, indicating that this facility consists of only this one address.

Before CIDR notation, IPv4 networks usually used dot-decimal notation, an alternative representation which uses the network address followed by the network's subnet mask. Thus, The CIDR notation 198.51.100.0/24 would be written as 198.51.100.0/255.255.255.0

The number of addresses of a subnet defined by the mask or prefix can be calculated as 2address size - prefix size, in which the address size is 128 for IPv6 and 32 for IPv4. For example, in IPv4, a prefix size of /29 gives: 232-29 = 23 = 8 addresses.

However, because at least one of these addresses is typically used for a gateway to other subnets, and because certain addresses are reserved as broadcast addresses, the number of addresses available for hosts is usually smaller.

See also

References

  1. ^ RFC 4632, Classless Inter-domain Routing (CIDR): The Internet Address Assignment and Aggregation Plan, V.Fuller, T. Li, IETF, August 2006