Skip to content
Tutorials Center
My learning

Topics

Lesson 19 of 37 ยท Protocol Analysis

IPv6 and Neighbor Discovery

Read IPv6 captures in Wireshark: address types, the fixed header, extension headers, ICMPv6, neighbor and router discovery, SLAAC, solicited-node multicast and filters.

Modern networks run IPv6 next to, or instead of, IPv4. Even if you only manage IPv4, your computer sends IPv6 packets the moment it joins a network: router solicitations, neighbor discovery, multicast listener reports. A capture with ipv6 and icmpv6 traffic is normal, not a sign of an attack. This lesson explains what you will see and how to read it, including how IPv6 replaces ARP.

IPv6 addresses

An IPv6 address has 128 bits, written as eight groups of four hex digits, with leading zeros dropped and one run of zeros replaced by ::: 2001:0db8:0000:0000:0000:0000:0000:0001 becomes 2001:db8::1. (2001:db8::/32 is reserved for documentation, so the examples use it.)

Prefix Type Notes
::1 Loopback Like 127.0.0.1
fe80::/10 Link-local Valid only on one link; every interface has one; the zone (%eth0) selects the interface
fc00::/7 (usually fd00::/8) Unique local Private addresses, like 10.0.0.0/8
2000::/3 Global unicast Public, routable
ff00::/8 Multicast ff02::1 all nodes, ff02::2 all routers, ff02::1:ffxx:xxxx solicited-node
:: Unspecified Source address while a host has none yet

There is no broadcast in IPv6; multicast does that job, which is why IPv6 is friendlier to the CPU of uninvolved hosts.

The IPv6 header

The header is a fixed 40 bytes (IPv4's variable options are gone) with these fields: version (6), traffic class (ipv6.tclass), flow label (ipv6.flow), payload length (ipv6.plen), next header (ipv6.nxt, the IPv4 protocol field: 6 TCP, 17 UDP, 58 ICMPv6), hop limit (ipv6.hlim, the TTL) and the source and destination addresses. There is no header checksum (transport protocols check it) and routers do not fragment packets; only the sending host may fragment, using an extension header.

Extension headers sit between the main header and the payload, chained by the next-header field: hop-by-hop options (0), routing (43), fragment (44), destination options (60), ESP/AH (50/51). When you filter on ipv6.nxt == 6 you only see packets whose first next header is TCP. To find TCP regardless of extension headers use tcp itself.

Filters: ipv6, ipv6.addr == 2001:db8::1, ipv6.src, ipv6.dst, ipv6.hlim < 5, ipv6.dst == ff02::/16 (link-local multicast).

Parse and classify addresses

Python's standard ipaddress module understands IPv6 addresses, so the stand-in classifies them the way you do in a capture, and builds the header bytes of a small packet. All addresses are from documentation or link-local ranges.

Python Classify IPv6 addresses and parse a header (stand-in)

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

ICMPv6 and Neighbor Discovery

IPv6 relies on ICMPv6 (next header 58) far more than IPv4 relies on ICMP. Blocking it breaks IPv6 completely. The Neighbor Discovery Protocol (NDP) is built from five ICMPv6 message types and replaces ARP, router discovery and redirects:

Type Name Purpose
133 Router Solicitation (RS) A host asks "are there routers?" (to ff02::2)
134 Router Advertisement (RA) A router announces prefixes, gateway, MTU and flags (to ff02::1)
135 Neighbor Solicitation (NS) "Who has this IPv6 address?" (ARP request equivalent); also duplicate address detection
136 Neighbor Advertisement (NA) "It is at this MAC" (ARP reply equivalent)
137 Redirect A better first hop exists

Other common ICMPv6 types: 128/129 echo request/reply (ping), 1 destination unreachable, 2 packet too big (the IPv6 equivalent of "fragmentation needed": essential, because routers never fragment), 3 time exceeded, and 130-143 multicast listener discovery (MLD).

Neighbor Solicitations are not broadcast. They go to the solicited-node multicast address of the target: ff02::1:ff followed by the last 24 bits of the target address. Only hosts whose address ends in the same 24 bits listen, so the CPU of everyone else is untouched. The Ethernet destination is the matching multicast MAC 33:33: plus the last 32 bits of the IPv6 address.

sequenceDiagram
    participant A as Host A
    participant B as Host B (2001:db8::20)
    A->>B: NS to ff02::1:ff00:20 "who has 2001:db8::20?"
    B->>A: NA "2001:db8::20 is at 00:00:5e:00:53:20"

Neighbor discovery: a multicast question and a unicast answer, like ARP.

SLAAC and addresses

A host can build its own global address with SLAAC (stateless address autoconfiguration): it sends a Router Solicitation, a router answers with an RA containing the prefix (for example 2001:db8:1::/64) and flags, and the host appends a 64-bit interface identifier. The identifier used to be derived from the MAC address (modified EUI-64: flip the universal/local bit and insert ff:fe in the middle), which leaks the hardware address, so most systems now use random, rotating "privacy" identifiers. The RA's flags tell the host whether to also use DHCPv6 (M managed address, O other configuration). Before using an address, the host sends a Neighbor Solicitation for it from :: to check that nobody else owns it (duplicate address detection).

The stand-in computes the solicited-node multicast address, the multicast MAC and the classic EUI-64 address.

Python Solicited-node multicast and EUI-64 (stand-in)

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Filters for IPv6 work

TEXT
ipv6                                     all IPv6
icmpv6                                   all ICMPv6
icmpv6.type == 135 or icmpv6.type == 136   neighbor solicitation and advertisement
icmpv6.type == 134                       router advertisements (who is a router?)
icmpv6.type == 2                         "packet too big"
ipv6.addr == 2001:db8::1                 one host
ipv6.dst == ff02::1:ff00:0/104           solicited-node multicast
dhcpv6                                   DHCPv6 (UDP 546/547)
ipv6.fragment                            fragments (sent by hosts only)

Two security notes for defenders: a rogue Router Advertisement (an unexpected icmpv6.type == 134 from a host that is not your router) can redirect all IPv6 traffic, so many switches offer RA Guard; and IPv6 is often forgotten in firewall rules, so check that traffic you thought was blocked is not flowing over IPv6.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. Which IPv6 mechanism replaces ARP?

    NS and NA, carried by ICMPv6, resolve IPv6 addresses to MAC addresses.
  2. 2. Why does IPv6 have no broadcast?

    IPv6 uses multicast (for example ff02::1 for all nodes), which reduces load on uninvolved hosts.
  3. 3. Which ICMPv6 message is essential because IPv6 routers do not fragment packets?

    Hosts learn the path MTU from Packet Too Big messages, so blocking them breaks large transfers.
  4. 4. An unexpected Router Advertisement appears from an ordinary workstation. What is the concern?

    Hosts trust RAs on the link, so a rogue sender can change gateways and prefixes.

Summary

  • IPv6 addresses are 128 bits; link-local fe80::, unique local fd00:: and global 2000::/3 are the main unicast kinds; there is no broadcast.
  • The IPv6 header is a fixed 40 bytes with a hop limit; routers do not fragment, so Packet Too Big matters.
  • ICMPv6 carries Neighbor Discovery (NS, NA, RS, RA), which replaces ARP and router discovery.
  • NS goes to the solicited-node multicast address; SLAAC builds addresses from RA prefixes and an interface identifier.
  • Watch for unexpected RAs, and do not forget IPv6 in your firewall and capture filters.

Next: A Packet-Level Troubleshooting Workflow