Arama Yap Mesaj Gönder
Biz Sizi Arayalım
+90
X
X
X
X

Knowledge Base

Homepage Knowledge Base General What is CIDR? IP Addressing and Sub...

Bize Ulaşın

Konum Halkalı merkez mahallesi fatih cd ozgur apt no 46 , Küçükçekmece , İstanbul , 34303 , TR

What is CIDR? IP Addressing and Subnet Masking

What is CIDR?

CIDR (Classless Inter-Domain Routing) is an IP addressing method used to distribute and route IP addresses more efficiently. It was developed to prevent address waste experienced in traditional class-based addressing (classes A, B, C). CIDR makes it possible to allocate IP addresses in blocks and flexibly adjust these blocks according to network size.

Key Points:

  • CIDR uses IP addresses more efficiently.
  • It prevents address waste in class-based addressing.
  • It allocates IP address blocks flexibly according to network size.

How Does CIDR Notation Work?

CIDR notation combines an IP address and a subnet mask into a single expression. This expression consists of the IP address followed by a forward slash (/) and a number indicating how many bits of the subnet mask are "1". For example, the notation 192.168.1.0/24 represents the IP address 192.168.1.0 and a 24-bit subnet mask (255.255.255.0).

Example:

192.168.1.0/24

  • 192.168.1.0: Network address
  • /24: Subnet mask (255.255.255.0)

This notation specifies the first IP address in the network and the number of available IP addresses. /24 indicates that the first 24 bits represent the network ID and the last 8 bits (32-24=8) represent device addresses. This means 28 = 256 addresses. However, two of these addresses (the network address and the broadcast address) cannot be used, so there are 254 available device addresses.

What is a Subnet Mask and Why is it Important?

A subnet mask is a 32-bit number that determines which part of an IP address represents the network address and which part represents the device address. The subnet mask is a fundamental part of the IP addressing scheme and determines how devices on the network will communicate with each other.

Key Points:

  • The subnet mask separates the network and device parts of the IP address.
  • It determines how devices on the network will communicate with each other.
  • CIDR notation allows the subnet mask to be expressed in a shorter and more understandable way.

Subnet Mask Examples:

CIDR Notation Subnet Mask Number of Available IP Addresses
/24 255.255.255.0 254
/25 255.255.255.128 126
/26 255.255.255.192 62
/27 255.255.255.224 30
/28 255.255.255.240 14

The Role of the Subnet Mask: When a device wants to send a packet to an IP address, it first uses the subnet mask to determine whether the destination IP is on its own network. If the destination IP address is on the same network, the device sends the packet directly to the destination. If the destination IP address is on a different network, the device sends the packet to the default gateway, and the gateway routes the packet to the destination.

How to Perform CIDR Calculation?

CIDR calculation involves determining the starting address, ending address, network address, broadcast address, and the number of available IP addresses of an IP address block.

Step-by-Step CIDR Calculation:

  1. Understanding CIDR Notation: For example, in the notation 192.168.1.0/24, 192.168.1.0 represents the network address, and /24 represents the subnet mask.
  2. Converting the Subnet Mask to Binary: /24 means 24 "1"s and 8 "0"s. This is expressed in binary as 11111111.11111111.11111111.00000000. Its decimal equivalent is 255.255.255.0.
  3. Finding the Network Address: The network address is found by performing a logical AND operation between the IP address and the subnet mask.
    
      IP Address:     192.168.1.10  (11000000.10101000.00000001.00001010)
      Subnet Mask: 255.255.255.0   (11111111.11111111.11111111.00000000)
      ---------------------------------------------------------------------
      Network Address:     192.168.1.0   (11000000.10101000.00000001.00000000)
      
  4. Finding the Broadcast Address: The broadcast address is found by converting the "0"s at the end of the network address to "1"s. For /24, the last 8 bits are converted to "1"s.
    
      Network Address:     192.168.1.0   (11000000.10101000.00000001.00000000)
      ---------------------------------------------------------------------
      Broadcast Address:  192.168.1.255 (11000000.10101000.00000001.11111111)
      
  5. Finding the Number of Available IP Addresses: The number of available IP addresses is found using the formula 2(32 - CIDR value) - 2. For /24, this number is 2(32-24) - 2 = 28 - 2 = 256 - 2 = 254.

Example CIDR Calculation:

IP Address: 10.0.0.50/16

  • Network Address: 10.0.0.0
  • Broadcast Address: 10.0.255.255
  • Number of Available IP Addresses: 2(32-16) - 2 = 216 - 2 = 65534

What are the Benefits of CIDR?

CIDR offers several advantages over traditional class-based addressing:

  • Address Efficiency: CIDR uses IP addresses more efficiently and prevents address waste. It allows allocating as many IP addresses as needed.
  • Reduction of Routing Tables: CIDR helps reduce routing tables because multiple network blocks can be represented with a single routing entry. This improves the performance of routers.
  • Flexibility: CIDR offers the flexibility to allocate IP address blocks according to network size. This gives network administrators more control.
  • Network Hierarchy: CIDR supports network hierarchy and provides better network organization.

