IPv4 and IPv6 Addressing — Complete Study Notes with MCQs
Exam-focused notes on IPv4 and IPv6 addressing for SSC, Banking (IBPS/SBI), Railway, UPSC, NIELIT, JAIIB/CAIIB and IT officer papers. Learn bits, classes, private ranges, special addresses, CIDR basics, IPv6 types, transition methods, and practice with interactive MCQs.
What is an IP Address?
Core definition asked in almost every computer awareness paper
An IP address (Internet Protocol address) is a logical address that identifies a device (or interface) on a network so that data can be sent to the correct destination — like a house number for computers.
IPv4
32 bits · dotted decimal · ~4.3 billion addresses · still widely used
IPv6
128 bits · colon hex · huge address space · designed for growth
Related ideas
Subnetting, CIDR, NAT, DHCP, DNS, dual-stack, tunneling
IPv4 Addressing
32-bit addresses in four octets
IPv4 uses a 32-bit address written as four decimal numbers (octets) separated by dots — dotted decimal notation.
Key facts
- Format example: 192.168.1.1
- Each octet: 0 to 255
- Total bits: 4 × 8 = 32
- Total addresses: 232 ≈ 4.3 billion
- Split into Network ID + Host ID
Exam hot points
- Invalid if any part > 255 (e.g., 10.0.0.256)
- Dotted decimal = IPv4
- Colon hex = IPv6
- IPv4 shortage led to NAT + IPv6
IPv4 Address Classes (Classful)
Still heavily tested even though modern networks use CIDR
| Class | First octet | Default mask | Typical use | Exam note |
|---|---|---|---|---|
| A | 1 – 126 | 255.0.0.0 (/8) | Very large networks | 127 is loopback, not Class A hosts |
| B | 128 – 191 | 255.255.0.0 (/16) | Medium networks | Common enterprise ranges |
| C | 192 – 223 | 255.255.255.0 (/24) | Small networks / LANs | 192.168.x.x is Class C private |
| D | 224 – 239 | — | Multicast | Not for normal host unicast |
| E | 240 – 255 | — | Experimental / research | Reserved |
Class A example
10.1.2.3 — first octet 10 → Class A
Class B example
172.16.5.10 — first octet 172 → Class B
Class C example
192.168.1.1 — first octet 192 → Class C
Special, Private & Reserved IPv4 Addresses
High-frequency match-the-following style questions
Special addresses
Loopback
- 127.0.0.1 (and whole 127.0.0.0/8)
- Tests the local host (localhost)
Limited broadcast
- 255.255.255.255
- Broadcast on the local network
APIPA / link-local
- 169.254.0.0 – 169.254.255.255
- Auto IP when DHCP fails
0.0.0.0
- “This host” / unspecified / default route contexts
- Meaning depends on use (binding vs routing)
Private IPv4 (RFC 1918)
Not routed on the public Internet. Used inside homes, offices, campuses. Public access usually needs NAT.
| Range | CIDR | Class feel |
|---|---|---|
| 10.0.0.0 – 10.255.255.255 | 10.0.0.0/8 | Class A private |
| 172.16.0.0 – 172.31.255.255 | 172.16.0.0/12 | Class B private block |
| 192.168.0.0 – 192.168.255.255 | 192.168.0.0/16 | Class C private |
CIDR & Subnetting Basics (Exam Level)
Enough for competitive exams — not full engineering depth
Subnetting divides a large network into smaller networks. CIDR (Classless Inter-Domain Routing) writes the prefix length after a slash, e.g. 192.168.1.0/24.
/24 meaning
- 24 network bits
- 8 host bits
- Mask: 255.255.255.0
- Usable hosts: 254
/26 meaning
- 26 network bits
- Mask: 255.255.255.192
- 64 addresses total
- 62 usable hosts
/30 meaning
- Often point-to-point links
- 4 addresses total
- 2 usable hosts
- Mask: 255.255.255.252
| Prefix | Subnet mask | Host bits | Usable hosts (typical) |
|---|---|---|---|
| /8 | 255.0.0.0 | 24 | 16,777,214 |
| /16 | 255.255.0.0 | 16 | 65,534 |
| /24 | 255.255.255.0 | 8 | 254 |
| /25 | 255.255.255.128 | 7 | 126 |
| /26 | 255.255.255.192 | 6 | 62 |
| /27 | 255.255.255.224 | 5 | 30 |
| /28 | 255.255.255.240 | 4 | 14 |
| /30 | 255.255.255.252 | 2 | 2 |
IPv6 Addressing
128-bit addresses written in hexadecimal
IPv6 uses 128 bits, written as eight groups of hexadecimal digits separated by colons. It was created mainly to solve IPv4 address exhaustion.
Key facts
- Example: 2001:0db8:85a3:0000:0000:8a2e:0370:7334
- 8 hextets × 16 bits = 128 bits
- Address space: 2128 (huge)
- No broadcast (uses multicast/anycast)
- IPsec support designed into architecture
Compression rules
- Drop leading zeros in a group: 0db8 → db8
- Replace one run of zero groups with ::
- :: can appear only once
- Example: 2001:0db8:0000:0000:0000:0000:0000:0001 → 2001:db8::1
:: in one address are wrong.
IPv6 Address Types & Important Prefixes
| Type | Prefix / example | Meaning |
|---|---|---|
| Global unicast | 2000::/3 (e.g. 2001:db8::1) | Publicly routable global addresses |
| Link-local | fe80::/10 | Auto on each interface; same link only |
| Unique local (ULA) | fc00::/7 (often fd00::/8) | Private-like internal addresses |
| Multicast | ff00::/8 (e.g. ff02::1) | One-to-many; replaces broadcast role |
| Loopback | ::1 | Like 127.0.0.1 |
| Unspecified | :: | Like 0.0.0.0 in some contexts |
| Anycast | Same as unicast format | Nearest of multiple destinations |
Unicast
One-to-one delivery to a single interface.
Multicast
One-to-many delivery to a group of interfaces.
Anycast
One-to-nearest among several hosts sharing the address.
IPv4 vs IPv6 — Comparison Table
Night-before-exam revision gold
| Feature | IPv4 | IPv6 |
|---|---|---|
| Address size | 32 bits | 128 bits |
| Notation | Dotted decimal (192.0.2.1) | Colon hexadecimal (2001:db8::1) |
| Address space | ~4.3 billion | 2128 (vast) |
| Broadcast | Yes | No (multicast/anycast) |
| Configuration | Manual / DHCP common | SLAAC + DHCPv6 options |
| Security | IPsec optional/add-on | IPsec support designed in |
| NAT need | Common due to scarcity | Much less needed |
| ARP | ARP for IP→MAC | Neighbor Discovery (NDP) |
| Header | More complex / variable options | Simpler fixed base header + extensions |
Moving from IPv4 to IPv6
Three transition words every exam loves
1 Dual-stack
Device/network runs both IPv4 and IPv6 at the same time. Most practical migration path.
2 Tunneling
Carry IPv6 packets inside IPv4 (or vice versa) across a network that does not natively support the inner protocol.
3 Translation
Convert between IPv4 and IPv6 traffic (e.g. NAT64) so IPv6-only and IPv4-only systems can talk.
Related exam concepts
NAT
- Network Address Translation
- Shares scarce public IPv4 addresses
- Common in home/office routers
- Less critical in pure IPv6 designs
Protocols over IP
- TCP — reliable transport
- UDP — fast, connectionless
- ICMP / ICMPv6 — errors, ping, NDP helpers
One-Glance Quick Revision
IPv4 bits
32 bits · 4 octets · dotted decimal
IPv6 bits
128 bits · 8 hextets · colon hex
IPv4 total
~4.3 billion addresses
Class A / B / C
1–126 · 128–191 · 192–223
Class D / E
Multicast · Experimental
Private IPv4
10/8 · 172.16/12 · 192.168/16
Loopback
IPv4 127.0.0.1 · IPv6 ::1
APIPA
169.254.0.0/16
IPv6 link-local
fe80::/10
IPv6 multicast
ff00::/8
IPv6 global
2000::/3
IPv6 ULA
fc00::/7
/24 usable
254 hosts
/30 usable
2 hosts
No broadcast in
IPv6
Transition 3
Dual-stack · Tunnel · Translate
Practice MCQs on IPv4 & IPv6 Addressing
Tap any option to reveal the correct answer and a short explanation. Answers stay hidden until you choose.
Exam Tips for IP Addressing Questions
First octet decides class
For classful MCQs, ignore the rest of the address until you classify A/B/C/D/E from the first number.
Dots vs colons
Dots + decimal = IPv4. Colons + hex = IPv6. Instant elimination tool.
Private ranges trio
Memorise 10/8, 172.16–31, 192.168/16. Anything else is usually public or special.
Loopback pair
127.0.0.1 ↔ ::1 is a favourite matching question.
Usable hosts formula
2^(host bits) − 2. For /24 → 2^8 − 2 = 254. For /30 → 2^2 − 2 = 2.
IPv6 has no broadcast
If an option says IPv6 broadcast like 255.255.255.255, it is wrong. Use multicast/anycast language.
Rank Math SEO Settings (for publishing)
Copy into Rank Math. Hide/remove this box on the live page after setup if you want.
- Focus Keyphrase
- IPv4 and IPv6 addressing
- Secondary Keywords
- IPv4 vs IPv6, IPv4 classes, private IP address ranges, APIPA, IPv6 address types, CIDR notation, dual stack tunneling, IPv4 IPv6 MCQ
- SEO Title
- IPv4 and IPv6 Addressing with Classes, CIDR & MCQs | GyanDesk
- Meta Description
- Learn IPv4 and IPv6 addressing — 32-bit vs 128-bit, classes A–E, private ranges, APIPA, CIDR basics and 60 MCQs for SSC, Banking and Railway exams.
- URL slug
- Keep existing:
ipv4-and-ipv6-addressing - Extra Rank Math tips
-
• Focus keyphrase in first paragraph + one H2
• Internal links to CIDR, subnetting, protocols, topologies
• Schema: Article + optional FAQ (“Difference between IPv4 and IPv6?”, “What is APIPA?”)
• Breadcrumbs: Home → Information Technology → IPv4 and IPv6 Addressing
Related notes
More free study notes in Information Technology — all part of the GyanDesk study library.
