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