A Comprehensive Guide to IPv4 and IPv6 CIDR

IPv4 and IPv6 CIDR

Introduction to CIDR

Classless Inter-Domain Routing (CIDR) is an IP address allocation technique designed to enhance data routing efficiency across the internet. CIDR enables the representation of IP addresses in a more scalable way. Therefore, this helps to prevent the rapid exhaustion of IPv4 addresses.

This article provides a IPv4 and IPv6 CIDR table, explaining subnet masks for IPv4 and subnetting concepts for IPv6, along with practical examples for easy reference.

Understanding Subnet Masks in IPv4

A subnet mask in IPv4 is a 32-bit number that divides an IP address into network and host portions. The network portion identifies the specific network where the host portion identifies individual devices within that network. The first 24 bits (corresponding to the 1s in the subnet mask) represent the network address, while the remaining 8 bits (corresponding to the 0s in the subnet mask) represent the host address.

For example, in the IP address 192.168.100.10, the first three octets (192.168.10) represent the network portion, while the final octet (10) represents the host portion.

Binary Notation of IP Address and Subnet Mask

IPv4 CIDR Table

In IPv4, subnetting allows a large network to be divided into smaller, manageable segments. This table shows the number of bits used for nodes, CIDR notation, subnet mask and the number of IP addresses that can be used for hosts.

BitsCIDRSubnet MaskIP Addresses
0/32255.255.255.2551
1/31255.255.255.2542
2/30255.255.255.2524
3/29255.255.255.2488
4/28255.255.255.24016
5/27255.255.255.22432
6/26255.255.255.19264
7/25255.255.255.128128
8/24255.255.255.0256
9/23255.255.254.0512
10/22255.255.252.01,024
11/21255.255.248.02,048
12/20255.255.240.04,096
13/19255.255.224.08,192
14/18255.255.192.016,384
15/17255.255.128.032,768
16/16255.255.0.065,536
17/15255.254.0.0131,072
18/14255.252.0.0262,144
19/13255.248.0.0524,288
20/12255.240.0.01,048,576
21/11255.224.0.02,097,152
22/10255.192.0.04,194,304
23/9255.128.0.08,388,608
24/8255.0.0.016,777,216
25/7254.0.0.033,554,432
26/6252.0.0.067,108,864
27/5248.0.0.0134,217,728
28/4240.0.0.0268,435,456
29/3224.0.0.0536,870,912
30/2192.0.0.01,073,741,824
31/1128.0.0.02,147,483,648
32/00.0.0.04,294,967,296

You can convert a CIDR block to an IP range or vice versa to streamline the process of subnetting, routing, and optimizing IP address allocation within a network.

IPv4 Subnet Mask Examples

  • /24 (255.255.255.0): Common for small to medium-sized networks, providing 254 usable host addresses.
  • /16 (255.255.0.0): Suitable for larger networks, offering 65,534 usable host addresses.
  • /30 (255.255.255.252): Ideal for point-to-point connections, providing only two usable host addresses.

Understanding Subnetting in IPv6

IPv6 subnetting is designed to be simpler and more efficient. With its larger address space which is 128-bit, network segmentation focuses less on conserving limited addresses (as in IPv4) and more on logical organization.

Most IPv6 addresses are /64 addresses, but this is not fixed. Instead of using subnet masks, IPv6 relies solely on CIDR notation to define network and subnet boundaries.

In a /64 IPv6 address, the first 4 hextets (64 bits) represent the network portion and the remaining 64 bits represent host portion.

IPv6 network and host portion

IPv6 CIDR Table

This table shows the number of bits used, CIDR notation and the number of IP addresses that can be used for hosts.

