Classless Inter-Domain Routing (CIDR)
Motivation
Traditional IPv4 addressing used fixed classes (A, B, C) that rigidly defined how many bits represented the network versus host portions of an address.This created significant waste because organizations often needed more addresses than Class C provided but far fewer than Class B offered.
CIDR eliminates this inflexibility by allowing network administrators to specify exactly how many bits should represent the network portion, creating networks of any size needed.
Method
CIDR uses slash notation appended to IP addresses to indicate the network boundary. The number after the slash represents how many bits from the left identify the network, with the remaining bits identifying individual hosts within that network.
For example, 192.168.1.0/24 means the first 24 bits define the network and the last 8 bits define hosts, creating a network with 256 possible addresses.
Usage
- With CIDR, we can identify whether an IP address is the same subnet as us, or do we need to send the packet out
- In router, there might be interface like
140.112.30.0/24, this means that any packet with destination in140.112.30.0/24should be send via this interface