CIDR Notation – Explained & Examples

CIDR (Classless Inter-Domain Routing) notation is a compact method for specifying IP addresses and their routing suffixes.

For example, we can express the idea that the IP address is associated with the netmask by using the CIDR notation of, where 24 represents the number of network bits in the IP address (IPv4 address has 32 bits, so the network can be between 0 and 32).

CIDR Notation

CIDR allows subnet masks of variable length – it has replaced the previous system based on fixed-size network classes and gained popularity due to its flexibility and efficiency.

CIDR notation: In IPv4, what is now called CIDR notation came into wide use only after the implementation of CIDR. The original CIDR standards used a dotted-decimal subnet mask after the slash, e.g Describing the network prefix’s width as a single number, e.g. became incorporated into later standards documents.

The initial goal of CIDR was to slow the increase of routing tables on routers across the internet and decrease the rapid exhaustion of IPv4 addresses.

Before CIDR, IP addresses were divided into general fixed-size classes where the first part of the IP address represented the network address (of 8, 16 or 24 bits) and the latter part represented the host address.

Exhaustion of the Class B network address space. One fundamental cause of this problem is the lack of a network class of a size which is appropriate for mid-sized organization; Class C, with a maximum of 254 host addresses, is too small, while Class B, which allows up to 65534 addresses, is too large for most organizations.
RFC 1519

Note, that if you want to create subnets (especially flexible subnets), it is not enough to simply attach the same suffix to the IP address, for example and do not belong to the same network:

Address:         11000000.10101000.11001000.00000101
Netmask: = 30  11111111.11111111.11111111.11111100
Network:      11000000.10101000.11001000.00000100
Broadcast:         11000000.10101000.11001000.00000111
HostMin:         11000000.10101000.11001000.00000101
HostMax:         11000000.10101000.11001000.00000110
Hosts/Net: 2

Address:         11000000.10101000.11001000.00001000
Netmask: = 30  11111111.11111111.11111111.11111100
Network:      11000000.10101000.11001000.00001000
Broadcast:        11000000.10101000.11001000.00001011
HostMin:         11000000.10101000.11001000.00001001
HostMax:        11000000.10101000.11001000.00001010
Hosts/Net: 2

Both addresses are therefore not in the same network, but they would have been, however, if the second address had been

Address:         11000000.10101000.11001000.00000110
Netmask: = 30  11111111.11111111.11111111.11111100
Network:      11000000.10101000.11001000.00000100
Broadcast:         11000000.10101000.11001000.00000111
HostMin:         11000000.10101000.11001000.00000101
HostMax:         11000000.10101000.11001000.00000110
Hosts/Net: 2


What is an IP Address?

InterNIC: IP addresses are allocated to the organizations that administrate computer networks based on TCP/IP protocol by the InterNIC – the organization that administrates the Internet.

An IP (Internet Protocol) address is a 32-bit number that uniquely identifies a host on a TCP/IP network.

It is typically shown as 4 octets of numbers from 0-255 represented in decimal form, e.g. the IP address: in binary form is 11000000.10101000.00000001.01100100.

The IP address consists of two parts: a network ID (the network segment to which the host belongs to) and a host ID (an individual host on some specific network segment).

The length of the these parts is not fixed and depends on a subnet mask.

IP Type Range Addresses CIDR
IPv4 from to 232

What is a Subnet Mask (or Netmask)?

Routers & Subnets: Routers use subnet masks to route data packets to the right subnet. It reads the network ID for a packet’s destination address and determines whether that packet should remain on the current subnet or be routed to a different subnet. When a router delivers a packet to the correct subnet, it uses then the host ID portion of the destination address to deliver the packet to its final destination.

A subnet mask is used to divide an IP address into the network and host addresses.

It is a 32-bit number created by setting host bits to all 0s and network bits to all 1s.

For example, (the same as in CIDR notation):

11000000.10101000.00000001.01100100 - IP address (
11111111.11111111.11111111.00000000 - Subnet mask (

The first 24 bits of 1s in the subnet mask are identified as the network address part, while the last 8 bits of 0s are identified as the host address, that gives us the following addresses:

11000000.10101000.00000001.00000000 - Network address (
11111111.11111111.11111111.01100100 - Host address (

So in this example, the subnet mask divides the IP address, into the network ID and the host address

When a packet arrives on the subnet the router then will use the host ID portion of the destination address i.e. to deliver the packet to its final destination.

Info: The 255 address is always assigned to a broadcast address, and the 0 address is always assigned to a network address. Neither can be assigned to hosts, as they are reserved for these special purposes.

What is a Subnet?

The process of dividing a network into smaller network sections is called subnetting.

This can be useful for many different purposes and helps isolate groups of hosts from each other to deal with them more easily.

Through subnetting, a network traffic can travel a shorter distance without passing through unnecessary routers to reach its destination.

What is an IP Routing?

Info: A host can communicate directly with other hosts only on the same subnet. To communicate with the hosts on another subnets, it must use a router.

IP Routing is the process of determining the path for data to follow across multiple networks from its source to its destination.

When a router receives a packet, it reads its header to see the destination IP and refers to its internal routing table to determine the next hop address.

The next router repeats the process using its own routing table until the packet reaches its destination.

What are the Network Classes?

Network Classes: IPv4 network classes have been deprecated and replaced with CIDR since the publication of RFC 1519 in 1993.

Before the introduction of CIDR in 1993, all the IP addresses had been divided into five classes based on the leading four address bits.

Classes A, B, and C had provided unicast addresses for networks of three different network sizes, class D had been for multicast networking and the class E address range had been reserved for future or experimental purposes.

Network Class Range Addr. per Net. Netmask CIDR
Class A 16,777,216 (224) /8
Class B 65,536 (216) /16
Class C 256 (28) /24
Was it useful? Share this post with the world!

Leave a Reply