BitsCIDRIP Addresses
0/1281
1/1272
2/1264
3/1258
4/12416
5/12332
6/12264
7/121128
8/120256
9/119512
10/1181,024
11/1172,048
12/1164,096
13/1158,192
14/11416,384
15/11332,768
16/11265,536
17/111131,072
18/110262,144
19/109524,288
20/1081,048,576
21/1072,097,152
22/1064,194,304
23/1058,388,608
24/10416,777,216
25/10333,554,432
26/10267,108,864
27/101134,217,728
28/100268,435,456
29/99536,870,912
30/981,073,741,824
31/972,147,483,648
32/964,294,967,296
33/958,589,934,592
34/9417,179,869,184
35/9334,359,738,368
36/9268,719,476,736
37/91137,438,953,472
38/90274,877,906,944
39/89549,755,813,888
40/881,099,511,627,776
41/872,199,023,255,552
42/864,398,046,511,104
43/858,796,093,022,208
44/8417,592,186,044,416
45/8335,184,372,088,832
46/8270,368,744,177,664
47/81140,737,488,355,328
48/80281,474,976,710,656
49/79562,949,953,421,312
50/781,125,899,906,842,620
51/772,251,799,813,685,248
52/764,503,599,627,370,496
53/759,007,199,254,740,992
54/7418,014,398,509,481,984
55/7336,028,797,018,963,968
56/7272,057,594,037,927,936
57/71144,115,188,075,855,872
58/70288,230,376,151,711,744
59/69576,460,752,303,423,488
60/681,152,921,504,606,846,976
61/672,305,843,009,213,693,952
62/664,611,686,018,427,387,904
63/659,223,372,036,854,775,808
64/6418,446,744,073,709,551,616
65/6336,893,488,147,419,103,232
66/6273,786,976,294,838,206,464
67/61147,573,952,589,676,412,928
68/60295,147,905,179,352,825,856
69/59590,295,810,358,705,651,712
70/581,180,591,620,717,411,303,424
71/572,361,183,241,434,822,606,848
72/564,722,366,482,869,645,213,696
73/559,444,732,965,739,290,427,392
74/5418,889,465,931,478,580,854,784
75/5337,778,931,862,957,161,709,568
76/5275,557,863,725,914,323,419,136
77/51151,115,727,451,828,646,838,772
78/50302,231,454,903,657,293,676,544
79/49604,462,909,807,314,587,353,088
80/481,208,925,819,614,629,174,706,176
81/472,417,851,639,229,258,349,412,352
82/464,835,703,278,458,516,698,824,704
83/459,671,406,556,917,033,397,649,408
84/4419,342,813,113,834,066,795,298,816
85/4338,685,626,227,668,133,590,597,632
86/4277,371,252,455,336,267,181,195,264
87/41154,742,504,910,672,534,362,390,528
88/40309,485,009,821,345,068,724,781,056
89/39618,970,019,642,690,137,449,562,112
90/381,237,940,039,285,380,274,899,124,224
91/372,475,880,078,570,760,549,798,248,448
92/364,951,760,157,141,521,099,596,496,896
93/359,903,520,314,283,042,199,192,993,792
94/3419,807,040,628,566,084,398,385,987,584
95/3339,614,081,257,132,168,796,771,975,168
96/3279,228,162,514,264,337,593,543,950,336
97/31158,456,325,028,528,675,187,087,900,672
98/30316,912,650,057,057,350,374,175,801,344
99/29633,825,300,114,114,700,748,351,602,688
100/281,267,650,600,228,229,401,496,703,205,376
101/272,535,301,200,456,458,802,993,406,410,752
102/265,070,602,400,912,917,605,986,812,821,504
103/2510,141,204,801,825,835,211,973,625,643,008
104/2420,282,409,603,651,670,423,947,251,286,016
105/2340,564,819,207,303,340,847,894,502,572,032
106/2281,129,638,414,606,681,695,789,005,144,064
107/21162,259,276,829,213,363,391,578,010,288,128
108/20324,518,553,658,426,726,783,156,020,576,256
109/19649,037,107,316,853,453,566,312,041,152,512
110/181,298,074,214,633,706,907,132,624,082,305,024
111/172,596,148,429,267,413,814,265,248,164,610,048
112/165,192,296,858,534,827,628,530,496,329,220,096
113/1510,384,593,717,069,655,257,060,992,658,440,192
114/1420,769,187,434,139,310,514,121,985,316,880,384
115/1341,538,374,868,278,621,028,243,970,633,760,768
116/1283,076,749,736,557,242,056,487,941,267,521,536
117/11166,153,499,473,114,484,112,975,882,535,043,072
118/10332,306,998,946,228,968,225,951,765,070,086,144
119/9664,613,997,892,457,936,451,903,530,140,172,288
120/81,329,227,995,784,915,872,903,807,060,280,344,576
121/72,658,455,991,569,831,745,807,614,120,560,689,152
122/65,316,911,983,139,663,491,615,228,241,121,378,304
123/510,633,823,966,279,326,983,230,456,482,242,756,608
124/421,267,647,932,558,653,966,460,912,964,485,513,216
125/342,535,295,865,117,307,932,921,825,928,971,026,432
126/285,070,591,730,234,615,865,843,651,857,942,052,864
127/1170,141,183,460,469,231,731,687,303,715,884,105,728
128/0340,282,366,920,938,463,463,374,607,431,768,211,456

You may download the pdf file of the IPv4 and IPv6 CIDR table.

IPv6 Subnetting Examples

  • /64 Subnet: 2001:0db8:85a3::/64
    • Usage: Ideal for a single LAN segment within an organization.
    • Host Addresses: 18,446,744,073,709,551,616 possible addresses.
  • /48 Subnet: 2001:0db8:85a3::/48
    • Usage: Assigned to an enterprise, allowing them to create up to 65,536 /64 subnets.
    • Host Addresses: Each /64 subnet provides an immense number of host addresses.

Practical Uses of CIDR Tables

Efficient Address Allocation

CIDR blocks help prevent waste of IP addresses by enabling networks to be allocated with just the number of addresses they need.

Simplified Routing

By aggregating routes, CIDR helps reduce the size of routing tables, enabling more efficient routing in large networks like the internet.

Network Security

In addition, CIDR allows for fine-grained control over IP ranges, making it easier to define firewall rules, network policies, and access control lists.

Subnetting

IPv4: Dividing a larger network into smaller subnets for organizational or security purposes.

IPv6: Creating standardized /64 subnets for individual LAN segments, facilitating features like SLAAC.

Conclusion

Understanding CIDR is essential for efficient IP address management, whether you’re working with IPv4 or the expansive IPv6. CIDR tables provide quick reference points for determining how many hosts a particular block can support and help you organize your networks at any scale. By utilizing subnet masks in IPv4 and embracing the streamlined subnetting approach in IPv6, you can manage IPs in a way that maximizes both resource availability and network performance.

Was this article helpful?

Related Articles