Real-Life Example: An internet service provider (ISP) has to allocate IP address blocks of different sizes to its customers. Thanks to CIDR, ISPs can allocate different sizes of address blocks, such as /24 blocks to small businesses, /20 blocks to medium-sized businesses, and /16 blocks to large organizations. This ensures that addresses are used more efficiently and address waste is prevented.

What is the Difference Between CIDR and VLSM (Variable Length Subnet Masking)?

CIDR and VLSM (Variable Length Subnet Masking) are closely related concepts, but they serve different purposes.

  • CIDR: It is an addressing method used to distribute and route IP addresses more efficiently. Its main purpose is to prevent address waste and reduce routing tables.
  • VLSM: It is a technique used to create subnets of different sizes within a network. VLSM allows for more efficient use of addresses by dividing the same network address block into subnets of different sizes.

Example: Suppose a company has the address block 192.168.1.0/24. This company wants to create subnets of different sizes for different departments. Using VLSM, this company can create subnets of different sizes such as /25, /26, and /27 and allocate as many IP addresses as each department needs.

VLSM Example:

Subnet CIDR Notation Subnet Mask Number of Usable IP Addresses Description
Marketing 192.168.1.0/25 255.255.255.128 126 For the marketing department that needs 126 IP addresses
Engineering 192.168.1.128/26 255.255.255.192 62 For the engineering department that needs 62 IP addresses
Accounting 192.168.1.192/27 255.255.255.224 30 For the accounting department that needs 30 IP addresses

Result: CIDR provides a general framework for the distribution and routing of IP addresses, while VLSM enables more efficient creation of subnets within this framework. VLSM can be considered an extension of CIDR.

How to Perform CIDR Block Subnetting?

CIDR block subnetting is the process of dividing an IP address block into smaller subnets. This is done to better manage networks, increase security, and use addresses more efficiently.

Step-by-Step CIDR Block Subnetting:

  1. Determine Needs: Determine how many subnets you need and how many IP addresses you need in each subnet.
  2. Determine Subnet Mask: Determine the appropriate subnet mask based on the number of subnets and IP addresses you need. The subnet mask determines how many bits in each subnet represent the network address and how many bits represent the device address.
  3. Create Subnets: Divide the original IP address block into subnets using the determined subnet mask. Each subnet will have a network address and a broadcast address.
  4. Allocate IP Addresses: Allocate IP addresses in each subnet to devices. Avoid using the network address and broadcast address.

Example: Suppose you want to divide the 192.168.1.0/24 address block into 4 subnets. You need approximately 60 IP addresses in each subnet.

  1. Number of Subnets: 4
  2. Number of IP Addresses: Approximately 60 (a /26 subnet offering 62 usable addresses would be sufficient)
  3. Subnet Mask: /26 (255.255.255.192)
  4. Subnets:
    • 192.168.1.0/26 (192.168.1.0 - 192.168.1.63)
    • 192.168.1.64/26 (192.168.1.64 - 192.168.1.127)
    • 192.168.1.128/26 (192.168.1.128 - 192.168.1.191)
    • 192.168.1.192/26 (192.168.1.192 - 192.168.1.255)

In this example, the 192.168.1.0/24 address block is divided into 4 subnets, each with 62 usable IP addresses. Each subnet can be assigned to a different department or network segment.

CIDR and Routing

CIDR is a fundamental part of the internet routing system. Routers use routing tables to deliver IP packets to their destinations. CIDR helps reduce the size of routing tables and increase routing efficiency.

Reducing Routing Table Size: CIDR makes it possible to represent multiple network blocks with a single routing entry. For example, an internet service provider (ISP) may have allocated many different /24 blocks to its customers. Thanks to CIDR, the ISP can represent all of these /24 blocks with a single /16 block. This significantly reduces the size of routing tables and improves the performance of routers.

Example: Let's say a router has the following routing table:

Network Address Subnet Mask Gateway
192.168.1.0 255.255.255.0 10.0.0.1
192.168.2.0 255.255.255.0 10.0.0.1
192.168.3.0 255.255.255.0 10.0.0.1

Using CIDR, we can combine these three entries into a single entry:

Network Address Subnet Mask Gateway
192.168.0.0 255.255.252.0 (/22) 10.0.0.1

This reduces the size of the routing table and speeds up routing operations.

Longest Prefix Match: Routers use the longest prefix match algorithm when routing an IP packet to its destination. This algorithm selects the routing entry where the destination IP address has the longest matching prefix. This ensures that packets are routed to the correct destination.

Summary: CIDR is a fundamental part of the internet routing system and helps to reduce the size of routing tables, increase routing efficiency, and ensure that packets are routed to the correct destination.

 

Can't find the information you are looking for?

Create a Support Ticket
Did you find it useful?
(3421 times viewed / 68 people found it helpful)

Call now to get more detailed information about our products and services.

Top