Next Generation Internet Protocol
Open in the Padhaiko app2.1 Introduction to IPv6
Internet Protocol version 6 (IPv6) is the next-generation network-layer protocol designed by the Internet Engineering Task Force (IETF) to succeed IPv4. Originally published as RFC 1883 (1995), updated in RFC 2460 (1998), and elevated to Internet Standard RFC 8200 (2017), IPv6 provides a vastly expanded 128-bit address space, a streamlined fixed header, extensible options, and native support for autoconfiguration and security.
2.1.1 History and need for IPv6
By the early 1990s, rapid growth of the Internet revealed two looming crises in IPv4: rapid depletion of Class B networks and explosive growth in backbone routing tables.
Historical Timeline of IPv6 Standardization
- 1992–1993 (Short-Term Bridges): The IETF deployed CIDR and VLSM alongside NAT as stopgap measures while forming the IPng (IP Next Generation) working area to design a long-term successor.
- 1994–1995 (Protocol Selection & RFC 1752 / RFC 1883): After evaluating proposals such as TUBA, CATNIP, and SIPP (Simple Internet Protocol Plus), the IETF selected SIPP with 128-bit addresses as IPv6 (version 5 was already assigned to the experimental Stream Protocol, ST).
- 1998 (RFC 2460): Refined the core IPv6 specification, Neighbor Discovery (RFC 2461/4861), and Stateless Address Autoconfiguration (RFC 2462/4862).
- 2011–Present (Exhaustion & RFC 8200): Following IANA's central IPv4 pool exhaustion in February 2011, RFC 8200 finalized IPv6 as a full Internet Standard to support mobile broadband, cloud infrastructure, 5G, and IoT at global scale.
Why IPv6 Is Needed:
- Address Exhaustion: 2^128 addresses eliminate the need for multi-tier Carrier-Grade NAT (CGNAT).
- Routing Efficiency: Hierarchical RIR allocations enable route aggregation across global BGP routers.
- Header Simplicity & Forwarding Speed: Fixed 40-byte header with no per-hop checksum reduces router CPU overhead.
- End-to-End Integrity & Security: Restores direct reachability for P2P, VoIP, and end-to-end IPsec without NAT traversal workarounds.
- Zero-Touch Configuration: Built-in Neighbor Discovery and SLAAC automate addressing and gateway discovery.
2.1.2 IPv6 header format
Unlike IPv4's variable 20–60 byte header containing 12+ fields, the base IPv6 header is always 40 bytes (320 bits) long and contains only 8 fields.
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|Version| Traffic Class | Flow Label |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Payload Length | Next Header | Hop Limit |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| |
+ +
| |
+ Source Address +
| (128 bits) |
+ +
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| |
+ +
| |
+ Destination Address +
| (128 bits) |
+ +
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+| Field | Size | Function |
|---|---|---|
| Version | 4 bits | Always 0110 (decimal 6) identifying IPv6. |
| Traffic Class | 8 bits | Replaces IPv4 ToS/DSCP: 6-bit DSCP (QoS priority) + 2-bit ECN (Explicit Congestion Notification). |
| Flow Label | 20 bits | Identifies packets belonging to the same real-time flow so routers can provide consistent QoS and ECMP hashing without inspecting transport headers. |
| Payload Length | 16 bits | Length in bytes of everything following the 40-byte base header (all Extension Headers + upper-layer segment). Max standard payload = 65,535 bytes (0 indicates a Jumbogram via Hop-by-Hop option). |
| Next Header | 8 bits | Identifies the type of header immediately following the IPv6 base header (either an Extension Header like 44 Fragment or an upper-layer protocol like 6 TCP, 17 UDP, 58 ICMPv6). |
| Hop Limit | 8 bits | Replaces IPv4 TTL; decremented by 1 at each router. Packet is discarded when it reaches 0 (with ICMPv6 Time Exceeded sent back). |
| Source Address | 128 bits | IPv6 address of the packet's originator. |
| Destination Address | 128 bits | IPv6 address of the intended recipient (or next node in a Routing Header). |
| Aspect | IPv4 Base Header | IPv6 Base Header |
|---|---|---|
| Header Length | Variable: 20 to 60 bytes (requires IHL field) | Fixed: always 40 bytes (IHL removed) |
| Number of Fields | 12 required fields + optional options | 8 fields total |
| Header Checksum | 16-bit checksum recomputed at every router hop | Removed entirely (relies on L2 CRC and L4 TCP/UDP/ICMPv6 checksums) |
| Fragmentation Fields | Identification, Flags, Fragment Offset in base header | Removed from base header; moved to Fragment Extension Header (source-only) |
| Protocol Identification | 8-bit Protocol field | 8-bit Next Header field (chains Extension Headers and L4 protocols) |
| Lifetime Field | Time to Live (TTL) | Hop Limit (explicitly counts router hops) |
| QoS Marking | 8-bit Type of Service (DSCP/ECN) | 8-bit Traffic Class + 20-bit Flow Label |
2.1.3 Features of IPv6
- Massive 128-Bit Address Space: Provides 2^128 addresses, supporting hierarchical provider-based aggregation and eliminating NAT.
- Streamlined Fixed Header: Fixed 40-byte alignment (64-bit aligned) enables fast ASIC/hardware packet switching.
- Modular Extension Headers: Optional features (routing, fragmentation, IPsec security) are placed in chained headers processed only when needed, rather than slowing down every router.
- Stateless & Stateful Autoconfiguration: Supports SLAAC (hosts configure their own addresses from Router Advertisements) as well as DHCPv6.
- Elimination of Broadcast: IPv6 has no broadcast address; broadcast storms are replaced by scoped multicast (such as All-Nodes
ff02::1and Solicited-Node Multicast). - Anycast Support: Multiple servers share an address so packets reach the topologically nearest node.
- Source-Only Fragmentation & Mandatory PMTUD: Intermediate routers never fragment packets, preventing router exhaustion.
- IPsec Compatibility & Mobility: Designed cleanly for AH/ESP security and Mobile IPv6 (MIPv6) route optimization.
2.1.4 IPv6 addressing format and types
Text Representation and Compression Rules (RFC 4291 / RFC 5952)
An IPv6 address is 128 bits divided into eight 16-bit groups (hextets) written in hexadecimal and separated by colons (:), for example: 2001:0db8:0000:0000:0000:ff00:0042:8329
Two compression rules shorten written IPv6 addresses:
- Leading Zero Suppression: Leading zeros in each 16-bit hextet may be omitted (
0db8->db8,0042->42,0000->0). Trailing zeros must never be omitted (ff00staysff00). - Zero Compression (
::): A single contiguous sequence of one or more all-zero hextets (:0000:0000:...) may be replaced with a double colon::. Because::expands to however many zero hextets are needed to reach 8 groups total,::can appear at most once in an address.
Per RFC 5952 (canonical text representation): use lowercase hex (a–f), compress the longest run of zeros (or leftmost run on a tie), and do not use :: to shorten just a single :0: hextet.
Prefix Notation and Subnetting Structure
Like CIDR, IPv6 uses address/prefix-length. A standard Global Unicast Address follows a three-tier 64-bit / 64-bit split:
- Global Routing Prefix (typically 48 bits): Assigned by RIR/ISP to an organization (
/48or/56). - Subnet ID (16 bits): Used internally by the organization to create up to
2^16 = 65,536subnets (/64each). - Interface Identifier (64 bits): Identifies the specific host interface on the link (generated randomly for privacy, manually, via DHCPv6, or via Modified EUI-64).
Modified EUI-64 Interface ID Derivation
To derive a 64-bit Interface ID from a 48-bit Ethernet MAC address (AA:BB:CC:DD:EE:FF):
- Split the 48-bit MAC in half and insert the 16-bit hex value
FFFEin the middle:AABB:CCFF:FEDD:EEFF. - Flip the 7th bit (the Universal/Local bit, i.e., XOR the first byte with
0x02).
Types of IPv6 Addresses
IPv6 defines three fundamental address categories (replacing IPv4 unicast, multicast, and broadcast):
- Unicast (One-to-One): Identifies a single interface.
- Global Unicast Address (GUA,
2000::/3): Globally routable public addresses (first 3 bits001, covering2000::to3fff:...). Documentation prefix is2001:db8::/32. - Link-Local Address (
fe80::/10): Automatically configured on every IPv6-enabled interface; valid only on the local link (never routed beyond a router). Used as next-hop in routing tables and for NDP. - Unique Local Address (ULA,
fc00::/7, practicallyfd00::/8): Private internal addressing (similar to IPv4 RFC 1918), not routed on the global Internet. - Loopback (
::1/128): Equivalent to IPv4127.0.0.1. - Unspecified (
::/128): All zeros; used as source address before a host acquires an address (e.g., during DAD). - IPv4-Mapped IPv6 Address (
::ffff:0:0/96): Represents an IPv4 host inside dual-stack socket APIs (e.g.,::ffff:192.0.2.10).
- Global Unicast Address (GUA,
- Anycast (One-to-Nearest): Assigned to multiple interfaces (typically geographically distributed servers like DNS root servers). Packets go to the single nearest interface according to routing protocol metrics. Anycast addresses share the exact syntax of unicast addresses.
- Multicast (One-to-Many,
ff00::/8): Identifies a group of interfaces; packets are delivered to all group members.- Format:
1111 1111(8 bitsff) | Flags (4 bits:0RPT, whereT=0permanent well-known,T=1transient) | Scope (4 bits) | Group ID (112 bits).
- Format:
| Address / Scope | Meaning |
|---|---|
Scope 1 (ff01::/16) | Interface-Local (loopback within single node) |
Scope 2 (ff02::/16) | Link-Local (local LAN segment only) |
Scope 5 (ff05::/16) | Site-Local (within an organization site) |
Scope 8 (ff08::/16) | Organization-Local |
Scope e (ff0e::/16) | Global Scope (Internet-wide) |
ff02::1 | All-Nodes on the local link (replaces IPv4 broadcast) |
ff02::2 | All-Routers on the local link |
ff02::5 / ff02::6 | All OSPFv3 Routers / All OSPFv3 Designated Routers |
ff02::9 | All RIPng Routers |
ff02::1:ff00:0/104 | Solicited-Node Multicast (appends last 24 bits of target unicast/anycast address; used for NDP address resolution & DAD) |
2.1.5 Extension headers
IPv6 places optional network-layer functions in separate Extension Headers chained between the 40-byte base header and the upper-layer payload (TCP/UDP/ICMPv6) using the Next Header field.
+--------------------+ +--------------------+ +--------------------+ +-------------+
| IPv6 Base Header | --> | Routing Header | --> | Fragment Header | --> | TCP Segment |
| Next Header = 43 | | Next Header = 44 | | Next Header = 6 | | + Payload |
+--------------------+ +--------------------+ +--------------------+ +-------------+With the sole exception of the Hop-by-Hop Options header, intermediate routers do not examine extension headers—they only inspect the 40-byte base header and forward at wire speed.
| Order | Next Header Code | Extension Header | Purpose |
|---|---|---|---|
| 1 | 0 | Hop-by-Hop Options | Options examined by every router along the path (e.g., Router Alert, IPv6 Jumbograms). |
| 2 | 60 | Destination Options (1st) | Options processed only by the first destination listed in the Routing Header (or final destination if no Routing Header). |
| 3 | 43 | Routing Header | Specifies intermediate nodes to visit (Type 0 deprecated for DoS risk; Type 2 used in Mobile IPv6; Segment Routing SRH Type 4). |
| 4 | 44 | Fragment Header | Allows the source host only to fragment packets exceeding Path MTU (contains 13-bit Fragment Offset, M flag, 32-bit Identification). |
| 5 | 51 | Authentication Header (AH) | IPsec header providing data origin authentication, integrity, and anti-replay protection. |
| 6 | 50 | Encapsulating Security Payload (ESP) | IPsec header providing confidentiality (encryption), integrity, and authentication. |
| 7 | 60 | Destination Options (2nd) | Options processed strictly by the final destination node. |
| 8 | 6 / 17 / 58 | Upper-Layer Header | TCP (6), UDP (17), ICMPv6 (58), or 59 (No Next Header). |
2.2 ICMPv6
Internet Control Message Protocol for IPv6 (ICMPv6), specified in RFC 4443, is identified by Next Header = 58. Unlike IPv4 where ICMP was an auxiliary diagnostic protocol separate from ARP and IGMP, ICMPv6 is a mandatory core pillar of IPv6.
2.2.1 Features
- Unified Control Plane: Consolidates IPv4's ICMPv4 (errors and echo), ARP (Layer 3-to-MAC resolution), and IGMP (multicast group membership via MLD, Multicast Listener Discovery).
- Mandatory Pseudo-Header Checksum: Every ICMPv6 message includes a mandatory checksum computed across the ICMPv6 message plus a 40-byte IPv6 pseudo-header (Source, Destination, ICMPv6 Length, Next Header = 58), protecting against misrouted packets.
- Error-Suppression Safeguards: To prevent broadcast/multicast storms, ICMPv6 error messages are never generated in response to another ICMPv6 error message, nor for packets sent to multicast/anycast-link addresses (with narrow exceptions like Packet Too Big for multicast Path MTU Discovery).
- Rate Limiting: Nodes must rate-limit outgoing ICMPv6 error messages to defend against bandwidth exhaustion and DoS amplification.
2.2.2 General message format
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Type | Code | Checksum |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| |
+ Message Body +
| (varies by Type/Code) |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+- Type (8 bits): Identifies the message class. The high-order bit divides messages cleanly into two halves:
0–127: Error messages (MSB =0).128–255: Informational messages (MSB =1).
- Code (8 bits): Specifies sub-reasons within a given Type (e.g., Code 0 = No route to destination, Code 4 = Port unreachable).
- Checksum (16 bits): Detects bit corruption across the ICMPv6 payload and the IPv6 pseudo-header.
- Message Body: For error messages, includes as much of the invoking offending packet as fits without exceeding the minimum IPv6 MTU (1280 bytes).
2.2.3 ICMP error and informational message types
| Category | Type | Name | Key Codes / Role |
|---|---|---|---|
| Error | 1 | Destination Unreachable | Code 0: No route; Code 1: Administratively prohibited (firewall); Code 3: Address unreachable; Code 4: Port unreachable |
| Error | 2 | Packet Too Big | Returned by a router when packet exceeds outgoing link MTU; carries 32-bit Next-Hop MTU for PMTUD |
| Error | 3 | Time Exceeded | Code 0: Hop Limit exceeded in transit (used by traceroute6); Code 1: Fragment reassembly time exceeded |
| Error | 4 | Parameter Problem | Code 0: Erroneous header field; Code 1: Unrecognized Next Header; Code 2: Unrecognized IPv6 option |
| Info | 128 | Echo Request | Sent by ping6 / ping to test host reachability |
| Info | 129 | Echo Reply | Response to Echo Request |
| Info | 130–132 | MLD (Listener Query/Report/Done) | Replaces IPv4 IGMP; manages IPv6 multicast group memberships |
| Info | 133–137 | Neighbor Discovery Protocol (NDP) | RS (133), RA (134), NS (135), NA (136), Redirect (137) |
2.2.4 Neighbor discovery
Neighbor Discovery Protocol (NDP, RFC 4861) uses five ICMPv6 informational messages (Types 133–137) with Hop Limit = 255 (preventing off-link spoofing, because any packet routed from elsewhere would have Hop Limit < 255).
The Five NDP Message Types (RFC 4861)
- Router Solicitation (RS, Type 133): Sent by a booting host to
ff02::2(All-Routers) asking local routers to send an RA immediately instead of waiting for the periodic broadcast timer. - Router Advertisement (RA, Type 134): Sent periodically by routers (or in reply to RS) to
ff02::1(All-Nodes). Carries the link prefix (e.g.,2001:db8:1::/64), link MTU, default gateway lifetime, andM(Managed) /O(Other) flags telling hosts whether to use SLAAC or DHCPv6. - Neighbor Solicitation (NS, Type 135): Sent to the target's Solicited-Node Multicast address (
ff02::1:ffxx:xxxx) to resolve a link-layer (MAC) address (replacing IPv4 ARP Request) or to perform Duplicate Address Detection (DAD) using source address::. - Neighbor Advertisement (NA, Type 136): Response to NS containing the target's MAC address (or unsolicited announcement if a MAC changes).
- Redirect (Type 137): Sent by a router to inform a host of a better first-hop router for a specific destination.
Core Functions Performed by NDP
- Address Resolution (Replaces ARP): Host A sends an NS to Host B's Solicited-Node Multicast (
ff02::1:ffxx:xxxx) instead of flooding every node on the Ethernet switch; only nodes sharing the last 24 bits process the frame. - Stateless Address Autoconfiguration (SLAAC, RFC 4862): Host combines the
/64prefix from an RA with a 64-bit Interface ID (EUI-64 or RFC 7217/privacy random ID) to form a complete IPv6 address without any DHCP server. - Duplicate Address Detection (DAD): Before assigning a tentative address, the host sends an NS from
::to its own tentative Solicited-Node Multicast address; if no NA returns, the address is unique. - Neighbor Unreachability Detection (NUD): Tracks whether neighbors (especially the default router) are still reachable in the Neighbor Cache (
INCOMPLETE -> REACHABLE -> STALE -> DELAY -> PROBE).
2.2.5 Path MTU discovery
In IPv4, routers fragment packets that exceed an outgoing interface's MTU. In IPv6, routers never fragment packets—only the originating source host may fragment.
Path MTU Discovery (PMTUD, RFC 8201) Mechanism
- Minimum IPv6 Link MTU: Every IPv6-capable link must support an MTU of at least 1280 bytes.
- Initial Assumption: The source host initially sends packets sized up to its own outgoing interface MTU (typically 1500 bytes on Ethernet).
- Bottleneck Detection: If a router along the path has a smaller outgoing MTU (e.g., 1300 bytes on a tunnel interface), the router drops the packet and sends an ICMPv6 Type 2 (Packet Too Big) message containing the 1300-byte Next-Hop MTU back to the source.
- Adaptation: The source updates its cached Path MTU for that destination to 1300 bytes and either reduces TCP MSS / application segment size or breaks the datagram at the source using the Fragment Extension Header (Next Header = 44).
Worked Examples
1
Given the network prefix 2001:0db8:0085:0000::/64 and a host interface with Ethernet MAC address 00:1A:2B:3C:4D:5E:
- Derive the 64-bit Interface Identifier using Modified EUI-64.
- Write the full 128-bit SLAAC Global Unicast Address and compress it to canonical RFC 5952 format.
- Compute the host's Solicited-Node Multicast Address used for DAD and Neighbor Discovery.
Deriving the Modified EUI-64 Interface Identifier:
- Split the 48-bit MAC
00:1A:2B:3C:4D:5Ein half and insertFF:FE:00:1A:2B:FF:FE:3C:4D:5E - Invert the 7th bit (Universal/Local bit) of the first byte (
0x00=0000 0000XOR0000 0010=0000 0010=0x02):02:1A:2B:FF:FE:3C:4D:5E - Format into four 16-bit lowercase hextets:
021a:2bff:fe3c:4d5e
Forming and Compressing the Full IPv6 Address:
- Combining the
/64prefix2001:0db8:0085:0000with021a:2bff:fe3c:4d5e: Uncompressed:2001:0db8:0085:0000:021a:2bff:fe3c:4d5e - Applying RFC 5952 compression (drop leading zeros in each hextet; do not use
::for a single:0:group): Compressed:2001:db8:85:0:21a:2bff:fe3c:4d5e/64
Computing the Solicited-Node Multicast Address: Solicited-Node Multicast uses the fixed 104-bit prefix ff02:0:0:0:0:1:ff00::/104 followed by the last 24 bits of the unicast address. The last 24 bits of 021a:2bff:fe3c:4d5e are 3c:4d5e, yielding: ff02:0000:0000:0000:0000:0001:ff3c:4d5e -> ff02::1:ff3c:4d5e
- Modified EUI-64 Interface ID:
021a:2bff:fe3c:4d5e - Canonical IPv6 Address (RFC 5952):
2001:db8:85:0:21a:2bff:fe3c:4d5e/64 - Solicited-Node Multicast Address:
ff02::1:ff3c:4d5e
2
An IPv6 packet carries a 1000-byte application payload inside a UDP datagram (8-byte UDP header) and uses a Fragment Extension Header (8 bytes) before the UDP header.
- Trace the Next Header field values in every header of the chain.
- Calculate the value stored in the IPv6 base header's Payload Length field and the total IPv6 packet size.
Tracing the Next Header Chain:
- IPv6 Base Header (40 bytes): Points to the Fragment Extension Header ->
Next Header = 44. - Fragment Extension Header (8 bytes): Points to the UDP header ->
Next Header = 17. - UDP Header (8 bytes) + Application Data (1000 bytes): Upper-layer transport payload (no Next Header field).
Computing Payload Length and Total Packet Size: In IPv6, Payload Length counts every byte after the 40-byte base header (including all extension headers): Payload Length = Fragment Header (8) + UDP Header (8) + Application Data (1000) = 1016 bytes Total IPv6 Packet Size = Base Header (40) + Payload Length (1016) = 1056 bytes
- Next Header Chain: IPv6 Base Header (
Next Header = 44) -> Fragment Header (Next Header = 17) -> UDP + Data. - IPv6 Payload Length: 1016 bytes; Total Packet Size: 1056 bytes.
3
A host wants to send a 3960-byte UDP datagram (UDP header + application payload) over IPv6 to a destination whose discovered Path MTU is 1300 bytes. Because intermediate routers cannot fragment IPv6 packets, the source fragments the packet using the Fragment Extension Header (8 bytes). Calculate:
- The maximum fragmentable payload bytes per fragment (must be a multiple of 8 bytes).
- The total number of IPv6 fragments generated.
- For each fragment: its payload length, Fragment Offset field value (in 8-octet units),
M(More Fragments) flag, and total IPv6 packet size.
Maximum Fragment Payload per Packet: Each fragment carries a 40-byte IPv6 base header plus an 8-byte Fragment Extension Header (40 + 8 = 48 bytes of IPv6 overhead). Available bytes for fragmentable payload within the 1300-byte Path MTU: 1300 - 48 = 1252 bytes Because the Fragment Offset field measures offsets in 8-byte units, every non-final fragment's payload must be a multiple of 8 bytes: (1252 // 8) * 8 = 156 * 8 = 1248 bytes
Number of Fragments Needed for 3960 Bytes:
- First 3 fragments each carry
1248 bytes:3 * 1248 = 3744 bytes. - Final (4th) fragment carries the remainder:
3960 - 3744 = 216 bytes.
Total fragments = 4.
Fragment-by-Fragment Header Values:
- Fragment 1: Payload =
1248 B, Offset =0 / 8 = 0,M = 1, Total packet =48 + 1248 = 1296 B - Fragment 2: Payload =
1248 B, Offset =1248 / 8 = 156,M = 1, Total packet =48 + 1248 = 1296 B - Fragment 3: Payload =
1248 B, Offset =2496 / 8 = 312,M = 1, Total packet =48 + 1248 = 1296 B - Fragment 4: Payload =
216 B, Offset =3744 / 8 = 468,M = 0, Total packet =48 + 216 = 264 B
- Max fragment payload: 1248 bytes (48 bytes overhead + 1248 bytes payload = 1296 bytes <= 1300 MTU).
- Number of fragments: 4 fragments.
- Fragment table: Frag 1 (
1248 B, Offset0,M=1,1296 B); Frag 2 (1248 B, Offset156,M=1,1296 B); Frag 3 (1248 B, Offset312,M=1,1296 B); Frag 4 (216 B, Offset468,M=0,264 B).
Exercises
Practice Exercises — Next Generation Internet Protocol & ICMPv6
Draw the IPv6 40-byte base header format, explain the function of each of its 8 fields, and state four structural changes made compared to the IPv4 header.
IPv6 Base Header Fields (8 Fields, 40 Bytes Fixed):
- Version (4 bits): Set to
6(0110). - Traffic Class (8 bits): Carries 6-bit DSCP + 2-bit ECN for QoS/congestion marking.
- Flow Label (20 bits): Identifies packets belonging to a common flow for consistent forwarding/QoS.
- Payload Length (16 bits): Size of all extension headers plus upper-layer payload in bytes.
- Next Header (8 bits): Identifies the first Extension Header or upper-layer protocol (e.g., 6 = TCP, 17 = UDP, 58 = ICMPv6).
- Hop Limit (8 bits): Decremented by 1 per router; packet dropped at 0.
- Source Address (128 bits) & Destination Address (128 bits): Origin and target addresses.
Four Structural Changes From IPv4:
- Fixed 40-byte length (removes IPv4 IHL field and inline variable-length options).
- Header Checksum removed (no per-hop checksum recalculation when Hop Limit decrements).
- Fragmentation fields moved out of the base header into the optional Fragment Extension Header (source-only fragmentation).
- 20-bit Flow Label added and Protocol generalized to Next Header chaining.
The IPv6 base header is a fixed 40-byte structure with 8 fields: Version, Traffic Class, Flow Label, Payload Length, Next Header, Hop Limit, Source Address, and Destination Address. Compared to IPv4, it fixes header length at 40 bytes, removes the per-hop header checksum, moves fragmentation to an Extension Header, and adds a 20-bit Flow Label.
Apply RFC 5952 compression rules to shorten each IPv6 address, and expand the compressed addresses back to full 32-hex-digit form:
- Compress:
fe80:0000:0000:0000:0202:b3ff:fe1e:8329 - Compress:
2001:0db8:0000:0012:0000:0000:0000:00a0 - Expand:
2001:db8:a::123 - Expand:
ff02::1:ff00:5
Compressing Addresses (Leading Zeros + Longest :: Run):
fe80:0000:0000:0000:0202:b3ff:fe1e:8329: Drop leading zeros ->fe80:0:0:0:202:b3ff:fe1e:8329; replace the three:0:0:0:groups with::->fe80::202:b3ff:fe1e:8329.2001:0db8:0000:0012:0000:0000:0000:00a0: Drop leading zeros ->2001:db8:0:12:0:0:0:a0; compress the longest run (three zeros on the right, leaving the single0intact) ->2001:db8:0:12::a0.
Expanding Addresses to 8 Full 4-Digit Hextets:
2001:db8:a::123: Four explicit hextets exist (2001,db8,a,123), so::represents8 - 4 = 4zero hextets ->2001:0db8:000a:0000:0000:0000:0000:0123.ff02::1:ff00:5: Four explicit hextets exist (ff02,1,ff00,5), so::represents8 - 4 = 4zero hextets ->ff02:0000:0000:0000:0000:0001:ff00:0005.
fe80::202:b3ff:fe1e:83292001:db8:0:12::a02001:0db8:000a:0000:0000:0000:0000:0123ff02:0000:0000:0000:0000:0001:ff00:0005
A host with Ethernet MAC address 34:17:EB:9A:BC:01 attaches to a LAN whose router advertises the prefix 2001:db8:40:10::/64 via SLAAC.
- Compute the host's Modified EUI-64 Interface ID and its resulting Global Unicast Address.
- Explain step-by-step how Duplicate Address Detection (DAD) verifies this address is unique using ICMPv6 Neighbor Discovery messages.
Modified EUI-64 Computation:
- Insert
FFFEin the middle of34:17:EB:9A:BC:01:34:17:EB:FF:FE:9A:BC:01. - Flip the 7th bit of the first byte
0x34(0011 0100XOR0000 0010=0011 0110=0x36). - Interface ID:
3617:ebff:fe9a:bc01. - Full Global Unicast Address:
2001:db8:40:10:3617:ebff:fe9a:bc01/64.
Duplicate Address Detection (DAD) Procedure:
- The host marks
2001:db8:40:10:3617:ebff:fe9a:bc01as tentative (cannot yet be used for normal traffic). - It joins the Solicited-Node Multicast group
ff02::1:ff9a:bc01. - It sends an ICMPv6 Neighbor Solicitation (Type 135) with Source Address =
::(Unspecified), Destination Address =ff02::1:ff9a:bc01, and Target Address =2001:db8:40:10:3617:ebff:fe9a:bc01. - If another host already owns that address, it replies with a Neighbor Advertisement (Type 136) to
ff02::1, and DAD fails. If no NA arrives before the timer expires, the host promotes the address to preferred.
- Interface ID:
3617:ebff:fe9a:bc01; GUA:2001:db8:40:10:3617:ebff:fe9a:bc01/64. - During DAD, the host sends an ICMPv6 NS (Type 135) from
::toff02::1:ff9a:bc01targeting its tentative address; if no NA (Type 136) is received, the address is promoted from tentative to preferred.
Explain the purpose of IPv6 Extension Headers, list the standard RFC 8200 ordering of extension headers, and distinguish between the Hop-by-Hop Options header and the Destination Options header.
Purpose and RFC 8200 Ordering of Extension Headers: Extension headers provide optional network-layer features without bloating the fixed 40-byte base header. RFC 8200 recommends placing them in this order:
- Hop-by-Hop Options (
0) - Destination Options (
60, before Routing) - Routing Header (
43) - Fragment Header (
44) - Authentication Header (
51) - Encapsulating Security Payload (
50) - Destination Options (
60, final destination) - Upper-Layer Header (
6TCP,17UDP,58ICMPv6)
Hop-by-Hop Options vs. Destination Options:
- Hop-by-Hop Options (
Next Header = 0): Placed immediately after the base header and examined by every intermediate router along the path (used for Router Alert or Jumbograms). - Destination Options (
Next Header = 60): Ignored by ordinary intermediate routers; processed only by the destination node (or by intermediate nodes listed in a Routing Header if placed before the Routing Header).
Extension headers chain optional functions via the Next Header field in RFC 8200 order: Hop-by-Hop (0), Destination Options (60), Routing (43), Fragment (44), AH (51), ESP (50), final Destination Options (60), then Upper-Layer. Hop-by-Hop Options are inspected by every router on the path, whereas Destination Options are processed only at the designated destination(s).
Describe how Path MTU Discovery (PMTUD) works in IPv6 when a sender transmits a 3000-byte UDP datagram (plus 40-byte IPv6 base header) across a path containing a link whose MTU is the IPv6 minimum (1280 bytes). Compute the size and Fragment Offset of each resulting source fragment.
How PMTUD Detects the 1280-Byte Bottleneck:
- The sender initially transmits the 3040-byte IPv6 packet.
- The router facing the 1280-byte MTU link cannot fragment the packet, so it drops it and sends an ICMPv6 Type 2 (Packet Too Big) message back to the sender reporting
Next-Hop MTU = 1280. - The sender updates its destination Path MTU cache to 1280 bytes and performs source fragmentation.
Calculating Fragment Sizes and Offsets:
- Overhead per fragment =
40 B (base header) + 8 B (Fragment header) = 48 B. - Max payload space =
1280 - 48 = 1232 bytes, which is already divisible by 8 (1232 / 8 = 154). - Splitting the 3000-byte UDP datagram:
- Fragment 1:
1232 B, Offset =0,M = 1, Total packet =1280 B. - Fragment 2:
1232 B, Offset =1232 / 8 = 154,M = 1, Total packet =1280 B. - Fragment 3:
3000 - 2464 = 536 B, Offset =2464 / 8 = 308,M = 0, Total packet =48 + 536 = 584 B.
- Fragment 1:
The bottleneck router drops the oversized packet and returns ICMPv6 Type 2 (Packet Too Big, MTU = 1280), prompting the source to fragment the 3000-byte datagram into 3 fragments: Frag 1 (1232 B, Offset 0, M=1, 1280 B), Frag 2 (1232 B, Offset 154, M=1, 1280 B), and Frag 3 (536 B, Offset 308, M=0, 584 B).