CIDR notation: Difference between revisions

From Citizendium
Jump to navigation Jump to search
imported>David MacQuigg
(Add reference & links)
imported>Francisco Reyes
 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
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.
{{subpages}}
{{seealso|Classless Inter-Domain Routing}} for a more comprehensive description.  The current article explains just the notation.
 
'''CIDR notation''' is a compact form for a block of Internet [[IP address|IP Addresses]].  It is written by adding a "prefix length" to the standard "dotted decimal" notation for 32-bit [[IPv4]] addresses, and has been adapted to [[IPv6]].
==IPv4==


   192.168.33.32/28
   192.168.33.32/28
        IP      Block


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.
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 that 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.
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>
  192.168.33.32/32      1 address
  192.168.33.32/31      2 addresses
  192.168.33.32/28    16 addresses
  192.168.33.32/24    256 addresses. C block
  192.168.33.32/16 65,536 addresses. B block
 
CIDR blocks are commonly used in allocation of network addresses, and the notation is understood by most students of computer networks, but it is not the most flexible or readable notation.  The block above could have been shown with a notation like 192.168.33.32-47. The addresses included in the block would then be more clear, and there would be more flexibility in designating odd-sized blocks.  The network scanning program [[NMAP]] can designate address ranges such as 192.168.0-255.1-254, and have a scan skip all addresses where the last octet is 0 or 255.  A range like 0-255.0-255.13.37 could be used to sample scan the entire Internet.


==References==
==IPv6==
{{reflist}}

Latest revision as of 16:20, 3 May 2015

This article is developing and not approved.
Main Article
Discussion
Related Articles  [?]
Bibliography  [?]
External Links  [?]
Citable Version  [?]
 
This editable Main Article is under development and subject to a disclaimer.
See also: Classless Inter-Domain Routing for a more comprehensive description. The current article explains just the notation.

CIDR notation is a compact form for a block of Internet IP Addresses. It is written by adding a "prefix length" to the standard "dotted decimal" notation for 32-bit IPv4 addresses, and has been adapted to IPv6.

IPv4

 192.168.33.32/28
       IP      Block

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 that 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.

 192.168.33.32/32      1 address
 192.168.33.32/31      2 addresses
 192.168.33.32/28     16 addresses 
 192.168.33.32/24    256 addresses. C block
 192.168.33.32/16 65,536 addresses. B block

CIDR blocks are commonly used in allocation of network addresses, and the notation is understood by most students of computer networks, but it is not the most flexible or readable notation. The block above could have been shown with a notation like 192.168.33.32-47. The addresses included in the block would then be more clear, and there would be more flexibility in designating odd-sized blocks. The network scanning program NMAP can designate address ranges such as 192.168.0-255.1-254, and have a scan skip all addresses where the last octet is 0 or 255. A range like 0-255.0-255.13.37 could be used to sample scan the entire Internet.

IPv6