idnits 2.17.1 draft-ietf-dhc-dhcpv4-bulk-leasequery-06.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- No issues found here. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year == Line 482 has weird spacing: '...ge-size the...' == Line 1594 has weird spacing: '... Name sta...' -- The document date (March 12, 2012) is 4421 days in the past. Is this intentional? Checking references for intended status: Proposed Standard ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) ** Obsolete normative reference: RFC 5226 (Obsoleted by RFC 8126) == Outdated reference: A later version (-13) exists of draft-ietf-dhc-relay-id-suboption-10 -- Obsolete informational reference (is this intentional?): RFC 4614 (Obsoleted by RFC 7414) Summary: 1 error (**), 0 flaws (~~), 4 warnings (==), 2 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 DHC Working Group Kim Kinnear 3 Internet Draft Mark Stapp 4 Intended Status: Standards Track Cisco Systems, Inc. 5 Expires: September 12, 2012 D. Rao 6 B. Joshi 7 Infosys Technologies Ltd. 8 Neil Russell 9 BMC Software, Inc. 10 March 12, 2012 12 Bulk DHCPv4 Lease Query 13 15 Status of this Memo 17 This Internet-Draft is submitted to IETF in full conformance with the 18 provisions of BCP 78 and BCP 79. 20 Internet-Drafts are working documents of the Internet Engineering 21 Task Force (IETF), its areas, and its working groups. Note that 22 other groups may also distribute working documents as Internet- 23 Drafts. 25 Internet-Drafts are draft documents valid for a maximum of six months 26 and may be updated, replaced, or obsoleted by other documents at any 27 time. It is inappropriate to use Internet-Drafts as reference 28 material or to cite them other than as "work in progress." 30 The list of current Internet-Drafts can be accessed at 31 http://www.ietf.org/ietf/1id-abstracts.txt. 33 The list of Internet-Draft Shadow Directories can be accessed at 34 http://www.ietf.org/shadow.html. 36 Copyright Notice 38 Copyright (c) 2012 IETF Trust and the persons identified as the 39 document authors. All rights reserved. 41 This document is subject to BCP 78 and the IETF Trust's Legal 42 Provisions Relating to IETF Documents 43 (http://trustee.ietf.org/license-info) in effect on the date of 44 publication of this document. Please review these documents 45 carefully, as they describe your rights and restrictions with respect 46 to this document. Code Components extracted from this document must 47 include Simplified BSD License text as described in Section 4.e of 48 the Trust Legal Provisions and are provided without warranty as 49 described in the Simplified BSD License. 51 Abstract 53 The Dynamic Host Configuration Protocol for IPv4 (DHCPv4) Leasequery 54 extension allows a requestor to request information about DHCPv4 55 bindings. This mechanism is limited to queries for individual 56 bindings. In some situations individual binding queries may not be 57 efficient, or even possible. This document extends the DHCPv4 58 Leasequery protocol to allow for bulk transfer of DHCPv4 address 59 binding data via TCP. 61 Table of Contents 63 1. Introduction................................................. 3 64 2. Terminology.................................................. 4 65 3. Design Goals................................................. 7 66 3.1. Information Acquisition before Data Starts................. 7 67 3.2. Lessen need for Caching and Negative Caching............... 7 68 3.3. Antispoofing in 'Fast Path'................................ 8 69 3.4. Minimize data transmission................................. 8 70 4. Protocol Overview............................................ 8 71 5. Interaction Between UDP Leasequery and Bulk Leasequery....... 10 72 6. Message and Option Definitions............................... 10 73 6.1. Message Framing for TCP.................................... 10 74 6.2. New or Changed Options..................................... 11 75 6.3. Connection and Transmission Parameters..................... 19 76 7. Requestor Behavior........................................... 19 77 7.1. Connecting and General Processing.......................... 19 78 7.2. Forming a Bulk Leasequery.................................. 20 79 7.3. Processing Bulk Replies.................................... 22 80 7.4. Processing Time Values in Leasequery messages.............. 24 81 7.5. Querying Multiple Servers.................................. 25 82 7.6. Making Sense Out of Multiple Responses Concerning a Single. 25 83 7.7. Multiple Queries to a Single Server over One Connection.... 26 84 7.8. Closing Connections........................................ 27 85 8. Server Behavior.............................................. 27 86 8.1. Accepting Connections...................................... 27 87 8.2. Replying to a Bulk Leasequery.............................. 28 88 8.3. Building a Single Reply for Bulk Leasequery................ 31 89 8.4. Multiple or Parallel Queries............................... 32 90 8.5. Closing Connections........................................ 33 91 9. Security Considerations...................................... 33 92 10. IANA Considerations......................................... 34 93 11. Contributing Authors........................................ 36 94 12. Acknowledgements............................................ 37 95 13. References.................................................. 37 96 13.1. Normative References...................................... 37 97 13.2. Informative References.................................... 38 99 1. Introduction 101 The DHCPv4 protocol [RFC2131] [RFC2132] specifies a mechanism for the 102 assignment of IPv4 address and configuration information to IPv4 103 nodes. DHCPv4 servers maintain authoritative binding information. 105 +--------+ 106 | DHCPv4 | +--------------+ 107 | Server |-...-| DSLAM | 108 | | | Relay Agent | 109 +--------+ +--------------+ 110 | | 111 +------+ +------+ 112 |Modem1| |Modem2| 113 +------+ +------+ 114 | | | 115 +-----+ +-----+ +-----+ 116 |Node1| |Node2| |Node3| 117 +-----+ +-----+ +-----+ 119 Figure 1: Example DHCPv4 configuration 121 DHCPv4 relay agents receive DHCPv4 messages and frequently append a 122 relay agent information option [RFC3046] before relaying them to the 123 configured DHCPv4 servers (see Figure 1). In this process, some relay 124 agents also glean lease information sent by the server and cache it 125 locally. This information is used for a variety of purposes. Two 126 examples are prevention of spoofing attempts from the DHCPv4 clients, 127 and installation of routes. When a relay agent reboots, this 128 information is frequently lost. 130 The DHCPv4 Leasequery capability [RFC4388] extends the basic DHCPv4 131 capability to allow an external entity, such as a relay agent, to 132 query a DHCPv4 server to recover lease state information about a 133 particular IP address or client in near real-time. 135 The existing query types in Leasequery are typically data driven; the 136 relay agent initiates the Leasequery when it receives data traffic 137 from or to the client. This approach may not scale well when there 138 are thousands of clients connected to the relay agent or when the 139 relay agent has a need to rebuild its internal data store prior to 140 processing traffic in one direction or another. 142 Some applications require the ability to query the server without 143 waiting for traffic from or to clients. This query capability in turn 144 requires an underlying transport more suitable to the bulk 145 transmission of data. 147 This document extends the DHCPv4 Leasequery protocol to add support 148 for queries that address these additional requirements. There may be 149 many thousands of DHCPv4 bindings returned as the result of a single 150 request, so TCP [RFC4614] is specified for efficiency of data 151 transfer. We define several additional query types, each of which 152 can return multiple responses, in order to meet a variety of 153 requirements. 155 2. Terminology 157 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 158 "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and 159 "OPTIONAL" in this document are to be interpreted as described in RFC 160 2119 [RFC2119]. 162 This document uses the following terms: 164 o "absolute time" 166 A 32-bit quantity containing the number of seconds since Jan 1, 167 1970. 169 o "access concentrator" 171 An access concentrator is a router or switch at the broadband 172 access provider's edge of a public broadband access network. 173 This document assumes that the access concentrator includes the 174 DHCPv4 relay agent functionality. For example, a CMTS (Cable 175 Modem Termination System) in Cable environment or a DSLAM 176 (Digital Subscriber Line Access Multiplexer) in a DSL 177 environment. 179 o "active binding" 181 An IP address with an active binding refers to an IP address 182 which is currently associated with a DHCPv4 client where that 183 DHCPv4 client has the right to use the IP address. 185 o "Bulk Leasequery" 187 Requesting and receiving the existing DHCPv4 address binding 188 information in an efficient manner. 190 o "clock skew" 192 The difference between the absolute time on a DHCPv4 server and 193 the absolute time on the system where a requestor of a Bulk 194 Leasequery is executing is termed the "clock skew" for that Bulk 195 Leasequery connection. It is not absolutely constant but is 196 likely to vary only slowly. It is possible that, when both 197 systems run NTP, the clock skew is negligible, and this is not 198 only acceptable, but desired. 200 While it is easy to think that this can be calculated precisely 201 after one message is received by a requestor from a DHCPv4 202 server, a more accurate value is derived from continuously 203 examining the instantaneous value developed from each message 204 received from a DHCPv4 server and using it to make small 205 adjustments to the existing value held in the requestor. 207 o "Default VPN" 209 Indicates that the address being described belongs to the set of 210 addresses not part of any VPN. In other words, the normal 211 address space operated on by DHCP. This includes private 212 addresses, for example the 10.x.x.x addresses as well as the 213 other private subnets that are not routed on the open internet. 215 o "DHCPv4 client" 217 A DHCPv4 client is an Internet node using DHCPv4 to obtain 218 configuration parameters such as a network address. 220 o "DHCPv4 relay agent" 222 A DHCPv4 relay agent is a third-party agent that transfers BOOTP 223 and DHCPv4 messages between clients and servers residing on 224 different subnets, per [RFC951] and [RFC1542]. 226 o "DHCPv4 server" 228 A DHCPv4 server is an Internet node that returns configuration 229 parameters to DHCPv4 clients. 231 o "DSLAM" 233 Digital Subscriber Line Multiplexer. 235 o "downstream" 237 Refers to a direction away from the central part of a network 238 and toward the edge. In a DHCPv4 context, typically refers to a 239 network direction which is away from the DHCPv4 server. 241 o "Global VPN" 243 Another name for the "Default VPN". 245 o "IP address" 247 In this document, the term "IP address" refers to an IPv4 IP 248 address. 250 o "IP address binding" 252 The information that a DHCPv4 server keeps regarding the 253 relationship between a DHCPv4 client and an IP address. This 254 includes the identity of the DHCPv4 client and the expiration 255 time, if any, of any lease that client has on a particular IP 256 address. In some contexts, this may include information on IP 257 addresses that are currently associated with DHCPv4 clients, and 258 in others it may also include IP addresses with no current 259 association to a DHCPv4 client. 261 o "MAC address" 263 In the context of a DHCPv4 message, a MAC address consists of 264 the fields: hardware type "htype", hardware length "hlen", and 265 client hardware address "chaddr". 267 o "upstream" 269 Refers to a direction toward the central part of a network and 270 away from the edge. In a DHCPv4 context, typically refers to a 271 network direction which is toward the DHCPv4 server. 273 o "stable storage" 274 Stable storage is used to hold information concerning IP address 275 bindings (among other things) so that this information is not 276 lost in the event of a failure which requires restart of the 277 network element. DHCPv4 servers are typically expected to have 278 high speed access to stable storage, while relay agents and 279 access concentrators usually do not have access to stable 280 storage, although they may have periodic access to such storage. 282 o "xid" 284 Transaction-id. The term "xid" refers to the DHCPv4 field 285 containing the transaction-id of the message. 287 3. Design Goals 289 The goal of this document is to provide a lightweight mechanism for 290 an Access Concentrator or other network element to retrieve IP 291 address binding information available in the DHCPv4 server. The 292 mechanism should also allow an Access Concentrator to retrieve 293 consolidated IP address binding information for either the entire 294 access concentrator or a single connection/circuit. 296 3.1. Information Acquisition before Data Starts 298 The existing data driven approach required by [RFC4388] means that 299 the Leasequeries can only be performed after an Access Concentrator 300 receives data. To implement antispoofing, the concentrator must drop 301 messages for each client until it gets lease information from the 302 DHCPv4 server for that client. If an Access Concentrator finishes the 303 Leasequeries before it starts receiving data, then there is no need 304 to drop legitimate messages. In this way, outage time may be reduced. 306 3.2. Lessen need for Caching and Negative Caching 308 The result of a single Leasequery should be cached, whether that 309 results in a positive or negative cache, in order to remember that 310 the Leasequery was performed. This caching is required to limit the 311 traffic imposed upon a DHCPv4 server by Leasequeries for information 312 already received. 314 These caches not only consume precious resources, they also need to 315 be managed. Hence they should be avoided as much as possible. 317 3.3. Antispoofing in 'Fast Path' 319 If Antispoofing is not done in the fast path, it will become a 320 bottleneck and may lead to denial of service of the access 321 concentrator. The Leasequeries should make it possible to do 322 antispoofing in the fast path. 324 3.4. Minimize data transmission 326 It may be that a network element is able to periodically save its 327 entire list of assigned IP addresses to some form of stable storage. 328 In this case, it will wish to recover all of the updates to this 329 information without duplicating the information it has recovered from 330 its own stable storage. 332 Bulk Leasequery allows the specification of a query-start-time as 333 well as a query-end-time. Use of query-times allows a network 334 element that periodically commits information to stable storage to 335 recover just what it lost since the last commit. 337 4. Protocol Overview 339 The DHCPv4 Bulk Leasequery mechanism is modeled on the existing 340 individual DHCPv4 Leasequery protocol in [RFC4388] as well as related 341 work on DHCPv6 Bulk Leasequery [RFC5460]. A Bulk Leasequery requestor 342 opens a TCP connection to a DHCPv4 Server, using the DHCPv4 port 67. 343 Note that this implies that the Leasequery requestor has server IP 344 address(es) available via configuration or some other means, and that 345 it has unicast IP reachability to the DHCPv4 server. No relaying of 346 Bulk Leasequery messages is specified. 348 After establishing a connection, the requestor sends a 349 DHCPBULKLEASEQUERY message over the connection. 351 The server uses the message type and additional data in the DHCPv4 352 DHCPBULKLEASEQUERY message to identify any relevant bindings. 354 In order to support some query types, servers may have to maintain 355 additional data structures or otherwise be able to locate bindings 356 that have been requested by the Leasequery requestor. 358 Relevant bindings are returned in DHCPv4 messages with either the 359 DHCPLEASEACTIVE message type for an IP address with a currently 360 active lease or, in some situations, a DHCPLEASEUNASSIGNED message 361 type for an IP address which is controlled by the DHCPv4 server but 362 which is not actively leased by a DHCPv4 client at the present time. 364 The Bulk Leasequery mechanism is designed to provide an external 365 entity with information concerning existing DHCPv4 IPv4 address 366 bindings managed by the DHCPv4 server. When complete, the DHCPv4 367 server will send a DHCPLEASEQUERYDONE message. If a connection is 368 lost while processing a Bulk Leasequery, the Bulk Leasequery must be 369 retried as there is no provision for determining the extent of data 370 already received by the requestor for a Bulk Leasequery. 372 Bulk Leasequery supports queries by MAC address and by Client 373 Identifier in a way similar to [RFC4388]. The Bulk Leasequery 374 protocol also adds several new queries. 376 o Query by Relay Identifier 378 This query asks a server for the bindings associated with a 379 specific relay agent; the relay agent is identified by a DUID 380 carried in a Relay-ID sub-option [RelayId]. Relay agents can 381 include this sub-option while relaying messages to DHCPv4 382 servers. Servers can retain the Relay-ID and associate it with 383 bindings made on behalf of the relay agent's clients. The 384 bindings returned are only those for DHCPv4 clients with a 385 currently active binding. 387 o Query by Remote ID 389 This query asks a server for the bindings associated with a 390 Relay Agent Remote-ID sub-option [RFC3046] value. The bindings 391 returned are only those for DHCPv4 clients with a currently 392 active binding. 394 o Query for All Configured IP Addresses 396 This query asks a server for information concerning all IP 397 addresses configured in that DHCPv4 server, by specifying no 398 other type of query. In this case, the bindings returned are for 399 all configured IP addresses, whether or not they contain a 400 currently active binding to a DHCPv4 client, since one point of 401 this type of query is to update an existing database with 402 changes after a particular point in time. 404 Any of the above queries can be qualified by the specification of a 405 query-start-time or a query-end-time (or both). When these timers are 406 used as qualifiers, they indicate that a binding should be included 407 if it changed on or after the query-start-time and on or before the 408 query-end-time. 410 In addition, any of the above queries can be qualified by the 411 specification of a vpn-id option [VpnId] to select the VPN on which 412 the query should be processed. The vpn-id option is also extended to 413 allow queries across all available VPNs. In the absence of any vpn-id 414 option, only the default (global) VPN is used to satisfy the query. 416 5. Interaction Between UDP Leasequery and Bulk Leasequery 418 Bulk Leasequery can be seen as an extension of the existing UDP 419 Leasequery protocol [RFC4388]. This section clarifies the 420 relationship between the two protocols. 422 Only the DHCPBULKLEASEQUERY request is supported over the Bulk 423 Leasequery connection. No other DHCPv4 requests are supported. The 424 Bulk Leasequery connection is not an alternative DHCPv4 communication 425 option for clients seeking other DHCPv4 services. 427 Two of the query-types introduced in the UDP Leasequery protocol can 428 be used in the Bulk Leasequery protocol -- query by MAC address and 429 query by client-id. 431 The contents of the reply messages are similar between the existing 432 UDP Leasequery protocol and the Bulk Leasequery protocol, though more 433 information is returned in the Bulk Leasequery messages. 435 One change in behavior for these existing queries is required when 436 Bulk Leasequery is used. [RFC4388], in sections 6.1, 6.4.1, and 437 6.4.2 specifies the use of an associated-ip option in DHCPLEASEACTIVE 438 messages in cases where multiple bindings were found. When Bulk 439 Leasequery is used, this mechanism is not necessary; a server 440 returning multiple bindings simply does so directly as specified in 441 this document. The associated-ip option MUST NOT appear in Bulk 442 Leasequery replies. 444 Implementors should note that the TCP message framing defined in 445 Section 4.1 is not compatible with the UDP message format. If a TCP- 446 framed request is sent as a UDP message, it may not be valid, because 447 protocol fields will be offset by the message-size prefix. 449 6. Message and Option Definitions 451 6.1. Message Framing for TCP 453 The use of TCP for the Bulk Leasequery protocol permits multiple 454 messages to be sent from one end of the connection to the other 455 without requiring a request/response paradigm as does UDP DHCPv4 457 [RFC2131]. The receiver needs to be able to determine the size of 458 each message it receives. Two octets containing the message size in 459 network byte-order are prepended to each DHCPv4 message sent on a 460 Bulk Leasequery TCP connection. The two message-size octets 'frame' 461 each DHCPv4 message. 463 The maximum message size is 65535 octets. 465 DHCPv4 message framed for TCP: 467 0 1 2 3 468 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 469 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 470 | message-size | op (1) | htype (1) | 471 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 472 | hlen (1) | hops (1) | .... | 473 +---------------+---------------+ + 474 | | 475 . remainder of DHCPv4 message, 476 . from Figure 1 of [RFC2131] . 477 . . 478 . (variable) . 479 | | 480 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 482 message-size the number of octets in the message that 483 follows, as a 16-bit integer in network 484 byte-order. 486 All other fields are as specified in DHCPv4 [RFC2131]. 488 Figure 2: Format of a DHCPv4 message in TCP 490 The intent in using this format is that code which currently knows 491 how to deal with sending or receiving a message in [RFC2131] format 492 will easily be able to deal with the message contained in the TCP 493 framing. 495 6.2. New or Changed Options 497 The existing messages DHCPLEASEUNASSIGNED and DHCPLEASEACTIVE are 498 used as the value of the dhcp-message-type option to indicate an IP 499 address which is currently not leased or currently leased to a DHCPv4 500 client, respectively [RFC4388]. 502 Additional options have also been defined to enable the Bulk 503 Leasequery protocol to communicate useful information to the 504 requestor. 506 6.2.1. dhcp-message-type 508 The dhcp-message-type option (option 53) from Section 9.6 of 509 [RFC2132] requires new values. The values of these message types are 510 shown below in an extension of the table from Section 9.6 of 511 [RFC2132]: 513 Value Message Type 514 ----- ------------ 515 TBD8 DHCPBULKLEASEQUERY 516 TBD9 DHCPLEASEQUERYDONE 518 6.2.2. status-code 520 The status code option allows a machine readable value to be returned 521 regarding the status of a DHCPBULKLEASEQUERY request. 523 This option has two possible scopes when used with Bulk Leasequery, 524 depending on the context in which it appears. It refers to the 525 information in a single Leasequery reply if the value of the dhcp- 526 message-type is DHCPLEASEACTIVE or DHCPLEASEUNASSIGNED. It refers to 527 the message stream related to an entire request if the value of the 528 dhcp-message-type is DHCPLEASEQUERYDONE. 530 The code for this option is TBD1. The length of this option is a 531 minimum of 1 octet. 533 Status Status 534 Code Len Code Message 535 +------+------+------+------+------+-- --+-----+ 536 | TBD1 | n+1 |status| s1 | s2 | ... | sn | 537 +------+------+------+------+------+-- --+-----+ 539 The status-code is an octet defined in the table below. The Status 540 Message is an optional UTF-8 encoded text string suitable for display 541 to an end user, which MUST NOT be null-terminated. 543 Name Status Code Description 544 ---- ----------- ----------- 545 Success 000 Success. Also signaled by absence of 546 a status-code option. 548 UnspecFail 001 Failure, reason unspecified. 550 QueryTerminated 002 Indicates that the server is unable to 551 perform a query or has prematurely terminated 552 the query for some reason (which should be 553 communicated in the text message). 555 MalformedQuery 003 The query was not understood. 557 NotAllowed 004 The query or request was understood but was 558 not allowed in this context. 560 A status-code option MAY appear in the options field of a DHCPv4 561 message. If the status-code option does not appear, it is assumed 562 that the operation was successful. The status-code option SHOULD NOT 563 appear in a message which is successful unless there is some text 564 string that needs to be communicated to the requestor. 566 6.2.3. base-time 568 The base-time option is the current time the message was created to 569 be sent by the DHCPv4 server to the requestor of the Bulk Leasequery. 570 This MUST be an absolute time. All of the other time based options in 571 the reply message are relative to this time, including the dhcp- 572 lease-time [RFC2132] and client-last-transaction-time [RFC4388]. 573 This time is in the context of the DHCPv4 server who placed this 574 option in a message. 576 This is an integer in network byte order. 578 The code for this option is TBD2. The length of this option is 4 579 octets. 581 DHCPv4 Server 582 Code Len base-time 583 +-----+-----+-----+-----+-----+-----+ 584 | TBD2| 4 | t1 | t2 | t3 | t4 | 585 +-----+-----+-----+-----+-----+-----+ 587 6.2.4. start-time-of-state 589 The start-time-of-state option allows the receiver to determine the 590 time at which the IP address made the transition into its current 591 state. 593 This MUST NOT be an absolute time, which is equivalent to saying that 594 this MUST NOT be an absolute number of seconds since Jan 1, 1970. 595 Instead, this MUST be the integer number of seconds from the time the 596 IP address transitioned its current state to the time specified in 597 the base-time option in the same message. 599 This is an integer in network byte order. 601 The code for this option is TBD3. The length of this option is 4 602 octets. 604 Seconds in the past 605 Code Len from base-time 606 +-----+-----+-----+-----+-----+-----+ 607 | TBD3| 4 | t1 | t2 | t3 | t4 | 608 +-----+-----+-----+-----+-----+-----+ 610 6.2.5. query-start-time 612 The query-start-time option specifies a start query time to the 613 DHCPv4 server. If specified, only bindings that have changed on or 614 after the query-start-time should be included in the response to the 615 query. 617 The requestor MUST determine the query-start-time using lease 618 information it has received from the DHCPv4 server. This MUST be an 619 absolute time in the DHCPv4 server's context (see Section 7.4). 621 Typically (though this is not a requirement) the query-start-time 622 option will contain the value most recently received in a base-time 623 option by the requestor, as this will indicate the last successful 624 communication with the DHCP server. 626 This MUST be an absolute time. 628 This is an integer in network byte order. 630 The code for this option is TBD4. The length of this option is 4 631 octets. 633 DHCPv4 Server 634 Code Len query-start-time 635 +-----+-----+-----+-----+-----+-----+ 636 | TBD4| 4 | t1 | t2 | t3 | t4 | 637 +-----+-----+-----+-----+-----+-----+ 639 6.2.6. query-end-time 641 The query-end-time option specifies an end query time to the DHCPv4 642 server. If specified, only bindings that have changed on or before 643 the query-end-time should be included in the response to the query. 645 The requestor MUST determine the query-end-time based on lease 646 information it has received from the DHCPv4 server. This MUST be an 647 absolute time in the context of the DHCPv4 server. 649 In the absence of information to the contrary, the requestor SHOULD 650 assume that the time context of the DHCPv4 server is identical to the 651 time context of the requestor (see Section 7.4). 653 This is an integer in network byte order. 655 The code for this option is TBD5. The length of this option is 4 656 octets. 658 DHCPv4 Server 659 Code Len query-end-time 660 +-----+-----+-----+-----+-----+-----+ 661 | TBD5| 4 | t1 | t2 | t3 | t4 | 662 +-----+-----+-----+-----+-----+-----+ 664 6.2.7. dhcp-state 666 The dhcp-state option allows greater detail to be returned than 667 allowed by the DHCPLEASEACTIVE and DHCPLEASEUNASSIGNED message types. 669 The code for this option is TBD6. The length of this option is 1 670 octet. 672 0 1 2 673 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 674 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 675 | TBD6 | Length | State | 676 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 678 TBD6 The option code. 680 Length The option length, 1 octet. 682 State The State of the IP address. 684 Value State 685 ----- ----- 686 1 AVAILABLE Address is available to local DHCPv4 server 687 2 ACTIVE Address is assigned to a DHCPv4 client 688 3 EXPIRED Lease has expired 689 4 RELEASED Lease has been released by DHCPv4 client 690 5 ABANDONED Server or client flagged address as unusable 691 6 RESET Lease was freed by some external agent 692 7 REMOTE Address is available to a remote DHCPv4 server 693 8 TRANSITIONING Address is moving between states 695 Note that some of these states may be transient and may not appear in 696 normal use. A DHCPv4 server MUST implement at least the AVAILABLE 697 and ACTIVE states, and SHOULD implement at least the ABANDONED and 698 RESET states. 700 Note the states AVAILABLE and REMOTE are relative to the current 701 server. An address that is available to the current server should 702 show AVAILABLE on that server, and if another server is involved with 703 that address as well, on that other server it should show as REMOTE. 705 The dhcp-state option SHOULD contain ACTIVE when it appears in a 706 DHCPLEASEACTIVE message. A DHCPv4 server MAY choose to not send a 707 dhcp-state option in a DHCPLEASEACTIVE message, and a requestor 708 SHOULD assume that the dhcp-state is ACTIVE if no dhcp-state option 709 appears in a DHCPLEASEACTIVE message. 711 The reference to local and remote relate to possible use in an 712 environment that includes multiple servers cooperating to provide an 713 increased availability solution. In this case, an IP address with 714 the state of AVAILABLE is available to the local server, while one 715 with the state of REMOTE is available to a remote server. Usually, 716 an IP address which is AVAILABLE on one server would be REMOTE on any 717 remote server. The TRANSITIONING state is also likely to be useful 718 in multiple server deployments, where sometimes one server must 719 interlock a state change with one or more other servers. Should a 720 Bulk Leasequery need to send information concerning the state of the 721 IP address during this period, it SHOULD use the TRANSITIONING state, 722 since the IP address is likely to be neither ACTIVE or AVAILABLE. 724 There is no requirement for the state of an IP address to transition 725 in a well defined way from state to state. To put this another way, 726 you cannot draw a simple state transition graph for the states of an 727 IP address and the requestor of a Leasequery MUST NOT depend on one 728 certain state always following a particular previous state. In 729 general, every state can (at times) follow every other state. 731 6.2.8. data-source 733 The data-source option contains information about the source of the 734 data in a DHCPLEASEACTIVE or a DHCPLEASEUNASSIGNED message. It 735 SHOULD be used when there are two or more servers who might have 736 information about a particular IP address binding. Frequently two 737 servers work together to provide an increased availability solution 738 for the DHCPv4 service, and in these cases, both servers will respond 739 to Bulk Leasequery requests for the same IP address. When one server 740 is working with another server and both may respond with information 741 about the same IP address, each server SHOULD return the data-source 742 option with the other information provided about the IP address. 744 The data contained in this option will allow an external process to 745 better discriminate between the information provided by each of the 746 servers servicing this IPv4 address. 748 The code for this option is TBD7. The length of this option is 1 749 octet. 751 0 1 2 752 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 753 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 754 | TBD7 | Length | Flags | 755 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 757 TBD7 The option code. 759 Length The option length, 1 octet. 761 Flags The Source information for this message. 763 0 1 2 3 4 5 6 7 764 +-+-+-+-+-+-+-+-+ 765 | MBZ |R| 766 +-+-+-+-+-+-+-+-+ 768 R: REMOTE flag 770 remote = 1 771 local = 0 773 MBZ: MUST BE ZERO (reserved for future use) 775 The REMOTE flag is used to indicate where the most recent change of 776 state (or other interesting change) concerning this IPv4 address took 777 place. If the value is local, then the change took place on the 778 server from which this message was transmitted. If the value is 779 remote, then the change took place on some other server, and was made 780 known to the server from which this message was transmitted. 782 If this option was requested and it doesn't appear, the requestor 783 MUST consider that the data-source was local. 785 6.2.9. Virtual Subnet Selection Type and Information 787 All of the (sub)options defined in [VpnId] carry identical payloads, 788 consisting of a type and additional VSS (Virtual Subnet Selection) 789 information. The existing table is extended (see below) with a new 790 type 254 to allow specification of a type code which indicates that 791 all VPN's are to be used to process the Bulk Leasequery. 793 Type VSS Information format: 794 ---- ----------------------- 795 0 UTF-8 ASCII VPN identifier 796 1 RFC 2685 VPN-ID 797 CHANGED -> 2-253 Not Allowed 798 NEW -> 254 All VPN's (wildcard) 799 255 Global, default VPN 801 6.3. Connection and Transmission Parameters 803 DHCPv4 servers that support Bulk Leasequery SHOULD listen for 804 incoming TCP connections on the DHCPv4 server port 67. 805 Implementations MAY offer to make the incoming port configurable, but 806 port 67 MUST be the default. Requestors SHOULD make TCP connections 807 to port 67, and MAY offer to make the destination server port 808 configurable. 810 This section presents a table of values used to control Bulk 811 Leasequery behavior, including recommended defaults. Implementations 812 MAY make these values configurable. However, configuring too-small 813 timeout values may lead to harmful behavior both to this application 814 as well as to other traffic in the network. As a result, timeout 815 values smaller than the default values are NOT RECOMMENDED. 817 Parameter Default Description 818 ------------------------------------------- 819 BULK_LQ_DATA_TIMEOUT 300 secs Bulk Leasequery data timeout 820 for both client and server 821 (see Sections 7 and 8) 822 BULK_LQ_MAX_CONNS 10 Max Bulk Leasequery TCP connections 823 at the server side (see Section 8.1) 825 7. Requestor Behavior 827 7.1. Connecting and General Processing 829 A Requestor attempts to establish a TCP connection to a DHCPv4 Server 830 in order to initiate a Leasequery exchange. If the attempt fails, 831 the Requestor MAY retry. 833 If Bulk Leasequery is terminated prematurely by a DHCPLEASEQUERYDONE 834 with a status-code option with a status-code of QueryTerminated or by 835 the failure of the connection over which it was being submitted, the 836 requestor MAY retry the request after the creation of a new 837 connection. 839 Messages from the DHCPv4 server come as multiple responses to a 840 single DHCPBULKLEASEQUERY message. Thus, each DHCPBULKLEASEQUERY 841 request MUST have an xid (transaction-id) unique on the connection on 842 which it is sent. All of the messages which come as a response to 843 that message will contain the same xid as the request. It is the xid 844 which allows the data-streams of two different DHCPBULKLEASEQUERY 845 requests to be demultiplexed by the requestor. 847 7.2. Forming a Bulk Leasequery 849 Bulk Leasequery is designed to create a connection which will 850 transfer the state of some subset (or possibly all) of the IP address 851 bindings from the DHCPv4 server to the requestor. The DHCPv4 server 852 will send all of the requested IPv4 address bindings across this 853 connection with minimal delay after it receives the request. In this 854 context, "all IP address binding information" means information about 855 all IPv4 addresses configured within the DHCPv4 server which meet the 856 specified query criteria. For some query criteria, this may include 857 IP address binding information for IP addresses which may not now 858 have or ever had have an association with a specific DHCPv4 client. 860 To form the Bulk query, a DHCPv4 request is constructed with a dhcp- 861 message-type of DHCPBULKLEASEQUERY. The query SHOULD have a dhcp- 862 parameter-request-list to inform the DHCPv4 server which DHCPv4 863 options are of interest to the requestor sending the 864 DHCPBULKLEASEQUERY message. The dhcp-parameter-request-list in a 865 DHCPBULKLEASEQUERY message SHOULD contain the codes for base-time, 866 dhcp-lease-time, start-time-of-state, and client-last-transaction- 867 time. 869 A DHCPBULKLEASEQUERY request is constructed of one primary query and 870 optionally one or more qualifiers for it. 872 The possible primary queries are listed below. Each 873 DHCPBULKLEASEQUERY request MUST contain only one of these primary 874 queries. 876 o Query by MAC address 878 In a Query by MAC address, the chaddr, htype, and hlen of the 879 DHCPv4 packet are filled in with the values requested. 881 o Query by Client-Id 882 In a Query by Client-Id, a dhcp-client-id option containing the 883 requested value is included in the DHCPBULKLEASEQUERY request. 885 o Query by Remote-Id 887 In a Query by Remote-Id, a remote-id sub-option containing the 888 requested value is included in the relay-agent-information 889 option of the DHCPBULKLEASEQUERY request. 891 o Query by Relay-Id 893 In a Query by Relay-Id, a relay-id sub-option [RelayId] 894 containing the requested value is included in the relay-agent- 895 information option of the DHCPBULKLEASEQUERY request. 897 o Query for All Configured IP Addresses 899 A Query for All Configured IP addresses is signaled by the 900 absence of any other primary query. 902 There are three qualifiers which can be applied to any of the above 903 primary queries. These qualifiers can appear individually or 904 together in any combination, but only one of each can appear. 906 o Query Start Time 908 Inclusion of a query-start-time option specifies that only IP 909 address bindings which have changed on or after the time specified 910 in the query-start-time option should be returned. 912 o Query End Time 914 Inclusion of a query-end-time option specifies that only IP address 915 bindings which have changed on or before the time specified in the 916 query-end-time option should be returned. 918 o VPN Id 920 If no vpn-id option appears in the DHCPBULKLEASEQUERY, the default 921 (global) VPN is searched to satisfy the query specified by the 922 DHCPBULKLEASEQUERY. Using the vpn-id option [VpnId] allows the 923 requestor to specify a single VPN other than the default VPN. In 924 addition, the vpn-id option has been extended as part of this 925 document to allow specification that all configured VPN's be 926 searched in order to satisfy the query specified in the 927 DHCPBULKLEASEQUERY. 929 In all cases, any message returned from a DHCPBULKLEASEQUERY 930 request containing information about an IP address for other than 931 the default (global) VPN MUST contain a vpn-id option in the 932 message. 934 Use of the query-start-time or the query-end-time options or both can 935 serve to reduce the amount of data transferred over the TCP 936 connection by a considerable amount. 938 The TCP connection may become blocked or stop being writable while 939 the requestor is sending its query. Should this happen, the 940 implementation's behavior is controlled by the current value of 941 BULK_LQ_DATA_TIMEOUT. The default value is given elsewhere in this 942 document, and this value may be overridden by local configuration of 943 the operator. 945 If this situation is detected, the requestor SHOULD start a timer 946 using the current value of BULK_LQ_DATA_TIMEOUT. If that timer 947 expires, the requestor SHOULD terminate the connection. 949 7.3. Processing Bulk Replies 951 The requestor attempts to read a DHCPv4 Leasequery reply message from 952 the TCP connection. 954 The TCP connection may stop delivering reply data (i.e., the 955 connection stops being readable). Should this happen, the 956 implementation's behavior is controlled by the current value of 957 BULK_LQ_DATA_TIMEOUT. The default value is given elsewhere in this 958 document, and this value may be overridden by local configuration of 959 the operator. 961 If this situation is detected, the requestor SHOULD start a timer 962 using the current value of BULK_LQ_DATA_TIMEOUT. If that timer 963 expires, the requestor SHOULD terminate the connection. 965 A single Bulk Leasequery can and usually will result in a large 966 number of replies. The requestor MUST be prepared to receive more 967 than one reply with an xid matching a single DHCPBULKLEASEQUERY 968 message from a single DHCPv4 server. If the xid in the received 969 message does not match an outstanding DHCPBULKLEASEQUERY message, the 970 requestor MUST close the TCP connection. 972 The DHCPv4 server MUST send a server-identifier option (option 54) in 973 the first response to any DHCPBULKLEASEQUERY message. The DHCPv4 974 server SHOULD NOT send server identifier options in subsequent 975 responses to that DHCPBULKLEASEQUERY message. The requestor MUST 976 cache the server-identifier option from the first response and apply 977 it to any subsequent responses. 979 The response messages generated by a DHCPBULKLEASEQUERY request are: 981 o DHCPLEASEACTIVE 983 A Bulk Leasequery will generate DHCPLEASEACTIVE messages 984 containing binding data for bound IP addresses which match the 985 specified query criteria. The IP address which is bound to a 986 DHCPv4 client will appear in the ciaddr field of the 987 DHCPLEASEACTIVE message. The message may contain a non-zero 988 chaddr, htype, and hlen and possibly additional options. 990 o DHCPLEASEUNASSIGNED 992 Some queries will also generate DHCPLEASEUNASSIGNED messages for 993 IP addresses which match the query criteria. These messages 994 indicate that the IP address is managed by the DHCPv4 server but 995 is not currently bound to any DHCPv4 client. The IP address to 996 which this message refers will appear in the ciaddr field of the 997 DHCPLEASEUNASSIGNED message. A DHCPLEASEUNASSGINED message MAY 998 also contain information about the last DHCPv4 client that was 999 bound to this IP address. The message may contain a non-zero 1000 chaddr, htype, and hlen and possibly additional options in this 1001 case. 1003 o DHCPLEASEQUERYDONE 1005 A response of DHCPLEASEQUERYDONE indicates that the server has 1006 completed its response to the query, and that no more messages 1007 will be sent in response to the DHCPBULKLEASEQUERY. More details 1008 will sometimes be available in the received status-code option 1009 in the DHCPLEASEQUERYDONE message. If there is no status-code 1010 option in the DHCPLEASEQUERYDONE message, then the query 1011 completed successfully. 1013 Note that a query which returned no data, that is a 1014 DHCPBULKLEASEQUERY request followed by a DHCPLEASEQUERYDONE 1015 response, is considered a successful query in that no errors 1016 occurred during the processing. It is not considered an error 1017 to have no information to return to a DHCPBULKLEASEQUERY 1018 request. 1020 The DHCPLEASEUNKNOWN message MUST NOT appear in a response to a Bulk 1021 Leasequery. 1023 The requestor MUST NOT assume that there is any inherent order in the 1024 IP address binding information that is sent in response to a 1025 DHCPBULKLEASEQUERY. While the base-time will tend to increase 1026 monotonically (as it is the current time on the DHCPv4 server), the 1027 actual time that any IP address binding information changed is 1028 unrelated to the base-time. 1030 The DHCPLEASEQUERYDONE message always ends a successful 1031 DHCPBULKLEASEQUERY request and any unsuccessful DHCPBULKLEASEQUERY 1032 requests not terminated by a dropped connection. After receiving 1033 DHCPLEASEQUERYDONE from a server, the requestor MAY close the TCP 1034 connection to that server if no other DHCPBULKLEASEQUERY is 1035 outstanding on that TCP connection. 1037 The DHCPv4 Leasequery protocol [RFC4388] uses the associated-ip 1038 option as an indicator that multiple bindings were present in 1039 response to a single DHCPv4 client based query. For Bulk Leasequery, 1040 a separate message is returned for each binding, and so the 1041 associated-ip option is not used. 1043 7.4. Processing Time Values in Leasequery messages 1045 Bulk Leasequery requests may be made to a DHCPv4 server whose 1046 absolute time may not be synchronized with the local time of the 1047 requestor. Thus, there are at least two time contexts in even the 1048 simplest Bulk Leasequery response, and in the situation where 1049 multiple DHCPv4 servers are queried, the situation becomes even more 1050 complex. 1052 If the requestor of a Bulk Leasequery is saving the data returned in 1053 some form, it has a requirement to store a variety of time values, 1054 and some of these will be time in the context of the requestor and 1055 some will be time in the context of the DHCPv4 server. 1057 When receiving a DHCPLEASEACTIVE or DHCPLEASEUNASSIGNED message from 1058 the DHCPv4 server, the message will contain a base-time option. The 1059 time contained in this base-time option is in the context of the 1060 DHCPv4 server. As such, it is an ideal time to save and use as input 1061 to a DHCPBULKLEASEQUERY in the query-start-time or query-end-time 1062 options, should the requestor need to ever issue a DHCPBULKLEASEQUERY 1063 message using those options as part of a later query, since those 1064 options require a time in the context of the DHCPv4 server. 1066 In addition to saving the base-time for possible future use in a 1067 query-start-time or query-end-time option, the base-time is used as 1068 part of the conversion of the other times in the Leasequery message 1069 to values which are meaningful in the context of the requestor. 1071 In systems whose clocks are synchronized, perhaps using NTP, the 1072 clock skew will usually be zero, which is not only acceptable, but 1073 desired. 1075 7.5. Querying Multiple Servers 1077 A Bulk Leasequery requestor MAY be configured to attempt to connect 1078 to and query from multiple DHCPv4 servers in parallel. The DHCPv4 1079 Leasequery specification [RFC4388] includes a discussion about 1080 reconciling binding data received from multiple DHCPv4 servers. 1082 In addition, the algorithm in Section 7.6 should be used. 1084 7.6. Making Sense Out of Multiple Responses Concerning a Single IPv4 1085 Address 1087 Any requestor of an Bulk Leasequery MUST be prepared for multiple 1088 responses to arrive for a particular IPv4 address from multiple 1089 different DHCPv4 servers. The following algorithm SHOULD be used to 1090 decide if the information just received is more up to date (i.e., 1091 better) than the best existing information. In the discussion below, 1092 the information that is received from a DHCPv4 server about a 1093 particular IPv4 address is termed a "record". The times used in the 1094 algorithm below SHOULD have been converted into the requestor's 1095 context and the time comparisons SHOULD be performed in a manner 1096 consistent with the information in Section 7.4. 1098 o If both the existing and the new record contain client-last- 1099 transaction-time information, the record with the later client- 1100 last-transaction-time is considered better. 1102 o If one of the records contains client-last-transaction-time 1103 information and the other one doesn't, then compare the client- 1104 last-transaction-time in the record that contains it against the 1105 other record's start-time-of-state. The record with the later 1106 time is considered better. 1108 o If neither record contains client-last-transaction-time 1109 information, compare their start-time-of-state information. The 1110 record with the later start-time-of-state is considered better. 1112 o If none of the comparisons above yield a clear answer as to 1113 which record is later, then compare the value of the REMOTE flag 1114 from the data-source option for each record. 1116 If the values of the REMOTE flag are different between the two 1117 records, the record with the REMOTE flag value of local is 1118 considered better. 1120 The above algorithm does not necessarily determine which record is 1121 better. In the event that the algorithm is inconclusive with regard 1122 to a record which was just received by the requestor, the requestor 1123 SHOULD use additional information in the two records to make a 1124 determination as to which record is better. 1126 7.7. Multiple Queries to a Single Server over One Connection 1128 Bulk Leasequery requestors may need to make multiple queries in order 1129 to recover binding information. A requestor MAY use a single 1130 connection to issue multiple queries to a server willing to support 1131 them. Each query MUST have a unique xid. 1133 A server SHOULD allow configuration of the number of queries that can 1134 be processed simultaneously over a single connection. A server 1135 SHOULD read the number of queries it is configured to process 1136 simultaneously and only read any subsequent queries as current 1137 queries are processed. 1139 A server that is processing multiple queries simultaneously MUST 1140 interleave replies to the multiple queries within the stream of reply 1141 messages it sends. Requestors need to be aware that replies for 1142 multiple queries may be interleaved within the stream of reply 1143 messages. Requestors that are not able to process interleaved 1144 replies (based on xid) MUST NOT send more than one query over a 1145 single connection prior to the completion of the previous query. 1147 Requestors should be aware that servers are not required to process 1148 more than one query over a connection at a time (the limiting case 1149 for the configuration described above), and that servers are likely 1150 to limit the rate at which they process queries from any one 1151 requestor. 1153 7.7.1. Example 1155 This example illustrates what a series of queries and responses might 1156 look like. This is only an example - there is no requirement that 1157 this sequence must be followed, or that requestors or servers must 1158 support parallel queries. 1160 In the example session, the client sends four queries after 1161 establishing a connection. Query 1 returns no results; query 2 1162 returns 3 messages and the stream of replies concludes before the 1163 client issues any new query. Query 3 and query 4 overlap, and the 1164 server interleaves its replies to those two queries. 1166 Requestor Server 1167 --------- ------ 1168 DHCPBULKLEASEQUERY xid 1 -----> 1169 <----- DHCPLEASEQUERYDONE xid 1 1170 DHCPBULKLEASEQUERY xid 2 -----> 1171 <----- DHCPLEASEACTIVE xid 2 1172 <----- DHCPLEASEACTIVE xid 2 1173 <----- DHCPLEASEACTIVE xid 2 1174 <----- DHCPLEASEQUERYDONE xid 2 1175 DHCPBULKLEASEQUERY xid 3 -----> 1176 DHCPBULKLEASEQUERY xid 4 -----> 1177 <----- DHCPLEASEACTIVE xid 4 1178 <----- DHCPLEASEACTIVE xid 4 1179 <----- DHCPLEASEACTIVE xid 3 1180 <----- DHCPLEASEACTIVE xid 4 1181 <----- DHCPLEASEUNASSIGNED xid 3 1182 <----- DHCPLEASEACTIVE xid 4 1183 <----- DHCPLEASEACTIVE xid 3 1184 <----- DHCPLEASEQUERYDONE xid 3 1185 <----- DHCPLEASEACTIVE xid 4 1186 <----- DHCPLEASEQUERYDONE xid 4 1188 7.8. Closing Connections 1190 The requestor SHOULD close the connection after the 1191 DHCPLEASEQUERYDONE message is received for the last outstanding query 1192 that it has sent, if it has no more queries to send. 1194 8. Server Behavior 1196 8.1. Accepting Connections 1198 Servers that implement DHCPv4 Bulk Leasequery listen for incoming TCP 1199 connections. Port numbers are discussed in Section 6.3. Servers 1200 MUST be able to limit the number of concurrently accepted and active 1201 connections. The value BULK_LQ_MAX_CONNS SHOULD be the default; 1202 implementations MAY permit the value to be configurable. Connections 1203 SHOULD be accepted and, if the number of connections is over 1204 BULK_LQ_MAX_CONNS, they SHOULD be closed immediately. 1206 Servers MAY restrict Bulk Leasequery connections and 1207 DHCPBULKLEASEQUERY messages to certain requestors. Connections not 1208 from permitted requestors SHOULD be closed immediately, to avoid 1209 server connection resource exhaustion. Servers MAY restrict some 1210 requestors to certain query types. Servers MAY reply to queries that 1211 are not permitted with the DHCPLEASEQUERYDONE message with a status- 1212 code option status of NotAllowed, or MAY simply close the connection. 1214 If the TCP connection becomes blocked while the server is accepting a 1215 connection or reading a query, it SHOULD be prepared to terminate the 1216 connection after an BULK_LQ_DATA_TIMEOUT. We make this 1217 recommendation to allow servers to control the period of time they 1218 are willing to wait before abandoning an inactive connection, 1219 independent of the TCP implementations they may be using. 1221 8.2. Replying to a Bulk Leasequery 1223 If the connection becomes blocked while the server is attempting to 1224 send reply messages, the server SHOULD be prepared to terminate the 1225 TCP connection after BULK_LQ_DATA_TIMEOUT. 1227 Every Bulk Leasequery request MUST be terminated by sending a final 1228 DHCPLEASEQUERYDONE message if such a message can be sent. The 1229 DHCPLEASEQUERYDONE message MUST have a status-code option status if 1230 the termination was other than successful, and SHOULD NOT contain a 1231 status-code option status if the termination was successful. 1233 If the DHCPv4 server encounters an error during processing of the 1234 DHCPBULKLEASEQUERY message, either during initial processing or later 1235 during the message processing, it SHOULD send a DHCPLEASEQUERYDONE 1236 containing a status-code option. It MAY close the connection after 1237 this error is signaled, but that is not required. 1239 If the server does not find any bindings satisfying a query, it MUST 1240 send a DHCPLEASEQUERYDONE. It SHOULD NOT include a status-code 1241 option with a Success status unless there is a useful string to 1242 include in the status-code option. Otherwise, the server sends each 1243 binding's data in a DHCPLEASEACTIVE or DHCPLEASEUNASSIGNED message. 1245 The response to a DHCPBULKLEASEQUERY may involve examination of 1246 multiple DHCPv4 IP address bindings maintained by the DHCPv4 server. 1247 The Bulk Leasequery protocol does not require any ordering of the IP 1248 addresses returned in DHCPLEASEACTIVE or DHCPLEASEUNASSIGNED 1249 messages. 1251 When responding to a DHCPBULKLEASEQUERY message, the DHCPv4 server 1252 MUST NOT send more than one message for each applicable IP address, 1253 even if the state of some of those IP addresses changes during the 1254 processing of the message. Updates to such IP address state are 1255 already handled by normal protocol processing, so no special effort 1256 is needed here. 1258 If the ciaddr, yiaddr, or siaddr is non-zero in a DHCPBULKLEASEQUERY 1259 request, the request must be terminated immediately by a 1260 DHCPLEASEQUERYDONE message with a status-code status of 1261 MalformedQuery. 1263 Any DHCPBULKLEASEQUERY which has more than one of the following 1264 primary query types specified MUST be terminated immediately by a 1265 DHCPLEASEQUERYDONE message with a status-code option status code of 1266 NotAllowed. 1268 The allowable queries in a DHCPBULKLEASEQUERY message are processed 1269 as follows. Note that the descriptions of the primary queries below 1270 must be constrained by the actions of any of the three qualifiers 1271 described subsequently as well. 1273 The following table discusses how to process the various queries. 1274 For information on how to identify the query, see the information in 1275 Section 7.2. 1277 o Query by MAC address 1279 Every IP address that has a current binding to a DHCPv4 client 1280 matching the chaddr, htype, and hlen in the DHCPBULKLEASEQUERY 1281 request MUST be returned in a DHCPLEASEACTIVE message. 1283 o Query by Client-Id 1285 Every IP address that has a current binding to a DHCPv4 client 1286 matching the client-id option in the DHCPBULKLEASEQUERY request 1287 MUST be returned in a DHCPLEASEACTIVE message. 1289 o Query by Remote-Id 1291 Every IP address that has a current binding to a DHCPv4 client 1292 matching the remote-id sub-option of the relay-agent-information 1293 option in the DHCPBULKLEASEQUERY request MUST be returned in a 1294 DHCPLEASEACTIVE message. 1296 o Query by Relay-Id 1298 Every IP address that has a current binding to a DHCPv4 client 1299 matching the relay-id sub-option of the relay-agent-information 1300 option in the DHCPBULKLEASEQUERY request MUST be returned in a 1301 DHCPLEASEACTIVE message. 1303 o Query for All Configured IP Addresses 1305 A Query for All Configured IP addresses is signaled by the 1306 absence of any other primary query. That is, if there is no 1307 value in the chaddr, hlen, htype, no client-id option, no 1308 remote-id sub-option or relay-id sub-option of the relay-agent- 1309 information option, then the request is a query for information 1310 concerning all configured IP addresses. In this case, every 1311 configured IP address that has a current binding to a DHCPv4 1312 client MUST be returned in a DHCPLEASEACTIVE message. In 1313 addition, every configured IP address that does not have a 1314 current binding to a DHCPv4 client MUST be returned in a 1315 DHCPLEASEUNASSIGNED message. 1317 In this form of query, each configured IP address MUST be 1318 returned at most one time. If the absence of qualifiers 1319 restricting the number of IP addresses returned, every 1320 configured IP address MUST be returned exactly once. 1322 There are three qualifiers that can be applied to any of the above 1323 primary queries. These qualifiers can appear individually or 1324 together in any combination, but only one of each can appear. 1326 o Query Start Time 1328 If a query-start-time option appears in the DHCPBULKLEASEQUERY 1329 request, only IP address bindings that have changed on or after the 1330 time specified in the query-start-time option should be returned. 1332 o Query End Time 1334 If a query-end-time option appears in the DHCPBULKLEASEQUERY 1335 request, only IP address bindings that have changed on or before 1336 the time specified in the query-end-time option should be returned. 1338 o VPN Id 1340 If no vpn-id option appears in the DHCPBULKLEASEQUERY, the default 1341 (global) VPN is used to satisfy the query. A vpn-id option [VpnId] 1342 value other than the wildcard value (254) allows the requestor to 1343 specify a single VPN other than the default VPN. In addition, the 1344 vpn-id option has been extended as part of this document to allow 1345 specification of a type 254 which indicates that all configured 1346 VPN's be searched in order to satisfy the primary query. 1348 In all cases, if the information returned in a DHCPLEASEACTIVE or 1349 DHCPLEASEUNASSIGNED message is for a VPN other than the default 1350 (global) VPN, a vpn-id option MUST appear in the packet. 1352 The query-start-time and query-end-time qualifiers are used to 1353 constrain the amount of data returned by a Bulk Leasequery request by 1354 returning only IP addresses whose address bindings have changed in 1355 some way during the time window specified by the query-start-time and 1356 query-end-time. 1358 A DHCPv4 server SHOULD consider an address binding to have changed 1359 during a specified time window if either the client-last- 1360 transaction-time or the start-time-of-state of the address binding 1361 changed during that time window. 1363 The DHCPv4 server MAY return address binding data in any order, as 1364 long as binding information for any given IP address is not repeated. 1365 When all binding data for a given DHCPBULKLEASEQUERY has been sent, 1366 the DHCPv4 server MUST send a DHCPBULKLEASEQUERYDONE message. 1368 8.3. Building a Single Reply for Bulk Leasequery 1370 The DHCPv4 Leasequery [RFC4388] specification describes the initial 1371 construction of DHCPLEASEQUERY reply messages using the 1372 DHCPLEASEACTIVE and DHCPLEASEUNASSIGNED message types in Section 1373 6.4.2. All of the reply messages in Bulk Leasequery are similar to 1374 the reply messages for an IP address query. Message transmission and 1375 framing for TCP is described in this document in Section 6.1. 1377 [RFC2131] and [RFC4388] specify that every response message MUST 1378 contain the server-identifier option. However, that option will be 1379 the same for every response from a particular DHCPBULKLEASEQUERY 1380 request. Thus, the DHCPv4 server MUST include the server-identifier 1381 option in the first message sent in response to a DHCPBULKLEASEQUERY. 1382 It SHOULD NOT include the server-identifier in later messages. 1384 The message type of DHCPLEASEACTIVE or DHCPLEASEUNASSIGNED is based 1385 on the value of the dhcp-state option. If the dhcp-state option 1386 value is ACTIVE, then the message type is DHCPLEASEACTIVE, otherwise 1387 the message type is DHCPLEASEUNASSIGNED. 1389 In addition to the basic message construction described in [RFC4388], 1390 the following guidelines exist: 1392 1. If the dhcp-state option code appears in the dhcp-parameter- 1393 request-list, the DHCPv4 server SHOULD include a dhcp-state 1394 option whose value corresponds most closely to the state held 1395 by the DHCPv4 server for the IP address associated with this 1396 reply. If the state is ACTIVE and the message being returned 1397 is DHCPLEASEACTIVE, then the DHCPv4 server MAY choose to not 1398 send the dhcp-state option. The requestor SHOULD assume that 1399 any DHCPLEASEACTIVE message arriving without a requested dhcp- 1400 state option has a dhcp-state of ACTIVE. 1402 2. If the base-time option code appears in the dhcp-parameter- 1403 request-list, the DHCPv4 server MUST include a base-time 1404 option, which is the current time in the DHCPv4 server's 1405 context and the time from which the start-time-of-state, dhcp- 1406 lease-time, client-last-transaction-time, and other duration- 1407 style times are based upon. 1409 3. If the start-time-of-state option code appears in the dhcp- 1410 parameter-request-list, the DHCPv4 server MUST include a 1411 start-time-of-state option whose value represents the time at 1412 which the dhcp-state option's state became valid. 1414 4. If the dhcp-lease-time option code appears in the dhcp- 1415 parameter-request-list, the DHCPv4 server MUST include a dhcp- 1416 lease-time option for any state that has a time-out value 1417 associated with it. 1419 5. If the data-source option code appears in the dhcp-parameter- 1420 request-list, the DHCPv4 server MUST include the data-source 1421 option in any situation where any of the bits would be non- 1422 zero. Thus, in the absence of the data-source option, the 1423 assumption is that all of the flags were zero. 1425 6. If the client-last-transaction-time option code appears in the 1426 dhcp-parameter-request-list, The DHCPv4 server MUST include the 1427 client-last-transaction-time option in any situation where the 1428 information is available. 1430 7. If there is a dhcp-parameter-request-list in the initial 1431 DHCPBULKLEASEQUERY request, then it should be used for all of 1432 the replies generated by that request. Some options can be 1433 sent from a DHCPv4 client to the server or from the DHCPv4 1434 server to a DHCPv4 client. Option 125 is such an option. If 1435 the option code for one of these options appears in the dhcp- 1436 parameter-request-list, it SHOULD result in returning the value 1437 of the option sent by the DHCPv4 client to the server if one 1438 exists. 1440 Note that there may be other requirements for a reply to a 1441 DHCPBULKLEASEQUERY request discussed in Section 8.2. 1443 8.4. Multiple or Parallel Queries 1445 As discussed in Section 7.3, requestors may want to use a connection 1446 that has already been established when they need to make additional 1447 queries. Servers SHOULD support reading and processing multiple 1448 queries from a single connection and SHOULD allow configuration of 1449 the number of simultaneous queries it may process. A server MUST NOT 1450 read more query messages from a connection than it is prepared to 1451 process simultaneously. 1453 This SHOULD be a feature that is administratively controlled. 1454 Servers SHOULD offer configuration that limits the number of 1455 simultaneous queries permitted from any one requestor, in order to 1456 control resource use if there are multiple requestors seeking 1457 service. 1459 8.5. Closing Connections 1461 The DHCPv4 server SHOULD start a timer for BULK_LQ_DATA_TIMEOUT 1462 seconds for a particular connection after it sends a 1463 DHCPLEASEQUERYDONE message over that connection and if there is no 1464 current query outstanding for that connection. It should clear this 1465 timer if a query arrives over that connection. If the timer expires, 1466 the DHCPv4 server should close the connection. 1468 The server MUST close its end of the TCP connection if it encounters 1469 an error sending data on the connection. The server MUST close its 1470 end of the TCP connection if it finds that it has to abort an in- 1471 process request. A server aborting an in-process request SHOULD 1472 attempt to signal that to its requestors by using the QueryTerminated 1473 status code in the status-code option in a DHCPLEASEQUERYDONE 1474 message, including a message string indicating details of the reason 1475 for the abort. If the server detects that the requesting end of the 1476 connection has been closed, the server MUST close its end of the 1477 connection. 1479 9. Security Considerations 1481 The "Security Considerations" section of [RFC2131] details the 1482 general threats to DHCPv4. The DHCPv4 Leasequery specification 1483 [RFC4388] describes recommendations for the Leasequery protocol, 1484 especially with regard to authentication of LEASEQUERY messages, 1485 mitigation of packet-flooding DOS attacks, and restriction to trusted 1486 requestors. 1488 The use of TCP introduces some additional concerns. Attacks that 1489 attempt to exhaust the DHCPv4 server's available TCP connection 1490 resources, such as SYN flooding attacks, can compromise the ability 1491 of legitimate requestors to receive service. Malicious requestors 1492 who succeed in establishing connections, but who then send invalid 1493 queries, partial queries, or no queries at all also can exhaust a 1494 server's pool of available connections. We recommend that servers 1495 offer configuration to limit the sources of incoming connections, 1496 that they limit the number of accepted connections and the number of 1497 in-process queries from any one connection, and that they limit the 1498 period of time during which an idle connection will be left open. 1500 There are two specific issues regarding Bulk Leasequery security that 1501 deserve explicit mention. The first is preventing information that 1502 Bulk Leasequery can provide from reaching clients who are not 1503 authorized to receive such information. The second is ensuring that 1504 authorized clients of the Bulk Leasequery capability receive accurate 1505 information from the Server (and that this information is not 1506 disrupted in transit). 1508 To prevent information leakage to unauthorized clients Servers SHOULD 1509 restrict Bulk Leasequery connections and DHCPBULKLEASEQUERY messages 1510 to certain requestors, either through explicit configuration of the 1511 Server itself or by employing external network elements to provide 1512 such restrictions. In particular, the typical DHCPv4 client SHOULD 1513 NOT be allowed to receive a response to a Bulk Leasequery request, 1514 and some technique MUST exist to allow prevention of such access in 1515 any environment where Bulk Leasequery is deployed. 1517 Connections not from permitted requestors SHOULD be closed 1518 immediately, to avoid server connection resource exhaustion or 1519 alternatively, simply not be allowed to reach the server at all. 1520 Servers SHOULD have the capability to restrict certain requestors to 1521 certain query types. Servers MAY reply to queries that are not 1522 permitted with the DHCPLEASEQUERYDONE message with a status-code 1523 option status of NotAllowed, or MAY simply close the connection. 1525 To prevent disruption and malicious corruption of Bulk Leasequery 1526 data flows between the server and authorized clients these data flows 1527 SHOULD transit only secured networks. These data flows are 1528 typically infrastructure oriented, and there is usually no reason to 1529 have them flowing over networks where such attacks are likely. In 1530 the rare cases where these data flows might need to be sent through 1531 unsecured networks, they MUST sent over connections secured through 1532 means external to the DHCPv4/DHCPv6 server and its client(s) (e.g., 1533 through VPN's). 1535 Authentication for DHCP Messages [RFC3118] MUST NOT be used to 1536 attempt to secure transmission of the messages described in this 1537 document. In particular, the message framing would not be protected 1538 by using the mechanisms described in [RFC3118] (which was designed 1539 only with UDP transport in mind). 1541 10. IANA Considerations 1543 IANA is requested to assign the following new DHCPv4 option codes 1544 from the registry "BOOTP Vendor Extensions and DHCP Options" 1545 maintained at http://www.iana.org/assignments/bootp-dhcp-parameters 1547 1. An option code of TBD1 for status-code. 1549 2. An option code of TBD2 for base-time. 1551 3. An option code of TBD3 for start-time-of-state. 1553 4. An option code of TBD4 for query-start-time. 1555 5. An option code of TBD5 for query-end-time. 1557 6. An option code of TBD6 for dhcp-state. 1559 7. An option code of TBD7 for data-source. 1561 IANA is requested to assign the following new DHCP message types from 1562 the registry "DHCP Message Type 53 Values" maintained at 1563 http://www.iana.org/assignments/bootp-dhcp-parameters 1565 1. A dhcp-message-type of TBD8 for DHCPBULKLEASEQUERY. 1567 2. A dhcp-message-type of TBD9 for DHCPLEASEQUERYDONE. 1569 IANA is requested to create a new registry on the same assignments 1570 page, titled "DHCP State TBD6 Values" (where TBD6 corresponds to the 1571 assigned value of the dhcp-state option, above). This registry will 1572 have the following initial values: 1574 State 1575 ----- 1576 1 AVAILABLE 1577 2 ACTIVE 1578 3 EXPIRED 1579 4 RELEASED 1580 5 ABANDONED 1581 6 RESET 1582 7 REMOTE 1583 8 TRANSITIONING 1585 New values for this name space may only be defined by IETF Consensus, 1586 as described in [RFC5226]. Basically, this means that they are 1587 defined by RFCs approved by the IESG. 1589 IANA is requested to create a new registry on the same assignments 1590 page, titled "DHCP Status Code TBD1 Values" (where TBD1 corresponds 1591 to the assigned value of the status-code option, above). This 1592 registry will have the following initial values: 1594 Name status-code 1595 ---- ----------- 1596 Success 000 1597 UnspecFail 001 1598 QueryTerminated 002 1599 MalformedQuery 003 1600 NotAllowed 004 1602 New values for this name space may only be defined by IETF Consensus, 1603 as described in [RFC5226]. Basically, this means that they are 1604 defined by RFCs approved by the IESG. 1606 IANA is requested to revise the registry that will be created on the 1607 same assignments page when the [VpnId] option is approved. The 1608 registry will be "Virtual Subnet Selection Type and Information". It 1609 should be revised to appear as follows: 1611 Type VSS Information format: 1613 0 UTF-8 ASCII VPN identifier 1614 1 RFC2685 VPN-ID 1615 2-253 Not Allowed 1616 254 All VPN's. (wildcard; only allowed in 1617 DHCPBULKLEASEQUERY messages) 1618 255 Global, default VPN. 1620 11. Contributing Authors 1622 The following authors were full participants in creating this 1623 document. In order to facilitate the process of approval for this 1624 work, they graciously volunteered to have their names appear in this 1625 section instead of on the title page. 1627 Pavan Kurapati 1628 Juniper Networks Ltd. 1629 Embassy Prime Buildings, C.V.Raman Nagar 1630 Bangalore 560 093 1631 India 1632 Email: kurapati@juniper.net 1633 URI: http://www.juniper.net/ 1635 Bernie Volz 1636 Cisco Systems 1637 1414 Massachusetts Ave. 1638 Boxborough, Massachusetts 01719 1640 Phone: (978) 936-0000 1642 EMail: volz@cisco.com 1644 12. Acknowledgements 1646 This draft is a collaboration between the authors of draft-dtv-dhc- 1647 dhcpv4-bulk-leasequery-00.txt and draft-kkinnear-dhc-dhcpv4-bulk- 1648 leasequery-00.txt. Both documents acknowledged that significant text 1649 as well as important ideas were borrowed in whole or in part from the 1650 DHCPv6 Bulk Leasequery RFC, [RFC5460] written by Mark Stapp. Further 1651 suggestions and improvements were made by participants in the DHC 1652 working group, including Alfred Hoenes. 1654 13. References 1656 13.1. Normative References 1658 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 1659 Requirement Levels", RFC 2119, March 1997. 1661 [RFC2131] Droms, R., "Dynamic Host Configuration Protocol", RFC 2131, 1662 March 1997. 1664 [RFC2132] Alexander, S., Droms, R., "DHCP Options and BOOTP Vendor 1665 Extensions", RFC 2132, March 1997. 1667 [RFC3046] Patrick, M., "DHCP Relay Agent Information Option", RFC 1668 3046, January 2001. 1670 [RFC3118] Droms, R. "Authentication for DHCP Messages", RFC 3118, 1671 June 2001. 1673 [RFC4388] Woundy, R., K. Kinnear, "Dynamic Host Configuration 1674 Protocol (DHCP) Leasequery", RFC 4388, February 2006. 1676 [RFC5226] Narten, T. and H. Alvestrand, "Guidelines for Writing an 1677 IANA Considerations Section in RFCs", BCP 26, RFC 5226, May 2008. 1679 [RelayId] Joshi, B., Rao, D. and M. Stapp, "The DHCPv4 Relay Agent 1680 Identifier Suboption", draft-ietf-dhc-relay-id-suboption-10.txt, 1681 (work in progress) January 2012. 1683 [VpnId] Kinnear, K., R. Johnson, M. Stapp and J. Kumarasamy, "Virtual 1684 Subnet Selection Options for DHCPv4 and DHCPv6" draft-ietf-dhc- 1685 vpn-option-15.txt, (work in progress) January 2012. 1687 13.2. Informative References 1689 [RFC951] Croft, B., Gilmore, J., "Bootstrap Protocol (BOOTP)", RFC 1690 951, September 1985. 1692 [RFC1542] Wimer, W., "Clarifications and Extensions for the Bootstrap 1693 Protocol", RFC 1542, October 1993. 1695 [RFC4614] Duke, M., R. Braden, W. Eddy, and E. Blanton, "A Roadmap 1696 for Transmission Control Protocol (TCP) Specification Documents", 1697 RFC 4614, September 2006. 1699 [RFC5460] Stapp, M., "DHCPv6 Bulk Leasequery", RFC 5460, February 1700 2009. 1702 Authors' Addresses 1704 Kim Kinnear 1705 Cisco Systems 1706 1414 Massachusetts Ave. 1707 Boxborough, Massachusetts 01719 1709 Phone: (978) 936-0000 1711 EMail: kkinnear@cisco.com 1713 Neil Russell 1714 BMC Software 1715 10 Maguire Rd., Bldg. 3, Ste. 320 1716 Lexington, MA 02421 1718 Phone: (781) 257-3105 1720 EMail: neil_russell@bmc.com 1722 Mark Stapp 1723 Cisco Systems 1724 1414 Massachusetts Ave. 1725 Boxborough, Massachusetts 01719 1727 Phone: (978) 936-0000 1729 EMail: mjs@cisco.com 1731 Ramakrishna Rao DTV 1732 Infosys Technologies Ltd. 1733 44 Electronics City, Hosur Road 1734 Bangalore 560 100 1735 India 1737 EMail: ramakrishnadtv@infosys.com 1738 URI: http://www.infosys.com/ 1740 Bharat Joshi 1741 Infosys Technologies Ltd. 1742 44 Electronics City, Hosur Road 1743 Bangalore 560 100 1744 India 1746 EMail: bharat_joshi@infosys.com 1747 URI: http://www.infosys.com/