idnits 2.17.1 draft-ietf-dnssd-push-07.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 -- The document date (April 4, 2016) is 2944 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) == Outdated reference: A later version (-28) exists of draft-ietf-tls-tls13-12 ** Obsolete normative reference: RFC 793 (Obsoleted by RFC 9293) ** Obsolete normative reference: RFC 5246 (Obsoleted by RFC 8446) == Outdated reference: A later version (-10) exists of draft-ietf-dnssd-hybrid-03 == Outdated reference: A later version (-06) exists of draft-sekar-dns-llq-01 -- Obsolete informational reference (is this intentional?): RFC 5077 (Obsoleted by RFC 8446) -- Obsolete informational reference (is this intentional?): RFC 7525 (Obsoleted by RFC 9325) Summary: 2 errors (**), 0 flaws (~~), 4 warnings (==), 3 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 Internet Engineering Task Force T. Pusateri 3 Internet-Draft Seeking affiliation 4 Intended status: Standards Track S. Cheshire 5 Expires: October 6, 2016 Apple Inc. 6 April 4, 2016 8 DNS Push Notifications 9 draft-ietf-dnssd-push-07 11 Abstract 13 The Domain Name System (DNS) was designed to return matching records 14 efficiently for queries for data that is relatively static. When 15 those records change frequently, DNS is still efficient at returning 16 the updated results when polled. But there exists no mechanism for a 17 client to be asynchronously notified when these changes occur. This 18 document defines a mechanism for a client to be notified of such 19 changes to DNS records, called DNS Push Notifications. 21 Status of This Memo 23 This Internet-Draft is submitted in full conformance with the 24 provisions of BCP 78 and BCP 79. 26 Internet-Drafts are working documents of the Internet Engineering 27 Task Force (IETF). Note that other groups may also distribute 28 working documents as Internet-Drafts. The list of current Internet- 29 Drafts is at http://datatracker.ietf.org/drafts/current/. 31 Internet-Drafts are draft documents valid for a maximum of six months 32 and may be updated, replaced, or obsoleted by other documents at any 33 time. It is inappropriate to use Internet-Drafts as reference 34 material or to cite them other than as "work in progress." 36 This Internet-Draft will expire on October 6, 2016. 38 Copyright Notice 40 Copyright (c) 2016 IETF Trust and the persons identified as the 41 document authors. All rights reserved. 43 This document is subject to BCP 78 and the IETF Trust's Legal 44 Provisions Relating to IETF Documents 45 (http://trustee.ietf.org/license-info) in effect on the date of 46 publication of this document. Please review these documents 47 carefully, as they describe your rights and restrictions with respect 48 to this document. Code Components extracted from this document must 49 include Simplified BSD License text as described in Section 4.e of 50 the Trust Legal Provisions and are provided without warranty as 51 described in the Simplified BSD License. 53 Table of Contents 55 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2 56 1.1. Requirements Language . . . . . . . . . . . . . . . . . . 3 57 2. Motivation . . . . . . . . . . . . . . . . . . . . . . . . . 3 58 3. Overview . . . . . . . . . . . . . . . . . . . . . . . . . . 4 59 4. Transport . . . . . . . . . . . . . . . . . . . . . . . . . . 6 60 4.1. Client-Initiated Termination . . . . . . . . . . . . . . 7 61 4.2. Server-Initiated Termination . . . . . . . . . . . . . . 9 62 5. State Considerations . . . . . . . . . . . . . . . . . . . . 11 63 6. Protocol Operation . . . . . . . . . . . . . . . . . . . . . 12 64 6.1. Discovery . . . . . . . . . . . . . . . . . . . . . . . . 13 65 6.2. DNS Push Notification SUBSCRIBE . . . . . . . . . . . . . 15 66 6.3. DNS Push Notification UNSUBSCRIBE . . . . . . . . . . . . 20 67 6.4. DNS Push Notification Update Messages . . . . . . . . . . 21 68 6.5. DNS RECONFIRM . . . . . . . . . . . . . . . . . . . . . . 24 69 6.6. DNS Push Notification Termination Message . . . . . . . . 25 70 7. Security Considerations . . . . . . . . . . . . . . . . . . . 28 71 7.1. Security Services . . . . . . . . . . . . . . . . . . . . 28 72 7.2. TLS Name Authentication . . . . . . . . . . . . . . . . . 28 73 7.3. TLS Compression . . . . . . . . . . . . . . . . . . . . . 29 74 7.4. TLS Session Resumption . . . . . . . . . . . . . . . . . 29 75 8. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 29 76 9. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 29 77 10. References . . . . . . . . . . . . . . . . . . . . . . . . . 30 78 10.1. Normative References . . . . . . . . . . . . . . . . . . 30 79 10.2. Informative References . . . . . . . . . . . . . . . . . 31 80 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 33 82 1. Introduction 84 DNS records may be updated using DNS Update [RFC2136]. Other 85 mechanisms such as a Hybrid Proxy [I-D.ietf-dnssd-hybrid] can also 86 generate changes to a DNS zone. This document specifies a protocol 87 for Unicast DNS clients to subscribe to receive asynchronous 88 notifications of changes to RRSets of interest. It is immediately 89 relevant in the case of DNS Service Discovery [RFC6763] but is not 90 limited to that use case, and provides a general DNS mechanism for 91 DNS record change notifications. Familiarity with the DNS protocol 92 and DNS packet formats is assumed [RFC1034] [RFC1035] [RFC6895]. 94 1.1. Requirements Language 96 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 97 "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and 98 "OPTIONAL" in this document are to be interpreted as described in 99 "Key words for use in RFCs to Indicate Requirement Levels" [RFC2119]. 101 2. Motivation 103 As the domain name system continues to adapt to new uses and changes 104 in deployment, polling has the potential to burden DNS servers at 105 many levels throughout the network. Other network protocols have 106 successfully deployed a publish/subscribe model to state changes 107 following the Observer design pattern. XMPP Publish-Subscribe 108 [XEP0060] and Atom [RFC4287] are examples. While DNS servers are 109 generally highly tuned and capable of a high rate of query/response 110 traffic, adding a publish/subscribe model for tracking changes to DNS 111 records can result in more timely notification of changes with 112 reduced CPU usage and lower network traffic. 114 Multicast DNS [RFC6762] implementations always listen on a well known 115 link-local IP multicast group, and new services and updates are sent 116 for all group members to receive. Therefore, Multicast DNS already 117 has asynchronous change notification capability. However, when DNS 118 Service Discovery [RFC6763] is used across a wide area network using 119 Unicast DNS (possibly facilitated via a Hybrid Proxy 120 [I-D.ietf-dnssd-hybrid]) it would be beneficial to have an equivalent 121 capability for Unicast DNS, to allow clients to learn about DNS 122 record changes in a timely manner without polling. 124 DNS Long-Lived Queries (LLQ) [I-D.sekar-dns-llq] is an existing 125 deployed solution to provide asynchronous change notifications. Even 126 though it can be used over TCP, LLQ is defined primarily as a UDP- 127 based protocol, and as such it defines its own equivalents of 128 existing TCP features like the three-way handshake. This document 129 builds on experience gained with the LLQ protocol, with an improved 130 design that uses long-lived TCP connections instead of UDP (and 131 therefore doesn't need to duplicate existing TCP functionality), and 132 adopts the syntax and semantics of DNS Update messages [RFC2136] 133 instead of inventing a new vocabulary of messages to communicate DNS 134 zone changes. 136 Because DNS Push Notifications impose a certain load on the 137 responding server (though less load than rapid polling of that 138 server) DNS Push Notification clients SHOULD exercise restraint in 139 issuing DNS Push Notification subscriptions. A subscription SHOULD 140 only be active when there is a valid reason to need live data (for 141 example, an on-screen display is currently showing the results of 142 that subscription to the user) and the subscription SHOULD be 143 cancelled as soon as the need for that data ends (for example, when 144 the user dismisses that display). Implementations MAY want to 145 implement idle timeouts, so that if the user ceases interacting with 146 the device, the display showing the result of the DNS Push 147 Notification subscription is automatically dismissed after a certain 148 period of inactivity. For example, if a user presses the "Print" 149 button on their phone, and then leaves the phone showing the printer 150 discovery screen until the phone goes to sleep, then the printer 151 discovery screen should be automatically dismissed as the device goes 152 to sleep. If the user does still intend to print, this will require 153 them to press the "Print" button again when they wake their phone up. 155 A DNS Push Notification client MUST NOT routinely keep a DNS Push 156 Notification subscription active 24 hours a day 7 days a week just to 157 keep a list in memory up to date so that it will be really fast if 158 the user does choose to bring up an on-screen display of that data. 159 DNS Push Notifications are designed to be fast enough that there is 160 no need to pre-load a "warm" list in memory just in case it might be 161 needed later. 163 Generally, a client SHOULD NOT keep a connection to a server open 164 indefinitely if it has no active subscriptions on that connection. 165 After 30 seconds with no active subscriptions the client SHOULD close 166 the idle connection, and, if needed in the future, open a new 167 connection. 169 3. Overview 171 The existing DNS Update protocol [RFC2136] provides a mechanism for 172 clients to add or delete individual resource records (RRs) or entire 173 resource record sets (RRSets) on the zone's server. 175 This specification adopts a simplified subset of these existing 176 syntax and semantics, and uses them for DNS Push Notification 177 messages going in the opposite direction, from server to client, to 178 communicate changes to a zone. The client subscribes for Push 179 Notifications by connecting to the server and sending DNS message(s) 180 indicating the RRSet(s) of interest. When the client loses interest 181 in updates to these records, it unsubscribes. 183 The DNS Push Notification server for a zone is any server capable 184 of generating the correct change notifications for a name. 185 It may be a master, slave, or stealth name server [RFC1996]. 186 Consequently, the "_dns-push-tls._tcp." SRV record for a 187 zone MAY reference the same target host and port as that zone's 188 "_dns-update-tls._tcp." SRV record. When the same target host 189 and port is offered for both DNS Updates and DNS Push Notifications, 190 a client MAY use a single TCP connection to that server for both DNS 191 Updates and DNS Push Notification Queries. 193 Supporting DNS Updates and DNS Push Notifications on the same server 194 is OPTIONAL. A DNS Push Notification server is not REQUIRED to 195 support DNS Update. 197 DNS Updates and DNS Push Notifications may be handled on different 198 ports on the same target host, in which case they are not considered 199 to be the "same server" for the purposes of this specification, and 200 communications with these two ports are handled independently. 202 Standard DNS Queries MAY be sent over a DNS Push Notification 203 connection, provided that these are queries for names falling within 204 the server's zone (the in the "_dns-push-tls._tcp." SRV 205 record). The RD (Recursion Desired) bit MUST be zero. 207 DNS Push Notification clients are NOT required to implement DNS 208 Update Prerequisite processing. Prerequisites are used to perform 209 tentative atomic test-and-set type operations when a client updates 210 records on a server, and that concept has no applicability when it 211 comes to an authoritative server informing a client of changes to DNS 212 records. 214 This DNS Push Notification specification includes support for DNS 215 classes, for completeness. However, in practice, it is anticipated 216 that for the foreseeable future the only DNS class in use will be DNS 217 class "IN", as it is today with existing DNS servers and clients. A 218 DNS Push Notification server MAY choose to implement only DNS class 219 "IN". 221 4. Transport 223 Implementations of DNS Update [RFC2136] MAY use either User Datagram 224 Protocol (UDP) [RFC0768] or Transmission Control Protocol (TCP) 225 [RFC0793] as the transport protocol, in keeping with the historical 226 precedent that DNS queries must first be sent over UDP [RFC1123]. 227 This requirement to use UDP has subsequently been relaxed [RFC7766]. 229 In keeping with the more recent precedent, DNS Push Notification is 230 defined only for TCP. DNS Push Notification clients MUST use TLS 231 over TCP. 233 Connection setup over TCP ensures return reachability and alleviates 234 concerns of state overload at the server through anonymous 235 subscriptions. All subscribers are guaranteed to be reachable by the 236 server by virtue of the TCP three-way handshake. Because TCP SYN 237 flooding attacks are possible with any protocol over TCP, 238 implementers are encouraged to use industry best practices to guard 239 against such attacks [IPJ.9-4-TCPSYN] [RFC4953]. 241 Transport Layer Security (TLS) [RFC5246] is well understood and 242 deployed across many protocols running over TCP. It is designed to 243 prevent eavesdropping, tampering, or message forgery. TLS is 244 REQUIRED for every connection between a client subscriber and server 245 in this protocol specification. Additional security measures such as 246 client authentication during TLS negotiation MAY also be employed to 247 increase the trust relationship between client and server. 248 Additional authentication of the SRV target using DNSSEC verification 249 and DANE TLSA records [RFC7673] is strongly encouraged. See below in 250 Section 7.2 for details. 252 A DNS Push Notification session begins with a client connecting to a 253 DNS Push Notification server. Over that connection the client then 254 issues DNS operation requests, such as SUBSCRIBE. 256 4.1. Client-Initiated Termination 258 An individual subscription is terminated by sending an UNSUBSCRIBE 259 message for that specific subscription, or all subscriptions can be 260 cancelled at once by the client closing the connection. When a 261 client terminates an individual subscription (via UNSUBSCRIBE) or all 262 subscriptions on that connection (by closing the connection) it is 263 signalling to the server that it is longer interested in receiving 264 those particular updates. It is informing the server that the server 265 may release any state information it has been keeping with regards to 266 these particular subscriptions. 268 After terminating its last subscription on a connection via 269 UNSUBSCRIBE, a client MAY close the connection immediately, or it may 270 keep it open if it anticipates performing further operations on that 271 connection in the future. If a client wishes to keep an idle 272 connection open, it MUST continue to meet its keepalive obligations 273 [I-D.ietf-dnsop-edns-tcp-keepalive] or the server is entitled to 274 close the connection (see below). 276 If a client plans to terminate one or more subscriptions on a 277 connection and doesn't intend to keep that connection open, then as 278 an efficiency optimization it MAY instead choose to simply close the 279 connection, which implicitly terminates all subscriptions on that 280 connection. This may occur because the client computer is being shut 281 down, is going to sleep, the application requiring the subscriptions 282 has terminated, or simply because the last active subscription on 283 that connection has been cancelled. 285 When closing a connection, a client will generally do an abortive 286 disconnect, sending a TCP RST. This immediately discards all 287 remaining inbound and outbound data, which is appropriate if the 288 client no longer has any interest in this data. In the BSD sockets 289 API, sending a TCP RST is achieved by setting the SO_LINGER option 290 with a time of 0 seconds and then closing the socket. 292 If a client has performed operations on this connection that it would 293 not want lost (like DNS updates) then the client SHOULD do an orderly 294 disconnect, sending a TCP FIN. In the BSD sockets API, sending a TCP 295 FIN is achieved by calling "shutdown(s,SHUT_WR)" and keeping the 296 socket open until all remaining data has been read from it. 298 In the first SUBSCRIBE response on a connection, the server MUST 299 include an explicit EDNS(0) TCP Keepalive option. If the first 300 SUBSCRIBE response does not include an explicit EDNS(0) TCP Keepalive 301 option this is an error and the client MUST immediately close the TCP 302 connection and not attempt any further DNS Push Notification requests 303 to that server until one hour has passed. This situation may occur 304 if a client connects to a server that doesn't implement DNS Push 305 Notifications at all, and it is important not to burden such servers 306 with continuous retries. 308 Upon receiving an error response from the server, a client SHOULD NOT 309 close the connection. An error relating to one particular operation 310 on a connection does not necessarily imply that all other operations 311 on that connection have also failed, or that future operations will 312 fail. The client should assume that the server will make its own 313 decision about whether or not to close the connection, based on the 314 server's determination of whether the error condition pertains to 315 this particular operation, or would also apply to any subsequent 316 operations. If the server does not close the connection then the 317 client SHOULD continue to use that connection for subsequent 318 operations. 320 Upon receiving a Termination Message from the server (see below), a 321 client MUST immediately close the connection. 323 4.2. Server-Initiated Termination 325 If a client makes a connection and then fails to send any DNS message 326 that uses EDNS(0) TCP Keepalive [I-D.ietf-dnsop-edns-tcp-keepalive] 327 (either SUBSCRIBE, where Keepalive is implicit, or some other DNS 328 message, with an explicit an EDNS(0) TCP Keepalive option) then after 329 30 seconds of inactivity the server SHOULD close the connection. If 330 no data has been sent on the connection the server MAY abort the 331 connection with a TCP RST. If data has been sent on the connection 332 then the server SHOULD close the connection gracefully with a TCP FIN 333 so that the data is reliably delivered. 335 In the response to the first successful SUBSCRIBE, the included 336 EDNS(0) TCP Keepalive option specifies the idle timeout so that the 337 client knows the frequency of traffic it must generate to keep the 338 connection alive. If the idle timeout for that connection changes, 339 then the server communicates this by placing an updated EDNS(0) TCP 340 Keepalive option in a subsequent message to the client. 342 At both servers and clients, the generation or reception of any 343 complete request, response, update, or keepalive message resets the 344 keepalive timer for that connection. 346 In the absence of any requests, responses, or update messages on a 347 connection, a client MUST generate keepalive traffic before the idle 348 timeout expires, or the server is entitled to close the connection. 350 If a client disconnects from the network abruptly, without closing 351 its connection, the server learns of this after failing to receive 352 further traffic from that client. If no requests, responses, update 353 messages or keepalive traffic occurs on a connection for 1.5 times 354 the idle timeout, then this indicates that the client is probably no 355 longer on the network, and the server SHOULD abort the connection 356 with a TCP RST. The time before the server closes the connection is 357 intentionally 50% longer than the time before the client is required 358 to generate keepalive traffic, to allow for differences in clock rate 359 and network propagation delays. 361 [We need to discuss the nature of "the required keepalives". Are 362 they TCP-layer keepalives? DNS-layer keepalives? There is currently 363 no DNS-layer keepalive or 'no-op' operation defined. What would that 364 operation be? A DNS QUERY containing zero questions? A DNS 365 SUBSCRIBE containing zero questions? An "empty" DNS message over the 366 TCP connection (just a pair of zero bytes, signifying a zero-length 367 message)? One benefit of TCP-layer keepalives is that they transmit 368 fewer bytes, and involve less software overhead for processing those 369 bytes. Another benefit is that it is more feasible to implement 370 these in networking offload hardware, which can allow devices to meet 371 their TCP keepalive obligations while sleeping. This is particularly 372 important for battery-powered devices like mobile phones and tablets. 373 On the other hand, using TCP-layer keepalives requires an API for a 374 client to tell the networking stack at what frequency to perform TCP- 375 layer keepalives, and an API for a server to request the networking 376 stack to inform it when TCP-layer keepalives are not received by the 377 required deadline. TCP-layer keepalives also only verify liveness of 378 the remote networking stack, whereas DNS-layer keepalives provide 379 higher assurance of liveness of the remote server application 380 software -- though this a limited benefit, since there is no reason 381 to expect that DNS Push Notification server software will routinely 382 become wedged and unresponsive.] 384 After sending an error response to a client, the server MAY close the 385 connection with a TCP FIN, or may allow the connection to remain 386 open. For error conditions that only affect the single operation in 387 question, the server SHOULD return an error response to the client 388 and leave the connection open for further operations. For error 389 conditions that are likely to make all operations unsuccessful in the 390 immediate future, the server SHOULD return an error response to the 391 client and then close the connection with a TCP FIN. 393 If the server is overloaded and needs to shed load, it SHOULD send a 394 Termination Message to the client and close the connection with a TCP 395 FIN. 397 Apart from the cases described above, a server MUST NOT close a 398 connection with a DNS Push Notification client, except in 399 extraordinary error conditions. Closing the connection is the 400 client's responsibility, to be done at the client's discretion, when 401 it so chooses. A DNS Push Notification server only closes a DNS Push 402 Notification connection under exceptional circumstances, such as when 403 the server application software or underlying operating system is 404 restarting, the server application terminated unexpectedly (perhaps 405 due to a bug that makes it crash), or the server is undergoing 406 maintenance procedures. When possible, a DNS Push Notification 407 server SHOULD send a Termination Message (Section 6.6 ) informing the 408 client of the reason for the connection being closed. 410 After a connection is closed by the server, the client SHOULD try to 411 reconnect, to that server, or to another server supporting DNS Push 412 Notifications for the zone. If reconnecting to the same server, and 413 there was a Termination Message or error response containing a 414 EDNS(0) TCP Keepalive option, the client MUST respect the indicated 415 delay before attempting to reconnect. 417 5. State Considerations 419 Each DNS Push Notification server is capable of handling some finite 420 number of Push Notification subscriptions. This number will vary 421 from server to server and is based on physical machine 422 characteristics, network bandwidth, and operating system resource 423 allocation. After a client establishes a connection to a DNS server, 424 each record subscription is individually accepted or rejected. 425 Servers may employ various techniques to limit subscriptions to a 426 manageable level. Correspondingly, the client is free to establish 427 simultaneous connections to alternate DNS servers that support DNS 428 Push Notifications for the zone and distribute record subscriptions 429 at its discretion. In this way, both clients and servers can react 430 to resource constraints. Token bucket rate limiting schemes are also 431 effective in providing fairness by a server across numerous client 432 requests. 434 6. Protocol Operation 436 A DNS Push Notification exchange begins with the client discovering 437 the appropriate server, and then making a TLS/TCP connection to it. 438 The client may then add and remove Push Notification subscriptions 439 over this connection. In accordance with the current set of active 440 subscriptions the server sends relevant asynchronous Push 441 Notifications to the client. Note that a client MUST be prepared to 442 receive (and silently ignore) Push Notifications for subscriptions it 443 has previously removed, since there is no way to prevent the 444 situation where a Push Notification is in flight from server to 445 client while the client's UNSUBSCRIBE message cancelling that 446 subscription is simultaneously in flight from client to server. 448 The exchange between client and server terminates when either end 449 closes the TCP connection with a TCP FIN or RST. 451 A client SHOULD NOT make multiple TLS/TCP connections to the same DNS 452 Push Notification server. A client SHOULD share a single TLS/TCP 453 connection for all requests to the same DNS Push Notification server. 454 This shared connection should be used for all DNS Queries and DNS 455 Push Notification Queries queries to that server, and for DNS Update 456 requests too when the "_dns-update-tls._tcp." SRV record 457 indicates that the same server also handles DNS Update requests. 458 This is to reduce unnecessary load on the DNS Push Notification 459 server. 461 For the purposes here, the determination of "same server" is made by 462 inspecting the target hostname and port, regardless of the name being 463 queried, or what zone if falls within. A given server may support 464 Push Notifications (and possibly DNS Updates too) for multiple DNS 465 zones. When a client discovers that the DNS Push Notification server 466 (and/or DNS Update server) for several different names (including 467 names that fall within different zones) is the same target hostname 468 and port, the client SHOULD use a single shared TCP connection for 469 all relevant operations on those names. A client SHOULD NOT open 470 multiple TCP connections to the same target host and port just 471 because the names being queried (or updated) happen to fall within 472 different zones. 474 Note that the "same server" determination described here is made 475 using the target hostname given in the SRV record, not the IP 476 address(es) that the hostname resolves to. If two different target 477 hostnames happen to resolve to the same IP address(es), then the 478 client SHOULD NOT recognize these as the "same server" for the 479 purposes of using a single shared connection to that server. If an 480 administrator wishes to use a single server for multiple zones and/or 481 multiple roles (e.g., both DNS Push Notifications and DNS Updates), 482 and wishes to have clients use a single shared connection for 483 operations on that server, then the administrator MUST use the same 484 target hostname in the appropriate SRV records. 486 However, server implementers and operators should be aware that this 487 connection sharing may not be possible in all cases. A single client 488 device may be home to multiple independent client software instances 489 that don't know about each other, so a DNS Push Notification server 490 MUST be prepared to accept multiple connections from the same client 491 IP address. This is undesirable from an efficiency standpoint, but 492 may be unavoidable in some situations, so a DNS Push Notification 493 server MUST be prepared to accept multiple connections from the same 494 client IP address. 496 Clients SHOULD silently ignore unrecognized messages (both requests 497 and responses) over the TLS/TCP connection. For example, UNSUBSCRIBE 498 and RECONFIRM currently generate no response, but if future versions 499 of this specification change that, existing clients SHOULD silently 500 ignore these unexpected responses. This allows for backwards 501 compatibility with future enhancements. 503 6.1. Discovery 505 The first step in DNS Push Notification subscription is to discover 506 an appropriate DNS server that supports DNS Push Notifications for 507 the desired zone. The client MUST also determine which TCP port on 508 the server is listening for connections, which need not be (and often 509 is not) the typical TCP port 53 used for conventional DNS, or TCP 510 port 853 used for DNS over TLS [I-D.ietf-dprive-dns-over-tls]. 512 1. The client begins the discovery by sending a DNS query to the 513 local resolver with record type SOA [RFC1035] for the name of the 514 record it wishes to subscribe. 516 2. If the SOA record exists, it MUST be returned in the Answer 517 Section of the response. If not, the local resolver SHOULD 518 include the SOA record for the zone of the requested name in the 519 Authority Section. 521 3. If no SOA record is returned, the client then strips off the 522 leading label from the requested name. If the resulting name has 523 at least one label in it, the client sends a new SOA query and 524 processing continues at step 2 above. If the resulting name is 525 empty (the root label) then this is a network configuration error 526 and the client gives up. The client MAY retry the operation at a 527 later time. 529 4. Once the SOA is known (either by virtue of being seen in the 530 Answer Section, or in the Authority Section), the client sends a 531 DNS query with type SRV [RFC2782] for the record name 532 "_dns-push-tls._tcp.", where is the owner name of 533 the discovered SOA record. 535 5. If the zone in question does not offer DNS Push Notifications 536 then SRV record MUST NOT exist and the SRV query will return a 537 negative answer. 539 6. If the zone in question is set up to offer DNS Push Notifications 540 then this SRV record MUST exist. The SRV "target" contains the 541 name of the server providing DNS Push Notifications for the zone. 542 The port number on which to contact the server is in the SRV 543 record "port" field. The address(es) of the target host MAY be 544 included in the Additional Section, however, the address records 545 SHOULD be authenticated before use as described below in 546 Section 7.2 [RFC7673]. 548 7. More than one SRV record may be returned. In this case, the 549 "priority" and "weight" values in the returned SRV records are 550 used to determine the order in which to contact the servers for 551 subscription requests. As described in the SRV specification 552 [RFC2782], the server with the lowest "priority" is first 553 contacted. If more than one server has the same "priority", the 554 "weight" indicates the weighted probability that the client 555 should contact that server. Higher weights have higher 556 probabilities of being selected. If a server is not reachable or 557 is not willing to accept a subscription request, then a 558 subsequent server is to be contacted. 560 Each time a client makes a new DNS Push Notification subscription 561 connection, it SHOULD repeat the discovery process in order to 562 determine the preferred DNS server for subscriptions at that time. 564 6.2. DNS Push Notification SUBSCRIBE 566 A DNS Push Notification client indicates its desire to receive DNS 567 Push Notifications for a given domain name by sending a SUBSCRIBE 568 request over the established TCP connection to the server. A 569 SUBSCRIBE request is formatted identically to a conventional DNS 570 QUERY request [RFC1035], except that the opcode is SUBSCRIBE (6) 571 instead of QUERY (0). If neither QTYPE nor QCLASS are ANY (255) then 572 this is a specific subscription to changes for the given name, type 573 and class. If one or both of QTYPE or QCLASS are ANY (255) then this 574 subscription matches any type and/or any class, as appropriate. 576 NOTE: A little-known quirk of DNS is that in DNS QUERY requests, 577 QTYPE and QCLASS 255 mean "ANY" not "ALL". They indicate that the 578 server should respond with ANY matching records of its choosing, not 579 necessarily ALL matching records. This can lead to some surprising 580 and unexpected results, were a query returns some valid answers but 581 not all of them, and makes QTYPE=ANY queries less useful than people 582 sometimes imagine. 584 When used in conjunction with DNS SUBSCRIBE, QTYPE and QCLASS 255 585 should be interpreted to mean "ALL", not "ANY". After accepting a 586 subscription where one or both of QTYPE or QCLASS are 255, the server 587 MUST send Push Notification Updates for ALL record changes that match 588 the subscription, not just some of them. 590 In a SUBSCRIBE request the DNS Header QR bit MUST be zero. 591 If the QR bit is not zero the message is not a SUBSCRIBE request. 593 The AA, TC, RD, RA, Z, AD, and CD bits, and the RCODE field, MUST be 594 zero on transmission, and MUST be silently ignored on reception. 596 The ID field may be set to any value of the client's choosing, and 597 the server MUST echo this value back in the response message. The 598 client is not required to select unique ID values; it is permissible 599 to use the same value (e.g., zero) for all operations. Since the 600 name, qtype, and qclass are sufficient to uniquely identify a 601 SUBSCRIBE operation on a connection, the name, qtype, and qclass in a 602 SUBSCRIBE response are sufficient to correlate a response with its 603 corresponding request. However, for convenience, the client may put 604 any value it chooses in the ID field of the SUBSCRIBE request, and 605 the server MUST echo that value back unchanged in the SUBSCRIBE 606 response. Note that the ID field of Push Notification Update 607 Messages is always zero, since a Push Notification Update Message 608 could potentially match more than one subscription, or could relate 609 to a subscription that the client has just cancelled with an 610 UNSUBSCRIBE message. 612 Like a DNS QUERY request, a SUBSCRIBE request MUST contain exactly 613 one question. Since SUBSCRIBE requests are sent over TCP, multiple 614 SUBSCRIBE requests can be concatenated in a single TCP stream and 615 packed efficiently into TCP segments, so the ability to pack multiple 616 SUBSCRIBE operations into a single DNS message within that TCP stream 617 would add extra complexity for little benefit. 619 ANCOUNT MUST be zero, and the Answer Section MUST be empty. 620 Any records in the Answer Section MUST be silently ignored. 622 NSCOUNT MUST be zero, and the Authority Section MUST be empty. 623 Any records in the Authority Section MUST be silently ignored. 625 ARCOUNT specifies the number of records in the Additional Data 626 Section. Typically this is zero, but it may be nonzero in some 627 cases, such as when the request includes an EDNS(0) OPT record. 629 If accepted, the subscription will stay in effect until the client 630 revokes the subscription or until the connection between the client 631 and the server is closed. 633 SUBSCRIBE requests on a given connection MUST be unique. A client 634 MUST NOT send a SUBSCRIBE message that duplicates the name, type and 635 class of an existing active subscription on that TLS/TCP connection. 636 For the purpose of this matching, the established DNS case- 637 insensitivity for US-ASCII letters applies (e.g., "foo.com" and 638 "Foo.com" are the same). If a server receives such a duplicate 639 SUBSCRIBE message this is an error and the server MUST immediately 640 close the TCP connection. 642 DNS wildcarding is not supported. That is, a wildcard ("*") in a 643 SUBSCRIBE message matches only a literal wildcard character ("*") in 644 the zone, and nothing else. 646 Aliasing is not supported. That is, a CNAME in a SUBSCRIBE message 647 matches only a literal CNAME record in the zone, and nothing else. 649 A client may SUBSCRIBE to records that are unknown to the server at 650 the time of the request (providing that the name falls within one of 651 the zone(s) the server is responsible for) and this is not an error. 652 The server MUST accept these requests and send Push Notifications if 653 and when matches are found in the future. 655 Since all SUBSCRIBE operations are implicitly long-lived operations, 656 the server MUST interpret a SUBSCRIBE request as if it contained an 657 EDNS(0) TCP Keepalive option [I-D.ietf-dnsop-edns-tcp-keepalive]. A 658 client MUST NOT include an actual EDNS(0) TCP Keepalive option in the 659 request, since it is automatic, and implied by the semantics of 660 SUBSCRIBE. If a server receives a SUBSCRIBE request that does 661 contain an actual EDNS(0) TCP Keepalive option this is an error and 662 the server MUST immediately close the TCP connection. 664 A SUBSCRIBE operation MAY include an explicit EDNS(0) [RFC6891] OPT 665 record where necessary to carry additional EDNS(0) information other 666 than a TCP Keepalive option. 668 The presence of a SUBSCRIBE operation on a connection indicates to 669 the server that the client fully implements EDNS(0) [RFC6891], and 670 can correctly understand any response that conforms to that 671 specification. After receiving a SUBSCRIBE request, the server MAY 672 include OPT record in any of its responses, as needed. 674 Each SUBSCRIBE request generates exactly one SUBSCRIBE response from 675 the server. 677 In a SUBSCRIBE response the DNS Header QR bit MUST be one. 678 If the QR bit is not one the message is not a SUBSCRIBE response. 680 The AA, TC, RD, RA, Z, AD, and CD bits, MUST be zero on transmission, 681 and MUST be silently ignored on reception. 683 The ID field MUST echo the value given in the ID field of the 684 SUBSCRIBE request. 686 The Question Section MUST echo back the values provided by the client 687 in the SUBSCRIBE request that generated this SUBSCRIBE response. 689 ANCOUNT MUST be zero, and the Answer Section MUST be empty. 690 Any records in the Answer Section MUST be silently ignored. 691 If the subscription was accepted and there are positive answers for 692 the requested name, type and class, then these positive answers MUST 693 be communicated to the client in an immediately following Push 694 Notification Update, not in the Answer Section of the SUBSCRIBE 695 response. This simplifying requirement is made so that there is only 696 a single way that information is communicated to a DNS Push 697 Notification client. Since a DNS Push Notification client has to 698 parse information received via Push Notification Updates anyway, it 699 is simpler if it does not also have to parse information received via 700 the Answer Section of a SUBSCRIBE response. 702 NSCOUNT MUST be zero, and the Authority Section MUST be empty. 703 Any records in the Authority Section MUST be silently ignored. 705 ARCOUNT specifies the number of records in the Additional Data 706 Section, e.g., the EDNS(0) OPT record. 708 In the SUBSCRIBE response the RCODE indicates whether or not the 709 subscription was accepted. Supported RCODEs are as follows: 711 +----------+-------+------------------------------------------------+ 712 | Mnemonic | Value | Description | 713 +----------+-------+------------------------------------------------+ 714 | NOERROR | 0 | SUBSCRIBE successful. | 715 | FORMERR | 1 | Server failed to process request due to a | 716 | | | malformed request. | 717 | SERVFAIL | 2 | Server failed to process request due to | 718 | | | resource exhaustion. | 719 | NXDOMAIN | 3 | NOT APPLICABLE. DNS Push Notification MUST NOT | 720 | | | return NXDOMAIN errors in response to | 721 | | | SUBSCRIBE requests. | 722 | NOTIMP | 4 | Server does not implement DNS Push | 723 | | | Notifications. | 724 | REFUSED | 5 | Server refuses to process request for policy | 725 | | | or security reasons. | 726 | NOTAUTH | 9 | Server is not authoritative for the requested | 727 | | | name. | 728 +----------+-------+------------------------------------------------+ 730 SUBSCRIBE Response codes 732 This document specifies only these RCODE values for SUBSCRIBE 733 Responses. Servers sending SUBSCRIBE Responses SHOULD use one of 734 these values. However, future circumstances may create situations 735 where other RCODE values are appropriate in SUBSCRIBE Responses, so 736 clients MUST be prepared to accept SUBSCRIBE Responses with any RCODE 737 value. 739 In the first SUBSCRIBE response on a connection, the server MUST 740 include an explicit EDNS(0) TCP Keepalive option. If the first 741 SUBSCRIBE response does not include an explicit EDNS(0) TCP Keepalive 742 option this is an error and the client MUST immediately close the TCP 743 connection. In this case the client should act as if the response 744 contained an EDNS(0) TCP Keepalive option with a value of one hour, 745 and not attempt any further DNS Push Notification requests to that 746 server until one hour has passed. This situation may occur if a 747 client connects to a server that doesn't implement DNS Push 748 Notifications at all, and it is important not to burden such servers 749 with continuous retries. 751 The server MAY include EDNS(0) TCP Keepalive options in subsequent 752 messages, if the idle timeout changes. If the client receives 753 subsequent messages that do not contain an explicit EDNS(0) TCP 754 Keepalive option then the idle timeout for that connection remains 755 unchanged at that time. 757 In an error response, with nonzero RCODE, the server MUST contain an 758 EDNS(0) TCP Keepalive option specifying the delay before the client 759 submits further requests to this server: 761 For RCODE = 1 (FORMERR) the delay may be any value selected by the 762 implementer. A value of one minute is RECOMMENDED, to avoid high 763 load from defective clients. 765 For RCODE = 2 (SERVFAIL), which occurs due to resource exhaustion, 766 the delay should be chosen according to the level of server 767 overload and the anticipated duration of that overload. By 768 default, a value of one minute is RECOMMENDED. 770 For RCODE = 4 (NOTIMP), which occurs on a server that doesn't 771 implement DNS Push Notifications, it is unlikely that the server 772 will begin supporting DNS Push Notifications in the next few 773 minutes, so the retry delay SHOULD be one hour. Note that a 774 server that doesn't implement DNS Push Notifications will most 775 likely not implement this retry delay mechanism using the EDNS(0) 776 TCP Keepalive option either, and in this case the client will fall 777 back to the case described above specifying how to handle 778 SUBSCRIBE responses that do not contain an EDNS(0) TCP Keepalive 779 option. 781 For RCODE = 5 (REFUSED), which occurs on a server that implements 782 DNS Push Notifications, but is currently configured to disallow 783 DNS Push Notifications, the retry delay may be any value selected 784 by the implementer and/or configured by the operator. 785 This is a misconfiguration, since this server is listed in a 786 "_dns-push-tls._tcp." SRV record, but the server itself is 787 not currently configured to support DNS Push Notifications. Since 788 it is possible that the misconfiguration may be repaired at any 789 time, the retry delay should not be set too high. By default, a 790 value of 5 minutes is RECOMMENDED. 792 For RCODE = 9 (NOTAUTH), which occurs on a server that implements 793 DNS Push Notifications, but is not configured to be authoritative 794 for the requested name, the retry delay may be any value selected 795 by the implementer and/or configured by the operator. 796 This is a misconfiguration, since this server is listed in a 797 "_dns-push-tls._tcp." SRV record, but the server itself is 798 not currently configured to support DNS Push Notifications for 799 that zone. Since it is possible that the misconfiguration may be 800 repaired at any time, the retry delay should not be set too high. 801 By default, a value of 5 minutes is RECOMMENDED. 803 For other RCODE values, the retry delay should be set by the 804 server as appropriate for that error condition. By default, a 805 value of 5 minutes is RECOMMENDED. 807 For RCODE = 9 (NOTAUTH), the time delay applies to requests for other 808 names falling within the same zone. Requests for names falling 809 within other zones are not subject to the delay. For all other 810 RCODEs the time delay applies to all subsequent requests to this 811 server. 813 After sending an error response the server MAY close the TCP 814 connection with a FIN, or MAY allow it to remain open, depending on 815 the nature of the error. Clients MUST correctly handle both cases. 817 6.3. DNS Push Notification UNSUBSCRIBE 819 To cancel an individual subscription without closing the entire 820 connection, the client sends an UNSUBSCRIBE message over the 821 established TCP connection to the server. The UNSUBSCRIBE message is 822 formatted identically to the SUBSCRIBE message which created the 823 subscription, with the exact same name, type and class, except that 824 the opcode is UNSUBSCRIBE (7) instead of SUBSCRIBE (6). 826 A client MUST NOT send an UNSUBSCRIBE message that does not exactly 827 match the name, type and class of an existing active subscription on 828 that TLS/TCP connection. If a server receives such an UNSUBSCRIBE 829 message this is an error and the server MUST immediately close the 830 connection. 832 No response message is generated as a result of processing an 833 UNSUBSCRIBE message. 835 Having being successfully revoked with a correctly-formatted 836 UNSUBSCRIBE message, the previously referenced subscription is no 837 longer active and the server MAY discard the state associated with it 838 immediately, or later, at the server's discretion. 840 6.4. DNS Push Notification Update Messages 842 Once a subscription has been successfully established, the server 843 generates Push Notification Updates to send to the client as 844 appropriate. An initial Push Notification Update will be sent 845 immediately in the case that the answer set was non-empty at the 846 moment the subscription was established. Subsequent changes to the 847 answer set are then communicated to the client in subsequent Push 848 Notification Updates. 850 The format of Push Notification Updates borrows from the existing DNS 851 Update [RFC2136] protocol, with some simplifications. 853 The following figure shows the existing DNS Update header format: 855 1 1 1 1 1 1 856 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 857 +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ 858 | ID | 859 +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ 860 |QR| Opcode | Z | RCODE | 861 +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ 862 | ZOCOUNT | 863 +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ 864 | PRCOUNT | 865 +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ 866 | UPCOUNT | 867 +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ 868 | ADCOUNT | 869 +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ 871 Figure 1 873 For DNS Push Notifications the following rules apply: 875 The QR bit MUST be zero, and the Opcode MUST be UPDATE (5). 876 Messages received where this is not true are not Push Notification 877 Update Messages and should be silently ignored for the purposes of 878 Push Notification Update Message handling. 880 ID, the Z bits, and RCODE MUST be zero on transmission, 881 and MUST be silently ignored on reception. 883 ZOCOUNT MUST be zero, and the Zone Section MUST be empty. 884 Any records in the Zone Section MUST be silently ignored. 886 PRCOUNT MUST be zero, and the Prerequisite Section MUST be empty. 887 Any records in the Prerequisite Section MUST be silently ignored. 889 UPCOUNT specifies the number of records in the Update Section. 891 ADCOUNT specifies the number of records in the Additional Data 892 Section. Typically this is zero, but it may be nonzero in some 893 cases, such as when the message includes an EDNS(0) OPT record. 895 The Update Section contains the relevant change information for the 896 client, formatted identically to a DNS Update [RFC2136]. To recap: 898 Delete all RRsets from a name: 899 TTL=0, CLASS=ANY, RDLENGTH=0, TYPE=ANY. 901 Delete an RRset from a name: 902 TTL=0, CLASS=ANY, RDLENGTH=0; 903 TYPE specifies the RRset being deleted. 905 Delete an individual RR from a name: 906 TTL=0, CLASS=NONE; 907 TYPE, RDLENGTH and RDATA specifies the RR being deleted. 909 Add to an RRset: 910 TTL, CLASS, TYPE, RDLENGTH and RDATA specifies the RR being added. 912 When processing the records received in a Push Notification Update 913 Message, the receiving client MUST validate that the records being 914 added or deleted correspond with at least one currently active 915 subscription on that connection. Specifically, the record name MUST 916 match the name given in the SUBSCRIBE request, subject to the usual 917 established DNS case-insensitivity for US-ASCII letters. If the 918 QTYPE in the SUBSCRIBE request was not ANY (255) then the TYPE of the 919 record must match the QTYPE given in the SUBSCRIBE request. If the 920 QCLASS in the SUBSCRIBE request was not ANY (255) then the CLASS of 921 the record must match the QCLASS given in the SUBSCRIBE request. If 922 a matching active subscription on that connection is not found, then 923 that individual record addition/deletion is silently ignored. 924 Processing of other additions and deletions in this message is not 925 affected. The TCP connection is not closed. This is to allow for 926 the race condition where a client sends an outbound UNSUBSCRIBE while 927 inbound Push Notification Updates for that subscription from the 928 server are still in flight. 930 In the case where a single change affects more than one active 931 subscription, only one update is sent. For example, an update adding 932 a given record may match both a SUBSCRIBE request with the same QTYPE 933 and a different SUBSCRIBE request with QTYPE=ANY. It is not the case 934 that two updates are sent because the new record matches two active 935 subscriptions. 937 The server SHOULD encode change notifications in the most efficient 938 manner possible. For example, when three AAAA records are deleted 939 from a given name, and no other AAAA records exist for that name, the 940 server SHOULD send a "delete an RRset from a name" update, not three 941 separate "delete an individual RR from a name" updates. Similarly, 942 when both an SRV and a TXT record are deleted from a given name, and 943 no other records of any kind exist for that name, the server SHOULD 944 send a "delete all RRsets from a name" update, not two separate 945 "delete an RRset from a name" updates. 947 A server SHOULD combine multiple change notifications in a single 948 Update Message when possible, even if those change notifications 949 apply to different subscriptions. Conceptually, a Push Notification 950 Update Message is a connection-level concept, not a subscription- 951 level concept. 953 Push Notification Update Messages MAY contain an EDNS(0) TCP 954 Keepalive option [I-D.ietf-dnsop-edns-tcp-keepalive] if the idle 955 timeout has changed since the last time the server sent an EDNS(0) 956 TCP Keepalive option on this connection. 958 In the event that the server wishes to inform a client of a new idle 959 timeout for the connection, the server MAY combine that with the next 960 message it sends to the client, or the server MAY send an empty Push 961 Notification Update Message (zero records in the Update Section) to 962 carry the EDNS(0) TCP Keepalive option. Clients MUST correctly 963 receive and process the EDNS(0) TCP Keepalive option in both cases. 965 Reception of a Push Notification Update Message does not directly 966 generate a response back to the server. (Updates may indirectly 967 generate other operations; e.g., a Push Notification Update Message 968 declaring the appearance of a PTR record could lead to a query for 969 the SRV record named in the rdata of that PTR record[RFC6763]. 971 The TTL of an added record is stored by the client and decremented as 972 time passes, with the caveat that for as long as a relevant 973 subscription is active, the TTL does not decrement below 1 second. 974 For as long as a relevant subscription remains active, the client 975 SHOULD assume that when a record goes away the server will notify it 976 of that fact. Consequently, a client does not have to poll to verify 977 that the record is still there. Once a subscription is cancelled 978 (individually, or as a result of the TCP connection being closed) 979 record aging resumes and records are removed from the local cache 980 when their TTL reaches zero. 982 6.5. DNS RECONFIRM 984 Sometimes, particularly when used with a Hybrid Proxy 985 [I-D.ietf-dnssd-hybrid], a DNS Zone may contain stale data. When a 986 client encounters data that it believe may be stale (e.g., an SRV 987 record referencing a target host+port that is not responding to 988 connection requests) the client sends a DNS RECONFIRM message to 989 request that the server re-verify that the data is still valid. For 990 a Hybrid Proxy, this causes it to issue new Multicast DNS requests to 991 ascertain whether the target device is still present. For other 992 kinds of DNS server the RECONFIRM operation is currently undefined 993 and SHOULD be silently ignored. 995 A RECONFIRM request is formatted similarly to a conventional DNS 996 QUERY request [RFC1035], except that the opcode is RECONFIRM (8) 997 instead of QUERY (0). QTYPE MUST NOT be the value ANY (255). QCLASS 998 MUST NOT be the value ANY (255). 1000 In a RECONFIRM request the DNS Header QR bit MUST be zero. 1001 If the QR bit is not zero the message is not a RECONFIRM request. 1003 The AA, TC, RD, RA, Z, AD, and CD bits, the ID field, and the RCODE 1004 field, MUST be zero on transmission, and MUST be silently ignored on 1005 reception. 1007 Like a DNS QUERY request, a RECONFIRM request MUST contain exactly 1008 one question. Since RECONFIRM requests are sent over TCP, multiple 1009 RECONFIRM requests can be concatenated in a single TCP stream and 1010 packed efficiently into TCP segments, so the ability to pack multiple 1011 RECONFIRM operations into a single DNS message within that TCP stream 1012 would add extra complexity for little benefit. 1014 ANCOUNT MUST be nonzero, and the Answer Section MUST contain the 1015 rdata for the record(s) that the client believes to be in doubt. 1017 NSCOUNT MUST be zero, and the Authority Section MUST be empty. 1018 Any records in the Authority Section MUST be silently ignored. 1020 ARCOUNT specifies the number of records in the Additional Data 1021 Section. Typically this is zero, but it may be nonzero in some 1022 cases, such as when the request includes an EDNS(0) OPT record. 1024 DNS wildcarding is not supported. That is, a wildcard ("*") in a 1025 SUBSCRIBE message matches only a wildcard ("*") in the zone, and 1026 nothing else. 1028 Aliasing is not supported. That is, a CNAME in a SUBSCRIBE message 1029 matches only a CNAME in the zone, and nothing else. 1031 No response message is generated as a result of processing a 1032 RECONFIRM message. 1034 If the server receiving the RECONFIRM request determines that the 1035 records are in fact no longer valid, then subsequent DNS Push 1036 Notification Update Messages will be generated to inform interested 1037 clients. Thus, one client discovering that a previously-advertised 1038 printer is no longer present has the side effect of informing all 1039 other interested clients that the printer in question is now gone. 1041 6.6. DNS Push Notification Termination Message 1043 If a server is low on resources it MAY simply terminate a client 1044 connection with a TCP RST. However, the likely behaviour of the 1045 client may be simply to reconnect immediately, putting more burden on 1046 the server. Therefore, a server SHOULD instead choose to shed client 1047 load by (a) sending a DNS Push Notification Termination Message and 1048 then (b) immediately closing the client connection with a TCP FIN 1049 instead of RST, thereby facilitating reliable delivery of the 1050 Termination Message. Upon successful reception of the Termination 1051 Message the client is expected to close the connection. The server 1052 SHOULD set a timer and, if the client has not closed the connection 1053 within a reasonable time, the server SHOULD then terminate the TCP 1054 connection with a TCP RST. The RECOMMENDED time the server should 1055 wait before terminating the TCP connection with a TCP RST is ten 1056 seconds. 1058 The format of a Termination Message is similar to a Push Notification 1059 Update. 1061 The following figure shows the existing DNS Update header format: 1063 1 1 1 1 1 1 1064 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 1065 +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ 1066 | ID | 1067 +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ 1068 |QR| Opcode | Z | RCODE | 1069 +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ 1070 | ZOCOUNT | 1071 +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ 1072 | PRCOUNT | 1073 +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ 1074 | UPCOUNT | 1075 +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ 1076 | ADCOUNT | 1077 +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ 1079 Figure 2 1081 For Termination Messages the following rules apply: 1083 The QR bit MUST be zero, and the Opcode MUST be UPDATE (5). 1084 Messages received where this is not true are not Termination Messages 1085 and should be silently ignored. 1087 ID and the Z bits MUST be zero on transmission, 1088 and MUST be silently ignored on reception. 1090 ZOCOUNT MUST be zero, and the Zone Section MUST be empty. 1091 Any records in the Zone Section MUST be silently ignored. 1093 PRCOUNT MUST be zero, and the Prerequisite Section MUST be empty. 1094 Any records in the Prerequisite Section MUST be silently ignored. 1096 UPCOUNT MUST be zero, and the Update Section MUST be empty. 1097 Any records in the Update Section MUST be silently ignored. 1099 ADCOUNT specifies the number of records in the Additional Data 1100 Section, e.g., the EDNS(0) OPT record.. 1102 The RCODE MUST contain a nonzero code giving the reason for 1103 termination, as indicated below: 1105 +----------+-------+------------------------------------------------+ 1106 | Mnemonic | Value | Description | 1107 +----------+-------+------------------------------------------------+ 1108 | SERVFAIL | 2 | The server is overloaded due to resource | 1109 | | | exhaustion. | 1110 | REFUSED | 5 | The server has been reconfigured and is no | 1111 | | | longer accepting DNS Push Notification | 1112 | | | requests for one or more of the currently | 1113 | | | subscribed names. | 1114 +----------+-------+------------------------------------------------+ 1116 Termination Response codes 1118 This document specifies only these two RCODE values for Termination 1119 Messages. Servers sending Termination Messages SHOULD use one of 1120 these two values. However, future circumstances may create 1121 situations where other RCODE values are appropriate in Termination 1122 Messages, so clients MUST be prepared to accept Termination Messages 1123 with any RCODE value. In particular, a Termination Message with 1124 RCODE value zero (NOERROR) is still a Termination Message and should 1125 be treated as such. 1127 The Termination Message MUST contain an EDNS(0) TCP Keepalive option 1128 [I-D.ietf-dnsop-edns-tcp-keepalive]. The client MUST wait for the 1129 time indicated in the EDNS(0) TCP Keepalive option's idle timeout 1130 before attempting any new connections to this server. A client that 1131 receives a Termination Message without an EDNS(0) TCP Keepalive 1132 option SHOULD treat it as equivalent to a TCP Keepalive option with a 1133 zero timeout value. 1135 In the case where the server is rejecting some, but not all, of the 1136 existing subscriptions (perhaps because it has been reconfigured and 1137 is no longer authoritative for those names) with a REFUSED (5) RCODE, 1138 the EDNS(0) TCP Keepalive option's idle timeout MAY be zero, 1139 indicating that the client SHOULD attempt to re-establish its 1140 subscriptions immediately. 1142 In the case where a server is terminating a large number of 1143 connections at once (e.g., if the system is restarting) and the 1144 server doesn't want to be inundated with a flood of simultaneous 1145 retries, it SHOULD send different EDNS(0) TCP Keepalive values to 1146 each client. These adjustments MAY be selected randomly, 1147 pseudorandomly, or deterministically (e.g., incrementing the time 1148 value by one tenth of a second for each successive client, yielding a 1149 post-restart reconnection rate of ten clients per second). 1151 7. Security Considerations 1153 TLS support is REQUIRED in DNS Push Notifications. There is no 1154 provision for opportunistic encryption using a mechanism like 1155 "STARTTLS". 1157 DNSSEC is RECOMMENDED for DNS Push Notifications. TLS alone does not 1158 provide complete security. TLS certificate verification can provide 1159 reasonable assurance that the client is really talking to the server 1160 associated with the desired host name, but since the desired host 1161 name is learned via a DNS SRV query, if the SRV query is subverted 1162 then the client may have a secure connection to a rogue server. 1163 DNSSEC can provided added confidence that the SRV query has not been 1164 subverted. 1166 7.1. Security Services 1168 It is the goal of using TLS to provide the following security 1169 services: 1171 Confidentiality: All application-layer communication is encrypted 1172 with the goal that no party should be able to decrypt it except 1173 the intended receiver. 1175 Data integrity protection: Any changes made to the communication in 1176 transit are detectable by the receiver. 1178 Authentication: An end-point of the TLS communication is 1179 authenticated as the intended entity to communicate with. 1181 Deployment recommendations on the appropriate key lengths and cypher 1182 suites are beyond the scope of this document. Please refer to TLS 1183 Recommendations [RFC7525] for the best current practices. Keep in 1184 mind that best practices only exist for a snapshot in time and 1185 recommendations will continue to change. Updated versions or errata 1186 may exist for these recommendations. 1188 7.2. TLS Name Authentication 1190 As described in Section 6.1, the client discovers the DNS Push 1191 Notification server using an SRV lookup for the record name 1192 "_dns-push-tls._tcp.". The server connection endpoint SHOULD 1193 then be authenticated using DANE TLSA records for the associated SRV 1194 record. This associates the target's name and port number with a 1195 trusted TLS certificate [RFC7673]. This procedure uses the TLS Sever 1196 Name Indication (SNI) extension [RFC6066] to inform the server of the 1197 name the client has authenticated through the use of TLSA records. 1198 Therefore, if the SRV record passes DNSSEC validation and a TLSA 1199 record matching the target name is useable, an SNI extension MUST be 1200 used for the target name to ensure the client is connecting to the 1201 server it has authenticated. If the target name does not have a 1202 usable TLSA record, then the use of the SNI extension is optional. 1204 7.3. TLS Compression 1206 In order to reduce the chances of compression related attacks, TLS- 1207 level compression SHOULD be disabled when using TLS versions 1.2 and 1208 earlier. In the draft version of TLS 1.3 [I-D.ietf-tls-tls13], TLS- 1209 level compression has been removed completely. 1211 7.4. TLS Session Resumption 1213 TLS Session Resumption is permissible on DNS Push Notification 1214 servers. The server may keep TLS state with Session IDs [RFC5246] or 1215 operate in stateless mode by sending a Session Ticket [RFC5077] to 1216 the client for it to store. However, once the connection is closed, 1217 any existing subscriptions will be dropped. When the TLS session is 1218 resumed, the DNS Push Notification server will not have any 1219 subscription state and will proceed as with any other new connection. 1220 Use of TLS Session Resumption allows a new TLS connection to be set 1221 up more quickly, but the client will still have to recreate any 1222 desired subscriptions. 1224 8. IANA Considerations 1226 This document defines the service name: "_dns-push-tls._tcp". 1227 It is only applicable for the TCP protocol. 1228 This name is to be published in the IANA Service Name Registry. 1230 This document defines three DNS OpCodes: SUBSCRIBE with (tentative) 1231 value 6, UNSUBSCRIBE with (tentative) value 7, and RECONFIRM with 1232 (tentative) value 8. 1234 9. Acknowledgements 1236 The authors would like to thank Kiren Sekar and Marc Krochmal for 1237 previous work completed in this field. 1239 This draft has been improved due to comments from Ran Atkinson, Tim 1240 Chown, Mark Delany, Ralph Droms, Bernie Volz, Jan Komissar, Manju 1241 Shankar Rao, Markus Stenberg, Dave Thaler, and Soraia Zlatkovic. 1243 10. References 1245 10.1. Normative References 1247 [I-D.ietf-dnsop-edns-tcp-keepalive] 1248 Wouters, P., Abley, J., Dickinson, S., and R. Bellis, "The 1249 edns-tcp-keepalive EDNS0 Option", draft-ietf-dnsop-edns- 1250 tcp-keepalive-06 (work in progress), February 2016. 1252 [I-D.ietf-tls-tls13] 1253 Rescorla, E., "The Transport Layer Security (TLS) Protocol 1254 Version 1.3", draft-ietf-tls-tls13-12 (work in progress), 1255 March 2016. 1257 [RFC0768] Postel, J., "User Datagram Protocol", STD 6, RFC 768, DOI 1258 10.17487/RFC0768, August 1980, 1259 . 1261 [RFC0793] Postel, J., "Transmission Control Protocol", STD 7, RFC 1262 793, DOI 10.17487/RFC0793, September 1981, 1263 . 1265 [RFC1034] Mockapetris, P., "Domain names - concepts and facilities", 1266 STD 13, RFC 1034, DOI 10.17487/RFC1034, November 1987, 1267 . 1269 [RFC1035] Mockapetris, P., "Domain names - implementation and 1270 specification", STD 13, RFC 1035, DOI 10.17487/RFC1035, 1271 November 1987, . 1273 [RFC1123] Braden, R., Ed., "Requirements for Internet Hosts - 1274 Application and Support", STD 3, RFC 1123, DOI 10.17487/ 1275 RFC1123, October 1989, 1276 . 1278 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 1279 Requirement Levels", BCP 14, RFC 2119, DOI 10.17487/ 1280 RFC2119, March 1997, 1281 . 1283 [RFC2136] Vixie, P., Ed., Thomson, S., Rekhter, Y., and J. Bound, 1284 "Dynamic Updates in the Domain Name System (DNS UPDATE)", 1285 RFC 2136, DOI 10.17487/RFC2136, April 1997, 1286 . 1288 [RFC2782] Gulbrandsen, A., Vixie, P., and L. Esibov, "A DNS RR for 1289 specifying the location of services (DNS SRV)", RFC 2782, 1290 DOI 10.17487/RFC2782, February 2000, 1291 . 1293 [RFC5246] Dierks, T. and E. Rescorla, "The Transport Layer Security 1294 (TLS) Protocol Version 1.2", RFC 5246, DOI 10.17487/ 1295 RFC5246, August 2008, 1296 . 1298 [RFC6066] Eastlake 3rd, D., "Transport Layer Security (TLS) 1299 Extensions: Extension Definitions", RFC 6066, DOI 1300 10.17487/RFC6066, January 2011, 1301 . 1303 [RFC6891] Damas, J., Graff, M., and P. Vixie, "Extension Mechanisms 1304 for DNS (EDNS(0))", STD 75, RFC 6891, DOI 10.17487/ 1305 RFC6891, April 2013, 1306 . 1308 [RFC6895] Eastlake 3rd, D., "Domain Name System (DNS) IANA 1309 Considerations", BCP 42, RFC 6895, DOI 10.17487/RFC6895, 1310 April 2013, . 1312 [RFC7673] Finch, T., Miller, M., and P. Saint-Andre, "Using DNS- 1313 Based Authentication of Named Entities (DANE) TLSA Records 1314 with SRV Records", RFC 7673, DOI 10.17487/RFC7673, October 1315 2015, . 1317 [RFC7766] Dickinson, J., Dickinson, S., Bellis, R., Mankin, A., and 1318 D. Wessels, "DNS Transport over TCP - Implementation 1319 Requirements", RFC 7766, DOI 10.17487/RFC7766, March 2016, 1320 . 1322 10.2. Informative References 1324 [I-D.ietf-dnssd-hybrid] 1325 Cheshire, S., "Hybrid Unicast/Multicast DNS-Based Service 1326 Discovery", draft-ietf-dnssd-hybrid-03 (work in progress), 1327 November 2015. 1329 [I-D.ietf-dprive-dns-over-tls] 1330 Zi, Z., Zhu, L., Heidemann, J., Mankin, A., Wessels, D., 1331 and P. Hoffman, "Specification for DNS over TLS", draft- 1332 ietf-dprive-dns-over-tls-09 (work in progress), March 1333 2016. 1335 [I-D.sekar-dns-llq] 1336 Sekar, K., "DNS Long-Lived Queries", draft-sekar-dns- 1337 llq-01 (work in progress), August 2006. 1339 [IPJ.9-4-TCPSYN] 1340 Eddy, W., "Defenses Against TCP SYN Flooding Attacks", The 1341 Internet Protocol Journal, Cisco Systems, Volume 9, Number 1342 4, December 2006. 1344 [RFC1996] Vixie, P., "A Mechanism for Prompt Notification of Zone 1345 Changes (DNS NOTIFY)", RFC 1996, DOI 10.17487/RFC1996, 1346 August 1996, . 1348 [RFC4287] Nottingham, M., Ed. and R. Sayre, Ed., "The Atom 1349 Syndication Format", RFC 4287, DOI 10.17487/RFC4287, 1350 December 2005, . 1352 [RFC4953] Touch, J., "Defending TCP Against Spoofing Attacks", RFC 1353 4953, DOI 10.17487/RFC4953, July 2007, 1354 . 1356 [RFC5077] Salowey, J., Zhou, H., Eronen, P., and H. Tschofenig, 1357 "Transport Layer Security (TLS) Session Resumption without 1358 Server-Side State", RFC 5077, DOI 10.17487/RFC5077, 1359 January 2008, . 1361 [RFC6762] Cheshire, S. and M. Krochmal, "Multicast DNS", RFC 6762, 1362 DOI 10.17487/RFC6762, February 2013, 1363 . 1365 [RFC6763] Cheshire, S. and M. Krochmal, "DNS-Based Service 1366 Discovery", RFC 6763, DOI 10.17487/RFC6763, February 2013, 1367 . 1369 [RFC7525] Sheffer, Y., Holz, R., and P. Saint-Andre, 1370 "Recommendations for Secure Use of Transport Layer 1371 Security (TLS) and Datagram Transport Layer Security 1372 (DTLS)", BCP 195, RFC 7525, DOI 10.17487/RFC7525, May 1373 2015, . 1375 [XEP0060] Millard, P., Saint-Andre, P., and R. Meijer, "Publish- 1376 Subscribe", XSF XEP 0060, July 2010. 1378 Authors' Addresses 1380 Tom Pusateri 1381 Seeking affiliation 1382 Hilton Head Island, SC 1383 USA 1385 Phone: +1 843 473 7394 1386 Email: pusateri@bangj.com 1388 Stuart Cheshire 1389 Apple Inc. 1390 1 Infinite Loop 1391 Cupertino, CA 95014 1392 USA 1394 Phone: +1 408 974 3207 1395 Email: cheshire@apple.com