Classless Inter-Domain Routing: Difference between revisions

Content deleted Content added
Line 9:
[[Image:IP_Address_Match.png|400px|right]]
 
CIDR is principally a [[bitwise]], prefix-based standard for the interpretation of IP addresses. It facilitates [[routing]] by allowing blocks of addresses to be grouped together into single [[routing table]] entries. These groups, commonly called '''CIDR blocks''', share an initial sequence of bits in the [[Binary numeral system|binary]] representation of their IP addresses. IPv4 CIDR blocks are identified using a syntax similar to that of IPv4 addresses: a four-part dotted-decimal address, followed by a slash, then a number from 0 to 32: ''A.B.C.D/N''. The dotted- decimal portion is interpreted, like an IPv4 address, as a 32-bit binary number that has been broken into four 8-bit bytes. The number following the slash is the '''prefix length''', the number of shared initial bits, counting from the left-hand side of the address. When speaking in abstract terms, the dotted-decimal portion is sometimes omitted, thus a ''/20'' 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. Thus, understanding CIDR requires that IP address be visualized in [[Binary numeral system|binary]]. Since the length of an IPv4 address is fixed at 32 bits, an N-bit CIDR prefix leaves <math>32-N</math> bits unmatched, and there are <math>2^{(32-N)}</math> possible combinations of these bits, meaning that <math>2^{(32-N)}</math> IPv4 addresses match a given N-bit CIDR prefix. ''Shorter'' CIDR prefixes match more addresses, while ''longer'' CIDR prefixes match fewer. An address can match multiple CIDR prefixes of different lengths.