OCI ‐ Lab 4 ‐ CIDR and IP Subnetting with MXToolbox - sayan028/Sayan-Chakraborty-OCI GitHub Wiki
A) CIDR
CIDR stands for Classless Inter-Domain Routing. It is a technique used to manage IP addresses efficiently and define the size of a network.
10.0.0.0 is simply a 32-bit IP address. By looking at the IP address alone, a router cannot determine which portion represents the network and which portion represents the hosts. When we write 10.0.0.0/8, the /8 provides this information by specifying the size of the network.
The / followed by a number is called CIDR notation. This number tells us how many bits, starting from the left side of the 32-bit IP address, are reserved for the Network ID. The remaining bits are available for Host IDs.
We can think of it like this:
- Network ID → Identifies the network
- Host ID → Identifies a particular device within that network
Summary
In the earlier IPv4 addressing system, IP addresses were divided into fixed Class A, Class B, and Class C categories. Each class provided a predefined number of addresses.
The problem was that organizations often received more IP addresses than they actually required, resulting in significant IP address wastage. There was very little flexibility between the fixed class sizes.
CIDR was introduced to provide more flexibility in assigning IP addresses. It allows networks to be defined according to their actual requirements.
Subnetting is the practical technique used to divide a larger network into smaller networks.
B) IP Subnetting
IP Subnetting is the process of dividing a larger IP network into multiple smaller networks, known as subnets.
Instead of using one large network for everything, we can divide the available IP address space based on our requirements.
For example:
Large Network ├── Subnet 1 ├── Subnet 2 ├── Subnet 3 ├── Subnet 4
This allows us to use IP addresses more efficiently and organize different parts of our network separately.
Subnet Mask
A Subnet Mask is used to determine which portion of an IP address belongs to the Network ID and which portion belongs to the Host ID.
For example:
- IP Address: 10.0.0.10
- Subnet Mask: 255.255.255.0
- CIDR: /24
Here, /24 means that the first 24 bits are used to identify the network, while the remaining 8 bits are available for identifying hosts.
- <---Network Portion----> <-Host Portion->
- <-------- 24 bits --------> <---- 8 bits ---->
In simple terms:
Subnet Mask = Helps us separate the Network part from the Host part of an IP address.
C) IP Subnetting with MXToolbox
Step 1. Open this website in a new tab MXToolbox
Step 2. Provide an RFC 1918 Private IP example- 10.0.0.0
Step 3. Click on the dropdown menu and according to how many IPs you need, select a CIDR suffix; for example I select 32.
Step 4. It will show the output details below
Step 5. Creating separate networks out of a single network. We will divide the network into two networks with equal amounts; for example, for the first network, we choose 10.0.0.0/27
Step 6. For the second network, we choose 10.0.1.0/27. With this, we can choose 31 networks, and each network consists of 31 IPs.