Computer NetworkingUnit 89 min read
IPv6 Addressing, Fragmentation & IPv4/IPv6 Comparison
Unit 8 of Computer Networking covers IPv6’s 128-bit address structure, its hexadecimal notation, fragmentation rules, and how it solves IPv4’s exhaustion and inefficiencies. It contrasts IPv4/IPv6 headers, explains why fragmentation happens, and shows real-world deployments like Ncell’s 4G/LTE networks and NEPSE’s stoc
TAKEAWAYS:
- IPv6 uses 128-bit addresses (written in hexadecimal with colons) to replace IPv4’s 32-bit addresses, eliminating exhaustion.
- Fragmentation in IPv4 occurs at routers; IPv6 avoids it by requiring Path MTU Discovery (PMTUD).
- IPv6 headers are simpler (8 fields vs. IPv4’s 12) but include extension headers for optional features like security.
- Real-world use: Ncell’s 4G/LTE uses IPv6 for mobile data; NEPSE’s trading platform relies on IPv6 for high-speed, low-latency transactions.
- Subnetting in IPv6 uses /64 prefix by default for end networks, unlike IPv4’s variable-length subnetting.
- Exam focus: Compare IPv4/IPv6 headers, calculate IPv6 address ranges, and explain fragmentation scenarios.
1. Why IPv6? Problems IPv4 Couldn’t Solve
IPv4’s 32-bit addresses (≈4.3 billion) were exhausted by 2011. Key limitations:
- Address exhaustion: IANA allocated last IPv4 blocks in 2011; Nepal’s NTC now uses CGNAT (Carrier-Grade NAT) to share addresses.
- No built-in security: IPv4 relies on firewalls/VPNs; IPv6 includes IPsec by default.
- Inefficient headers: IPv4’s 20-byte header wastes bandwidth; IPv6’s 40-byte header is optimized.
- No native multicast: IPv4 uses IGMP; IPv6 has multicast built-in (e.g., IPTV, video conferencing).
| Metric | IPv4 | IPv6 |
|---|---|---|
| Address size | 32-bit (4.3B addresses) | 128-bit (3.4×10³⁸ addresses) |
| Notation | Dotted decimal (e.g., 192.168.1.1) | Hexadecimal (e.g., 2001:0db8::1) |
| Header size | 20 bytes (variable) | 40 bytes (fixed) |
| Fragmentation | Handled by routers | Handled by source (PMTUD) |
| Security | Optional (IPsec, firewalls) | Built-in (IPsec, AH, ESP) |
| Multicast | IGMP (separate protocol) | Native support |
2. IPv6 Address Structure
A. 128-Bit Address Format
An IPv6 address is 128 bits long, written as 8 groups of 4 hex digits, separated by colons (:).
Example:
2001:0db8:85a3:0000:0000:8a2e:0370:7334
B. Shorthand Notations
- Leading zeros omitted:
2001:db8:85a3:0:0:8a2e:370:7334 - Consecutive zeros replaced with
::(only once per address):2001:db8:85a3::8a2e:370:7334 - Unspecified address:
::(all zeros) - Loopback address:
::1
C. Types of IPv6 Addresses
mindmap
root((IPv6 Address Types))
Unicast
Global Unicast (2000::/3)
Link-Local (fe80::/10)
Unique Local (fc00::/7)
Multicast (ff00::/8)
Anycast (shared by multiple nodes)D. Worked Example: Convert Binary to IPv6
Problem: Convert 11111111 00000000 00000000 00000000 00000000 00000000 00000000 00000001 to IPv6.
Solution:
- Split into 16-bit chunks:
11111111 00000000 | 00000000 00000000 | ... | 00000000 00000001 - Convert each to hex:
FF00:0000:0000:0000:0000:0000:0000:0001 - Simplify:
FF00::1
Real-world tie-in:
Ncell’s 4G/LTE networks assign Global Unicast IPv6 addresses (e.g., 2400:3200:130:1::/64) to user devices. The /64 prefix ensures enough addresses for millions of users.
3. IPv6 Header vs. IPv4 Header
A. IPv4 Header (20–60 bytes)
B. IPv6 Header (40 bytes, fixed)
Key Differences
| Feature | IPv4 | IPv6 |
|---|---|---|
| Header size | 20–60 bytes | Fixed 40 bytes |
| Checksum | Yes (header) | No (end-to-end checksum) |
| Fragmentation | Handled by routers | Handled by source (PMTUD) |
| Options | In-header (inefficient) | Extension headers |
| Security | Optional (IPsec) | Built-in (IPsec, AH, ESP) |
Why no checksum in IPv6? IPv6 assumes link-layer checksums (e.g., Ethernet’s CRC) are reliable, reducing overhead.
4. IPv6 Fragmentation: Path MTU Discovery (PMTUD)
A. Why Fragmentation?
- IPv4 routers fragment packets if they exceed the Maximum Transmission Unit (MTU) of a link (e.g., 1500 bytes for Ethernet).
- Problem: Fragmentation adds overhead and can fail if a router doesn’t support it.
B. IPv6’s Solution: PMTUD
- Source host sends a packet with Don’t Fragment (DF) bit set (like IPv4).
- If the packet is too large, the first router that can’t forward it sends an ICMPv6 "Packet Too Big" message.
- The source host reduces packet size and retries.
Example:
- MTU of a link: 1280 bytes (common for some mobile networks).
- Packet size: 1500 bytes.
- Action: Source reduces to 1280 bytes or less.
Real-world example: When you use Pathao’s delivery app, its servers use PMTUD to ensure packets reach your phone without fragmentation, even if the delivery driver’s phone switches between Wi-Fi and mobile data.
5. IPv6 Subnetting: The /64 Rule
A. IPv4 Subnetting Recap
- Uses variable-length subnet masks (VLSM).
- Example:
192.168.1.0/26→ 64 hosts per subnet.
B. IPv6 Subnetting Simplified
- Default subnet size:
/64(64 bits for host portion). - Why /64?
- Ensures enough addresses for autoconfiguration (SLAAC) and future growth.
- Example: A home network gets
2001:db8::/64→2001:db8::to2001:db8:ffff:ffff:ffff:ffff:ffff:ffff.
C. Worked Example: IPv6 Subnetting
Problem: Given 2001:db8:1234::/48, divide into 4 subnets.
Solution:
- Prefix:
/48→ 16 bits left for subnets + hosts. - Subnet bits: Allocate 2 bits (→ 4 subnets).
- New prefix:
/50(48 + 2).
- New prefix:
- Subnet addresses:
- Subnet 1:
2001:db8:1234::/50→2001:db8:1234:0000::/64 - Subnet 2:
2001:db8:1234:4000::/64 - Subnet 3:
2001:db8:1234:8000::/64 - Subnet 4:
2001:db8:1234:C000::/64
- Subnet 1:
Real-world tie-in:
NTC’s fiber-to-the-home (FTTH) networks assign /64 subnets to each household, ensuring seamless IPv6 connectivity for services like eSewa payments and Khalti transactions.
6. IPv6 Transition Technologies
Since IPv4 and IPv6 can’t coexist natively, transition methods include:
- Dual Stack: Run both IPv4 and IPv6 on devices (most common today).
- Tunneling: Encapsulate IPv6 in IPv4 (e.g., 6to4, Teredo).
- Translation: Convert between IPv4 and IPv6 (e.g., NAT64/DNS64).
- Header Translation: Modify headers (e.g., SIIT).
Example:
- NEPSE’s trading platform uses dual stack to handle both IPv4 (legacy systems) and IPv6 (new high-frequency trading servers).
In the Real World
Ncell’s 4G/LTE Networks
- Uses IPv6 for mobile data (e.g.,
2400:3200:130:1::/64) to support millions of users without address exhaustion. - Why? Nepal’s population growth would exhaust IPv4 addresses within a decade.
- Uses IPv6 for mobile data (e.g.,
eSewa and Khalti Payments
- Both apps use IPv6-enabled servers for secure transactions, especially on mobile networks.
- Key feature: IPv6’s built-in IPsec encrypts payment data without extra configuration.
NTC’s Smart Grid Monitoring
- NTC’s IoT sensors (e.g., power line monitors) use IPv6 for low-power, long-range communication (e.g.,
fd00::/8for Unique Local Addresses). - Why? IPv6’s multicast reduces bandwidth for sensor data aggregation.
- NTC’s IoT sensors (e.g., power line monitors) use IPv6 for low-power, long-range communication (e.g.,
Exam Tip
- Compare IPv4/IPv6 headers: Memorize the 8 key fields of IPv6 and why it’s simpler.
- PMTUD is critical: Always explain that IPv6 fragmentation is handled by the source, not routers.
- Subnetting shortcut: IPv6 uses /64 by default; calculate subnets by adding bits to the prefix (e.g.,
/48 + 2 = /50). - Real-world examples:
- Ncell/LTE: IPv6 for mobile data.
- NEPSE: Dual stack for trading systems.
- eSewa/Khalti: IPv6 for secure payments.
- Avoid common mistakes:
- Don’t confuse IPv6’s
::with IPv4’s0.0.0.0. - Don’t forget extension headers in IPv6 (e.g., Hop-by-Hop, Routing).
- Don’t confuse IPv6’s
- Calculation traps:
- For IPv6 subnetting, always start with
/64for end networks. - In IPv4 subnetting questions, borrow bits correctly (e.g.,
/26→ 6 bits borrowed, 62 hosts).
- For IPv6 subnetting, always start with
Based on the TU BCA syllabus for Computer Networking (CACS303), unit 8.
Discussion
Loading…