0
0
Computer Networksknowledge~10 mins

CIDR notation in Computer Networks - Step-by-Step Execution

Choose your learning style9 modes available
Concept Flow - CIDR notation
Start with IP address
Add '/' and prefix length
Calculate subnet mask from prefix
Determine network and host parts
Use for routing and IP allocation
CIDR notation shows an IP address with a suffix that tells how many bits are for the network part, helping to divide IP addresses efficiently.
Execution Sample
Computer Networks
192.168.1.0/24

# /24 means first 24 bits are network
# subnet mask: 255.255.255.0
# host bits: 8 (32-24)
# total addresses: 256 (254 usable)
This shows an IP address with a /24 prefix, meaning the first 24 bits are network bits, leaving 8 bits for hosts.
Analysis Table
StepActionValue/CalculationResult
1Start with IP address192.168.1.0192.168.1.0
2Add prefix length/24192.168.1.0/24
3Calculate subnet mask24 bits network255.255.255.0
4Determine network partFirst 24 bits fixed192.168.1.0
5Determine host part32 - 24 = 8 bits256 addresses total
6Calculate usable hosts256 - 2 (network & broadcast)254 usable IPs
7Use in routingRoute traffic to 192.168.1.0/24Network identified
8EndPrefix length defines subnet sizeExecution complete
💡 Prefix length fully defines network and host division, stopping further calculation.
State Tracker
VariableStartAfter Step 3After Step 5Final
IP Address192.168.1.0192.168.1.0192.168.1.0192.168.1.0
Prefix LengthN/A242424
Subnet MaskN/A255.255.255.0255.255.255.0255.255.255.0
Host BitsN/AN/A88
Total AddressesN/AN/A256256
Usable HostsN/AN/AN/A254
Key Insights - 3 Insights
Why does /24 mean 255.255.255.0 as subnet mask?
Because /24 means the first 24 bits are network bits, which in decimal form is 255.255.255.0 as shown in execution_table step 3.
Why subtract 2 from total addresses to get usable hosts?
Two addresses are reserved: one for the network itself and one for broadcast, so usable hosts are total minus 2, as shown in step 6.
What does the prefix length tell us about the IP address?
It tells how many bits are fixed for the network part, separating network and host bits, as seen in steps 3 and 4.
Visual Quiz - 3 Questions
Test your understanding
Look at the execution table, what is the subnet mask calculated at step 3?
A255.0.0.0
B255.255.0.0
C255.255.255.0
D255.255.255.255
💡 Hint
Check the 'Result' column in step 3 of the execution_table.
At which step do we find out how many host bits are available?
AStep 5
BStep 2
CStep 4
DStep 6
💡 Hint
Look for where 'Host Bits' or '32 - prefix' is calculated in execution_table.
If the prefix length changed from /24 to /26, how would the total addresses change?
ADecrease to 128
BDecrease to 64
CIncrease to 512
DStay the same at 256
💡 Hint
Recall total addresses = 2^(32 - prefix length). Check variable_tracker for prefix length effect.
Concept Snapshot
CIDR notation shows an IP address with a slash and number (e.g., /24).
The number is how many bits are for the network part.
Subnet mask is derived from this prefix length.
It divides IPs into network and host parts.
Used to allocate IPs efficiently and route traffic.
Full Transcript
CIDR notation is a way to write IP addresses that includes how many bits are used for the network part. For example, 192.168.1.0/24 means the first 24 bits are network bits. This corresponds to a subnet mask of 255.255.255.0. The remaining bits are for hosts, so with 8 host bits, there are 256 total addresses. Two addresses are reserved for network and broadcast, leaving 254 usable IPs. This notation helps computers know which part of the address is the network and which part is the device, making routing and IP allocation more efficient.