IPv4 = 32-bit address divided into 4 octets (each 0–255)
Each octet = 8 bits; total = 4 × 8 = 32 bits
Subnet Mask decides which part is Network and which is Host
CIDR notation: the number after "/" = count of network bits
IPv6 uses 128 bits (not 32) — designed to replace IPv4
📊
Most Asked in Banking & Govt ExamsIPv4 Classes (A to E)
A
1 – 126
16,777,214 hosts
/8 · 255.0.0.0
Large orgs, ISPs
B
128 – 191
65,534 hosts
/16 · 255.255.0.0
Medium orgs
C
192 – 223
254 hosts
/24 · 255.255.255.0
Small networks
D
224 – 239
Multicast
No default mask
No hosts — multicast
E
240 – 255
Reserved
No default mask
Research / future use
Class
First Octet Range
Default Mask
CIDR
Networks
Hosts/Network
Use
A
1–126
255.0.0.0
/8
126
16,777,214
Very large orgs
B
128–191
255.255.0.0
/16
16,384
65,534
Medium orgs
C
192–223
255.255.255.0
/24
2,097,152
254
Small networks
D
224–239
N/A
N/A
—
—
Multicast
E
240–255
N/A
N/A
—
—
Experimental
🎯 Exam Tricks — IP Classes
127.x.x.x is skipped from Class A — reserved for Loopback (127.0.0.1 = localhost)
0.x.x.x is also reserved — so Class A starts at 1
Classes D and E have NO subnet mask and NO hosts
Trick: A=1–126, B=128–191, C=192–223 — memorise the starting numbers
Classful vs Classless: Modern internet uses CIDR (classless) — class system is now legacy
🔒
Frequently Asked in All ExamsPrivate & Special IP Addresses
10.0.0.0/8
Class A Private Range: 10.0.0.0 – 10.255.255.255 Hosts: ~16.7 million
172.16.0.0/12
Class B Private Range: 172.16.0.0 – 172.31.255.255 Hosts: ~1 million
192.168.0.0/16
Class C Private Range: 192.168.0.0 – 192.168.255.255 Hosts: ~65,000
127.0.0.0/8
Loopback 127.0.0.1 = localhost Tests TCP/IP on own machine
169.254.0.0/16
APIPA (Link-Local) Assigned when DHCP fails Self-assigned by OS
0.0.0.0
Unspecified / Default Route Used in routing tables Represents "all networks"
✂️
Core TopicWhat is Subnetting?
Subnetting = dividing a large IP network into smaller networks called subnets. Achieved by borrowing bits from the host portion of the address and adding them to the network portion — making the subnet mask longer.
Reason for Subnetting
Explanation
Example
🔒 Security
Different departments get separate subnets; breach in one doesn't spread
HR vs Finance vs IT subnet
📦 Reduce broadcast traffic
Smaller subnet = smaller broadcast domain = less noise
LAN with 10 devices vs 254
💾 Efficient IP use
Allocate only what is needed; avoid wasting addresses
30-host subnet instead of 254
🏦 Better management
Separate ATMs, branches, servers — easier troubleshooting
Bank ATM: 10.10.10.0/28
🚦 Traffic control
Routers between subnets control inter-subnet traffic
Inter-VLAN routing
📌 Key Terms
Network ID — first address of a subnet (all host bits = 0). Cannot be assigned to a host.
Broadcast Address — last address (all host bits = 1). Sends to ALL hosts in subnet. Cannot be assigned.
Usable Host Range — all addresses between Network ID and Broadcast address.
Block Size / Increment — 256 − subnet mask last octet (e.g., 256−192 = 64 for /26)
Borrowed Bits — extra bits moved from host to network to create subnets
CIDR = Classless Inter-Domain Routing — uses /24, /26 etc. instead of class system
🧮
Must MemoriseSubnetting Formulas
Usable Hosts per Subnet
2h − 2
h = host bits (32 − prefix). Subtract 2 for Network ID and Broadcast address.
Number of Subnets Created
2b
b = borrowed bits (new prefix − old prefix). Modern networks allow all subnets.
Block Size (Increment)
256 − mask_octet
The "jump" between subnets. E.g., /26 mask=192 → block = 256−192 = 64.
VLSM = using different subnet mask sizes within the same network. Unlike fixed subnetting (all subnets same size), VLSM lets you right-size each subnet — assign /25 to a large dept, /28 to a small one, /30 for a point-to-point link.
Feature
Fixed Subnetting
VLSM
Mask size
Same for all subnets
Different for each subnet
IP efficiency
Wastes addresses
Very efficient
Routing protocol
Works with classful
Requires classless (OSPF, EIGRP, RIP v2)
Use case
Simple networks
Enterprise / complex networks
📌 VLSM Example — Allocate for: Dept A (100 hosts), Dept B (50 hosts), WAN link (2 hosts)
1
Dept A — 100 hosts
Need 2ʰ − 2 ≥ 100 → h=7 → 126 hosts → use /25 (255.255.255.128)
2
Dept B — 50 hosts
Need 2ʰ − 2 ≥ 50 → h=6 → 62 hosts → use /26 (255.255.255.192)
3
WAN link — 2 hosts
2ʰ − 2 ≥ 2 → h=2 → use /30 (255.255.255.252) — classic P2P link
✅ Best Answer: VLSM allocation /25 + /26 + /30
🔗
Opposite of SubnettingSupernetting / Route Aggregation
Supernetting = combining multiple smaller networks into one larger network. Also called Route Aggregation, Route Summarization, or Prefix Aggregation. The subnet mask becomes shorter (fewer network bits). Mainly used by ISPs to reduce routing table size.
✂️ Subnetting
Purpose: Divide large network into smaller ones
Mask: Becomes LONGER (/24 → /26)
Used by: LAN admins, banks, offices
Hosts: Per network decreases
Borrows: bits FROM host part
Result: More networks, fewer hosts each
🔗 Supernetting
Purpose: Combine small networks into one large
Mask: Becomes SHORTER (/24 → /22)
Used by: ISPs, large WAN networks
Hosts: Per network increases
Returns: bits BACK to host part
Result: Fewer routes, larger network each
📌 3 Rules for Supernetting (Must All Be Met)
Rule 1 — Consecutive: Networks must be adjacent (no gaps). 192.168.0.0, .1.0, .2.0 ✅ — but not .0.0, .2.0, .3.0 ❌
Rule 2 — Same Mask: All networks must have the same prefix length (/24 with /24 etc.)
Rule 3 — Boundary Aligned: First network must start at the correct boundary. For 4×/24 networks, must start at multiples of 4 (e.g., .0, .4, .8)
✅ Supernet: 192.168.16.0/21 (covers .16.0 to .23.255)
📝
Tap Any Option to Reveal AnswerMCQ Practice — 50 Questions
Score:0 / 0
Q.01Basics🔥 Most Asked
IPv4 address is how many bits long?
✔ Correct: B — 32 bits
IPv4 addresses are 32 bits written as 4 octets (4 × 8 = 32). IPv6 uses 128 bits. This is the single most asked networking fact in competitive exams.
Q.02Classes🔥 Most Asked
Which class of IP address has a default subnet mask of 255.255.255.0?
✔ Correct: C — Class C
Class C (192–223) has default mask 255.255.255.0 (/24), giving 254 usable hosts. Class A = 255.0.0.0 (/8). Class B = 255.255.0.0 (/16).
Q.03Formula🔥 Most Asked
The formula for usable hosts per subnet is:
✔ Correct: B — 2^(host bits) − 2
We subtract 2 because the first address (all host bits = 0) is the Network ID and the last address (all host bits = 1) is the Broadcast address — neither can be assigned to a host.
/29 → host bits = 32−29 = 3 → 2³ − 2 = 8 − 2 = 6 usable hosts. This subnet is often used for small server clusters.
Q.06CIDR🔥 Most Asked
CIDR stands for:
✔ Correct: B — Classless Inter-Domain Routing
CIDR = Classless Inter-Domain Routing. It replaces the rigid classful system (A/B/C) by allowing variable-length prefixes like /22, /27. Both subnetting and supernetting use CIDR notation.
Q.07Subnet ID🔥 Most Asked
What is the broadcast address of subnet 192.168.1.64/26?
IP address 192.168.100.130/25 — which subnet does it belong to?
✔ Correct: B — 192.168.100.128/25
/25 splits at .0 (range 0–127) and .128 (range 128–255). IP .130 falls in the 128–255 range → subnet = 192.168.100.128/25.
Q.10Private IP🔥 Most Asked
Which of these is a PRIVATE IP address?
✔ Correct: B — 192.168.1.1
Private IP ranges: 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16. 8.8.8.8 = Google DNS (public). 203.0.113.x = TEST-NET (documentation). 4.2.2.2 = public DNS.
Q.11Subnets🔥 Most Asked
How many subnets are created if you borrow 3 bits from the host portion?
127.0.0.1 (localhost) is the loopback address. The entire 127.x.x.x range is reserved. Used to test TCP/IP stack on the local machine. 169.254.x.x = APIPA (when DHCP fails).
Q.14APIPA
APIPA (Automatic Private IP Addressing) uses which IP range?
✔ Correct: B — 169.254.0.0/16
APIPA = 169.254.0.0/16. A computer auto-assigns an IP in this range when it cannot reach a DHCP server. 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16 are the three standard private ranges.
Q.15Subnets from /24
How many /28 subnets can be created from a single /24 network?
✔ Correct: C — 16
Borrowed bits = 28 − 24 = 4 → subnets = 2⁴ = 16. Each /28 has 14 usable hosts and block size 16. 16 × 16 = 256 = full /24 space.
Q.16Network ID
What is the Network ID of 192.168.1.0/29 containing IP 192.168.1.10?
✔ Correct: A — 192.168.1.8
/29 block size = 8. Subnets: .0–.7, .8–.15, .16–.23… IP .10 falls in .8–.15 → Network ID = 192.168.1.8, Broadcast = .15, Usable = .9–.14.
Q.17VLSM🔥 Most Asked
VLSM stands for:
✔ Correct: B — Variable Length Subnet Masking
VLSM allows different subnet mask sizes within the same network — /25 for a large dept, /30 for a WAN link. Requires classless routing protocols (OSPF, RIPv2, EIGRP).
Q.18P2P
Which subnet mask is best for a point-to-point WAN link (only 2 hosts needed)?
✔ Correct: C — /30
/30 provides exactly 2 usable hosts (2² − 2 = 2) — perfect for router-to-router links where one IP goes to each end. Mask = 255.255.255.252.
Q.19Hosts Needed
A department needs 200 hosts in one subnet. What is the smallest (most efficient) subnet mask to use?
✔ Correct: A — /24 (254 usable hosts)
Need ≥ 200 hosts. /25 = only 126 (not enough). /24 = 254 (just enough). We use the smallest subnet that fits, which is /24 here.
Q.20Wildcard
What is the wildcard mask for subnet mask 255.255.255.0?
✔ Correct: A — 0.0.0.255
Wildcard mask = inverse of subnet mask = 255.255.255.255 − 255.255.255.0 = 0.0.0.255. Used in Cisco ACLs and routing protocols like OSPF.
Q.21Supernetting🔥 Most Asked
Supernetting is also known as:
✔ Correct: B — Route Aggregation / Route Summarization
Supernetting = Route Aggregation / Route Summarization / Prefix Aggregation. Combines multiple networks to reduce routing table entries. Used mainly by ISPs.
Q.22Supernetting🔥 Most Asked
Combining two /24 networks results in which supernet mask?
First octet = 172 → falls in Class B range (128–191). 172.16.0.0/12 is also a private Class B range. Default mask = 255.255.0.0 (/16).
Q.28Broadcast
The broadcast address sends data to:
✔ Correct: B — All hosts in the subnet
Broadcast address = last IP in the subnet (all host bits = 1). Sends to all devices within that subnet. Cannot be assigned to a single host.
Q.29Four Subnets
Company has 192.168.0.0/24 and needs exactly 4 equal subnets. New mask?
✔ Correct: C — /26
4 subnets = 2² → borrow 2 bits → /24 + 2 = /26. Each /26 subnet has 62 usable hosts and block size 64.
Q.30ISP
Supernetting is most commonly used by:
✔ Correct: C — ISPs
ISPs use supernetting to advertise fewer, larger routes to the internet, keeping routing tables small. Also used in MPLS/WAN networks and bank data centres.
252 = 11111100 in binary = 6 ones. Network bits = 16 + 6 = 22 → /22. This is the supernet for 4 Class C (/24) networks.
Q.33Subnet reduce
What does subnetting reduce in a network?
✔ Correct: B — Broadcast domain size
Subnetting splits a big broadcast domain into smaller ones, reducing unnecessary broadcast traffic. This improves performance — fewer devices receive unwanted broadcast packets.
Q.34NAT
Which mechanism translates private IP addresses to public IP addresses?
✔ Correct: C — NAT (Network Address Translation)
NAT maps private IPs (192.168.x.x) to a public IP for internet access. Enables many devices to share one public IP. Standard feature on all home routers.
Q.35Network ID
IP: 203.0.113.5, Mask: 255.255.255.252 — Network ID is:
✔ Correct: B — 203.0.113.4
/30 block = 4. Subnets: .0–.3, .4–.7, .8–.11... IP .5 is in .4 block → Network ID = 203.0.113.4, Broadcast = .7.
Q.36Banking use
In banking, which is NOT a typical use of subnetting?
✔ Correct: C — Printing cheques
Banks use subnetting for ATM networks, branch LANs, server isolation, VPN segments, firewall zones, and VoIP networks. Cheque printing is a physical process unrelated to IP subnetting.
Class D (224.0.0.0–239.255.255.255) is reserved for multicast — sending to a group of hosts simultaneously. Class E (240–255) is for experimental/research use.
Q.39Supernetting
192.168.0.0/24 to 192.168.3.0/24 combined → supernet is:
First octet = 10 → Class A range (1–126). 10.0.0.0/8 is the largest private IP range (Class A private). Default mask = 255.0.0.0 (/8).
Q.45500 hosts
You need a subnet for exactly 500 hosts from 10.0.0.0/16. Best mask?
✔ Correct: A — /23 (510 usable hosts)
/24 = only 254 (too few). /23 → 9 host bits → 2⁹ − 2 = 510 hosts (fits 500+). /22 = 1022 (wasteful). Use the smallest subnet that fits the requirement.
Q.46Supernetting reduces
Supernetting primarily reduces:
✔ Correct: B — Routing table entries
Supernetting's primary purpose: combine many small routes into one → fewer routing table entries → faster router lookups → better internet performance.
Q.47CIDR / classful
Supernetting works with which type of addressing?
✔ Correct: B — CIDR (Classless)
Supernetting requires CIDR — classful addressing is too rigid to support shorter-than-default prefixes. CIDR enables any prefix length (/8 to /30 etc.).
Q.48Boundary
When combining 4 × /24 networks via supernetting, the first network must start at a multiple of:
✔ Correct: B — 4
Combining 4 /24 networks requires the first to start at a boundary of 4 (e.g., .0, .4, .8, .12, .16…). 2 networks = multiple of 2; 8 networks = multiple of 8.
Q.49IPv4 exhaustion
The total number of IPv4 addresses available is approximately:
✔ Correct: B — ~4.3 billion (2³²)
IPv4 = 32 bits → 2³² = ~4.29 billion addresses. IPv6 = 128 bits → 2¹²⁸ ≈ 340 undecillion. IPv4 addresses were officially exhausted by IANA in 2011.
Q.50VLSM best answer🔥 Most Asked
Depts need 100, 50 and 12 hosts. Which approach is BEST?
✔ Correct: B — VLSM /25 + /26 + /28
VLSM lets you right-size: /25 (126 hosts → fits 100), /26 (62 hosts → fits 50), /28 (14 hosts → fits 12). Efficient, no wastage. This is the design question examiners love.