RFC 8415
Dynamic Host Configuration Protocol for IPv6 (DHCPv6)
Dynamic Host Configuration Protocol for IPv6 (DHCPv6) โจ
okay bestie, this is RFC 8415 ๐ and it's the big DHCPv6 glow-up ๐
- Number: RFC 8415
- Category: Standards Track
- Date: November 2018
- ISSN: 2070-1721
- Obsoletes: RFC 3315, RFC 3633, RFC 3736, RFC 4242, RFC 7083, RFC 7283, RFC 7550
- Authors: T. Mrugalski, M. Siodelski, and B. Volz (ISC); A. Yourtchenko (Cisco); M. Richardson (SSW); S. Jiang (Huawei); T. Lemon (Nibbhaya Consulting); T. Winters (UNH-IOL) ๐
Abstract
so DHCPv6 is the Dynamic Host Configuration Protocol for IPv6 ๐ธ and it's basically an extensible way to configure nodes with network configuration parameters, IP addresses, and prefixes โจ The parameters can be handed out statelessly, or together with stateful assignment of one or more IPv6 addresses and/or IPv6 prefixes ๐ DHCPv6 can work either in place of or in addition to stateless address autoconfiguration (SLAAC) ๐ฆ
this document updates the text from RFC 3315 (the original DHCPv6 specification) and rolls in a bunch of other stuff ๐ง it brings in prefix delegation (RFC 3633), stateless DHCPv6 (RFC 3736), an option to set an upper bound on how long a client should wait before refreshing information (RFC 4242), a way to throttle DHCPv6 clients when DHCPv6 service isn't available (RFC 7083), and relay agent handling of unknown messages (RFC 7283) ๐ on top of that, it clears up how the models of operation interact with each other (RFC 7550) ๐
so yeah, this document obsoletes RFC 3315, RFC 3633, RFC 3736, RFC 4242, RFC 7083, RFC 7283, and RFC 7550. it's giving full replacement energy ๐๐
Status of This Memo
this is an Internet Standards Track document ๐ฅ
this document is a product of the Internet Engineering Task Force (IETF) ๐ it represents the consensus of the IETF community ๐ซถ it got public review and was approved for publication by the Internet Engineering Steering Group (IESG) ๐ if you want more on Internet Standards, check out Section 2 of RFC 7841 ๐ง
info about the current status of this document, any errata, and how to send feedback is at https://www.rfc-editor.org/info/rfc8415 ๐ฆ
Copyright Notice
Copyright (c) 2018 IETF Trust and the persons identified as the document authors. All rights reserved. ๐
this document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (https://trustee.ietf.org/license-info) as they stand on the date this document was published ๐ please read these carefully, bestie, because they describe your rights and restrictions for this document ๐ code components pulled out of this document must include Simplified BSD License text as described in Section 4.e of the Trust Legal Provisions, and they're provided without warranty as described in the Simplified BSD License ๐
this document may contain material from IETF Documents or IETF Contributions published or made publicly available before November 10, 2008. the person(s) controlling the copyright in some of that material may not have granted the IETF Trust the right to allow modifications of it outside the IETF Standards Process ๐ญ without an adequate license from the person(s) controlling the copyright in those materials, this document may not be modified outside the IETF Standards Process, and derivative works of it may not be created outside the IETF Standards Process. the only exceptions are formatting it for publication as an RFC or translating it into languages other than English ๐ธ
part 1 of 34 done, bestie! more parts are coming ๐๐
Table of Contents ๐บ๏ธ
okay bestie, this is the whole map of the spec, so let's see where everything lives ๐ Every section, subsection, and appendix is here in order, with the page numbers. Keep it handy, because the text refers to these numbers constantly โจ
Table of Contents
1. Introduction ....................................................6
1.1. Relationship to Previous DHCPv6 Standards ..................7
1.2. Relationship to DHCPv4 .....................................8
2. Requirements ....................................................8
3. Background ......................................................8
4. Terminology .....................................................9
4.1. IPv6 Terminology ...........................................9
4.2. DHCP Terminology ..........................................11
5. Client/Server Exchanges ........................................16
5.1. Client/Server Exchanges Involving Two Messages ............16
5.2. Client/Server Exchanges Involving Four Messages ...........17
5.3. Server/Client Exchanges ...................................18
6. Operational Models .............................................18
6.1. Stateless DHCP ............................................18
6.2. DHCP for Non-temporary Address Assignment .................19
6.3. DHCP for Prefix Delegation ................................19
6.4. DHCP for Customer Edge Routers ............................22
6.5. DHCP for Temporary Addresses ..............................22
6.6. Multiple Addresses and Prefixes ...........................22
7. DHCP Constants .................................................23
7.1. Multicast Addresses .......................................23
7.2. UDP Ports .................................................24
7.3. DHCP Message Types ........................................24
7.4. DHCP Option Codes .........................................26
7.5. Status Codes ..............................................26
7.6. Transmission and Retransmission Parameters ................27
7.7. Representation of Time Values and "Infinity" as a
Time Value ................................................28
8. Client/Server Message Formats ..................................29
9. Relay Agent/Server Message Formats .............................30
9.1. Relay-forward Message .....................................31
9.2. Relay-reply Message .......................................31
10. Representation and Use of Domain Names ........................32
11. DHCP Unique Identifier (DUID) .................................32
11.1. DUID Contents ............................................33
11.2. DUID Based on Link-Layer Address Plus Time (DUID-LLT) ....33
11.3. DUID Assigned by Vendor Based on Enterprise
Number (DUID-EN) .........................................35
11.4. DUID Based on Link-Layer Address (DUID-LL) ...............36
11.5. DUID Based on Universally Unique Identifier (DUID-UUID) ..37
12. Identity Association ..........................................37
12.1. Identity Associations for Address Assignment .............38
12.2. Identity Associations for Prefix Delegation ..............38
13. Assignment to an IA ...........................................39
13.1. Selecting Addresses for Assignment to an IA_NA ...........39
13.2. Assignment of Temporary Addresses ........................40
13.3. Assignment of Prefixes for IA_PD .........................41
14. Transmission of Messages by a Client ..........................41
14.1. Rate Limiting ............................................41
14.2. Client Behavior when T1 and/or T2 Are 0 ..................42
15. Reliability of Client-Initiated Message Exchanges .............43
16. Message Validation ............................................45
16.1. Use of Transaction IDs ...................................45
16.2. Solicit Message ..........................................46
16.3. Advertise Message ........................................46
16.4. Request Message ..........................................46
16.5. Confirm Message ..........................................47
16.6. Renew Message ............................................47
16.7. Rebind Message ...........................................47
16.8. Decline Message ..........................................47
16.9. Release Message ..........................................48
16.10. Reply Message ...........................................48
16.11. Reconfigure Message .....................................48
16.12. Information-request Message .............................49
16.13. Relay-forward Message ...................................49
16.14. Relay-reply Message .....................................49
17. Client Source Address and Interface Selection .................49
17.1. Source Address and Interface Selection for
Address Assignment .......................................49
17.2. Source Address and Interface Selection for Prefix
Delegation ...............................................50
18. DHCP Configuration Exchanges ..................................50
18.1. A Single Exchange for Multiple IA Options ................53
18.2. Client Behavior ..........................................53
18.2.1. Creation and Transmission of Solicit Messages .....55
18.2.2. Creation and Transmission of Request Messages .....57
18.2.3. Creation and Transmission of Confirm Messages .....59
18.2.4. Creation and Transmission of Renew Messages .......60
18.2.5. Creation and Transmission of Rebind Messages ......62
18.2.6. Creation and Transmission of
Information-request Messages ......................63
18.2.7. Creation and Transmission of Release Messages .....64
18.2.8. Creation and Transmission of Decline Messages .....65
18.2.9. Receipt of Advertise Messages .....................67
18.2.10. Receipt of Reply Messages ........................68
18.2.10.1. Reply for Solicit (with Rapid
Commit), Request, Renew, or Rebind ......69
18.2.10.2. Reply for Release and Decline ...........72
18.2.10.3. Reply for Confirm .......................72
18.2.10.4. Reply for Information-request ...........72
18.2.11. Receipt of Reconfigure Messages ..................72
18.2.12. Refreshing Configuration Information .............73
18.3. Server Behavior ..........................................74
18.3.1. Receipt of Solicit Messages .......................75
18.3.2. Receipt of Request Messages .......................77
18.3.3. Receipt of Confirm Messages .......................79
18.3.4. Receipt of Renew Messages .........................79
18.3.5. Receipt of Rebind Messages ........................81
18.3.6. Receipt of Information-request Messages ...........83
18.3.7. Receipt of Release Messages .......................84
18.3.8. Receipt of Decline Messages .......................85
18.3.9. Creation of Advertise Messages ....................85
18.3.10. Transmission of Advertise and Reply Messages .....87
18.3.11. Creation and Transmission of Reconfigure
Messages .........................................87
18.4. Reception of Unicast Messages ............................88
19. Relay Agent Behavior ..........................................89
19.1. Relaying a Client Message or a Relay-forward Message .....89
19.1.1. Relaying a Message from a Client ..................90
19.1.2. Relaying a Message from a Relay Agent .............90
19.1.3. Relay Agent Behavior with Prefix Delegation .......91
19.2. Relaying a Relay-reply Message ...........................91
19.3. Construction of Relay-reply Messages .....................91
19.4. Interaction between Relay Agents and Servers .............92
20. Authentication of DHCP Messages ...............................93
20.1. Security of Messages Sent between Servers and
Relay Agents .............................................94
20.2. Summary of DHCP Authentication ...........................94
20.3. Replay Detection .........................................94
20.4. Reconfiguration Key Authentication Protocol (RKAP) .......95
20.4.1. Use of the Authentication Option in RKAP ..........96
20.4.2. Server Considerations for RKAP ....................96
20.4.3. Client Considerations for RKAP ....................97
21. DHCP Options ..................................................97
21.1. Format of DHCP Options ...................................98
21.2. Client Identifier Option .................................99
21.3. Server Identifier Option .................................99
21.4. Identity Association for Non-temporary Addresses
Option ..................................................100
21.5. Identity Association for Temporary Addresses Option .....102
21.6. IA Address Option .......................................104
21.7. Option Request Option ...................................106
21.8. Preference Option .......................................108
21.9. Elapsed Time Option .....................................108
21.10. Relay Message Option ...................................109
21.11. Authentication Option ..................................110
21.12. Server Unicast Option ..................................111
21.13. Status Code Option .....................................112
21.14. Rapid Commit Option ....................................114
21.15. User Class Option ......................................115
21.16. Vendor Class Option ....................................116
21.17. Vendor-specific Information Option .....................117
21.18. Interface-Id Option ....................................119
21.19. Reconfigure Message Option .............................121
21.20. Reconfigure Accept Option ..............................121
21.21. Identity Association for Prefix Delegation Option ......122
21.22. IA Prefix Option .......................................124
21.23. Information Refresh Time Option ........................126
21.24. SOL_MAX_RT Option ......................................127
21.25. INF_MAX_RT Option ......................................128
22. Security Considerations ......................................130
23. Privacy Considerations .......................................133
24. IANA Considerations ..........................................133
25. Obsoleted Mechanisms .........................................138
26. References ...................................................139
26.1. Normative References ....................................139
26.2. Informative References ..................................140
Appendix A. Summary of Changes ...................................146
Appendix B. Appearance of Options in Message Types ...............149
Appendix C. Appearance of Options in the "options" Field of DHCP
Options ..............................................151
Acknowledgments ..................................................152
Authors' Addresses ...............................................153
Okay, that's the full roadmap! Next up we get into the actual meat, so stay tuned ๐ฆ๐
1. Introduction โจ
okay bestie, so this doc is all about DHCP for IPv6 (DHCPv6) ๐. It's a client/server protocol that handles managed configuration of devices. The basic version gives configuration to clients on the same link as the server, and there's also a relay agent feature so clients and servers that aren't on the same link can still talk ๐ฆ.
DHCPv6 can hand a device addresses from a DHCPv6 server, plus other configuration info. All that data rides along in options ๐. And the best part? You can make new options to carry config stuff this doc doesn't cover. Iconic extensibility ๐ .
DHCPv6 also does automated prefix delegation, which was first specified in [RFC3633]. A delegating router can hand out prefixes to routers that ask for them. You'll find this mechanism used in [RFC7084] and by [TR-187] ๐ธ.
Then there's "stateless DHCPv6", which is when DHCP only gives out other config options (no addresses or prefixes). Since the server doesn't have to track any state, it's way lighter than stateful DHCPv6. ngl that's lowkey genius ๐ง. [RFC3736] was written to document just the bits needed for stateless operation.
The rest of this intro gives you the lay of the land: how this doc relates to older DHCPv6 standards (see Section 1.1) and where it stands on DHCPv4 (see Section 1.2). Section 5 walks through message exchanges to show how DHCP works, not every possible interaction, and Section 6 covers common operational models. Section 18 is where client and server behaviour gets explained in full ๐.
1.1. Relationship to Previous DHCPv6 Standards
The first DHCPv6 spec was [RFC3315], and a bunch of follow-up docs came out over the years:
- [RFC3633] ("IPv6 Prefix Options for Dynamic Host Configuration Protocol (DHCP) version 6")
- [RFC3736] ("Stateless Dynamic Host Configuration Protocol (DHCP) Service for IPv6")
- [RFC4242] ("Information Refresh Time Option for Dynamic Host Configuration Protocol for IPv6 (DHCPv6)")
- [RFC7083] ("Modification to Default Values of SOL_MAX_RT and INF_MAX_RT")
- [RFC7283] ("Handling Unknown DHCPv6 Messages")
- [RFC7550] ("Issues and Recommendations with Multiple Stateful DHCPv6 Options")
This document is the unified, corrected, and cleaned-up version of DHCPv6 ๐. It also rolls in every applicable erratum filed against the older RFCs (check the list in Appendix A). So it obsoletes the RFCs in the list above ๐ซถ. A small number of mechanisms got obsoleted too, so peek at Section 25 and Appendix A for those.
1.2. Relationship to DHCPv4
The operational models and config info for DHCPv4 [RFC2131] [RFC2132] and DHCPv6 are different enough that this doc doesn't include integration between the two ๐. [RFC3315] suggested that future work could extend DHCPv6 to carry IPv4 address and config info. But the current IETF consensus is that DHCPv4 should be used rather than DHCPv6 for conveying IPv4 config to nodes. For IPv6-only networks, [RFC7341] describes a transport mechanism that carries DHCPv4 messages over the DHCPv6 protocol to dynamically provision IPv4 addresses and config ๐.
Merging DHCPv4 and DHCPv6 config is out of scope here ๐ โโ๏ธ. [RFC4477] talks through some issues and possible strategies for running both services together. It's a little dated, but it's still a solid overview of the drama ๐.
2. Requirements
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in BCP 14 [RFC2119] [RFC8174] when, and only when, they appear in all capitals, as shown here โจ. Lowercase versions don't count, so no sneaky vibes.
This doc also uses internal conceptual variables to describe protocol behaviour, plus external variables that an implementation must let system administrators change ๐. The variable names, how their values change, and how their settings affect behaviour are all there to show how the protocol acts. An implementation is not required to have them in the exact form described here, as long as its external behaviour matches what this document describes ๐ .
3. Background
[RFC8200] ("Internet Protocol, Version 6 (IPv6) Specification") gives the base architecture and design of IPv6 ๐ธ. Alongside [RFC8200], the IPv6 work an implementer should really study includes:
- [RFC4291] ("IP Version 6 Addressing Architecture")
- [RFC4862] ("IPv6 Stateless Address Autoconfiguration")
- [RFC4861] ("Neighbor Discovery for IP version 6 (IPv6)")
These specs let DHCP build on the IPv6 work to provide robust stateful autoconfiguration ๐ง.
[RFC4291] defines the address scopes you can use in an IPv6 implementation, and it also has architecture guidelines for network designers working with the IPv6 address space ๐บ๏ธ. Two IPv6 perks are that multicast support is required and nodes can create link-local addresses during initialization ๐ฆ. Because of that, a client can use its link-local address and a well-known multicast address to find and talk to DHCP servers or relay agents on its link. Main character energy ๐.
[RFC4862] covers how a node may autoconfigure addresses based on Router Advertisements [RFC4861], and it uses a valid lifetime to support renumbering of addresses across the Internet ๐. Compatibility with stateless address autoconfiguration is a design requirement of DHCP, so DHCP has to play nice with it ๐ซถ.
IPv6 Neighbor Discovery [RFC4861] is the node discovery protocol in IPv6, and it replaces and improves on functions of ARP [RFC826] ๐ฅ. To get IPv6 and stateless address autoconfiguration, it's strongly recommended that implementers understand IPv6 Neighbor Discovery. Honestly, it's a must-read vibe ๐.
4. Terminology
This section defines the IPv6 and DHCP terms used in this document ๐.
4.1. IPv6 Terminology
IPv6 terminology from [RFC8200], [RFC4291], and [RFC4862] that's relevant to this spec is included below ๐.
address An IP-layer identifier for an interface or
a set of interfaces.
GUA Global unicast address (see [RFC4291]).
host Any node that is not a router.
IP Internet Protocol Version 6 (IPv6). The
terms "IPv4" and "IPv6" are used only in
contexts where it is necessary to avoid
ambiguity.
interface A node's attachment to a link.
link A communication facility or medium over
which nodes can communicate at the link
layer, i.e., the layer immediately below
IP. Examples are Ethernet (simple or
bridged); Point-to-Point Protocol (PPP) and
PPP over Ethernet (PPPoE) links; and
Internet-layer (or higher) "tunnels", such
as tunnels over IPv4 or IPv6 itself.
link-layer identifier A link-layer identifier for an interface --
for example, IEEE 802 addresses for
Ethernet or Token Ring network interfaces.
link-local address An IPv6 address having a link-only scope,
indicated by having the prefix (fe80::/10),
that can be used to reach neighboring nodes
attached to the same link. Every IPv6
interface on which DHCPv6 can reasonably be
useful has a link-local address.
multicast address An identifier for a set of interfaces
(typically belonging to different nodes).
A packet sent to a multicast address is
delivered to all interfaces identified by
that address.
neighbor A node attached to the same link.
node A device that implements IP.
packet An IP header plus payload.
prefix The initial bits of an address, or a set
of IP addresses that share the same
initial bits.
prefix length The number of bits in a prefix.
router A node that forwards IP packets not
explicitly addressed to itself.
ULA Unique local address (see [RFC4193]).
unicast address An identifier for a single interface. A
packet sent to a unicast address is
delivered to the interface identified by
that address.
4.2. DHCP Terminology
Terminology specific to DHCP is below ๐ง.
appropriate to the link An address is "appropriate to the link"
when the address is consistent with the
DHCP server's knowledge of the network
topology, prefix assignment, and address
assignment policies.
binding A binding (or client binding) is a group of
server data records containing the
information the server has about the
addresses or delegated prefixes in an
Identity Association (IA) or configuration
information explicitly assigned to the
client. Configuration information that has
been returned to a client through a policy,
such as the information returned to all
clients on the same link, does not require
a binding. A binding containing
information about an IA is indexed by the
tuple <DUID, IA-type, IAID> (where IA-type
is the type of lease in the IA -- for
example, temporary). A binding containing
configuration information for a client is
indexed by <DUID>. See below for
definitions of DUID, IA, and IAID.
configuration parameter An element of the configuration information
set on the server and delivered to the
client using DHCP. Such parameters may be
used to carry information to be used by a
node to configure its network subsystem and
enable communication on a link or
internetwork, for example.
Okay the binding stuff is the big one, so re-read it if it feels like a lot ๐๐
- container option ๐: An option that wraps other options inside it. For example, the IA_NA option (see Section 21.4) may contain IA Address options (see Section 21.6). Main container energy ๐
- delegating router ๐: The router that acts as a DHCP server and answers requests for delegated prefixes. This document mostly says "DHCP server" or "server" when it's talking about the "delegating router" side of prefix delegation (see Section 1).
- DHCP ๐ธ: Dynamic Host Configuration Protocol for IPv6. "DHCPv4" and "DHCPv6" only show up when we need to avoid mixing them up ๐
- DHCP client ๐ฆ, also called "client": A node that starts requests on a link to get configuration parameters from one or more DHCP servers. It may act as a requesting router (see below) if it supports prefix delegation.
- DHCP domain ๐ฐ: A set of links managed by DHCP and run by a single administrative entity.
- DHCP relay agent ๐ง, also called "relay agent": A node that acts as the middle-person for delivering DHCP messages between clients and servers. In some setups there may be more than one relay agent between clients and servers, so a relay agent may send DHCP messages to another relay agent.
- DHCP server ๐, also called "server": A node that responds to requests from clients. It may or may not be on the same link as the client(s). Depending on its capabilities, if it supports prefix delegation it may also feature the functionality of a delegating router.
- DUID ๐ชช: A DHCP Unique Identifier for a DHCP participant. Each DHCP client and server has exactly one DUID. See Section 11 for details of the ways a DUID may be constructed.
- encapsulated option ๐ซง: A DHCP option that is usually only contained in another option. For example, the IA Address option is contained in IA_NA or IA_TA options (see Section 21.5). See Section 9 of [RFC7227] for a more complete definition.
- IA ๐งธ: Identity Association: a collection of leases assigned to a client. Each IA has an associated IAID (see below). A client may have more than one IA assigned to it -- for example, one for each of its interfaces. Each IA holds one type of lease. For example, an identity association for temporary addresses (IA_TA) holds temporary addresses, and an identity association for prefix delegation (IA_PD) holds delegated prefixes. Throughout this document, "IA" is used to refer to an identity association without identifying the type of lease in the IA. At the time of writing this document, there are three IA types defined: IA_NA, IA_TA, and IA_PD. New IA types may be defined in the future.
- IA option(s) ๐: At the time of writing this document, one or more IA_NA, IA_TA, and/or IA_PD options. New IA types may be defined in the future.
- IAID ๐ท๏ธ: Identity Association Identifier: an identifier for an IA, chosen by the client. Each IA has an IAID, which is chosen to be unique among IAIDs for IAs of a specific type that belong to that client.
- IA_NA ๐ : Identity Association for Non-temporary Addresses: an IA that carries assigned addresses that are not temporary addresses (see "IA_TA"). See Section 21.4 for details on the IA_NA option.
- IA_PD ๐บ๏ธ: Identity Association for Prefix Delegation: an IA that carries delegated prefixes. See Section 21.21 for details on the IA_PD option.
- IA_TA ๐: Identity Association for Temporary Addresses: an IA that carries temporary addresses (see [RFC4941]). See Section 21.5 for details on the IA_TA option.
- lease ๐: A contract where the server grants the client the use of an address or delegated prefix for a specified period of time.
- message ๐ฆ: A unit of data carried as the payload of a UDP datagram, passed around among DHCP servers, relay agents, and clients.
- Reconfigure key ๐: A key supplied to a client by a server. It's used to provide security for Reconfigure messages (see Section 7.3 for the list of available message types).
- relaying ๐จ: A DHCP relay agent relays DHCP messages between DHCP participants.
- requesting router ๐ฃ๏ธ: The router that acts as a DHCP client and requests prefix(es) to be assigned. This document mostly uses "DHCP client" or "client" when it's talking about the "requesting router" side of prefix delegation (see Section 1).
- retransmission ๐: Another attempt to send the same DHCP message by a client or server, because no valid response came back to the previously sent messages. The retransmitted message is typically modified before sending, as required by the DHCP specifications. In particular, the client updates the value of the Elapsed Time option in the retransmitted message.
- RKAP ๐: The Reconfiguration Key Authentication Protocol (see Section 20.4).
- singleton option 1๏ธโฃ: An option that is allowed to appear only once, either as a top-level option or at any encapsulation level. Most options are singletons.
- T1 โฐ: The time interval after which the client is expected to contact the server that did the assignment to extend (renew) the lifetimes of the addresses assigned (via IA_NA option(s)) and/or prefixes delegated (via IA_PD option(s)) to the client. T1 is expressed as an absolute value in messages (in seconds), is conveyed within IA containers (currently the IA_NA and IA_PD options), and is interpreted as a time interval since the packet's reception. The value stored in the T1 field in IA options is referred to as the T1 value. The actual time when the timer expires is referred to as the T1 time.
- T2 โ: The time interval after which the client is expected to contact any available server to extend (rebind) the lifetimes of the addresses assigned (via IA_NA option(s)) and/or prefixes delegated (via IA_PD option(s)) to the client. T2 is expressed as an absolute value in messages (in seconds), is conveyed within IA containers (currently the IA_NA and IA_PD options), and is interpreted as a time interval since the packet's reception. The value stored in the T2 field in IA options is referred to as the T2 value. The actual time when the timer expires is referred to as the T2 time.
- top-level option ๐: An option conveyed in a DHCP message directly, i.e., not encapsulated in any other option, as described in Section 9 of [RFC7227].
- transaction ID ๐งพ: An opaque value used to match responses with replies initiated by either a client or a server.
5. Client/Server Exchanges โจ
Okay so, clients and servers swap DHCP messages using UDP (see [RFC768] and BCP 145 [RFC8085]) ๐ The client uses a link-local address, or addresses figured out through other mechanisms, for sending and receiving DHCP messages.
A DHCP client sends most messages to a reserved, link-scoped multicast destination address ๐ฃ That way the client doesn't need to be configured with the address or addresses of any DHCP servers. Iconic, right? ๐ซถ
To let a DHCP client message a DHCP server that isn't attached to the same link, a DHCP relay agent on the client's link relays messages between the client and server. The relay agent works totally behind the scenes, so the client never notices ๐ฅท The rest of this section skips over the relaying of messages by relay agents, so we can focus on the message exchanges ๐
Once the client has figured out a server's address, it may, in some situations, send messages straight to the server using unicast ๐ฏ
5.1. Client/Server Exchanges Involving Two Messages โจ
okay so, if a DHCP client doesn't need a DHCP server to hand it IP addresses or delegated prefixes, it can still grab other config info, like a list of DNS servers [RFC3646] or NTP servers [RFC5908], with just one message and reply exchange ๐
. To get that other config info, the client first sends an Information-request message to the All_DHCP_Relay_Agents_and_Servers multicast address. Servers respond with a Reply message that carries the other config info for the client. ๐ซถ
A client can also ask the server to speed things up by doing a two-message exchange instead of the usual four-message one (more on that in the next section) ๐๏ธ. The client can request expedited assignment, but servers may or may not honor the request (see Sections 18.3.1 and 21.14 for more details and why servers may not honor this request). Clients might ask for this fast lane when there's probably only one server on the link with no expectation that a second one will show up, or when getting configured as fast as possible is the top priority.
To request the expedited two-message exchange, the client sends a Solicit message to the All_DHCP_Relay_Agents_and_Servers multicast address asking for addresses and/or delegated prefixes plus other config info. This message includes an indication (the Rapid Commit option; see Section 21.14) that the client is willing to accept an immediate Reply message from the server ๐ฅ. The server that's willing to commit the assignment of addresses and/or delegated prefixes to the client right away responds with a Reply message. The config info and the addresses and/or delegated prefixes in that Reply are then immediately ready for the client to use โจ.
Each address or delegated prefix assigned to the client has preferred and valid lifetimes set by the server. To extend those lifetimes, the client sends a Renew message to the server. The server sends a Reply with the new lifetimes, so the client keeps using the address or delegated prefix without any interruption ๐. If the server can't extend the lifetime of an address or delegated prefix, it says so by returning that address or delegated prefix with lifetimes of 0. At the same time, the server may assign other addresses or delegated prefixes ๐.
See Section 18 for descriptions of additional two-message exchanges between the client and server ๐ฆ.
5.2. Client/Server Exchanges Involving Four Messages
To request the assignment of one or more addresses and/or delegated prefixes, a client first finds a DHCP server and then asks that server for the addresses and/or delegated prefixes plus other configuration info ๐. The client sends a Solicit message to the All_DHCP_Relay_Agents_and_Servers multicast address to find available DHCP servers. Any server that can meet the client's requirements responds with an Advertise message. The client then picks one of the servers and sends a Request message asking for confirmed assignment of addresses and/or delegated prefixes and other configuration info. The server responds with a Reply message that contains the confirmed addresses, delegated prefixes, and configuration ๐.
As described in the previous section, the client can request an extension of the lifetimes assigned to addresses or delegated prefixes (this is a two-message exchange) ๐ซถ.
5.3. Server/Client Exchanges
A server that has previously communicated with a client and negotiated for the client to listen for Reconfigure messages may send the client a Reconfigure message. That tells the client to update its configuration by sending an Information-request, Renew, or Rebind message. The client then performs the two-message exchange described earlier. This can be used to expedite configuration changes to a client, like when a network needs to be renumbered (see [RFC6879]) ๐.
6. Operational Models โจ
This section walks through some of the most common DHCP operational models ๐. The described models aren't mutually exclusive, and they're sometimes used together. For example, a device might start in stateful mode to obtain an address and then, later on when an application starts, request additional parameters using stateless mode ๐ง.
This document assumes that the DHCP servers and the client, communicating with the servers via a specific interface, belong to a single provisioning domain ๐ธ.
DHCP may be extended to support additional stateful services that may interact with one or more of the models described below. Such interaction should be considered and documented as part of any future protocol extension ๐.
6.1. Stateless DHCP
Stateless DHCP [RFC3736] is used when DHCP isn't being used to obtain a lease, but a node (DHCP client) still wants one or more DHCP "other configuration" parameters, like a list of DNS recursive name servers or DNS domain search lists [RFC3646] ๐. Stateless DHCP may be used when a node initially boots, or at any time the software on the node requires some missing or expired configuration information that's available via DHCP โญ.
This is the simplest and most basic operation for DHCP, and it requires a client (and a server) to support only two messages -- Information-request and Reply ๐ฆ. Note that DHCP servers and relay agents typically also need to support the Relay-forward and Relay-reply messages to accommodate operation when clients and servers are not on the same link ๐.
6.2. DHCP for Non-temporary Address Assignment
This model of operation was the original motivation for DHCP ๐. It's appropriate for situations where stateless address autoconfiguration alone is insufficient or impractical, e.g., because of network policy, additional requirements such as dynamic updates to the DNS, or client-specific requirements ๐ .
The model of operation for non-temporary address assignment goes like this. The server is provided with prefixes from which it may allocate addresses to clients, as well as any related network topology information about which prefixes are present on which links ๐บ๏ธ. A client requests a non-temporary address to be assigned by the server. The server allocates an address or addresses appropriate for the link the client is connected to. Then the server returns the allocated address or addresses to the client ๐.
Each address has associated preferred and valid lifetimes, which together form an agreement about how long the client is allowed to use the address โณ. A client can request an extension of the lifetimes on an address, and it is required to terminate the use of an address if the valid lifetime of the address expires. That's a hard rule, bestie ๐.
Typically, clients request other configuration parameters, such as the DNS name server addresses and domain search lists, when they request addresses ๐.
Clients can also request more than one address or set of addresses (see Sections 6.6 and 12) โจ.
6.3. DHCP for Prefix Delegation ๐
okay so prefix delegation ๐ฆ is the other stateful mode, and it's originally from [RFC3633]. The whole point is simple delegation of prefixes from a delegating router (the DHCP server) to requesting routers (the DHCP clients). It's a great fit when the delegating router (1) doesn't know anything about the topology of the networks the requesting router is attached to, and (2) doesn't need anything beyond the requesting router's identity to pick a prefix. ISPs use this to hand a prefix to a subscriber, and that prefix can get subnetted and assigned to links inside the subscriber's network. [RFC7084] and [RFC7368] go into detail on this use case ๐
The design of this prefix delegation mechanism meets the requirements for prefix delegation in [RFC3769]. Literally on-brand ๐
Now, [RFC3633] assumes the DHCP client is a router (that's where "requesting router" comes from) and the DHCP server is a router (hence "delegating router"). But prefix delegation itself doesn't require the client to forward IP packets that aren't addressed to itself. So the client (or the server) doesn't have to be a router as defined in [RFC8200] ๐ Also, in lots of cases, like tethering or hosting virtual machines, hosts are already forwarding IP packets and act as routers as defined in [RFC8200] anyway. So this document mostly swaps "requesting router" for "client" and "delegating router" for "server" โจ
The model of operation goes like this. A server gets provisioned with prefixes to hand out to clients. A client requests prefix(es) from the server, as described in Section 18. The server picks the prefix(es) for delegation and responds with them. From there, the client is responsible for the delegated prefix(es). For example, the client might assign a subnet from a delegated prefix to one of its interfaces and start sending Router Advertisements for that prefix on that link ๐ง
Each prefix has a preferred lifetime and a valid lifetime. Together they make up an agreement about how long the client is allowed to use the prefix ๐ซถ A client can ask for an extension of the lifetimes on a delegated prefix, and it is required to stop using a delegated prefix once the valid lifetime of that prefix expires. No cap, that's the rule ๐ญ
Here's Figure 1, which shows a network where prefix delegation could be used:
______________________ \
/ \ \
| ISP core network | \
\__________ ___________/ |
| |
+-------+-------+ |
| Aggregation | | ISP
| device | | network
| (delegating | |
| router) | |
+-------+-------+ |
| /
|Network link to /
|subscriber premises /
|
+------+------+ \
| CPE | \
| (requesting | \
| router) | |
+----+---+----+ |
| | | Subscriber
---+-------------+-----+ +-----+------ | network
| | | |
+----+-----+ +-----+----+ +----+-----+ |
|Subscriber| |Subscriber| |Subscriber| /
| PC | | PC | | PC | /
+----------+ +----------+ +----------+ /
Figure 1: Prefix Delegation Network
In this example, the server (delegating router) is set up with a bunch of prefixes to assign to customers when they first connect to the ISP service ๐ The prefix delegation process kicks off when the client (requesting router) asks for configuration info through DHCP. Those DHCP messages get received by the server in the aggregation device. When the server gets the request, it selects an available prefix or prefixes for delegation to the client, and then sends them back ๐
Next, the client subnets the delegated prefix and assigns the longer prefixes to links in the subscriber's network. In a typical setup based on Figure 1, the client subnets a single delegated /48 prefix into /64 prefixes and gives one /64 prefix to each link in the subscriber network ๐ธ
The prefix delegation options can be used together with other DHCP options that carry other config info to the client โจ
The client may also provide DHCP service to nodes on the internal network, and that's giving main character energy ๐ For example, the client may grab the addresses of DNS and NTP servers from the ISP server, then pass that config on to the subscriber hosts through a DHCP server running in the client (requesting router) ๐ซถ
If the client uses a delegated prefix to configure addresses on its own interfaces or on other nodes behind it, the preferred and valid lifetimes of those addresses MUST be no longer than the remaining preferred and valid lifetimes, respectively, for the delegated prefix at any time. In particular, if the delegated prefix or a prefix derived from it is advertised for stateless address autoconfiguration [RFC4862], the advertised preferred and valid lifetimes MUST NOT exceed the corresponding remaining lifetimes of the delegated prefix. ๐
6.4. DHCP for Customer Edge Routers ๐
The DHCP requirements and network architecture for Customer Edge Routers are described in [RFC7084]. This model of operation combines address assignment (see Section 6.2) and prefix delegation (see Section 6.3). Generally speaking, this model assumes that a single set of transactions between the client and server will assign or extend the client's non-temporary addresses and delegated prefixes. So efficient, it's iconic ๐
6.5. DHCP for Temporary Addresses ๐ฆ
Temporary addresses were originally introduced to avoid privacy concerns with stateless address autoconfiguration, which based 64 bits of the address on the EUI-64 (see [RFC4941]. They were added to DHCP to give complementary support when stateful address assignment is used ๐
Temporary address assignment works mostly the same way as non-temporary address assignment (see Section 6.2). The difference is that these addresses are generally meant to be used for a short period of time, and they aren't meant to have their lifetimes extended, though they can be if required โจ
6.6. Multiple Addresses and Prefixes ๐
DHCP lets a client receive multiple addresses. During typical operation, a client sends one instance of an IA_NA option, and the server assigns at most one address from each prefix assigned to the link the client is attached to. The server can also be configured to serve addresses out of multiple prefixes for a given link, which is useful when a network renumbering event is in progress ๐ฅ In a typical deployment, the server grants one address for each IA_NA option (see Section 21.4).
A client can explicitly ask for multiple addresses by sending multiple IA_NA options (and/or IA_TA options; see Section 21.5). It can send multiple IA_NA (and/or IA_TA) options in its initial transmissions. Or it can send an extra Request message carrying additional new IA_NA (and/or IA_TA) options, or include them in a Renew message ๐ง
The same principle applies to prefix delegation too. In principle, DHCP lets a client request new prefixes to be delegated by sending additional IA_PD options (see Section 21.21). But a typical operator usually prefers to delegate a single, larger prefix. In most deployments, it is recommended that the client request a larger prefix in its initial transmissions rather than asking for additional prefixes later on ๐
Whether the server grants additional addresses and prefixes is up to the server policy and is out of scope for this document ๐คทโโ๏ธ
For more info on how the server tells IA option instances apart, see Section 12 ๐ซถ
7. DHCP Constants ๐
This section describes various program and networking constants used by DHCP โจ
7.1. Multicast Addresses ๐ฆ
DHCP uses the following multicast addresses ๐
All_DHCP_Relay_Agents_and_Servers (ff02::1:2)A link-scoped multicast address used by a client to talk to neighboring (i.e., on-link) relay agents and servers. All servers and relay agents are members of this multicast group ๐งAll_DHCP_Servers (ff05::1:3)A site-scoped multicast address used by a relay agent to talk to servers, either because the relay agent wants to send messages to all servers or because it doesn't know the unicast addresses of the servers. Heads up: for a relay agent to use this address, it must have an address of sufficient scope to be reachable by the servers. All servers within the site are members of this multicast group on the interfaces that are within the site ๐ฅ
7.2. UDP Ports ๐ธ
Clients listen for DHCP messages on UDP port 546. Servers and relay agents listen for DHCP messages on UDP port 547 ๐
7.3. DHCP Message Types โจ
okay so DHCP has a whole cast of message types ๐
The formats for these live in Sections 8 and 9. New message types have already been defined and more may show up later, so check <https://www.iana.org/assignments/dhcpv6-parameters> for the latest list. Each type's numeric code is in parentheses.
SOLICIT (1): a client sends this to go hunting for servers ๐ADVERTISE (2): a server sends this to say "hey, I'm available for DHCP service!" and it replies to a Solicit from a client ๐โโ๏ธREQUEST (3): a client sends this to ask a specific server for config parameters, including addresses and/or delegated prefixes ๐CONFIRM (4): a client sends this to any available server to check whether the addresses it got are still right for the link it's on ๐งRENEW (5): a client sends this to the server that originally gave it leases and config. It extends the lease lifetimes and updates other config params ๐REBIND (6): a client sends this to any available server to extend its leases and update config. It only goes out after the client gets no response to a Renew ๐ฌREPLY (7): this one is the server's all-purpose response ๐. It sends Reply messages with assigned leases and config in response to a Solicit, Request, Renew, or Rebind. It sends config params in response to an Information-request. It also answers a Confirm by confirming or denying that the client's addresses fit the link. And it acknowledges a Release or Decline ๐ซถRELEASE (8): a client sends this to the server that assigned its leases, to say it's done with one or more of them ๐DECLINE (9): a client sends this to a server to report that one or more of the addresses it was given are already in use on the link ๐จRECONFIGURE (10): a server sends this to a client to say its config params are new or updated. The client then starts a Renew/Reply, Rebind/Reply, or Information-request/Reply transaction with the server to grab the updated info โจINFORMATION-REQUEST (11): a client sends this to a server to ask for config parameters without getting any leases assigned ๐งRELAY-FORW (12): a relay agent sends this to pass messages along to servers, either directly or through another relay agent ๐. The message it's passing, whether that's a client message or a Relay-forward from another relay agent, gets wrapped up as an option inside the Relay-forward message ๐RELAY-REPL (13): a server sends this to a relay agent with a message the relay delivers to a client ๐ซ. Other relay agents may pass the Relay-reply along until it reaches the destination relay agent ๐ค๏ธ
The server wraps the client message up as an option in the Relay-reply, and the relay agent unwraps it and relays it to the client. Iconic teamwork ๐ค
7.4. DHCP Option Codes ๐งฉ
DHCP uses options in its messages all the time ๐. Some are defined later, in Section 21. Others are defined in other documents, and more may be defined in the future. If you're writing a new option definition, [RFC7227] has the guidance you need ๐.
7.5. Status Codes ๐ฆ
DHCP uses status codes to show whether a requested operation in a client or server message worked out ๐. They also explain exactly why something failed when it didn't. The specific status codes are defined in Section 21.13 ๐ .
If the Status Code option (see Section 21.13) doesn't show up in a message where it could have appeared, the message's status is assumed to be Success โ . No news is good news, bestie ๐ฅฐ.
7.6. Transmission and Retransmission Parameters ๐๏ธ
This section has a table of values that describe how clients and servers send their messages ๐ค. Some of these values get adjusted by a randomization factor and backoffs (see Section 15). Rate limiting can also change how often things get transmitted (see Section 14.1) ๐ฅ.
+-----------------+------------------+------------------------------+
| Parameter | Default | Description |
+-----------------+------------------+------------------------------+
| SOL_MAX_DELAY | 1 sec | Max delay of first Solicit |
| | | |
| SOL_TIMEOUT | 1 sec | Initial Solicit timeout |
| | | |
| SOL_MAX_RT | 3600 secs | Max Solicit timeout value |
| | | |
| REQ_TIMEOUT | 1 sec | Initial Request timeout |
| | | |
| REQ_MAX_RT | 30 secs | Max Request timeout value |
| | | |
| REQ_MAX_RC | 10 | Max Request retry attempts |
| | | |
| CNF_MAX_DELAY | 1 sec | Max delay of first Confirm |
| | | |
| CNF_TIMEOUT | 1 sec | Initial Confirm timeout |
| | | |
| CNF_MAX_RT | 4 secs | Max Confirm timeout |
| | | |
| CNF_MAX_RD | 10 secs | Max Confirm duration |
| | | |
| REN_TIMEOUT | 10 secs | Initial Renew timeout |
| | | |
| REN_MAX_RT | 600 secs | Max Renew timeout value |
| | | |
| REB_TIMEOUT | 10 secs | Initial Rebind timeout |
| | | |
| REB_MAX_RT | 600 secs | Max Rebind timeout value |
| | | |
| INF_MAX_DELAY | 1 sec | Max delay of first |
| | | Information-request |
| | | |
| INF_TIMEOUT | 1 sec | Initial Information-request |
| | | timeout |
| | | |
| INF_MAX_RT | 3600 secs | Max Information-request |
| | | timeout value |
| | | |
| REL_TIMEOUT | 1 sec | Initial Release timeout |
| | | |
| REL_MAX_RC | 4 | Max Release retry attempts |
| | | |
| DEC_TIMEOUT | 1 sec | Initial Decline timeout |
| | | |
| DEC_MAX_RC | 4 | Max Decline retry attempts |
| | | |
| REC_TIMEOUT | 2 secs | Initial Reconfigure timeout |
| | | |
| REC_MAX_RC | 8 | Max Reconfigure attempts |
| | | |
| HOP_COUNT_LIMIT | 8 | Max hop count in a |
| | | Relay-forward message |
| | | |
| IRT_DEFAULT | 86400 secs (24 | Default information refresh |
| | hours) | time |
| | | |
| IRT_MINIMUM | 600 secs | Min information refresh time |
| | | |
| MAX_WAIT_TIME | 60 secs | Max required time to wait |
| | | for a response |
+-----------------+------------------+------------------------------+
Table 1: Transmission and Retransmission Parameters
7.7. Representation of Time Values and "Infinity" as a Time Value ๐ฆ
Okay so bestie, time values in DHCP are a whole vibe. โจ Every time value for lifetimes, T1, and T2 is an unsigned 32-bit integer, and the unit is seconds. โฐ The value 0xffffffff is the special "infinity" value when it's used as a lifetime (same idea as in [RFC4861]) or as a value for T1 or T2. ๐
Setting the valid lifetime of an address or a delegated prefix to 0xffffffff ("infinity") basically means a permanent assignment of that address or delegation to a client. ๐ So this should only be used when permanent assignments are actually what you want. ๐ซถ
Be careful with T1 or T2 set to 0xffffffff ("infinity") ๐ญ. A client will never try to extend the lifetimes of any addresses in an IA with T1 set to 0xffffffff. A client will also never use a Rebind message to go find a different server to extend the lifetimes of any addresses in an IA with T2 set to 0xffffffff. ๐
8. Client/Server Message Formats ๐
All DHCP messages sent between clients and servers share the same fixed-format header, plus a variable-format area for options. ๐
All values in the message header and in options are in network byte order. ๐ข
Options are stored one after another in the "options" field, with no padding between them. ๐งฉ They're byte-aligned, but that's it. They are not aligned in any other way, like on 2-byte or 4-byte boundaries. ๐
Here's the layout of DHCP messages sent between clients and servers, bestie ๐:
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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| msg-type | transaction-id |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| |
. options .
. (variable number and length) .
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Figure 2: Client/Server Message Format
msg-type ๐ธ Identifies the DHCP message type. The available message types are listed in Section 7.3. It's a 1-octet field.
transaction-id ๐ The transaction ID for this message exchange. It's a 3-octet field.
options ๐ Options carried in this message. Options are described in Section 21. It's a variable-length field (4 octets less than the size of the message).
9. Relay Agent/Server Message Formats ๐ง
Relay agents are the matchmakers ๐ that pass messages back and forth between relay agents and servers, so that clients and servers that aren't on the same link can still talk to each other. ๐ฆ
All values in the message header and in options are in network byte order. ๐ข
Options are stored one after another in the "options" field, with no padding between them. Options are byte-aligned, but not aligned in any other way (like on 2-byte or 4-byte boundaries). ๐งฉ
There are two relay agent messages, Relay-forward and Relay-reply, and they share the same 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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| msg-type | hop-count | |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| |
| link-address |
| |
| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-|
| | |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| |
| peer-address |
| |
| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-|
| | |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
. .
. options (variable number and length) .... .
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Figure 3: Relay Agent/Server Message Format
The following sections describe how the relay agent message header gets used. ๐
9.1. Relay-forward Message ๐ซ
Here's the table for how the fields are used in a Relay-forward message ๐:
msg-type RELAY-FORW (12). A 1-octet field.
hop-count Number of relay agents that have already
relayed this message. A 1-octet field.
link-address An address that may be used by the server to
identify the link on which the client is
located. This is typically a globally scoped
unicast address (i.e., GUA or ULA), but see
the discussion in Section 19.1.1. A 16-octet
field.
peer-address The address of the client or relay agent from
which the message to be relayed was received.
A 16-octet field.
options MUST include a Relay Message option (see
Section 21.10); MAY include other options,
such as the Interface-Id option (see
Section 21.18), added by the relay agent. A
variable-length field (34 octets less than
the size of the message).
See Section 13.1 for an explanation of how the link-address field is used. ๐
9.2. Relay-reply Message ๐
Here's the table for how the fields are used in a Relay-reply message ๐:
msg-type RELAY-REPL (13). A 1-octet field.
hop-count Copied from the Relay-forward message.
A 1-octet field.
link-address Copied from the Relay-forward message.
A 16-octet field.
peer-address Copied from the Relay-forward message.
A 16-octet field.
options MUST include a Relay Message option (see
Section 21.10); MAY include other options,
such as the Interface-Id option (see
Section 21.18). A variable-length field
(34 octets less than the size of the
message).
10. Representation and Use of Domain Names ๐
So that domain names get encoded the same way everywhere, a domain name or a list of domain names is encoded using the technique in Section 3.1 of [RFC1035]. ๐ A domain name, or list of domain names, in DHCP MUST NOT be stored in compressed form as described in Section 4.1.4 of [RFC1035]. ๐ซ No compression, periodt ๐
11. DHCP Unique Identifier (DUID) ๐
Each DHCP client and server has a DUID ๐ชช. DHCP servers use DUIDs to identify clients when they pick configuration parameters and when they associate IAs with clients. DHCP clients use DUIDs to identify a server in messages where a server needs to be identified. See Sections 21.2 and 21.3 for the details on how a DUID is represented in a DHCP message. ๐โโ๏ธ
Clients and servers MUST treat DUIDs as opaque values, and they MUST only compare DUIDs for equality. ๐ Clients and servers SHOULD NOT interpret DUIDs in any other way. Clients and servers MUST NOT restrict DUIDs to the types defined in this document, because additional DUID types may be defined in the future. ๐ฎ
Okay, real talk: trying to parse a DUID to get a client's link-layer address is unreliable ๐ฌ. There's no guarantee the client is still using the same link-layer address it had when it made its DUID. And it's only going to get less reliable as more clients adopt privacy measures like the ones in [RFC7844]. If you need that capability, it is recommended to rely on the Client Link-Layer Address option instead [RFC6939]. ๐ต๏ธโโ๏ธ
The DUID goes in an option because it can be variable in length, and because it isn't needed in every DHCP message. โจ The DUID is designed to be unique across all DHCP clients and servers, and stable for any specific client or server. So the DUID used by a client or server SHOULD NOT change over time, if at all possible. ๐ฆ For example, a device's DUID should not change because its network hardware changed or because virtual interfaces changed (like logical PPP (over Ethernet) interfaces that may come and go in Customer Premises Equipment routers). The client may change its DUID as specified in [RFC7844]. ๐
Why more than one DUID type? Because the DUID has to be globally unique and also easy to generate ๐. The kind of globally unique identifier that's easy to generate can look wildly different from device to device. Plus, some devices don't have any persistent storage, so they can't keep a generated DUID around. The DUID scheme has to work for those devices too ๐ฅบ.
11.1. DUID Contents ๐งฌ
A DUID is a 2-octet type code in network byte order, followed by a variable number of octets that make up the actual identifier. The length of the DUID (not including the type code) is at least 1 octet and at most 128 octets. ๐ These are the types that are currently defined:
+------+------------------------------------------------------+
| Type | Description |
+------+------------------------------------------------------+
| 1 | Link-layer address plus time |
| 2 | Vendor-assigned unique ID based on Enterprise Number |
| 3 | Link-layer address |
| 4 | Universally Unique Identifier (UUID) [RFC6355] |
+------+------------------------------------------------------+
Table 2: DUID Types
The formats for the variable field of the DUID for the first three types above are shown below ๐. The fourth type, DUID-UUID [RFC6355], can be used when there's a UUID stored in a device's firmware settings ๐.
11.2. DUID Based on Link-Layer Address Plus Time (DUID-LLT) ๐ฐ๏ธ
Okay bestie, DUID-LLT is giving "I have a timestamp AND a MAC address" energy ๐ . This type of DUID starts with a 2-octet type field holding the value 1, then a 2-octet hardware type code, then 4 octets of time value, and then the link-layer address of any one network interface that's connected to the DHCP device when the DUID gets generated ๐ฆ. The time value is the moment the DUID was made, counted in seconds since midnight (UTC), January 1, 2000, modulo 2^32 โฐ. The hardware type MUST be a valid hardware type assigned by IANA; see [IANA-HARDWARE-TYPES] ๐. Both the time and the hardware type are stored in network byte order ๐ง. For Ethernet hardware types, the link-layer address is stored in canonical form, as described in [RFC2464] ๐.
The following diagram illustrates the format of a DUID-LLT:
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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| DUID-Type (1) | hardware type (16 bits) |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| time (32 bits) |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
. .
. link-layer address (variable length) .
. .
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Figure 4: DUID-LLT Format
The choice of network interface can be completely arbitrary, as long as that interface provides a globally unique link-layer address for the link type. The same DUID-LLT SHOULD be used in configuring all network interfaces connected to the device, regardless of which interface's link-layer address was used to generate the DUID-LLT ๐ธ.
Clients and servers using this type of DUID MUST store the DUID-LLT in stable storage and MUST continue to use this DUID-LLT even if the network interface used to generate the DUID-LLT is removed. Clients and servers that do not have any stable storage MUST NOT use this type of DUID. Not me making the rules this strict, but okay ๐.
Clients and servers that use this DUID SHOULD attempt to configure the time prior to generating the DUID, if that is possible, and MUST use some sort of time source (for example, a real-time clock) in generating the DUID, even if that time source could not be configured prior to generating the DUID. The use of a time source makes it unlikely that two identical DUID-LLTs will be generated if the network interface is removed from the client and another client then uses the same network interface to generate a DUID-LLT. A collision between two DUID-LLTs is very unlikely even if the clocks have not been configured prior to generating the DUID. The timestamp is doing so much work here, I'm obsessed ๐ญโจ.
This method of DUID generation is recommended for all general-purpose computing devices such as desktop computers and laptop computers, and also for devices such as printers, routers, and so on, that contain some form of writable non-volatile storage ๐.
It is possible that this algorithm for generating a DUID could result in a client identifier collision. A DHCP client that generates a DUID-LLT using this mechanism MUST provide an administrative interface that replaces the existing DUID with a newly generated DUID-LLT. So yes, collisions can happen, and the client has to give you a way to swap in a fresh DUID ๐ฅ.
11.3. DUID Assigned by Vendor Based on Enterprise Number (DUID-EN) ๐ญ
The vendor assigns this form of DUID to the device. This DUID consists of the 4-octet vendor's registered Private Enterprise Number as maintained by IANA [IANA-PEN], followed by a unique identifier assigned by the vendor. The following diagram summarizes the structure of a DUID-EN:
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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| DUID-Type (2) | enterprise-number |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| enterprise-number (contd) | |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
. identifier .
. (variable length) .
. .
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Figure 5: DUID-EN Format
The source of the identifier is left up to the vendor defining it, but each identifier part of each DUID-EN MUST be unique to the device that is using it, and MUST be assigned to the device no later than at the first usage and stored in some form of non-volatile storage. This typically means being assigned during the manufacturing process in the case of physical devices or, in the case of virtual machines, when the image is created or booted for the first time. The generated DUID SHOULD be recorded in non-erasable storage. The enterprise-number is the vendor's registered Private Enterprise Number as maintained by IANA [IANA-PEN]. The enterprise-number is stored as an unsigned 32-bit number ๐.
An example DUID of this type might look like this:
+---+---+---+---+---+---+---+---+
| 0 | 2 | 0 | 0 | 0 | 9| 12|192|
+---+---+---+---+---+---+---+---+
|132|211| 3 | 0 | 9 | 18|
+---+---+---+---+---+---+
Figure 6: DUID-EN Example
This example includes the 2-octet type of 2 and the Enterprise Number (9), followed by 8 octets of identifier data (0x0CC084D303000912). Ta-da ๐งโโ๏ธ๐.
11.4. DUID Based on Link-Layer Address (DUID-LL) ๐
This type of DUID consists of 2 octets containing a DUID type of 3 and a 2-octet network hardware type code, followed by the link-layer address of any one network interface that is permanently connected to the client or server device. For example, a node that has a network interface implemented in a chip that is unlikely to be removed and used elsewhere could use a DUID-LL ๐. The hardware type MUST be a valid hardware type assigned by IANA; see [IANA-HARDWARE-TYPES]. The hardware type is stored in network byte order. The link-layer address is stored in canonical form, as described in [RFC2464]. The following diagram illustrates the format of a DUID-LL:
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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| DUID-Type (3) | hardware type (16 bits) |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
. .
. link-layer address (variable length) .
. .
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Figure 7: DUID-LL Format
The choice of network interface can be completely arbitrary, as long as that interface provides a unique link-layer address and is permanently attached to the device on which the DUID-LL is being generated. The same DUID-LL SHOULD be used in configuring all network interfaces connected to the device, regardless of which interface's link-layer address was used to generate the DUID.
A DUID-LL is recommended for devices that have a permanently connected network interface with a link-layer address and do not have nonvolatile, writable stable storage. A DUID-LL SHOULD NOT be used by DHCP clients or servers that cannot tell whether or not a network interface is permanently attached to the device on which the DHCP client is running. So if you can't tell whether the NIC is stuck on for good, skip DUID-LL, no cap ๐ โโ๏ธ๐.
11.5. DUID Based on Universally Unique Identifier (DUID-UUID) ๐
This type of DUID consists of 16 octets containing a 128-bit UUID. [RFC6355] details when to use this type and how to pick an appropriate source of the UUID ๐ฆ.
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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| DUID-Type (4) | UUID (128 bits) |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| |
| |
| -+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
Figure 8: DUID-UUID Format
12. Identity Association โจ
An Identity Association (IA) is a construct through which a server and a client can identify, group, and manage a set of related IPv6 addresses or delegated prefixes. Each IA consists of an IAID and associated configuration information ๐ซถ.
The IAID uniquely identifies the IA and MUST be chosen to be unique among the IAIDs for that IA type on the client (e.g., an IA_NA with an IAID of 0 and an IA_PD with an IAID of 0 are each considered unique). The IAID is chosen by the client. For any given use of an IA by the client, the IAID for that IA MUST be consistent across restarts of the DHCP client. The client may maintain consistency by either storing the IAID in non-volatile storage or using an algorithm that will consistently produce the same IAID as long as the configuration of the client has not changed. There may be no way for a client to maintain consistency of the IAIDs if it does not have non-volatile storage and the client's hardware configuration changes. If the client uses only one IAID, it can use a well-known value, e.g., zero ๐.
If the client wishes to obtain a distinctly new address or prefix and deprecate the existing one, the client sends a Release message to the server for the IAs using the original IAID. The client then creates a new IAID, to be used in future messages to obtain leases for the new IA. Fresh IAID, fresh start, main character energy ๐ธ๐ .
12.1. Identity Associations for Address Assignment ๐ก
A client must associate at least one distinct IA with each of its network interfaces for which it is to request the assignment of IPv6 addresses from a DHCP server. The client uses the IAs assigned to an interface to obtain configuration information from a server for that interface. Each such IA must be associated with exactly one interface.
The configuration information in an IA_NA option consists of one or more IPv6 addresses along with the T1 and T2 values for the IA. See Section 21.4 for details regarding the representation of an IA_NA in a DHCP message.
The configuration information in an IA_TA option consists of one or more IPv6 addresses. See Section 21.5 for details regarding the representation of an IA_TA in a DHCP message.
Each address in an IA has a preferred lifetime and a valid lifetime, as defined in [RFC4862]. The lifetimes are transmitted from the DHCP server to the client in the IA Address option (see Section 21.6). The lifetimes apply to the use of addresses; see Section 5.5.4 of [RFC4862] โญ.
12.2. Identity Associations for Prefix Delegation ๐
okay so an IA_PD is lowkey different from an IA for address assignment, bestie ๐ because it doesn't have to be tied to exactly one interface. One IA_PD can belong to the client, to a set of interfaces, or to just one interface โจ. A client that wants delegated prefixes must create at least one distinct IA_PD. It may give each of its downstream network interfaces its own IA_PD and use that one to get a prefix for that interface from the server ๐ธ
The configuration info in an IA_PD option is one or more prefixes plus the T1 and T2 values for that IA_PD. Check out Section 21.21 for how an IA_PD shows up in a DHCP message ๐ง
Each delegated prefix in an IA has a preferred lifetime and a valid lifetime, as defined in [RFC4862] ๐ The DHCP server sends those lifetimes to the client in the IA Prefix option (see Section 21.22). They apply to how the delegated prefixes get used, so see Section 5.5.4 of [RFC4862] for the full tea โ
13. Assignment to an IA ๐ฆ
13.1. Selecting Addresses for Assignment to an IA_NA ๐
okay this part is giving detective energy ๐ต๏ธโโ๏ธ A server picks the addresses for an IA_NA based on the address assignment policies its admin set up, plus whatever it figures out about the client from some mix of these sources:
- The link the client is attached to. The server works out the link like this:
- If the server gets the message directly from the client, and the source address in the IP datagram it arrived in is a link-local address, then the client is on the same link as the interface the message came in on. ๐
- If the server gets the message from a forwarding relay agent, then the client is on the same link as the one the interface named in the link-address field of the relay agent's message is attached to. According to [RFC6221], the server MUST ignore any link-address field whose value is zero. The link-address here can come from any of the Relay-forward messages wrapped up in the received Relay-forward, and generally the most encapsulated one (the Relay-forward closest to the client) has the most useful value ๐ง
- If the server gets the message directly from the client, and the source address in the IP datagram is not a link-local address, then the client is on the link identified by that source address (note that this can only happen if the server has turned on unicast message delivery for the client and the client sent a message where unicast delivery is allowed) ๐คฏ
- The DUID supplied by the client.
- Other info in options the client sent, e.g., IA Address options (see Section 21.6) that carry the client's requests for specific addresses. ๐
- Other info in options the relay agent sent.
By default, DHCP server implementations SHOULD NOT generate predictable addresses (see Section 4.7 of [RFC7721]). Server implementers are encouraged to look at [RFC4941], [RFC7824], and [RFC7707] for things to consider when generating addresses ๐
A server MUST NOT assign an address that is reserved for some other purpose. For example, a server MUST NOT assign addresses that use a reserved IPv6 Interface Identifier [RFC5453] [RFC7136] [IANA-RESERVED-IID]. Not on my watch ๐ โโ๏ธ
For a more detailed look at how servers figure out a client's location on the network, see [RFC7969] ๐บ๏ธ
13.2. Assignment of Temporary Addresses ๐ซง
A client may ask for temporary addresses (see [RFC4941] for what temporary addresses are). DHCP handles address assignment for temporary addresses exactly the same way, no drama ๐
Clients ask for them, servers hand them out. Temporary addresses ride along in the IA_TA option (see Section 21.5). Each IA_TA option usually has at least one temporary address for each of the prefixes on the link the client is attached to โจ
The lifetime of the assigned temporary address gets set in the IA Address option (see Section 21.6) that's tucked inside the IA_TA option. It is RECOMMENDED to set short lifetimes, typically shorter than TEMP_VALID_LIFETIME and TEMP_PREFERRED_LIFETIME (see Section 5 of [RFC4941]). Short and sweet ๐
A DHCP server implementation MAY generate temporary addresses, using the algorithm defined in Section 3.2.1 of [RFC4941], with the extra condition that any new address is not the same as any address already assigned ๐ฒ
The server MAY update the DNS for a temporary address, as described in Section 4 of [RFC4941] ๐
On clients, temporary addresses are preferred by default in source address selection, according to Rule 7 in Section 5 of [RFC6724]. That policy can be overridden though ๐ง
Here's the big thing about temporary addresses: the whole point is to make it hard to link the address to different actions over time ๐ถ๏ธ So it is NOT RECOMMENDED for a client to renew temporary addresses, even though DHCP does provide for that possibility (see Section 21.5). Main character energy is not renewing your temp address, periodt ๐
13.3. Assignment of Prefixes for IA_PD ๐ท
This document doesn't specify how the server picks the prefix(es) to delegate. Some examples of how a server might choose prefix(es) for a client: static assignment based on a subscription to an ISP, dynamic assignment from a pool of available prefixes, and selection based on an external authority like a RADIUS server using the Framed-IPv6-Prefix option as described in [RFC3162] ๐ฆ
14. Transmission of Messages by a Client ๐ฎ
Unless this document or a document describing how IPv6 is carried over a specific type of link says otherwise (for link types that don't support multicast), a client sends DHCP messages to the All_DHCP_Relay_Agents_and_Servers multicast address ๐ฃ
DHCP servers SHOULD NOT check whether the Layer 2 address used was multicast, as long as the Layer 3 address was correct. No need to be nosy about it ๐ซถ
A client uses multicast to reach all servers or just one individual server. To target an individual server, the client puts that server's DUID in a Server Identifier option (see Section 21.3) in its message. (Every server gets this message, but only the one named in it responds ๐โโ๏ธ) If that option isn't included, then all servers are the audience ๐
A client may send some messages straight to a server with unicast, as described in Section 21.12 ๐ฌ
14.1. Rate Limiting ๐ฆ
To avoid long bursts of messages caused by possible logic loops, a DHCP client MUST limit the rate of the DHCP messages it sends or resends. Here's a spicy example ๐ถ๏ธ: a client gets an address or delegated prefix but doesn't like the response, so it goes back to the Solicit procedure, finds the same (only) server, requests an address or delegated prefix, and gets the exact same one as before (since the server still has that earlier lease assigned to this client). That loop could go on forever if there's no quit or stop mechanism. So a client must not start transmissions too often ๐๐
A recommended way to do rate limiting is a token bucket (see Appendix A of [RFC3290]), which caps the average transmission rate at a certain number in a certain time interval. This way of bounding burstiness also guarantees that the long-term transmission rate won't be exceeded ๐ชฃ
A transmission rate limit SHOULD be configurable. A possible default could be 20 packets in 20 seconds โฑ๏ธ
If a device has multiple interfaces, the limit MUST be enforced on a per-interface basis ๐
Rate limiting of forwarded DHCP messages and server-side messages is out of scope for this specification ๐
14.2. Client Behavior when T1 and/or T2 Are 0 ๐
In certain cases, the T1 and/or T2 values may be set to 0. Right now there are three such cases:
- a client received an IA_NA option (see Section 21.4) with a zero value
- a client received an IA_PD option (see Section 21.21) with a zero value
- a client received an IA_TA option (see Section 21.5) (which doesn't contain T1 and T2 fields, and these leases are not generally renewed)
This is a sign that the renew and rebind times are left up to the client's discretion. But it's not totally free rein, bestie ๐ซฃ
When the T1 and/or T2 values are set to 0, the client MUST choose a time to avoid packet storms. In particular, it MUST NOT transmit immediately. If the client received multiple IA options, it SHOULD pick renew and/or rebind transmission times so that all the IA options get handled in one exchange, if possible ๐ค The client MUST choose renew and rebind times that don't violate the rate-limiting restrictions defined in Section 14.1 ๐ซโจ
15. Reliability of Client-Initiated Message Exchanges โจ
okay bestie, so DHCP clients are responsible for making sure their messages actually arrive ๐ฌ in the client-initiated exchanges from Section 18. If a client doesn't get the response it was waiting for from a server, it has to send its message again using the retransmission strategy in this section ๐
ngl the procedure is slightly different for the Solicit message, so check out Section 18.2.1 ๐ซถ
The client starts the message exchange by sending a message to the server. The exchange ends when either (1) the client successfully gets the appropriate response or responses from a server or servers, or (2) the exchange is considered failed under the retransmission mechanism below ๐
The client MUST update the "elapsed-time" value in an Elapsed Time option (see Section 21.9) in the retransmitted message. Sometimes the client may also need to change the values in IA Address options (see Section 21.6) or IA Prefix options (see Section 21.22) if a valid lifetime for one of its leases runs out before the retransmission. So whenever this document says "retransmission," it means BOTH tweaking the original message AND sending this new version to the server ๐
The client's retransmission behavior is controlled by the following variables ๐
RT Retransmission timeout
IRT Initial retransmission time
MRC Maximum retransmission count
MRT Maximum retransmission time
MRD Maximum retransmission duration
RAND Randomization factor
Specific values for each of these parameters, for the different messages, are in the subsections of Section 18.2, using the values defined in Table 1 in Section 7.6. The algorithm for RAND is the same across all message transmissions ๐ฆ
With every message transmission or retransmission, the client sets RT using the rules below. If RT expires before the message exchange ends, the client recalculates RT and retransmits the message ๐
Every new RT calculation includes a randomization factor (RAND), which is a random number picked with a uniform distribution between -0.1 and +0.1. The randomization factor exists to minimize synchronization of messages sent by DHCP clients ๐
The algorithm for picking a random number does not need to be cryptographically sound. The algorithm SHOULD produce a different sequence of random numbers from each invocation of the DHCP client ๐ฒ
RT for the first message transmission is based on IRT:
RT = IRT + RAND*IRT
RT for each subsequent message transmission is based on the previous value of RT:
RT = 2*RTprev + RAND*RTprev
MRT sets an upper bound on the value of RT (ignoring the randomization added by RAND). If MRT is 0, there is no upper limit on RT. Otherwise:
if (RT > MRT)
RT = MRT + RAND*MRT
MRC sets an upper bound on how many times a client may retransmit a message. Unless MRC is zero, the message exchange fails once the client has transmitted the message MRC times ๐ซ
MRD sets an upper bound on how long a client may keep retransmitting a message. Unless MRD is zero, the message exchange fails once MRD seconds have passed since the client first sent the message โฐ
If both MRC and MRD are non-zero, the message exchange fails whenever either of the two conditions in the previous two paragraphs is met ๐
If both MRC and MRD are zero, the client keeps transmitting the message until it receives a response ๐ฅน
A client isn't expected to listen for a response during the entire RT period. It may turn off its listening capabilities after waiting at least the shorter of RT and MAX_WAIT_TIME, for power saving or other reasons ๐ Of course, a client MUST listen for a Reconfigure if it has negotiated for its use with the server ๐
16. Message Validation ๐ก๏ธ
This section is all about which options are valid in which message types, and what to do when a client or server gets a message containing known options that aren't valid for that message. For example, an IA option is not allowed to show up in an Information-request message ๐ โโ๏ธ
Clients and servers MAY choose to either (1) pull out information from such a message if it's useful to the recipient, or (2) ignore the message completely and just discard it ๐๏ธ
If a server gets a message it considers invalid, it MAY send a Reply message (or an Advertise message, as appropriate) with a Server Identifier option (see Section 21.3), a Client Identifier option (see Section 21.2) (if one was included in the message), and a Status Code option (see Section 21.13) with the status UnspecFail ๐ค
Clients, relay agents, and servers MUST NOT discard messages that contain unknown options (or instances of vendor options with unknown enterprise-number values). These should be ignored as if they weren't there. This is critical for future DHCP extensions, so don't skip this one ๐
A server MUST discard any Solicit, Confirm, Rebind, or Information-request messages it receives with a Layer 3 unicast destination address ๐ฎ
A client or server MUST discard any received DHCP message with an unknown message type ๐
16.1. Use of Transaction IDs
The transaction-id field holds a value that clients and servers use to match server responses to client messages ๐ A client SHOULD generate a random number that can't easily be guessed or predicted to use as the transaction ID for each new message it sends. ngl if a client makes easily predictable transaction IDs, it can become more vulnerable to certain kinds of attacks from off-path intruders ๐ญ A client MUST leave the transaction ID unchanged in retransmissions of a message ๐
16.2. Solicit Message
Clients MUST discard any received Solicit messages ๐ซ
Servers MUST discard any Solicit messages that do NOT include a Client Identifier option or that DO include a Server Identifier option ๐ โโ๏ธ
16.3. Advertise Message
Clients MUST discard any received Advertise message that meets any of the following conditions:
- the message does not include a Server Identifier option (see Section 21.3).
- the message does not include a Client Identifier option (see Section 21.2).
- the contents of the Client Identifier option do not match the client's DUID.
- the
transaction-idfield value does not match the value the client used in its Solicit message.
Servers and relay agents MUST discard any received Advertise messages ๐๏ธ
16.4. Request Message
Clients MUST discard any received Request messages ๐ซ
Servers MUST discard any received Request message that meets any of the following conditions:
- the message does not include a Server Identifier option (see Section 21.3).
- the contents of the Server Identifier option do not match the server's DUID.
- the message does not include a Client Identifier option (see Section 21.2).
16.5. Confirm Message
Clients MUST discard any received Confirm messages ๐ซ
Servers MUST discard any received Confirm messages that do not include a Client Identifier option (see Section 21.2) or that do include a Server Identifier option (see Section 21.3) ๐
16.6. Renew Message
Clients MUST discard any received Renew messages ๐ซ
Servers MUST discard any received Renew message that meets any of the following conditions:
- the message does not include a Server Identifier option (see Section 21.3).
- the contents of the Server Identifier option do not match the server's identifier.
- the message does not include a Client Identifier option (see Section 21.2).
16.7. Rebind Message
Clients MUST discard any received Rebind messages ๐ซ
Servers MUST discard any received Rebind messages that do not include a Client Identifier option (see Section 21.2) or that do include a Server Identifier option (see Section 21.3) ๐
16.8. Decline Message
Clients MUST discard any received Decline messages ๐ซ
Servers MUST discard any received Decline message that meets any of the following conditions:
- the message does not include a Server Identifier option (see Section 21.3).
- the contents of the Server Identifier option do not match the server's identifier.
- the message does not include a Client Identifier option (see Section 21.2).
16.9. Release Message
Clients MUST discard any received Release messages ๐ซ
Servers MUST discard any received Release message that meets any of the following conditions:
- the message does not include a Server Identifier option (see Section 21.3).
- the contents of the Server Identifier option do not match the server's identifier.
- the message does not include a Client Identifier option (see Section 21.2).
16.10. Reply Message
Clients MUST discard any received Reply message that meets any of the following conditions:
- the message does not include a Server Identifier option (see Section 21.3).
- the "transaction-id" field in the message does not match the value used in the original message.
If the client included a Client Identifier option (see Section 21.2) in the original message, the Reply message MUST include a Client Identifier option, and the contents of that Client Identifier option MUST match the DUID of the client. If the client did NOT include a Client Identifier option in the original message, the Reply message MUST NOT include a Client Identifier option ๐
Servers and relay agents MUST discard any received Reply messages ๐๏ธ
16.11. Reconfigure Message
Servers and relay agents MUST discard any received Reconfigure messages ๐ซ
Clients MUST discard any Reconfigure message that meets any of the following conditions:
- the message was not unicast to the client.
- the message does not include a Server Identifier option (see Section 21.3).
- the message does not include a Client Identifier option (see Section 21.2) that contains the client's DUID.
- the message does not include a Reconfigure Message option (see Section 21.19).
- the Reconfigure Message option msg-type is not a valid value.
- the message does not include authentication (such as RKAP; see Section 20.4) or fails authentication validation ๐
16.12. Information-request Message
Clients MUST discard any received Information-request messages ๐ซ
Servers MUST discard any received Information-request message that meets any of the following conditions:
- the message includes a Server Identifier option (see Section 21.3), and the DUID in the option does not match the server's DUID.
- the message includes an IA option.
16.13. Relay-forward Message
Clients MUST discard any received Relay-forward messages ๐ซ
16.14. Relay-reply Message
Clients and servers MUST discard any received Relay-reply messages ๐๏ธ
17. Client Source Address and Interface Selection ๐ธ
The client's behavior around interface selection is different depending on what the configuration is for ๐ง
17.1. Source Address and Interface Selection for Address Assignment โจ
okay so when a client sends a DHCP message to the All_DHCP_Relay_Agents_and_Servers multicast address, it SHOULD send it out through the interface it's requesting config (including addresses) for. ๐ฆ The client MAY use a different interface, but only if the one it wants config for is a logical interface with no direct link attachment, or if it's certain two interfaces are attached to the same link. ๐
when a client sends a DHCP message directly to a server with unicast (after getting the Server Unicast option from that server, see Section 21.12), the source address in the IPv6 datagram header MUST be an address assigned to the interface the client is after config for. It also has to be suitable for the server to use when replying to the client. ๐ซถ
17.2. Source Address and Interface Selection for Prefix Delegation ๐ธ
delegated prefixes are not tied to a particular interface the way addresses are for address assignment (see Section 17.1 above), so the vibe is totally different here. ๐ง
when a client sends a DHCP message for prefix delegation, it SHOULD be sent on the interface linked to the upstream router, which is usually the one connected to an ISP network (see [RFC7084]). the upstream interface is typically decided by configuration. and this rule still applies even when a separate IA_PD is used for each downstream interface. ๐
when a client sends a DHCP message directly to a server with unicast (after getting the Server Unicast option from that server, see Section 21.12), the source address SHOULD be an address from the upstream interface that the server can use to respond to the client. ๐
18. DHCP Configuration Exchanges ๐ง
a client starts a message exchange with a server (or servers) to get or update the config info it cares about. ๐ there are a bunch of reasons a client might start this, and the most common ones are:
- as part of the operating system configuration/bootstrap process,
- when requested to do so by the application layer (through an operating-system-specific API),
- when a Router Advertisement indicates that DHCPv6 is available for address configuration (see Section 4.2 of [RFC4861]),
- as required to extend the lifetime of address(es) and/or delegated prefix(es), using Renew and Rebind messages, or
- upon the receipt of a Reconfigure message, when requested to do so by a server.
the client is in charge of creating IAs and asking a server to assign addresses and/or delegated prefixes to them. ๐ it makes the IAs first and gives them IAIDs, then sends a Solicit message with the IA options that describe them. the client MUST NOT be using any of the addresses or delegated prefixes it's trying to get bindings for with that Solicit message. ๐ and if the client already had some valid bindings but decided to start server discovery to get those same bindings from a different server, it MUST stop using the addresses and delegated prefixes it got from the previous server for the bindings it's now trying to get from the new one (see Section 18.2.7 for more details on what "stop using" means in this context). no cap, this part is serious. ๐ญ
a DHCP client that doesn't need a DHCP server to assign it IP addresses or delegated prefixes can still get config info, like a list of DNS servers [RFC3646] or NTP servers [RFC5908], in one single message and reply exchange with a DHCP server. โจ to do that, the client first sends an Information-request message (see Section 18.2.6) to the All_DHCP_Relay_Agents_and_Servers multicast address. servers respond with a Reply message containing the config info for the client (see Section 18.3.6). ๐
if the client wants one or more addresses or delegated prefixes, it first has to locate a DHCP server and then ask that server for the address/prefix assignment and other config info. ๐ฆ it does this by sending a Solicit message (see Section 18.2.1) to the All_DHCP_Relay_Agents_and_Servers multicast address and collecting the Advertise messages that come back from the servers that respond. then the client picks one server to get config info from. this whole thing is called server discovery. once the client has picked its server, it sends a Request message to that server as described in Section 18.2.2. ๐
a client that's happy to do the Solicit/Reply message exchange described in Section 18.2.1 includes a Rapid Commit option (see Section 21.14) in its Solicit message. ๐ฅ
servers that can assign addresses or delegated prefixes to the IAs respond to the client with an Advertise message or a Reply message, as long as the client included a Rapid Commit option and the server is configured to accept it. ๐
if the server responds with an Advertise message, the client starts a configuration exchange as described in Section 18.2.2. ๐ซถ
a server can start a message exchange with a client by sending a Reconfigure message. this tells the client to send a Renew, Rebind, or Information-request message to refresh its config info as soon as it gets the Reconfigure message. โญ
Figure 9 shows a timeline diagram of the messages exchanged between a client and two servers for the typical lifecycle of one or more leases. ๐ it starts with the four-message Solicit/Advertise/Request/Reply exchange to get the lease(s), then has a two-message Renew/Reply exchange to extend the lifetime on the lease(s), and ends with a two-message Release/Reply exchange to end the client's use of the lease(s). ๐ธ
Server Server
(not selected) Client (selected)
v v v
| | |
| Begins initialization |
| | |
start of | _____________/|\_____________ |
4-message |/ Solicit | Solicit \|
exchange | | |
Determines | Determines
configuration | configuration
| | |
|\ | ____________/|
| \________ | /Advertise |
| Advertise\ |/ |
| \ | |
| Collects Advertises |
| \ | |
| Selects configuration |
| | |
| _____________/|\_____________ |
|/ Request | Request \|
| | |
| | Commits configuration
| | |
end of | | _____________/|
4-message | |/ Reply |
exchange | | |
| Initialization complete |
| | |
. . .
. . .
| T1 (renewal) timer expires |
| | |
2-message | _____________/|\_____________ |
exchange |/ Renew | Renew \|
| | |
| | Commits extended lease(s)
| | |
| | _____________/|
| |/ Reply |
. . .
. . .
| | |
| Graceful shutdown |
| | |
2-message | _____________/|\_____________ |
exchange |/ Release | Release \|
| | |
| | Discards lease(s)
| | |
| | _____________/|
| |/ Reply |
| | |
v v v
Figure 9: Timeline Diagram of the Messages Exchanged between a Client
and Two Servers for the Typical Lifecycle of One or More Leases
18.1. A Single Exchange for Multiple IA Options ๐ฆ
this document assumes a client SHOULD use a single transaction for all of the IA options it needs on an interface. ๐ that keeps the client implementation simple and cuts down on how many transactions are needed (for the background on this design choice, refer to Section 4 of [RFC7550]). to make that work, servers MUST return the same T1/T2 values for all IA options in a Reply (see Sections 18.3.2, 18.3.4, and 18.3.5), so the client makes just one transaction when it renews or rebinds its leases. ๐ but since some servers might not conform to this yet, a client MUST be prepared to pick appropriate T1/T2 times as described in Section 18.2.4. ๐ฅบโจ
18.2. Client Behavior ๐ฆ
Okay so this is where the client gets to be the main character ๐ A client uses the Solicit message to find DHCP servers that are set up to assign leases or send back other configuration parameters on the link it's plugged into ๐ธ
A client uses Request, Renew, Rebind, Release, and Decline messages during the normal lifecycle of addresses and delegated prefixes ๐
When a client thinks it might have moved to a new link, it uses Confirm if it only has addresses, and Rebind if it has delegated prefixes (and addresses) ๐งญ It uses Information-request messages when it needs configuration info but has no addresses and no prefixes ๐
When a client asks for multiple IA option types, or multiple instances of the same IA type, in a Solicit, Request, Renew, or Rebind, the server(s) might only be set up to offer some of them ๐ฅบ When possible, the client SHOULD use the best configuration available and keep asking for the rest of the IAs in later messages ๐ This lets the client keep one session and one state machine, which is so clean ๐ซถ Honestly, especially with IA_NA and IA_PD requests [RFC7084], this should be rare or a result of a temporary operational error ๐ So it's more likely the client gets everything if it keeps asking, in each later configuration exchange, for all the config it's programmed to try to get, including any stateful config options that didn't return results in previous exchanges โจ
When the client gets a Reconfigure message from the server, it responds with a Renew, Rebind, or Information-request message, as indicated by the Reconfigure Message option (see Section 21.19) ๐ฃ The client SHOULD be suspicious of the Reconfigure message (they might be faked ๐), and it MUST NOT abandon any resources it might already have obtained ๐ The client SHOULD treat the Reconfigure message as if the T1 timer had expired โฐ The client will expect the server to send IAs and/or other configuration information back in a Reply message ๐ฌ
If the client has a source address with enough scope that the server can use it as a return address, and the client has received a Server Unicast option (see Section 21.12) from the server, the client SHOULD unicast any Request, Renew, Release, and Decline messages to the server ๐
Unicast can help avoid delays from relay agents passing messages along, and it cuts down on servers having to deal with client messages going to multiple servers ๐ But making the client send everything through a relay agent lets relay agent options be included in all the messages the client sends ๐ง The server should enable the use of unicast only when relay agent options will not be used ๐
Not gonna lie, this is a little bit of a trade-off moment, bestie ๐
18.2.1. Creation and Transmission of Solicit Messages ๐
The client sets the msg-type field to SOLICIT. It generates a transaction ID and puts that value in the transaction-id field ๐
The client MUST include a Client Identifier option (see Section 21.2) so it can identify itself to the server ๐ชช It includes IA options for any IAs it wants the server to assign leases for ๐
The client MUST include an Elapsed Time option (see Section 21.9) to show how long it's been trying to finish the current DHCP message exchange โณ
The client uses IA_NA options (see Section 21.4) to request non-temporary addresses, IA_TA options (see Section 21.5) to request temporary addresses, and IA_PD options (see Section 21.21) to request prefix delegation ๐ You can include IA_NA, IA_TA, or IA_PD options, or any combo of all three, in DHCP messages. You can also include multiple instances of any IA option type ๐ฐ
The client MAY include addresses in IA Address options (see Section 21.6), which are wrapped inside IA_NA and IA_TA options, as hints telling the server which addresses it prefers ๐ฏ
The client MAY include values in IA Prefix options (see Section 21.22), which are wrapped inside IA_PD options, as hints for the delegated prefix and/or prefix length it prefers. See Section 18.2.4 for more on prefix-length hints ๐งฉ
The client MUST include an Option Request option (ORO) (see Section 21.7) to request the SOL_MAX_RT option (see Section 21.24) and any other options it's interested in getting back ๐ The client MAY also include instances of those options that are listed in the Option Request option, with data values as hints about the parameter values it would like returned ๐ซ
The client includes a Reconfigure Accept option (see Section 21.20) if it's willing to accept Reconfigure messages from the server ๐
The client MUST NOT include any other options in the Solicit message, except as specifically allowed in the definition of individual options. Rules are rules, babe ๐ซ
The first Solicit message from the client on the interface SHOULD be delayed by a random amount of time between 0 and SOL_MAX_DELAY. This random delay helps desynchronize clients that start a DHCP session at the same time, such as after recovering from a power failure, or after a router outage when they see that DHCP is available in Router Advertisement messages (see Section 4.2 of [RFC4861]) ๐ฒโจ
The client transmits the message according to Section 15, using these parameters:
IRT SOL_TIMEOUT
MRT SOL_MAX_RT
MRC 0
MRD 0
A client that wants to use the Rapid Commit two-message exchange includes a Rapid Commit option (see Section 21.14) in its Solicit message โก The client may get a bunch of different replies from different servers. It notes any valid Advertise messages it gets. It discards any Reply messages that don't contain the Rapid Commit option ๐๏ธ
Once a valid Reply with the Rapid Commit option comes in, the client processes the message as described in Section 18.2.10 ๐
At the end of the first RT period, if no suitable Reply messages arrived but the client has valid Advertise messages, then the client processes the Advertise as described in Section 18.2.9 ๐ฐ๏ธ
If the client later receives a valid Reply message that includes a Rapid Commit option, it does one of the following:
- processes the Reply message as described in Section 18.2.10 and discards any Reply messages received in response to the Request message
- processes any Reply messages received in response to the Request message and discards the Reply message that includes the Rapid Commit option
If the client is waiting for an Advertise message, the mechanism described in Section 15 gets modified like this for sending Solicit messages ๐ ๏ธ The message exchange isn't ended by getting an Advertise before the first RT has elapsed. Instead, the client collects valid Advertise messages until the first RT has elapsed ๐ฅ Also, the first RT MUST be selected to be strictly greater than IRT by choosing RAND to be strictly greater than 0 ๐
A client MUST collect valid Advertise messages for the first RT seconds, unless it receives a valid Advertise message with a preference value of 255 ๐ The preference value is carried in the Preference option (see Section 21.8). Any valid Advertise that doesn't include a Preference option counts as having a preference value of 0 ๐คทโโ๏ธ If the client gets a valid Advertise message with a Preference option set to 255, it immediately starts a client-initiated message exchange (as described in Section 18.2.2) by sending a Request message to the server the Advertise came from ๐ If it gets a valid Advertise message without a Preference option of 255, it keeps waiting until the first RT elapses. If the first RT elapses and the client has a valid Advertise message, the client SHOULD continue with a client-initiated message exchange by sending a Request message ๐จ
If the client doesn't get any valid Advertise messages before the first RT has elapsed, it then applies the retransmission mechanism described in Section 15 ๐ The client stops the retransmission process as soon as it gets any valid Advertise message, and it acts on that Advertise message right away without waiting for more Advertise messages ๐โโ๏ธ
A DHCP client SHOULD choose MRC and MRD values of 0. If the DHCP client is configured with either MRC or MRD set to a value other than 0, it MUST stop trying to configure the interface if the message exchange fails. After the DHCP client stops trying to configure the interface, it SHOULD restart the reconfiguration process after some external event, such as user input, a system restart, or when the client is attached to a new link ๐๐
18.2.2. Creation and Transmission of Request Messages โจ
The client uses a Request message to fill up IAs with leases and to get other configuration information ๐ฆ The client includes one or more IA options in the Request message. The server then sends back leases and other info about the IAs to the client, in IA options, inside a Reply message ๐
The client sets the msg-type field to REQUEST. It generates a transaction ID and puts that value in the transaction-id field ๐
The client MUST include the identifier of the destination server in a Server Identifier option (see Section 21.3) ๐ฏ
The client MUST include a Client Identifier option (see Section 21.2) to identify itself to the server ๐ชช It adds any other appropriate options, including one or more IA options ๐ง
The client MUST include an Elapsed Time option (see Section 21.9) to indicate how long it's been trying to finish the current DHCP message exchange โณ
The client MUST include an Option Request option (see Section 21.7) to request the SOL_MAX_RT option (see Section 21.24) and any other options it's interested in receiving. The client MAY also include instances of those options that are identified in the Option Request option, with data values as hints to the server about the parameter values it would like returned ๐ซ
The client includes a Reconfigure Accept option (see Section 21.20) if it's willing to accept Reconfigure messages from the server ๐
The client transmits the message according to Section 15, using these parameters:
IRT REQ_TIMEOUT
MRT REQ_MAX_RT
MRC REQ_MAX_RC
MRD 0
If the message exchange fails, the client takes an action based on its local policy ๐ง Some actions the client might take include the following:
- Select another server from a list of servers known to the client -- for example, servers that responded with an Advertise message ๐ฏ
- Initiate the server discovery process described in Section 18 ๐
- Terminate the configuration process and report failure ๐ โโ๏ธ
That's the whole vibe for part 13, bestie ๐๐
18.2.3. Creation and Transmission of Confirm Messages ๐ง
Okay bestie, the Confirm message is for when the client has only addresses (no delegated prefixes) from a DHCP server and wants to check if it's still on the same link ๐ ๐. This happens when the client detects a change in network info, as described in Section 18.2.12. Main character check-in energy โจ
The client sets the msg-type field to CONFIRM. It generates a transaction ID and drops that value into the transaction-id field ๐.
The client MUST include a Client Identifier option (see Section 21.2) so it can introduce itself to the server ๐ซถ.
The client MUST include an Elapsed Time option (see Section 21.9) to show how long it's been trying to finish the current DHCP message exchange. Honestly so relatable ๐ญ.
The client includes IA options for all of the IAs assigned to the interface the Confirm message is being sent on. Those IA options carry all of the addresses the client currently has associated with those IAs ๐ธ. The client SHOULD set the T1 and T2 fields in any IA_NA options (see Section 21.4), and the preferred-lifetime and valid-lifetime fields in the IA Address options (see Section 21.6), to 0. The server ignores these fields anyway, so zeroing them is the move ๐ .
The first Confirm message from the client on the interface MUST be delayed by a random amount of time between 0 and CNF_MAX_DELAY. It's giving "wait a sec before you knock" ๐. The client transmits the message according to Section 15, using these parameters:
IRT CNF_TIMEOUT
MRT CNF_MAX_RT
MRC 0
MRD CNF_MAX_RD
If the client gets no responses before the message transmission process ends (see Section 15), the client SHOULD keep using any leases, with the last known lifetimes for those leases, and SHOULD keep using any other previously obtained configuration parameters ๐ฆ. Not gonna lie, that's a very chill fallback ๐.
18.2.4. Creation and Transmission of Renew Messages ๐
To extend the preferred and valid lifetimes for the leases assigned to the IAs, and to get new addresses or delegated prefixes for IAs, the client sends a Renew message to the server the leases came from. The Renew message includes IA options for the IAs whose lease lifetimes should be extended. Okay, that's the whole vibe: renew the bag ๐. The client includes IA Address options (see Section 21.6) within IA_NA (see Section 21.4) and IA_TA (see Section 21.5) options for the addresses assigned to the IAs. It includes IA Prefix options (see Section 21.22) within IA_PD options (see Section 21.21) for the delegated prefixes assigned to the IAs.
The server controls when the client should check back in to extend lease lifetimes, through the T1 and T2 values assigned to an IA ๐ฐ๏ธ. But the client SHOULD renew/rebind all IAs from the server at the same time, so the client MUST select T1 and T2 times from all IA options that guarantee it starts sending Renew/Rebind messages no later than the T1/T2 times tied to any of its bindings (the earliest T1/T2). Scheduling queen behavior ๐.
At time T1, the client starts a Renew/Reply message exchange to extend the lifetimes on any leases in the IA ๐.
A client MUST also start a Renew/Reply message exchange before time T1 if the client's link-local address used in previous interactions with the server is no longer valid and the client is willing to receive Reconfigure messages ๐.
If the server set T1 or T2 to 0 (for an IA_NA or IA_PD), or there are no T1 or T2 times (for an IA_TA) in a previous Reply, the client may, at its discretion, send a Renew or Rebind message, respectively. The client MUST follow the rules defined in Section 14.2 ๐ซง. This part is giving "read the fine print, babe" โจ.
The client sets the msg-type field to RENEW. It generates a transaction ID and puts it in the transaction-id field ๐ธ.
The client MUST include a Server Identifier option (see Section 21.3) in the Renew message, naming the server it talked to most recently ๐ง.
The client MUST include a Client Identifier option (see Section 21.2) to identify itself to the server. It adds any appropriate options, including one or more IA options ๐.
The client MUST include an Elapsed Time option (see Section 21.9) to show how long it's been trying to finish the current DHCP message exchange โณ.
For IAs that have leases assigned, the client includes a matching IA option with an IA Address option for each address assigned to the IA, and an IA Prefix option for each prefix assigned to the IA. The client MUST NOT include addresses or prefixes in any IA option that it didn't get from the server, or that are no longer valid (that have a valid lifetime of 0). No ghost addresses allowed ๐ป๐ซ.
The client MAY include an IA option for each binding it wants but hasn't been able to get. In that case, if the client includes the IA_PD option to request prefix delegation, it MAY include the IA Prefix option inside the IA_PD option, with the IPv6-prefix field set to 0 and the prefix-length field set to the desired length of the prefix to be delegated. The server MAY use this value as a hint for the prefix length ๐. The client SHOULD NOT include an IA Prefix option with the IPv6-prefix field set to 0 unless it's giving a hint for the prefix length. Hints only, no fake vibes ๐
.
The client includes an Option Request option (see Section 21.7) to ask for the SOL_MAX_RT option (see Section 21.24) and any other options it's interested in getting back ๐. The client MAY include options with data values as hints to the server about parameter values it would like returned ๐.
The client transmits the message according to Section 15, using these parameters:
IRT REN_TIMEOUT
MRT REN_MAX_RT
MRC 0
MRD Remaining time until earliest T2
The message exchange ends when the earliest time T2 is reached. While the client is responding to a Reconfigure, the client ignores and discards any additional Reconfigure messages it may receive ๐. The message exchange is terminated when the earliest time T2 is reached, at which point the client begins the Rebind message exchange (see Section 18.2.5). Plot twist, we move on to Rebind ๐ฆโจ.
18.2.5. Creation and Transmission of Rebind Messages ๐ท
At time T2 (which only happens if the server the Renew message was sent to, starting at time T1, hasn't responded), the client starts a Rebind/Reply message exchange with any available server ๐ฅ.
A Rebind is also used to verify delegated prefix bindings, but with different retransmission parameters, as described in Section 18.2.3 ๐ .
The client builds the Rebind message as described in Section 18.2.4, with these differences:
- The client sets the
msg-typefield to REBIND. - The client does not include the Server Identifier option (see Section 21.3) in the Rebind message. No server name tag this time ๐ซฃ.
The client transmits the message according to Section 15, using these parameters:
IRT REB_TIMEOUT
MRT REB_MAX_RT
MRC 0
MRD Remaining time until valid lifetimes of all leases in all
IAs have expired
If all leases for an IA have expired, the client may choose to include this IA in later Rebind messages to show it's still interested in getting leases assigned to this IA ๐.
The message exchange ends when the valid lifetimes of all leases across all IAs have expired. At that point, the client uses the Solicit message to find a new DHCP server and sends a Request for the expired IAs to the new server ๐งโโ๏ธ. If the Rebind exchange that just ended was started because of a Reconfigure message, the client ignores and discards that Reconfigure message ๐.
18.2.6. Creation and Transmission of Information-request Messages ๐
The client uses an Information-request message to get configuration info without having addresses and/or delegated prefixes assigned to it ๐. Think of it as asking for the tea without getting a whole outfit ๐ต.
The client sets the msg-type field to INFORMATION-REQUEST. It generates a transaction ID and puts it in the transaction-id field ๐.
The client SHOULD include a Client Identifier option (see Section 21.2) to identify itself to the server. (Though see Section 4.3.1 of [RFC7844] for reasons a client may not want to include this option ๐.) If the client doesn't include a Client Identifier option, the server won't be able to return any client-specific options to the client, or the server may choose not to respond to the message at all ๐ฌ.
The client MUST include an Elapsed Time option (see Section 21.9) to show how long it's been trying to finish the current DHCP message exchange โณ.
The client MUST include an Option Request option (see Section 21.7) to request the INF_MAX_RT option (see Section 21.25), the Information Refresh Time option (see Section 21.23), and any other options it's interested in receiving ๐. The client MAY include options with data values as hints to the server about parameter values it would like returned ๐ธ.
When responding to a Reconfigure, the client includes a Server Identifier option (see Section 21.3) carrying the identifier from the Reconfigure message it's responding to ๐ซถ.
The first Information-request message from the client on the interface MUST be delayed by a random amount of time between 0 and INF_MAX_DELAY. Then the client transmits the message according to Section 15, using these parameters:
IRT INF_TIMEOUT
MRT INF_MAX_RT
MRC 0
MRD 0
That's the Confirm, Renew, Rebind and Information-request crew all wrapped up, bestie ๐โจ
18.2.7. Creation and Transmission of Release Messages ๐
Okay so, when a client wants to give back one or more leases, it sends a Release message to the server ๐
The client sets the "msg-type" field to RELEASE ๐ It makes up a transaction ID and drops that into the "transaction-id" field ๐ฆ
The client also puts the identifier of the server that handed out the lease(s) into a Server Identifier option (see Section 21.3) ๐ซถ
The client MUST include a Client Identifier option (see Section 21.2) so the server knows exactly who it is ๐
The client MUST include an Elapsed Time option (see Section 21.9) too, to show how long it's been trying to finish the current DHCP message exchange โณ
The client puts options with the IAs for the leases it's releasing into the "options" field. The leases being released MUST be included in the IAs. Any leases for IAs the client wants to keep using MUST NOT be added to the IAs ๐
โโ๏ธ
The client MUST stop using all of the leases it's releasing before it starts the Release message exchange. For an address, that means the address MUST have been removed from the interface. For a delegated prefix, that means the prefix MUST have been advertised with a Preferred Lifetime and a Valid Lifetime of 0 in a Router Advertisement message, as described in part (e) of Section 5.5.3 of [RFC4862]. Also check requirement L-13 in Section 4.3 of [RFC7084] ๐ง
The client MUST NOT use any of the addresses it's releasing as the source address in the Release message or in any message sent after it ๐ซ
Release messages can get lost, so the client should retransmit the Release if no Reply comes back ๐ฅบ But sometimes a client doesn't want to wait out the whole normal retransmission timeout before giving up, like when it's powering down ๐ So Implementations SHOULD retransmit one or more times, but MAY choose to end the retransmission procedure early.
The client sends the message according to Section 15, using these parameters:
IRT REL_TIMEOUT
MRT 0
MRC REL_MAX_RC
MRD 0
If the leases get released but the Reply from the DHCP server is lost, the client will retransmit the Release message. The server might answer with a Reply that has a status of NoBinding, so the client does not treat a Reply with a NoBinding status in a Release message exchange as an error ๐ธ
Also, if the client fails to release the lease, the server will reclaim each lease assigned to the IA once that lease's valid lifetime runs out โฐ
18.2.8. Creation and Transmission of Decline Messages ๐จ
If a client notices that one or more addresses a server gave it are already being used by another node, it sends a Decline message to the server to say "hey, this address is sus" ๐ต๏ธโโ๏ธ
Decline messages aren't used in prefix delegation, so the client MUST NOT include IA_PD options (see Section 21.21) in the Decline message ๐ โโ๏ธ
The client sets the "msg-type" field to DECLINE and makes a transaction ID for the "transaction-id" field ๐
The client puts the identifier of the server that gave out the address(es) into a Server Identifier option (see Section 21.3) ๐ซถ
The client MUST include a Client Identifier option (see Section 21.2) ๐
The client MUST include an Elapsed Time option (see Section 21.9) to show how long it's been trying to finish the current DHCP message exchange โณ
The client puts options with the IAs for the addresses it's declining into the "options" field. The addresses being declined MUST be included in the IAs. Any addresses for IAs the client wants to keep using should not be added to the IAs ๐
The client MUST NOT use any of the addresses it's declining as the source address in the Decline message or in any message after that ๐ซ
The client sends the message according to Section 15, using these parameters:
IRT DEC_TIMEOUT
MRT 0
MRC DEC_MAX_RC
MRD 0
If addresses get declined but the Reply from the DHCP server is lost, the client will retransmit the Decline message. The server might respond with a Reply that has a status of NoBinding, so the client doesn't treat a Reply with a NoBinding status in a Decline message exchange as an error ๐
Here's the tea: the client SHOULD NOT send a Release message for other bindings it got just because it sent a Decline ๐ต It SHOULD retain the non-conflicting bindings โจ And it SHOULD treat failing to get a binding (because of the conflict) the same as never having received that binding, at least when it comes to how it acts with Renew and Rebind messages ๐ฆ
18.2.9. Receipt of Advertise Messages ๐ฌ
When a client gets one or more valid Advertise messages, it picks one or more of them based on these criteria:
- Advertise messages with the highest server preference value SHOULD be preferred over all the other Advertise messages. The client MAY choose a less preferred server if that server has a better set of advertised parameters, like the available set of IAs and the set of other configuration options it advertised ๐
- Within a group of Advertise messages with the same server preference value, a client MAY select those servers whose Advertise messages advertise information it's interested in ๐
Once a client has picked Advertise message(s), it usually stores info about each server, like the server preference value, the addresses advertised, when the advertisement arrived, and so on ๐๏ธ
Basically, this means the client will keep independent per-IA state machines for each selected server ๐ง
If the client needs to pick an alternate server because a chosen server doesn't respond, it picks the next server using the criteria above ๐
The client MUST process any SOL_MAX_RT option (see Section 21.24) and INF_MAX_RT option (see Section 21.25) present in an Advertise message, even if the message has a Status Code option (see Section 21.13) showing a failure, and even though the client will discard that Advertise message ๐ซถ A client SHOULD only update its SOL_MAX_RT and INF_MAX_RT values if every received Advertise message that contained the matching option specified the same value. Otherwise, it should use the default value (see Section 7.6) ๐ค
The client MUST ignore any Advertise message that has no addresses (IA Address options (see Section 21.6) encapsulated in IA_NA options (see Section 21.4) or IA_TA options (see Section 21.5)) and no delegated prefixes (IA Prefix options (see Section 21.22) encapsulated in IA_PD options (see Section 21.21)). The only exception is that the client:
- MUST process an included SOL_MAX_RT option, and
- MUST process an included INF_MAX_RT option.
A client can log any associated status message(s) in an activity log or show them to the user ๐
The client ignoring an Advertise message MUST NOT restart the Solicit retransmission timer โธ๏ธ
18.2.10. Receipt of Reply Messages ๐
When a client gets a valid Reply message in response to a Solicit with a Rapid Commit option (see Section 21.14), a Request, a Confirm, a Renew, a Rebind, or an Information-request message, it pulls out the top-level Status Code option (see Section 21.13) if there is one ๐
The client MUST process any SOL_MAX_RT option (see Section 21.24) and INF_MAX_RT option (see Section 21.25) present in a Reply message, even if the message has a Status Code option showing a failure ๐ช
If the client gets a Reply with a status code of UnspecFail, the server is saying it couldn't process the client's message because of an unspecified failure ๐ต If the client resends the original message to the same server to retry the operation, the client MUST limit the rate at which it retransmits and MUST limit how long it keeps retransmitting (see Section 14.1) ๐ข
If the client gets a Reply with a status code of UseMulticast, it records that it got the message and sends later messages to that server through the interface the Reply came in on, using multicast ๐ก The client then resends the original message using multicast ๐
Otherwise (no status code, or some other status code), the client processes the Reply as described below, based on the original message the Reply was for โจ
The client MAY choose to report any status code or message from the Status Code option in the Reply message ๐ฃ
When a client got a configuration option in an earlier Reply, and then sends a Renew, Rebind, or Information-request, and the requested option is not in the Reply, the client SHOULD stop using the previously received configuration information ๐ In other words, the client should act like it never got that configuration option and go back to the relevant default state ๐ If there's no viable way to stop using the received configuration information, the values received or configured from that option MAY persist, but only if there are no other sources for that data and they have no external impact ๐คทโโ๏ธ For example, a client that got a Client FQDN option (see [RFC4704]) and used it to set up its hostname is allowed to keep using it if there's no reasonable way for a node to unset its hostname and it has no external impact ๐ป As a counter-example, a client that got an NTP server address from the DHCP server and doesn't get it anymore MUST stop using the configured NTP server address โ The client SHOULD be open to other sources of the same configuration information ๐ This behavior doesn't apply to any IA options, since their processing is described in detail in the next section ๐
When a client receives a requested option with an updated value from what it got before, the client SHOULD make use of that updated value as soon as possible for its configuration information โก
18.2.10.1. Reply for Solicit (with Rapid Commit), Request, Renew, or Rebind
Okay so if the client gets a NotOnLink status from the server ๐ in response to a Solicit (with a Rapid Commit option; see Section 21.14) or a Request, it can either reissue the message without specifying any addresses, or restart the DHCP server discovery process (see Section 18). Bestie, pick your fighter ๐
If the Reply was received in response to a Solicit (with a Rapid Commit option), Request, Renew, or Rebind message, the client updates the information it has recorded about IAs using the IA options in the Reply message:
- Calculate T1 and T2 times (based on T1 and T2 values sent in the packet and the packet reception time), if appropriate for the IA type. โฐ
- Add any new leases in the IA option to the IA as recorded by the client. ๐
- Update lifetimes for any leases in the IA option that the client already has recorded in the IA. โจ
- Discard any leases from the IA, as recorded by the client, that have a valid lifetime of 0 in the IA Address or IA Prefix option. ๐๏ธ
- Leave unchanged any information about leases the client has recorded in the IA but that were not included in the IA from the server. ๐ฆ
If the client can operate with the addresses and/or prefixes obtained from the server:
- The client uses the addresses, delegated prefixes, and other information from any IAs that do not contain a Status Code option with the
NoAddrsAvailorNoPrefixAvailstatus code. The client MAY include the IAs for which it received theNoAddrsAvailorNoPrefixAvailstatus code, with no addresses or prefixes, in subsequent Renew and Rebind messages sent to the server, to retry obtaining the addresses or prefixes for these IAs. ๐ - The client MUST perform duplicate address detection as per Section 5.4 of [RFC4862], which does list some exceptions, on each of the received addresses in any IAs on which it has not performed duplicate address detection during processing of any of the previous Reply messages from the server. The client performs the duplicate address detection before using the received addresses for any traffic. If any of the addresses are found to be in use on the link, the client sends a Decline message to the server for those addresses as described in Section 18.2.8. ๐ต๏ธโโ๏ธ
- For each assigned address that does not have any associated reachability information (see the definition of "on-link" in Section 2.1 of [RFC4861]), in order to avoid the problems described in [RFC4943], the client MUST NOT assume that any addresses are reachable on-link as a result of receiving an IA_NA or IA_TA. Addresses obtained from an IA_NA or IA_TA MUST NOT be used to form an implicit prefix with a length other than 128. ๐ซ
- For each delegated prefix, the client assigns a subnet to each of the links to which the associated interfaces are attached.
When a client subnets a delegated prefix, it must assign additional bits to the prefix to generate unique, longer prefixes. For example, if the client in Figure 1 were delegated 2001:db8:0::/48, it might generate 2001:db8:0:1::/64 and 2001:db8:0:2::/64 for assignment to the two links in the subscriber network. If the client were delegated 2001:db8:0::/48 and 2001:db8:5::/48, it might assign 2001:db8:0:1::/64 and 2001:db8:5:1::/64 to one of the links, and 2001:db8:0:2::/64 and 2001:db8:5:2::/64 for assignment to the other link. ๐งฉ
If the client uses a delegated prefix to configure addresses on interfaces on itself or other nodes behind it, the preferred and valid lifetimes of those addresses MUST be no longer than the remaining preferred and valid lifetimes, respectively, for the delegated prefix at any time. In particular, if the delegated prefix or a prefix derived from it is advertised for stateless address autoconfiguration [RFC4862], the advertised preferred and valid lifetimes MUST NOT exceed the corresponding remaining lifetimes of the delegated prefix. โณ
Management of the specific configuration information is detailed in the definition of each option in Section 21.
If the Reply message contains any IAs but the client finds no usable addresses and/or delegated prefixes in any of these IAs, the client may either try another server (perhaps restarting the DHCP server discovery process) or use the Information-request message to obtain other configuration information only. ๐คทโโ๏ธ
When the client receives a Reply message in response to a Renew or Rebind message, the client:
- Sends a Request message to the server that responded if any of the IAs in the Reply message contain the
NoBindingstatus code. The client places IA options in this message for all IAs. The client continues to use other bindings for which the server did not return an error. - Sends a Renew/Rebind if any of the IAs are not in the Reply message, but as this likely indicates that the server that responded does not support that IA type, sending immediately is unlikely to produce a different result. Therefore, the client MUST rate-limit its transmissions (see Section 14.1) and MAY just wait for the normal retransmission time (as if the Reply message had not been received). The client continues to use other bindings for which the server did return information. ๐ฆ
- Otherwise accepts the information in the IA. โ
Whenever a client restarts the DHCP server discovery process or selects an alternate server as described in Section 18.2.9, the client SHOULD stop using all the addresses and delegated prefixes for which it has bindings and try to obtain all required leases from the new server. This facilitates the client using a single state machine for all bindings. ๐งผ
18.2.10.2. Reply for Release and Decline
When the client receives a valid Reply message in response to a Release message, the client considers the Release event completed, regardless of the Status Code option (see Section 21.13) returned by the server. ๐
When the client receives a valid Reply message in response to a Decline message, the client considers the Decline event completed, regardless of the Status Code option(s) returned by the server. ๐
18.2.10.3. Reply for Confirm
If the client receives any Reply messages that indicate a status of Success (explicit or implicit), the client can use the addresses in the IA and ignore any messages that indicate a NotOnLink status. When the client only receives one or more Reply messages with the NotOnLink status in response to a Confirm message, the client performs DHCP server discovery as described in Section 18. ๐
18.2.10.4. Reply for Information-request
Refer to Section 21.23 for details on how the Information Refresh Time option (whether or not present in the Reply) should be handled by the client. ๐
18.2.11. Receipt of Reconfigure Messages
A client receives Reconfigure messages sent to UDP port 546 on interfaces for which it has acquired configuration information through DHCP. These messages may be sent at any time. Since the results of a reconfiguration event may affect application-layer programs, the client SHOULD log these events and MAY notify these programs of the change through an implementation-specific interface. ๐ฃ
Upon receipt of a valid Reconfigure message, the client responds with a Renew message, a Rebind message, or an Information-request message as indicated by the Reconfigure Message option (see Section 21.19). The client ignores the "transaction-id" field in the received Reconfigure message. While the transaction is in progress, the client discards any Reconfigure messages it receives. ๐ โโ๏ธ
The Reconfigure message acts as a trigger that signals the client to complete a successful message exchange. Once the client has received a Reconfigure, the client proceeds with the message exchange (retransmitting the Renew, Rebind, or Information-request message if necessary); the client MUST ignore any additional Reconfigure messages until the exchange is complete. ๐
Duplicate messages will be ignored because the client will begin the exchange after the receipt of the first Reconfigure. Retransmitted messages will either (1) trigger the exchange (if the first Reconfigure was not received by the client) or (2) be ignored. The server MAY discontinue retransmission of Reconfigure messages to the client once the server receives the Renew, Rebind, or Information-request message from the client. ๐
It might be possible for a duplicate or retransmitted Reconfigure to be sufficiently delayed (and delivered out of order) that it arrives at the client after the exchange (initiated by the original Reconfigure) has been completed. In this case, the client would initiate a redundant exchange. The likelihood of delayed and out-of-order delivery is small enough to be ignored. The consequence of the redundant exchange is inefficiency rather than incorrect operation. ๐ข
18.2.12. Refreshing Configuration Information
Whenever a client may have moved to a new link, the prefixes/addresses assigned to the interfaces on that link may no longer be appropriate for the link to which the client is attached. Examples of times when a client may have moved to a new link include the following: ๐บ๏ธ
- The client reboots (and has stable storage and persistent DHCP state).
- The client is reconnected to a link on which it has obtained leases.
- The client returns from sleep mode.
- The client changes access points (e.g., if using Wi-Fi technology).
When the client detects that it may have moved to a new link and it has obtained addresses and no delegated prefixes from a server, the client SHOULD initiate a Confirm/Reply message exchange. The client includes any IAs assigned to the interface that may have moved to a new link, along with the addresses associated with those IAs, in its Confirm message. Any responding servers will indicate whether those addresses are appropriate for the link to which the client is attached with the status in the Reply message it returns to the client. ๐
If the client has any valid delegated prefixes obtained from the DHCP server, the client MUST initiate a Rebind/Reply message exchange as described in Section 18.2.5, with the exception that the retransmission parameters should be set as for the Confirm message (see Section 18.2.3). The client includes IA_NAs, IA_TAs, and IA_PDs, along with the associated leases, in its Rebind message. ๐
If the client has only obtained network information using Information-request/Reply message exchanges, the client MUST initiate an Information-request/Reply message exchange as described in Section 18.2.6. ๐ก
If not associated with one of the above-mentioned conditions, a client SHOULD initiate a Renew/Reply exchange (as if the T1 time expired) as described in Section 18.2.4 or an Information-request/Reply exchange as described in Section 18.2.6 if the client detects a significant change regarding the prefixes available on the link (when new prefixes are added or existing prefixes are deprecated), as this may indicate a configuration change. However, a client MUST rate-limit such attempts to avoid flooding a server with requests when there are link issues (for example, only doing one of these at most every 30 seconds). ๐
18.3. Server Behavior โจ
okay so for this part we're assuming the server has been set up in some implementation-specific way with the configurations clients care about ๐
A server sends an Advertise message in response to each valid Solicit message it receives. That's how it announces itself to the client ๐ฃ
In most cases, the server sends a Reply to Request, Confirm, Renew, Rebind, Decline, Release, and Information-request messages from a client. It also sends a Reply to a Solicit that has a Rapid Commit option (see Section 21.14), but only when it's configured to respond with committed lease assignments ๐
These Advertise and Reply messages MUST always contain the Server Identifier option (see Section 21.3) with the server's DUID, plus the Client Identifier option (see Section 21.2) from the client message if there was one ๐ซถ
In most response messages, the server includes options with configuration info for the client. The server must be aware of the packet size recommendations and the fragmentation guidance in Section 5 of [RFC8200] ๐ If the client put an Option Request option (see Section 21.7) in its message, the server includes options in the response with configuration parameters for every option listed there that the server has been configured to return. The server MAY return additional options to the client if it's been configured to do so โจ
Any message from a client may reach the server wrapped in one or more Relay-forward messages. The server MUST use the received message to build the proper Relay-reply message, so the response gets relayed back through the same relay agents, in reverse order, as the original client message. See Section 19.3 for more details ๐ฆ The server may also need to record this info for each client in case it has to send a Reconfigure message later, unless the server has been configured with addresses it can use to send Reconfigure messages directly to the client (see Section 18.3.11). Note that servers that support leasequery [RFC5007] also need to record this info ๐ง
By sending Reconfigure messages, the server MAY initiate a configuration exchange to get DHCP clients to obtain new addresses, prefixes, and other configuration info. For example, an administrator might use a server-initiated exchange when links in the DHCP domain are getting renumbered, or when other configuration options are updated, perhaps because servers were moved, added, or removed ๐ธ
When a client receives a Reconfigure message from the server, the client starts sending a Renew, Rebind, or Information-request message, as indicated by msg-type in the Reconfigure Message option (see Section 21.19). The server then sends IAs and/or other configuration info to the client in a Reply message. The server MAY include options with the IAs and new values for other configuration parameters in that Reply, even if those IAs and parameters weren't requested in the client's message ๐
18.3.1. Receipt of Solicit Messages โจ
For Solicit messages received via unicast, see Section 18.4. Unicast transmission of Solicit messages is not allowed, regardless of whether the Server Unicast option (see Section 21.12) is configured or not ๐ โโ๏ธ
The server figures out the information about the client and its location as described in Section 13, and it checks its administrative policy about responding to the client. If the server is not permitted to respond to the client, it discards the Solicit message. For example, say the administrative policy is that the server may only respond to a client that's willing to accept a Reconfigure message. If the client doesn't include a Reconfigure Accept option (see Section 21.20) in its Solicit message, the server discards that Solicit ๐๏ธ
If (1) the server is permitted to respond to the client, (2) the client did not include a Rapid Commit option (see Section 21.14) in the Solicit message, or (3) the server has not been configured to respond with committed assignments of leases and other resources, the server sends an Advertise message to the client as described in Section 18.3.9 ๐ฃ
If the client included a Rapid Commit option in its Solicit message and the server has been configured to respond with committed assignments of leases and other resources, the server responds to the Solicit with a Reply message. The server produces that Reply as though it had received a Request message, as described in Section 18.3.2, and it transmits the Reply as described in Section 18.3.10. The server MUST commit the assignment of any addresses and delegated prefixes or other configuration information before sending a Reply message to a client. In this case, the server includes a Rapid Commit option in the Reply to show that the Reply is answering a Solicit message ๐ฅ
DISCUSSION: this is the speedy lane! ๐๏ธ
When using the Solicit/Reply message exchange, the server commits the assignment of any leases before sending the Reply message. The client can assume it's been assigned the leases in the Reply, so it doesn't need to send a Request message for those leases.
Typically, servers configured to use the Solicit/Reply exchange will be deployed so that only one server responds to a Solicit message. If more than one server responds, the client will only use the leases from one of them. The leases from the other servers will be committed to the client but never used by it ๐ญ
18.3.2. Receipt of Request Messages โจ
For Request messages received via unicast, see Section 18.4 ๐
When the server receives a valid Request message, it creates the bindings for that client according to the server's policy and configuration information, and it records the IAs and other information the client asked for ๐
The server builds a Reply message by setting the "msg-type" field to REPLY and copying the transaction ID from the Request message into the "transaction-id" field ๐
The server MUST include a Server Identifier option (see Section 21.3) with the server's DUID in the Reply message, along with the Client Identifier option (see Section 21.2) from the Request message ๐ซถ
The server examines all the IAs in the message from the client ๐
For each IA_NA option (see Section 21.4) and IA_TA option (see Section 21.5) in the Request message, the server checks whether the prefixes of the included addresses are appropriate for the link the client is connected to. If any of those prefixes are not appropriate for that link, the server MUST return the IA to the client with a Status Code option (see Section 21.13) set to the value NotOnLink. If the server doesn't send the NotOnLink status code but still can't assign any IP addresses to an IA, the server MUST return the IA option in the Reply message with no addresses in the IA, and a Status Code option containing status code NoAddrsAvail in the IA ๐
For any IA_PD option (see Section 21.21) in the Request message where the server can't assign any delegated prefixes, the server MUST return that IA_PD option in the Reply message with no prefixes in the IA_PD, and with a Status Code option containing status code NoPrefixAvail in the IA_PD ๐ฅบ
The server MAY assign different addresses and/or delegated prefixes to an IA than the ones included within the IA of the client's Request message ๐ฒ
For all the IAs the server can assign addresses or delegated prefixes to, the server includes those IAs with addresses (for IA_NAs and IA_TAs), prefixes (for IA_PDs), and other configuration parameters, and it records each IA as a new client binding. The server MUST NOT include any addresses or delegated prefixes in an IA that it does not assign to the client ๐ซ
The T1/T2 times set in each applicable IA option for a Reply MUST be the same values across all IAs. The server MUST determine those T1/T2 times across all of the applicable client's bindings in the Reply. This lets the client renew all of its bindings at the same time ๐
The server SHOULD include a Reconfigure Accept option (see Section 21.20) if the server policy enables the reconfigure mechanism and the client supports it. Right now, sending this option in a Reply is technically redundant, since using the reconfiguration mechanism requires authentication. At present, the only defined mechanism is RKAP (see Section 20.4), and the presence of the reconfigure key signals support for accepting Reconfigure messages. However, better security mechanisms may be defined in the future that would mean RKAP is no longer used ๐
The server includes other options with configuration information to be returned to the client, as described in Section 18.3 ๐
If the server finds that the client has included an IA in the Request message for which the server already has a binding associating that IA with the client, the server sends a Reply message with the existing bindings, possibly with updated lifetimes. The server may update the bindings according to its local policies. But the server SHOULD generate the response again and not simply retransmit previously sent information, even if the "transaction-id" field value matches a previous transmission. The server MUST NOT cache its responses ๐ โโ๏ธ๐
DISCUSSION: cached replies are a no-go, bestie ๐
Cached replies are bad because lifetimes need to be updated. You either decrease the timers by the amount of time that has passed since the original transmission, or you keep the lifetime values and update the lease information in the server's database. Also, if the message uses any security protection, such as the Replay Detection Method (RDM) described in Section 20.3, its value must be updated. Any digests must be updated too. Given all of that, caching replies is way more complex than just resending the same buffer as before, and it's really easy to miss some of those steps ๐คฏ
18.3.3. Receipt of Confirm Messages โจ
okay bestie, Confirm messages that come in over unicast have their own rules, so go check Section 18.4 for those ๐ . Unicast Confirm is a no-go no matter whether the Server Unicast option (see Section 21.12) is configured or not ๐
When the server gets a Confirm, it checks whether the addresses in it are appropriate for the link the client is attached to ๐. If every address passes, it returns a status of Success ๐. If any address fails, it returns NotOnLink ๐ซ. But if the server can't run that check (like, it doesn't have info about the prefixes on the client's link) or there were no addresses in any of the IAs the client sent, the server MUST NOT send a Reply to the client ๐. No reply = total ghost, fr.
The server ignores the T1 and T2 fields in the IA options, and also the preferred-lifetime and valid-lifetime fields in the IA Address options (see Section 21.6) ๐.
The server builds its Reply by setting the msg-type field to REPLY and copying the transaction ID from the Confirm into the transaction-id field ๐.
The server MUST include a Server Identifier option (see Section 21.3) with its DUID, plus the Client Identifier option (see Section 21.2) from the Confirm message ๐. It also includes a Status Code option (see Section 21.13) showing the status of the Confirm ๐ซถ.
18.3.4. Receipt of Renew Messages ๐
Renew messages that come in over unicast get routed to Section 18.4, so peep that too ๐
For each IA in a client's Renew, the server finds the client's binding and checks that the IA info from the client matches what's stored for that client ๐ต๏ธ
If the server finds the client entry for the IA, it sends the IA back with new lifetimes and, if applicable, T1/T2 times โฐ. If the server can't extend the lifetimes of an address or delegated prefix in the IA, it MAY choose not to include the IA Address option (see Section 21.6) for that address, or the IA Prefix option (see Section 21.22) for that delegated prefix ๐ฅฒ. If the server does include the IA Address or IA Prefix option for one of those, it SHOULD set T1 and T2 to the valid lifetime for the IA option, unless it also includes other addresses or delegated prefixes it can extend for that IA. Setting T1 and T2 equal to the valid lifetime tells the client that the leases tied to that IA won't be extended, so there's zero point in trying ๐ . It also keeps the server from generating unnecessary traffic as the remaining lifetime heads toward 0 ๐.
The server may choose to change the list of addresses or delegated prefixes, and the lifetimes in the IAs returned to the client ๐.
If the server finds that any addresses in the IA are not appropriate for the link the client is attached to, it returns that address to the client with lifetimes of 0 ๐ช. Same deal for delegated prefixes: if they aren't appropriate for the client's link, the server returns them with lifetimes of 0 ๐ช.
For each IA where the server can't find a client entry, the server has these choices, depending on its policy and configuration info ๐ง :
- If the server is configured to create new bindings as a result of processing Renew messages, the server SHOULD create a binding and return the IA with assigned addresses or delegated prefixes, lifetimes, T1/T2 times if applicable, and any other info the client asked for โจ. If the client put the IA Prefix option inside the IA_PD option (see Section 21.21) with a zero value in the
IPv6-prefixfield and a non-zero value in theprefix-lengthfield, the server MAY use theprefix-lengthvalue as a hint for the length of the prefixes to assign (see [RFC8168] for further details on prefix-length hints) ๐ฏ - If the server is configured to create new bindings from Renew processing but won't assign any leases to an IA, it returns the IA option with a Status Code option (see Section 21.13) holding the
NoAddrsAvailorNoPrefixAvailstatus code, plus a status message for a user ๐ญ - If the server doesn't support creating new bindings for the client sending a Renew, or if that behaviour is disabled by policy or config info, the server returns the IA option with a Status Code option holding the
NoBindingstatus code and a status message for a user ๐ซ
The server builds its Reply by setting msg-type to REPLY and copying the transaction ID from the Renew into transaction-id ๐
The server MUST include a Server Identifier option (see Section 21.3) with its DUID, and the Client Identifier option (see Section 21.2) from the Renew message ๐
It includes other options with config info to send back to the client, as described in Section 18.3 ๐
The server MAY include options with the IAs and values for other config parameters, even if the client didn't ask for them in the Renew ๐
The T1/T2 values set in each applicable IA option for a Reply MUST be the same across all IAs. The server MUST determine the T1/T2 values across all of the applicable client's bindings in the Reply. Bestie, this is the whole point: it lets the client renew all of its bindings at the same time ๐งธ
18.3.5. Receipt of Rebind Messages ๐ช
Unicast Rebind messages are not allowed, whether or not the Server Unicast option (see Section 21.12) is configured ๐ . Check Section 18.4 for how unicast is handled.
When the server gets a Rebind with an IA option from a client, it finds the client's binding and checks that the IA info matches what's stored for that client ๐ต๏ธ
If the server finds the client entry for the IA, and it decides the addresses or delegated prefixes in the IA are appropriate for the link the client's interface is attached to (going by its explicit config info), the server SHOULD send the IA back with new lifetimes and, if applicable, T1/T2 values ๐. If it can't extend the lifetimes of an address in the IA, it MAY choose not to include the IA Address option (see Section 21.6) for that address. If it can't extend the lifetimes of a delegated prefix in the IA, it MAY choose not to include the IA Prefix option (see Section 21.22) for that prefix.
If the server finds that the client entry for the IA, and any of the addresses or delegated prefixes, are no longer appropriate for the client's link (per the server's explicit config info), it returns those addresses or delegated prefixes to the client with lifetimes of 0 ๐ช
If the server can't find a client entry for the IA, it checks whether the IA contains addresses (for IA_NAs and IA_TAs) or delegated prefixes (for IA_PDs) ๐. It then checks whether those addresses and prefixes are appropriate for the client's link, using its explicit config info. For any address that isn't appropriate, the server MAY include the IA Address option with lifetimes of 0. For any delegated prefix that isn't appropriate, the server MAY include the IA Prefix option with lifetimes of 0. A Reply with lifetimes of 0 is an explicit heads-up to the client that those specific addresses and delegated prefixes are no longer valid, and they MUST NOT be used by the client ๐. If the server decides not to include any IAs with IA Address or IA Prefix options at lifetimes of 0, and it doesn't include any other IAs with leases and/or status codes, the server does not send a Reply message. In that case, it just discards the Rebind ๐๏ธ
Otherwise, for each IA where the server can't find a client entry, the server has these choices, depending on its policy and config info ๐ง :
- If the server is configured to create new bindings as a result of processing Rebind messages (also see the note below about the Rapid Commit option (Section 21.14)), the server SHOULD create a binding and return the IA with allocated leases, lifetimes, T1/T2 values if applicable, and other info the client asked for โจ. The server MUST NOT return any addresses or delegated prefixes in the IA that it doesn't assign to the client ๐ โโ๏ธ
- If the server is configured to create new bindings from Rebind processing but won't assign any leases to an IA, it returns the IA option with a Status Code option (see Section 21.13) holding the
NoAddrsAvailorNoPrefixAvailstatus code, plus a status message for a user ๐ญ - If the server doesn't support creating new bindings for the client sending a Rebind, or if that behaviour is disabled by policy or config info, it returns the IA option with a Status Code option holding the
NoBindingstatus code and a status message for a user ๐ซ
When the server creates new bindings for the IA, other servers might also create bindings from the same Rebind message. Check the "DISCUSSION" text in Section 21.14 for the tea ๐ That's why the server SHOULD only create new bindings while processing a Rebind if it's configured to respond with a Reply to a Solicit containing the Rapid Commit option โก
The server builds its Reply by setting msg-type to REPLY and copying the transaction ID from the Rebind into transaction-id ๐
The server MUST include a Server Identifier option (see Section 21.3) with its DUID, and the Client Identifier option (see Section 21.2) from the Rebind message ๐
It includes other options with config info to send back to the client, as described in Section 18.3 ๐
The server MAY include options with the IAs and values for other config parameters, even if those IAs and parameters weren't requested in the Rebind ๐
The T1 or T2 values set in each applicable IA option for a Reply MUST be the same values across all IAs. The server MUST determine the T1 or T2 values across all of the applicable client's bindings in the Reply. Again, this helps the client renew all of its bindings at the same time ๐ซถ
18.3.6. Receipt of Information-request Messages ๐ง
See Section 18.4 for the scoop on Information-request messages that come in via unicast ๐
Okay so when the server gets an Information-request, the client is only asking for configuration info. No lease assignments are involved, which is giving low-key drama-free vibes โจ The server works out all the configuration parameters that fit this client, based on the server configuration policies it knows about.
Next, the server builds a Reply message. It sets the msg-type field to REPLY and copies the transaction ID from the Information-request into the transaction-id field ๐
The server MUST include a Server Identifier option (see Section 21.3) that holds the server's DUID in the Reply ๐ซถ If the client put a Client Identifier option (see Section 21.2) in the Information-request, the server copies that option over to the Reply too. Main character energy for the client's identity ๐
The server adds options with the config info that gets sent back to the client, as described in Section 18.3. The server MAY also include extra options the client didn't ask for in the Information-request. Generous bestie behavior ๐
If the Information-request didn't have a Client Identifier option, the server SHOULD still respond with a Reply containing whatever config parameters aren't tied to the client's identity ๐ธ If the server decides not to respond, the client may keep retransmitting the Information-request forever. Yikes, but valid ๐
18.3.7. Receipt of Release Messages ๐ฆ
See Section 18.4 for the details on Release messages that come in via unicast ๐ฌ
The server builds a Reply message by setting the msg-type field to REPLY and copying the transaction ID from the Release into the transaction-id field โจ
When a valid Release shows up, the server checks out the IAs and the leases inside them for validity ๐ If the IAs in the message belong to a binding for the client, and the leases in those IAs were assigned by the server to those IAs, then the server deletes the leases from the IAs and makes them available for other clients to grab ๐ The server ignores any leases that weren't assigned to the IAs, though it may choose to log an error. Lowkey petty, but fair ๐
Once all the leases are processed, the server generates a Reply message. It includes a Status Code option (see Section 21.13) with the value Success, a Server Identifier option (see Section 21.3) with the server's DUID, and a Client Identifier option (see Section 21.2) with the client's DUID ๐ For each IA in the Release where the server has no binding info, the server adds an IA option using the IAID from the Release. It then includes a Status Code option with the value NoBinding inside that IA option. No other options go in the IA option, so keep it clean ๐งผ
A server may choose to keep a record of assigned leases and IAs even after the lease lifetimes have expired. That way it can reassign those previously assigned leases to a client later on ๐ Memory like an elephant ๐๐
18.3.8. Receipt of Decline Messages ๐ท
See Section 18.4 for the details on Decline messages that come in via unicast ๐ฌ
Upon receiving a valid Decline, the server examines the IAs and the addresses in them for validity ๐ If the IAs in the message belong to a binding for the client, and the addresses in those IAs were assigned by the server to those IAs, the server deletes the addresses from the IAs. The server ignores any addresses that weren't assigned to the IAs (though it may choose to log an error if it finds such addresses) ๐
Here's the tea ๐ต The client has found any addresses in the Decline messages to be already in use on its link. So the server SHOULD mark the declined addresses so they don't get assigned to other clients. It MAY also choose to make a notification that addresses were declined ๐ซ Local policy on the server decides when the addresses named in a Decline may be made available for assignment again โฐ
After all the addresses are processed, the server generates a Reply message by setting the msg-type field to REPLY and copying the transaction ID from the Decline into the transaction-id field. The client includes a Status Code option (see Section 21.13) with the value Success, a Server Identifier option (see Section 21.3) with the server's DUID, and a Client Identifier option (see Section 21.2) with the client's DUID ๐ For each IA in the Decline where the server has no binding info, the server adds an IA option using the IAID from the Decline and includes a Status Code option with the value NoBinding in the IA option. No other options are included in the IA option ๐ซง
18.3.9. Creation of Advertise Messages ๐ฃ
The server sets the msg-type field to ADVERTISE and copies the contents of the transaction-id field from the Solicit message the client sent over into the Advertise message ๐ฆ The server puts its server identifier in a Server Identifier option (see Section 21.3) and copies the Client Identifier option (see Section 21.2) from the Solicit into the Advertise โจ
The server MAY add a Preference option (see Section 21.8) to carry the preference value for the Advertise message ๐ The server implementation SHOULD let the administrator set a server preference value. The server preference value MUST default to 0 unless the server administrator configures something else ๐ข
If the server wants to say it supports the Reconfigure mechanism, it includes a Reconfigure Accept option (see Section 21.20) ๐ The client might use that info during server selection, so it's a whole vibe ๐
The server includes the options it will return to the client in a later Reply message. The client can use the info in these options to pick a server if it gets more than one Advertise ๐ The server MUST include options in the Advertise message with config parameters for all the options named in the Option Request option (see Section 21.7) from the Solicit, as long as the server is set up to return them to the client ๐ซถ If the Option Request option includes a container option, the server MUST include all the options that are eligible to be encapsulated in that container ๐ฆ The Option Request option MAY be used to signal support for a feature even when that option is encapsulated, like with the Prefix Exclude option [RFC6603]. When that happens, the server needs special processing ๐ง The server MAY also return additional options to the client if it's been configured to do that ๐
The server MUST include IA options in the Advertise message with any addresses and/or delegated prefixes that would be assigned to the IAs in the client's Solicit ๐ If the client put addresses in IA Address options (see Section 21.6) in the Solicit, the server MAY use those addresses as hints about what the client would like to get ๐ญ If the client included IA Prefix options (see Section 21.22), the server MAY use the prefix in the IPv6-prefix field and/or the prefix length in the prefix-length field as hints about the prefixes the client wants ๐ But if the server isn't going to assign an address or delegated prefix that came in as a hint, the server MUST NOT include it in the Advertise message ๐
โโ๏ธ
If the server won't assign any addresses to an IA_NA or IA_TA in later Request messages from the client, the server MUST include the IA option in the Advertise message with no addresses in that IA. It also has to include a Status Code option (see Section 21.13) inside the IA option with the status code NoAddrsAvail ๐
If the server won't assign any prefixes to an IA_PD in later Request messages from the client, the server MUST include the IA_PD option (see Section 21.21) in the Advertise message with no prefixes in it. It also needs a Status Code option encapsulated in the IA_PD with the status code NoPrefixAvail ๐ซ
Transmission of Advertise messages is covered in the next section โ๏ธ
18.3.10. Transmission of Advertise and Reply Messages ๐
If the server got the original message directly, it unicasts the Advertise or Reply straight to the client. It uses the address in the source address field of the IP datagram the original message came in on ๐ฏ The Advertise or Reply MUST be unicast through the same interface the original message was received on ๐
If the original message came in a Relay-forward message, the server builds a Relay-reply message with the Reply in the payload of a Relay Message option (see Section 21.10) ๐ฎ If the Relay-forward messages had an Interface-Id option (see Section 21.18), the server copies that option into the Relay-reply. Then it unicasts the Relay-reply directly to the relay agent, using the address in the source address field of the IP datagram the Relay-forward arrived in ๐ฆ See Section 19.3 for more details on building Relay-reply messages ๐
18.3.11. Creation and Transmission of Reconfigure Messages โจ
okay so the server sets the msg-type field to RECONFIGURE and the transaction-id field to 0 ๐
It also includes a Server Identifier option (see Section 21.3) with its DUID, and a Client Identifier option (see Section 21.2) with the client's DUID, in the Reconfigure message ๐
bestie, DoS attacks against DHCP clients are a real risk (denial-of-service, aka DoS ๐ญ), so a security mechanism is mandated in Reconfigure messages ๐ The server MUST use DHCP authentication in the Reconfigure message (see Section 20.4). no skipping this one ๐ โโ๏ธ
The server MUST include a Reconfigure Message option (see Section 21.19) to pick whether the client responds with a Renew message, a Rebind message, or an Information-request message ๐ฆ
The server MUST NOT include any other options in the Reconfigure message, except as specifically allowed in the definition of individual options. the vibe is minimal, minimal, minimal ๐ธ
A server sends each Reconfigure message to a single DHCP client, using an IPv6 unicast address of sufficient scope that belongs to that DHCP client ๐ If the server doesn't have an address it can use to send the Reconfigure message directly to the client, it uses a Relay-reply message (as described in Section 19.3) to send the Reconfigure message to a relay agent, and that relay agent relays it to the client ๐ง The server may figure out the client's address (and the right relay agent, if needed) from the info it has about clients that have been in contact with it (see Section 18.3), or through some external agent ๐
to reconfigure more than one client, the server unicasts a separate message to each client ๐ The server may kick off the reconfiguration of multiple clients at the same time. for example, it can send a Reconfigure message to more clients while earlier reconfiguration message exchanges are still in progress โญ
the Reconfigure message makes the client start a Renew/Reply, Rebind/Reply, or Information-request/Reply message exchange with the server ๐ The server counts the receipt of a Renew, Rebind, or Information-request message from the client (whichever one was specified in the original Reconfigure message) as satisfying the Reconfigure message request โ
when the server transmits the Reconfigure message, it sets the retransmission time (RT) to REC_TIMEOUT โฑ๏ธ If the server doesn't receive a Renew, Rebind, or Information-request message from the client before the RT elapses, it retransmits the Reconfigure message, doubles the RT value, and waits again ๐ It keeps doing this until REC_MAX_RC unsuccessful attempts have been made. at that point the server SHOULD abort the reconfigure process for that client ๐
Default and initial values for REC_TIMEOUT and REC_MAX_RC are documented in Section 7.6 ๐
18.4. Reception of Unicast Messages ๐ช
unless the subsections of Section 18.3 that discuss the receipt of specific messages say otherwise, the server is not supposed to accept unicast traffic when it isn't explicitly configured to do so ๐ For example, unicast transmission isn't allowed for Solicit, Confirm, and Rebind messages (see Sections 18.3.1, 18.3.3, and 18.3.5, respectively), even if the Server Unicast option (see Section 21.12) is configured. For Request, Renew, Information-request, Release, and Decline messages, it's allowed only if the Server Unicast option is configured ๐ซถ
when the server gets a unicast message from a client that it has not sent a Server Unicast option to (or isn't currently configured to do so for), the server discards that message ๐๏ธ and responds with an Advertise (when responding to a Solicit message) or a Reply message (when responding to any other message). that response contains a Status Code option (see Section 21.13) with the value UseMulticast, a Server Identifier option (see Section 21.3) with the server's DUID, the Client Identifier option (see Section 21.2) from the client message (if there is one), and no other options ๐
19. Relay Agent Behavior ๐
the relay agent SHOULD be configured to use a list of destination addresses that includes unicast addresses ๐ฏ The list of destination addresses MAY include the All_DHCP_Servers multicast address or other addresses picked by the network administrator ๐งโ๐ผ If the relay agent hasn't been explicitly configured, it MUST use the All_DHCP_Servers multicast address as the default. no debate ๐ค
if the relay agent relays messages to the All_DHCP_Servers multicast address or other multicast addresses, it sets the Hop Limit field to 8 ๐ฆ
if the relay agent receives a message other than Relay-forward and Relay-reply, and it doesn't recognize that message's type, it MUST forward the message as described in Section 19.1.1 ๐ง
19.1. Relaying a Client Message or a Relay-forward Message ๐
a relay agent relays both messages from clients and Relay-forward messages from other relay agents ๐ When a relay agent receives a Relay-forward message, a recognized message type that it is not the intended target for, or an unrecognized message type [RFC7283], it builds a new Relay-forward message. The relay agent copies the source address from the header of the IP datagram in which the message was received into the peer-address field of the Relay-forward message ๐ฌ It also copies the received DHCP message (excluding any IP or UDP headers) into a Relay Message option (see Section 21.10) in the new message. Finally, it adds to the Relay-forward message any other options it's configured to include ๐
[RFC6221] defines a Lightweight DHCPv6 Relay Agent (LDRA) that lets relay agent information get inserted by an access node that does a link-layer bridging (i.e., non-routing) function ๐ธ
19.1.1. Relaying a Message from a Client ๐งโ๐คโ๐ง
if the relay agent got the message to relay from a client, it puts a globally scoped unicast address (i.e., GUA or ULA) from a prefix assigned to the link where the client should get leases into the link-address field ๐ก If there's no such address available, the relay agent may set the link-address field to a link-local address from the interface the original message came in on. this is not recommended, as it may require extra info in the server configuration. See Section 3.2 of [RFC7969] for a detailed discussion ๐
this address is what the server uses to figure out which link the client should get leases and other config info from ๐
the hop-count value in the Relay-forward message is set to 0 ๐ข
if the relay agent can't use the address in the link-address field to identify the interface where the response to the client will be relayed, the relay agent MUST include an Interface-Id option (see Section 21.18) in the Relay-forward message ๐จ The server will include the Interface-Id option in its Relay-reply message ๐ The relay agent sets the link-address field as described earlier in this subsection, whether or not it includes an Interface-Id option in the Relay-forward message โจ
19.1.2. Relaying a Message from a Relay Agent ๐ช
if the message the relay agent receives is a Relay-forward message and the hop-count value in it is greater than or equal to HOP_COUNT_LIMIT, the relay agent discards the received message ๐
the relay agent copies the source address from the IP datagram in which the message was received into the peer-address field in the Relay-forward message, and sets the hop-count field to the hop-count value from the received message plus 1 โ
if the source address from the IP datagram header of the received message is a globally scoped unicast address (i.e., GUA or ULA), the relay agent sets the link-address field to 0 ๐ Otherwise, the relay agent sets the link-address field to a globally scoped unicast address (i.e., GUA or ULA) assigned to the interface the message was received on, or it includes an Interface-Id option (see Section 21.18) to identify the interface the message was received on ๐ซถ
19.1.3. Relay Agent Behavior with Prefix Delegation ๐ท
a relay agent forwards messages containing prefix delegation options the same way it would relay addresses (i.e., per Sections 19.1.1 and 19.1.2) ๐ฆ
if a server talks to a client through a relay agent about delegated prefixes, the server may need a protocol or other out-of-band communication to configure routing information for the delegated prefixes on any router the client might forward traffic through ๐บ๏ธ
19.2. Relaying a Relay-reply Message ๐ฎ
the relay agent processes any options included in the Relay-reply message, in addition to the Relay Message option (see Section 21.10) ๐งพ
the relay agent extracts the message from the Relay Message option and relays it to the address in the peer-address field of the Relay-reply message. Relay agents MUST NOT modify the message. hands off, no edits ๐
if the Relay-reply message includes an Interface-Id option (see Section 21.18), the relay agent relays the message from the server to the client on the link identified by that Interface-Id option ๐ฏ Otherwise, if the link-address field is not set to 0, the relay agent relays the message on the link identified by the link-address field ๐
if the relay agent receives a Relay-reply message, it MUST process the message as defined above, regardless of the type of message encapsulated in the Relay Message option. no exceptions, periodt ๐ ๐
19.3. Construction of Relay-reply Messages โจ
okay so the server uses a Relay-reply message for two things ๐ (1) sending a response back to a client when the original message got relayed to the server inside a Relay-forward message, or (2) sending a Reconfigure message to a client when the server doesn't have an address it can use to reach the client directly ๐ฆ
a response to the client MUST be relayed through the same relay agents as the original client message ๐ the server makes that happen by building a Relay-reply message with a Relay Message option (see Section 21.10) holding the message for the next relay agent on the way back to the client. that contained Relay-reply message has its own Relay Message option for the next relay agent, and so on ๐ง the server must record the contents of the peer-address fields in the received message so it can build the right Relay-reply message carrying the server's response ๐ซถ
for example, say client C sent a message that relay agent A relayed to relay agent B, and then B relayed it to the server. the server would send this Relay-reply message to relay agent B:
msg-type: RELAY-REPL
hop-count: 1
link-address: 0
peer-address: A
Relay Message option containing the following:
msg-type: RELAY-REPL
hop-count: 0
link-address: address from link to which C is attached
peer-address: C
Relay Message option: <response from server>
Figure 10: Relay-reply Example
when the server sends a Reconfigure message to a client through a relay agent, it creates a Relay-reply message with a Relay Message option holding the Reconfigure message for the next relay agent on the return path to the client ๐ธ the server sets the peer-address field in the Relay-reply message header to the client's address, and sets the link-address field however the relay agent needs it to relay the Reconfigure message to the client ๐ the server gets the addresses of the client and the relay agent through earlier interaction with the client or through some external mechanism โจ
19.4. Interaction between Relay Agents and Servers ๐
every time a relay agent relays a packet toward a server, a new encapsulation level gets wrapped around the packet ๐ each relay can insert additional options on the encapsulation level it added, but it MUST NOT change anything in the packet being encapsulated ๐ if there are multiple relays between a client and a server, multiple encapsulations get used. yes it makes packet processing a little more complex, but the big upside is a clear record of which relay inserted which option ๐ the response packet is expected to travel through the same relays, just in reverse order. every time a response gets relayed back toward a client, one encapsulation level is removed ๐ฆ
relays can add one or more options in certain cases ๐ they can do that for a few reasons:
- First, relays can give the server extra info about the client. that info usually comes from the network infrastructure instead of the client, so server admins tend to trust it more, and it can't be easily spoofed ๐ฅ the server can use these options to decide its allocation policy.
- Second, a relay might need some info to send a response back to the client. relay agents are expected to be stateless (not retaining any state after a packet has been processed) ๐ a relay agent may include the Interface-Id option (see Section 21.18), which gets echoed back in the response. it can include other options too, and ask the server to echo one or more of them back in the response. the relay agent can then use those options to send the response back to the client, or for other needs โจ the client never sees these options. see [RFC4994] for details.
- Third, sometimes a relay is the best device to supply values for certain options ๐ง a relay can insert an option into the packet it forwards to the server and ask the server to pass that option back to the client, and then the client will receive it ๐ it's worth noting that the server is the ultimate authority here. depending on its configuration, it may or may not send the option back to the client ๐ see [RFC6422] for details.
servers may need to keep the relay information even after packet processing is done ๐ซถ two big reasons. one is a bulk leasequery mechanism that might ask for all the addresses and/or prefixes that were assigned via a specific relay. the other is the reconfigure mechanism ๐ท the server may choose to send the Reconfigure message via relays instead of directly to the client. this particular behavior is considered an implementation detail and is out of scope for this document ๐
20. Authentication of DHCP Messages ๐
this document introduces two security mechanisms for authenticating DHCP messages ๐ก๏ธ (1) authentication (and encryption) of messages sent between servers and relay agents using IPsec, and (2) protection against a client getting misconfigured by a Reconfigure message sent from a malicious DHCP server ๐ญ
the delayed authentication protocol, defined in [RFC3315], has been obsoleted by this document (see Section 25) ๐
20.1. Security of Messages Sent between Servers and Relay Agents ๐
relay agents and servers that exchange messages can use IPsec as detailed in [RFC8213] ๐ซถ
20.2. Summary of DHCP Authentication ๐
authentication of DHCP messages happens through the Authentication option (see Section 21.11) ๐ the authentication info in that option can reliably identify where a DHCP message came from, and confirm that its contents haven't been tampered with ๐
the Authentication option gives you a framework for multiple authentication protocols ๐ง one of them, RKAP, is defined in Section 20.4. other protocols defined in the future will be specified in separate documents ๐
any DHCP message MUST NOT include more than one Authentication option ๐ โโ๏ธ
the protocol field in the Authentication option tells you which specific protocol generated the authentication info carried in the option ๐ฅ the algorithm field identifies a specific algorithm within that protocol. for example, it specifies the hash algorithm used to generate the Message Authentication Code (MAC) in the Authentication option ๐ the RDM field specifies the type of replay detection used in the replay detection field โจ
20.3. Replay Detection ๐
the RDM field of the Authentication option (see Section 21.11) determines the type of replay detection used in the replay detection field ๐
if the RDM field contains 0x00, the replay detection field MUST be set to the value of a strictly monotonically increasing 64-bit unsigned integer (modulo 2^64) ๐ฆ using this technique can reduce the danger of replay attacks ๐ณ this method MUST be supported by all Authentication option protocols. one choice might be to use the 64-bit NTP timestamp format [RFC5905]).
a client that receives a message with the RDM field set to 0x00 MUST compare its replay detection field with the previous value sent by that same server (based on the Server Identifier option; see Section 21.3). it should only accept the message if the received value is greater, and record that as the new value ๐ซถ hmm wait, correction for accuracy: a client MUST only accept the message if the received value is greater, and it records this as the new value ๐ if this is the first time a client processes an Authentication option sent by a server, the client MUST record the replay detection value and skip the replay detection check โจ
servers that support the reconfigure mechanism MUST ensure that the replay detection value is retained between restarts ๐ failing to do so may cause clients to refuse Reconfigure messages sent by the server, which effectively renders the reconfigure mechanism useless ๐ญ
20.4. Reconfiguration Key Authentication Protocol (RKAP) ๐๏ธ
RKAP protects a client against misconfiguration caused by a Reconfigure message sent by a malicious DHCP server ๐ก๏ธ in this protocol, a DHCP server sends a reconfigure key to the client during the initial exchange of DHCP messages. the client records that key and uses it to authenticate later Reconfigure messages from that server. then the server includes a Hashed Message Authentication Code (HMAC) computed from the reconfigure key in those subsequent Reconfigure messages ๐ง
both the reconfigure key sent from server to client and the HMAC in later Reconfigure messages get carried as the authentication info in an Authentication option (see Section 21.11) ๐ the format of that authentication info is defined in the following section ๐
RKAP gets used (initiated by the server) only if the client and server have negotiated to use Reconfigure messages ๐ธ
20.4.1. Use of the Authentication Option in RKAP ๐
the following fields get set in an Authentication option (see Section 21.11) for RKAP:
protocol 3
algorithm 1
RDM 0
the format of the authentication info for RKAP looks like this:
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 | Value (128 bits) |
+-+-+-+-+-+-+-+-+ |
. .
. .
. +-+-+-+-+-+-+-+-+
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Figure 11: RKAP Authentication Information
Type: the type of data in the Value field carried in this option:- 1: Reconfigure key value (used in the Reply message).
- 2: HMAC-MD5 digest of the message (used in the Reconfigure message).
- this is a 1-octet field.
Value: data as defined by the Type field. this is a 16-octet field. ๐ง
20.4.2. Server Considerations for RKAP ๐ค
the server selects a reconfigure key for a client during the Request/Reply, Solicit/Reply, or Information-request/Reply message exchange ๐ท the server records the reconfigure key and sends that key to the client in an Authentication option (see Section 21.11) in the Reply message โจ
the reconfigure key is 128 bits long, and it MUST be a cryptographically strong random or pseudorandom number that cannot easily be predicted ๐
to provide authentication for a Reconfigure message, the server selects a replay detection value according to the RDM it selected, and computes an HMAC-MD5 of the Reconfigure message using the client's reconfigure key ๐ the server computes the HMAC-MD5 over the entire DHCP Reconfigure message, including the Authentication option. the HMAC-MD5 field in the Authentication option is set to 0 for that computation ๐งฎ the server then includes the HMAC-MD5 in the authentication info field of an Authentication option in the Reconfigure message sent to the client ๐ซถ
20.4.3. Client Considerations for RKAP โจ
Okay, bestie, now let's talk about the client's side of RKAP ๐ซถ The client gets a reconfigure key from the server inside an Authentication option (see Section 21.11) in the initial Reply message ๐ The client records that key so it can use it to authenticate Reconfigure messages that come later ๐
To check a Reconfigure message, the client computes an HMAC-MD5 over the Reconfigure message, with zeroes substituted for the HMAC-MD5 field, using the reconfigure key received from the server ๐งฎ If that computed HMAC-MD5 matches the value in the Authentication option, the client accepts the Reconfigure message ๐
21. DHCP Options โจ
Options are how DHCP messages carry extra information and parameters ๐ Every option shares the same base format (see Section 21.1), and all values in options are represented in network byte order ๐ธ
This document describes the DHCP options defined as part of the base DHCP specification. Other options may be defined in the future in separate documents. See [RFC7227] for guidelines on defining new options. See Section 24 for more about the DHCPv6 "Option Codes" registry that IANA maintains ๐ฆ
Unless otherwise noted, each option may appear only in the options area of a DHCP message, and it may appear only once. If an option does show up multiple times, each instance is treated separately, and the data areas of the options MUST NOT be concatenated or otherwise combined. Not me trying to mash them together ๐
Options that are allowed to appear only once are called "singleton options" ๐ The only non-singleton options defined in this document are the IA_NA (see Section 21.4), IA_TA (see Section 21.5), Vendor Class (see Section 21.16), Vendor-specific Information (see Section 21.17), and IA_PD (see Section 21.21) options. IA Address (see Section 21.6) and IA Prefix (see Section 21.22) are also allowed to appear more than once inside their respective IA options ๐
21.1. Format of DHCP Options ๐
Every option uses this 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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| option-code | option-len |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| option-data |
| (option-len octets) |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Figure 12: Option Format
option-code An unsigned integer identifying the specific
option type carried in this option.
A 2-octet field.
option-len An unsigned integer giving the length of the
option-data field in this option in octets.
A 2-octet field.
option-data The data for the option; the format of this
data depends on the definition of the option.
A variable-length field (the length, in
octets, is specified by option-len).
Options get scoped through encapsulation ๐ง Some apply to the client as a whole, some belong to a specific IA, and some belong to the addresses inside an IA. The last two cases are covered in Sections 21.4, 21.5, and 21.6 ๐
21.2. Client Identifier Option ๐ธ
The Client Identifier option carries a DUID (see Section 11) that identifies the client ๐ชช Here's its 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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| OPTION_CLIENTID | option-len |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
. .
. DUID .
. (variable length) .
. .
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Figure 13: Client Identifier Option Format
option-code OPTION_CLIENTID (1).
option-len Length of DUID in octets.
DUID The DUID for the client.
21.3. Server Identifier Option ๐ฆ
The Server Identifier option carries a DUID (see Section 11) that identifies the server ๐ฅ๏ธโจ Here's its 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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| OPTION_SERVERID | option-len |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
. .
. DUID .
. (variable length) .
. .
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Figure 14: Server Identifier Option Format
option-code OPTION_SERVERID (2).
option-len Length of DUID in octets.
DUID The DUID for the server.
21.4. Identity Association for Non-temporary Addresses Option ๐
The IA_NA option carries an IA_NA, the parameters associated with that IA_NA, and the non-temporary addresses tied to it ๐ก
Addresses in an IA_NA option are not temporary addresses (see Section 21.5) ๐ โโ๏ธ
Here's the format of the IA_NA option:
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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| OPTION_IA_NA | option-len |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| IAID (4 octets) |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| T1 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| T2 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| |
. IA_NA-options .
. .
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Figure 15: Identity Association for Non-temporary Addresses
Option Format
option-code OPTION_IA_NA (3).
option-len 12 + length of IA_NA-options field.
IAID The unique identifier for this IA_NA; the
IAID must be unique among the identifiers for
all of this client's IA_NAs. The number
space for IA_NA IAIDs is separate from the
number space for other IA option types (i.e.,
IA_TA and IA_PD). A 4-octet field containing
an unsigned integer.
T1 The time interval after which the client
should contact the server from which the
addresses in the IA_NA were obtained to
extend the lifetimes of the addresses
assigned to the IA_NA; T1 is a time duration
relative to the current time expressed in
units of seconds. A 4-octet field containing
an unsigned integer.
T2 The time interval after which the client
should contact any available server to extend
the lifetimes of the addresses assigned to
the IA_NA; T2 is a time duration relative to
the current time expressed in units of
seconds. A 4-octet field containing an
unsigned integer.
IA_NA-options Options associated with this IA_NA. A
variable-length field (12 octets less than
the value in the option-len field).
The IA_NA-options field holds the options that are specific to this IA_NA ๐ For example, every IA Address option (see Section 21.6) carrying an address for this IA_NA lives in the IA_NA-options field ๐งบ
Each IA_NA carries one "set" of non-temporary addresses ๐ท The server policy decides how many addresses get assigned, but typically at most one address is assigned from each prefix assigned to the link the client is attached to ๐
An IA_NA option may only appear in the options area of a DHCP message. A DHCP message can contain multiple IA_NA options, though each one must have a unique IAID ๐ฅ
Any status for operations involving this IA_NA shows up in a Status Code option (see Section 21.13) inside the IA_NA-options field ๐ฆ
Heads up: an IA_NA doesn't have an explicit "lifetime" or "lease length" of its own ๐ Once the valid lifetimes of all of its addresses have run out, the IA_NA can be considered expired. T1 and T2 exist so servers have explicit control over when a client checks back in about a specific IA_NA โฐ
In a message sent by a client to a server, the T1 and T2 fields SHOULD be set to 0. The server MUST ignore any values in these fields in messages received from a client ๐
In a message sent by a server to a client, the client MUST use the values in the T1 and T2 fields for the T1 and T2 times, unless those fields are 0. The values in the T1 and T2 fields are the number of seconds until T1 and T2, and they're calculated from when the message was received ๐ฐ๏ธ
As per Section 7.7, the value 0xffffffff is taken to mean "infinity" and should be used carefully ๐
The server picks the T1 and T2 values so the client can extend the lifetimes of any addresses in the IA_NA before they expire, even if the server is unavailable for a short while ๐ซถ Recommended values for T1 and T2 are 0.5 and 0.8 times the shortest preferred lifetime of the addresses in the IA that the server is willing to extend, respectively. If that "shortest" preferred lifetime is 0xffffffff ("infinity"), the recommended T1 and T2 values are also 0xffffffff โพ๏ธ If the server wants the client to decide when to renew the addresses in an IA_NA, it sets the T1 and T2 values to 0. The client MUST follow the rules defined in Section 14.2 ๐
If a client receives an IA_NA with T1 greater than T2, and both T1 and T2 are greater than 0, the client discards the IA_NA option and processes the rest of the message as though the server had never included that invalid IA_NA option ๐๏ธโจ
21.5. Identity Association for Temporary Addresses Option โจ
okay so the IA_TA option is the thing that carries an IA_TA ๐, plus its parameters and the addresses that belong to it. every address in here is used by the client as a temporary address, as defined in [RFC4941] ๐ง. the layout looks like this:
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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| OPTION_IA_TA | option-len |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| IAID (4 octets) |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| |
. IA_TA-options .
. .
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Figure 16: Identity Association for Temporary Addresses Option Format
here's the breakdown ๐ :
option-code: OPTION_IA_TA (4).option-len: 4 + length of IA_TA-options field.IAID: the unique identifier for this IA_TA. it has to be unique among the identifiers for all of this client's IA_TAs. the number space for IA_TA IAIDs is separate from the number space for other IA option types (i.e., IA_NA and IA_PD). it's a 4-octet field holding an unsigned integer.IA_TA-options: options associated with this IA_TA. it's variable-length, 4 octets less than the value in the option-len field.
the IA_TA-options field is where all the IA_TA-specific stuff lives ๐ธ. for example, all of the IA Address options (see Section 21.6) that carry this IA_TA's addresses sit in the IA_TA-options field.
each IA_TA carries one "set" of temporary addresses ๐ฆ. how many addresses actually get assigned is up to the server policy.
an IA_TA option may only show up in the options area of a DHCP message. a DHCP message can contain multiple IA_TA options, but each one needs its own unique IAID ๐.
the status of any operation involving this IA_TA gets reported in a Status Code option (see Section 21.13) inside the IA_TA-options field.
ngl this one's kind of a plot twist: an IA has no explicit "lifetime" or "lease length" of its own ๐. once the valid lifetimes of all the addresses in an IA_TA have expired, the IA can be considered expired.
an IA_TA option does not include values for T1 and T2 ๐. a client MAY ask for the valid lifetime of its temporary addresses to be extended by putting those addresses in an IA_TA option sent in a Renew or Rebind message to a server. like, a client might ask for an extension so an app can keep using an established TCP connection. extending only the valid lifetime (and not the preferred one) means the address will eventually end up in a deprecated state. existing connections can keep going, but no new ones will be created with that address.
to get brand new temporary addresses, the client sends an IA_TA option with a new IAID to a server ๐. asking for new ones is basically the same as generating new temporary addresses as described in [RFC4941]. the server generates them and sends them back. the client should request new temporary addresses before the lifetimes on the old ones run out โฐ.
a server MUST return the same set of temporary addresses for the same IA_TA (as identified by the IAID) for as long as those addresses are still valid ๐ฅ. once the lifetimes of the addresses in an IA_TA have expired, the IAID may be reused to identify a new IA_TA with new temporary addresses.
21.6. IA Address Option โจ
the IA Address option specifies an address tied to an IA_NA or an IA_TA ๐. it has to be encapsulated in the IA_NA-options field of an IA_NA option (see Section 21.4) or the IA_TA-options field of an IA_TA option (see Section 21.5). the IAaddr-options field holds the options specific to this one address.
the format is:
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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| OPTION_IAADDR | option-len |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| |
| IPv6-address |
| |
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| preferred-lifetime |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| valid-lifetime |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
. .
. IAaddr-options .
. .
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Figure 17: IA Address Option Format
the fields, explained ๐ง:
option-code: OPTION_IAADDR (5).option-len: 24 + length of IAaddr-options field.IPv6-address: an IPv6 address. a client MUST NOT form an implicit prefix with a length other than 128 for this address. it's a 16-octet field.preferred-lifetime: the preferred lifetime for the address in the option, in seconds. it's a 4-octet unsigned integer.valid-lifetime: the valid lifetime for the address in the option, in seconds. also a 4-octet unsigned integer.IAaddr-options: options associated with this address. it's variable-length, 24 octets less than the value in the option-len field.
when a client sends this to a server, the preferred-lifetime and valid-lifetime fields SHOULD be set to 0 ๐. the server MUST ignore any values it receives in them.
the client SHOULD NOT send the IA Address option with the unspecified address (::) ๐ซ.
when a server sends this to a client, the client MUST use the values in the preferred-lifetime and valid-lifetime fields as its preferred and valid lifetimes. those values are the number of seconds still left on each lifetime โณ.
the client MUST discard any addresses where the preferred lifetime is greater than the valid lifetime ๐๏ธ.
as per Section 7.7, if the valid lifetime of an address is 0xffffffff, it means "infinity" and should be used carefully ๐.
more than one IA Address option can show up in an IA_NA option or an IA_TA option ๐ก.
the status of any operation involving this IA Address gets reported in a Status Code option in the IAaddr-options field, as specified in Section 21.13 โ .
21.7. Option Request Option โจ
the Option Request option is how a client and server agree on a list of options in a message ๐. the format is:
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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| OPTION_ORO | option-len |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| requested-option-code-1 | requested-option-code-2 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| ... |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Figure 18: Option Request Option Format
option-code: OPTION_ORO (6).option-len: 2 * number of requested options.requested-option-code-n: the option code for an option the client requested. each option code is a 2-octet unsigned integer.
a client MUST include an Option Request option in a Solicit, Request, Renew, Rebind, or Information-request message ๐โโ๏ธ. that tells the server which options the client wants sent back. for certain message types, some option codes MUST be included in the Option Request option. see Table 4 for the details ๐.
the Option Request option MUST NOT include the following options ๐ซ:
- Client Identifier (see Section 21.2)
- Server Identifier (see Section 21.3)
- IA_NA (see Section 21.4)
- IA_TA (see Section 21.5)
- IA_PD (see Section 21.21)
- IA Address (see Section 21.6)
- IA Prefix (see Section 21.22)
- Option Request (this section)
- Elapsed Time (see Section 21.9)
- Preference (see Section 21.8)
- Relay Message (see Section 21.10)
- Authentication (see Section 21.11)
- Server Unicast (see Section 21.12)
- Status Code (see Section 21.13)
- Rapid Commit (see Section 21.14)
- User Class (see Section 21.15)
- Vendor Class (see Section 21.16)
- Interface-Id (see Section 21.18)
- Reconfigure Message (see Section 21.19)
- Reconfigure Accept (see Section 21.20)
heads up ๐จ: other top-level options MUST appear in the Option Request option, or the server won't send them. only top-level options MAY appear in it. options encapsulated in a container option SHOULD NOT appear in an Option Request option. see [RFC7598] for an example of container options. however, options MAY be defined that specify exceptions to this restriction on including encapsulated options. for example, the Option Request option MAY be used to signal support for a feature even when that option is encapsulated, like with the Prefix Exclude option [RFC6603]. see Table 4 โจ.
21.8. Preference Option ๐
okay so the Preference option is how a server nudges a client toward picking it ๐ it's giving main character energy ๐
The format of the Preference option is:
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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| OPTION_PREFERENCE | option-len |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| pref-value |
+-+-+-+-+-+-+-+-+
Figure 19: Preference Option Format
option-code:OPTION_PREFERENCE (7)๐option-len:1โจpref-value: the preference value for the server in this message. It's a 1-octet unsigned integer.
A server MAY include a Preference option in an Advertise message to control the selection of a server by the client. Check out Section 18.2.9 for how the client uses the Preference option and how it reads that data value ๐ง
21.9. Elapsed Time Option โฑ๏ธ
The Elapsed Time option is basically the client's "how long have I been waiting, bestie?" stopwatch ๐ฅบ
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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| OPTION_ELAPSED_TIME | option-len |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| elapsed-time |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Figure 20: Elapsed Time Option Format
option-code:OPTION_ELAPSED_TIME (8)๐option-len:2๐elapsed-time: the amount of time since the client began its current DHCP transaction. It's measured in hundredths of a second (10^-2 seconds) and is a 2-octet field holding an unsigned integer.
A client MUST include an Elapsed Time option in messages to show how long it has been trying to finish a DHCP message exchange. The clock starts when the client sends the first message in the exchange, and the elapsed-time field is set to 0 in that first message ๐ซถ Servers and relay agents read this value as input to their policy for deciding how to answer a client message. For example, the Elapsed Time option lets a secondary DHCP server jump in and answer a request when the primary server has been ghosting for too long ๐ The elapsed-time value is a 16-bit (2-octet) unsigned integer. If the time is bigger than what this option can show, the client uses 0xffff instead ๐
21.10. Relay Message Option ๐ฆ
The Relay Message option is the envelope that carries a DHCP message inside a Relay-forward or Relay-reply message ๐
The format of the Relay Message option is:
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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| OPTION_RELAY_MSG | option-len |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| |
. DHCP-relay-message .
. .
. .
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Figure 21: Relay Message Option Format
option-code:OPTION_RELAY_MSG (9)๐งoption-len: the length of the DHCP-relay-message field โจDHCP-relay-message: in a Relay-forward message, this is the received message, relayed verbatim to the next relay agent or server. In a Relay-reply message, it's the message to be copied and relayed to the relay agent or client whose address is in the peer-address field of the Relay-reply message. Its length in octets is given byoption-len๐
21.11. Authentication Option ๐
The Authentication option carries authentication info so you can verify who a DHCP message is from and that its contents are legit ๐ฅ Section 20 explains how to use it. Heads up: the delayed authentication protocol from [RFC3315] has been obsoleted by this document because nobody was really using it (see Section 25) ๐ The format of the Authentication option is:
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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| OPTION_AUTH | option-len |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| protocol | algorithm | RDM | |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| |
| replay detection (64 bits) +-+-+-+-+-+-+-+-+
| | |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
. authentication information .
. (variable length) .
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Figure 22: Authentication Option Format
option-code:OPTION_AUTH (11)๐ฆoption-len:11 + length of authentication information field๐ธprotocol: the authentication protocol used in this Authentication option. It's a 1-octet unsigned integer.algorithm: the algorithm used in that authentication protocol. It's a 1-octet unsigned integer.RDM: the replay detection method used in this Authentication option. It's a 1-octet unsigned integer.replay detection: the replay detection info for the RDM. It's a 64-bit (8-octet) field.authentication information: the authentication info, as specified by the protocol and algorithm used in this Authentication option. It's a variable-length field, 11 octets less than the value in theoption-lenfield ๐ง
IANA keeps a registry for the protocol, algorithm, and RDM values at <https://www.iana.org/assignments/auth-namespaces> ๐
21.12. Server Unicast Option ๐ฆ
The server sends this option to a client to say, "hey, you're allowed to unicast messages straight to me" ๐ The format of the Server Unicast option is:
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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| OPTION_UNICAST | option-len |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| |
| server-address |
| |
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Figure 23: Server Unicast Option Format
option-code:OPTION_UNICAST (12)๐option-len:16โจserver-address: the 128-bit address the client should send messages to when using unicast ๐ซถ
The server puts the address it wants the client to unicast to in the server-address field. When a client gets this option, it sends messages directly to the server at that address wherever that's allowed and makes sense ๐
When the server sends a Server Unicast option to the client, some messages from the client won't be relayed by relay agents and won't include relay agent options from them ๐ญ So a server should only send a Server Unicast option to a client when relay agents aren't sending relay agent options. A DHCP server rejects any messages that get sent with unicast when they shouldn't be, so messages still get relayed by relay agents whenever relay agent options are in use ๐ซ
Details about when the client may send messages to the server using unicast are in Section 18 ๐
21.13. Status Code Option โจ
okay bestie, this option is how a DHCP message (or an option sitting inside one) reports what happened ๐ it's giving status report energy. Here's the layout:
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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| OPTION_STATUS_CODE | option-len |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| status-code | |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
. .
. status-message .
. .
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Figure 24: Status Code Option Format
Here's what each piece means:
option-code:OPTION_STATUS_CODE (13).option-len: 2 + length of status-message field.status-code: The numeric code for the status encoded in this option. It's a 2-octet field containing an unsigned integer.status-message: A UTF-8 encoded [RFC3629] text string that's suitable for display to an end user. It MUST NOT be null-terminated. This is a variable-length field, 2 octets less than the value in the option-len field.
A Status Code option may appear in the "options" field of a DHCP message and/or in the "options" field of another option. If the Status Code option does not appear in a message where it could appear, the status of the message is assumed to be Success. ๐ซถ
The status-code values previously defined by [RFC3315] and [RFC3633] are:
+---------------+------+--------------------------------------------+
| Name | Code | Description |
+---------------+------+--------------------------------------------+
| Success | 0 | Success. |
| | | |
| UnspecFail | 1 | Failure, reason unspecified; this status |
| | | code is sent by either a client or a |
| | | server to indicate a failure not |
| | | explicitly specified in this document. |
| | | |
| NoAddrsAvail | 2 | The server has no addresses available to |
| | | assign to the IA(s). |
| | | |
| NoBinding | 3 | Client record (binding) unavailable. |
| | | |
| NotOnLink | 4 | The prefix for the address is not |
| | | appropriate for the link to which the |
| | | client is attached. |
| | | |
| UseMulticast | 5 | Sent by a server to a client to force the |
| | | client to send messages to the server |
| | | using the |
| | | All_DHCP_Relay_Agents_and_Servers |
| | | multicast address. |
| | | |
| NoPrefixAvail | 6 | The server has no prefixes available to |
| | | assign to the IA_PD(s). |
+---------------+------+--------------------------------------------+
Table 3: Status Code Definitions
For the current list of status codes, check the "Status Codes" registry at https://www.iana.org/assignments/dhcpv6-parameters. ๐ธ
21.14. Rapid Commit Option โจ
the Rapid Commit option is how you signal that you want the two-message exchange for address assignment ๐ฆ super quick, no cap. Here's the 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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| OPTION_RAPID_COMMIT | option-len |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Figure 25: Rapid Commit Option Format
option-code:OPTION_RAPID_COMMIT (14).option-len: 0.
A client MAY include this option in a Solicit message if the client is prepared to perform the Solicit/Reply message exchange described in Section 18.2.1. โจ
A server MUST include this option in a Reply message sent in response to a Solicit message when completing the Solicit/Reply message exchange. ๐
DISCUSSION: ngl this part is a little spicy ๐ every server that replies to a Solicit containing a Rapid Commit option commits the leases in that Reply, but it never finds out whether the client actually got the Reply. So if more than one server answers the same Solicit, all but one of them end up committing leases the client never uses. That could mean wrong address info in DNS if the DHCP servers update DNS [RFC4704], and leasequery responses [RFC5007] may include info on leases that aren't in use by the client. The fix is to make sure only one server responds to the Solicit, or to use fairly short lifetimes for newly assigned leases, so the unused ones expire quickly. ๐
21.15. User Class Option โจ
the User Class option is how a client says what type or category of users or apps it represents ๐ง it's basically the client's little label. The format is:
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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| OPTION_USER_CLASS | option-len |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
. .
. user-class-data .
. .
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Figure 26: User Class Option Format
option-code:OPTION_USER_CLASS (15).option-len: Length of user-class-data field.user-class-data: The user classes carried by the client. The length, in octets, is specified by option-len.
The info in the data area of this option is held in one or more opaque fields that represent the user class (or classes) the client belongs to. A server picks configuration info for the client based on the classes in this option. For example, you could use the User Class option to give all the clients of people in accounting a different printer than the clients of people in marketing, which is so iconic ๐จ๏ธ๐ The user class info carried in this option MUST be configurable on the client. ๐
The data area of the User Class option MUST contain one or more instances of user-class-data information. Each instance of user-class-data is formatted like this:
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-...-+-+-+-+-+-+-+
| user-class-len | opaque-data |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-...-+-+-+-+-+-+-+
Figure 27: Format of user-class-data Field
The user-class-len field is 2 octets long and specifies the length of the opaque user-class-data, in network byte order. ๐
A server interprets the classes in this option according to its configuration, so it can pick the right configuration info for the client. A server may use only the user classes it's configured to interpret when selecting configuration info for a client, and ignore any others. When it gets a message with a User Class option, a server may include a User Class option containing the classes it successfully interpreted, so the client knows which ones the server understood. ๐
21.16. Vendor Class Option โจ
this option is how a client identifies the vendor that made the hardware it's running on ๐ฅ the data in here is a bunch of opaque fields describing the hardware setup. The format is:
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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| OPTION_VENDOR_CLASS | option-len |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| enterprise-number |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
. .
. vendor-class-data .
. . . . .
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Figure 28: Vendor Class Option Format
option-code:OPTION_VENDOR_CLASS (16).option-len: 4 + length of vendor-class-data field.enterprise-number: The vendor's registered Enterprise Number, as maintained by IANA [IANA-PEN]. It's a 4-octet field containing an unsigned integer.vendor-class-data: The hardware configuration of the node the client is running on. This is a variable-length field, 4 octets less than the value in the option-len field.
The vendor-class-data field is made up of separate items, each describing some characteristic of the client's hardware configuration. Examples might include the version of the operating system the client is running, or how much memory is installed on the client. ๐ง โจ
Each instance of vendor-class-data is formatted like this:
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-...-+-+-+-+-+-+-+
| vendor-class-len | opaque-data |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-...-+-+-+-+-+-+-+
Figure 29: Format of vendor-class-data Field
The vendor-class-len field is 2 octets long and specifies the length of the opaque vendor-class-data, in network byte order. ๐
Servers and clients MUST NOT include more than one instance of OPTION_VENDOR_CLASS with the same Enterprise Number. Each instance of OPTION_VENDOR_CLASS can carry multiple vendor-class-data instances. ๐ฆ
21.17. Vendor-specific Information Option ๐
okay so this option is how clients and servers swap vendor-specific info, aka the extra goodies a company's own DHCP setup can do, bestie ๐
The format of the Vendor-specific Information option is:
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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| OPTION_VENDOR_OPTS | option-len |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| enterprise-number |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
. .
. vendor-option-data .
. .
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Figure 30: Vendor-specific Information Option Format
option-code is OPTION_VENDOR_OPTS (17). โจ
option-len is 4 + length of vendor-option-data field. ๐ง
enterprise-number is the vendor's registered Enterprise Number as maintained by IANA [IANA-PEN]. It's a 4-octet field holding an unsigned integer. ๐
vendor-option-data is vendor options, interpreted by vendor-specific code on the clients and servers. It's a variable-length field (4 octets less than the value in the option-len field). ๐ธ
The definition of the info in this option is vendor specific, and the vendor is indicated in the enterprise-number field. Using vendor-specific info lets you unlock enhanced operation with extra features in a vendor's DHCP implementation, iykyk ๐. A DHCP client that doesn't receive requested vendor-specific info will still set up the node's IPv6 stack so it's functional, no cap ๐ซถ.
The vendor-option-data field MUST be encoded as a sequence of code/length/value fields with a format identical to the DHCP options (see Section 21.1). The sub-option codes are defined by the vendor identified in the enterprise-number field and are NOT managed by IANA. Each sub-option is formatted like this:
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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| sub-opt-code | sub-option-len |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
. .
. sub-option-data .
. .
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Figure 31: Vendor-specific Options Format
sub-opt-code is the code for the sub-option, a 2-octet field. ๐
sub-option-len is an unsigned integer giving the length of the sub-option-data field in this sub-option, in octets. It's a 2-octet field. ๐ฆ
sub-option-data is the data area for the sub-option. Its length, in octets, is specified by sub-option-len. ๐
Multiple instances of the Vendor-specific Information option may show up in a DHCP message. Each instance is interpreted according to the option codes defined by the vendor identified by the Enterprise Number in that option. Servers and clients MUST NOT send more than one instance of the Vendor-specific Information option with the same Enterprise Number. Each instance of the Vendor-specific Information option MAY contain multiple sub-options. ๐ฅ
A client that's interested in receiving a Vendor-specific Information option:
- MUST specify the Vendor-specific Information option in an Option Request option.
- MAY specify an associated Vendor Class option (see Section 21.16).
- MAY specify the Vendor-specific Information option with appropriate data.
Servers only return Vendor-specific Information options if they were specified in Option Request options from clients, and they:
- MAY use the Enterprise Numbers in the associated Vendor Class options to restrict the set of Enterprise Numbers in the Vendor-specific Information options returned.
- MAY return all configured Vendor-specific Information options.
- MAY use other information in the packet or in its configuration to determine which set of Enterprise Numbers in the Vendor-specific Information options to return.
21.18. Interface-Id Option ๐ฆ
okay this one is all about the relay agent ๐ง It MAY send the Interface-Id option to identify the interface where the client message was received. If a relay agent gets a Relay-reply message with an Interface-Id option, the relay agent relays the message to the client through the interface identified by the option. โจ
The format of the Interface-Id option is:
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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| OPTION_INTERFACE_ID | option-len |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
. .
. interface-id .
. .
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Figure 32: Interface-Id Option Format
option-code is OPTION_INTERFACE_ID (18). ๐ธ
option-len is the length of the interface-id field. ๐
interface-id is an opaque value of arbitrary length generated by the relay agent to identify one of the relay agent's interfaces. Its length, in octets, is specified by option-len. ๐ซถ
The server MUST copy the Interface-Id option from the Relay-forward message into the Relay-reply message the server sends to the relay agent in response to the Relay-forward message. This option MUST NOT appear in any message except a Relay-forward or Relay-reply message. ๐ฅ
Servers MAY use the interface-id field for parameter assignment policies. The interface-id value SHOULD be considered opaque, with policies based on exact match only. That means the interface-id field SHOULD NOT be internally parsed by the server. The interface-id value for an interface SHOULD be stable and remain unchanged, for example after the relay agent is restarted. If the interface-id value changes, a server won't be able to use it reliably in parameter assignment policies. ๐
21.19. Reconfigure Message Option ๐
a server includes a Reconfigure Message option in a Reconfigure message to tell the client whether to respond with a Renew message, a Rebind message, or an Information-request message. ๐
The format of the Reconfigure Message option is:
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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| OPTION_RECONF_MSG | option-len |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| msg-type |
+-+-+-+-+-+-+-+-+
Figure 33: Reconfigure Message Option Format
option-code is OPTION_RECONF_MSG (19). ๐
option-len is 1. ๐ง
msg-type is 5 for a Renew message, 6 for a Rebind message, and 11 for an Information-request message. It's a 1-octet unsigned integer. ๐
The Reconfigure Message option can ONLY appear in a Reconfigure message. ๐
21.20. Reconfigure Accept Option ๐ธ
a client uses the Reconfigure Accept option to announce to the server whether it's willing to accept Reconfigure messages, and a server uses this option to tell the client whether or not to accept them. If this option is absent, the default behavior is that the client is unwilling to accept Reconfigure messages. ๐ The format of the Reconfigure Accept option is:
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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| OPTION_RECONF_ACCEPT | option-len |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Figure 34: Reconfigure Accept Option Format
option-code is OPTION_RECONF_ACCEPT (20). โจ
option-len is 0. ๐
21.21. Identity Association for Prefix Delegation Option โจ
okay bestie, let's talk about the IA_PD option ๐ this is the thing a client uses to carry a prefix delegation identity association ๐ฆ so it's basically the bundle that holds the parameters for the IA_PD and all the prefixes that belong to it. literally the whole vibe of "here's my prefix package, handle with care" ๐
Here's how the format lays out:
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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| OPTION_IA_PD | option-len |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| IAID (4 octets) |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| T1 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| T2 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
. .
. IA_PD-options .
. .
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Figure 35: Identity Association for Prefix Delegation Option Format ๐ธ
option-code: OPTION_IA_PD (25) ๐option-len: 12 + length of IA_PD-options field ๐งIAID: the unique ID for this IA_PD โจ. It has to be unique among all of this client's IA_PDs ๐ซถ. The number space for IA_PD IAIDs is separate from the one for other IA option types (so IA_NA and IA_TA have their own space, no mixing) ๐. It's a 4-octet unsigned integer.T1: the time after which the client should contact the server that gave the prefixes, to extend their lifetimes ๐. It's a duration in seconds, measured from when the message was received. 4-octet unsigned integer.T2: the time after which the client should contact any available server to extend the lifetimes ๐ฆ. Also seconds from message reception, also a 4-octet unsigned integer.IA_PD-options: all the options specific to this IA_PD ๐. It's variable length, and it's 12 octets less than theoption-lenvalue ๐ .
The IA_PD-options field is where everything specific to this IA_PD lives ๐. For example, all the IA Prefix options (see Section 21.22) carrying the prefixes for this IA_PD go right in there ๐ง.
An IA_PD option may only show up in the options area of a DHCP message ๐ฅ. A DHCP message can hold multiple IA_PD options, but each one needs a unique IAID ๐. No duplicates, bestie ๐.
Any status for operations involving this IA_PD is reported in a Status Code option (see Section 21.13), sitting inside the IA_PD-options field ๐.
Now here's the fun bit ๐: an IA_PD has no explicit "lifetime" or "lease length" of its own ๐ญ. It just kinda... expires once the valid lifetimes of all its prefixes have run out ๐. The T1 and T2 fields exist so the server can have explicit control over when a client should check in about a specific IA_PD โจ.
In a message sent by a client to a server, the T1 and T2 fields SHOULD be set to 0 ๐ซถ. The server MUST ignore any values in those fields when it gets them from a client ๐ โโ๏ธ. (Hard no, server, don't even look at them ๐ )
In a message sent by a server to a client, the client MUST use the T1 and T2 values for its T1 and T2 timers ๐ฅ, unless those fields are 0 ๐ง. The values are the number of seconds until T1 and T2 ๐.
The server picks T1 and T2 so the client can extend the prefix lifetimes before they expire ๐ฆ, even if the server is briefly unavailable ๐ธ. The recommended values are 0.5 and 0.8 times the shortest preferred lifetime of the prefixes in the IA_PD that the server is willing to extend ๐, respectively. If the server wants to leave the renewal timing up to the client ๐, it sets T1 and T2 to 0. The client MUST follow the rules defined in Section 14.2 โจ.
If a client receives an IA_PD where T1 is greater than T2, and both T1 and T2 are greater than 0 โ ๏ธ, the client discards that IA_PD option and processes the rest of the message as though the server had never included the IA_PD option ๐. Not the vibe, so it's just gone ๐.
21.22. IA Prefix Option ๐
okay the IA Prefix option is the one that actually specifies a prefix tied to an IA_PD ๐ธ. It must be encapsulated in the IA_PD-options field of an IA_PD option (see Section 21.21) ๐ซถ. So it lives inside its parent, no exceptions ๐.
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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| OPTION_IAPREFIX | option-len |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| preferred-lifetime |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| valid-lifetime |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| prefix-length | |
+-+-+-+-+-+-+-+-+ IPv6-prefix |
| (16 octets) |
| |
| |
| |
| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| | .
+-+-+-+-+-+-+-+-+ .
. IAprefix-options .
. .
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Figure 36: IA Prefix Option Format ๐
option-code: OPTION_IAPREFIX (26) ๐งoption-len: 25 + length of IAprefix-options field ๐preferred-lifetime: how long the prefix is preferred, in seconds ๐ฆ. A value of0xffffffffmeans "infinity" (see Section 7.7) โพ๏ธโจ. It's a 4-octet unsigned integer.valid-lifetime: how long the prefix is valid, in seconds ๐.0xffffffffalso means "infinity" ๐ฅ. 4-octet unsigned integer.prefix-length: the length of this prefix in bits ๐. It's a 1-octet unsigned integer.IPv6-prefix: an IPv6 prefix, 16 octets ๐ .IAprefix-options: options associated with this prefix ๐ซถ. It's variable length, and it's 25 octets less than theoption-lenvalue ๐.
In a message sent by a client to a server, the preferred-lifetime and valid-lifetime fields SHOULD be set to 0 ๐. The server MUST ignore any values it receives in those lifetime fields ๐ โโ๏ธ.
The client SHOULD NOT send an IA Prefix option with 0 in the prefix-length field (and the unspecified address :: in the IPv6-prefix field) ๐. But a client MAY send a non-zero prefix-length with :: in IPv6-prefix to hint at the prefix size it wants ๐ง. For more on prefix-length hints, see [RFC8168] ๐โจ.
The client MUST discard any prefixes where the preferred lifetime is greater than the valid lifetime ๐ฅ. No cap, that's a red flag ๐ฉ.
The values in the preferred-lifetime and valid-lifetime fields are the number of seconds remaining in each lifetime โณ. See Section 18.2.10.1 for the details on how these get used for delegated prefixes ๐ธ.
As per Section 7.7, a value of 0xffffffff for either the preferred or valid lifetime is taken to mean "infinity" ๐ฆ, and it should be used carefully โ ๏ธ๐.
An IA Prefix option may appear only in an IA_PD option ๐. You can have more than one IA Prefix option inside a single IA_PD option ๐.
Any status for operations involving this IA Prefix option is reported in a Status Code option (see Section 21.13), in the IAprefix-options field ๐.
21.23. Information Refresh Time Option โจ
okay so this option is how a server tells a client "hey, don't check back for fresh info for longer than this" ๐ฐ๏ธ๐ Clients ask for it, servers send it back, but it only shows up in Reply messages answering Information-request messages. Everywhere else, the timing info is already handled by stuff like T1/T2 and lifetimes ๐ This one is lowkey clutch when the config parameters change or during a renumbering event, because stateless clients can finally update their settings ๐ฆ
The format of the Information Refresh Time option is:
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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|OPTION_INFORMATION_REFRESH_TIME| option-len |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| information-refresh-time |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Figure 37: Information Refresh Time Option Format
option-code OPTION_INFORMATION_REFRESH_TIME (32).
option-len 4.
information-refresh-time Time duration relative to the current
time, expressed in units of seconds. A
4-octet field containing an unsigned
integer.
A DHCP client MUST request this option in the Option Request option (see Section 21.7) when sending Information-request messages. A client MUST NOT request this option in the Option Request option in any other messages. ๐
A server sending a Reply to an Information-request message SHOULD include this option if it is requested in the Option Request option of the Information-request. The option value MUST NOT be smaller than IRT_MINIMUM. This option MUST only appear in the top-level options area of Reply messages. ๐
If the Reply to an Information-request message does not contain this option, the client MUST behave as if the option with the value IRT_DEFAULT was provided. ๐ธ
A client MUST use the refresh time IRT_MINIMUM if it receives the option with a value less than IRT_MINIMUM. ๐
As per Section 7.7, the value 0xffffffff is taken to mean "infinity" and implies that the client should not refresh its configuration data without some other trigger (such as detecting movement to a new link). It's giving "never ask again unless something changes" ๐ง
If a client contacts the server to obtain new data or refresh some existing data before the refresh time expires, then it SHOULD also refresh all data covered by this option. โจ
When the client detects that the refresh time has expired, it SHOULD try to update its configuration data by sending an Information-request as specified in Section 18.2.6, except that the client MUST delay sending the first Information-request by a random amount of time between 0 and INF_MAX_DELAY. Ngl that little random wait is so thoughtful ๐ซถ
A client MAY have a maximum value for the refresh time, where that value is used whenever the client receives this option with a value higher than the maximum. This also means that the maximum value is used when the received value is "infinity". A maximum value might make the client less vulnerable to attacks based on forged DHCP messages. Without a maximum value, a client may be made to use wrong information for a possibly infinite period of time. ๐ญ There may, however, be reasons for having a very long refresh time, so it may be useful for this maximum value to be configurable. ๐ฅ
21.24. SOL_MAX_RT Option ๐
A DHCP server sends the SOL_MAX_RT option to a client to override the default value of SOL_MAX_RT. The value of SOL_MAX_RT in the option replaces the default value defined in Section 7.6. One use for the SOL_MAX_RT option is to set a higher value for SOL_MAX_RT, which reduces the Solicit traffic from a client that has not received a response to its Solicit messages. Less spam, more peace ๐
The format of the SOL_MAX_RT option is:
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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| OPTION_SOL_MAX_RT | option-len |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| SOL_MAX_RT value |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Figure 38: SOL_MAX_RT Option Format
option-code OPTION_SOL_MAX_RT (82).
option-len 4.
SOL_MAX_RT value Overriding value for SOL_MAX_RT in seconds;
MUST be in this range: 60 <= "value" <= 86400
(1 day). A 4-octet field containing an
unsigned integer.
A DHCP client MUST include the SOL_MAX_RT option code in any Option Request option (see Section 21.7) it sends in a Solicit message. ๐
The DHCP server MAY include the SOL_MAX_RT option in any response it sends to a client that has included the SOL_MAX_RT option code in an Option Request option. The SOL_MAX_RT option is sent as a top-level option in the message to the client. ๐ฆ
A DHCP client MUST ignore any SOL_MAX_RT option values that are less than 60 or more than 86400. ๐
If a DHCP client receives a message containing a SOL_MAX_RT option that has a valid value for SOL_MAX_RT, the client MUST set its internal SOL_MAX_RT parameter to the value contained in the SOL_MAX_RT option. This value of SOL_MAX_RT is then used by the retransmission mechanism defined in Sections 15 and 18.2.1. โจ
The purpose of this mechanism is to give network administrators a way to avoid excessive DHCP traffic if all DHCP servers become unavailable. Therefore, this value is expected to be retained for as long as practically possible. Main character energy for network admins ๐
An updated SOL_MAX_RT value applies only to the network interface on which the client received the SOL_MAX_RT option. ๐ธ
21.25. INF_MAX_RT Option ๐
A DHCP server sends the INF_MAX_RT option to a client to override the default value of INF_MAX_RT. The value of INF_MAX_RT in the option replaces the default value defined in Section 7.6. One use for the INF_MAX_RT option is to set a higher value for INF_MAX_RT, which reduces the Information-request traffic from a client that has not received a response to its Information-request messages. Same energy as the last one, just for Information-requests ๐ง
The format of the INF_MAX_RT option is:
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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| OPTION_INF_MAX_RT | option-len |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| INF_MAX_RT value |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Figure 39: INF_MAX_RT Option Format
option-code OPTION_INF_MAX_RT (83).
option-len 4.
INF_MAX_RT value Overriding value for INF_MAX_RT in seconds;
MUST be in this range: 60 <= "value" <= 86400
(1 day). A 4-octet field containing an
unsigned integer.
A DHCP client MUST include the INF_MAX_RT option code in any Option Request option (see Section 21.7) it sends in an Information-request message. ๐
The DHCP server MAY include the INF_MAX_RT option in any response it sends to a client that has included the INF_MAX_RT option code in an Option Request option. The INF_MAX_RT option is a top-level option in the message to the client. ๐
A DHCP client MUST ignore any INF_MAX_RT option values that are less than 60 or more than 86400. ๐
If a DHCP client receives a message containing an INF_MAX_RT option that has a valid value for INF_MAX_RT, the client MUST set its internal INF_MAX_RT parameter to the value contained in the INF_MAX_RT option. This value of INF_MAX_RT is then used by the retransmission mechanism defined in Sections 15 and 18.2.6. ๐
An updated INF_MAX_RT value applies only to the network interface on which the client received the INF_MAX_RT option. ๐ซถ
22. Security Considerations ๐โจ
okay bestie, this section is about the security stuff that is not privacy ๐ซถ the privacy part is Section 23, so we'll get there.
the threat to DHCP is inherently an insider threat (assuming a properly configured network where DHCP ports are blocked on the perimeter gateways of the enterprise) ๐ฐ but ngl, no matter how the gateway is set up, the potential attacks from insiders and outsiders are the same ๐
DHCP has no end-to-end encryption between clients and servers ๐ญ so hijacking, tampering, and eavesdropping attacks are all possible because of that. some network environments (we'll talk about them below) can be locked down in various ways to cut these attacks down ๐
one attack that's specific to a DHCP client is setting up a malicious server that hands out wrong configuration info ๐ the goal might be a "man in the middle" attack, where the client talks to a bad server instead of a valid one for some service (like DNS or NTP). the malicious server can also run a DoS attack by misconfiguring the client, which would make all of the client's network communication fail ๐ต
a malicious DHCP server might make a client set its SOL_MAX_RT and INF_MAX_RT parameters to an unreasonably high value, using the SOL_MAX_RT (see Section 21.24) and INF_MAX_RT (see Section 21.25) options ๐ข that can cause an undue delay in the client finishing its DHCP protocol transaction in the case where no other valid response shows up. but if the client also gets a response from a valid DHCP server, big SOL_MAX_RT and INF_MAX_RT values won't have any effect โจ
a malicious server can also send a Server Unicast option (see Section 21.12) to a client in an Advertise message ๐ต๏ธโโ๏ธ which could make the client bypass relays and only talk to the malicious server for later Request and Renew messages.
another threat to DHCP clients is DHCP servers that are misconfigured by mistake or by accident ๐ they answer client requests with configuration parameters that are unintentionally incorrect.
a DHCP client can also be attacked by getting a Reconfigure message from a malicious server, which makes the client obtain incorrect configuration info from that server ๐ค here's the tricky bit: even though a client sends its response (Renew, Rebind, or Information-request message) through a relay agent, so that response only reaches the servers that DHCP messages are relayed to, a malicious server could still send a Reconfigure message to a client. then, after an appropriate delay, it could follow up with a Reply message that the client would accept. so a malicious server that isn't on the network path between the client and the server can still pull off a Reconfigure attack on a client ๐ using transaction IDs that are cryptographically sound and can't easily be predicted will also lower the odds that this kind of attack works ๐
โ ๏ธ Because of the opportunity for attack through the Reconfigure message, a DHCP client MUST discard any Reconfigure message that does not include authentication or that does not pass the validation process for the authentication protocol. no exceptions, bestie.
RKAP, described in Section 20.4, protects against a malicious DHCP server using a Reconfigure message to run a DoS or man-in-the-middle attack on a client ๐ก๏ธ but it can be compromised by an attacker who can intercept the initial message where the DHCP server sends the key "in plain text" to the client ๐ฌ
a lot of these attacks by rogue servers can be softened by using the mechanisms in [RFC7610] and [RFC7513] ๐ธ
the threat specific to a DHCP server is an invalid client masquerading as a valid client ๐ญ the motivation could be theft of service, or getting around auditing for any number of nefarious purposes ๐ฟ
the threat shared by both the client and the server is the "resource-exhaustion" DoS attack ๐ these attacks usually involve running out of available assigned addresses or delegatable prefixes, or running out of CPU or network bandwidth. they're around any time there's a shared resource. some forms of these exhaustion attacks can be partially mitigated by good server policy, e.g., limiting the maximum number of leases any one client can get ๐
the messages exchanged between relay agents and servers can be used to mount a man-in-the-middle or DoS attack ๐ฅบ good news though: communication between a server and a relay agent, and communication between relay agents, can be authenticated and encrypted with IPsec, as described in [RFC8213] ๐๐ฆ
BUT, the use of manually configured pre-shared keys for IPsec between relay agents and servers does not defend against replayed DHCP messages ๐ โโ๏ธ replayed messages can be a DoS attack through exhaustion of processing resources, but not through misconfiguration or exhaustion of other resources like assignable addresses and delegatable prefixes.
various network environments also offer levels of security if they're deployed as described below ๐
- In enterprise and factory networks, use of authentication per [IEEE-802.1x] can stop unknown or untrusted clients from connecting to the network ๐ญ however, this doesn't necessarily guarantee that the connected client will be a good DHCP or network actor.
- For wired networks, where clients are typically connected to a switch port, snooping DHCP multicast (or unicast) traffic gets hard, because the switches limit the traffic delivered to a port ๐ the client's DHCP multicast packets (with destination address
fe02::1:2) are only forwarded to the DHCP server's (or relay's) switch port, not all ports. the server's (or relay's) unicast replies are only delivered to the target client's port, not all ports. - In public networks (like a Wi-Fi network in a coffee shop or airport), it's possible for others within radio range to snoop DHCP and other traffic โ but in these environments there's very little, if anything, that can be learned from the DHCP traffic itself (from client to server or from server to client) if the privacy considerations in Section 23 are followed ๐ even for devices that don't follow those privacy considerations, there's little that can be learned that wouldn't be available from later communications anyway (like the device's Media Access Control (MAC) address). also, because all clients typically receive similar configuration details, a bad actor who starts a DHCP request themselves can learn much of that info ๐ถ๏ธ as mentioned above, one threat is that the RKAP key for a client can be learned (if the initial Solicit/Advertise/Request/Reply exchange is monitored), and that can trigger a premature reconfiguration. this is relatively easy to prevent by disallowing direct client-to-client communication on these networks, or by using [RFC7610] and [RFC7513] โจ
23. Privacy Considerations ๐ซฃ๐
for an extended discussion about privacy considerations for the client, see [RFC7824] ๐ง
- In particular, its Section 3 discusses various identifiers that could be misused to track the client ๐
- Its Section 4 discusses existing mechanisms that might affect a client's privacy ๐
- Finally, its Section 5 discusses potential attack vectors โ ๏ธ
for recommendations on how to address or mitigate those issues, see [RFC7844] ๐
this specification does not define any allocation strategies for servers ๐ implementers are expected to develop their own algorithm for the server to choose a resource out of the available pool. several possible allocation strategies are mentioned in Section 4.3 of [RFC7824]. please keep in mind that the list in [RFC7824] is not exhaustive, and there are definitely other possible strategies ๐งฉ readers are also encouraged to read [RFC7707], especially its Section 4.1.2, which talks about the problems with certain allocation strategies ๐
24. IANA Considerations ๐๐ท
this document does not define any new DHCP name spaces or definitions ๐ซถ
publishing this document does not change the assignment rules for new values for message types, option codes, DUID types, or status codes ๐
the list of assigned values used in DHCPv6 is available at <https://www.iana.org/assignments/dhcpv6-parameters> ๐
IANA has updated <https://www.iana.org/assignments/dhcpv6-parameters> to add a reference to this document for definitions previously created by [RFC3315], [RFC3633], [RFC4242], and [RFC7083] ๐
IANA has added two columns to the DHCPv6 "Option Codes" registry at <https://www.iana.org/assignments/dhcpv6-parameters> ๐ one shows which options are allowed to appear in a client's Option Request option (see Section 21.7), and the other shows which options are singleton options (only allowed to appear once as a top-level or encapsulated option; see Section 16 of [RFC7227]). Table 4 provides the data for the options IANA assigned at the time this document was written ๐ฆ
Okay bestie, this is the Updated Options table ๐ ๐ It's the lineup of option codes that got a glow-up in this spec. The columns tell you if a client can ask for an option in its Option Request, and whether you're only allowed to send it once. Here it is, exactly as the spec has it โจ
+---------+--------------------------+------------------+-----------+
| Option | Option Name ("OPTION" | Client ORO (1) | Singleton |
| | prefix removed) | | Option |
+---------+--------------------------+------------------+-----------+
| 1 | CLIENTID | No | Yes |
| 2 | SERVERID | No | Yes |
| 3 | IA_NA | No | No |
| 4 | IA_TA | No | No |
| 5 | IAADDR | No | No |
| 6 | ORO | No | Yes |
| 7 | PREFERENCE | No | Yes |
| 8 | ELAPSED_TIME | No | Yes |
| 9 | RELAY_MSG | No | Yes |
| 11 | AUTH | No | Yes |
| 12 | UNICAST | No | Yes |
| 13 | STATUS_CODE | No | Yes |
| 14 | RAPID_COMMIT | No | Yes |
| 15 | USER_CLASS | No | Yes |
| 16 | VENDOR_CLASS | No | No (2) |
| 17 | VENDOR_OPTS | Optional | No (2) |
| 18 | INTERFACE_ID | No | Yes |
| 19 | RECONF_MSG | No | Yes |
| 20 | RECONF_ACCEPT | No | Yes |
| 21 | SIP_SERVER_D | Yes | Yes |
| 22 | SIP_SERVER_A | Yes | Yes |
| 23 | DNS_SERVERS | Yes | Yes |
| 24 | DOMAIN_LIST | Yes | Yes |
| 25 | IA_PD | No | No |
| 26 | IAPREFIX | No | No |
| 27 | NIS_SERVERS | Yes | Yes |
| 28 | NISP_SERVERS | Yes | Yes |
| 29 | NIS_DOMAIN_NAME | Yes | Yes |
| 30 | NISP_DOMAIN_NAME | Yes | Yes |
| 31 | SNTP_SERVERS | Yes | Yes |
| 32 | INFORMATION_REFRESH_TIME | Required for | Yes |
| | | Information- | |
| | | request | |
| 33 | BCMCS_SERVER_D | Yes | Yes |
| 34 | BCMCS_SERVER_A | Yes | Yes |
| 36 | GEOCONF_CIVIC | Yes | Yes |
| 37 | REMOTE_ID | No | Yes |
| 38 | SUBSCRIBER_ID | No | Yes |
| 39 | CLIENT_FQDN | Yes | Yes |
| 40 | PANA_AGENT | Yes | Yes |
| 41 | NEW_POSIX_TIMEZONE | Yes | Yes |
| 42 | NEW_TZDB_TIMEZONE | Yes | Yes |
| 43 | ERO | No | Yes |
| 44 | LQ_QUERY | No | Yes |
| 45 | CLIENT_DATA | No | Yes |
| 46 | CLT_TIME | No | Yes |
| 47 | LQ_RELAY_DATA | No | Yes |
| 48 | LQ_CLIENT_LINK | No | Yes |
| 49 | MIP6_HNIDF | Yes | Yes |
| 50 | MIP6_VDINF | Yes | Yes |
| 51 | V6_LOST | Yes | Yes |
| 52 | CAPWAP_AC_V6 | Yes | Yes |
| 53 | RELAY_ID | No | Yes |
| 54 | IPv6_Address-MoS | Yes | Yes |
| 55 | IPv6_FQDN-MoS | Yes | Yes |
| 56 | NTP_SERVER | Yes | Yes |
| 57 | V6_ACCESS_DOMAIN | Yes | Yes |
| 58 | SIP_UA_CS_LIST | Yes | Yes |
| 59 | OPT_BOOTFILE_URL | Yes | Yes |
| 60 | OPT_BOOTFILE_PARAM | Yes | Yes |
| 61 | CLIENT_ARCH_TYPE | No | Yes |
| 62 | NII | Yes | Yes |
| 63 | GEOLOCATION | Yes | Yes |
| 64 | AFTR_NAME | Yes | Yes |
| 65 | ERP_LOCAL_DOMAIN_NAME | Yes | Yes |
| 66 | RSOO | No | Yes |
| 67 | PD_EXCLUDE | Yes | Yes |
| 68 | VSS | No | Yes |
| 69 | MIP6_IDINF | Yes | Yes |
| 70 | MIP6_UDINF | Yes | Yes |
| 71 | MIP6_HNP | Yes | Yes |
| 72 | MIP6_HAA | Yes | Yes |
| 73 | MIP6_HAF | Yes | Yes |
| 74 | RDNSS_SELECTION | Yes | No |
| 75 | KRB_PRINCIPAL_NAME | Yes | Yes |
| 76 | KRB_REALM_NAME | Yes | Yes |
| 77 | KRB_DEFAULT_REALM_NAME | Yes | Yes |
| 78 | KRB_KDC | Yes | Yes |
| 79 | CLIENT_LINKLAYER_ADDR | No | Yes |
| 80 | LINK_ADDRESS | No | Yes |
| 81 | RADIUS | No | Yes |
| 82 | SOL_MAX_RT | Required for | Yes |
| | | Solicit | |
| 83 | INF_MAX_RT | Required for | Yes |
| | | Information- | |
| | | request | |
| 84 | ADDRSEL | Yes | Yes |
| 85 | ADDRSEL_TABLE | Yes | Yes |
| 86 | V6_PCP_SERVER | Yes | No |
| 87 | DHCPV4_MSG | No | Yes |
| 88 | DHCP4_O_DHCP6_SERVER | Yes | Yes |
| 89 | S46_RULE | No | No (3) |
| 90 | S46_BR | No | No |
| 91 | S46_DMR | No | Yes |
| 92 | S46_V4V6BIND | No | Yes |
| 93 | S46_PORTPARAMS | No | Yes |
| 94 | S46_CONT_MAPE | Yes | No |
| 95 | S46_CONT_MAPT | Yes | Yes |
| 96 | S46_CONT_LW | Yes | Yes |
| 97 | 4RD | Yes | Yes |
| 98 | 4RD_MAP_RULE | Yes | Yes |
| 99 | 4RD_NON_MAP_RULE | Yes | Yes |
| 100 | LQ_BASE_TIME | No | Yes |
| 101 | LQ_START_TIME | No | Yes |
| 102 | LQ_END_TIME | No | Yes |
| 103 | DHCP Captive-Portal | Yes | Yes |
| 104 | MPL_PARAMETERS | Yes | No |
| 105 | ANI_ATT | No | Yes |
| 106 | ANI_NETWORK_NAME | No | Yes |
| 107 | ANI_AP_NAME | No | Yes |
| 108 | ANI_AP_BSSID | No | Yes |
| 109 | ANI_OPERATOR_ID | No | Yes |
| 110 | ANI_OPERATOR_REALM | No | Yes |
| 111 | S46_PRIORITY | Yes | Yes |
| 112 | MUD_URL_V6 | No | Yes |
| 113 | V6_PREFIX64 | Yes | No |
| 114 | F_BINDING_STATUS | No | Yes |
| 115 | F_CONNECT_FLAGS | No | Yes |
| 116 | F_DNS_REMOVAL_INFO | No | Yes |
| 117 | F_DNS_HOST_NAME | No | Yes |
| 118 | F_DNS_ZONE_NAME | No | Yes |
| 119 | F_DNS_FLAGS | No | Yes |
| 120 | F_EXPIRATION_TIME | No | Yes |
| 121 | F_MAX_UNACKED_BNDUPD | No | Yes |
| 122 | F_MCLT | No | Yes |
| 123 | F_PARTNER_LIFETIME | No | Yes |
| 124 | F_PARTNER_LIFETIME_SENT | No | Yes |
| 125 | F_PARTNER_DOWN_TIME | No | Yes |
| 126 | F_PARTNER_RAW_CLT_TIME | No | Yes |
| 127 | F_PROTOCOL_VERSION | No | Yes |
| 128 | F_KEEPALIVE_TIME | No | Yes |
| 129 | F_RECONFIGURE_DATA | No | Yes |
| 130 | F_RELATIONSHIP_NAME | No | Yes |
| 131 | F_SERVER_FLAGS | No | Yes |
| 132 | F_SERVER_STATE | No | Yes |
| 133 | F_START_TIME_OF_STATE | No | Yes |
| 134 | F_STATE_EXPIRATION_TIME | No | Yes |
| 135 | RELAY_PORT | No | Yes |
| 143 | IPv6_Address-ANDSF | Yes | Yes |
+---------+--------------------------+------------------+-----------+
Table 4: Updated Options
Now the notes, which are basically the rules for reading the table ๐ซถ
(1) In the "Client ORO" column, a "Yes" means the client puts that option code in the Option Request option (see Section 21.7) if it wants that config info. A "No" means the client MUST NOT include it, and servers SHOULD silently ignore that option code if it shows up in a client's Option Request option ๐
(2) For each Enterprise Number, there MUST only be a single instance. Non-negotiable, bestie ๐ฅ
(3) See [RFC7598] for details. ๐
IANA has corrected the range of possible status codes in the "Status Codes" table at https://www.iana.org/assignments/dhcpv6-parameters by replacing 23-255 (as Unassigned) with 23-65535. The codes are 16-bit unsigned integers, so that's the real range ๐
IANA has also updated the All_DHCP_Relay_Agents_and_Servers (ff02::1:2) and All_DHCP_Servers (ff05::1:3) table entries in the "IPv6 Multicast Address Space Registry" at https://www.iana.org/assignments/ipv6-multicast-addresses. Those entries now point at this document instead of [RFC3315] โจ
IANA has added an Obsolete annotation to the "DHCPv6 Delayed Authentication" entry in the "Authentication Suboption (value 8) - Protocol identifier values" registry at https://www.iana.org/assignments/bootp-dhcp-parameters, and to the "Delayed Authentication" entry in the "Protocol Name Space Values" registry at https://www.iana.org/assignments/auth-namespaces. They also updated those pages to point at this document instead of [RFC3315]. ๐งพโจ
IANA has added a reference to this document for the RDM value of 0 in the "RDM Name Space Values" registry at https://www.iana.org/assignments/auth-namespaces. ๐
IANA has updated the "Service Name and Transport Protocol Port Number Registry" at https://www.iana.org/assignments/service-names-port-numbers like this:
546/udp This document
547/udp This document
547/tcp [RFC5460]
647/tcp [RFC8156]
25. Obsoleted Mechanisms ๐ชฆ
Okay so bestie, this spec is basically a glow-up of the original, [RFC3315], with a bunch of later RFC upgrades stacked on top ๐. But there are a few mechanisms that never really caught on, were kinda vague, or had operational problems, so they're now deprecated ๐ญ. Legacy implementations MAY still support them, but anything conformant to this document MUST NOT rely on them. Not it! ๐
These mechanisms are now obsolete:
- Delayed authentication. This one was underspecified and a huge operational headache ๐. After 10 years, adoption was extremely limited at best.
- Lifetime hints sent by a client. Clients used to be allowed to send lifetime values as hints ๐. Almost nobody implemented it, and some implementations sent the remaining lifetimes instead of the total lifetimes they actually wanted. Servers sometimes read that as a request for ever-decreasing lease lifetimes, which got messy as the values approached zero ๐ต. Clients now SHOULD set lifetimes to
0inIA AddressandIA Prefixoptions, and servers MUST ignore any requested lifetime value ๐ง. - T1/T2 hints sent by a client. These had the same kind of issues as the lifetime hints ๐. Clients now SHOULD set the T1/T2 values to
0inIA_NAandIA_PDoptions, and servers MUST ignore any T1/T2 values a client supplies ๐ซถ.
26. References โจ
26.1. Normative References
The receipts, bestie ๐:
[RFC768] Postel, J., "User Datagram Protocol", STD 6, RFC 768,
DOI 10.17487/RFC0768, August 1980,
<https://www.rfc-editor.org/info/rfc768>.
[RFC1035] Mockapetris, P., "Domain names - implementation and
specification", STD 13, RFC 1035, DOI 10.17487/RFC1035,
November 1987, <https://www.rfc-editor.org/info/rfc1035>.
[RFC2119] Bradner, S., "Key words for use in RFCs to Indicate
Requirement Levels", BCP 14, RFC 2119,
DOI 10.17487/RFC2119, March 1997,
<https://www.rfc-editor.org/info/rfc2119>.
[RFC4291] Hinden, R. and S. Deering, "IP Version 6 Addressing
Architecture", RFC 4291, DOI 10.17487/RFC4291,
February 2006, <https://www.rfc-editor.org/info/rfc4291>.
[RFC4861] Narten, T., Nordmark, E., Simpson, W., and H. Soliman,
"Neighbor Discovery for IP version 6 (IPv6)", RFC 4861,
DOI 10.17487/RFC4861, September 2007,
<https://www.rfc-editor.org/info/rfc4861>.
[RFC4862] Thomson, S., Narten, T., and T. Jinmei, "IPv6 Stateless
Address Autoconfiguration", RFC 4862,
DOI 10.17487/RFC4862, September 2007,
<https://www.rfc-editor.org/info/rfc4862>.
[RFC6221] Miles, D., Ed., Ooghe, S., Dec, W., Krishnan, S., and A.
Kavanagh, "Lightweight DHCPv6 Relay Agent", RFC 6221,
DOI 10.17487/RFC6221, May 2011,
<https://www.rfc-editor.org/info/rfc6221>.
[RFC6355] Narten, T. and J. Johnson, "Definition of the UUID-Based
DHCPv6 Unique Identifier (DUID-UUID)", RFC 6355,
DOI 10.17487/RFC6355, August 2011,
<https://www.rfc-editor.org/info/rfc6355>.
[RFC7227] Hankins, D., Mrugalski, T., Siodelski, M., Jiang, S., and
S. Krishnan, "Guidelines for Creating New DHCPv6 Options",
BCP 187, RFC 7227, DOI 10.17487/RFC7227, May 2014,
<https://www.rfc-editor.org/info/rfc7227>.
[RFC7283] Cui, Y., Sun, Q., and T. Lemon, "Handling Unknown DHCPv6
Messages", RFC 7283, DOI 10.17487/RFC7283, July 2014,
<https://www.rfc-editor.org/info/rfc7283>.
[RFC8085] Eggert, L., Fairhurst, G., and G. Shepherd, "UDP Usage
Guidelines", BCP 145, RFC 8085, DOI 10.17487/RFC8085,
March 2017, <https://www.rfc-editor.org/info/rfc8085>.
[RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in
RFC 2119 Key Words", BCP 14, RFC 8174,
DOI 10.17487/RFC8174, May 2017,
<https://www.rfc-editor.org/info/rfc8174>.
[RFC8200] Deering, S. and R. Hinden, "Internet Protocol, Version 6
(IPv6) Specification", STD 86, RFC 8200,
DOI 10.17487/RFC8200, July 2017,
<https://www.rfc-editor.org/info/rfc8200>.
[RFC8213] Volz, B. and Y. Pal, "Security of Messages Exchanged
between Servers and Relay Agents", RFC 8213,
DOI 10.17487/RFC8213, August 2017,
<https://www.rfc-editor.org/info/rfc8213>.
26.2. Informative References ๐โจ
okay bestie, this is the "go deeper" pile ๐ง every single reference, lined up exactly like the original ๐
[IANA-HARDWARE-TYPES]
IANA, "Hardware Types",
<https://www.iana.org/assignments/arp-parameters>.
[IANA-PEN] IANA, "Private Enterprise Numbers",
<https://www.iana.org/assignments/enterprise-numbers>.
[IANA-RESERVED-IID]
IANA, "Reserved IPv6 Interface Identifiers",
<https://www.iana.org/assignments/ipv6-interface-ids>.
[IEEE-802.1x]
IEEE, "IEEE Standard for Local and metropolitan area
networks--Port-Based Network Access Control",
IEEE 802.1X-2010, DOI 10.1109/IEEESTD.2010.5409813,
<https://ieeexplore.ieee.org/servlet/
opac?punumber=5409757>.
[RFC826] Plummer, D., "An Ethernet Address Resolution Protocol: Or
Converting Network Protocol Addresses to 48.bit Ethernet
Address for Transmission on Ethernet Hardware", STD 37,
RFC 826, DOI 10.17487/RFC0826, November 1982,
<https://www.rfc-editor.org/info/rfc826>.
[RFC2131] Droms, R., "Dynamic Host Configuration Protocol",
RFC 2131, DOI 10.17487/RFC2131, March 1997,
<https://www.rfc-editor.org/info/rfc2131>.
[RFC2132] Alexander, S. and R. Droms, "DHCP Options and BOOTP Vendor
Extensions", RFC 2132, DOI 10.17487/RFC2132, March 1997,
<https://www.rfc-editor.org/info/rfc2132>.
[RFC2464] Crawford, M., "Transmission of IPv6 Packets over Ethernet
Networks", RFC 2464, DOI 10.17487/RFC2464, December 1998,
<https://www.rfc-editor.org/info/rfc2464>.
[RFC3162] Aboba, B., Zorn, G., and D. Mitton, "RADIUS and IPv6",
RFC 3162, DOI 10.17487/RFC3162, August 2001,
<https://www.rfc-editor.org/info/rfc3162>.
[RFC3290] Bernet, Y., Blake, S., Grossman, D., and A. Smith, "An
Informal Management Model for Diffserv Routers", RFC 3290,
DOI 10.17487/RFC3290, May 2002,
<https://www.rfc-editor.org/info/rfc3290>.
[RFC3315] Droms, R., Ed., Bound, J., Volz, B., Lemon, T., Perkins,
C., and M. Carney, "Dynamic Host Configuration Protocol
for IPv6 (DHCPv6)", RFC 3315, DOI 10.17487/RFC3315,
July 2003, <https://www.rfc-editor.org/info/rfc3315>.
[RFC3629] Yergeau, F., "UTF-8, a transformation format of
ISO 10646", STD 63, RFC 3629, DOI 10.17487/RFC3629,
November 2003, <https://www.rfc-editor.org/info/rfc3629>.
[RFC3633] Troan, O. and R. Droms, "IPv6 Prefix Options for Dynamic
Host Configuration Protocol (DHCP) version 6", RFC 3633,
DOI 10.17487/RFC3633, December 2003,
<https://www.rfc-editor.org/info/rfc3633>.
[RFC3646] Droms, R., Ed., "DNS Configuration options for Dynamic
Host Configuration Protocol for IPv6 (DHCPv6)", RFC 3646,
DOI 10.17487/RFC3646, December 2003,
<https://www.rfc-editor.org/info/rfc3646>.
[RFC3736] Droms, R., "Stateless Dynamic Host Configuration Protocol
(DHCP) Service for IPv6", RFC 3736, DOI 10.17487/RFC3736,
April 2004, <https://www.rfc-editor.org/info/rfc3736>.
[RFC3769] Miyakawa, S. and R. Droms, "Requirements for IPv6 Prefix
Delegation", RFC 3769, DOI 10.17487/RFC3769, June 2004,
<https://www.rfc-editor.org/info/rfc3769>.
[RFC4193] Hinden, R. and B. Haberman, "Unique Local IPv6 Unicast
Addresses", RFC 4193, DOI 10.17487/RFC4193, October 2005,
<https://www.rfc-editor.org/info/rfc4193>.
[RFC4242] Venaas, S., Chown, T., and B. Volz, "Information Refresh
Time Option for Dynamic Host Configuration Protocol for
IPv6 (DHCPv6)", RFC 4242, DOI 10.17487/RFC4242,
November 2005, <https://www.rfc-editor.org/info/rfc4242>.
[RFC4477] Chown, T., Venaas, S., and C. Strauf, "Dynamic Host
Configuration Protocol (DHCP): IPv4 and IPv6 Dual-Stack
Issues", RFC 4477, DOI 10.17487/RFC4477, May 2006,
<https://www.rfc-editor.org/info/rfc4477>.
[RFC4704] Volz, B., "The Dynamic Host Configuration Protocol for
IPv6 (DHCPv6) Client Fully Qualified Domain Name (FQDN)
Option", RFC 4704, DOI 10.17487/RFC4704, October 2006,
<https://www.rfc-editor.org/info/rfc4704>.
[RFC4941] Narten, T., Draves, R., and S. Krishnan, "Privacy
Extensions for Stateless Address Autoconfiguration in
IPv6", RFC 4941, DOI 10.17487/RFC4941, September 2007,
<https://www.rfc-editor.org/info/rfc4941>.
[RFC4943] Roy, S., Durand, A., and J. Paugh, "IPv6 Neighbor
Discovery On-Link Assumption Considered Harmful",
RFC 4943, DOI 10.17487/RFC4943, September 2007,
<https://www.rfc-editor.org/info/rfc4943>.
[RFC4994] Zeng, S., Volz, B., Kinnear, K., and J. Brzozowski,
"DHCPv6 Relay Agent Echo Request Option", RFC 4994,
DOI 10.17487/RFC4994, September 2007,
<https://www.rfc-editor.org/info/rfc4994>.
[RFC5007] Brzozowski, J., Kinnear, K., Volz, B., and S. Zeng,
"DHCPv6 Leasequery", RFC 5007, DOI 10.17487/RFC5007,
September 2007, <https://www.rfc-editor.org/info/rfc5007>.
[RFC5453] Krishnan, S., "Reserved IPv6 Interface Identifiers",
RFC 5453, DOI 10.17487/RFC5453, February 2009,
<https://www.rfc-editor.org/info/rfc5453>.
[RFC5460] Stapp, M., "DHCPv6 Bulk Leasequery", RFC 5460,
DOI 10.17487/RFC5460, February 2009,
<https://www.rfc-editor.org/info/rfc5460>.
[RFC5905] Mills, D., Martin, J., Ed., Burbank, J., and W. Kasch,
"Network Time Protocol Version 4: Protocol and Algorithms
Specification", RFC 5905, DOI 10.17487/RFC5905, June 2010,
<https://www.rfc-editor.org/info/rfc5905>.
[RFC5908] Gayraud, R. and B. Lourdelet, "Network Time Protocol (NTP)
Server Option for DHCPv6", RFC 5908, DOI 10.17487/RFC5908,
June 2010, <https://www.rfc-editor.org/info/rfc5908>.
[RFC6422] Lemon, T. and Q. Wu, "Relay-Supplied DHCP Options",
RFC 6422, DOI 10.17487/RFC6422, December 2011,
<https://www.rfc-editor.org/info/rfc6422>.
[RFC6603] Korhonen, J., Ed., Savolainen, T., Krishnan, S., and O.
Troan, "Prefix Exclude Option for DHCPv6-based Prefix
Delegation", RFC 6603, DOI 10.17487/RFC6603, May 2012,
<https://www.rfc-editor.org/info/rfc6603>.
[RFC6724] Thaler, D., Ed., Draves, R., Matsumoto, A., and T. Chown,
"Default Address Selection for Internet Protocol Version 6
(IPv6)", RFC 6724, DOI 10.17487/RFC6724, September 2012,
<https://www.rfc-editor.org/info/rfc6724>.
[RFC6879] Jiang, S., Liu, B., and B. Carpenter, "IPv6 Enterprise
Network Renumbering Scenarios, Considerations, and
Methods", RFC 6879, DOI 10.17487/RFC6879, February 2013,
<https://www.rfc-editor.org/info/rfc6879>.
[RFC6939] Halwasia, G., Bhandari, S., and W. Dec, "Client Link-Layer
Address Option in DHCPv6", RFC 6939, DOI 10.17487/RFC6939,
May 2013, <https://www.rfc-editor.org/info/rfc6939>.
[RFC7083] Droms, R., "Modification to Default Values of SOL_MAX_RT
and INF_MAX_RT", RFC 7083, DOI 10.17487/RFC7083,
November 2013, <https://www.rfc-editor.org/info/rfc7083>.
[RFC7084] Singh, H., Beebee, W., Donley, C., and B. Stark, "Basic
Requirements for IPv6 Customer Edge Routers", RFC 7084,
DOI 10.17487/RFC7084, November 2013,
<https://www.rfc-editor.org/info/rfc7084>.
[RFC7136] Carpenter, B. and S. Jiang, "Significance of IPv6
Interface Identifiers", RFC 7136, DOI 10.17487/RFC7136,
February 2014, <https://www.rfc-editor.org/info/rfc7136>.
[RFC7341] Sun, Q., Cui, Y., Siodelski, M., Krishnan, S., and I.
Farrer, "DHCPv4-over-DHCPv6 (DHCP 4o6) Transport",
RFC 7341, DOI 10.17487/RFC7341, August 2014,
<https://www.rfc-editor.org/info/rfc7341>.
[RFC7368] Chown, T., Ed., Arkko, J., Brandt, A., Troan, O., and J.
Weil, "IPv6 Home Networking Architecture Principles",
RFC 7368, DOI 10.17487/RFC7368, October 2014,
<https://www.rfc-editor.org/info/rfc7368>.
[RFC7513] Bi, J., Wu, J., Yao, G., and F. Baker, "Source Address
Validation Improvement (SAVI) Solution for DHCP",
RFC 7513, DOI 10.17487/RFC7513, May 2015,
<https://www.rfc-editor.org/info/rfc7513>.
[RFC7550] Troan, O., Volz, B., and M. Siodelski, "Issues and
Recommendations with Multiple Stateful DHCPv6 Options",
RFC 7550, DOI 10.17487/RFC7550, May 2015,
<https://www.rfc-editor.org/info/rfc7550>.
[RFC7598] Mrugalski, T., Troan, O., Farrer, I., Perreault, S., Dec,
W., Bao, C., Yeh, L., and X. Deng, "DHCPv6 Options for
Configuration of Softwire Address and Port-Mapped
Clients", RFC 7598, DOI 10.17487/RFC7598, July 2015,
<https://www.rfc-editor.org/info/rfc7598>.
[RFC7610] Gont, F., Liu, W., and G. Van de Velde, "DHCPv6-Shield:
Protecting against Rogue DHCPv6 Servers", BCP 199,
RFC 7610, DOI 10.17487/RFC7610, August 2015,
<https://www.rfc-editor.org/info/rfc7610>.
[RFC7707] Gont, F. and T. Chown, "Network Reconnaissance in IPv6
Networks", RFC 7707, DOI 10.17487/RFC7707, March 2016,
<https://www.rfc-editor.org/info/rfc7707>.
[RFC7721] Cooper, A., Gont, F., and D. Thaler, "Security and Privacy
Considerations for IPv6 Address Generation Mechanisms",
RFC 7721, DOI 10.17487/RFC7721, March 2016,
<https://www.rfc-editor.org/info/rfc7721>.
[RFC7824] Krishnan, S., Mrugalski, T., and S. Jiang, "Privacy
Considerations for DHCPv6", RFC 7824,
DOI 10.17487/RFC7824, May 2016,
<https://www.rfc-editor.org/info/rfc7824>.
[RFC7844] Huitema, C., Mrugalski, T., and S. Krishnan, "Anonymity
Profiles for DHCP Clients", RFC 7844,
DOI 10.17487/RFC7844, May 2016,
<https://www.rfc-editor.org/info/rfc7844>.
[RFC7969] Lemon, T. and T. Mrugalski, "Customizing DHCP
Configuration on the Basis of Network Topology", RFC 7969,
DOI 10.17487/RFC7969, October 2016,
<https://www.rfc-editor.org/info/rfc7969>.
[RFC8156] Mrugalski, T. and K. Kinnear, "DHCPv6 Failover Protocol",
RFC 8156, DOI 10.17487/RFC8156, June 2017,
<https://www.rfc-editor.org/info/rfc8156>.
[RFC8168] Li, T., Liu, C., and Y. Cui, "DHCPv6 Prefix-Length Hint
Issues", RFC 8168, DOI 10.17487/RFC8168, May 2017,
<https://www.rfc-editor.org/info/rfc8168>.
[TR-187] Broadband Forum, "TR-187 - IPv6 for PPP Broadband Access",
February 2013, <https://www.broadband-forum.org/
technical/download/TR-187_Issue-2.pdf>.
Appendix A. Summary of Changes โจ
Okay bestie, this appendix is the big "what's new" recap for this updated DHCPv6 spec. Here's the tea, item by item ๐
- The Introduction (Section 1) got reorganized and glowed up ๐ธ. The client/server message exchanges now have their own brand new (and expanded) section (see Section 5).
- New sections were added to talk about how this connects to older DHCPv6 docs, and also to DHCPv4 ๐ฆ.
- Sections 2 ("Requirements") and 3 ("Background") only had very minor edits ๐ค.
- Section 4 ("Terminology") had minor edits too.
- Section 4.2 ("DHCP Terminology") got expanded to pull in definitions from RFC 3633, add T1/T2 definitions, add definitions useful for describing combined address assignment and prefix delegation operations, and improve some existing definitions ๐.
- Section 5 ("Client/Server Exchanges") was created from material previously in Section 1 of RFC 3315 ("Introduction and Overview") and then expanded ๐ซถ.
- Section 6 ("Operational Models") is brand new! It explains the kinds of DHCP clients and how they operate ๐ง.
- Section 7 ("DHCP Constants") was mostly updated to add constants from RFC 4242 and RFC 7083. Heads up: the default
HOP_COUNT_LIMITvalue went down from 32 to 8 ๐. - Sections 8 ("Client/Server Message Formats"), 9 ("Relay Agent/ Server Message Formats"), and 10 ("Representation and Use of Domain Names") only had very minor changes ๐.
- Section 11 ("DHCP Unique Identifier (DUID)") now discourages, rather than disallows, a server from parsing the DUID. It also has some info on the DUID-UUID (RFC 6355) now, plus other minor edits.
- Section 12 ("Identity Association") got expanded to explain the concept better, and now it also covers prefix delegation ๐.
- Section 13 ("Assignment to an IA") pulls in material from two sections (11 and 12) of RFC 3315, and it also has a section on prefix delegation.
- Section 14 ("Transmission of Messages by a Client") was expanded to cover rate limiting by clients, and how clients should handle T1 or T2 values of 0.
- Section 15 ("Reliability of Client-Initiated Message Exchanges") was expanded to clarify that the Elapsed Time option must be updated in retransmitted messages, and that a client is not required to listen for DHCP traffic for the entire retransmission period โฐ.
- Section 16 ("Message Validation") had minor edits.
- Section 17 ("Client Source Address and Interface Selection") was expanded to include prefix delegation.
- Section 18 ("DHCP Configuration Exchanges") is where the RFC 3315 sections "DHCP Server Solicitation" (Section 17), "DHCP Client-Initiated Configuration Exchange" (Section 18), and "DHCP Server-Initiated Configuration Exchange" (Section 19) all got merged. It was reorganized and enhanced, and it brings in prefix delegation from RFC 3633 plus other changes from RFC 4242, RFC 7083, and RFC 7550. A few highlights:
- A. The Option Request option is no longer optional for some messages (Solicit and Information-request), because RFC 7083 says clients have to request SOL_MAX_RT or INF_MAX_RT options ๐.
- B. The Reconfigure message should no longer contain IA_NA/IA_PD, ORO, or other options to tell the client what was reconfigured. The client should ask for everything it needs in the response to the Reconfigure ๐.
- C. The lifetime and T1/T2 hints should not be sent by a client (it should send values of 0 in these fields), and any non-zero values should be ignored by the server ๐ โโ๏ธ.
- D. Clarified that a server may return different addresses in the Reply than the client requested in the Request message. Also clarified that a server must not include addresses that it will not assign ๐.
Also, Section 18.2.12 ("Refreshing Configuration Information") was added to show use cases for when a client should try to refresh network information.
- Section 19 ("Relay Agent Behavior") incorporates RFC 7283 and had minor edits. A new section, "Interaction between Relay Agents and Servers" (Section 19.4), was added ๐งโโ๏ธ.
- Section 20 ("Authentication of DHCP Messages") got significant changes. IPsec materials were mostly removed and replaced with a reference to RFC 8213, and the delayed authentication protocol has been obsoleted (see Section 25). Note that RKAP is still considered current ๐.
- Section 21 ("DHCP Options") was expanded to incorporate OPTION_IA_PD and OPTION_IAPREFIX from RFC 3633, the Information Refresh Time option (OPTION_INFORMATION_REFRESH_TIME) from RFC 4242, and the SOL_MAX_RT and INF_MAX_RT options from RFC 7083. Some extra edits clarify option handling, like which options should not be in an Option Request option.
- The security considerations (Section 22) got updated to expand the discussion of security threats and include material from the incorporated documents, mainly RFC 3633. This one is serious business ๐จ.
- New privacy considerations were added (Section 23) to account for privacy issues ๐ซฃ.
- Section 24 ("IANA Considerations") was rewritten to reflect the changes requested for this document. Other documents had already made the message, option, DUID, and status code assignments, and this document doesn't add any new assignments ๐.
- Section 25 ("Obsoleted Mechanisms") is a new section that documents the mechanisms this specification obsoletes ๐๏ธ.
- Appendices B ("Appearance of Options in Message Types") and C ("Appearance of Options in the "options" Field of DHCP Options") got updated to reflect the incorporated options from RFC 3633, RFC 4242, and RFC 7083.
- Where it made sense, informative references were added to give more background and guidance throughout the document. You can totally tell from the huge jump in references ๐.
- Changes were made to incorporate these errata:
Note that Erratum ID 1880 for RFC 3633 no longer applies, since servers (delegating routers) ignore received T1/T2 hints (see (C) in item 17 above) ๐.
- General changes to other IPv6 specifications were made to the document, like removing the use of site-local unicast addresses and adding unique local addresses ๐.
- Quick heads up: this document doesn't refer to all DHCPv6 functionality and specifications. Readers should visit
https://www.iana.org/assignments/dhcpv6-parametersandhttps://datatracker.ietf.org/wg/dhc/to learn about the RFCs that define DHCPv6 messages, options, status codes, and more ๐ง.
Appendix B. Appearance of Options in Message Types ๐
Here's where we check which options are allowed in each DHCP message type. The tables mark each allowed option with a "*" ๐.
These tables are just informational. If they ever conflict with the text earlier in this document, go with that text, because it's the authoritative one ๐.
Client Server IA_NA/ Elap. Relay Server
ID ID IA_TA IA_PD ORO Pref Time Msg. Auth. Unicast
Solicit * * * * *
Advert. * * * * *
Request * * * * * *
Confirm * * *
Renew * * * * * *
Rebind * * * * *
Decline * * * * *
Release * * * * *
Reply * * * * * *
Reconf. * * *
Inform. * (see note) * *
R-forw. *
R-repl. *
NOTE: The Server Identifier option (see Section 21.3) is only included in Information-request messages that are sent in response to a Reconfigure (see Section 18.2.6). Don't skip this one! ๐
Info
Status Rap. User Vendor Vendor Inter. Recon. Recon. Refresh
Code Comm. Class Class Spec. ID Msg. Accept Time
Solicit * * * * *
Advert. * * * * *
Request * * * *
Confirm * * *
Renew * * * *
Rebind * * * *
Decline * * *
Release * * *
Reply * * * * * * *
Reconf. *
Inform. * * * *
R-forw. * *
R-repl. * *
SOL_MAX_RT INF_MAX_RT
Solicit
Advert. *
Request
Confirm
Renew
Rebind
Decline
Release
Reply * *
Reconf.
Inform.
R-forw.
R-repl.
Appendix C. Appearance of Options in the "options" Field of DHCP Options ๐
This table shows where the options defined in this document can show up, either as top-level options or wrapped inside other options defined here, marked with a "*" ๐ง. Other RFCs can define extra situations where options from this document get encapsulated in other options, so keep that in mind.
This table is informational too. If it conflicts with text earlier in this document, that text wins ๐ .
Top- IA_NA/ RELAY- RELAY-
Level IA_TA IAADDR IA_PD IAPREFIX FORW REPL
Client ID *
Server ID *
IA_NA/IA_TA *
IAADDR *
IA_PD *
IAPREFIX *
ORO *
Preference *
Elapsed Time *
Relay Message * *
Authentic. *
Server Uni. *
Status Code * * *
Rapid Comm. *
User Class *
Vendor Class *
Vendor Info. * * *
Interf. ID * *
Reconf. MSG. *
Reconf. Accept *
Info Refresh Time *
SOL_MAX_RT *
INF_MAX_RT *
Notes: Options asterisked in the "Top-Level" column appear in the "options" field of client messages (see Section 8). Options asterisked in the "RELAY-FORW" and "RELAY-REPL" columns appear in the "options" field of the Relay-forward and Relay-reply messages (see Section 9) ๐.
Acknowledgments ๐โจ
okay so this doc is basically a glow-up of earlier work by a bunch of brilliant people, and it literally wouldn't exist without them ๐ซถ the originals are:
- RFC 3315 (Ralph Droms, Jim Bound, Bernie Volz, Ted Lemon, Charles Perkins, and Mike Carney)
- RFC 3633 (Ole Troan and Ralph Droms)
- RFC 3736 (Ralph Droms)
- RFC 4242 (Stig Venaas, Tim Chown, and Bernie Volz)
- RFC 7083 (Ralph Droms)
- RFC 7283 (Yong Cui, Qi Sun, and Ted Lemon)
- RFC 7550 (Ole Troan, Bernie Volz, and Marcin Siodelski)
A whole crew of other people also helped spot problems with RFC 3315 and RFC 3633 and suggested fixes that made it into this document ๐ (listed here in no particular order): Ole Troan, Robert Marks, Leaf Yeh, Michelle Cotton, Pablo Armando, John Brzozowski, Suresh Krishnan, Hideshi Enokihara, Alexandru Petrescu, Yukiyo Akisada, Tatuya Jinmei, Fred Templin, and Christian Huitema. ๐
Then there are the people who left review comments and weren't mentioned elsewhere ๐ (also in no particular order): Jeremy Reed, Francis Dupont, Lorenzo Colitti, Tianxiang Li, Ian Farrer, Yogendra Pal, Kim Kinnear, Shawn Routhier, Michayla Newcombe, Alissa Cooper, Allison Mankin, Adam Roach, Kyle Rose, Elwyn Davies, Eric Rescorla, Ben Campbell, Warren Kumari, and Kathleen Moriarty. ๐ธ
And a huge special thank you to Ralph Droms ๐ for answering so many questions about the original RFC 3315 and RFC 3633 work, and for shepherding this document through the IETF process. Iconic behaviour, honestly. ๐ฅน
Authors' Addresses ๐ฎ
Here's where you can find the authors ๐
Tomek Mrugalski ๐
Internet Systems Consortium, Inc.
950 Charter Street
Redwood City, CA 94063
United States of America
Email: tomasz.mrugalski@gmail.com
Marcin Siodelski ๐ฆ
Internet Systems Consortium, Inc.
950 Charter Street
Redwood City, CA 94063
United States of America
Email: msiodelski@gmail.com
Bernie Volz ๐
Cisco Systems, Inc.
1414 Massachusetts Ave.
Boxborough, MA 01719
United States of America
Email: volz@cisco.com
Andrew Yourtchenko ๐
Cisco Systems, Inc.
De kleetlaan 6a
Diegem BRABANT 1831
Belgium
Email: ayourtch@cisco.com
Michael C. Richardson โญ
Sandelman Software Works
470 Dawson Avenue
Ottawa, ON K1Z 5V7
Canada
Email: mcr+ietf@sandelman.ca
URI: http://www.sandelman.ca/
Sheng Jiang ๐ง
Huawei Technologies Co., Ltd
Q14, Huawei Campus, No. 156 Beiqing Road
Hai-Dian District, Beijing 100095
China
Email: jiangsheng@huawei.com
Ted Lemon ๐
Nibbhaya Consulting
P.O. Box 958
Brattleboro, VT 05301-0958
United States of America
Email: mellon@fugue.com
Timothy Winters ๐ซถ
University of New Hampshire, Interoperability Lab (UNH-IOL)
Durham, NH
United States of America
Email: twinters@iol.unh.edu
๐ฆ where this page comes from
- ietf: rfc8415 2018-11
- ๐ girlified by claude-haiku-5-5 on : a language model's rewrite of the original, under its terms