DHCPv6 vs SLAAC: What the M and O Flags Do, Packet by Packet
This walkthrough uses captures from the late Nick Russo's free packet-capture library, preserved by the Internet Archive. Three are in the Network Services archive, netsrv_pcap.zip, under netsrv_pcap/dhcp/: dhcp_v6_flags_m.pcapng, dhcp_v6_flags_o.pcapng, and dhcp_v6_flags_mo.pcapng. The baseline is in the ICMP archive, icmp_pcap.zip, as icmp_pcap/ipv6/nd_rsra.pcapng. The rest of the library is listed on his job aid page. We decoded the captures with VisualEther, which turns a Wireshark PCAP into a sequence diagram with a plain-English caption on every message.
An IPv6 host can get its address in two ways. With SLAAC (Stateless Address Autoconfiguration), the host builds its own address from a prefix the router announces. With DHCPv6, a server hands the address out and keeps a record of it, much as DHCP does for IPv4. Two bits in the router's Router Advertisement, the M and O flags, tell hosts which to use: M says "get your address from DHCPv6", and O says "get other settings, such as DNS servers, from DHCPv6".
Whichever method supplies the address, the Router Advertisement always supplies the default gateway and the on-link prefix. DHCPv6 has no option for either.
This article follows the same client, a Cisco router named R4, through three captures in which only the flags change, plus a two-frame baseline from another lab:
- M=0, O=0, the baseline. Pure SLAAC; the router offers no DHCPv6 at all.
- M=0, O=1. SLAAC for the address, and stateless DHCPv6 for the DNS servers.
- M=1, O=0. Stateful DHCPv6: the server assigns the address too.
- M=1, O=1. The same as M alone, packet for packet.
Each of the three main captures is drawn as an annotated sequence diagram. Each participant gets a lane, each message is an arrow numbered as in Wireshark, and each carries a caption saying what it does. Every diagram comes as an interactive viewer, an HTML page, and a printable PDF. In the viewer and the HTML page, clicking any message opens its full Wireshark field tree.
💡 Read the walkthrough and a diagram side by side: open the interactive diagram in a split-screen window, or open the HTML version in a new tab and snap the two windows side by side. Each section below links its own diagram.
What is the difference between DHCPv6 and SLAAC?
SLAAC lets a host make its own address: it takes the 64-bit prefix from a Router Advertisement and appends a 64-bit interface identifier it chooses itself (RFC 4862 section 5.5.3). No server is involved, and nothing records which host has which address. DHCPv6 (RFC 8415) has a server assign the address and keep a lease for it, which gives the network operator a record of who holds what.
Both are needed in practice, because each piece of a host's configuration has its own source:
| Setting | SLAAC network | Stateful DHCPv6 network |
|---|---|---|
| Address | Host builds it from the RA prefix | DHCPv6 server assigns it (IA_NA) |
| On-link prefix and length | RA prefix option, L flag | RA prefix option, L flag |
| Default gateway | RA source, if router lifetime > 0 | RA source, if router lifetime > 0 |
| DNS servers | Stateless DHCPv6 (O flag) or RA RDNSS option | DHCPv6 reply |
A few terms used throughout:
- Router Advertisement (RA). An ICMPv6 message a router multicasts to all nodes (
ff02::1), periodically and in reply to a Router Solicitation (RS). It is part of Neighbor Discovery (RFC 4861). Neighbor Discovery messages always carry hop limit 255, and receivers drop any with another value, so they can't come from off the link. - IA_NA (Identity Association for Non-temporary Addresses). The DHCPv6 container in which a client asks for an address and a server returns one with its lifetimes and renewal timers.
- DAD (Duplicate Address Detection). Before using a new address, a host asks whether anyone else already has it, by sending a Neighbor Solicitation from the unspecified address
::.
DHCPv6 clients send to ff02::1:2, the multicast group that every DHCPv6 relay agent and server joins. Clients use UDP port 546, and servers and relays use 547 (RFC 8415 section 7).
What do the M and O flags in a Router Advertisement mean?
The M (Managed address configuration) flag means addresses are available from DHCPv6. The O (Other configuration) flag means other configuration, such as DNS servers, is available from DHCPv6. RFC 4861 section 4.2 defines both, and adds: "If the M flag is set, the O flag is redundant and can be ignored because DHCPv6 will return all available configuration information."
A third flag decides whether SLAAC is allowed. It lives not in the RA header but in each Prefix Information option: the A (autonomous) flag. A host forms a SLAAC address from a prefix only when A is set (RFC 4862 section 5.5.3). The prefix's L (on-link) flag says that addresses in the prefix are reachable directly on this link, without going through a router.
| M | O | Prefix A | What the router is saying |
|---|---|---|---|
| 0 | 0 | 1 | SLAAC only. No DHCPv6. |
| 0 | 1 | 1 | SLAAC for addresses, DHCPv6 for other settings (stateless DHCPv6). |
| 1 | 0 or 1 | 0 | DHCPv6 for addresses and settings; no SLAAC. |
| 1 | 0 or 1 | 1 | DHCPv6 is available, and SLAAC is allowed too. A host may end up with both addresses. |
The flags are advice, not commands. RFC 4862 dropped the text that told hosts how to act on them (its appendix C), so what a host does with M and O is up to its implementation and configuration. Captures 1 and 3 show that.
All three main captures carry the same RA apart from the flags: prefix fc00:10:2:4::/64 with A and L set, a 30-day valid lifetime, a 7-day preferred lifetime, and a router lifetime of 1800 s. So SLAAC is allowed in all three. What the client does next is up to it.
Baseline: M=0, O=0, pure SLAAC
The two-frame baseline comes from a different lab, with the prefix fc00:10:1:4::/64. R4 (fe80::4) sends a Router Solicitation, and R1 (fe80::1) answers 0.66 ms later.
This RA's options are a source link-layer address, an MTU of 1500, and the prefix. There is no RDNSS option and no hint to use DHCPv6. A host on this link gets an address and a default route, but nothing tells it a DNS server. Here the RA was sent unicast to fe80::4; RFC 4861 section 6.2.6 allows that, though the usual reply is a multicast to all nodes, as in the other captures.
Capture 1: the M flag, stateful DHCPv6
In all three captures, R4 is the client and R2 (fe80::2) is both the router sending RAs and the DHCPv6 server. This one has 19 frames over 3.8 seconds. The RA has M set and O clear.
What does each message do?
Frame 1: Router Solicitation. R4 asks for an RA from its link-local address fe80::a8bb:ccff:fe00:420. That address is EUI-64: the MAC aa:bb:cc:00:04:20 with ff:fe in the middle and one bit flipped (aa becomes a8).
Frame 2: Solicit. 0.45 s later R4 multicasts a DHCPv6 Solicit. It carries an IA_NA, asking for an address, and an Option Request option asking for options 23 (DNS servers) and 24 (domain search list), both defined in RFC 3646. RFC 8415 section 18.2.1 says a client should delay its first Solicit by a random 0 to 1 s, so that many hosts powering up together don't transmit at once.
Frame 3: Advertise. R2 answers in 0.42 ms with an offer: the address fc00:10:2:4:9939:4fb3:359b:162a, renewal timer T1 of 43200 s and rebinding timer T2 of 69120 s, the DNS servers 2001:4860:4860::8888 and ::8844, and the search domain njrusmc.net. T1 and T2 are 0.5 and 0.8 of the address's 86400 s preferred lifetime, the values RFC 8415 section 21.4 recommends. The interface identifier is random-looking because the server chose it; RFC 8415 section 13.1 leaves the choice to the server's policy and advises against predictable addresses.
Frame 4: Request. R4 asks for the offered address, with a new transaction ID, still by multicast. It names R2 by the Server Identifier from the Advertise, so any other server that hears the Request knows it lost.
Frame 5: Router Advertisement. Now the RA arrives: M set, O clear, router lifetime 1800 s, prefix fc00:10:2:4::/64 with A and L set.
Frame 6: Reply. R2 commits the lease, 0.56 ms after the RA: 86400 s preferred, 172800 s valid, with the same DNS servers. From the RS to a committed lease took 1.55 s.
Frame 7: DAD. 11.9 ms after the Reply, R4 checks that the new address is unique. It sends a Neighbor Solicitation from :: to the address's solicited-node multicast group, ff02::1:ff9b:162a, built from the address's last 24 bits. Nobody answers, so the address is R4's. RFC 8415 section 18.2.10.1 requires DAD on DHCPv6 addresses, just as RFC 4862 section 5.4 does for SLAAC.
Frames 8 to 19: ping. R4 pings fc00::2, an address on R2, five times. The first reply takes 20.3 ms because R2 must first resolve R4's new address with a Neighbor Solicitation (frames 9 and 10); the rest take 0.30 ms or less.
Here is the RA from frame 5 as Wireshark decodes it. Open the flags and the Prefix Information option to see M, O, L, and A:
frame : Frame 5: Packet, 118 bytes on wire (944 bits), 118 bytes captured (944 bits) on interface -, id 0
Interface id : 0 (-)
eth : Ethernet II, Src: aa:bb:cc:00:02:20, Dst: 33:33:00:00:00:01
Destination : 33:33:00:00:00:01
Source : aa:bb:cc:00:02:20
ipv6 : Internet Protocol Version 6, Src: fe80::2, Dst: ff02::1
.... 1110 0000 .... .... .... .... .... = Traffic Class : 0xe0 (DSCP: CS7, ECN: Not-ECT)
Source Address : fe80::2
Special-Purpose Allocation : Link-Local Unicast
Source or Destination Address : fe80::2
Special-Purpose Allocation : Link-Local Unicast
Destination Address : ff02::1
.... .... 0000 .... = Multicast Flags : 0x0
Source or Destination Address : ff02::1
.... .... 0000 .... = Multicast Flags : 0x0
icmpv6 : Internet Control Message Protocol v6
Flags : 0x80, Managed address configuration, Prf (Default Router Preference): Medium
ICMPv6 Option (Source link-layer address : aa:bb:cc:00:02:20)
ICMPv6 Option (MTU : 1500)
ICMPv6 Option (Prefix information : fc00:10:2:4::/64)
Flag : 0xc0, On-link Flag (L), Autonomous Address Configuration Flag (A)
Did the M flag trigger the DHCPv6 exchange?
No. R4 sent its Solicit at 0.45 s and had its offer at 0.45 s, more than a second before the capture's only RA, at 1.55 s. R4 started DHCPv6 because it was configured to, most likely with Cisco IOS's ipv6 address dhcp, not because of the M flag. The RA only confirmed what the client was already doing.
This matters when you debug. A host that never sends a Solicit may be ignoring M, and a host that sends one may not need M at all. Check the client's configuration as well as the router's flags.
R4 is a router acting as a client: every Neighbor Advertisement it sends has the Router flag set. A PC or phone may treat the flags differently.
Why does the client wait a second before sending Request?
The Advertise arrives 0.42 ms after the Solicit, but the Request follows 1.10 s later. The wait is required. RFC 8415 section 18.2.1 says a client must collect Advertise messages until its first retransmission timeout (just over 1 s) has passed, in case a better server answers. Only an Advertise with preference 255 ends the wait early, and R2's Advertise carries no Preference option at all. Capture 3 shows the same pause.
Did the client also form a SLAAC address?
There is no sign of one, although the RA's A flag allowed it. No DAD probe goes out for the EUI-64 address fc00:10:2:4:a8bb:ccff:fe00:420, and every ping uses the DHCPv6 address. On Cisco IOS, SLAAC needs a separate ipv6 address autoconfig. Many host operating systems would form both addresses on this link.
Capture 2: the O flag, stateless DHCPv6
This capture has 16 frames over 12.4 seconds. The RA has M clear and O set.
What is stateless DHCPv6?
Stateless DHCPv6 gives a host configuration settings but no address, so the server keeps no per-client state. The host takes its address from SLAAC and asks DHCPv6 only for the rest, with a two-message exchange: Information-request and Reply (RFC 8415 sections 6.1 and 18.2.6). It used to have its own RFC, 3736, which RFC 8415 replaced.
Frame 1: Router Advertisement. M clear, O set, and the same prefix with A set. The capture starts here; any RS before it isn't in the file.
Frame 2: Information-request. 1.10 s later R4 asks for three options and carries no IA_NA, because it wants no address:
- 23, DNS recursive name servers.
- 24, domain search list.
- 32, Information Refresh Time: how long the client may use these settings before asking again. Wireshark shows it under its old name,
Lifetime.
RFC 8415 section 18.2.6 requires a random 0 to 1 s delay before a first Information-request, which fits the 1.10 s gap after the RA.
Here is the Information-request as Wireshark decodes it:
frame : Frame 2: Packet, 96 bytes on wire (768 bits), 96 bytes captured (768 bits) on interface -, id 0
Interface id : 0 (-)
eth : Ethernet II, Src: aa:bb:cc:00:04:20, Dst: 33:33:00:01:00:02
Destination : 33:33:00:01:00:02
Source : aa:bb:cc:00:04:20
ipv6 : Internet Protocol Version 6, Src: fe80::a8bb:ccff:fe00:420, Dst: ff02::1:2
.... 1110 0000 .... .... .... .... .... = Traffic Class : 0xe0 (DSCP: CS7, ECN: Not-ECT)
Source Address : fe80::a8bb:ccff:fe00:420
Special-Purpose Allocation : Link-Local Unicast
Source or Destination Address : fe80::a8bb:ccff:fe00:420
Special-Purpose Allocation : Link-Local Unicast
Destination Address : ff02::1:2
.... .... 0000 .... = Multicast Flags : 0x0
Source or Destination Address : ff02::1:2
.... .... 0000 .... = Multicast Flags : 0x0
udp : User Datagram Protocol, Src Port: 546, Dst Port: 547
Timestamps
dhcpv6 : DHCPv6
Elapsed time
Client Identifier
Option Request
Frame 3: Reply. R2 answers in 0.30 ms with the DNS servers and the search domain, but no Information Refresh Time. RFC 8415 section 21.23 covers that case: the client then uses the default of 86400 s, so R4 will ask again in a day. Unlike the stateful exchange, nothing here is leased, renewed, or released.
Frame 4: R4 announces its address. 0.45 s after the Reply, R4 multicasts an unsolicited Neighbor Advertisement for fc00:10:2:4:a8bb:ccff:fe00:420, the RA prefix plus its EUI-64 interface identifier. That is SLAAC. The Solicited flag is clear, as RFC 4861 section 7.2.6 requires for an unsolicited advertisement.
Frames 5 to 16: ping. R4 pings fc00::2 from its SLAAC address. R2 still sends a Neighbor Solicitation for that address before replying: the unsolicited advertisement didn't create a cache entry, because a node that has no entry for the target discards it (RFC 4861 section 7.2.5). The first reply takes 19.2 ms; the rest take about 0.1 to 0.2 ms.
Where is the DAD probe?
This capture has none. RFC 4862 section 5.4 requires DAD on every new unicast address unless it is turned off, so R4 should have sent a Neighbor Solicitation from :: for its SLAAC address. The capture may have missed it, or R4 may have skipped it; the trace can't tell. Capture 3 is also missing a probe for its DHCPv6 address, while capture 1 shows one. When you debug DAD itself, capture on the client's own port, from before the interface comes up.
Capture 3: both M and O set
This capture has 18 frames over 27.4 seconds. This time R2 answers the RS in 0.34 ms, so the RA comes first and the DHCPv6 exchange follows.
What happens when both M and O are set?
Nothing different from M alone. Compare the two captures message by message:
- The Solicits carry the same options and request the same codes, 23 and 24. Setting O added nothing to the request.
- The Advertise and Reply carry the same options: Server and Client Identifier, IA_NA, DNS servers, and search list.
- The lease has the same lifetimes and timers: 86400 s preferred, 172800 s valid, T1 43200 s, T2 69120 s.
Only the address differs (...c559:9256:f326:e8e9 this time), because the server picks a new one for each lease.
That is what RFC 4861 section 4.2 means by calling O redundant when M is set: a stateful exchange returns all the settings anyway. It also shows who decides what the client gets. A DHCPv6 server answers the client's Option Request with whatever it is configured to return (RFC 8415 section 18.3.9). The server ignores the flags, which only tell clients which exchange to run.
Again there is no sign of a SLAAC address, and again R4 waits just over a second (1.05 s) between Advertise and Request. The pings, 25.9 s after the Reply, come from the DHCPv6 address.
The three captures side by side
Where each piece of R4's configuration came from, under each flag setting:
| RA flags | Address from | DNS servers from | Default router from | DHCPv6 messages | RA to first ping |
|---|---|---|---|---|---|
| M=0, O=0 (baseline, other lab) | SLAAC | Nowhere: no DHCPv6, no RDNSS | RA (fe80::1) | None | Capture ends at the RA |
| M=0, O=1 (capture 2) | SLAAC, EUI-64 | Stateless DHCPv6 | RA (fe80::2) | Information-request, Reply | 12.35 s |
| M=1, O=0 (capture 1) | DHCPv6 IA_NA | DHCPv6, because the client asked | RA (fe80::2) | Solicit, Advertise, Request, Reply | 2.22 s (DHCPv6 began before the RA) |
| M=1, O=1 (capture 3) | DHCPv6 IA_NA | DHCPv6 | RA (fe80::2) | Solicit, Advertise, Request, Reply | 27.40 s |
The first-ping times mostly measure when someone typed ping, not how fast configuration finished. The protocol timings are short: from the RS to a committed DHCPv6 lease took 1.55 s in capture 1 and 1.48 s in capture 3, most of it the random start delay and the one-second wait for Advertises. In capture 2 the stateless DHCPv6 Reply arrived 1.10 s after the RA.
In every capture, the first ping reply took about 20 ms (19.2 to 21.6 ms) and the rest under half a millisecond. The difference is R2 resolving R4's new address with a Neighbor Solicitation before it can answer.
Why doesn't DHCPv6 give a default gateway?
Because in IPv6 the routers announce themselves. Any router sending an RA with a nonzero router lifetime becomes a default router candidate for that long (RFC 4861 section 4.2), so a separate DHCPv6 option was never defined. RFC 8415 has no default-router option.
DHCPv6 gives no prefix length either. The IA Address option carries an address and its two lifetimes, nothing else, and RFC 8415 section 21.6 forbids the client from assuming any prefix length but /128 from it. Only an RA prefix with the L flag makes a prefix on-link. RFC 5942 section 4 says it plainly: assigning an address, by SLAAC, by DHCPv6, or by hand, doesn't by itself make its prefix on-link.
So a DHCPv6-only network still needs RAs. Without them a host holds an address but has no route off the link and doesn't even know which other addresses share its link.
How does a host get DNS servers in IPv6?
There are two ways, and a network can offer both:
- DHCPv6, with options 23 (DNS servers) and 24 (search list) from RFC 3646. A client gets them in a stateful exchange, or in a stateless one when only O is set. All three captures here use DHCPv6.
- The RA itself, with the RDNSS (Recursive DNS Server, type 25) and DNSSL (DNS Search List, type 31) options from RFC 8106. This needs no DHCPv6 at all. None of these captures' RAs carries them.
The baseline shows the gap between the two: with M and O clear and no RDNSS option, a host gets an address and a route but no resolver. Once it has one, our DNS walkthrough shows what the resolver does with a query.
Which method a host supports varies. Android, for example, has long relied on SLAAC and RDNSS and shipped without a DHCPv6 client for addresses, so on a DHCPv6-only network an Android phone may get no address at all. Offering RDNSS beside DHCPv6 covers more clients.
Troubleshooting: why did a host get no address, route, or DNS server?
Capture the client's port from before its interface comes up, then check these in order:
- No default route? Look for an RA with a nonzero router lifetime. DHCPv6 can't fix this.
- No global address? Check the RA's prefix option: A set for SLAAC, and a /64 prefix (RFC 4862 needs prefix plus interface identifier to total 128 bits). For DHCPv6, look for a Solicit; if there is none, the client isn't running DHCPv6, whatever M says.
- Solicit but no Advertise? The server or relay isn't on the path. A server on another subnet needs a relay agent on the client's link, listening on
ff02::1:2. - An address, but no DNS? Check whether the client asked for option 23 and whether the Reply contains it, or whether the RA carries RDNSS.
- An address that never comes up? Look for a DAD probe from
::; a Neighbor Advertisement answering it means the address is a duplicate.
On Cisco IOS, the router side is ipv6 nd managed-config-flag (M) and ipv6 nd other-config-flag (O), and the client side is ipv6 address dhcp or ipv6 address autoconfig. The IPv4 side of DHCP, including relay agents and lease renewal, is in How DHCP Works, Packet by Packet.
Frequently asked questions
Can a host have both a SLAAC and a DHCPv6 address? Yes. When M is set and the prefix's A flag is set too, the router allows both. These captures' client used only DHCPv6, but many hosts would form both.
Does the M flag turn off SLAAC? No. Only clearing the A flag in the prefix option stops SLAAC for that prefix.
What is the difference between stateful and stateless DHCPv6? Stateful DHCPv6 assigns addresses (IA_NA) with a four-message exchange, and the server keeps a lease per client. Stateless DHCPv6 gives only settings such as DNS servers, with two messages, and keeps no state.
Why do DHCPv6 addresses look random? The server chooses the interface identifier. RFC 8415 section 13.1 advises servers against predictable addresses. A SLAAC address on many modern hosts looks random too, from RFC 7217 stable identifiers or RFC 8981 temporary addresses, while these Cisco clients use the older MAC-based EUI-64 form.
Which ports and addresses does DHCPv6 use? Clients send from UDP port 546 to ff02::1:2, port 547. In these captures the server replies by unicast to the client's link-local address.
Is DHCPv6 the same protocol as DHCP for IPv4? No. It does the same job with different messages: Solicit, Advertise, Request, and Reply instead of Discover, Offer, Request, and ACK. It also never assigns a gateway or subnet mask. RFC 8415 defines it, replacing RFC 3315, RFC 3736, and five other RFCs.
Takeaways
- M and O say where to get configuration; A says whether SLAAC is allowed. M means addresses from DHCPv6, O means other settings from DHCPv6, and the prefix's A flag allows SLAAC independently of both.
- The default gateway and on-link prefix always come from the RA. DHCPv6 has no option for either, so every IPv6 network needs RAs.
- O adds nothing when M is set. Captures 1 and 3 are identical in every DHCPv6 option. The server answers the client's Option Request, not the flags.
- The flags are hints. Capture 1's client started DHCPv6 before it saw any RA and ignored the A flag. Check the client's configuration, not just the router's.
- Stateless DHCPv6 is two messages. Information-request and Reply, with no IA_NA and no lease.
- DNS can come from DHCPv6 or from the RA's RDNSS option. With neither, a host has an address and a route but no resolver.