RFC 3315
Dynamic Host Configuration Protocol for IPv6 (DHCPv6)
RFC 3315: Dynamic Host Configuration Protocol for IPv6 (DHCPv6) ๐
Part 1 of 21 ๐
Okay bestie, this is the title block, and it's giving serious standards-track energy ๐ง. Here's the tea:
- Number: RFC 3315 ๐ฆ
- Working group: Network Working Group
- Editor: R. Droms, Ed., from Cisco ๐
- Other authors: J. Bound (Hewlett Packard), B. Volz (Ericsson), T. Lemon (Nominum), C. Perkins (Nokia Research Center), and M. Carney (Sun Microsystems) ๐ซถ
- Category: Standards Track โจ
- Date: July 2003 ๐ธ
- Obsoletes and updates: The title block doesn't list anything this RFC obsoletes or updates ๐
Six people wrote this together, which is honestly iconic ๐ญ.
Status of this Memo ๐
Okay so this section is the official "what kind of document is this" part. This document specifies an Internet standards track protocol for the Internet community, and it's literally asking everyone to chime in with discussion and suggestions for improvements ๐ฌ. If you want the current standardization state and status of this protocol, go check the current edition of the "Internet Official Protocol Standards" (STD 1) ๐. And distribution of this memo is unlimited, so share it with everyone you know ๐.
Copyright Notice ๐ฅ
Copyright (C) The Internet Society (2003). All Rights Reserved. โจ
Abstract ๐ง
Okay, the main vibe: the Dynamic Host Configuration Protocol for IPv6 (DHCP) lets DHCP servers pass configuration parameters, like IPv6 network addresses, over to IPv6 nodes ๐. It's giving automatic allocation of reusable network addresses plus extra configuration flexibility ๐ฆ, which is so useful, ngl.
It's also the stateful counterpart to "IPv6 Stateless Address Autoconfiguration" (RFC 2462) ๐. The cute part is that you can use DHCP on its own, or run it alongside RFC 2462 to get your configuration parameters ๐ซถ. Main character energy for sure ๐.
Table of Contents ๐บ๏ธ
okay bestie, this is the map of the whole spec, so let's see where everything lives ๐ section numbers and page numbers stay exactly as they are so you can find everything ๐ซถ
1. Introduction and Overview . . . . . . . . . . . . . . . . . . 5
1.1. Protocols and Addressing . . . . . . . . . . . . . . . 6
1.2. Client-server Exchanges Involving Two Messages . . . . 6
1.3. Client-server Exchanges Involving Four Messages. . . . 7
2. Requirements. . . . . . . . . . . . . . . . . . . . . . . . . 7
3. Background. . . . . . . . . . . . . . . . . . . . . . . . . . 8
4. Terminology . . . . . . . . . . . . . . . . . . . . . . . . . 8
4.1. IPv6 Terminology . . . . . . . . . . . . . . . . . . . 9
4.2. DHCP Terminology . . . . . . . . . . . . . . . . . . . 10
5. DHCP Constants. . . . . . . . . . . . . . . . . . . . . . . . 12
5.1. Multicast Addresses. . . . . . . . . . . . . . . . . . 13
5.2. UDP Ports. . . . . . . . . . . . . . . . . . . . . . . 13
5.3. DHCP Message Types . . . . . . . . . . . . . . . . . . 13
5.4. Status Codes . . . . . . . . . . . . . . . . . . . . . 15
5.5. Transmission and Retransmission Parameters . . . . . . 16
5.6 Representation of time values and "Infinity" as a time
value. . . . . . . . . . . . . . . . . . . . . . . . . 16
6. Client/Server Message Formats . . . . . . . . . . . . . . . . 16
7. Relay Agent/Server Message Formats. . . . . . . . . . . . . . 17
7.1. Relay-forward Message. . . . . . . . . . . . . . . . . 18
7.2. Relay-reply Message. . . . . . . . . . . . . . . . . . 19
8. Representation and Use of Domain Names. . . . . . . . . . . . 19
9. DHCP Unique Identifier (DUID) . . . . . . . . . . . . . . . . 19
9.1. DUID Contents. . . . . . . . . . . . . . . . . . . . . 20
9.2. DUID Based on Link-layer Address Plus Time [DUID-LLT]. 20
9.3. DUID Assigned by Vendor Based on Enterprise Number
[DUID-EN]. . . . . . . . . . . . . . . . . . . . . . . 22
9.4. DUID Based on Link-layer Address [DUID-LL] . . . . . . 22
10. Identity Association. . . . . . . . . . . . . . . . . . . . . 23
11. Selecting Addresses for Assignment to an IA . . . . . . . . . 24
12. Management of Temporary Addresses . . . . . . . . . . . . . . 25
13. Transmission of Messages by a Client. . . . . . . . . . . . . 25
14. Reliability of Client Initiated Message Exchanges . . . . . . 26
15. Message Validation. . . . . . . . . . . . . . . . . . . . . . 27
15.1. Use of Transaction IDs . . . . . . . . . . . . . . . . 28
15.2. Solicit Message. . . . . . . . . . . . . . . . . . . . 28
15.3. Advertise Message. . . . . . . . . . . . . . . . . . . 28
15.4. Request Message. . . . . . . . . . . . . . . . . . . . 29
15.5. Confirm Message. . . . . . . . . . . . . . . . . . . . 29
15.6. Renew Message. . . . . . . . . . . . . . . . . . . . . 29
15.7. Rebind Message . . . . . . . . . . . . . . . . . . . . 29
15.8. Decline Messages . . . . . . . . . . . . . . . . . . . 30
15.9. Release Message. . . . . . . . . . . . . . . . . . . . 30
15.10. Reply Message. . . . . . . . . . . . . . . . . . . . . 30
15.11. Reconfigure Message. . . . . . . . . . . . . . . . . . 31
15.12. Information-request Message. . . . . . . . . . . . . . 31
15.13. Relay-forward Message. . . . . . . . . . . . . . . . . 31
15.14. Relay-reply Message. . . . . . . . . . . . . . . . . . 31
16. Client Source Address and Interface Selection . . . . . . . . 32
17. DHCP Server Solicitation. . . . . . . . . . . . . . . . . . . 32
17.1. Client Behavior. . . . . . . . . . . . . . . . . . . . 32
17.1.1. Creation of Solicit Messages . . . . . . . . . 32
17.1.2. Transmission of Solicit Messages . . . . . . . 33
17.1.3. Receipt of Advertise Messages. . . . . . . . . 35
17.1.4. Receipt of Reply Message . . . . . . . . . . . 35
17.2. Server Behavior. . . . . . . . . . . . . . . . . . . . 36
17.2.1. Receipt of Solicit Messages . . . . . . . . . 36
17.2.2. Creation and Transmission of Advertise Messages 36
17.2.3. Creation and Transmission of Reply Messages. . 38
18. DHCP Client-Initiated Configuration Exchange. . . . . . . . . 38
18.1. Client Behavior. . . . . . . . . . . . . . . . . . . . 39
18.1.1. Creation and Transmission of Request Messages. 39
18.1.2. Creation and Transmission of Confirm Messages. 40
18.1.3. Creation and Transmission of Renew Messages. . 41
18.1.4. Creation and Transmission of Rebind Messages . 43
18.1.5. Creation and Transmission of Information-
request Messages . . .. . . . . . . . . . . . 44
18.1.6. Creation and Transmission of Release Messages. 44
18.1.7. Creation and Transmission of Decline Messages. 46
18.1.8. Receipt of Reply Messages. . . . . . . . . . . 46
18.2. Server Behavior. . . . . . . . . . . . . . . . . . . . 48
18.2.1. Receipt of Request Messages. . . . . . . . . . 49
18.2.2. Receipt of Confirm Messages. . . . . . . . . . 50
18.2.3. Receipt of Renew Messages. . . . . . . . . . . 51
18.2.4. Receipt of Rebind Messages . . . . . . . . . . 51
18.2.5. Receipt of Information-request Messages. . . . 52
18.2.6. Receipt of Release Messages. . . . . . . . . . 53
18.2.7. Receipt of Decline Messages. . . . . . . . . . 53
18.2.8. Transmission of Reply Messages . . . . . . . . 54
19. DHCP Server-Initiated Configuration Exchange. . . . . . . . . 54
19.1. Server Behavior. . . . . . . . . . . . . . . . . . . . 55
19.1.1. Creation and Transmission of Reconfigure
Messages . . . . . . . . . . . . . . . . . . . 55
19.1.2. Time Out and Retransmission of Reconfigure
Messages . . . . . . . . . . . . . . . . . . . 56
19.2. Receipt of Renew Messages. . . . . . . . . . . . . . . 56
19.3. Receipt of Information-request Messages. . . . . . . . 56
19.4. Client Behavior. . . . . . . . . . . . . . . . . . . . 57
19.4.1. Receipt of Reconfigure Messages. . . . . . . . 57
19.4.2. Creation and Transmission of Renew Messages. . 58
19.4.3. Creation and Transmission of Information-
request Messages . . . . . . . . . . . . . . . 58
19.4.4. Time Out and Retransmission of Renew or
Information-request Messages . . . . . . . . . 58
19.4.5. Receipt of Reply Messages. . . . . . . . . . . 58
20. Relay Agent Behavior. . . . . . . . . . . . . . . . . . . . . 58
20.1. Relaying a Client Message or a Relay-forward Message . 59
20.1.1. Relaying a Message from a Client . . . . . . . 59
20.1.2. Relaying a Message from a Relay Agent. . . . . 59
20.2. Relaying a Relay-reply Message . . . . . . . . . . . . 60
20.3. Construction of Relay-reply Messages . . . . . . . . . 60
21. Authentication of DHCP Messages . . . . . . . . . . . . . . . 61
21.1. Security of Messages Sent Between Servers and Relay
Agents . . . . . . . . . . . . . . . . . . . . . . . 61
21.2. Summary of DHCP Authentication . . . . . . . . . . . . 63
21.3. Replay Detection . . . . . . . . . . . . . . . . . . . 63
21.4. Delayed Authentication Protocol. . . . . . . . . . . . 63
21.4.1. Use of the Authentication Option in the Delayed
Authentication Protocol. . . . . . . . . . . . 64
21.4.2. Message Validation . . . . . . . . . . . . . . 65
21.4.3. Key Utilization . . . . . . . . . . . . . . . 65
21.4.4. Client Considerations for Delayed Authentication
Protocol . . . . . . . . . . . . . . . . . . . 66
21.4.5. Server Considerations for Delayed Authentication
Protocol . . . . . . . . . . . . . . . . . . . 67
21.5. Reconfigure Key Authentication Protocol. . . . . . . . 68
21.5.1. Use of the Authentication Option in the
Reconfigure Key Authentication Protocol. . . . 69
21.5.2. Server considerations for Reconfigure Key
protocol . . . . . . . . . . . . . . . . . . . 69
21.5.3. Client considerations for Reconfigure Key
protocol . . . . . . . . . . . . . . . . . . . 70
22. DHCP Options. . . . . . . . . . . . . . . . . . . . . . . . . 70
22.1. Format of DHCP Options . . . . . . . . . . . . . . . . 71
22.2. Client Identifier Option . . . . . . . . . . . . . . . 71
22.3. Server Identifier Option . . . . . . . . . . . . . . . 72
22.4. Identity Association for Non-temporary Addresses Option 72
22.5. Identity Association for Temporary Addresses Option. . 75
22.6. IA Address Option. . . . . . . . . . . . . . . . . . . 76
22.7. Option Request Option. . . . . . . . . . . . . . . . . 78
22.8. Preference Option. . . . . . . . . . . . . . . . . . . 79
22.9. Elapsed Time Option. . . . . . . . . . . . . . . . . . 79
22.10. Relay Message Option . . . . . . . . . . . . . . . . . 80
22.11. Authentication Option. . . . . . . . . . . . . . . . . 81
22.12. Server Unicast Option. . . . . . . . . . . . . . . . . 82
22.13. Status Code Option . . . . . . . . . . . . . . . . . . 82
22.14. Rapid Commit Option. . . . . . . . . . . . . . . . . . 83
22.15. User Class Option. . . . . . . . . . . . . . . . . . . 84
22.16. Vendor Class Option. . . . . . . . . . . . . . . . . . 85
22.17. Vendor-specific Information Option . . . . . . . . . . 86
22.18. Interface-Id Option. . . . . . . . . . . . . . . . . . 87
22.19. Reconfigure Message Option . . . . . . . . . . . . . . 88
22.20. Reconfigure Accept Option. . . . . . . . . . . . . . . 89
23. Security Considerations . . . . . . . . . . . . . . . . . . . 89
24. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 91
24.1. Multicast Addresses. . . . . . . . . . . . . . . . . . 92
24.2. DHCP Message Types . . . . . . . . . . . . . . . . . . 93
24.3. DHCP Options . . . . . . . . . . . . . . . . . . . . . 94
24.4. Status Codes . . . . . . . . . . . . . . . . . . . . . 95
24.5. DUID . . . . . . . . . . . . . . . . . . . . . . . . . 95
25. Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . 95
26. References. . . . . . . . . . . . . . . . . . . . . . . . . . 96
26.1. Normative References . . . . . . . . . . . . . . . . . 96
26.2. Informative References . . . . . . . . . . . . . . . . 97
A. Appearance of Options in Message Types . . . . . . . . . . . . 98
B. Appearance of Options in the Options Field of DHCP Options . . 99
Chair's Address . . . . . . . . . . . . . . . . . . . . . . . . . 99
Authors' Addresses. . . . . . . . . . . . . . . . . . . . . . . . 100
Full Copyright Statement. . . . . . . . . . . . . . . . . . . . . 101
1. Introduction and Overview โจ
okay so this doc is about DHCP for IPv6 (aka DHCP ๐), a client/server protocol for managed configuration of devices ๐
DHCP can hand a device addresses from a DHCP server, plus other config info that rides along in options ๐ง and you can extend it by defining new options for stuff this doc doesn't cover yet ๐
DHCP is the "stateful address autoconfiguration protocol" and the "stateful autoconfiguration protocol" mentioned in "IPv6 Stateless Address Autoconfiguration" [17] ๐ฆ
the operational models and config info for DHCPv4 [18][19] and DHCPv6 are different enough that integrating the two isn't included here ๐ if there's enough interest and demand, someone could write a doc that extends DHCPv6 to carry IPv4 addresses and config info ๐
the rest of this intro gives you the summary: how the messages get exchanged, plus example flows ๐ the flows in sections 1.2 and 1.3 are just illustrations, not a complete list of every possible client-server interaction โจ if you want the full detailed play-by-play for client and server, look at Sections 17, 18, and 19 ๐ซถ
1.1. Protocols and Addressing
clients and servers swap DHCP messages using UDP [15] ๐ธ the client uses a link-local address (or addresses figured out some other way) to send and receive DHCP messages ๐ฆ
DHCP servers receive messages from clients on a reserved, link-scoped multicast address ๐ most of the time the client sends to that reserved multicast address, so it doesn't need to be configured with the address(es) of any DHCP servers. iconic, honestly ๐
now, what if the server isn't on the same link as the client? ๐ค that's where a DHCP relay agent comes in. it sits on the client's link and relays messages between the client and server ๐ง the client doesn't even notice the relay agent, so the message exchanges in the rest of this section skip over the relaying part ๐
once the client has figured out a server's address, it may, under some circumstances, send messages straight to that server using unicast ๐
1.2. Client-server Exchanges Involving Two Messages
when a DHCP client doesn't need a server to assign it IP addresses, it can still grab config info, like a list of DNS servers [20] or NTP servers [21], in one message and one reply ๐ to do that, the client first sends an Information-Request message to the All_DHCP_Relay_Agents_and_Servers multicast address โจ then the servers respond with a Reply message carrying the config info for the client ๐
this exchange assumes the client only needs configuration information and doesn't need any IPv6 addresses assigned ๐ซถ
now, when a server already has IPv6 addresses and other config info committed to a client, they might be able to finish the whole thing in just two messages instead of the four we'll see in the next section ๐ฅ here's how it goes: the client sends a Solicit message to All_DHCP_Relay_Agents_and_Servers asking for addresses and other config info ๐ that message also says the client is willing to accept an immediate Reply ๐ฆ the server that's willing to commit the addresses right away responds with a Reply message ๐ and then the config info and addresses in that Reply are immediately ready for the client to use ๐
each address given to the client has preferred and valid lifetimes set by the server ๐ if the client wants to extend those lifetimes, it sends a Renew message to the server โญ the server replies with the new lifetimes, so the client keeps using the address without any interruption ๐
1.3. Client-server Exchanges Involving Four Messages
to ask for one or more IPv6 addresses, a client first has to find a DHCP server, and then request addresses and other config info from that server ๐ง the client sends a Solicit message to the All_DHCP_Relay_Agents_and_Servers address to look for available DHCP servers ๐ any server that can meet the client's requirements answers with an Advertise message ๐
the client picks one of those servers and sends it a Request message asking for confirmed assignment of addresses and other config info ๐ซถ the server responds with a Reply message containing the confirmed addresses and config ๐ธ
like we said in the previous section, the client sends a Renew message to the server to extend the lifetimes on its addresses, so it can keep using them without interruption โจ
2. Requirements ๐
the keywords MUST, MUST NOT, REQUIRED, SHALL, SHALL NOT, SHOULD, SHOULD NOT, RECOMMENDED, MAY, and OPTIONAL, when they show up in this document, are to be interpreted as described in [1] ๐ this is the rulebook, bestie, so pay attention to those words ๐ญ
this document also uses internal conceptual variables to describe protocol behavior, and external variables that an implementation must let system administrators change ๐ง the specific variable names, how their values change, and how their settings influence behavior are given to demonstrate the protocol behavior ๐ an implementation doesn't have to match the exact form described here, as long as its external behavior is consistent with what this document describes ๐ฆ
3. Background ๐
the IPv6 Specification gives the base architecture and design of IPv6 ๐ธ the related IPv6 work an implementor should study includes the IPv6 Specification [3], the IPv6 Addressing Architecture [5], IPv6 Stateless Address Autoconfiguration [17], IPv6 Neighbor Discovery Processing [13], and Dynamic Updates to DNS [22] ๐ซถ these specs let DHCP build on top of IPv6 to deliver both robust stateful autoconfiguration and autoregistration of DNS Host Names ๐
the IPv6 Addressing Architecture [5] defines the address scopes you can use in an IPv6 implementation, plus the various configuration architecture guidelines for network designers working with the IPv6 address space ๐ two IPv6 advantages: 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 ๐ฆ
IPv6 Stateless Address Autoconfiguration [17] specifies how a node may autoconfigure addresses based on router advertisements [13], and how a valid lifetime supports renumbering of addresses on the Internet ๐ it also specifies how a node's protocol interaction begins stateless or stateful autoconfiguration ๐ง DHCP is one vehicle for stateful autoconfiguration, and being compatible with stateless address autoconfiguration is a design requirement of DHCP ๐
IPv6 Neighbor Discovery [13] is the node discovery protocol in IPv6, and it replaces and enhances the functions of ARP [14] ๐ to understand IPv6 and stateless address autoconfiguration, it is strongly recommended that implementors understand IPv6 Neighbor Discovery ๐ธ
Dynamic Updates to DNS [22] is a spec that supports dynamic updates of DNS records for both IPv4 and IPv6 ๐ฅ DHCP can use those dynamic DNS updates to integrate addresses and the name space, which supports not just autoconfiguration but also autoregistration in IPv6 ๐
4. Terminology ๐
this section defines the terminology specific to IPv6 and DHCP that's used in this document ๐
4.1. IPv6 Terminology ๐ฆ
the IPv6 terms relevant to this spec, taken from the IPv6 Protocol [3], the IPv6 Addressing Architecture [5], and IPv6 Stateless Address Autoconfiguration [17], are included below ๐
address An IP layer identifier for an interface
or a set of interfaces.
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); Token Ring; PPP links,
X.25, Frame Relay, or ATM networks; and
Internet (or higher) layer "tunnels",
such as tunnels over IPv4 or IPv6
itself.
link-layer identifier A link-layer identifier for an
interface. Examples include IEEE 802
addresses for Ethernet or Token Ring
network interfaces, and E.164 addresses
for ISDN links.
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 interface 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.
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 ๐
okay so this part is the DHCP glossary, and you know I love a good glossary ๐ค๐ here's the DHCP-specific vocab you need, bestie:
appropriate to the link ๐ฆ an address is "appropriate to the link" when it's consistent with what the DHCP server knows about the network topology, prefix assignment, and address assignment policies. basically it fits the network the server actually knows about ๐
binding ๐ a binding (aka client binding) is a group of server data records holding what the server knows about the addresses in an IA, or about configuration info that was explicitly assigned to the client. config info handed out through a policy, like what every client on the same link gets, does NOT need a binding ๐
โโ๏ธ a binding for an IA is indexed by the tuple <DUID, IA-type, IAID>, where IA-type is the kind of address in the IA (temporary, for example). a binding for plain config info is indexed by <DUID> โจ
configuration parameter โ๏ธ an element of the config info set on the server and delivered to the client over DHCP. these can carry stuff a node uses to set up its network subsystem and get talking on a link or internetwork, for example ๐
DHCP ๐ Dynamic Host Configuration Protocol for IPv6. the terms DHCPv4 and DHCPv6 only get used where it's needed to avoid confusion ๐ซถ
DHCP client (or client) ๐ a node that starts requests on a link to get configuration parameters from one or more DHCP servers ๐ฌ
DHCP domain ๐ธ a set of links managed by DHCP and run by one administrative entity ๐
DHCP realm ๐ a name that identifies the DHCP administrative domain a DHCP authentication key was picked from ๐๏ธ
DHCP relay agent (or relay agent) ๐ง a node that acts as the middle-person for delivering DHCP messages between clients and servers. it's on the same link as the client ๐ซถ
DHCP server (or server) ๐ a node that answers requests from clients, and it may or may not be on the same link as the client(s) ๐คทโโ๏ธ
DUID ๐ชช a DHCP Unique IDentifier for a DHCP participant. every DHCP client and server has exactly one DUID โจ see section 9 for the details on how a DUID can be built ๐
Identity association (IA) ๐ง a collection of addresses assigned to a client. each IA has an associated IAID, and a client can have more than one IA, for example one per interface ๐
each IA holds one type of address. for example, an identity association for temporary addresses (IA_TA) holds temporary addresses (see "identity association for temporary addresses") ๐ฆ throughout this document, "IA" is used to mean an identity association without saying which type of addresses it holds ๐
Identity association identifier (IAID) ๐ซ an identifier for an IA, chosen by the client. every IA gets an IAID, and it's chosen to be unique among all the IAIDs for IAs belonging to that client ๐
Identity association for non-temporary addresses (IA_NA) ๐ก an IA that carries assigned addresses which aren't temporary addresses (see "identity association for temporary addresses") ๐
Identity association for temporary addresses (IA_TA) ๐ซง an IA that carries temporary addresses (see RFC 3041 [12]) ๐
message ๐ a unit of data carried as the payload of a UDP datagram, exchanged among DHCP servers, relay agents, and clients ๐ฆ
Reconfigure key ๐๏ธ a key a server gives to a client, used to provide security for Reconfigure messages ๐ฅ
relaying ๐จ a DHCP relay agent relays DHCP messages between DHCP participants. that's the whole job, and it's iconic ๐
transaction ID ๐ช an opaque value used to match responses with replies, whether they were started by a client or a server ๐
5. DHCP Constants โจ
this section covers the program and networking constants DHCP uses ๐งฎ๐
5.1. Multicast Addresses ๐ก
DHCP uses the following multicast addresses:
All_DHCP_Relay_Agents_and_Servers (FF02::1:2) ๐ a link-scoped multicast address clients use to talk to neighboring (aka on-link) relay agents and servers. all servers and relay agents are members of this group ๐ซถ
All_DHCP_Servers (FF05::1:3) ๐๏ธ a site-scoped multicast address relay agents use to talk to servers. they do this either because they want to send messages to all servers, or because they don't know the servers' unicast addresses ๐คทโโ๏ธ heads up: for a relay agent to use this address, it has to have an address with enough scope to be reachable by the servers โ ๏ธ all servers within the site are members of this group ๐
5.2. UDP Ports ๐
clients listen for DHCP messages on UDP port 546 ๐ง servers and relay agents listen for DHCP messages on UDP port 547 ๐งโจ
5.3. DHCP Message Types โจ
DHCP has a bunch of message types, and you'll want to know them all ๐ More detail on each one lives in sections 6 and 7. Any message type that isn't on this list is reserved for future use ๐ฎ The number in parentheses is the numeric encoding for each type.
SOLICIT (1): A client sends a Solicit message to find servers ๐ADVERTISE (2): A server sends an Advertise message to say it's open for DHCP business, as a reply to a Solicit from a client ๐ฃREQUEST (3): A client sends a Request message to ask a specific server for configuration parameters, including IP addresses ๐โโ๏ธCONFIRM (4): A client sends a Confirm message to any available server to check whether the addresses it got are still right for the link it's connected to ๐งRENEW (5): A client sends a Renew message to the server that originally gave it its addresses and configuration parameters. This extends the lifetimes on those addresses and updates other parameters ๐REBIND (6): A client sends a Rebind message to any available server to extend the lifetimes on its addresses and update other parameters. This one goes out after the client gets no response to a Renew message ๐ฌREPLY (7): A server sends a Reply message in a few different situations. It can carry assigned addresses and configuration parameters, answering a Solicit, Request, Renew, or Rebind from a client. It can carry configuration parameters only, answering an Information-request. It can confirm or deny that a client's addresses still suit its link, answering a Confirm. And it can acknowledge a Release or Decline ๐RELEASE (8): A client sends a Release message to the server that assigned its addresses, saying it's done using one or more of them ๐DECLINE (9): A client sends a Decline message to a server to say it has found that one or more of the server's addresses are already in use on the link it's connected to ๐ซRECONFIGURE (10): A server sends a Reconfigure message to a client to say it has new or updated configuration parameters. The client then starts a Renew/Reply or Information-request/Reply exchange with the server to grab the updated info ๐INFORMATION-REQUEST (11): A client sends an Information-request message to a server to ask for configuration parameters, without getting any IP addresses assigned ๐งพRELAY-FORW (12): A relay agent sends a Relay-forward message to pass messages along to servers, either directly or through another relay agent. The message it received, whether that's a client message or a Relay-forward from another relay agent, gets wrapped up as an option inside the Relay-forward ๐RELAY-REPL (13): A server sends a Relay-reply message to a relay agent, carrying a message the relay agent hands off to a client. The Relay-reply can be passed along by other relay agents until it reaches the destination relay agent ๐
The server wraps the client message up as an option inside the Relay-reply, and the relay agent unwraps it and forwards it to the client ๐ซถ
5.4. Status Codes ๐ฆ
DHCPv6 uses status codes to say whether the operations clients and servers asked for worked out, and to explain exactly why something failed. The specific status codes are defined in section 24.4 ๐
5.5. Transmission and Retransmission Parameters โฑ๏ธ
This section has a table of values that describe how clients and servers handle sending and resending their messages. Here it is, exactly as written:
Parameter Default Description
-------------------------------------
SOL_MAX_DELAY 1 sec Max delay of first Solicit
SOL_TIMEOUT 1 sec Initial Solicit timeout
SOL_MAX_RT 120 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 120 secs Max Information-request timeout value
REL_TIMEOUT 1 sec Initial Release timeout
REL_MAX_RC 5 MAX Release attempts
DEC_TIMEOUT 1 sec Initial Decline timeout
DEC_MAX_RC 5 Max Decline attempts
REC_TIMEOUT 2 secs Initial Reconfigure timeout
REC_MAX_RC 8 Max Reconfigure attempts
HOP_COUNT_LIMIT 32 Max hop count in a Relay-forward message
5.6 Representation of time values and "Infinity" as a time value โณ
All time values for lifetimes, T1, and T2 are unsigned integers ๐ข The value 0xffffffff means "infinity" when it's used as a lifetime (as in RFC2461 [17]) or as a value for T1 or T2 ๐
6. Client/Server Message Formats ๐
Every DHCP message sent between clients and servers has the same fixed-format header, followed by 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 they aren't aligned any other way, like on 2 or 4 byte boundaries ๐งฉ
Here's the diagram of the format of DHCP messages sent between clients and servers:
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) .
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Here's what each field does ๐
msg-type: Identifies the DHCP message type. The available message types are listed in section 5.3.transaction-id: The transaction ID for this message exchange.options: The options carried in this message. Options are described in section 22.
7. Relay Agent/Server Message Formats ๐ฆ
Relay agents talk to servers to pass messages between clients and servers that aren't on the same link ๐
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 they aren't aligned any other way, like on 2 or 4 byte boundaries ๐งฉ
There are two relay agent messages, and they share the following 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) .... .
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
The following sections describe how to use the Relay Agent message header ๐
7.1. Relay-forward Message ๐ซ
The table below defines how the message fields get used in a Relay-forward message ๐ฏ
msg-type RELAY-FORW
hop-count Number of relay agents that have relayed this
message.
link-address A global or site-local address that will be used by
the server to identify the link on which the client
is located.
peer-address The address of the client or relay agent from which
the message to be relayed was received.
options MUST include a "Relay Message option" (see
section 22.10); MAY include other options added by
the relay agent.
7.2. Relay-reply Message ๐
okay so the Relay-reply is the message that heads back out, and this table is basically the cheat sheet for what each field has to say ๐
msg-type RELAY-REPL
hop-count Copied from the Relay-forward message
link-address Copied from the Relay-forward message
peer-address Copied from the Relay-forward message
options MUST include a "Relay Message option"; see
section 22.10; MAY include other options
8. Representation and Use of Domain Names ๐ธ
so domain names need to be encoded the same way everywhere, bestie ๐ง. a domain name, or a whole list of them, gets encoded with the technique from section 3.1 of RFC 1035 [10]. and here's the big one: a domain name, or list of domain names, in DHCP MUST NOT be stored in compressed form, the way section 4.1.4 of RFC 1035 describes. no compression allowed, periodt ๐ โโ๏ธ
9. DHCP Unique Identifier (DUID) ๐ฆ
every DHCP client and server has a DUID, and it's literally their main character identifier ๐. servers use DUIDs to figure out who's who when picking configuration parameters and linking IAs to clients. clients use DUIDs to identify a server whenever a server needs to be pointed out. check out sections 22.2 and 22.3 to see how a DUID shows up inside a DHCP message ๐จ.
okay, the rules are strict here ๐ค. clients and servers MUST treat DUIDs as opaque values, and they MUST only compare DUIDs for equality. they MUST NOT in any other way interpret DUIDs. and clients and servers MUST NOT restrict DUIDs to the types defined in this document, because additional DUID types may be defined in the future ๐ฎ
the DUID gets carried in an option because it may be variable length, and because it isn't required in every DHCP message. the goal is a DUID that's 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 just because its network hardware changed ๐ซถ
the reason there's more than one type of DUID is that the DUID has to be globally unique and also easy to generate. the kind of globally-unique identifier that's easy to make can look wildly different from device to device ๐. plus, some devices have no persistent storage at all. they can't keep a generated DUID around, so the DUID scheme has to work for those devices too ๐
9.1. DUID Contents ๐
a DUID is a two-octet type code in network byte order, followed by a variable number of octets that make up the actual identifier. a DUID can be no more than 128 octets long, not counting the type code. these are the types that are currently defined:
1 Link-layer address plus time
2 Vendor-assigned unique ID based on Enterprise Number
3 Link-layer address
the format of the variable field for each of the types above is shown below ๐
9.2. DUID Based on Link-layer Address Plus Time [DUID-LLT] โฐ
this type of DUID is the time-based one, and it's giving very structured ๐. it starts with a two octet type field containing the value 1, then a two octet hardware type code, then four octets holding a time value. after that comes 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 generated, counted in seconds since midnight (UTC), January 1, 2000, modulo 2^32. the hardware type MUST be a valid hardware type assigned by the IANA, as described in RFC 826 [14]. both the time and the hardware type are stored in network byte order, and the link-layer address is stored in canonical form, as described in RFC 2464 [2].
here's the diagram for 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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| 1 | hardware type (16 bits) |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| time (32 bits) |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
. .
. link-layer address (variable length) .
. .
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
you can pick whichever network interface you want, totally arbitrary ๐, as long as that interface gives a globally unique link-layer address for its link type. and the same DUID-LLT SHOULD be used when configuring all network interfaces connected to the device, no matter which interface's link-layer address was used to generate the DUID-LLT โจ
now the storage drama ๐ญ. clients and servers using this type of DUID MUST store the DUID-LLT in stable storage, and they MUST continue to use this DUID-LLT even if the network interface used to generate it gets removed. clients and servers without any stable storage MUST NOT use this type of DUID. no exceptions, bestie ๐
clients and servers that use this DUID SHOULD attempt to configure the time before generating the DUID, if that's possible. and they MUST use some sort of time source (a real-time clock, for example) when generating the DUID, even if that time source couldn't be configured beforehand. using a time source makes it unlikely that two identical DUID-LLTs get generated when the network interface is moved from one client to another client that then uses the same interface. even if the clocks weren't configured before generating the DUID, a collision between two DUID-LLTs is very unlikely ๐ฅฐ
this way of generating a DUID is recommended for all general purpose computing devices, like desktop computers and laptop computers, and also for devices like printers, routers, and so on, that contain some form of writable non-volatile storage ๐จ๏ธ
despite our best efforts ๐ฅฒ, it's possible that this algorithm could still result in a client identifier collision. so 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. that's the safety net ๐งฏ
9.3. DUID Assigned by Vendor Based on Enterprise Number [DUID-EN] ๐ญ
this one is assigned by the vendor to the device, so it's basically their signature ๐๏ธ. it's made up of the vendor's registered Private Enterprise Number, as maintained by IANA [6], followed by a unique identifier the vendor assigns. here's the structure at a glance:
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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| 2 | enterprise-number |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| enterprise-number (contd) | |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
. identifier .
. (variable length) .
. .
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
the vendor decides where the identifier comes from, but each identifier part of each DUID-EN MUST be unique to the device using it. it MUST also be assigned to the device when it's manufactured and stored in some form of non-volatile storage. the generated DUID SHOULD be recorded in non-erasable storage ๐. the enterprise-number is that vendor's registered Private Enterprise Number, as maintained by IANA [6], and it's stored as an unsigned 32 bit number ๐ข
here's an example DUID of this type ๐
+---+---+---+---+---+---+---+---+
| 0 | 2 | 0 | 0 | 0 | 9| 12|192|
+---+---+---+---+---+---+---+---+
|132|221| 3 | 0 | 9 | 18|
+---+---+---+---+---+---+
so this example has the two-octet type of 2, the Enterprise Number (9), and then eight octets of identifier data (0x0CC084D303000912). the vibes are immaculate ๐
9.4. DUID Based on Link-layer Address [DUID-LL] ๐
this type of DUID is two octets containing the DUID type 3, then a two octet network hardware type code, followed by the link-layer address of any one network interface that's permanently connected to the client or server device. for example, a host with a network interface built into a chip that's unlikely to get removed and used somewhere else could use a DUID-LL ๐งฉ. the hardware type MUST be a valid hardware type assigned by the IANA, as described in RFC 826 [14]. the hardware type is stored in network byte order, and the link-layer address is stored in canonical form, as described in RFC 2464 [2]. here's the diagram for 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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| 3 | hardware type (16 bits) |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
. .
. link-layer address (variable length) .
. .
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
the network interface choice is completely arbitrary, as long as that interface provides a unique link-layer address and is permanently attached to the device where the DUID-LL is being generated. and the same DUID-LL SHOULD be used when configuring all network interfaces connected to the device, no matter which interface's link-layer address was used to generate the DUID ๐
DUID-LL is recommended for devices that have a permanently-connected network interface with a link-layer address and don't have nonvolatile, writable stable storage ๐ท. and DUID-LL MUST NOT be used by DHCP clients or servers that can't tell whether or not a network interface is permanently attached to the device the DHCP client is running on ๐ โโ๏ธ
10. Identity Association โจ
okay so bestie, an "identity-association" (IA) ๐ is basically a little construct that lets a server and a client identify, group, and manage a whole set of related IPv6 addresses together ๐ฆ. Each IA is made of an IAID plus its configuration info, and honestly it's giving organised binder energy ๐ .
A client MUST associate at least one distinct IA with each of its network interfaces that it wants IPv6 addresses for from a DHCP server ๐ธ. The client then uses the IAs tied to an interface to grab configuration info from a server for that interface. Each IA MUST be associated with exactly one interface, no exceptions bestie ๐.
The IAID uniquely identifies the IA and has to be unique among the IAIDs on the client ๐ฅ. The client picks the IAID itself. For any given use of an IA, the IAID for that IA MUST stay consistent across restarts of the DHCP client ๐. The client can keep it consistent either by saving the IAID in non-volatile storage, or by using an algorithm that reliably spits out the same IAID as long as the client's configuration hasn't changed ๐ง. Lowkey, there may be no way for a client to keep its IAIDs consistent if it has no non-volatile storage AND its hardware configuration changes ๐.
The configuration info in an IA is one or more IPv6 addresses along with the times T1 and T2 for that IA โญ. See section 22.4 for how an IA shows up in a DHCP message ๐ซถ.
Each address in an IA has a preferred lifetime and a valid lifetime, as defined in RFC 2462 [17] ๐. The server sends these lifetimes to the client in the IA option, and they apply to how IPv6 addresses get used, as described in section 5.5.4 of RFC 2462 โจ.
11. Selecting Addresses for Assignment to an IA ๐ฆ
ngl this section is where the server gets to be a detective ๐ต๏ธโโ๏ธ. A server picks addresses for an IA based on the address assignment policies its administrator set, plus whatever it figures out about the client from some combo of these sources:
- The link the client is attached to. The server figures out the link like this:
- If the server gets the message directly from the client AND the source address in the IP datagram 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 identified by the link-address field in the relay agent's message is attached to ๐.
- 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 ๐. (Btw this can only happen if the server has enabled 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 supplied by the client. ๐
- Other info in options supplied by the relay agent. ๐ง
Any address a server assigns that's based on an EUI-64 identifier MUST include an interface identifier with the "u" (universal/local) and "g" (individual/group) bits set appropriately, as indicated in section 2.5.1 of RFC 2373 [5] ๐ .
A server MUST NOT assign an address that's reserved for some other purpose ๐ซ. For example, a server MUST NOT assign reserved anycast addresses, as defined in RFC 2526, from any subnet ๐.
12. Management of Temporary Addresses ๐
A client MAY request temporary addresses (see RFC 3041 [12] for the definition of temporary addresses) ๐ฆ. DHCPv6 handles address assignment the same way for temporary addresses, no difference at all โจ. DHCPv6 says nothing about the details of temporary addresses, like lifetimes, how clients use them, or the rules for generating successive temporary addresses, etc ๐.
Clients ask for temporary addresses and servers assign them ๐. Temporary addresses are carried in the Identity Association for Temporary Addresses (IA_TA) option (see section 22.5) ๐. Each IA_TA option contains at most one temporary address for each of the prefixes on the link the client is attached to ๐ธ.
The IAID number space for the IA_TA option is separate from the IA_NA option IAID number space ๐ง.
The server MAY update the DNS for a temporary address, as described in section 4 of RFC 3041 ๐.
13. Transmission of Messages by a Client ๐ฌ
Unless this document says otherwise, or a document describing how IPv6 is carried over a specific link type says otherwise (for link types that don't support multicast), a client sends DHCP messages to the All_DHCP_Relay_Agents_and_Servers ๐.
A client uses multicast to reach all servers or one individual server ๐ฆ. An individual server gets targeted by putting that server's DUID in a Server Identifier option (see section 22.3) in the client's message ๐ฏ. All servers will receive that message, but only the indicated server will respond ๐. If the option isn't supplied, that means all servers ๐ซถ.
A client MAY send some messages directly to a server using unicast, as described in section 22.12 ๐.
14. Reliability of Client Initiated Message Exchanges ๐
DHCP clients are responsible for reliable delivery of messages in the client-initiated message exchanges described in sections 17 and 18 ๐ซถ. If a DHCP client doesn't get an expected response from a server, the client MUST retransmit its message ๐ญ. This section explains the retransmission strategy clients use in client-initiated message exchanges ๐ .
Quick heads up: the procedure here is slightly modified when used with the Solicit message ๐. The modified version is in section 17.1.2 โจ.
The client starts the message exchange by sending a message to the server ๐. The exchange ends when either the client successfully gets the appropriate response(s) from a server or servers, OR when the exchange is considered to have failed under the retransmission mechanism below ๐ฆ.
The client's retransmission behaviour is controlled by these variables ๐:
RT Retransmission timeout
IRT Initial retransmission time
MRC Maximum retransmission count
MRT Maximum retransmission time
MRD Maximum retransmission duration
RAND Randomization factor
With each message transmission or retransmission, the client sets RT according to the rules below ๐งฎ. If RT expires before the exchange ends, the client recomputes RT and retransmits the message ๐.
Every new RT computation includes a randomization factor (RAND), a random number picked with a uniform distribution between -0.1 and +0.1 ๐ฒ. It's there to minimise synchronisation of messages sent by DHCP clients ๐.
The algorithm for choosing 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 has a value of 0, there's no upper limit on RT. Otherwise ๐:
if (RT > MRT) RT = MRT + RAND*MRT
MRC sets an upper bound on how many times a client can 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 can 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 exchange fails whenever either of the 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 ๐ฅน.
15. Message Validation ๐
Clients and servers SHOULD discard any messages containing options that aren't allowed to appear in the received message ๐๏ธ. For example, an IA option isn't allowed in an Information-request message ๐ โโ๏ธ. Clients and servers MAY choose to extract information from such a message if the information is useful to the recipient ๐.
A server MUST discard any Solicit, Confirm, Rebind or Information-request messages it receives with a unicast destination address ๐ซ.
Message validation based on DHCP authentication is discussed in section 21.4.2 ๐.
If a server receives a message that has options it shouldn't contain (like an Information-request message with an IA option), is missing options it should contain, or is otherwise not valid, it MAY send a Reply (or Advertise, as appropriate) ๐จ. That response can include a Server Identifier option, a Client Identifier option if one was in the message, and a Status Code option with status UnSpecFail ๐ซ .
15.1. Use of Transaction IDs ๐
The "transaction-id" field holds a value that clients and servers use to synchronise 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 ๐ฒ. Lowkey, if a client generates easily predictable transaction IDs, it may become more vulnerable to certain attacks from off-path intruders ๐ฑ. A client MUST leave the transaction ID unchanged in retransmissions of a message ๐.
15.2. Solicit Message ๐
Clients MUST discard any received Solicit messages ๐ โโ๏ธ.
Servers MUST discard any Solicit messages that don't include a Client Identifier option, or that DO include a Server Identifier option ๐๏ธ.
15.3. Advertise Message ๐ฃ
Clients MUST discard any received Advertise messages that meet any of the following conditions ๐:
- the message does not include a Server Identifier option.
- the message does not include a Client Identifier option.
- the contents of the Client Identifier option do not match the client's DUID.
- the "transaction-id" field value does not match the value the client used in its Solicit message.
Servers and relay agents MUST discard any received Advertise messages ๐ซ.
15.4. Request Message ๐โโ๏ธ
Clients MUST discard any received Request messages ๐๏ธ.
Servers MUST discard any received Request messages that meet any of the following conditions ๐:
- the message does not include a Server Identifier option.
- the contents of the Server Identifier option do not match the server's DUID.
- the message does not include a Client Identifier option.
15.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, or that DO include a Server Identifier option ๐ซถ.
15.6. Renew Message ๐
Okay bestie, clients MUST discard any Renew messages they receive. No exceptions ๐
Servers have a checklist too. A server MUST discard any received Renew message that meets any of these conditions:
- the message does not include a Server Identifier option.
- the contents of the Server Identifier option do not match the server's identifier.
- the message does not include a Client Identifier option.
15.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 or that do include a Server Identifier option. Yikes for anyone who gets it wrong ๐ญ
15.8. Decline Messages ๐ธ
Clients MUST discard any received Decline messages, periodt โจ
Servers MUST discard any received Decline message that meets any of the following conditions:
- the message does not include a Server Identifier option.
- the contents of the Server Identifier option do not match the server's identifier.
- the message does not include a Client Identifier option.
15.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.
- the contents of the Server Identifier option do not match the server's identifier.
- the message does not include a Client Identifier option.
15.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.
- the
transaction-idfield in the message does not match the value used in the original message.
This one is lowkey picky. If the client included a Client Identifier option in the original message, the Reply message MUST include a Client Identifier option, and the contents of that option MUST match the DUID of the client. OR, 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 ๐
15.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.
- the message does not include a Client Identifier option that contains the client's DUID.
- the message does not contain a Reconfigure Message option and the msg-type must be a valid value.
- the message includes any IA options and the msg-type in the Reconfigure Message option is INFORMATION-REQUEST.
- the message does not include DHCP authentication:
- the message does not contain an authentication option.
- the message does not pass the authentication validation performed by the client.
15.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 and the DUID in the option does not match the server's DUID.
- The message includes an IA option.
15.13. Relay-forward Message ๐
Clients MUST discard any received Relay-forward messages. Bye-bye, relay-forward ๐
15.14. Relay-reply Message ๐
Clients and servers MUST discard any received Relay-reply messages.
16. Client Source Address and Interface Selection ๐
When a client sends a DHCP message to the All_DHCP_Relay_Agents_and_Servers address, it SHOULD send the message through the interface for which configuration information is being requested. However, the client MAY send the message through another interface attached to the same link, if and only if the client is certain the two interfaces are attached to the same link. The client MUST use a link-local address assigned to the interface for which it is requesting configuration information as the source address in the header of the IP datagram โจ
When a client sends a DHCP message directly to a server using unicast (after receiving the Server Unicast option from that server), the source address in the header of the IP datagram MUST be an address assigned to the interface for which the client is interested in obtaining configuration, and which is suitable for use by the server in responding to the client. Main character energy for that address ๐
17. DHCP Server Solicitation ๐ง
This section is all about how a client finds the servers that will assign addresses to IAs belonging to the client ๐
The client is the one in charge of creating IAs and asking a server to assign IPv6 addresses to them. It first creates an IA and gives it an IAID. Then it sends a Solicit message with an IA option describing that IA. Servers that can assign addresses to the IA reply with an Advertise message, and then the client starts a configuration exchange as described in section 18.
If the client will accept a Reply message with committed address assignments and other resources in response to the Solicit message, it includes a Rapid Commit option (see section 22.14) in the Solicit message. Speedrun mode activated ๐โโ๏ธ๐จ
17.1. Client Behavior ๐
A client uses the Solicit message to discover DHCP servers that are configured to assign addresses or return other configuration parameters on the link it is attached to.
17.1.1. Creation 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 to identify itself to the server. It includes IA options for any IAs it wants the server to assign addresses to. The client MAY include addresses in the IAs as a hint to the server about addresses it has a preference for. The client MUST NOT include any other options in the Solicit message, except where a specific option's definition says it's allowed ๐ โโ๏ธ
The client uses IA_NA options to request assignment of non-temporary addresses, and IA_TA options to request assignment of temporary addresses. Either IA_NA or IA_TA options, or a combination of both, can be included in DHCP messages.
The client SHOULD include an Option Request option (see section 22.7) to say which 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 22.20) if it's willing to accept Reconfigure messages from the server.
17.1.2. Transmission of Solicit Messages ๐ฆ
The first Solicit message from the client on the interface MUST be delayed by a random amount of time between 0 and SOL_MAX_DELAY. When DHCP is initiated by IPv6 Neighbor Discovery, that delay is the amount of time to wait after IPv6 Neighbor Discovery causes the client to invoke the stateful address autoconfiguration protocol (see section 5.5.3 of RFC 2462). This random delay keeps clients that start at the same time (for example, after a power outage) from all showing up in sync ๐ญ
The client transmits the message according to section 14, using these parameters:
IRT SOL_TIMEOUT
MRT SOL_MAX_RT
MRC 0
MRD 0
If the client included a Rapid Commit option in its Solicit message, it ends the waiting process as soon as a Reply message with a Rapid Commit option is received โก
If the client is waiting for an Advertise message, the mechanism in section 14 gets a little tweak for Solicit messages. Receiving an Advertise doesn't end the exchange before the first RT has elapsed. Instead, the client collects Advertise messages until the first RT has passed. 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 Advertise messages for the first RT seconds, unless it receives an Advertise message with a preference value of 255. The preference value is carried in the Preference option (section 22.8). Any Advertise that does not include a Preference option is considered to have a preference value of 0. If the client receives an Advertise message that includes a Preference option with a preference value of 255, it immediately begins a client-initiated message exchange (as described in section 18) by sending a Request message to the server the Advertise came from. If the client receives an Advertise message that does not include a Preference option with a preference value of 255, it keeps waiting until the first RT elapses. If the first RT elapses and the client has received an Advertise message, the client SHOULD continue with a client-initiated message exchange by sending a Request message ๐ฏ
If the client doesn't receive any Advertise messages before the first RT has elapsed, it begins the retransmission mechanism described in section 14. The client ends the retransmission process as soon as it receives any Advertise message, and it acts on that Advertise message without waiting for any more Advertise messages ๐
A DHCP client SHOULD choose MRC and MRD to be 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 ๐
Reminder: MRC and MRD defaults are the move. Anything else and the client has to give up on that interface if the exchange fails.
17.1.3. Receipt of Advertise Messages ๐
The client MUST ignore any Advertise message that includes a Status Code option containing the value NoAddrsAvail. The one exception: the client MAY display the associated status message to the user ๐
Once one or more valid Advertise messages come in, the client picks one or more of them based on these criteria:
- Advertise messages with the highest server preference value are preferred over all other Advertise messages.
- Within a group of Advertise messages with the same server preference value, a client MAY select those servers whose Advertise messages advertise information of interest to the client. For example, the client may choose a server that returned an advertisement with configuration options it cares about.
- The client MAY choose a less-preferred server if that server has a better set of advertised parameters, such as the available addresses advertised in IAs.
Once a client has selected Advertise message(s), it will typically store info about each server, like the server preference value, the addresses advertised, when the advertisement was received, and so on ๐๏ธ
If the client needs to pick an alternate server because the chosen one doesn't respond, the client chooses the next server according to the criteria above ๐
17.1.4. Receipt of Reply Message โจ
okay so if the client put a Rapid Commit option in its Solicit message, it's expecting a Reply message that has a Rapid Commit option back ๐ any Reply that comes in without one gets tossed in the bin ๐๏ธ. if a valid Reply with a Rapid Commit option shows up, the client handles it the way section 18.1.8 says ๐ . but if no Reply like that arrives and a valid Advertise message does, the client handles the Advertise the way section 17.1.3 describes ๐ซถ
and then, if a valid Reply with a Rapid Commit option comes in later, the client does one of these:
- it processes that Reply as described in section 18.1.8, and throws out any Reply messages that came back for the Request message ๐, or
- it processes any Reply messages that came back for the Request message, and throws out the Reply that has the Rapid Commit option ๐
17.2. Server Behavior ๐ธ
a server sends an Advertise message in response to valid Solicit messages it gets, just to say "hey, I'm here and available" ๐ฆ
17.2.1. Receipt of Solicit Messages ๐ง
the server figures out info about the client and where it is, as described in section 11 ๐บ๏ธ, and checks its admin policy about whether it's even allowed to answer this client. if the server isn't permitted to respond, it discards the Solicit message ๐ โโ๏ธ. for example, say the server's admin policy is that it only answers clients who are cool with getting a Reconfigure message. if the client says, using a Reconfigure Accept option in the Solicit message, that it won't accept a Reconfigure message, then the servers discard the Solicit message. no vibes, no response ๐
if the client put a Rapid Commit option in the Solicit message, and the server is set up to respond with committed address assignments and other resources, then the server responds to the Solicit with a Reply message as described in section 17.2.3 โญ otherwise, the server ignores the Rapid Commit option and handles the rest of the message like it was never there ๐คทโโ๏ธ
17.2.2. Creation and Transmission of Advertise Messages ๐
the server sets the msg-type field to ADVERTISE and copies the transaction-id field from the Solicit message it got from the client into the Advertise message ๐ the server also puts its server identifier in a Server Identifier option, and copies the Client Identifier from the Solicit message into the Advertise message ๐
the server MAY add a Preference option to carry the preference value for the Advertise message ๐ the server implementation SHOULD let the admin set a server preference value ๐ง and the server preference value MUST default to zero, unless the server admin configures something else ๐ข
the server includes a Reconfigure Accept option if it wants to require that the client accept Reconfigure messages ๐
the server includes options that it'll send back to the client in a later Reply message ๐ฆ the info in these options might be used by the client to pick a server if it gets more than one Advertise message โ๏ธ if the client put an Option Request option in the Solicit message, the server includes options in the Advertise message with configuration parameters for all of the options named in that Option Request option, as long as the server is set up to return them to the client ๐ the server MAY also return additional options to the client, if it's been configured to do that โจ and the server must be aware of the recommendations on packet sizes and the use of fragmentation in section 5 of RFC 2460 ๐
if the Solicit message from the client had one or more IA options, the server MUST include IA options in the Advertise message with any addresses that would be assigned to the IAs in the client's Solicit message ๐ if the client put addresses in the IAs in its Solicit message, the server uses those addresses as hints about what the client would like to get ๐ซถ
if the server won't assign any addresses to any IAs in a later Request from the client, the server MUST send the client an Advertise message that only includes a Status Code option with code NoAddrsAvail and a status message for the user, a Server Identifier option with the server's DUID, and a Client Identifier option with the client's DUID ๐ basically "sorry bestie, no addresses for you" ๐ญ
if the Solicit message got to the server directly, the server unicasts the Advertise message straight to the client, using the address in the source address field of the IP datagram that carried the Solicit ๐ฏ the Advertise message MUST be unicast on the link the Solicit came in on ๐ค๏ธ
if the Solicit message came in a Relay-forward message, the server builds a Relay-reply message and puts the Advertise message in the payload of a relay-message option ๐ฌ if the Relay-forward message had an Interface-id option, the server copies that option into the Relay-reply message too ๐ then the server unicasts the Relay-reply message to the relay agent, using the address in the source address field of the IP datagram that carried the Relay-forward message ๐
17.2.3. Creation and Transmission of Reply Messages ๐ฆ
the server MUST commit the assignment of any addresses or other configuration information message before it sends a Reply message to a client in response to a Solicit message ๐
DISCUSSION: when you're using the Solicit-Reply message exchange, the server commits the assignment of any addresses before it sends the Reply message ๐ the client can just assume it got the addresses listed in the Reply, so it doesn't need to send a Request message for them ๐ usually, servers using the Solicit-Reply exchange are set up so that only one server answers a Solicit message ๐ง if more than one server responds, the client only uses addresses from one of them, and the addresses from the other servers stay committed to the client without ever getting used ๐ญ
the server includes a Rapid Commit option in the Reply message to show that the Reply is answering a Solicit message โก
the server includes a Reconfigure Accept option if it wants to require that the client accept Reconfigure messages ๐
the server builds the Reply message as if it had received a Request message, as described in section 18.2.1 ๐๏ธ then it transmits the Reply message as described in section 18.2.8 ๐ค
18. DHCP Client-Initiated Configuration Exchange ๐
a client starts a message exchange with a server (or servers) to get or update the configuration info it cares about ๐ the client can kick this off as part of the operating system configuration process ๐ฅ๏ธ, when the application layer asks it to ๐ฑ, when Stateless Address Autoconfiguration needs it ๐, or to extend the lifetime of an address (Renew and Rebind messages) โณ
18.1. Client Behavior ๐ธ
a client uses Request, Renew, Rebind, Release and Decline messages during the normal life cycle of addresses ๐ it uses Confirm to validate addresses when it may have moved to a new link ๐ and it uses Information-Request messages when it needs configuration info but no addresses ๐
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 (section 22.12) from the server, the client SHOULD unicast any Request, Renew, Release and Decline messages to the server ๐ฏ
DISCUSSION: unicast can avoid delays caused by relay agents passing messages along ๐ข, and it also avoids extra overhead and duplicate responses from servers that happen when client messages get delivered to multiple servers ๐ โโ๏ธ requiring the client to send all DHCP messages through a relay agent means relay agent options can be included in every message the client sends ๐ the server should only turn on unicast when relay agent options won't be used ๐ง
18.1.1. Creation and Transmission of Request Messages ๐
the client uses a Request message to fill up its IAs with addresses and to get other configuration info ๐ก the client includes one or more IA options in the Request message ๐ฆ then the server sends addresses and info about the IAs back to the client in IA options in a Reply message ๐
the client makes up a transaction ID and puts it in the transaction-id field ๐
the client puts the identifier of the destination server in a Server Identifier option ๐ฏ
the client MUST include a Client Identifier option to identify itself to the server ๐ชช the client adds any other appropriate options, including one or more IA options (if the client is asking the server to assign it some network addresses) ๐งฉ
the client MUST include an Option Request option (see section 22.7) to say which options it's interested in getting ๐๏ธ the client MAY include options with data values as hints to the server about parameter values it would love to get back ๐ญ
the client includes a Reconfigure Accept option (see section 22.20) to say whether or not it's willing to accept Reconfigure messages from the server ๐โโ๏ธ
the client transmits the message according to section 14, with 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:
- selecting another server from a list of servers the client knows about, like servers that sent an Advertise message ๐
- starting the server discovery process described in section 17 ๐
- terminating the configuration process and reporting failure ๐
18.1.2. Creation and Transmission of Confirm Messages โจ
okay so whenever a client might have moved to a new link ๐งณ, the prefixes on the addresses attached to its interfaces might not fit the new link anymore ๐ฌ. Times when that can happen include:
- The client reboots. ๐
- The client is physically connected to a wired connection. ๐
- The client returns from sleep mode. ๐ด
- The client using a wireless technology changes access points. ๐ถ
Any time a client might have moved to a new link, it MUST initiate a Confirm/Reply message exchange ๐ . It puts any IAs assigned to the interface that may have moved, along with the addresses tied to those IAs, into its Confirm message. Responding servers then say whether those addresses fit the link the client is on, using the status in the Reply message they send back ๐ซถ.
The client sets the msg-type field to CONFIRM ๐. It generates a transaction ID and puts that value in the transaction-id field ๐.
The client MUST include a Client Identifier option so the server knows who it is ๐ชช. It includes IA options for all of the IAs on the interface the Confirm message is for. Those IA options carry every address the client currently has for those IAs ๐ฆ. The client SHOULD set the T1 and T2 fields in any IA_NA options to 0, and also set the preferred-lifetime and valid-lifetime fields in the IA Address options to 0, since the server ignores those fields anyway ๐.
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 โณ. The client sends the message according to section 14, using these parameters:
IRT CNF_TIMEOUT
MRT CNF_MAX_RT
MRC 0
MRD CNF_MAX_RD
If the client gets no responses before the transmission process ends (see section 14), it SHOULD keep using its IP addresses with the last known lifetimes, and SHOULD keep using any other configuration parameters it got before ๐ธ. Not gonna lie, that's a very chill backup plan ๐.
18.1.3. Creation and Transmission of Renew Messages ๐
To extend the valid and preferred lifetimes for the addresses in an IA, the client sends a Renew message to the server it got those addresses from ๐. The Renew message has an IA option for that IA, and inside it are IA Address options for the addresses tied to the IA ๐ฌ. The server decides the new lifetimes according to its own administrative configuration ๐งโ๐ผ. The server may also add new addresses to the IA, and it may remove addresses from the IA by setting their preferred and valid lifetimes to zero ๐๏ธ.
The server is the one controlling when the client checks in to extend lifetimes, through the T1 and T2 parameters on an IA ๐ฐ๏ธ.
At time T1 for an IA, the client starts a Renew/Reply message exchange to extend the lifetimes on any addresses in the IA ๐. The Renew message includes an IA option with every address currently assigned to the IA ๐ฏ.
If the server sets T1 or T2 to 0 (for an IA_NA), or there are no T1 or T2 times (for an IA_TA), the client may send a Renew or Rebind message, respectively, whenever it feels like it ๐คทโโ๏ธ.
The client sets the msg-type field to RENEW ๐. It generates a transaction ID and puts it in the transaction-id field ๐.
The client puts the identifier of the destination server in a Server Identifier option ๐.
The client MUST include a Client Identifier option to identify itself to the server ๐ชช. It adds any other appropriate options, including one or more IA options ๐งฉ. The client MUST include the list of addresses it currently has associated with the IAs in the Renew message ๐.
The client MUST include an Option Request option (see section 22.7) to say which options it wants back ๐โโ๏ธ. The client MAY include options with data values as hints about parameter values it would love to get returned ๐ซ.
The client sends the message according to section 14, using these parameters:
IRT REN_TIMEOUT
MRT REN_MAX_RT
MRC 0
MRD Remaining time until T2
The message exchange wraps up when T2 is reached (see section 18.1.4), and at that point the client begins a Rebind message exchange ๐ฆ.
18.1.4. Creation and Transmission of Rebind Messages ๐
At time T2 for an IA (which only happens if the server the Renew message went to at time T1 never responded ๐ถ), the client starts a Rebind/Reply message exchange with any available server ๐ก. The Rebind message includes an IA option with every address currently assigned to the IA ๐.
The client sets the msg-type field to REBIND ๐. It generates a transaction ID and puts it in the transaction-id field ๐.
The client MUST include a Client Identifier option to identify itself to the server ๐ชช. It adds any other appropriate options, including one or more IA options ๐งฉ. The client MUST include the list of addresses it currently has associated with the IAs in the Rebind message ๐.
The client MUST include an Option Request option (see section 22.7) to say which options it wants back ๐โโ๏ธ. The client MAY include options with data values as hints about parameter values it would love to get returned ๐ซ.
The client sends the message according to section 14, using these parameters:
IRT REB_TIMEOUT
MRT REB_MAX_RT
MRC 0
MRD Remaining time until valid lifetimes of all addresses have
expired
The message exchange ends when the valid lifetimes of every address assigned to the IA run out (see section 10). At that point the client has a few options to pick from, for example:
- The client may choose to use a Solicit message to locate a new DHCP server and send a Request for the expired IA to the new server. ๐
- The client may have addresses in other IAs, so it may choose to throw out the expired IA and use the addresses in the other IAs. ๐๏ธ
18.1.5. Creation and Transmission of Information-request Messages ๐
The client uses an Information-request message to get configuration information without having any addresses assigned to it ๐งพ.
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 so it can identify itself to the server ๐ชช. If it doesn't, 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 a Client Identifier option if the Information-Request message is going to be authenticated ๐.
The client MUST include an Option Request option (see section 22.7) to say which options it wants back ๐โโ๏ธ. The client MAY include options with data values as hints about parameter values it would love to get returned ๐ซ.
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 โณ. The client sends the message according to section 14, using these parameters:
IRT INF_TIMEOUT
MRT INF_MAX_RT
MRC 0
MRD 0
18.1.6. Creation and Transmission of Release Messages ๐
To release one or more addresses, a client sends a Release message to the server ๐จ.
The client sets the msg-type field to RELEASE ๐. It generates a transaction ID and places it in the transaction-id field ๐.
The client places the identifier of the server that gave out the address(es) in a Server Identifier option ๐.
The client MUST include a Client Identifier option to identify itself to the server ๐ชช. The client includes options containing the IAs for the addresses it's releasing in the options field ๐ฆ. The addresses being released MUST be included in the IAs ๐ฏ. Any addresses for the IAs that the client wants to keep using MUST NOT be added to the IAs ๐ซ.
The client MUST NOT use any of the addresses it is releasing as the source address in the Release message or in any message sent after it ๐ โโ๏ธ.
Because Release messages can get lost, the client should retransmit the Release if no Reply is received ๐. But sometimes the client doesn't want to wait out the normal retransmission timeout before giving up (for example, when it's powering down) ๐. Implementations SHOULD retransmit one or more times, but MAY choose to end the retransmission procedure early ๐ซ .
The client sends the message according to section 14, using these parameters:
IRT REL_TIMEOUT
MRT 0
MRC REL_MAX_RC
MRD 0
The client MUST stop using all of the addresses being released as soon as it starts the Release message exchange process ๐. If the addresses get released but the Reply from a DHCP server is lost, the client retransmits the Release message, and the server may respond with a Reply showing a status of NoBinding ๐ซฃ. So the client doesn't treat a Reply with a status of NoBinding in a Release message exchange as an error โ .
Note that if the client fails to release the addresses, the server will reclaim each address assigned to the IA when that address's valid lifetime expires โฐ.
18.1.7. Creation and Transmission of Decline Messages ๐ โโ๏ธ
If a client detects that one or more addresses the server gave it are already being used by another node, it sends a Decline message to the server to say that the address is suspect ๐จ.
The client sets the msg-type field to DECLINE ๐. It generates a transaction ID and places it in the transaction-id field ๐.
The client places the identifier of the server that gave out the address(es) in a Server Identifier option ๐.
The client MUST include a Client Identifier option to identify itself to the server ๐ชช. The client includes options containing the IAs for the addresses it's declining in the options field ๐ฆ. The addresses being declined MUST be included in the IAs ๐ฏ. Any addresses for the IAs that the client wants to keep using should not be added to the IAs ๐.
The client MUST NOT use any of the addresses it is declining as the source address in the Decline message or in any message sent after it ๐ซ.
The client sends the message according to section 14, using these parameters:
IRT DEC_TIMEOUT
MRT 0
MRC DEC_MAX_RC
MRD 0
If the addresses get declined but the Reply from a DHCP server is lost, the client retransmits the Decline message, and the server may respond with a Reply showing a status of NoBinding ๐ฅบ. So the client doesn't treat a Reply with a status of NoBinding in a Decline message exchange as an error ๐.
18.1.8. Receipt of Reply Messages ๐
okay so bestie, when a valid Reply lands ๐ฌ in response to a Solicit (with a Rapid Commit option), Request, Confirm, Renew, Rebind or Information-request, the client digs out the configuration info inside it ๐
. The client MAY choose to report any status code or message from the Status Code option in the Reply. Totally your call, bestie ๐.
The client SHOULD perform duplicate address detection [17] on each address in any IAs it gets in the Reply before actually using that address for traffic ๐. If any of them are already in use on the link, the client sends a Decline message to the server, as described in section 18.1.7 ๐ โโ๏ธ.
If the Reply was received in response to a Solicit (with a Rapid Commit option), Request, Renew or Rebind message, the client updates what it has recorded about IAs using the IA options in the Reply ๐:
- Record T1 and T2 times. โฐ
- Add any new addresses in the IA option to the IA as recorded by the client. โ
- Update lifetimes for any addresses in the IA option that the client already has recorded in the IA. ๐
- Discard any addresses from the IA, as recorded by the client, that have a valid lifetime of 0 in the IA Address option. ๐๏ธ
- Leave unchanged any information about addresses the client has recorded in the IA but that were not included in the IA from the server. ๐ง
Management of the specific configuration information is detailed in the definition of each option in section 22 ๐๐ธ.
If the client receives a Reply message with a Status Code containing UnspecFail, the server is basically saying "I couldn't process that because of an unspecified failure" ๐ฌ. If the client retransmits the original message to the same server to retry the operation, the client MUST limit the rate at which it retransmits the message and limit the duration of the time during which it retransmits the message. Pace yourself, bestie ๐โณ.
When the client receives a Reply message with a Status Code option with the value UseMulticast, the client records the receipt of the message and sends subsequent messages to the server through the interface the message came in on, using multicast ๐ก. It also resends the original message using multicast ๐ฆ.
When the client gets a NotOnLink status from the server in response to a Confirm message, the client performs DHCP server solicitation, as described in section 17, and client-initiated configuration as described in section 18 ๐. If the client receives any Reply messages that do not indicate a NotOnLink status, the client can use the addresses in the IA and ignore any messages that indicate a NotOnLink status ๐ซถ.
When the client receives a NotOnLink status from the server in response to a Request, the client can either re-issue the Request without specifying any addresses, or restart the DHCP server discovery process (see section 17) ๐.
The client examines the status code in each IA individually ๐ฌ. If the status code is NoAddrsAvail, the client has received no usable addresses in that IA and may choose to try obtaining addresses for the IA from another server. The client uses addresses and other information from any IAs that do not contain a Status Code option with the NoAddrsAvail code โจ. If the client receives no addresses in any of the IAs, it 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 examines each IA independently ๐. For each IA in the original Renew or Rebind message, the client:
- sends a Request message if the IA contained a Status Code option with the
NoBindingstatus (and does not send any additional Renew/Rebind messages) - sends a Renew/Rebind if the IA is not in the Reply message
- otherwise accepts the information in the IA
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(s) 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. Server Behavior ๐
For this discussion, the server is assumed to have been configured in an implementation specific manner with configuration of interest to clients โ๏ธ.
In most instances, the server will send a Reply in response to a client message. This Reply message MUST always contain the Server Identifier option containing the server's DUID, and the Client Identifier option from the client message if one was present ๐ชช.
In most Reply messages, the server includes options containing configuration information for the client ๐. The server must be aware of the recommendations on packet sizes and the use of fragmentation in section 5 of RFC 2460 ๐. If the client included an Option Request option in its message, the server includes options in the Reply message containing configuration parameters for all of the options identified in the Option Request option that the server has been configured to return to the client ๐. The server MAY return additional options to the client if it has been configured to do so โจ.
18.2.1. Receipt of Request Messages ๐ฅ
When the server receives a Request message via unicast from a client to which the server has not sent a unicast option, the server discards the Request message and responds with a Reply message containing a Status Code option with the value UseMulticast, a Server Identifier option containing the server's DUID, the Client Identifier option from the client message, and no other options ๐ข.
When the server receives a valid Request message, the server creates the bindings for that client according to the server's policy and configuration information, and records the IAs and other information requested by the client ๐๐.
The server constructs 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 containing the server's DUID and the Client Identifier option from the Request message in the Reply message ๐ชช.
If the server finds that the prefix on one or more IP addresses in any IA in the message from the client is not appropriate for the link to which the client is connected, the server MUST return the IA to the client with a Status Code option with the value NotOnLink ๐ซ๐.
If the server cannot assign any addresses to an IA in the message from the client, the server MUST include the IA in the Reply message with no addresses in the IA, and a Status Code option in the IA containing the status code NoAddrsAvail ๐ข.
For any IAs to which the server can assign addresses, the server includes the IA with addresses and other configuration parameters, and records the IA as a new client binding ๐.
The server includes a Reconfigure Accept option if the server wants to require that the client accept Reconfigure messages ๐.
The server includes other options containing configuration information to be returned to the client, as described in section 18.2 ๐.
If the server finds that the client has included an IA in the Request message for which the server already has a binding that associates the IA with the client, the client has resent a Request message for which it did not receive a Reply message. The server either resends a previously cached Reply message or sends a new Reply message ๐๐ .
18.2.2. Receipt of Confirm Messages ๐
When the server receives a Confirm message, the server determines whether the addresses in the Confirm message are appropriate for the link to which the client is attached ๐ง. If all of the addresses in the Confirm message pass this test, the server returns a status of Success โ
. If any of the addresses do not pass this test, the server returns a status of NotOnLink ๐
โโ๏ธ. If the server is unable to perform this test (for example, the server does not have information about prefixes on the link to which the client is connected), or there were no addresses in any of the IAs sent by the client, the server MUST NOT send a reply to the client ๐ค.
The server ignores the T1 and T2 fields in the IA options, and the preferred-lifetime and valid-lifetime fields in the IA Address options ๐.
The server constructs a Reply message by setting the msg-type field to REPLY, and copying the transaction ID from the Confirm message into the transaction-id field ๐งฉ.
The server MUST include a Server Identifier option containing the server's DUID and the Client Identifier option from the Confirm message in the Reply message ๐ชช. The server includes a Status Code option indicating the status of the Confirm message ๐.
18.2.3. Receipt of Renew Messages ๐
When the server receives a Renew message via unicast from a client to which the server has not sent a unicast option, the server discards the Renew message and responds with a Reply message containing a Status Code option with the value UseMulticast, a Server Identifier option containing the server's DUID, the Client Identifier option from the client message, and no other options ๐ข.
When the server receives a Renew message that contains an IA option from a client, it locates the client's binding and verifies that the information in the IA from the client matches the information stored for that client ๐ต๏ธโโ๏ธ.
If the server cannot find a client entry for the IA, the server returns the IA containing no addresses, with a Status Code option set to NoBinding, in the Reply message ๐ซฅ.
If the server finds that any of the addresses are not appropriate for the link to which the client is attached, the server returns the address to the client with lifetimes of 0 ๐ง.
If the server finds the addresses in the IA for the client, then the server sends back the IA to the client with new lifetimes and T1/T2 times โฐ. The server may choose to change the list of addresses, and the lifetimes of addresses, in IAs that are returned to the client ๐ฆ.
The server constructs a Reply message by setting the msg-type field to REPLY, and copying the transaction ID from the Renew message into the transaction-id field ๐งฉ.
The server MUST include a Server Identifier option containing the server's DUID and the Client Identifier option from the Renew message in the Reply message ๐ชช.
The server includes other options containing configuration information to be returned to the client, as described in section 18.2 ๐ธ๐.
18.2.4. Receipt of Rebind Messages ๐ฆ
okay bestie, when the server gets a Rebind message with an IA option from a client, it hunts down that client's binding and checks that the info in the client's IA matches what the server has stored for them ๐
If the server can't find a client entry for the IA, and it decides the addresses in the IA aren't appropriate for the link the client's interface is attached to (going by its explicit configuration info), the server MAY send a Reply to the client with the client's IA in it, and the lifetimes for those addresses set to zero. This Reply is basically an explicit "heads up, these addresses are no longer valid" ๐ In this situation, if the server doesn't send a Reply, it silently discards the Rebind message ๐
If the server finds that any of the addresses are no longer appropriate for the link the client is attached to, it returns that address to the client with lifetimes of 0 ๐
If the server finds the addresses in the IA for the client, then the server SHOULD send back the IA to the client with new lifetimes and T1/T2 times โจ
The server constructs a Reply message by setting the msg-type field to REPLY, and copying the transaction ID from the Rebind message into the transaction-id field ๐
The server MUST include a Server Identifier option containing the server's DUID, plus the Client Identifier option from the Rebind message, in the Reply message. no skipping this one, it's giving required ๐
The server includes other options with configuration info to return to the client, as described in section 18.2. ๐ซถ
18.2.5. Receipt of Information-request Messages ๐ง
So when the server receives an Information-request message, the client is asking for configuration info that does NOT include any address assignments. The server figures out every configuration parameter that fits this client, based on the server configuration policies it knows about ๐
The server constructs a Reply message by setting the msg-type field to REPLY, and copying the transaction ID from the Information-request message into the transaction-id field ๐
The server MUST include a Server Identifier option containing the server's DUID in the Reply message. If the client included a Client Identification option in the Information-request message, the server copies that option over to the Reply message too ๐ธ
The server includes options with configuration info to return to the client, as described in section 18.2. โจ
If the Information-request message from the client did NOT include a Client Identifier option, the server SHOULD respond with a Reply message containing any configuration parameters that aren't determined by the client's identity. If the server decides not to respond, the client may keep retransmitting the Information-request message forever (indefinitely) ๐ญ
18.2.6. Receipt of Release Messages ๐
When the server gets a Release message via unicast from a client it hasn't sent a unicast option to, the server discards the Release and responds with a Reply message. That Reply has a Status Code option with the value UseMulticast, a Server Identifier option containing the server's DUID, the Client Identifier option from the client's message, and NO other options ๐ซ
Once a valid Release message comes in, the server checks the IAs and the addresses in them for validity. If the IAs in the message are in 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 and makes them available for assignment to other clients ๐ฆ It ignores addresses that weren't assigned to the IA, though it may choose to log an error ๐
After all the addresses have been processed, the server generates a Reply message that includes a Status Code option with the value Success, a Server Identifier option with the server's DUID, and a Client Identifier option with the client's DUID. For each IA in the Release message that the server has NO binding information for, the server adds an IA option using the IAID from the Release message, and includes a Status Code option with the value NoBinding in that IA option. No other options go in the IA option ๐
A server may choose to keep a record of assigned addresses and IAs even after the lifetimes on those addresses have expired, so it can reassign those previously assigned addresses to a client later ๐
18.2.7. Receipt of Decline Messages ๐ฅ
When the server gets a Decline message via unicast from a client it hasn't sent a unicast option to, the server discards the Decline message and responds with a Reply message containing a Status Code option with the value UseMulticast, a Server Identifier option containing the server's DUID, the Client Identifier option from the client message, and no other options ๐ซ
Upon receiving a valid Decline message, the server checks the IAs and the addresses in them for validity. If the IAs in the message are in 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 addresses that weren't assigned to the IA (though it may choose to log an error if it finds one) ๐ง
Here's the tea: the client has found the addresses in the Decline messages are already in use on its link. So the server SHOULD mark the declined addresses so they don't get assigned to other clients, and it MAY choose to send a notification that addresses were declined ๐ฃ Local policy on the server decides when the addresses identified in a Decline message can be made available for assignment again ๐
After all the addresses have been processed, the server generates a Reply message that includes a Status Code option with the value Success, a Server Identifier option with the server's DUID, and a Client Identifier option with the client's DUID. For each IA in the Decline message that the server has NO binding information for, the server adds an IA option using the IAID from the Release message and includes a Status Code option with the value NoBinding in that IA option. No other options go in the IA option ๐
18.2.8. Transmission of Reply Messages ๐
If the original message was received directly by the server, the server unicasts the Reply message straight to the client, using the address in the source address field from the IP datagram the original message came in on. The Reply message MUST be unicast through the interface the original message was received on ๐ฏ
If the original message was received in a Relay-forward message, the server builds a Relay-reply message with the Reply message in the payload of a Relay Message option (see section 22.10). If the Relay-forward message included an Interface-id option, the server copies that option into the Relay-reply message. The server unicasts the Relay-reply message directly to the relay agent, using the address in the source address field from the IP datagram the Relay-forward message was received in ๐ง
19. DHCP Server-Initiated Configuration Exchange ๐
sometimes the server starts the convo itself!! A server initiates a configuration exchange to make DHCP clients obtain new addresses and other configuration info. For example, an administrator might use a server-initiated configuration exchange when links in the DHCP domain are getting renumbered ๐ข Other examples include changes in the location of directory servers, adding new services like printing, and new software being available ๐จ๏ธ๐พ
19.1. Server Behavior ๐
A server sends a Reconfigure message to make a client immediately start a Renew/Reply or Information-request/Reply message exchange with the server โก
19.1.1. Creation and Transmission of Reconfigure Messages ๐
The server sets the msg-type field to RECONFIGURE. The server sets the transaction-id field to 0. The server includes a Server Identifier option containing its DUID, and a Client Identifier option containing the client's DUID, in the Reconfigure message ๐ซถ
The server MAY include an Option Request option to tell the client what info has changed or what new info has been added. Specifically, the server puts the IA option in the Option Request option if it wants the client to obtain new address info. If the server identifies the IA option in the Option Request option, the server MUST include an IA option that contains no other sub-options, to identify each IA that is to be reconfigured on the client ๐
Heads up, because of the risk of denial of service attacks against DHCP clients, a security mechanism is mandated in Reconfigure messages. The server MUST use DHCP authentication in the Reconfigure message ๐ก๏ธ๐
The server MUST include a Reconfigure Message option (defined in section 22.19) to select whether the client responds with a Renew 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 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 send the Reconfigure message to directly, it uses a Relay-reply message (as described in section 20.3) to send the Reconfigure message to a relay agent that will relay it to the client ๐ The server may get the client's address (and the right relay agent, if needed) from info it has about clients that have been in contact with it, or through some external agent ๐ต๏ธ
To reconfigure more than one client, the server unicasts a separate message to each client. The server may start reconfiguring multiple clients at the same time. For example, a server may 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 or Information-request/Reply message exchange with the server. The server counts the receipt of a Renew or Information-request message (whichever was specified in the original Reconfigure message) from the client as satisfying the Reconfigure message request โ
19.1.2. Time Out and Retransmission of Reconfigure Messages โฐ
If the server doesn't receive a Renew or Information-request message from the client within REC_TIMEOUT milliseconds, the server retransmits the Reconfigure message, doubles the REC_TIMEOUT value, and waits again. The server keeps doing this until REC_MAX_RC unsuccessful attempts have been made, and then 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 5.5. ๐
19.2. Receipt of Renew Messages ๐
The server generates and sends a Reply message to the client as described in sections 18.2.3 and 18.2.8, including options for configuration parameters ๐
The server MAY include options containing the IAs and new values for other configuration parameters in the Reply message, even if those IAs and parameters weren't requested in the Renew message from the client ๐
19.3. Receipt of Information-request Messages โจ
okay so when the server gets an Information-request, it builds a Reply and sends it back to the client, just like in sections 18.2.5 and 18.2.8 ๐ The Reply carries options for configuration parameters.
The server MAY also throw in new values for other configuration parameters in that Reply, even if the client never asked for them in the Information-request ๐
19.4. Client Behavior ๐ฆ
clients receive Reconfigure messages sent to UDP port 546 on any interface where they already got configuration info through DHCP ๐ก These can show up at any time, no warning ๐ญ Since a reconfiguration can change stuff that application layer programs rely on, the client SHOULD log these events, and it MAY tell those programs about the change through an implementation-specific interface ๐
19.4.1. Receipt of Reconfigure Messages ๐ฅ
when a valid Reconfigure message arrives, the client replies with either a Renew message or an Information-request message, whichever the Reconfigure Message option says to use (that option is in section 22.19) ๐ The client ignores the transaction-id field in the Reconfigure message it got. While a transaction is already in progress, the client quietly drops any Reconfigure messages that show up ๐คซ
DISCUSSION:
the Reconfigure message is basically a trigger that tells the client to finish a successful message exchange โจ Once the client gets a Reconfigure, it runs the exchange (resending its Renew or Information-request if it has to), and it ignores extra Reconfigure messages until that exchange is done. Later Reconfigure messages make it start a brand new exchange ๐
so what about duplicate or retransmitted Reconfigure messages? ๐ค Duplicates just get ignored, because the client starts the exchange when the first one arrives. Retransmissions either kick off the exchange (if the first one never reached the client) or get ignored. The server can stop resending Reconfigure messages once it gets the Renew or Information-request from the client ๐
could a duplicate or retransmitted Reconfigure be delayed enough, and show up out of order, after the exchange it started is already finished? ๐ณ Yeah, it's possible. In that case the client would start a redundant exchange. But the odds of delayed, out-of-order delivery are small enough to ignore ๐ธ And the result is just inefficiency, not wrong behavior, so no drama ๐
19.4.2. Creation and Transmission of Renew Messages ๐
when the client is responding to a Reconfigure, it builds and sends the Renew message exactly the way section 18.1.3 describes, with one twist: it copies the Option Request option and any IA options from the Reconfigure message into the Renew ๐ง
19.4.3. Creation and Transmission of Information-request Messages ๐
same deal here. When responding to a Reconfigure, the client builds and sends the Information-request exactly like section 18.1.5 says, except it includes a Server Identifier option carrying the identifier from the Reconfigure it's answering ๐ซถ
19.4.4. Time Out and Retransmission of Renew or Information-request Messages โฐ
the client uses the same variables and retransmission algorithm it uses for Renew or Information-request messages from a client-initiated exchange. Check sections 18.1.3 and 18.1.5 for the details ๐ If the client still hasn't heard back from the server once the retransmissions run out, it ignores and discards the Reconfigure message ๐๏ธ
19.4.5. Receipt of Reply Messages ๐
when a valid Reply message arrives, the client processes the options and sets (or resets) configuration parameters as needed โจ It also records and updates the lifetimes for any addresses listed in IAs in the Reply ๐
20. Relay Agent Behavior ๐
the relay agent MAY be configured with a list of destination addresses. That list MAY include unicast addresses, the All_DHCP_Servers multicast address, or other addresses the network administrator picks ๐บ๏ธ If the relay agent was never explicitly configured, it MUST use the All_DHCP_Servers multicast address as its default. No skipping this one, bestie ๐จ
If the relay agent relays messages to the All_DHCP_Servers multicast address or to other multicast addresses, it sets the Hop Limit field to 32 ๐ข
20.1. Relaying a Client Message or a Relay-forward Message ๐ฆ
relay agents relay both messages from clients and Relay-forward messages from other relay agents ๐ When a relay agent gets a valid message to relay, it builds a brand new Relay-forward message. It copies the source address from the IP datagram header the message came in on into the peer-address field of the Relay-forward ๐ฎ Then it copies the received DHCP message (minus any IP or UDP headers) into a Relay Message option in the new message. Finally, it adds any other options it's configured to include ๐
20.1.1. Relaying a Message from a Client ๐ป
if the relay agent got the message from a client, it puts a global or site-scoped address with a prefix assigned to the link where the client should get its address into the link-address field ๐ The server uses this address to figure out which link the client should be assigned an address and other config info from. The hop-count in the Relay-forward is set to 0 ๐ฏ
if the relay agent can't use the link-address field to identify the interface the response will be relayed through, it MUST include an Interface-id option (see section 22.18) in the Relay-forward message ๐งฉ The server will copy that Interface-id option into its Relay-reply message. The relay agent fills in the link-address field the way we just described, whether or not it includes an Interface-id option in the Relay-forward, so no matter what it always gets filled in โจ
20.1.2. Relaying a Message from a Relay Agent ๐ช
if the message the relay agent got is a Relay-forward message and its hop-count is greater than or equal to HOP_COUNT_LIMIT, the relay agent throws it away ๐ โโ๏ธ
otherwise, the relay agent copies the source address from the IP datagram it came in on (from the client) into the peer-address field of the Relay-forward, and sets the hop-count field to whatever the received hop-count was plus 1 โ
if the source address in the IP datagram header of the received message is a global or site-local address (and the device running the relay agent belongs to only one site), the relay agent sets the link-address field to 0. If not, the relay agent sets the link-address field to a global or site-local address assigned to the interface the message came in on, or it includes an Interface-ID option to identify that interface ๐ซง
20.2. Relaying a Relay-reply Message ๐
the relay agent processes any options in the Relay-reply message along with the Relay Message option, and then it discards those options ๐๏ธ
the relay agent pulls the message out of the Relay Message option and relays it to the address in the peer-address field of the Relay-reply ๐
if the Relay-reply has an Interface-id option, the relay agent relays the message from the server to the client on the link that the Interface-id option names. Otherwise, if the link-address field isn't set to zero, the relay agent relays the message on the link named by the link-address field ๐งญ
20.3. Construction of Relay-reply Messages ๐ช
a server uses a Relay-reply message in two situations: to send a response back to a client when the original client message got relayed to the server in a Relay-forward message, or to send 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 that includes a Relay Message option holding the message for the next relay agent on the way back to the client. That contained Relay-reply has its own Relay Message option for the next relay agent, and so on, like nesting dolls ๐ช The server must record the contents of the peer-address fields in the received message so it can build the right Relay-reply carrying the server's response ๐
for example, if 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-REPLY
hop-count: 1
link-address: 0
peer-address: A
Relay Message option, containing:
msg-type: RELAY-REPLY
hop-count: 0
link-address: address from link to which C is attached
peer-address: C
Relay Message option: <response from server>
when the server sends a Reconfigure message to a client through a relay agent, it builds a Relay-reply that includes a Relay Message option holding the Reconfigure message for the next relay agent on the way back to the client. The server sets the peer-address field in the Relay-reply header to the client's address, and sets the link-address field however the relay agent needs it set to relay the Reconfigure 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 ๐
21. Authentication of DHCP Messages ๐
some network administrators may want to authenticate where DHCP messages came from and what's inside them ๐ต๏ธโโ๏ธ For example, clients can get hit with denial of service attacks from bogus DHCP servers, or they might just get misconfigured by DHCP servers that were started by accident ๐ฑ Admins may also want to limit address allocation to authorized hosts, to dodge denial of service attacks in "hostile" environments where the network medium isn't physically secured, like wireless networks or college residence halls ๐ซ๐
The DHCP authentication mechanism is based on the design of authentication for DHCPv4 [4] ๐
21.1. Security of Messages Sent Between Servers and Relay Agents
Okay so, relay agents and servers that want to swap messages securely use the IPsec mechanisms for IPv6 [7] ๐โจ If a client message gets relayed through multiple relay agents, each of those relay agents MUST have its own independent, pairwise trust relationship ๐ซถ Like, if client C's messages go from relay agent A to relay agent B and then on to the server, then relay agents A and B must be set up to use IPsec for the messages they trade, and relay agent B and the server must be set up to use IPsec for theirs ๐
Relay agents and servers that support secure relay-agent-to-server or relay-agent-to-relay-agent communication use IPsec under the following conditions:
- Selectors: Relay agents are manually configured with the addresses of the relay agent or server that DHCP messages get forwarded to ๐ง Every relay agent and server that's using IPsec to protect DHCP messages also needs a list of the relay agents that messages will be sent back to. The selectors are the pairs of addresses for the relay agents and servers that swap DHCP messages on the DHCPv6 UDP ports 546 and 547 ๐ฆ
- Mode: Relay agents and servers use transport mode and ESP. Honestly, the info inside DHCP messages isn't usually considered confidential, so encryption doesn't have to be used (so NULL encryption can be used) ๐
- Key management: The relay agents and servers live inside one organization, so public key schemes aren't necessary ๐ Since they have to be configured by hand, manually configured key management may suffice, BUT it doesn't protect against replayed messages ๐ So IKE with preshared secrets SHOULD be supported ๐ฅ IKE with public keys MAY be supported ๐
- Security policy: DHCP messages between relay agents and servers should only be accepted from DHCP peers that are identified in the local configuration ๐
- Authentication: Shared keys, indexed to the source IP address of the received DHCP message, are adequate for this application ๐ธ
- Availability: Proper IPsec implementations are likely to be around for servers and for relay agents in the more featureful devices used in enterprise and core ISP networks ๐ IPsec is less likely to be available for relay agents in the low-end devices mostly used in home or small office markets ๐ฅบ
21.2. Summary of DHCP Authentication
Authentication of DHCP messages happens through the Authentication option (see section 22.11) โจ The authentication info carried in that option can be used to reliably figure out who sent a DHCP message and to confirm that the contents haven't been tampered with ๐ต๏ธโโ๏ธ๐
The Authentication option gives you a framework for multiple authentication protocols ๐งฉ Two of them are defined here. Any other protocols defined in the future will get their own separate documents ๐
Any DHCP message MUST NOT include more than one Authentication option. Not one extra, bestie ๐ โโ๏ธ
The protocol field in the Authentication option tells you which specific protocol made the authentication info carried in the option ๐ The algorithm field picks a specific algorithm inside that protocol. For example, it says which hash algorithm was used to generate the message authentication code (MAC) in the option ๐งฎ The replay detection method (RDM) field says what type of replay detection is used in the replay detection field ๐
21.3. Replay Detection
The Replay Detection Method (RDM) field decides what kind of replay detection gets used in the Replay Detection field ๐ฆ
If the RDM field contains 0x00, the replay detection field MUST be set to the value of a monotonically increasing counter ๐ข Using a counter value, like the current time of day (for example, an NTP-format timestamp [9]), can reduce the danger of replay attacks ๐ซฃ This method MUST be supported by all protocols ๐
21.4. Delayed Authentication Protocol
If the protocol field is 2, the message is using the "delayed authentication" mechanism โณ Here's how it goes: the client asks for authentication in its Solicit message, and then the server replies with an Advertise message that includes authentication info ๐ฌ That info has a nonce value that the source generates as a message authentication code (MAC), which gives you both message authentication and entity authentication ๐๐ซ
The specific technique here is based on the HMAC protocol [8], using the MD5 hash [16] โจ
21.4.1. Use of the Authentication Option in the Delayed Authentication Protocol
In a Solicit message, the client fills in the protocol, algorithm and RDM fields in the Authentication option with its own preferences ๐ The client sets the replay detection field to zero and leaves out the authentication information field ๐ It sets the option-len field to 11 ๐
In every other message, the protocol and algorithm fields tell you the method used to build the contents of the authentication information field ๐ง The RDM field tells you the method used to build the contents of the replay detection field ๐
The format of the Authentication information 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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| DHCP realm |
| (variable length) |
. .
. .
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| key ID |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| |
| HMAC-MD5 |
| (128 bits) |
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- DHCP realm: The DHCP realm that identifies the key used to generate the HMAC-MD5 value ๐บ๏ธ
- key ID: The key identifier that identified the key used to generate the HMAC-MD5 value ๐ชช
- HMAC-MD5: The message authentication code generated by applying MD5 to the DHCP message using the key identified by the DHCP realm, client DUID, and key ID ๐ง
The sender computes the MAC using the HMAC generation algorithm [8] and the MD5 hash function [16] ๐งฎ The entire DHCP message gets used as input to the HMAC-MD5 computation, with the MAC field of the authentication option set to zero ๐ซง That includes the DHCP message header and the options field too ๐ฆ
DISCUSSION: Algorithm 1 specifies the use of HMAC-MD5 ๐ Using a different technique, like HMAC-SHA, will be specified as a separate protocol ๐ The DHCP realm used to identify authentication keys is chosen to be unique among administrative domains ๐ Using the DHCP realm lets DHCP admins avoid conflicts in key identifiers, and it lets a host using DHCP keep using authenticated DHCP while roaming between DHCP administrative domains โ๏ธโจ
21.4.2. Message Validation
Any DHCP message that includes more than one authentication option MUST be discarded ๐๏ธ No exceptions, no cap ๐ โโ๏ธ
To validate an incoming message, the receiver first checks that the value in the replay detection field is acceptable according to the replay detection method named by the RDM field ๐ Next, the receiver computes the MAC as described in [8] ๐งฎ The entire DHCP message (with the MAC field of the authentication option set to 0) gets used as input to the HMAC-MD5 computation function ๐ซง If the MAC the receiver computes doesn't match the MAC in the authentication option, the receiver MUST discard the DHCP message ๐
21.4.3. Key Utilization
Each DHCP client has a set of keys ๐๏ธ Each key is identified by <DHCP realm, client DUID, key id> and each key also has a lifetime โฐ A key may not be used past the end of its lifetime, so don't even try ๐ โโ๏ธ The client's keys get handed to it initially through some out-of-band mechanism ๐ฎ The lifetime for each key is distributed along with the key ๐ How keys get distributed and how lifetimes get specified is beyond the scope of this document ๐คทโโ๏ธ
The client and server use one of the client's keys to authenticate DHCP messages during a session (until the next Solicit message sent by the client) ๐คโจ
21.4.4. Client Considerations for Delayed Authentication Protocol
The client announces that it wants to use DHCP authentication by including an Authentication option in its Solicit message ๐ฃ The server picks a key for the client based on the client's DUID ๐ The client and server use that key to authenticate all the DHCP messages exchanged during the session ๐ซถ
21.4.4.1. Sending Solicit Messages
When the client sends a Solicit message and wants to use authentication, it includes an Authentication option with the desired protocol, algorithm and RDM, as described in section 21.4 ๐ The client doesn't include any replay detection or authentication information in the Authentication option ๐
21.4.4.2. Receiving Advertise Messages โจ
Okay so the client checks every Advertise message that has an Authentication option saying it's using the delayed authentication protocol, using the validation test from section 21.4.2. ๐
Now, what if no Advertise messages include auth info, or none of them pass the test? Bestie, that's up to the client's local policy ๐คทโโ๏ธ According to client policy, the client MAY choose to respond to an Advertise message that hasn't been authenticated. ๐ซฃ
Setting local policy to accept unauthenticated messages should be done with care ๐ Accepting an unauthenticated Advertise message can make the client vulnerable to spoofing and other attacks ๐ And if the local users aren't explicitly told that the client accepted an unauthenticated Advertise message, they might wrongly assume the client got an authenticated address and is totally safe from DHCP attacks through unauthenticated messages. That's a whole mess, so please be transparent with your users ๐ซถ
A client MUST be configurable to discard unauthenticated messages, and SHOULD be configured by default to discard them if the client has been set up with an authentication key or other authentication information. ๐ A client MAY choose to tell apart Advertise messages with no authentication information from Advertise messages that don't pass the validation test. For example, it might accept the former and discard the latter. ๐ If a client does accept an unauthenticated message, it SHOULD inform any local users and SHOULD log the event. ๐
21.4.4.3. Sending Request, Confirm, Renew, Rebind, Decline or Release Messages ๐
If the client authenticated the Advertise message it used to pick the server, the client MUST generate authentication information for the later Request, Confirm, Renew, Rebind or Release messages it sends to that server, as described in section 21.4. ๐ And when it sends one of those subsequent messages, it MUST use the same key the server used to generate the authentication information. ๐ No switching keys mid-convo, periodt ๐ โโ๏ธ
21.4.4.4. Sending Information-request Messages ๐ง
If the server has selected a key for the client in a previous message exchange (see section 21.4.5.1), the client MUST use that same key to generate the authentication information throughout the session. ๐๏ธ Consistency is everything, no cap โจ
21.4.4.5. Receiving Reply Messages ๐ฌ
If the client authenticated the Advertise it accepted, the client MUST validate the matching Reply message from the server. ๐ง The client MUST discard the Reply if it fails the validation test, and it MAY log the validation failure. ๐ If the Reply fails the validation test, the client MUST restart the DHCP configuration process by sending a Solicit message. ๐ Start over, girl, we move ๐
If the client accepted an Advertise message that either didn't include authentication information or didn't pass the validation test, the client MAY accept an unauthenticated Reply message from the server. ๐คทโโ๏ธ
21.4.4.6. Receiving Reconfigure Messages ๐จ
The client MUST discard the Reconfigure if it fails the validation test, and it MAY log the validation failure. ๐๏ธ Not the vibe, not the message ๐
21.4.5. Server Considerations for Delayed Authentication Protocol ๐ฅ๏ธ
After the server gets a Solicit message that contains an Authentication option, it selects a key for the client. The server picks that key based on the client's DUID and on the key selection policies the server has been configured with. ๐ง The server then identifies the selected key in the Advertise message, and uses that key to validate later messages between the client and the server. ๐ Main character server energy ๐
21.4.5.1. Receiving Solicit Messages and Sending Advertise Messages ๐จ
The server selects a key for the client and includes authentication information in the Advertise message it sends back, as specified in section 21.4. The server MUST record the identifier of the key it selected for the client, and MUST use that same key to validate later messages with that client. ๐ Consistency, bestie ๐ซถ
21.4.5.2. Receiving Request, Confirm, Renew, Rebind or Release Messages and Sending Reply Messages ๐ฌ
The server uses the key identified in the message and validates the message as specified in section 21.4.2. If the message fails the validation test, or the server doesn't know the key identified by the 'key ID' field, the server MUST discard the message. It MAY choose to log the validation failure. ๐๏ธ๐
If the message passes the validation test, the server responds to that specific message as described in section 18.2. โ The server MUST include authentication information generated using the key identified in the received message, as specified in section 21.4. ๐ Every reply gets dressed up in the right key ๐
21.5. Reconfigure Key Authentication Protocol ๐
The Reconfigure key authentication protocol protects a client from misconfiguration caused by a Reconfigure message sent by a malicious DHCP server. ๐๐ซ Here's how it goes: a DHCP server sends a Reconfigure Key to the client during the initial exchange of DHCP messages. The client records that Reconfigure Key so it can authenticate later Reconfigure messages from that server. After that, the server includes an HMAC computed from the Reconfigure Key in its subsequent Reconfigure messages. ๐
Both the Reconfigure Key sent from the server to the client, and the HMAC in later Reconfigure messages, are carried as the Authentication information in an Authentication option. The format of that Authentication information is defined in the next section. ๐ฆ
The Reconfigure Key protocol is initiated by the server, and it's only used if the client and server aren't using any other authentication protocol and have negotiated to use Reconfigure messages. ๐ค Only when it's the right setup, no cap โจ
21.5.1. Use of the Authentication Option in the Reconfigure Key Authentication Protocol ๐งพ
The following fields are set in an Authentication option for the Reconfigure Key Authentication Protocol:
protocol 3
algorithm 1
RDM 0
The format of the Authentication information for the Reconfigure Key Authentication Protocol 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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Type | Value (128 bits) |
+-+-+-+-+-+-+-+-+ |
. .
. .
. +-+-+-+-+-+-+-+-+
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Type Type of data in Value field carried in this option:
1 Reconfigure Key value (used in Reply message).
2 HMAC-MD5 digest of the message (used in Reconfigure
message).
Value Data as defined by field.
21.5.2. Server considerations for Reconfigure Key protocol ๐ฅ๏ธ
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 in the Reply message. ๐ฌ
The Reconfigure Key is 128 bits long, and it MUST be a cryptographically strong random or pseudo-random number that cannot easily be predicted. ๐ฒ๐ No guessable keys, please and thank you ๐ โโ๏ธ
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 Reconfigure Key for that client. ๐งฎ 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 zero for that computation. 0๏ธโฃ Then the server includes the HMAC-MD5 in the authentication information field of an Authentication option in the Reconfigure message it sends to the client. โจ
21.5.3. Client considerations for Reconfigure Key protocol ๐ง
The client gets a Reconfigure Key from the server in the initial Reply message. ๐ฉ The client records that Reconfigure Key so it can authenticate later Reconfigure messages. ๐
To authenticate a Reconfigure message, the client computes an HMAC-MD5 over the DHCP Reconfigure message, using the Reconfigure Key it received from the server. ๐งฎ If the computed HMAC-MD5 matches the value in the Authentication option, the client accepts the Reconfigure message. โ Match? Accept. No match? Yeeted ๐
22. DHCP Options ๐
Options carry additional information and parameters in DHCP messages. ๐ Every option shares a common base format, as described in section 22.1. 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. ๐ฎ
Unless otherwise noted, each option MAY appear only in the options area of a DHCP message, and MAY appear only once. Hmm, wait, let me say it properly: unless otherwise noted, each option may appear only in the options area of a DHCP message and may appear only once. If an option does appear multiple times, each instance is considered separate, and the data areas of the options MUST NOT be concatenated or otherwise combined. ๐ซ๐งฉ No mashing options together, bestie ๐ โโ๏ธ
22.1. Format of DHCP Options ๐งฑ
The format of DHCP options 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-code | option-len |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| option-data |
| (option-len octets) |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
option-code An unsigned integer identifying the specific option
type carried in this option.
option-len An unsigned integer giving the length of the
option-data field in this option in octets.
option-data The data for the option; the format of this data
depends on the definition of the option.
DHCPv6 options are scoped by using encapsulation. ๐ช Some options apply generally to the client, some are specific to an IA, and some are specific to the addresses within an IA. Those last two cases are discussed in sections 22.4 and 22.6. ๐
22.2. Client Identifier Option ๐ชช
The Client Identifier option carries a DUID (see section 9) that identifies a client between a client and a server. ๐ The format of the Client Identifier 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_CLIENTID | option-len |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
. .
. DUID .
. (variable length) .
. .
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
option-code OPTION_CLIENTID (1).
option-len Length of DUID in octets.
DUID The DUID for the client.
22.3. Server Identifier Option โจ
okay so the Server Identifier option is how a client and a server pass a DUID (see section 9) back and forth to say "this is the server I mean" ๐ 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_SERVERID | option-len |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
. .
. DUID .
. (variable length) .
. .
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
option-code: it'sOPTION_SERVERID (2)๐option-len: the length of the DUID in octets ๐DUID: the DUID for the server ๐ง
22.4. Identity Association for Non-temporary Addresses Option โจ
the Identity Association for Non-temporary Addresses option (IA_NA option) is the one that carries an IA_NA, its parameters, and the non-temporary addresses tied to it ๐ธ
the addresses inside an IA_NA option are not temporary addresses (see section 22.5), so no mixing them up, bestie ๐
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_IA_NA | option-len |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| IAID (4 octets) |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| T1 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| T2 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| |
. IA_NA-options .
. .
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
the fields, lowkey the important part:
option-code:OPTION_IA_NA (3)๐ฆoption-len:12 + length of IA_NA-options field๐IAID: the unique identifier for this IA_NA. it has to be unique among all of this client's IA_NAs. the number space for IA_NA IAIDs is separate from the number space for IA_TA IAIDs, so they don't clash ๐T1: the time when the client goes back to the server that gave out the addresses to extend their lifetimes. it's a duration in seconds, counted from now โฐT2: the time when the client goes to any available server to extend the lifetimes. also a duration in seconds from now ๐ซถIA_NA-options: options that belong to this IA_NA specifically. like, all the IA Address Options carrying this IA_NA's addresses live in here ๐
an IA_NA option may only appear in the options area of a DHCP message. a DHCP message can have multiple IA_NA options ๐
the status of anything happening with this IA_NA shows up in a Status Code option inside the IA_NA-options field โจ
ngl this part is important: an IA_NA has no lifetime or lease length of its own ๐ when all the valid lifetimes of its addresses have run out, the IA_NA can be considered expired. T1 and T2 are just there so servers get explicit say over when a client checks back in about a specific IA_NA ๐
in a message from client to server, the T1 and T2 fields show the client's preference for those values. if the client has no preference, it sets T1 and T2 to 0 ๐ธ
in a message from server to client, the client MUST use the values in the T1 and T2 fields for the T1 and T2 parameters, 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 lifetimes of any addresses in the IA_NA before they expire, even if the server is down for a bit. the recommended values are .5 and .8 times the shortest preferred lifetime of the addresses in the IA that the server is willing to extend, respectively ๐ง if the "shortest" preferred lifetime is 0xffffffff ("infinity"), the recommended T1 and T2 values are also 0xffffffff โพ๏ธ and if the server wants the client to decide when to renew, it sets T1 and T2 to 0 ๐
now the invalid-values drama ๐ญ
- if a server gets an IA_NA with T1 greater than T2, and both T1 and T2 are greater than 0, the server ignores the invalid T1 and T2 values and processes the IA_NA as though the client had set T1 and T2 to 0 ๐
- if a client gets 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 never included that invalid IA_NA option ๐๏ธ
careful with 0xffffffff ("infinity") for T1 or T2 โ ๏ธ a client will never try to extend the lifetimes of any addresses in an IA with T1 set to 0xffffffff. and a client will never try to use a Rebind message to find a different server to extend the lifetimes of any addresses in an IA with T2 set to 0xffffffff. so think before you set it, bestie ๐ฅบ
22.5. Identity Association for Temporary Addresses Option โจ
the Identity Association for the Temporary Addresses (IA_TA) option carries an IA_TA, its parameters, and the addresses tied to it. the client uses every address in this option as a temporary address, as defined in RFC 3041 [12] ๐ฆ 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_IA_TA | option-len |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| IAID (4 octets) |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| |
. IA_TA-options .
. .
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
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 all of this client's IA_TAs. the IA_TA IAID number space is separate from the IA_NA one ๐งIA_TA-options: options that belong to this IA_TA specifically. all the IA Address Options carrying this IA_TA's addresses go here ๐
an IA_TA option may only appear in the options area of a DHCP message, and a DHCP message can have multiple IA_TA options ๐ the status of any operations on this IA_TA is in a Status Code option in the IA_TA-options field ๐
an IA_TA has no lifetime of its own either. when all the valid lifetimes of the addresses in an IA_TA have expired, the IA can be considered expired โณ
an IA_TA option doesn't include T1 and T2 values, but a client MAY ask for the lifetimes on 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. for example, a client might ask for an extension so an app can keep using an established TCP connection ๐ซถ
each IA_TA carries one "set" of temporary addresses, meaning at most one address from each prefix assigned to the link the client is attached to ๐ธ
to get new temporary addresses, the client sends an IA_TA option with a new IAID to a server. asking the server for new ones is the same as generating new temporary addresses as described in RFC 3041 ๐ฆ the server will generate new temporary addresses and send them back. the client should ask for new ones before the lifetimes on the old addresses run out โฐ
the big rule: 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 ๐
this option MAY appear in a Confirm message if the lifetimes on the temporary addresses in the associated IA have not expired โจ
22.6. IA Address Option ๐ก
okay so the IA Address option is how you attach specific IPv6 addresses to an IA_NA or an IA_TA ๐ it has to live inside the Options field of one of those, and that Options field holds the stuff that's specific to this one address โจ
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_IAADDR | option-len |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| |
| IPv6 address |
| |
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| preferred-lifetime |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| valid-lifetime |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
. .
. IAaddr-options .
. .
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
the fields, bestie ๐ซถ
option-codeisOPTION_IAADDR (5).option-lenis24 + length of IAaddr-options field.IPv6 addressis the IPv6 address itself ๐ธpreferred-lifetimeis the preferred lifetime for that address, in seconds.valid-lifetimeis the valid lifetime for that address, in seconds.IAaddr-optionsis the options that belong to this address.
ok the lifetime stuff is where it gets spicy ๐ถ๏ธ when a client is sending this to a server, the lifetime values are just the client saying what it prefers ๐ and it's allowed to send 0 if it doesn't care at all. but when a server sends it back to a client, the client MUST use those preferred and valid lifetime values for real ๐ฅ and they're the number of seconds still left on each lifetime, not the original numbers.
a client throws out any address where the preferred lifetime is bigger than the valid lifetime ๐๏ธ and a server just ignores the client's lifetimes if the preferred one is bigger than the valid one ๐ it also ignores the client's T1 and T2 values if those are bigger than the preferred lifetime. no drama, just vibes ๐ง
careful with 0xffffffff ("infinity") for the valid lifetime ๐ that's basically saying "this address is permanently yours," so think twice before you hit that.
an IA Address option can only show up inside an IA_NA option or an IA_TA option ๐ and you can have more than one IA Address option in there, no cap ๐
finally, if anything's going wrong with operations on this IA Address, the status shows up in a Status Code option sitting in the IAaddr-options field ๐จ
22.7. Option Request Option ๐
the Option Request option is basically the client's wishlist ๐ it's a list of option codes, so both sides know which options are being asked for. here's the shape:
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 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| ... |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
option-codeisOPTION_ORO (6).option-lenis2 * number of requested options.requested-option-code-nis the option code for each option the client is asking for.
a client MAY include an Option Request option in a Solicit, Request, Renew, Rebind, Confirm or Information-request message to tell the server which options it wants sent back ๐ and a server MAY include one in a Reconfigure option to say which options the client should go request from it ๐
22.8. Preference Option ๐
the Preference option is a server's way of flexing on clients ๐ it's sent by a server to a client to influence which server the client picks. 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_PREFERENCE | option-len |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| pref-value |
+-+-+-+-+-+-+-+-+
option-codeisOPTION_PREFERENCE (7).option-lenis1.pref-valueis the preference value this server is putting out in this message.
a server MAY include a Preference option in an Advertise message to steer which server the client selects ๐ฆ check section 17.1.3 for how the client uses it and how to read that pref-value ๐ง
22.9. Elapsed Time Option โฑ๏ธ
this one is all about the clock โฐ it tells the server how long the client has been trying to finish its current DHCP transaction. here's how it looks:
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 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
option-codeisOPTION_ELAPSED_TIME (8).option-lenis2.elapsed-timeis the time since the client started its current DHCP transaction, in hundredths of a second (10^-2 seconds).
a client MUST include an Elapsed Time option in its messages ๐จ the clock starts when the client sends the first message in the exchange, and that first message has elapsed-time set to 0 ๐ฅน servers and Relay Agents use this number as input to their policy on how to respond. for example, it lets a secondary DHCP server jump in and answer when the primary has been ghosting for too long ๐ป
the elapsed-time value is an unsigned, 16 bit integer ๐ข and if the time is bigger than the biggest value it can hold, the client uses 0xffff to say "it's been forever" ๐
22.10. Relay Message Option ๐ฌ
the Relay Message option is the envelope ๐ it carries a DHCP message inside a Relay-forward or Relay-reply message. 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_RELAY_MSG | option-len |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| |
. DHCP-relay-message .
. .
. .
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
option-codeisOPTION_RELAY_MSG (9)option-lenis the length ofDHCP-relay-message.DHCP-relay-messagedepends on which message it's riding in ๐ฆ in a Relay-forward message, it's the message that was received, passed along verbatim to the next relay agent or server. in a Relay-reply message, it's the message that gets copied and relayed on to the relay agent or client whose address is in thepeer-addressfield of that Relay-reply.
22.11. Authentication Option ๐
the Authentication option carries the authentication info that proves who sent a DHCP message and that its contents haven't been messed with ๐ต๏ธโโ๏ธ section 21 explains how it's used. 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_AUTH | option-len |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| protocol | algorithm | RDM | |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| |
| replay detection (64 bits) +-+-+-+-+-+-+-+-+
| | auth-info |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
. authentication information .
. (variable length) .
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
option-codeisOPTION_AUTH (11).option-lenis11 + length of authentication information field.protocolis the authentication protocol used in this option ๐งพalgorithmis the algorithm used within that protocol ๐งฎRDMis the replay detection method used in this option ๐replay detectionis the replay detection info for whichever RDM is in play ๐ฐ๏ธauthentication informationis the auth data, shaped by the protocol and algorithm being used here โจ
and that's the vibe for this part, bestie ๐ฆ
22.12. Server Unicast Option ๐ฆ
okay so this one is giving "server, you're allowed to DM the client directly" ๐ The server sends this option to a client to say it's allowed to unicast messages to the server. 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_UNICAST | option-len |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| |
| server-address |
| |
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
option-code:OPTION_UNICAST(12).option-len: 16.server-address: the IP address the client should send unicast messages to.
The server puts the IPv6 address the client should use in the server-address field. When a client gets this option, where permissible and appropriate, it sends messages straight to the server at that address ๐
When the server sends a Unicast option to the client, some messages from the client won't be relayed by Relay Agents, and they won't include Relay Agent options from those agents. So a server should only send a Unicast option when Relay Agents aren't sending Relay Agent options ๐ A DHCP server rejects any messages sent inappropriately using unicast, which makes sure messages still get relayed by Relay Agents whenever Relay Agent options are in use. Super important, bestie ๐
Details about when the client may send messages to the server using unicast are in section 18.
22.13. Status Code Option โจ
This option returns a status indication related to the DHCP message or option it appears in. 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_STATUS_CODE | option-len |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| status-code | |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
. .
. status-message .
. .
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
option-code:OPTION_STATUS_CODE(13).option-len: 2 + length ofstatus-message.status-code: the numeric code for the status in this option. The status codes are defined in section 24.4.status-message: a UTF-8 encoded text string meant for end users to read. It MUST NOT be null-terminated ๐
A Status Code option may show up in the options field of a DHCP message, and/or in the options field of another option ๐ง If the Status Code option doesn't appear in a message where it could, the message's status is assumed to be Success.
22.14. Rapid Commit Option ๐ฅ
The Rapid Commit option signals the use of the two message exchange for address assignment. 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 | 0 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
option-code:OPTION_RAPID_COMMIT(14).option-len: 0.
A client MAY include this option in a Solicit message if it's prepared to do the Solicit-Reply message exchange described in section 17.1.1 ๐
A server MUST include this option in a Reply message sent in response to a Solicit message when it's completing the Solicit-Reply message exchange ๐
DISCUSSION: Each server that responds with a Reply to a Solicit that includes a Rapid Commit option commits the assigned addresses in that Reply to the client, and it won't get any confirmation that the client actually received the Reply. So if more than one server responds to a Solicit with a Rapid Commit option, some servers will commit addresses that the client never ends up using ๐ญ The unused address problem can be minimized, for example, by designing the DHCP service so that only one server responds to the Solicit, or by using relatively short lifetimes for assigned addresses.
22.15. User Class Option ๐ธ
The User Class option is how a client identifies the type or category of user or applications it represents. Format:
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 .
. .
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
option-code:OPTION_USER_CLASS(15).option-len: length of the user class data field.user-class-data: the user classes the client carries.
The data in this option is made of one or more opaque fields, each representing a user class the client belongs to ๐ The server picks configuration information for the client based on those classes. For example, the User Class option can be used so that clients of people in the accounting department get a different printer than clients of people in the marketing department ๐จ๏ธ The user class information 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. Each instance is formatted like this:
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-...-+-+-+-+-+-+-+
| user-class-len | opaque-data |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-...-+-+-+-+-+-+-+
user-class-len is two 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 config for the client. A server may use only the user classes it's configured to interpret when selecting configuration information for a client, and ignore any other user classes ๐ In response to a message containing a User Class option, the server includes a User Class option listing the classes it successfully interpreted, so the client knows which ones the server understood.
22.16. Vendor Class Option ๐
This option is how a client identifies the vendor that made the hardware it's running on. The info in the data area is made of one or more opaque fields that describe the hardware configuration ๐ง Format:
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 .
. . . . .
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
option-code:OPTION_VENDOR_CLASS(16).option-len: 4 + length of the vendor class data field.enterprise-number: the vendor's registered Enterprise Number, as registered with IANA [6].vendor-class-data: the hardware configuration of the host the client is running on.
The vendor-class-data is made of a bunch of separate items, and each one describes some characteristic of the client's hardware configuration โจ Examples could be 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 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-...-+-+-+-+-+-+-+
vendor-class-len is two octets long and specifies the length of the opaque vendor class data, in network byte order ๐
22.17. Vendor-specific Information Option โจ
okay so this option is how clients and servers swap vendor-specific information ๐ it's basically a little bonus lane where a vendor can add their own fancy features ๐ฆ
The format of the Vendor-specific Information option is:
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 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
. .
. option-data .
. .
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
option-code: OPTION_VENDOR_OPTS (17)
option-len: 4 + length of option-data field
enterprise-number: The vendor's registered Enterprise Number as registered with IANA [6].
option-data: An opaque object of option-len octets, interpreted by vendor-specific code on the clients and servers
The information inside this option is totally vendor-defined. The vendor is named in the enterprise-number field ๐ท๏ธ Using vendor-specific info unlocks enhanced operation and extra features in a vendor's DHCP implementation ๐ And here's the best part: a DHCP client that doesn't get the vendor-specific info it asked for will still set up the host's IPv6 stack so it works ๐ซถ
The encapsulated vendor-specific options field MUST be encoded as a sequence of code/length/value fields of identical format to the DHCP options field. The option codes are defined by the vendor identified in the enterprise-number field and are not managed by IANA. Each encapsulated option is formatted like this:
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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| opt-code | option-len |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
. .
. option-data .
. .
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
opt-code: The code for the encapsulated option.
option-len: An unsigned integer giving the length of the option-data field in this encapsulated option in octets.
option-data: The data area for the encapsulated option.
Multiple instances of the Vendor-specific Information option may appear 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 ๐
22.18. Interface-Id Option ๐ง
okay this one is for relay agents ๐ธ a relay agent MAY send the Interface-id option so the server knows which interface the client message came in on ๐ and if a relay agent gets a Relay-reply message carrying an Interface-id option, it relays the message to the client through the interface named in that 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 .
. .
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
option-code: OPTION_INTERFACE_ID (18).
option-len: Length of interface-id field.
interface-id: An opaque value of arbitrary length generated by the relay agent to identify one of the relay agent's interfaces.
The server MUST copy the Interface-Id option from the Relay-Forward message into the Relay-Reply message it sends back to the relay agent in response to that Relay-Forward message. This option MUST NOT appear in any message except a Relay-Forward or Relay-Reply message. Strict rules, bestie, no exceptions ๐ โโ๏ธ
Servers MAY use the Interface-ID for parameter assignment policies. The Interface-ID SHOULD be considered an opaque value ๐ Policies should be based on exact match only, which means the Interface-ID 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 changes, a server will not be able to use it reliably in parameter assignment policies. ๐ญ
22.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 or an Information-request message ๐ The format of this 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 |
+-+-+-+-+-+-+-+-+
option-code: OPTION_RECONF_MSG (19).
option-len: 1.
msg-type: 5 for Renew message, 11 for Information-request message.
The Reconfigure Message option can only appear in a Reconfigure message. Keep it in its lane ๐
22.20. Reconfigure Accept Option ๐
this one is a yes-or-no vibe check ๐ซง A client uses the Reconfigure Accept option to announce whether it's willing to accept Reconfigure messages, and a server uses it to tell the client whether or not to accept them ๐ฌ If the option is missing, the default is no for both: the client is unwilling to accept Reconfigure messages, and the server is instructing the client not to accept them ๐ โโ๏ธ 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_RECONF_ACCEPT | 0 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
option-code: OPTION_RECONF_ACCEPT (20).
option-len: 0.
23. Security Considerations โจ
okay bestie, this section is SERIOUS ๐ญ๐ but I'm gonna explain it in my own words so it's easier to vibe with. DHCP's main threat is basically an insider threat ๐ (assuming the network is set up properly and DHCPv6 ports are blocked at the perimeter gateways of the enterprise ๐งฑ). Even so, the gateway setup doesn't change the fact that attacks from insiders and outsiders are the same ๐ .
Using manually configured preshared keys for IPsec between relay agents and servers does NOT protect against replayed DHCP messages ๐. Replays can cause a DOS attack by eating up processing resources ๐ฅ, but they can't cause misconfiguration or use up other stuff like assignable addresses ๐.
One attack that's specific to a DHCP client is a malicious server showing up with the goal of giving the client wrong configuration info ๐. The reason could be a "man in the middle" attack, so the client talks to a bad server instead of a legit one for something like DNS or NTP ๐ซฃ. The malicious server could also cause a denial of service by messing up the client's config so ALL its network communication fails ๐ญ.
Then there's the threat to clients from DHCP servers that are mistakenly or accidentally misconfigured ๐คฆโโ๏ธ. They answer client requests with wrong config parameters by accident, which is still rough ๐.
A client can also get attacked through a Reconfigure message from a malicious server ๐จ. The client sends its response (Renew or Information-request) through a relay agent, so that response only reaches the servers the DHCP messages get relayed to ๐ค๏ธ. BUT a malicious server could send a Reconfigure message to the client, then (after an appropriate delay โณ) send a Reply that the client would accept ๐ฑ. So a malicious server that's NOT on the network path between the client and the server can still pull off a Reconfigure attack ๐. Using transaction IDs that are cryptographically sound and hard to predict also helps lower the chances that this attack works ๐โจ.
The threat specific to a DHCP server is an invalid client pretending to be a valid one ๐ญ. The motive could be stealing service or dodging auditing for all kinds of shady reasons ๐ต๏ธโโ๏ธ.
The threat for BOTH the client and the server is the resource "denial of service" (DoS) attack ๐. These usually involve running out of available addresses, or running out of CPU or network bandwidth ๐. They show up anytime there's a shared resource ๐ซ .
If relay agents add extra options to Relay Forward messages, the messages between relay agents and servers could be used to mount a "man in the middle" or denial of service attack ๐ซ.
The threat model here doesn't treat the privacy of DHCP message contents as important ๐ โโ๏ธ. DHCP isn't used to swap authentication or config info that has to stay secret from other network nodes ๐ค.
DHCP authentication lets clients and servers verify each other's identity, and protects the integrity of messages sent between them ๐ชช๐. It does NOT give any privacy for the contents of DHCP messages ๐๏ธ.
The Delayed Authentication protocol in section 21.4 uses a secret key shared between a client and a server ๐๏ธ. A "DHCP realm" in the shared key lets a client figure out which administrative domain it's in, so it can pick the right key or keys when roaming between domains ๐งญ. BUT the Delayed Authentication protocol doesn't define any way to share keys, so a client might need a separate key for every administrative domain it runs into ๐ฉ. Shared keys may not scale well, and they don't offer a way to repudiate compromised keys โ. This protocol is focused on the intradomain problem, where swapping a shared key out-of-band is feasible ๐ค๐ธ.
Because of the attack risk through the Reconfigure message, a DHCP client MUST discard any Reconfigure message that does not include authentication, or that doesn't pass the validation process for the authentication protocol ๐ซ๐. This is non-negotiable, periodt ๐ .
The Reconfigure Key protocol in section 21.5 protects against a malicious DHCP server using a Reconfigure message to pull off a denial of service or man-in-the-middle attack on a client ๐ก๏ธ. BUT this protocol can be broken by an attacker who can intercept the initial message where the DHCP server sends the key to the client ๐ฌ.
Communication between a server and a relay agent, and between relay agents, can be secured with IPsec, as described in section 21.1 ๐. Manual configuration and installation of static keys are acceptable here, because relay agents and the server belong to the same administrative domain ๐ , and the relay agents need other specific config anyway (like the DHCP server address) plus the IPsec config ๐งฉ.
24. IANA Considerations ๐
okay so this section is about the new name spaces DHCPv6 and its options need ๐. The ones defined here are:
- Message types
- Status codes
- DUID
- Option codes
IANA set up a registry of values for each of these, which I'll walk through below ๐. IANA manages these name spaces, and they're all managed separately from the DHCPv4 name spaces ๐.
New multicast addresses, message types, status codes, and DUID types are assigned via Standards Action [11] ๐๏ธ.
New DHCP option codes are tentatively assigned once the spec for the option, published as an Internet Draft, has gotten expert review from a designated expert [11] ๐ง. The final assignment of DHCP option codes happens through Standards Action, as defined in RFC 2434 [11] ๐ฏ.
This document also references three name spaces in section 21 that go with the Authentication Option (section 22.11) ๐. Those name spaces are defined by the authentication mechanism for DHCPv4 in RFC 3118 [4] ๐.
The authentication name spaces IANA has registered so far will apply to both DHCPv6 and DHCPv4 โจ. Going forward, specs that define new Protocol, Algorithm and RDM mechanisms will explicitly say whether those mechanisms are used with DHCPv4, DHCPv6, or both ๐.
24.1. Multicast Addresses
Section 5.1 defines the following multicast addresses, which IANA assigned for DHCPv6 use ๐ก:
All_DHCP_Relay_Agents_and_Servers address: FF02::1:2
All_DHCP_Servers address: FF05::1:3
24.2. DHCP Message Types
IANA recorded the following message types (defined in section 5.3) ๐. IANA will maintain the registry of DHCP message types ๐๏ธ.
SOLICIT 1
ADVERTISE 2
REQUEST 3
CONFIRM 4
RENEW 5
REBIND 6
REPLY 7
RELEASE 8
DECLINE 9
RECONFIGURE 10
INFORMATION-REQUEST 11
RELAY-FORW 12
RELAY-REPL 13
24.3. DHCP Options
IANA recorded the following option-codes (as defined in section 22) ๐. IANA will maintain the registry of DHCP option codes ๐.
OPTION_CLIENTID 1
OPTION_SERVERID 2
OPTION_IA_NA 3
OPTION_IA_TA 4
OPTION_IAADDR 5
OPTION_ORO 6
OPTION_PREFERENCE 7
OPTION_ELAPSED_TIME 8
OPTION_RELAY_MSG 9
OPTION_AUTH 11
OPTION_UNICAST 12
OPTION_STATUS_CODE 13
OPTION_RAPID_COMMIT 14
OPTION_USER_CLASS 15
OPTION_VENDOR_CLASS 16
OPTION_VENDOR_OPTS 17
OPTION_INTERFACE_ID 18
OPTION_RECONF_MSG 19
OPTION_RECONF_ACCEPT 20
24.4. Status Codes
IANA recorded the status codes in the table below ๐งพ. IANA will manage the definition of additional status codes in the future ๐ฎ.
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 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
address.
24.5. DUID
IANA recorded the following DUID types (as defined in section 9.1) ๐ชช. IANA will manage the definition of additional DUID types in the future ๐.
DUID-LLT 1
DUID-EN 2
DUID-LL 3
25. Acknowledgments ๐ซถ
Thanks to the DHC Working Group and the members of the IETF for their time and input into the specification ๐. Extra thanks for the consistent input, ideas, and review from (in alphabetical order) Bernard Aboba, Bill Arbaugh, Thirumalesh Bhat, Steve Bellovin, A. K. Vijayabhaskar, Brian Carpenter, Matt Crawford, Francis Dupont, Richard Hussong, Kim Kinnear, Fredrik Lindholm, Tony Lindstrom, Josh Littlefield, Gerald Maguire, Jack McCann, Shin Miyakawa, Thomas Narten, Erik Nordmark, Jarno Rajahalme, Yakov Rekhter, Mark Stapp, Matt Thomas, Sue Thomson, Tatuya Jinmei and Phil Wells ๐ธโจ.
Thanks to Steve Deering and Bob Hinden, who have consistently taken the time to discuss the more complex parts of the IPv6 specifications ๐ง ๐.
And thanks to Steve Deering for pointing out at IETF 51 in London that the DHCPv6 specification has the highest revision number of any Internet Draft ๐๐.
26. References ๐
26.1. Normative References โจ
okay so the normative references are the docs this RFC needs you to have read, bestie ๐
[1]Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, March 1997.[2]Crawford, M., "Transmission of IPv6 Packets over Ethernet Networks", RFC 2464, December 1998.[3]Deering, S. and R. Hinden, "Internet Protocol, Version 6 (IPv6) Specification", RFC 2460, December 1998.[4]Droms, R., Ed. and W. Arbaugh, Ed., "Authentication for DHCP Messages", RFC 3118, June 2001.[5]Hinden, R. and S. Deering, "IP Version 6 Addressing Architecture", RFC 2373, July 1998.[6]IANA. Private Enterprise Numbers.http://www.iana.org/assignments/enterprise-numbers.html.[7]Kent, S. and R. Atkinson, "Security Architecture for the Internet Protocol", RFC 2401, November 1998.[8]Krawczyk, H., Bellare, M. and R. Canetti, "HMAC: Keyed-Hashing for Message Authentication", RFC 2104, February 1997.[9]Mills, D., "Network Time Protocol (Version 3) Specification, Implementation", RFC 1305, March 1992.[10]Mockapetris, P., "Domain names - implementation and specification", RFC 1035, November 1987.[11]Narten, T. and H. Alvestrand, "Guidelines for Writing an IANA Considerations Section in RFCs", BCP 26, RFC 2434, October 1998.[12]Narten, T. and R. Draves, "Privacy Extensions for Stateless Address Autoconfiguration in IPv6", RFC 3041, January 2001.[13]Narten, T., Nordmark, E. and W. Simpson, "Neighbor Discovery for IP Version 6 (IPv6)", RFC 2461, December 1998.[14]Plummer, D.C., "Ethernet Address Resolution Protocol: Or converting network protocol addresses to 48.bit Ethernet address for transmission on Ethernet hardware", STD 37, RFC 826, November 1982.[15]Postel, J., "User Datagram Protocol", STD 6, RFC 768, August 1980.[16]Rivest, R., "The MD5 Message-Digest Algorithm", RFC 1321, April 1992.[17]Thomson, S. and T. Narten, "IPv6 Stateless Address Autoconfiguration", RFC 2462, December 1998.
26.2. Informative References ๐ฆ
these ones are the helpful extras. good to know, not strictly required ๐
[18]Alexander, S. and R. Droms, "DHCP Options and BOOTP Vendor Extensions", RFC 2132, March 1997.[19]Droms, R., "Dynamic Host Configuration Protocol", RFC 2131, March 1997.[20]R. Droms, Ed. DNS Configuration options for DHCPv6. April 2002. Work in Progress.[21]A. K. Vijayabhaskar. Time Configuration Options for DHCPv6. May 2002. Work in Progress.[22]Vixie, P., Ed., Thomson, S., Rekhter, Y. and J. Bound, "Dynamic Updates in the Domain Name System (DNS UPDATE)", RFC 2136, April 1997.
A. Appearance of Options in Message Types ๐
this appendix is the cheat sheet for which options are allowed in each DHCP message type. a * means yes, allowed ๐ซถ
The following table indicates with a "*" the options are allowed in
each DHCP message type:
Client Server IA_NA Option Pref Time Relay Auth. Server
ID ID IA_TA Request Msg. Unica.
Solicit * * * * *
Advert. * * * * *
Request * * * * * *
Confirm * * * * *
Renew * * * * * *
Rebind * * * * *
Decline * * * * * *
Release * * * * * *
Reply * * * * * *
Reconf. * * * *
Inform. * (see note) * * *
R-forw. * *
R-repl. * *
NOTE:
Only included in Information-Request messages that are sent
in response to a Reconfigure (see section 19.4.3).
Status Rap. User Vendor Vendor Inter. Recon. Recon.
Code Comm. Class Class Spec. ID Msg. Accept
Solicit * * * * *
Advert. * * * * *
Request * * * *
Confirm * * *
Renew * * * *
Rebind * * * *
Decline * * *
Release * * *
Reply * * * * * *
Reconf. *
Inform. * * * *
R-forw. * * * *
R-repl. * * * *
B. Appearance of Options in the Options Field of DHCP Options ๐
and this one is the matching cheat sheet for where options can sit inside the options field of other options. it's options all the way down, iykyk ๐ช
The following table indicates with a "*" where options can appear in
the options field of other options:
Option IA_NA/ IAADDR Relay Relay
Field IA_TA Forw. Reply
Client ID *
Server ID *
IA_NA/IA_TA *
IAADDR *
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 *
Note: "Relay Forw" / "Relay Reply" options appear in the options
field of the message but may only appear in these messages.
Chair's Address ๐
the working group can be reached through the current chair, Ralph Droms ๐ง
Ralph Droms
Cisco Systems
1414 Massachusetts Avenue
Boxborough, MA 01719
Phone: (978) 936-1674
EMail: rdroms@cisco.com
Authors' Addresses ๐
the people who wrote this thing, with their contact details exactly as published ๐
Jim Bound
Hewlett Packard Corporation
ZK3-3/W20
110 Spit Brook Road
Nashua, NH 03062-2698
USA
Phone: +1 603 884 0062
EMail: Jim.Bound@hp.com
Bernie Volz
116 Hawkins Pond Road
Center Harbor, NH 03226-3103
USA
Phone: +1-508-259-3734
EMail: volz@metrocast.net
Ted Lemon
Nominum, Inc.
950 Charter Street
Redwood City, CA 94043
USA
EMail: Ted.Lemon@nominum.com
Charles E. Perkins
Communications Systems Lab
Nokia Research Center
313 Fairchild Drive
Mountain View, California 94043
USA
Phone: +1-650 625-2986
EMail: charles.perkins@nokia.com
Mike Carney
Sun Microsystems, Inc
17 Network Circle
Menlo Park, CA 94025
USA
Phone: +1-650-786-4171
EMail: michael.carney@sun.com
Full Copyright Statement โญ
the legal bit. it stays word for word, no edits, because it's the actual license terms ๐
Copyright (C) The Internet Society (2003). All Rights Reserved.
This document and translations of it may be copied and furnished to others, and derivative works that comment on or otherwise explain it or assist in its implementation may be prepared, copied, published and distributed, in whole or in part, without restriction of any kind, provided that the above copyright notice and this paragraph are included on all such copies and derivative works. However, this document itself may not be modified in any way, such as by removing the copyright notice or references to the Internet Society or other Internet organizations, except as needed for the purpose of developing Internet standards in which case the procedures for copyrights defined in the Internet Standards process must be followed, or as required to translate it into languages other than English.
The limited permissions granted above are perpetual and will not be revoked by the Internet Society or its successors or assigns.
This document and the information contained herein is provided on an "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
Acknowledgement ๐ซถ
funding for the RFC Editor function is currently provided by the Internet Society, and that's the end of the RFC, bestie ๐๐ฆ๐
๐ฆ where this page comes from
- ietf: rfc3315 2003-07
- ๐ girlified by claude-haiku-5-5 on : a language model's rewrite of the original, under its terms