How PCs get IPv6 addresses: NDP and SLAAC

Neighbor Discovery Protocol (NDP)

IPv6 has no ARP. Its job, and more, is done by NDP, five ICMPv6 messages:

MessageSent toJob
Router Solicitation (RS)ff02::2 (all routers)A PC asks: "any routers here?"
Router Advertisement (RA)ff02::1 (all nodes) or the PCA router answers: "I'm here, the prefix is 2001:db8:acad:10::/64, use me as gateway"
Neighbor Solicitation (NS)the solicited-node group"Who has 2001:db8:acad:10::1? Tell me your MAC" (like an ARP request)
Neighbor Advertisement (NA)the asker"That's me, here's my MAC" (like an ARP reply)
Redirectthe sender"Use another router for that destination"

SLAAC: Stateless Address Autoconfiguration

  1. The PC builds its link-local address by itself (fe80:: + an interface ID).
  2. It sends an RS. The router answers with an RA holding the /64 prefix.
  3. The PC adds its own interface ID to the prefix: that's its global address. Linux uses EUI-64 from its MAC; Windows and macOS use a random interface ID for privacy.
  4. DAD (Duplicate Address Detection): before using the address, the PC sends an NS for it. If nobody answers, it's unique.
  5. The PC's default gateway is the router's link-local address, taken from the RA.

No server keeps track of who has which address: that's why it's "stateless". Here are both PCs after SLAAC:

In NetLab

▶ PC1
NetLab Windows-style command prompt. Type help to see the commands.
C:\Users\student>ipconfig

Windows IP Configuration


Ethernet adapter Ethernet:

   Connection-specific DNS Suffix  . : 
   IPv6 Address. . . . . . . . . . . : 2001:db8:acad:10:11db:99de:fbce:36d1
   Link-local IPv6 Address . . . . . : fe80::11db:99de:fbce:36d1%12
   Default Gateway . . . . . . . . . : fe80::1%12
▶ PC2
student@PC2:~$ ip -6 addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    inet6 ::1/128 scope host noprefixroute 
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    inet6 2001:db8:acad:20:21a:f2ff:fe3a:a4ee/64 scope global dynamic mngtmpaddr 
       valid_lft 2591998sec preferred_lft 604798sec
    inet6 fe80::21a:f2ff:fe3a:a4ee/64 scope link 
       valid_lft forever preferred_lft forever
student@PC2:~$ ip -6 route
2001:db8:acad:20::/64 dev eth0 proto ra metric 100 pref medium
fe80::/64 dev eth0 proto kernel metric 256 pref medium
default via fe80::1 dev eth0 proto ra metric 1024 pref medium

PC1 (Windows) has a random-looking interface ID; PC2 (Linux) has 21a:...:ff:fe.., which is EUI-64 from its MAC. Both use fe80::1, R1's link-local address, as the gateway.

The three ways to give hosts IPv6 settings

MethodAddress fromDNS server from
SLAACRA prefix + own interface IDRA (RDNSS option), if the router sends it
Stateless DHCPv6SLAACA DHCPv6 server (RA has the O flag set)
Stateful DHCPv6A DHCPv6 server, which tracks leasesThe DHCPv6 server (RA has the M flag set)

The router's neighbour table is IPv6's ARP table:

In NetLab

▶ PC1
NetLab Windows-style command prompt. Type help to see the commands.
C:\Users\student>ping 2001:db8:acad:20::1

Pinging 2001:db8:acad:20::1 with 32 bytes of data:
Reply from 2001:db8:acad:20::1: time<1ms
Reply from 2001:db8:acad:20::1: time<1ms
Reply from 2001:db8:acad:20::1: time<1ms
Reply from 2001:db8:acad:20::1: time<1ms

Ping statistics for 2001:db8:acad:20::1:
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 0ms, Maximum = 0ms, Average = 0ms
▶ R1
R1>enable
R1#show ipv6 neighbors
IPv6 Address                              Age Link-layer Addr State Interface
2001:DB8:ACAD:10:11DB:99DE:FBCE:36D1        0 001a.33d5.62b1 REACH Gi0/0

Remember: RA = prefix + gateway. SLAAC = the PC builds its own address from the RA. The gateway is the router's link-local address. All of it needs ipv6 unicast-routing on the router.

HOME LABS COMMUNITY DASHBOARD