How Does CIDR Allocate IPv4 Address Blocks?

996.5K views
•
May 6, 2018
by
Gate Smashers
YouTube video player
How Does CIDR Allocate IPv4 Address Blocks?

TL;DR

CIDR allocates IPv4 addresses in flexible, contiguous blocks instead of fixed classes, reducing address wastage by matching block size to user demand. The prefix /n identifies the network bits, while the remaining bits identify addresses within the block. For 200.10.20.40/28, four host bits provide 16 addresses, and the block ID is 200.10.20.32/28.

Transcript

Hello friends, welcome to Gate Smashers. The topic is Classless Addressing. The concept of Classless Addressing came in 1993 after the concept of Classful Addressing. In Classful Addressing we divide the IP Addresses into 5 classes. Because of that there is a problem of flexibility and what other problems or we can say disadvantages occur in Classf... Read More

Key Insights

  • Classless addressing is an IPv4 allocation method introduced in 1993 that eliminates fixed address classes. It replaces the Class A, B, C, and D structure with variable blocks, allowing address allocations to correspond more closely to the number of addresses requested by a user.
  • CIDR blocks reduce address wastage by avoiding rigid class sizes. Under classful addressing, a request for 1,000 addresses cannot be fulfilled as an exact class allocation, while classless addressing is designed to provide a block sized according to the user’s demand.
  • CIDR notation is written as x.y.z.w/n, where the four octets form the IPv4 address and n represents the number of continuous 1s in the mask. The prefix also states how many bits belong to the network or block identifier.
  • The host-bit count is calculated by subtracting the CIDR prefix from the 32-bit IPv4 address length. For a /28 prefix, 32 minus 28 leaves four host bits, so the corresponding block contains 2 raised to the power of 4, or 16 addresses.
  • The subnet mask for a /28 prefix is 255.255.255.240. Its binary form contains 28 continuous 1s followed by four 0s, so the first 28 bits identify the block and the final four bits represent the variable host portion.
  • The block ID for 200.10.20.40/28 is 200.10.20.32/28. It can be found by preserving the first 28 bits and setting the four host bits to zero, or by performing a bitwise AND between the address and 255.255.255.240.
  • CIDR block addresses must be contiguous, meaning each address follows the preceding address without skipped values. A block beginning at 200.10.20.32 continues through successive values such as 33, 34, 35, and 36 rather than using separated or interleaved addresses.
  • A valid CIDR block must contain a power-of-two number of addresses, and its first address must be evenly divisible by the block size. A 16-address block satisfies the size rule because 16 equals 2 raised to the power of 4, while 17 does not.

Install to Summarize YouTube Videos and Get Transcripts

Explore YouTube Video Summarizer or Get YouTube Transcript Extractor

Questions & Answers

Q: What is classless addressing in IPv4?

Classless addressing is a method of organizing IPv4 addresses into blocks without using fixed Class A, B, C, or D divisions. A user can receive a block based on the required number of addresses, giving the allocation greater flexibility than classful addressing. The method was introduced in 1993 and is presented as a way to reduce the address wastage caused by predefined class sizes.

Q: How is CIDR different from classful addressing?

CIDR uses variable address blocks, while classful addressing divides addresses into five predefined classes. In the classful system, a user requesting 1,000 addresses cannot receive an exact class-sized allocation and might be assigned a much larger network. CIDR instead uses a prefix and block size that can correspond more closely to demand, so fewer IPv4 addresses are wasted.

Q: What does the prefix in CIDR notation mean?

The prefix in x.y.z.w/n states how many of the 32 IPv4 bits belong to the block or network identifier. It also represents the number of continuous 1s in the mask. For example, /28 means that the mask begins with 28 continuous 1s. The other four bits remain available as host bits within that address block.

Q: How many addresses are contained in a /28 block?

A /28 block contains 16 addresses. An IPv4 address has 32 bits, and the /28 prefix assigns 28 of them to the block identifier. That leaves four host bits. The address count is therefore 2 raised to the power of 4, which equals 16. This satisfies the CIDR requirement that the number of addresses be a power of two.

Q: How do you find the subnet mask for a /28 prefix?

Write 28 continuous binary 1s and fill the remaining four positions with 0s. The first three octets each contain eight 1s and therefore equal 255. The final octet is 11110000, which equals 240. As a result, the mask represented by the /28 prefix is 255.255.255.240, with four bits left for the host portion.

Q: How do you find the block ID of 200.10.20.40/28?

Preserve the first 28 bits because they identify the block, then set the remaining four host bits to zero. The last octet, 40, is 00101000 in binary. Keeping its first four bits and replacing its final four bits with 0000 produces 00100000, or 32. The resulting block ID is therefore 200.10.20.32/28.

Q: Can a CIDR block contain 17 addresses?

A CIDR block cannot contain 17 addresses under the rules described because the number of addresses must be a power of two. A block containing 16 addresses is valid because 16 equals 2 raised to the power of 4. The value 17 is not a power of two, so it cannot serve as a valid CIDR block size.

Q: What rules must a classless address block follow?

A classless address block must follow three stated rules. Its addresses must be contiguous, without skipped or interleaved values. The total number of addresses must be a power of two. Finally, the block’s first address, which identifies the network, must be evenly divisible by the size of the block. These conditions determine whether a proposed CIDR block is valid.

Summary & Key Takeaways

  • Classless addressing removes the fixed Class A, B, C, and D structure used in classful addressing. It organizes IPv4 addresses into blocks whose sizes can better match user demand. This flexibility reduces address wastage because an organization can receive an appropriately sized block instead of an unnecessarily large predefined class.

  • CIDR writes an address as x.y.z.w/n, where n gives the number of continuous mask bits set to 1 and identifies the block portion. Because IPv4 addresses contain 32 bits, subtracting n from 32 gives the host-bit count. Raising 2 to that count gives the block’s total address count.

  • For 200.10.20.40/28, the prefix reserves 28 bits for the block and leaves four bits for addresses, producing 16 addresses. Setting those four host bits to zero changes the last octet from 40 to 32. Therefore, the address belongs to the block identified as 200.10.20.32/28.


Read in Other Languages (beta)

Share This Summary 📚

Explore More Summaries from Gate Smashers 📚