Bird
Raised Fist0
Computer Networksknowledge~10 mins

Subnetting and subnet masks in Computer Networks - Step-by-Step Execution

Choose your learning style10 modes available
Concept Flow - Subnetting and subnet masks
Start with IP address
↓
Apply subnet mask
↓
Divide network into subnets
↓
Calculate subnet addresses
↓
Assign IPs within subnets
↓
Communicate within subnet or route outside
Subnetting splits a big network into smaller parts using a subnet mask to separate network and host parts of an IP address.
Execution Sample
Computer Networks
IP: 192.168.1.0
Mask: 255.255.255.0
Subnet bits borrowed: 2
New mask: 255.255.255.192
Calculate subnets and hosts
This example shows how borrowing 2 bits from host part changes the subnet mask and creates smaller subnets.
Analysis Table
StepActionIP/Mask BinarySubnet CalculationResult
1Original IP and maskIP: 11000000.10101000.00000001.00000000 Mask: 11111111.11111111.11111111.00000000No subnettingNetwork: 192.168.1.0/24
2Borrow 2 bits for subnettingMask changes to 11111111.11111111.11111111.11000000New mask: 255.255.255.192Subnet bits: 2, Host bits: 6
3Calculate number of subnets2^2 = 44 subnets createdSubnet ranges: .0-.63, .64-.127, .128-.191, .192-.255
4Calculate hosts per subnet2^6 - 2 = 6262 usable hosts per subnetHost addresses exclude network and broadcast
5Assign IPs in first subnet192.168.1.0/26Hosts: 192.168.1.1 to 192.168.1.62Broadcast: 192.168.1.63
6Assign IPs in second subnet192.168.1.64/26Hosts: 192.168.1.65 to 192.168.1.126Broadcast: 192.168.1.127
7End--Subnetting complete with 4 subnets and 62 hosts each
💡 Subnetting done by borrowing bits; network divided into smaller parts with calculated hosts.
State Tracker
VariableStartAfter Step 2After Step 3After Step 4Final
Subnet Mask255.255.255.0255.255.255.192255.255.255.192255.255.255.192255.255.255.192
Subnet Bits Borrowed02222
Number of Subnets14444
Hosts per Subnet254254626262
Key Insights - 3 Insights
Why do we subtract 2 from the number of hosts per subnet?
Because one address is reserved for the network ID and one for the broadcast address, as shown in step 4 of the execution_table.
How does borrowing bits affect the subnet mask?
Borrowing bits changes the subnet mask by turning host bits into network bits, increasing the mask value as seen in step 2 of the execution_table.
Why are there exactly 4 subnets after borrowing 2 bits?
Because 2 bits borrowed means 2^2 = 4 subnets, as calculated in step 3 of the execution_table.
Visual Quiz - 3 Questions
Test your understanding
Look at the execution_table at step 3, how many subnets are created after borrowing 2 bits?
A2
B4
C8
D16
💡 Hint
Refer to the 'Subnet Calculation' column in step 3 of the execution_table.
According to variable_tracker, what is the subnet mask after borrowing bits?
A255.255.255.192
B255.255.255.128
C255.255.255.0
D255.255.255.224
💡 Hint
Check the 'Subnet Mask' row after Step 2 in variable_tracker.
At which step in the execution_table do we calculate the number of usable hosts per subnet?
AStep 2
BStep 3
CStep 4
DStep 5
💡 Hint
Look for 'Calculate hosts per subnet' in the Action column of execution_table.
Concept Snapshot
Subnetting splits a network into smaller parts by borrowing bits from host portion.
Subnet mask changes to reflect borrowed bits.
Number of subnets = 2^(borrowed bits).
Hosts per subnet = 2^(host bits) - 2 (network & broadcast).
Used to organize and secure networks efficiently.
Full Transcript
Subnetting is the process of dividing a large network into smaller subnetworks by using a subnet mask. The subnet mask separates the network part of an IP address from the host part. By borrowing bits from the host portion, we create more subnets but fewer hosts per subnet. For example, starting with IP 192.168.1.0 and mask 255.255.255.0, borrowing 2 bits changes the mask to 255.255.255.192. This creates 4 subnets, each with 62 usable hosts after subtracting network and broadcast addresses. The execution table shows each step: original IP and mask, borrowing bits, calculating subnets and hosts, and assigning IP ranges. The variable tracker shows how subnet mask, subnet bits, number of subnets, and hosts per subnet change through the process. Key moments clarify why we subtract 2 from hosts, how borrowing bits changes the mask, and why 2 borrowed bits create 4 subnets. The visual quiz tests understanding of these steps and values. Subnetting helps organize networks for better management and security.

Practice

