Classless inter-domain routing
Classless Inter-Domain Routing ( CIDR ) describes a procedure for more efficient use of the existing 32-bit IP address space for IPv4 . It was introduced in 1993 ( RFC 1518 , RFC 1519 , RFC 4632 ) to reduce the size of routing tables and to better utilize the available address ranges.
With CIDR there is no fixed assignment of an IPv4 address to a network class , from which the prefix length of the respective network class was derived from the first two bits of the first octet. The prefix length can be freely selected with CIDR and must therefore be specified when writing down an IP subnet. A network mask is often used for this .
CIDR introduced so-called suffixes as a new notation . The suffix indicates the number of 1 bits in the network mask. This form of writing, e.g. B. 172.17.0.0/17
, is much shorter and easier to use than the dotted decimal notation such as 172.17.0.0/255.255.128.0
and also unambiguous.
With IPv6 , the notation is the same as with CIDR in IPv4 and consists of the IPv6 address and prefix length (e.g. 2001:0DB8:0:CD30::1/60
).
Examples
- The notation
192.168.2.7/24
corresponds to the address 192.168.2.7 with the netmask 255.255.255.0: In binary notation, the netmask is 11111111.11111111.11111111.00000000 - there are thus 3 · 8 = 24 set bits, exactly as specified in the suffix. Therefore,192.168.2.0/24, 192.168.2.1/24, 192.168.2.2/24, ... 192.168.2.254/24
and192.168.2.255/24
all describe the same 24-bit prefix and thus the same IP subnet. It is common practice to write down IP subnets with the network address and the CIDR suffix; here192.168.2.0/24
.
-
10.43.8.67/28
corresponds to the address 10.43.8.67 with the netmask 255.255.255.240: In binary notation, the netmask is 11111111.11111111.11111111.11110000 - there are thus 3 · 8 + 4 = 28 bits set, again exactly as specified in the suffix. The IPv4 network in which the host 10.43.8.67 is located therefore goes from 10.43.8.64 to 10.43.8.79 and is briefly noted as 10.43.8.64/28, whereby only 10.43.8.65 to 10.43.8.78 can be used for hosts. The broadcast address is 10.43.8.79, the network address 10.43.8.64 and the subnet can address 14 hosts.
calculation
IPv4 address = 10.43.8.67/28 (32-28 = 4 bits (netmask: 11111111.11111111.11111111.1111 0000 (with 4 digits in the dual system, 16 different values can be represented, namely 0-15)) → 16 addresses - (broadcast and Network address) = 14 IPv4 addresses to be assigned.)
Netmask = 255.255.255.240
description | Calculation (dual system) | Dual representation of the addresses | Decimal representation |
---|---|---|---|
IPv4 address | Given / initial definition |
00001010.00101011.00001000.01000011
|
10.43.8.67 |
Netmask | Given / initial definition |
11111111.11111111.11111111.11110000
|
255.255.255.240 |
Directed broadcast address | OR link of IPv4 address and negated network mask |
00001010.00101011.00001000.01001111
|
10.43.8.79 |
Network address (network ID) | AND link of IPv4 address and network mask |
00001010.00101011.00001000.01000000
|
10.43.8.64 |
Position in the network (host ID) | AND link of IPv4 address and negated network mask |
00000000.00000000.00000000.00000011
|
3 |
Address range | 10.43.8.64 to 10.43.8.79 |
IPv4 addresses for end devices | 10.43.8.65 to 10.43.8.78 |
because the first and last address in an address range is the network and broadcast address and can therefore not be assigned to any terminal device. |
Others
CIDR also provides the basis for performing route aggregation . Several more specific routes can be combined into a less specific entry in the routing table, which is then reduced in size. In addition to reducing the size of the routing table, aggregation also increases stability, since the aggregated route does not contain any status information from the more specific route information. Example: the following 256 subnets 10.1.1.0/24, 10.1.2.0/24, ..., 10.1.255.0/24 all have the prefix 10.1 in common and can therefore be aggregated to 10.1.0.0/16. This summary route can be announced in the network at points where status information about the more specific routes is not required. Accordingly, instabilities ("link flapping") of more specific routes do not affect their aggregate and consequently do not lead to a recalculation of the routing table in the case of a change in the state of the aggregate members in routers that only know the aggregate. The same principle is known from the telephone network. For example, an exchange in Karlsruhe does not provide precise information about the subscriber 040/123456 in the Hamburg local network, but only the information in which direction calls on the "aggregated route" 040 are generally to be switched.
The routing protocols BGP , IS-IS , RIP v2 (RIP II) (not RIP / RIP I) and OSPF and the Cisco - proprietary EIGRP have implemented CIDR .
The CIDR notation has now established itself on a broad basis for referencing IP networks in application software (e.g. in IRC daemons ). It is thus possible to write an access list that should affect all IPv4 addresses from 172.25.0.0 to 172.25.255.255 as 172.25.0.0/16. Occasionally, low-order octets that are zero are left out, so that 172.25 / 16 is also noted for 172.25.0.0/16 - however, this is not anchored in RFC 4632 and is therefore not recommended.
Overview for IPv4
The following table shows the number of IPv4 addresses per subnet and the addresses that can be used by hosts, i.e. minus the addresses in a range for the network address (all bits in the host part to zero, i.e. the smallest address in the range) and the broadcast address (all Bits in the host part to one, i.e. the largest address in the range).
In general:
notation | Number of addresses | Usable host addresses |
Subnet mask decimal |
Subnet mask binary |
comment |
---|---|---|---|---|---|
/ 0 | 4,294,967,296 | - | 0.0.0.0 |
00000000.00000000.00000000.00000000
|
Full IPv4 address space |
/1 | 2,147,483,648 | - | 128.0.0.0 |
10000000.00000000.00000000.00000000
|
|
/ 2 | 1,073,741,824 | - | 192.0.0.0 |
11000000.00000000.00000000.00000000
|
|
/ 3 | 536.870.912 | - | 224.0.0.0 |
11100000.00000000.00000000.00000000
|
|
/ 4 | 268.435.456 | - | 240.0.0.0 |
11110000.00000000.00000000.00000000
|
|
/ 5 | 134.217.728 | - | 248.0.0.0 |
11111000.00000000.00000000.00000000
|
|
/ 6 | 67.108.864 | - | 252.0.0.0 |
11111100.00000000.00000000.00000000
|
|
/ 7 | 33,554,432 | - | 254.0.0.0 |
11111110.00000000.00000000.00000000
|
|
/8th | 16,777,216 | 16,777,214 | 255.0.0.0 |
11111111.00000000.00000000.00000000
|
"Class A" size |
/ 9 | 8,388,608 (128x65,536) | 8,388,606 | 255.128.0.0 |
11111111.10000000.00000000.00000000
|
|
/ 10 | 4,194,304 (64x65,536) | 4,194,302 | 255.192.0.0 |
11111111.11000000.00000000.00000000
|
|
/ 11 | 2,097,152 (32x65,536) | 2,097,150 | 255.224.0.0 |
11111111.11100000.00000000.00000000
|
|
/ 12 | 1,048,576 (16x65,536) | 1,048,574 | 255.240.0.0 |
11111111.11110000.00000000.00000000
|
|
/ 13 | 524,288 (8x65,536) | 524.286 | 255.248.0.0 |
11111111.11111000.00000000.00000000
|
|
/ 14 | 262,144 (4x65,536) | 262,142 | 255.252.0.0 |
11111111.11111100.00000000.00000000
|
|
/ 15 | 131,072 (2x65,536) | 131.070 | 255.254.0.0 |
11111111.11111110.00000000.00000000
|
|
/ 16 | 65,536 (1x65,536) | 65,534 | 255.255.0.0 |
11111111.11111111.00000000.00000000
|
"Class B" size |
/ 17 | 32,768 (128x256) | 32,766 | 255.255.128.0 |
11111111.11111111.10000000.00000000
|
|
/ 18th | 16,384 (64x256) | 16,382 | 255.255.192.0 |
11111111.11111111.11000000.00000000
|
|
/ 19th | 8,192 (32x256) | 8,190 | 255.255.224.0 |
11111111.11111111.11100000.00000000
|
|
/ 20 | 4,096 (16x256) | 4,094 | 255.255.240.0 |
11111111.11111111.11110000.00000000
|
|
/ 21 | 2,048 (8x256) | 2,046 | 255.255.248.0 |
11111111.11111111.11111000.00000000
|
|
/ 22 | 1,024 (4x256) | 1,022 | 255.255.252.0 |
11111111.11111111.11111100.00000000
|
|
/ 23 | 512 (2x256) | 510 | 255.255.254.0 |
11111111.11111111.11111110.00000000
|
|
/ 24 | 256 (1x256) | 254 | 255.255.255.0 |
11111111.11111111.11111111.00000000
|
"Class C" size |
/ 25 | 128 (128x1) | 126 | 255.255.255.128 |
11111111.11111111.11111111.10000000
|
|
/ 26 | 64 (64x1) | 62 | 255.255.255.192 |
11111111.11111111.11111111.11000000
|
|
/ 27 | 32 (32x1) | 30th | 255.255.255.224 |
11111111.11111111.11111111.11100000
|
|
/ 28 | 16 (16x1) | 14th | 255.255.255.240 |
11111111.11111111.11111111.11110000
|
|
/ 29 | 8 (8x1) | 6th | 255.255.255.248 |
11111111.11111111.11111111.11111000
|
|
/ 30 | 4 (4x1) | 2 | 255.255.255.252 |
11111111.11111111.11111111.11111100
|
Connection network between two routers |
/ 31 | 2 (2x1) | 0 (2) | 255.255.255.254 |
11111111.11111111.11111111.11111110
|
Connection network between two routers |
/ 32 | 1 (1x1) | 0 (1) | 255.255.255.255 |
11111111.11111111.11111111.11111111
|
single host |
- ↑ Address areas of size / 0 to / 7 are not used as a single subnet in practice, but are divided into several subnets.
- ↑ a b / 31 networks do not contain any usable host addresses, while / 32 does not address a subnet, but always addresses a single host. There are exceptions to this. In RFC 3021, it was proposed that / 31 networks be used to establish point-to-point connections. This was implemented by the company Cisco, among others. Furthermore, under certain circumstances it is possible to use the network and broadcast address for hosts.
Since the introduction of CIDR, classful routing has practically been abolished, but the designation of a / 24 network as "Class C" has been retained, at least in colloquial terms - although this designation is mostly wrong, as it is now former Class A or Class B networks are allocated as smaller allocations / assignments and one speaks of a "Class C" network, which, according to classic notation, would be a subnet of a Class A or B network.
See also
Web links
- RFC 950 - Internet Standard Subnetting Procedure, 1985
- RFC 1338 - Supernetting: an Address Assignment and Aggregation Strategy, 1992
- RFC 1518 - An Architecture for IP Address Allocation with CIDR, 1993 (Status HISTORICAL)
- RFC 1519 - Classless Inter-Domain Routing (CIDR): an Address Assignment and Aggregation Strategy, 1993 (status HISTORICAL)
- RFC 3021 - Using 31-Bit Prefixes on IPv4 Point-to-Point Links
- RFC 4632 - Classless Inter-domain Routing (CIDR): The Internet Address Assignment and Aggregation Plan, 2006
- RFC 4291 - IP Version 6 Addressing Architecture contains the notation for IPv6 in chapter 2.3
- netplanet: IP subnetting
Individual evidence
- ↑ Using 31-Bit Prefixes on IPv4 Point-to-Point Links. Retrieved April 13, 2017 .