CIDR notation: Difference between revisions

From Citizendium
Jump to navigation Jump to search
imported>David MacQuigg
(stub article)
 
imported>David MacQuigg
(Add reference & links)
Line 1: Line 1:
A block of Internet [[IP address|IP Addresses]] can be shown in a compact notation by adding a "mask" to the standard "dotted quad" notation for 32-bit IPv4 addresses.
A block of Internet [[IP address|IP Addresses]] can be shown in a compact notation by adding a "prefix length" to the standard "dotted decimal" notation for 32-bit [[IPv4]] addresses.


   192.168.33.32/28
   192.168.33.32/28


The /28 in the ip4 terms is CIDR notation for a block of 16 addresses. The number 28 is the number of bits in the "mask", which is a bit pattern used in testing address ranges. Comparisons using a mask are faster than a general integer range test, but the blocks are limited to sizes that are a power of two (/32=1, /31=2, 4, 8, 16, ... /24=256, ... /0=2^32).  
The /28 in this "CIDR block" indicates a block of 16 addresses. The number 28 is the number of bits in the "network prefix", the leading bits which are common to all addresses in the block.


CIDR notation is commonly used in routers, where speed is critical.
CIDR blocks are limited to sizes that are a power of two.  /32=1, /31=2, 4, 8, 16, ... /24=256, ... /0=2^32 (the entire Internet).  The boundaries of the block must also align with all other blocks the same size or larger, e.g. 192.168.33.43/28 is the same block as above.
 
The block 192.168.33.32/28 could have been shown with a notation like 192.168.33.32-47. This notation would be more readable, and more flexible in designating odd-sized blocks.  The reason for the more restrictive notation is that the most common use is in allocating addresses to networks in a scheme known as [[Classless Inter-Domain Routing]]. <ref>"Classless Routing (CIDR), Section 4.3.2 in Computer Networks, 4th ed., Peterson & Davie (2007).</ref>
 
==References==
{{reflist}}

Revision as of 06:58, 27 October 2009

A block of Internet IP Addresses can be shown in a compact notation by adding a "prefix length" to the standard "dotted decimal" notation for 32-bit IPv4 addresses.

 192.168.33.32/28

The /28 in this "CIDR block" indicates a block of 16 addresses. The number 28 is the number of bits in the "network prefix", the leading bits which are common to all addresses in the block.

CIDR blocks are limited to sizes that are a power of two. /32=1, /31=2, 4, 8, 16, ... /24=256, ... /0=2^32 (the entire Internet). The boundaries of the block must also align with all other blocks the same size or larger, e.g. 192.168.33.43/28 is the same block as above.

The block 192.168.33.32/28 could have been shown with a notation like 192.168.33.32-47. This notation would be more readable, and more flexible in designating odd-sized blocks. The reason for the more restrictive notation is that the most common use is in allocating addresses to networks in a scheme known as Classless Inter-Domain Routing. [1]

References

  1. "Classless Routing (CIDR), Section 4.3.2 in Computer Networks, 4th ed., Peterson & Davie (2007).