CIDR Notation

CIDR uses variable bit length host masks.

To get the network address of an IP address, AND it with the hostmask.


00001010.00001010.00000001.00101100	10.10.1.44		&
11111111.11111111.11111111.11100000	255.255.255.224 (/27)
00001010.00001010.00000001.00100000	10.10.1.32

10100000.10100100.10010111.01001110	80.164.151.78		&
11111111.11111111.11111111.11110000	255.255.255.240 (/28)
10100000.10100100.10010111.01000000	80.164.151.64


Ranges:
(Yes I'm to lazy to calculate these every time I use them)

CIDR	Hosts		Netmask
/32	         1	255.255.255.255
/31	         2	255.255.255.254
/30	         4	255.255.255.252
/29	         8	255.255.255.248 
/28	        16	255.255.255.240
/27	        32	255.255.255.224
/26	        64	255.255.255.192
/25	       128	255.255.255.128
/24	       256	255.255.255.000
/23	       512	255.255.254.000
/22	      1024	255.255.252.000
/21	      2048	255.255.248.000
/20	      4096	255.255.240.000
/19	      8192	255.255.224.000
/18	     16384	255.255.192.000
/17	     32768	255.255.128.000
/16	     65536	255.255.000.000
/15	    131072	255.254.000.000
/14	    262144	255.252.000.000
/13	    524288	255.248.000.000
/12	   1048576	255.240.000.000
/11	   2097152	255.224.000.000
/10	   4194304	255.192.000.000
/9	   8388608	255.128.000.000
/8	  16777216	255.000.000.000
/7	  33554432	254.000.000.000
/6	  67108864	252.000.000.000
/5	 134217728	248.000.000.000
/4	 268435456	240.000.000.000
/3	 536870912	224.000.000.000
/2	1073741824	192.000.000.000
/1	2147483648	128.000.000.000
/0	4294967296	000.000.000.000


Since 3 addresses is always used per network, subnets longer than 30 cannot be used.

Also, ranges larger than 16 are not often used as a single range, since it would 
create a huge broadcast domain.
The larger ranges can however be quite practial when using aggrerated ranges, 
where several smaller nets are joined in a supernet.

The 3 addresses which are always used is the network address, the router address and the broadcast address.
The network address defines the network and is always the first.
The broadcast address is always the last address in the network.
The router address, is the address of a router accessible from the network.
This router enables access to other networks, and is normaly given the second address in the network.
This is however no requirement, but a best practice.
Dette indlæg blev udgivet i Knowledge Base, Networking. Bogmærk permalinket.

Skriv et svar