Netmasks and Netblock Sizes


Netblock Sizes, Netmasks, and Bit-sized Networks

The following table shows the relationship between IP network's block sizes, classful interpretation, netmasks, "supernets" [bit-length], "cisco wild bits" and the actual bit-sizes of the networks.

An IP address on its own does not communicate what size network block to which it belongs. A netmask associated with an IP address describes "masked" portions [the left-most bits 'blocked out' by the ones in the netmask] of an IP address. These masked portions create the "network part" of the address, commonly called the "prefix".

Block Size

The block size tells you how many addresses are within the network. The "bottom" [all-zero] is reserved to refer to the network itself and "top" [all-ones] is reserved as the broadcast address, so these are unusable. therefore, any given netblock has two less usable addresses that the literal block size.

Eg, a network 10.0.0.64 with a block size of four has only two usable addresses, 10.0.0.65 and 10.0.0.66.

Netmask

The netmask indicates the final (or final two) octets of what should be masked against the address to configure equipment or define routes with the apropriately-sized network. All leading [leftmost] octets in a netmask are ones.

Eg, a network 10.0.16.0 with a netmask of 252.0 would result in a network netmask pair of 10.0.16.0 255.255.252.0, while the previous example from block size would result in 10.0.0.64 255.255.255.252.

Cisco "Wild Bits"

The cisco wild bits indicate the apropos value for the final (or final two) octets of what is needed when creating a Cisco router's access list for a certain network size. It is one less than the block size, merely because given the network number [the "zero" or "bottom" of the network], the "wild bits" define all the remaining possible values within the network.

"Supernet"

The supernet notation indicates the literal bitsize of a network. "Supernet" is actually a misnomer, stemming from the perceived need to differentiate prefixes longer than 24-bits [subnets of "Class C" blocks] from those shorter than 24-bits in traditional "Class C space" (eg, the 207.* network), calling ther latter "supernets". The number actually represents the "prefix length" - what part of an address is the network-part.

Given that IPv4 addresses are 32-bits long, this is the most common and easy way of describing a network. A network of one device (a host route) is defined as easily as a network of two hundred fifty-six devices: 10.0.99.99/32 is a host and 10.0.98.0/24 is a "C-sized block".

Raw Bits

The raw bits define the bits "within" the network. These are the inverse of the supernet notation, and are a bitwise representation of the blocksize. Lastly, this is the exponent for "2" when describing the network mathematically.

Classful

The classful row merely gives a "backwards compatible" reference. All classful interpretations [Class A, B, C, D and E networks] of IPv4 space are archaic. This row is provided to give a reference point when speaking to customers that do not yet have a firm grasp of "supernet" notation.

Reference Table

Netmasks and Wild Bits refer to the RIGHTMOST octets.
								
block size	1	2	4	8	16	32	64	128	256
netmask		255	254	252	248	240	224	192	128	0
cisco wild bits	0	1	3	7	15	31	63	127	255
supernet	/32	/31	/30	/29	/28	/27	/26	/25	/24
raw bits	0	1	2	3	4	5	6	7	8
Classful	|------ 	Subnets of Class C addresses		------|	Class C


block size	512	1024	2048	4096	8192	16384	32768
netmask		254.0	252.0	248.0	240.0	224.0	192.0	128.0
cisco wild bits	1.255	3.255	7.255	15.255	31.255	63.255	127.255
supernet	/23	/22	/21	/20	/19	/18	/17
raw bits	9	10	11	12	13	14	15
Classful	|---------   Subnets of Class B addresses  --------|	

block size	65536
netmask		0.0
cisco wild bits	255.255
supernet	/16
raw bits	16
Classful	Class B

Thank you Joe Provo for the above v4 document!

IPv6

