The topic “CIDR” addresses the Design and Implementation of AWS Networks as highlighted in the AWS Blueprint for the exam guide
What is CIDR?
CIDR stands for Classless Inter-Domain Routing and is used for IP addressing and routing. It allocates IP addresses in a more flexible manner as compared to the original system of Internet Protocol (IP) address classes. In this way, it increases the number of available IP addresses with extensive use of NAT (Network Address Translation).
By providing a new, more efficient way to allocate network addresses, CIDR has reduced the issue of wasted address space in the routers. With CIDR, one entry in the routing table entry represents a combination of networks existing in the forward path. This network aggregation in a single address is known as Supernet.
CIDR IP addresses can be described as consisting of two groups of bits. The most significant group of bits denotes the prefix i.e., a network address that is used for the identification of a network or sub-network. The least significant group of bits is known as host identifier that determines the total number of bits in the address. It is used to signify the device on the work that will receive incoming information packets.
For example, consider the following CIDR Notation
Here, the prefix is – 18.104.22.168, and
The total number of bits in this address is 28.
The prefix, first group of bits in the notation allows you to group the multiple blocks of network addresses into a single routing network. CIDR blocks share the first group of bits (the binary representation of the network addresses). The blocks are also identified using same decimal dot notation system as IPv4 addresses.
For example, a CIDR block is shown below
Here /24 signifies the total number of 1’s bits in the routing mask (network mask).
This IP address can be shown as below in the binary format:
Here the first 24 bits are marked as 1.
It would be equivalent to a network mask of 255.255.255.0
Note that the network addresses that have the identical prefix and the same number of bits, always belong the same block. Also, the large and small blocks can be distinguished by the length of the prefix.
Calculating the Network Mask
Let’ say that we have given a notation of /20 as the mask, how can we calculate the network mask
We can do this with the help of the below table notation.
For a mask of /20, the equivalent binary format would be as follows
From the third octet, e can see that there are 4 leading 1’s. This corresponds to the first 4 columns of our table
If we add these numbers we get – 240
Hence our network mask would be 255.255.240.0
Calculating the Number of Subnets and Hosts
Now based on a CIDR block, let’s say we need to calculate the number of subnets and hosts possible. We can do this with the following equations.
- Number of Networks possible in a CIDR network, use 2n where n is the number of 1s in the subnet mask
- Number of hosts possible in a CIDR network, use 2n-2 where n is the number of 0s in the host mask
- Every network needs 2 addresses, 1 for network and 1 for broadcast
Let’s consider the following example,
There is a given CIDR block of IP address 192.168.1.0/28
So first let’s get the decimal format in place
Now, here the first 3 octets are dedicated to the Network
The first 4 bits of 1’s of the 4th octet is what gives us the possibility of the subnets. So the value of n is 4.
So the number of subnets is (2*2*2*2) = 16
Next, we need to calculate the number of hosts
Since the number of host bits is 4, hence the value of n is also 4
So the number of hosts is (2*2*2*2) – 2 = 14
CIDR for VPC’s and Subnets
- The allowed range of CIDR block size for the VPC (Virtual Private Cloud) is between a /16 network mask (65,536 IP addresses) and /28 network mask (16 IP addresses).
- The CIDR block of a subnet can be same as that of the block for the VPC (for a single subnet in the VPC)
- The CIDR block of a subnet can also be same as that of the other subset in case of multiple subnets.
- In a subnet CIDR block, the first four IP addresses and the last IP address in each subnet block are not available to use, and cannot be assigned to an instance. For example, in a subnet with block 10.0.0.0/24, the following five IP addresses are reserved:
- 0.0.0: Network address.
- 0.0.1: Reserved by AWS for the VPC router.
- 0.0.2: Reserved by AWS.
- 0.0.3: Reserved by AWS for future use.
- 0.0.255: Network broadcast address.
Preparing for AWS Certified Advanced Networking Speciality Certification? Pass in 1st Attempt. Start with Whizlabs Free and Practice Tests Now!
The aim of Whizlabs is to help the individuals in their journey of preparing and passing AWS Certified Advanced Networking Specialty certification exam. We deliver the best and high-quality preparation material to evolve professional career. Whizlabs content is prepared by the industry experts who have a great knowledge and passion for cloud computing. We are continuously growing our cloud expert’s community.
- Amazon EC2 vs Amazon S3: A comparison guide - March 27, 2023
- 7 pro tips for the AZ-900 exam: Microsoft Azure Fundamentals Certifications - March 17, 2023
- How to build and train Machine Learning Model? - March 13, 2023
- Preparation Guide for AWS Developer Associate Certification DVA-C02 - February 9, 2023
- Preparation Guide on Salesforce Platform App Builder Certification - February 5, 2023
- Exam tips on Google Cloud Certified Professional Cloud Architect - January 26, 2023
- Let’s begin you career in DevSecOps | An Exclusive Interview with DevSecOps Certified Expert – Andreas Horn - January 9, 2023
- 25 Free Question on AWS Certified SAP on AWS – Specialty Exam (PAS-C01) - December 19, 2022