Intro:
An Overview
of CIDR (Classless Inter-Domain Routing) for IPv4.
- CIDR (Classless
Inter-Domain Routing) for IPv4 is a fundamental concept in networking, especially
when designing VPCs, Subnets, and Routing in AWS or
any cloud environment.
Breakdown:
- The concept:CIDR (Classless
Inter-Domain Routing),
- Structure of an IPv4 CIDR Block,
- CIDR Notation Breakdown,
- How to Calculate a CIDR Block,
- CIDR Aggregation (Supernetting)
- CIDR in AWS VPC Design,
- Tools & Tips for CIDR Planning,
- CIDR in Security Context (AWS SGs & NACLs),
- Advanced Topics.
The concept: CIDR (Classless
Inter-Domain Routing)
·
CIDR (Classless Inter-Domain Routing) is a method
for allocating IP addresses and routing Internet Protocol packets.
·
CIDR (Classless Inter-Domain Routing) replaced the old classful
addressing system (Class A, B, C) to make IP address allocation more
efficient and flexible.
Structure
of an IPv4 CIDR Block
A CIDR block
is written in the format:
<IPv4 Address>/<Prefix Length>Example:
192.168.10.0/24From above:
-
192.168.10.0→ Network address -
/24→ Prefix length (number of bits representing the network) - The remaining (32 - 24 = 8) bits are reserved for host
addresses.
CIDR
Notation Breakdown
|
CIDR |
Network
Bits |
Host
Bits |
#
of Hosts (Usable) |
Subnet
Mask |
Sample
Range |
|
/8 |
8 |
24 |
16,777,214 |
255.0.0.0 |
10.0.0.0 – 10.255.255.255 |
|
/16 |
16 |
16 |
65,534 |
255.255.0.0 |
192.168.0.0 – 192.168.255.255 |
|
/24 |
24 |
8 |
254 |
255.255.255.0 |
192.168.1.0 – 192.168.1.255 |
|
/28 |
28 |
4 |
14 |
255.255.255.240 |
192.168.1.0 – 192.168.1.15 |
How
to Calculate a CIDR Block
Example:
twtech is given 10.0.0.0/16
- Network bits: 16
- Host bits: 16 → (32 – 16 = 16)
- Number of addresses: 2^16 = 65,536 total addresses
(Usable = 65,534, because 1 for network + 1 for broadcast)
CIDR Aggregation (Supernetting)
- CIDR allows grouping multiple contiguous networks into a single routing entry.
Example: The networks.
192.168.0.0/24192.168.1.0/24This Can be
summarized as:
192.168.0.0/23NB:
- This reduces routing table entries — critical in internet routing.
CIDR in AWS VPC
Design
- In AWS, twtech defines the VPC CIDR block, then subdivide it into subnets.
Example:
VPC CIDR: 10.0.0.0/16Subnets:
- Public Subnet A → 10.0.0.0/24
- Private Subnet A → 10.0.1.0/24
- Public Subnet B → 10.0.2.0/24
- Private Subnet B → 10.0.3.0/24
NB:
This allows isolation
and controlled
routing.
Tools
& Tips for CIDR Planning
- CIDR Calculator:
- Tols like
cidr.xyz,ipcalc, or AWS VPC wizard help in visualizing ranges. - Avoid Overlap:
- Ensure CIDR ranges don’t overlap when peering or connecting networks.
- Private IPv4 Ranges (RFC 1918):
-
10.0.0.0/8→ Large enterprises -
172.16.0.0/12→ Mid-size -
192.168.0.0/16→ Small networks
CIDR
in Security Context (AWS SGs & NACLs)
- CIDR is used to define source/destination IP ranges in:
· Security Groups
· Network ACLs
· Route Tables
Examples:
0.0.0.0/0 → open to the internet10.0.0.0/16 → internal network203.0.113.0/24 → specific corporate rangeInsights: Advanced Topics
- VLSM (Variable Length Subnet Masking):
- Allows efficient IP allocation using variable subnet sizes.
- Route Summarization:
- Reduces route table size by combining multiple CIDRs.
- CIDR Overlaps in Multi-VPC / Hybrid Cloud:
- Must plan carefully to avoid conflicts with on-premises IP space.
- IPv6 Equivalent:
- Uses
/nnotation as well, but supports 128-bit addressing.
How to calculate CIDR to IP Range from the website: https://www.ipaddressguide.com/cidr
CIDR to IPv4 Conversion
- CIDR is the short for Classless Inter-Domain Routing,
an IP addressing scheme that replaces the older system based on classes A, B,
and C.
- A single IP address can be used to designate many
unique IP addresses with CIDR.
- A CIDR IP address looks like a normal IP address
except that it ends with a slash followed by a number, called the IP network
prefix.
- CIDR addresses reduce the size of routing tables and
make more IP addresses available within organizations.
No comments:
Post a Comment