2^64 = 18,446,744,073,709,551,616

  Prefix          /48 count                 /56 count          Number of /64 Subnets      Number of Hosts

    /56                                             1                            256      4,722,366,482,869,645,213,696 (2^72)
    /55                                             2                            512      9,444,732,965,739,290,427,392
    /54                                             4                          1,024      18,889,465,931,478,580,854,784
    /53                                             8                          2,048      37,778,931,862,957,161,709,568
    /52                                            16                          4,096      75,557,863,725,914,323,419,136
    /51                                            32                          8,192      151,115,727,451,828,646,838,272 
    /50                                            64                         16,384      302,231,454,903,657,293,676,544
    /49                                           128                         32,768      604,462,909,807,314,587,353,088	
    /48                  1                        256                         65,536      1,208,925,819,614,629,174,706,176 (2^80)
    /47                  2                        512                        131,072      2,417,851,639,229,258,349,412,352
    /46                  4                      1,024                        262,144      4,835,703,278,458,516,698,824,704
    /45                  8	                2,048                        524,288      9,671,406,556,917,033,397,649,408
    /44                 16                      4,096                      1,048,576      19,342,813,113,834,066,795,298,816
    /43                 32                      8,192                      2,097,152      38,685,626,227,668,133,590,597,632
    /42                 64                     16,384                      4,194,304      77,371,252,455,336,267,181,195,264
    /41                128                     32,768                      8,388,608      154,742,504,910,672,534,362,390,528
    /40                256                     65,536                     16,777,216      309,485,009,821,345,068,724,781,056
    /39                512                    131,072                     33,554,432      618,970,019,642,690,137,449,562,112
    /38              1,024                    262,144                     67,108,864      1,237,940,039,285,380,274,899,124,224
    /37              2,048                    524,288                    134,217,728      2,475,880,078,570,760,549,798,248,448
    /36              4,096                  1,048,576                    268,435,456      4,951,760,157,141,521,099,596,496,896
    /35              8,192                  2,097,152                    536,870,912      9,903,520,314,283,042,199,192,993,792
    /34             16,384                  4,194,304                  1,073,741,824      19,807,040,628,566,084,398,385,987,584
    /33             32,768                  8,388,608                  2,147,483,648      39,614,081,257,132,168,796,771,975,168
    /32             65,536                 16,777,216                  4,294,967,296      79,228,162,514,264,337,593,543,950,336 (2^96)
    /31            131,072                 33,554,432                  8,589,934,592      158,456,325,028,528,675,187,087,900,672
    /30            262,144                 67,108,864                 17,179,869,184      316,912,650,057,057,350,374,175,801,344
    /29            524,288                134,217,728                 34,359,738,368      633,825,300,114,114,700,748,351,602,688
    /28          1,048,576                268,435,456                 68,719,476,736      1,267,650,600,228,229,401,496,703,205,376
    /27          2,097,152                536,870,912                137,438,953,472      2,535,301,200,456,458,802,993,406,410,752
    /26          4,194,304              1,073,741,824                274,877,906,944      5,070,602,400,912,917,605,986,812,821,504
    /25          8,388,608              2,147,483,648                549,755,813,888      10,141,204,801,825,835,211,973,625,643,008
    /24         16,777,216              4,294,967,296              1,099,511,627,776      20,282,409,603,651,670,423,947,251,286,016
    /23         33,554,432              8,589,934,592              2,199,023,255,552      40,564,819,207,303,340,847,894,502,572,032
    /22         67,108,864             17,179,869,184              4,398,046,511,104      81,129,638,414,606,681,695,789,005,144,064
    /21        134,217,728             34,359,738,368              8,796,093,022,208      162,259,276,829,213,363,391,578,010,288,128
    /20        268,435,456             68,719,476,736             17,592,186,044,416      324,518,553,658,426,726,783,156,020,576,256
    /19        536,870,912            137,438,953,472             35,184,372,088,832      649,037,107,316,853,453,566,312,041,152,512
    /18      1,073,741,824            274,877,906,944             70,368,744,177,664      1,298,074,214,633,706,907,132,624,082,305,024
    /17      2,147,483,648            549,755,813,888            140,737,488,355,328      2,596,148,429,267,413,814,265,248,164,610,048
    /16      4,294,967,296          1,099,511,627,776            281,474,976,710,656      5,192,296,858,534,827,628,530,496,329,220,096
    /15      8,589,934,592          2,199,023,255,552            562,949,953,421,312      1,038,459,371,706,965,525,706,099,265,844,0192
    /14     17,179,869,184          4,398,046,511,104          1,125,899,906,842,624      207,691,874,341,393,105,141,219,853,168,80,384
    /13     34,359,738,368          8,796,093,022,208          2,251,799,813,685,248      41,538,374,868,278,621,028,243,970,633,760,768
    /12     68,719,476,736         17,592,186,044,416          4,503,599,627,370,496      83,076,749,736,557,242,056,487,941,267,521,536
    /11    137,438,953,472         35,184,372,088,832          9,007,199,254,740,992      166,153,499,473,114,484,112,975,882,535,043,072
    /10    274,877,906,944         70,368,744,177,664         18,014,398,509,481,984      332,306,998,946,228,968,225,951,765,070,086,144
    /9     549,755,813,888        140,737,488,355,328         36,028,797,018,963,968      664,613,997,892,457,936,451,903,530,140,172,288
    /8   1,099,511,627,776        281,474,976,710,656         72,057,594,037,927,936      1,329,227,995,784,915,872,903,807,060,280,344,576
    /7   2,199,023,255,552        562,949,953,421,312        144,115,188,075,855,872      2,658,455,991,569,831,745,807,614,120,560,689,152
    /6   4,398,046,511,104      1,125,899,906,842,624        288,230,376,151,711,744      5,316,911,983,139,663,491,615,228,241,121,378,304
    /5   8,796,093,022,208      2,251,799,813,685,248        576,460,752,303,423,488      10,633,823,966,279,326,983,230,456,482,242,756,608
    /4  17,592,186,044,416      4,503,599,627,370,496      1,152,921,504,606,846,976      21,267,647,932,558,653,966,460,912,964,485,513,216
    /3  35,184,372,088,832      9,007,199,254,740,992      2,305,843,009,213,693,952      42,535,295,865,117,307,932,921,825,928,971,026,432
    /2  70,368,744,177,664     18,014,398,509,481,984      4,611,686,018,427,387,904      85,070,591,730,234,615,865,843,651,857,942,052,864
    /1 140,737,488,355,328     36,028,797,018,963,968      9,223,372,036,854,775,808      170,141,183,460,469,231,731,687,303,715,884,105,728


										Aaron Hughes aaronh@bind.com http://www.bind.com