(1/5)
1. What is the main purpose of subnetting in computer networks?
easy
A. To connect different types of devices without IP addresses
B. To increase the total number of IP addresses available globally
C. To encrypt data sent over the network
D. To divide a large network into smaller, manageable parts

Solution

  1. Step 1: Understand subnetting concept

    Subnetting is used to split a large network into smaller subnetworks for easier management.
  2. Step 2: Compare options

    Only To divide a large network into smaller, manageable parts correctly describes subnetting's purpose; others describe unrelated functions.
  3. Final Answer:

    To divide a large network into smaller, manageable parts -> Option D
  4. Quick Check:

    Subnetting = dividing networks [OK]
Hint: Subnetting means splitting networks into smaller parts [OK]
Common Mistakes:
  • Confusing subnetting with encryption
  • Thinking subnetting increases global IP addresses
  • Believing subnetting connects devices without IPs
2. Which of the following is a valid subnet mask?
easy
A. 255.255.255.0
B. 0.255.255.255
C. 255.0.255.0
D. 255.255.0.255

Solution

  1. Step 1: Recall valid subnet mask format

    A subnet mask must have continuous 1s followed by continuous 0s in binary, like 255.255.255.0.
  2. Step 2: Check each option

    Only 255.255.255.0 fits this rule; others have mixed or invalid patterns.
  3. Final Answer:

    255.255.255.0 -> Option A
  4. Quick Check:

    Valid subnet mask = continuous 1s then 0s [OK]
Hint: Subnet masks have continuous 255s then 0s [OK]
Common Mistakes:
  • Choosing masks with mixed 255 and 0 in wrong order
  • Not knowing binary pattern rules for subnet masks
  • Confusing IP addresses with subnet masks
3. Given the IP address 192.168.1.10 and subnet mask 255.255.255.0, what is the network address?
medium
A. 192.168.1.0
B. 192.168.0.0
C. 192.168.1.255
D. 192.168.0.255

Solution

  1. Step 1: Understand network address calculation

    The network address is found by performing a bitwise AND between the IP address and subnet mask.
  2. Step 2: Calculate network address

    IP: 192.168.1.10 AND Mask: 255.255.255.0 gives 192.168.1.0 as the network address.
  3. Final Answer:

    192.168.1.0 -> Option A
  4. Quick Check:

    Network address = IP AND subnet mask [OK]
Hint: AND IP with mask to get network address [OK]
Common Mistakes:
  • Confusing broadcast address with network address
  • Using wrong subnet mask for calculation
  • Not applying bitwise AND operation
4. Identify the error in this subnet mask: 255.255.224.255
medium
A. Subnet mask must always end with 0 in the last octet
B. Subnet mask cannot have 224 in any octet
C. Subnet mask must have continuous 1s followed by 0s; this mask breaks that rule
D. Subnet mask cannot have more than two 255 octets

Solution

  1. Step 1: Check binary pattern of subnet mask

    Subnet masks must have all 1s on the left side and all 0s on the right side without interruption.
  2. Step 2: Analyze given mask

    255.255.224.255 breaks this rule because the last octet is 255 (all 1s) after 224 (which is partial 1s), causing non-continuous 1s.
  3. Final Answer:

    Subnet mask must have continuous 1s followed by 0s; this mask breaks that rule -> Option C
  4. Quick Check:

    Subnet mask = continuous 1s then 0s [OK]
Hint: Subnet mask 1s must be continuous, no breaks [OK]
Common Mistakes:
  • Thinking 224 is invalid in subnet masks
  • Believing last octet must always be 0
  • Ignoring binary continuity rule
5. You have a network 10.0.0.0/24 and need at least 6 subnets. Which subnet mask should you use to create enough subnets?
hard
A. 255.255.255.192
B. 255.255.255.224
C. 255.255.255.0
D. 255.255.255.128

Solution

  1. Step 1: Calculate required subnet bits

    To create at least 6 subnets, find minimum bits n where 2^n ≥ 6. Here, n=3 (2^3=8 subnets).
  2. Step 2: Determine new subnet mask

    Original mask /24 means 24 bits for network. Adding 3 bits for subnetting gives /27 mask.
  3. Step 3: Convert /27 to subnet mask

    /27 corresponds to 255.255.255.224.
  4. Final Answer:

    255.255.255.224 -> Option B
  5. Quick Check:

    3 subnet bits = /27 = 255.255.255.224 [OK]
Hint: Use 2^n ≥ needed subnets to find mask [OK]
Common Mistakes:
  • Choosing mask with too few subnet bits
  • Confusing host bits with subnet bits
  • Not converting CIDR to decimal mask correctly
Recommended

Ready to prove it?

Pass the test and this pattern moves unknown strong while earning +1 Grip toward your certificate.

10 questions~5 mineasy hard