ELEC3506

Network LayerLecture 518 min

IPv6

The 128-bit address space and 40-byte fixed header IPv4 could not simply grow into, and the two ways a network runs both protocols during the changeover.

By the end of this page you should be able to

  • State why IPv6 needed a new header format rather than just a wider address field
  • Name every field in the IPv6 base header and what it replaced from IPv4
  • Compare IPv4 and IPv6 header structure directly
  • Distinguish dual stack from tunneling as transition strategies

The idea

Module 5 opened with IPv4’s own numbers: about 4295 million addresses total. Classless addressing and NAT both slow how fast that space runs out, but neither one changes the ceiling — 32 bits is still 32 bits. IPv6’s answer is to widen the address field outright, to 128 bits.

That single change turned out not to be a small patch. Lecture 5 states this plainly: enlarging the address field forces a change to the header format itself, which is exactly why IPv6 is a new protocol version rather than IPv4 with a longer address tacked on. Alongside the bigger address space, the lecture lists what else the redesign was used to buy: support for real-time audio and video (minimal delay, reservable resources), built-in security options (encryption and authentication), automatic configuration, and better routing performance generally.

How it works

40 bytes, 8 fields, always

The IPv6 base header laid out as 32-bit words: version, traffic class and flow label; payload length, next header and hop limit; the 128-bit source address across four words; and the 128-bit destination address across four words.BITS — ONE ROW IS ONE 32-BIT WORDVersion4 bTraffic Class8 bFlow Label20 bPayload Length16 bNext Header8 bHop Limit8 bSource Address128 bSource Address128 bcont.Source Address128 bcont.Source Address128 bcont.Destination Address128 bDestination Address128 bcont.Destination Address128 bcont.Destination Address128 bcont.
Fixed at 40 bytes regardless of options — there is no header length field because there is nothing variable to measure. No checksum and no fragmentation fields either: both jobs move up to the transport layer and to path MTU discovery.
FieldWidthPurpose
Version4 bitsProtocol version number (6, for IPv6)
Priority (Traffic Class)8 bitsPriority of this packet relative to others
Flow Label20 bitsSpecial handling for one flow of data — same path, same resources
Payload Length16 bitsLength of the packet, excluding the IPv6 header itself
Next Header8 bitsNames the next extension header, or the upper-layer protocol if there is none
Hop Limit8 bitsSame function as IPv4's TTL
Source Address128 bitsSender's IPv6 address
Destination Address128 bitsReceiver's IPv6 address
Fixed at 40 bytes no matter what follows. There is no Header Length field, because there is nothing variable left in the base header to measure.

Options moved out entirely. IPv4 kept them inline, which is part of why its header length is variable. IPv6 puts them in separate extension headers instead, chained after the base header and pointed to by Next Header — which is also why IPv6 dropped IPv4’s Header Length, Identification, Flags, Fragment Offset and Checksum fields altogether. The reasoning behind that, though not something Lecture 5 spells out itself: header integrity checking is redundant once the link layer and transport layer both already check for errors, and dropping the checksum means a router no longer has to recompute it at every single hop.

AspectIPv4IPv6
Header size20 bytes minimum, variable with options40 bytes, always
Address size32 bits128 bits
OptionsInline in the base header, variable lengthIn separate extension headers
Hop counterTTL, 8 bitsHop Limit, 8 bits — same function
Next-protocol fieldProtocol onlyNext Header — extensible, chains to further headers
This is close to verbatim how the lecture itself frames the comparison — worth learning in this shape, since 'distinguish IPv4 from IPv6' is a natural exam phrasing.

Aside

The lecture names five address types — Unicast, Multicast, Anycast, Reserved and Local — and says the address space is split into a type prefix plus the rest of the address, but it does not give the specific prefix values or bit patterns for any of the five. If a question needs a concrete prefix, that number is not in this lecture — check the tutorial material before relying on one from memory.

Getting from IPv4 to IPv6

How it works

No flag day

Not every router in the world can be upgraded to IPv6 at once — there is no single moment where the whole Internet switches over, no “flag day.” For a long stretch, the network has to keep working with a mix of IPv4-only, IPv6-only and dual-stack routers all at the same time. The lecture gives two approaches for making that work:

ApproachWhat it does
Dual stackA node runs a complete IPv4 implementation alongside IPv6, and picks IPv6 when talking to an IPv6 node, IPv4 when talking to an IPv4 one
TunnelingAn IPv6 packet is carried as the payload of an ordinary IPv4 datagram, so a stretch of IPv4-only routers can forward it without understanding IPv6 at all
Dual stack needs both protocols understood at the endpoints. Tunneling needs neither protocol understood in the middle — the IPv6 packet is just opaque data to an IPv4-only router.

Where marks get lost

Dual stack and tunneling solve different problems

Dual stack is about a single node choosing which protocol to speak, depending on who it’s talking to — both ends still need to understand both protocols for it to matter. Tunneling is about crossing infrastructure that understands neither address family being used at the endpoints — the IPv4-only routers in the middle never see an IPv6 header at all, only an IPv4 one with IPv6 riding inside as payload. A question that describes “IPv6 hosts either side of an IPv4-only backbone” is describing tunneling specifically, not dual stack.

In the exam

  • 40 bytes, always. No Header Length field exists because nothing in the base header varies — memorise this as a fixed number, not “20 bytes plus options” the way IPv4 works.
  • Name what moved and where. Options went to extension headers; TTL became Hop Limit with no change in function; Protocol became Next Header and gained the extra job of chaining to further headers.
  • 8 fields, 128-bit source and destination make up 32 of the 40 bytes. The other 8 bytes hold the six smaller fields.
  • The lecture gives no extension header types or address-type prefixes. If a question needs either, it is drawing on material outside this lecture — say so rather than guessing.
  • Dual stack vs tunneling is a “distinguish between” question. Dual stack is an endpoint choosing a protocol; tunneling is intermediate routers never seeing the inner protocol at all.

Check yourself

  1. How big is the IPv6 base header?
  2. What does the NextHeader field do?
  3. TTL in IPv4 and HopLimit in IPv6 — how do they relate?
  4. An IPv6 packet must cross a stretch of network where every router only understands IPv4. Which transition strategy handles this?
  5. Why can't the Internet switch to IPv6 all at once?