AWS Certified Advanced Networking - Specialty Exam: Subnet CIDR Calculation

Calculate Subnet CIDR for 20 Hosts

Prev Question Next Question

Question

You need to create a subnet in a VPC that supports 20 hosts.

You need to be as accurate as possible.

What CIDR should you use?

Answers

Explanations

Click on the arrows to vote for the correct answer

A. B. C. D.

Answer - A.

This can be seen by using an online CIDR calculator.

http://www.subnet-calculator.com/cidr.php
) CIDR Calculator

IP Address CIDR Netmask
0.0.0.0 255.255.255.224
Mask Bits Wildcard Mask

27 0.0.0.31
Maximum Subnets Maximum Addresses
32 30

CIDR Network (Route) Net: CIDR Notation
0.0.0.0 0.0.0.0/27

CIDR Address Range
0.0.0.0 - 0.0.0.31

To determine the appropriate CIDR for the subnet, you need to calculate the number of available host addresses that will be required in the subnet. In this case, you need to create a subnet that supports 20 hosts, so you need to find the smallest CIDR block size that will provide at least 20 host addresses.

CIDR notation is a way of representing a range of IP addresses using a single address and a subnet mask. The subnet mask is represented as a number of bits, with the number of bits determining the size of the subnet. The subnet mask is used to divide an IP address range into smaller subnets, each of which can be used to assign IP addresses to devices.

To calculate the number of available host addresses in a subnet, you need to subtract two from the total number of IP addresses in the subnet. This is because the first IP address is reserved for the network address, and the last IP address is reserved for the broadcast address.

Using the formula (2^n)-2, where n is the number of host bits, we can calculate the number of available host addresses in each of the given CIDR blocks:

A. /27: (2^5)-2 = 30 B. /24: (2^8)-2 = 254 C. /28: (2^4)-2 = 14 D. /25: (2^7)-2 = 126

Based on these calculations, the smallest CIDR block size that provides at least 20 host addresses is /27. Therefore, the answer is A. /27.