idnits 2.17.1 draft-ietf-dnssd-push-02.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 == Using lowercase 'not' together with uppercase 'MUST', 'SHALL', 'SHOULD', or 'RECOMMENDED' is not an accepted usage according to RFC 2119. Please use uppercase 'NOT' together with RFC 2119 keywords (if that is what you mean). Found 'MUST not' in this paragraph: A DNS Push Notification client MUST not routinely keep a DNS Push Notification subscription active 24 hours a day 7 days a week just to keep a list in memory up to date so that it will be really fast if the user does choose to bring up an on-screen display of that data. DNS Push Notifications are designed to be fast enough that there is no need to pre-load a "warm" list in memory just in case it might be needed later. -- The document date (October 19, 2015) is 3111 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 (-06) exists of draft-ietf-dnsop-5966bis-03 == Outdated reference: A later version (-28) exists of draft-ietf-tls-tls13-09 ** Obsolete normative reference: RFC 793 (Obsoleted by RFC 9293) ** Downref: Normative reference to an Informational RFC: RFC 4953 ** Obsolete normative reference: RFC 5246 (Obsoleted by RFC 8446) ** Obsolete normative reference: RFC 5966 (Obsoleted by RFC 7766) ** Obsolete normative reference: RFC 6195 (Obsoleted by RFC 6895) == Outdated reference: A later version (-10) exists of draft-ietf-dnssd-hybrid-01 == 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: 5 errors (**), 0 flaws (~~), 6 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: April 21, 2016 Apple Inc. 6 October 19, 2015 8 DNS Push Notifications 9 draft-ietf-dnssd-push-02 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 April 21, 2016. 38 Copyright Notice 40 Copyright (c) 2015 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 . . . . . . . . . . . . . . . . . . . . . . . . . . 5 60 5. State Considerations . . . . . . . . . . . . . . . . . . . . 6 61 6. Protocol Operation . . . . . . . . . . . . . . . . . . . . . 7 62 6.1. Discovery . . . . . . . . . . . . . . . . . . . . . . . . 7 63 6.2. DNS Push Notification SUBSCRIBE . . . . . . . . . . . . . 9 64 6.3. DNS Push Notification UNSUBSCRIBE . . . . . . . . . . . . 12 65 6.4. DNS Push Notification Update Messages . . . . . . . . . . 13 66 6.5. DNS RECONFIRM . . . . . . . . . . . . . . . . . . . . . . 16 67 6.6. DNS Push Notification Termination Message . . . . . . . . 18 68 7. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 19 69 8. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 19 70 9. Security Considerations . . . . . . . . . . . . . . . . . . . 19 71 9.1. Security Services . . . . . . . . . . . . . . . . . . . . 19 72 9.2. TLS Name Authentication . . . . . . . . . . . . . . . . . 20 73 9.3. TLS Compression . . . . . . . . . . . . . . . . . . . . . 20 74 9.4. TLS Session Resumption . . . . . . . . . . . . . . . . . 20 75 10. References . . . . . . . . . . . . . . . . . . . . . . . . . 21 76 10.1. Normative References . . . . . . . . . . . . . . . . . . 21 77 10.2. Informative References . . . . . . . . . . . . . . . . . 22 78 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 23 80 1. Introduction 82 DNS records may be updated using DNS Update [RFC2136]. Other 83 mechanisms such as a Hybrid Proxy [I-D.ietf-dnssd-hybrid] can also 84 generate changes to a DNS zone. This document specifies a protocol 85 for Unicast DNS clients to subscribe to receive asynchronous 86 notifications of changes to RRSets of interest. It is immediately 87 relevant in the case of DNS Service Discovery [RFC6763] but is not 88 limited to that use case and provides a general DNS mechanism for DNS 89 record change notifications. Familiarity with the DNS protocol and 90 DNS packet formats is assumed [RFC1034] [RFC1035] [RFC6195]. 92 1.1. Requirements Language 94 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 95 "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and 96 "OPTIONAL" in this document are to be interpreted as described in 97 "Key words for use in RFCs to Indicate Requirement Levels" [RFC2119]. 99 2. Motivation 101 As the domain name system continues to adapt to new uses and changes 102 in deployment, polling has the potential to burden DNS servers at 103 many levels throughout the network. Other network protocols have 104 successfully deployed a publish/subscribe model to state changes 105 following the Observer design pattern. XMPP Publish-Subscribe 106 [XEP-0060] and Atom [RFC4287] are examples. While DNS servers are 107 generally highly tuned and capable of a high rate of query/response 108 traffic, adding a publish/subscribe model for tracking changes to DNS 109 records can result in more timely notification of changes with 110 reduced CPU usage and lower network traffic. 112 Multicast DNS [RFC6762] implementations always listen on a well known 113 link-local IP multicast group, and new services and updates are sent 114 for all group members to receive. Therefore, Multicast DNS already 115 has asynchronous change notification capability. However, when DNS 116 Service Discovery [RFC6763] is used across a wide area network using 117 Unicast DNS (possibly facilitated via a Hybrid Proxy 118 [I-D.ietf-dnssd-hybrid]) it would be beneficial to have an equivalent 119 capability for Unicast DNS, to allow clients to learn about DNS 120 record changes in a timely manner without polling. 122 DNS Long-Lived Queries (LLQ) [I-D.sekar-dns-llq] is an existing 123 deployed solution to provide asynchronous change notifications. Even 124 though it can be used over TCP, LLQ is defined primarily as a UDP- 125 based protocol, and as such it defines its own equivalents of 126 existing TCP features like the three-way handshake. This document 127 builds on experience gained with the LLQ protocol, with an improved 128 design that uses long-lived TCP connections instead of UDP (and 129 therefore doesn't need to duplicate existing TCP functionality), and 130 adopts the syntax and semantics of DNS Update messages [RFC2136] 131 instead of inventing a new vocabulary of messages to communicate DNS 132 zone changes. 134 Because DNS Push Notifications impose a certain load on the 135 responding server (though less load that rapid polling of that 136 server) DNS Push Notification clients SHOULD exercise restraint in 137 issuing DNS Push Notification subscriptions. A subscription SHOULD 138 only be active when there is a valid reason to need live data (for 139 example, an on-screen display is currently showing the results of 140 that subscription to the user) and the subscription SHOULD be 141 cancelled as soon as the need for that data ends (for example, when 142 the user dismisses that display). 144 A DNS Push Notification client MUST not routinely keep a DNS Push 145 Notification subscription active 24 hours a day 7 days a week just to 146 keep a list in memory up to date so that it will be really fast if 147 the user does choose to bring up an on-screen display of that data. 148 DNS Push Notifications are designed to be fast enough that there is 149 no need to pre-load a "warm" list in memory just in case it might be 150 needed later. 152 3. Overview 154 The existing DNS Update protocol [RFC2136] provides a mechanism for 155 clients to add or delete individual resource records (RRs) or entire 156 resource record sets (RRSets) on the zone's server. Adopting this 157 existing syntax and semantics for DNS Push Notifications allows for 158 messages going in the other direction, from server to client, to 159 communicate changes to a zone. The client first must subscribe for 160 Push Notifications by connecting to the server and sending DNS 161 message(s) indicating the RRSet(s) of interest. When the client 162 loses interest in updates to these records, it unsubscribes. 164 The DNS Push Notification server for a zone is any server capable of 165 generating the correct change notifications for a name. It may be a 166 master, slave, or stealth name server [RFC1996]. Consequently, the 167 "_dns-push-tls._tcp." SRV record for a MAY reference the 168 same target host and port as that zone's 169 "_dns-update-tls._tcp." SRV record. When the same target host 170 and port is offered for both DNS Updates and DNS Push Notifications, 171 a client MAY use a single TCP connection to that server for DNS 172 Updates, DNS Queries, and DNS Push Notification Queries. 174 DNS Push Notification clients are NOT required to implement DNS 175 Update Prerequisite processing. Prerequisites are used to perform 176 tentative atomic test-and-set type operations on the server, and that 177 concept has no application when it comes to an authoritative server 178 informing a client of changes to DNS records. 180 4. Transport 182 Implementations of DNS Update [RFC2136] MAY use either User Datagram 183 Protocol (UDP) [RFC0768] or Transmission Control Protocol (TCP) 184 [RFC0793] as the transport protocol, in keeping with the historical 185 precedent that DNS queries must first be sent over UDP [RFC1123]. 186 This requirement to use UDP has subsequently been relaxed 187 [RFC5966][I-D.ietf-dnsop-5966bis]. Following that precendent, DNS 188 Push Notification is defined only for TCP. DNS Push Notification 189 clients MUST use TLS over TCP. 191 Either end of the TCP connection can terminate all of the 192 subscriptions on that connection by simply closing the connection 193 abruptly with a TCP FIN or RST. (An individual subscription is 194 terminated by sending an UNSUBSCRIBE message for that specific 195 subscription.) 197 If a client closes the connection, it is signaling that it is no 198 longer interested in receiving updates to any of the records it has 199 subscribed. It is informing the server that the server may release 200 all state information it has been keeping with regards to this 201 client. This may occur because the client computer has been 202 disconnected from the network, has gone to sleep, or the application 203 requiring the records has terminated. 205 If a server closes the connection, it is informing the client that it 206 can no longer provide updates for the subscribed records. This may 207 occur because the server application software or operating system is 208 restarting, the application terminated unexpectedly, the server is 209 undergoing maintenance procedures, or the server is overloaded and 210 can no longer provide the information to all the clients that wish to 211 receive it. The client can try to re-subscribe at a later time or 212 connect to another server supporting DNS Push Notifications for the 213 zone. 215 Connection setup over TCP ensures return reachability and alleviates 216 concerns of state overload at the server through anonymous 217 subscriptions. All subscribers are guaranteed to be reachable by the 218 server by virtue of the TCP three-way handshake. Because TCP SYN 219 flooding attacks are possible with any protocol over TCP, 220 implementers are encouraged to use industry best practices to guard 221 against such attacks [IPJ.9-4-TCPSYN] [RFC4953]. 223 Transport Layer Security (TLS) [RFC5246] is well understood and 224 deployed across many protocols running over TCP. It is designed to 225 prevent eavesdropping, tampering, or message forgery. TLS is 226 REQUIRED for every connection between a client subscriber and server 227 in this protocol specification. Additional security measures such as 228 client authentication during TLS negotiation MAY also be employed to 229 increase the trust relationship between client and server. 230 Additional authentication of the SRV target using DNSSEC verification 231 and DANE TLSA records [RFC7673] is strongly encouraged. See below in 232 Section 9.2 for details. 234 5. State Considerations 236 Each DNS Push Notification server is capable and handling some finite 237 number of Push Notification subscriptions. This number will vary 238 from server to server and is based on physical machine 239 characteristics, network bandwidth, and operating system resource 240 allocation. After a client establishes a connection to a DNS server, 241 each record subscription is individually accepted or rejected. 242 Servers may employ various techniques to limit subscriptions to a 243 manageable level. Correspondingly, the client is free to establish 244 simultaneous connections to alternate DNS servers that support DNS 245 Push Notifications for the zone and distribute record subscriptions 246 at its discretion. In this way, both clients and servers can react 247 to resource constraints. Token bucket rate limiting schemes are also 248 effective in providing fairness by a server across numerous client 249 requests. 251 6. Protocol Operation 253 A DNS Push Notification exchange begins with the client discovering 254 the appropriate server, and then making a TLS/TCP connection to it. 255 The client may then add and remove Push Notification subscriptions 256 over this connection. In accordance with the current set of active 257 subscriptions the server sends relevant asynchronous Push 258 Notifications to the client. The exchange terminates when either end 259 closes the TCP connection with a TCP FIN or RST. 261 A client SHOULD NOT make multiple TLS/TCP connections to the same DNS 262 Push Notification server. A client SHOULD share a single TLS/TCP 263 connection for all requests to the same DNS Push Notification server. 264 This shared connection should be used for all DNS Queries and DNS 265 Push Notification Queries queries to that server, and for DNS Update 266 requests too when the "_dns-update-tls._tcp." SRV record 267 indicates that the same server also handles DNS Update requests. 268 This is to reduce unnecessary load on the DNS Push Notification 269 server. 271 However, a single client device may be home to multiple independent 272 client software instances that don't know about each other, so a DNS 273 Push Notification server MUST be prepared to accept multiple 274 connections from the same client IP address. This is undesirable 275 from an efficiency stanpoint, but may be unavoidable in some 276 situations, so a DNS Push Notification server MUST be prepared to 277 accept multiple connections from the same client IP address. 279 6.1. Discovery 281 The first step in DNS Push Notification subscription is to discover 282 an appropriate DNS server that supports DNS Push Notifications for 283 the desired zone. The client MUST also determine which TCP port on 284 the server is listening for connections, which need not be (and often 285 is not) the typical TCP port 53 used for conventional DNS. 287 1. The client begins the discovery by sending a DNS query to the 288 local resolver with record type SOA [RFC1035] for the name of the 289 record it wishes to subscribe. 291 2. If the SOA record exists, it MUST be returned in the Answer 292 Section of the reply. If not, the server SHOULD include the SOA 293 record for the zone of the requested name in the Authority 294 Section. 296 3. If no SOA record is returned, the client then strips off the 297 leading label from the requested name. If the resulting name has 298 at least one label in it, the client sends a new SOA query and 299 processing continues at step 2 above. If the resulting name is 300 empty (the root label) then this is a network configuration error 301 and the client gives up. The client MAY retry the operation at a 302 later time. 304 4. Once the SOA is known, the client sends a DNS query with type SRV 305 [RFC2782] for the record name "_dns-push-tls._tcp.", where 306 is the owner name of the discovered SOA record. 308 5. If the zone in question does not offer DNS Push Notifications 309 then SRV record MUST NOT exist and the SRV query will return a 310 negative answer. 312 6. If the zone in question is set up to offer DNS Push Notifications 313 then this SRV record MUST exist. The SRV "target" contains the 314 name of the server providing DNS Push Notifications for the zone. 315 The port number on which to contact the server is in the SRV 316 record "port" field. The address(es) of the target host MAY be 317 included in the Additional Section, however, the address records 318 SHOULD be authenticated before use as described below in 319 Section 9.2 [RFC7673]. 321 7. More than one SRV record may be returned. In this case, the 322 "priority" and "weight" values in the returned SRV records are 323 used to determine the order in which to contact the servers for 324 subscription requests. As described in the SRV specification 325 [RFC2782], the server with the lowest "priority" is first 326 contacted. If more than one server has the same "priority", the 327 "weight" is indicates the weighted probability that the client 328 should contact that server. Higher weights have higher 329 probabilities of being selected. If a server is not reachable or 330 is not willing to accept a subscription request, then a 331 subsequent server is to be contacted. 333 If a server closes a DNS Push Notification subscription connection, 334 the client SHOULD repeat the discovery process in order to determine 335 the preferred DNS server for subscriptions at that time. 337 6.2. DNS Push Notification SUBSCRIBE 339 A DNS Push Notification client indicates its desire to receive DNS 340 Push Notifications for a given domain name by sending a SUBSCRIBE 341 request over the established TCP connection to the server. A 342 SUBSCRIBE request is formatted identically to a conventional DNS 343 QUERY request [RFC1035], except that the opcode is SUBSCRIBE (6) 344 instead of QUERY (0). If neither QTYPE nor QCLASS are ANY (255) then 345 this is a specific subscription to changes for the given name, type 346 and class. If one or both of QTYPE or QCLASS are ANY (255) then this 347 subscription matches any type and/or any class, as appropriate. 349 In a SUBSCRIBE request the DNS Header QR bit MUST be zero. 350 If the QR bit is not zero the message is not a SUBSCRIBE request. 352 The AA, TC, RD, RA, Z, AD, and CD bits, the ID field, and the RCODE 353 field, MUST be zero on transmission, and MUST be silently ignored on 354 reception. 356 Like a DNS QUERY request, a SUBSCRIBE request MUST contain exactly 357 one question. Since SUBSCRIBE requests are sent over TCP, multiple 358 SUBSCRIBE requests can be concatenated in a single TCP stream and 359 packed efficiently into TCP segments, so the ability to pack multiple 360 SUBSCRIBE operations into a single DNS message within that TCP stream 361 would add extra complexity for little benefit. 363 ANCOUNT MUST be zero, and the Answer Section MUST be empty. 364 Any records in the Answer Section MUST be silently ignored. 366 NSCOUNT MUST be zero, and the Authority Section MUST be empty. 367 Any records in the Authority Section MUST be silently ignored. 369 ARCOUNT MUST be zero, and the Additional Section MUST be empty. 370 Any records in the Additional Section MUST be silently ignored. 372 Each SUBSCRIBE request generates exactly one SUBSCRIBE response from 373 the server. 375 In the SUBSCRIBE response the RCODE indicates whether or not the 376 subscription was accepted. Supported RCODEs are as follows: 378 +----------+-------+------------------------------------------------+ 379 | Mnemonic | Value | Description | 380 +----------+-------+------------------------------------------------+ 381 | NOERROR | 0 | SUBSCRIBE successful | 382 | FORMERR | 1 | Server failed to process request due to a | 383 | | | malformed request | 384 | SERVFAIL | 2 | Server failed to process request due to | 385 | | | resource exhaustion | 386 | NOTIMP | 4 | Server does not implement DNS Push | 387 | | | Notifications | 388 | REFUSED | 5 | Server refuses to process request for policy | 389 | | | or security reasons | 390 +----------+-------+------------------------------------------------+ 392 Table 1: Response codes 394 In a SUBSCRIBE response the DNS Header QR bit MUST be one. 395 If the QR bit is not one the message is not a SUBSCRIBE response. 397 The AA, TC, RD, RA, Z, AD, and CD bits, and the ID field, MUST be 398 zero on transmission, and MUST be silently ignored on reception. 400 The Question Section MUST echo back the values provided by the client 401 in the SUBSCRIBE request that generated this SUBSCRIBE response. 403 ANCOUNT MUST be zero, and the Answer Section MUST be empty. 404 Any records in the Answer Section MUST be silently ignored. 405 If the subscription was accepted and there are positive answers for 406 the requested name, type and class, then these positive answers MUST 407 be communicated to the client in an immediately following Push 408 Notification Update, not in the Answer Section of the SUBSCRIBE 409 response. This simplifying requirement is made so that there is only 410 a single way that information is communicated to a DNS Push 411 Notification client. Since a DNS Push Notification client has to 412 parse information received via Push Notification Updates anyway, it 413 is simpler if it does not also have to parse information received via 414 the Answer Section of a SUBSCRIBE response. 416 NSCOUNT MUST be zero, and the Authority Section MUST be empty. 417 Any records in the Authority Section MUST be silently ignored. 419 ARCOUNT MUST be zero, and the Additional Section MUST be empty. 421 Any records in the Additional Section MUST be silently ignored. 423 If accepted, the subscription will stay in effect until the client 424 revokes the subscription or until the connection between the client 425 and the server is closed. 427 SUBSCRIBE requests on a given connection MUST be unique. A client 428 MUST NOT send a SUBSCRIBE message that duplicates the name, type and 429 class of an existing active subscription on that TLS/TCP connection. 430 For the purpose of this matching, the established DNS case- 431 insensitivity for US-ASCII letters applies (e.g., "foo.com" and 432 "Foo.com" are the same). If a server receives such a duplicate 433 SUBSCRIBE message this is an error and the server MUST immediately 434 close the TCP connection. 436 DNS wildcarding is not supported. That is, a wildcard ("*") in a 437 SUBSCRIBE message matches only a wildcard ("*") in the zone, and 438 nothing else. 440 Aliasing is not supported. That is, a CNAME in a SUBSCRIBE message 441 matches only a CNAME in the zone, and nothing else. 443 A client may SUBSCRIBE to records that are unknown to the server at 444 the time of the request and this is not an error. The server MUST 445 accept these requests and send Push Notifications if and when matches 446 are found in the future. 448 Since all SUBSCRIBE operations are implicitly long-lived operations, 449 the server MUST interpret a SUBSCRIBE request as if it contained an 450 EDNS0 TCP Keepalive option [I-D.wouters-edns-tcp-keepalive]. A 451 client MUST NOT include an actual EDNS0 TCP Keepalive option in the 452 request, since it is automatic, and implied by the semantics of 453 SUBSCRIBE. If a server receives a SUBSCRIBE request this is an error 454 and the server MUST immediately close the TCP connection. In a 455 SUBSCRIBE response the server MUST include an EDNS0 TCP Keepalive 456 option specifying the idle timeout so that the client knows the 457 frequency of keepalives it must generate to keep the connection 458 alive. If the client receives a SUBSCRIBE response that does not 459 contain an EDNS0 TCP Keepalive option this is an error and the client 460 MUST immediately close the TCP connection. 462 6.3. DNS Push Notification UNSUBSCRIBE 464 To cancel an individual subscription without closing the entire 465 connection, the client sends an UNSUBSCRIBE message over the 466 established TCP connection to the server. The UNSUBSCRIBE message is 467 formatted identically to the SUBSCRIBE message which created the 468 subscription, with the exact same name, type and class, except that 469 the opcode is UNSUBSCRIBE (7) instead of SUBSCRIBE (6). 471 A client MUST NOT send an UNSUBSCRIBE message that does not exactly 472 match the name, type and class of an existing active subscription on 473 that TLS/TCP connection. If a server receives such an UNSUBSCRIBE 474 message this is an error and the server MUST immediately close the 475 connection. 477 No response message is generated as a result of processing an 478 UNSUBSCRIBE message. 480 Having being successfully revoked with a correctly-formatted 481 UNSUBSCRIBE message, the previously referenced subscription is no 482 longer active and the server MAY discard the state associated with it 483 immediately, or later, at the server's discretion. 485 6.4. DNS Push Notification Update Messages 487 Once a subscription has been successfully established, the server 488 generates Push Notification Updates to send to the client as 489 appropriate. An initial Push Notification Update will be sent 490 immediately in the case that the answer set was non-empty at the 491 moment the subscription was established. Subsequent changes to the 492 answer set are then communicated to the client in subsequent Push 493 Notification Updates. 495 The format of Push Notification Updates borrows from the existing DNS 496 Update [RFC2136] protocol, with some simplifications. 498 The following figure shows the existing DNS Update header format: 500 1 1 1 1 1 1 501 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 502 +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ 503 | ID | 504 +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ 505 |QR| Opcode | Z | RCODE | 506 +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ 507 | ZOCOUNT | 508 +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ 509 | PRCOUNT | 510 +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ 511 | UPCOUNT | 512 +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ 513 | ADCOUNT | 514 +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ 516 Figure 1 518 For DNS Push Notifications the following rules apply: 520 The QR bit MUST be zero, and the Opcode MUST be UPDATE (5). 521 Messages received where this is not true are not Push Notification 522 Update Messages and should be silently ignored for the purposes of 523 Push Notification Update Message handling. 525 ID, the Z bits, and RCODE MUST be zero on transmission, 526 and MUST be silently ignored on reception. 528 ZOCOUNT MUST be zero, and the Zone Section MUST be empty. 529 Any records in the Zone Section MUST be silently ignored. 531 PRCOUNT MUST be zero, and the Prerequisite Section MUST be empty. 532 Any records in the Prerequisite Section MUST be silently ignored. 534 ADCOUNT MUST be zero, and the Additional Data Section MUST be empty. 535 Any records in the Additional Data Section MUST be silently ignored. 537 The Update Section contains the relevant change information for the 538 client, formatted identically to a DNS Update [RFC2136]. To recap: 540 Delete all RRsets from a name: 541 TTL=0, CLASS=ANY, RDLENGTH=0, TYPE=ANY. 543 Delete an RRset from a name: 544 TTL=0, CLASS=ANY, RDLENGTH=0; 545 TYPE specifies the RRset being deleted. 547 Delete an individual RR from a name: 548 TTL=0, CLASS=NONE; 549 TYPE, RDLENGTH and RDATA specifies the RR being deleted. 551 Add an individual RR to a name: 552 TTL, CLASS, TYPE, RDLENGTH and RDATA specifies the RR being added. 554 Upon reception of a Push Notification Update Message, the client 555 receiving the message MUST validate that the records being added or 556 deleted correspond with at least one currently active subscription on 557 that connection. Specifically, the record name MUST match the name 558 given in the SUBSCRIBE request, subject to the usual established DNS 559 case-insensitivity for US-ASCII letters. If the QTYPE was not ANY 560 (255) then the TYPE of the record must match the QTYPE given in the 561 SUBSCRIBE request. If the QCLASS was not ANY (255) then the CLASS of 562 the record must match the QCLASS given in the SUBSCRIBE request. If 563 a matching active subscription on that connection is not found, then 564 that individual record addition/deletion is silently ignored. 565 Processing of other additions and deletions in this message is not 566 affected. The TCP connection is not closed. This is to allow for 567 the race condition where a client sends an outbound UNSUBSCRIBE while 568 inbound Push Notification Updates for that subscription from the 569 server are still in flight. 571 In the case where a single change affects more than one active 572 subscription, only one update is sent. For example, an update adding 573 a given record may match both a SUBSCRIBE request with the same QTYPE 574 and a different SUBSCRIBE request with QTYPE=ANY. It is not the case 575 that two updates are sent because the new record matches two active 576 subscriptions. 578 The server SHOULD encode change notifications in the most efficient 579 manner possible. For example, when three AAAA records are deleted 580 from a given name, and no other AAAA records exist for that name, the 581 server SHOULD send a "delete an RRset from a name" update, not three 582 separate "delete an individual RR from a name" updates. Similarly, 583 when both an SRV and a TXT record are deleted from a given name, and 584 no other records of any kind exist for that name, the server SHOULD 585 send a "delete all RRsets from a name" update, not two separate 586 "delete an RRset from a name" updates. 588 All Push Notification Update Messages MUST contain an EDNS0 TCP 589 Keepalive option [I-D.wouters-edns-tcp-keepalive] specifying the idle 590 timeout so that the client knows the frequency of keepalives it must 591 generate to keep the connection alive. If the client receives a Push 592 Notification Update Message that does not contain an EDNS0 TCP 593 Keepalive option this is an error and the client MUST immediately 594 close the TCP connection. 596 Reception of a Push Notification Update Message results in no 597 response back to the server. 599 The TTL of an added record is stored by the client and decremented as 600 time passes, with the caveat that for as long as a relevant 601 subscription is active, the TTL does not decrement below 1 second. 602 For as long as a relevant subscription remains active, the client 603 SHOULD assume that when a record goes away the server will notify it 604 of that fact. Consequently, a client does not have to poll to verify 605 that the record is still there. Once a subscription is cancelled 606 (individually, or as a result of the TCP connection being closed) 607 record aging resumes and records are removed from the local cache 608 when their TTL reaches zero. 610 6.5. DNS RECONFIRM 612 Sometimes, particularly when used with a Hybrid Proxy 613 [I-D.ietf-dnssd-hybrid], a DNS Zone may contain stale data. When a 614 client encounters data that it believe may be stale (e.g., an SRV 615 record referencing a target host+port that is not responding to 616 connection requests) the client sends a DNS RECONFIRM message to 617 request that the server re-verify that the data is still valid. For 618 a Hybrid Proxy, this causes it to issue new Multicast DNS requests to 619 ascertain whether the target device is still present. For other 620 kinds of DNS server the RECONFIRM operation is currently undefined 621 and should be sliently ignored. A RECONFIRM request is formatted 622 similarly to a conventional DNS QUERY request [RFC1035], except that 623 the opcode is RECONFIRM (8) instead of QUERY (0). QTYPE MUST NOT be 624 the value ANY (255). QCLASS MUST NOT be the value ANY (255). 626 In a RECONFIRM request the DNS Header QR bit MUST be zero. 627 If the QR bit is not zero the message is not a RECONFIRM request. 629 The AA, TC, RD, RA, Z, AD, and CD bits, the ID field, and the RCODE 630 field, MUST be zero on transmission, and MUST be silently ignored on 631 reception. 633 Like a DNS QUERY request, a RECONFIRM request MUST contain exactly 634 one question. Since RECONFIRM requests are sent over TCP, multiple 635 RECONFIRM requests can be concatenated in a single TCP stream and 636 packed efficiently into TCP segments, so the ability to pack multiple 637 RECONFIRM operations into a single DNS message within that TCP stream 638 would add extra complexity for little benefit. 640 ANCOUNT MUST be nonzero, and the Answer Section MUST contain the 641 rdata for the record(s) that the client believes to be in doubt. 643 NSCOUNT MUST be zero, and the Authority Section MUST be empty. 644 Any records in the Authority Section MUST be silently ignored. 646 ARCOUNT MUST be zero, and the Additional Section MUST be empty. 647 Any records in the Additional Section MUST be silently ignored. 649 DNS wildcarding is not supported. That is, a wildcard ("*") in a 650 SUBSCRIBE message matches only a wildcard ("*") in the zone, and 651 nothing else. 653 Aliasing is not supported. That is, a CNAME in a SUBSCRIBE message 654 matches only a CNAME in the zone, and nothing else. 656 No response message is generated as a result of processing a 657 RECONFIRM message. 659 If the server receiving the RECONFIRM request determines that the 660 records are in fact no longer valid, then subsequent DNS Push 661 Notification Update Messages will be generated to inform interested 662 clients. Thus, one client discovering that a previously-advertised 663 printer is no longer present has the side effect of informing all 664 other interested clients that the printer in question is now gone. 666 6.6. DNS Push Notification Termination Message 668 If a server is low on resources it MAY simply terminate a client 669 connection with a TCP RST. However, the likely behavour of the 670 client may be simply to reconnect immediately, putting more burden on 671 the server. Therefore, a server MAY instead choose to shed client 672 load by (a) sending a DNS Push Notification Termination Message and 673 then (b) closing the client connection with a TCP FIN instead of RST, 674 thereby facilitating reliable delivery of the Termination Message. 676 The format of a Termination Message is similar to a Push Notification 677 Update. 679 The following figure shows the existing DNS Update header format: 681 1 1 1 1 1 1 682 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 683 +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ 684 | ID | 685 +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ 686 |QR| Opcode | Z | RCODE | 687 +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ 688 | ZOCOUNT | 689 +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ 690 | PRCOUNT | 691 +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ 692 | UPCOUNT | 693 +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ 694 | ADCOUNT | 695 +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ 697 Figure 2 699 For Termination Messages the following rules apply: 701 The QR bit MUST be zero, and the Opcode MUST be UPDATE (5). 702 Messages received where this is not true are not Termination Messages 703 and should be silently ignored. 705 ID and the Z bits MUST be zero on transmission, 706 and MUST be silently ignored on reception. 708 ZOCOUNT MUST be zero, and the Zone Section MUST be empty. 709 Any records in the Zone Section MUST be silently ignored. 711 PRCOUNT MUST be zero, and the Prerequisite Section MUST be empty. 712 Any records in the Prerequisite Section MUST be silently ignored. 714 UPCOUNT MUST be zero, and the Update Section MUST be empty. 715 Any records in the Update Section MUST be silently ignored. 717 ADCOUNT MUST be zero, and the Additional Data Section MUST be empty. 718 Any records in the Additional Data Section MUST be silently ignored. 720 The RCODE MUST contain a code giving the reason for termination. 721 [Codes to be determined.] The Termination Message MUST contain an 722 EDNS0 TCP Keepalive option [I-D.wouters-edns-tcp-keepalive] where the 723 idle timeout indicates the time the client SHOULD wait before 724 attempting to reconnect. 726 7. Acknowledgements 728 The authors would like to thank Kiren Sekar and Marc Krochmal for 729 previous work completed in this field. This draft has been improved 730 due to comments from Ran Atkinson. 732 8. IANA Considerations 734 This document defines the service name: "_dns-push-tls._tcp". 735 It is only applicable for the TCP protocol. 736 This name is to be published in the IANA Service Name Registry. 738 This document defines two DNS OpCodes: SUBSCRIBE with (tentative) 739 value 6 and UNSUBSCRIBE with (tentative) value 7. 741 9. Security Considerations 743 TLS support is mandatory in DNS Push Notifications. There is no 744 provision for opportunistic encryption using a mechanism like 745 "STARTTLS". 747 9.1. Security Services 749 It is the goal of using TLS to provide the following security 750 services: 752 Confidentiality All application-layer communication is encrypted 753 with the goal that no party should be able to decrypt it except 754 the intended receiver. 756 Data integrity protection Any changes made to the communication in 757 transit are detectable by the receiver. 759 Authentication An end-point of the TLS communication is 760 authenticated as the intended entity to communicate with. 762 Deployment recommendations on the appropriate key lengths and cypher 763 suites are beyond the scope of this document. Please refer to TLS 764 Recommendations [RFC7525] for the best current practices. Keep in 765 mind that best practices only exist for a snapshot in time and 766 recommendations will continue to change. Updated versions or errata 767 may exist for these recommendations. 769 9.2. TLS Name Authentication 771 As described in Section 6.1, the client discovers the DNS Push 772 Notification server using an SRV lookup for the record name 773 "_dns-push-tls._tcp.". The server connection endpoint SHOULD 774 then be authenticated using DANE TLSA records for the associated SRV 775 record. This associates the target's name and port number with a 776 trusted TLS certificate [RFC7673]. This procedure uses the TLS Sever 777 Name Indication (SNI) extension [RFC6066] to inform the server of the 778 name the client has authenticated through the use of TLSA records. 779 Therefore, if the SRV record passes DNSSEC validation and a TLSA 780 record matching the target name is useable, an SNI extension MUST be 781 used for the target name to ensure the client is connecting to the 782 server it has authenticated. If the target name does not have a 783 usable TLSA record, then the use of the SNI extension is optional. 785 9.3. TLS Compression 787 In order to reduce the chances of compression related attacks, TLS- 788 level compression SHOULD be disabled when using TLS versions 1.2 and 789 earlier. In the draft version of TLS 1.3 [I-D.ietf-tls-tls13], TLS- 790 level compression has been removed completely. 792 9.4. TLS Session Resumption 794 TLS Session Resumption is permissible on DNS Push Notification 795 servers. The server may keep TLS state with Session IDs [RFC5246] or 796 operate in stateless mode by sending a Session Ticket [RFC5077] to 797 the client for it to store. However, once the connection is closed, 798 any existing subscriptions will be dropped. When the TLS session is 799 resumed, the DNS Push Notification server will not have any 800 subscription state and will proceed as with any other new connection. 802 10. References 804 10.1. Normative References 806 [I-D.ietf-dnsop-5966bis] 807 Dickinson, J., Dickinson, S., Bellis, R., Mankin, A., and 808 D. Wessels, "DNS Transport over TCP - Implementation 809 Requirements", draft-ietf-dnsop-5966bis-03 (work in 810 progress), September 2015. 812 [I-D.ietf-tls-tls13] 813 Rescorla, E., "The Transport Layer Security (TLS) Protocol 814 Version 1.3", draft-ietf-tls-tls13-09 (work in progress), 815 October 2015. 817 [I-D.wouters-edns-tcp-keepalive] 818 Wouters, P. and J. Abley, "The edns-tcp-keepalive EDNS0 819 Option", draft-wouters-edns-tcp-keepalive-01 (work in 820 progress), February 2014. 822 [RFC0768] Postel, J., "User Datagram Protocol", STD 6, RFC 768, DOI 823 10.17487/RFC0768, August 1980, 824 . 826 [RFC0793] Postel, J., "Transmission Control Protocol", STD 7, RFC 827 793, DOI 10.17487/RFC0793, September 1981, 828 . 830 [RFC1034] Mockapetris, P., "Domain names - concepts and facilities", 831 STD 13, RFC 1034, DOI 10.17487/RFC1034, November 1987, 832 . 834 [RFC1035] Mockapetris, P., "Domain names - implementation and 835 specification", STD 13, RFC 1035, DOI 10.17487/RFC1035, 836 November 1987, . 838 [RFC1123] Braden, R., Ed., "Requirements for Internet Hosts - 839 Application and Support", STD 3, RFC 1123, DOI 10.17487/ 840 RFC1123, October 1989, 841 . 843 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 844 Requirement Levels", BCP 14, RFC 2119, DOI 10.17487/ 845 RFC2119, March 1997, 846 . 848 [RFC2136] Vixie, P., Ed., Thomson, S., Rekhter, Y., and J. Bound, 849 "Dynamic Updates in the Domain Name System (DNS UPDATE)", 850 RFC 2136, DOI 10.17487/RFC2136, April 1997, 851 . 853 [RFC2782] Gulbrandsen, A., Vixie, P., and L. Esibov, "A DNS RR for 854 specifying the location of services (DNS SRV)", RFC 2782, 855 DOI 10.17487/RFC2782, February 2000, 856 . 858 [RFC4953] Touch, J., "Defending TCP Against Spoofing Attacks", RFC 859 4953, DOI 10.17487/RFC4953, July 2007, 860 . 862 [RFC5246] Dierks, T. and E. Rescorla, "The Transport Layer Security 863 (TLS) Protocol Version 1.2", RFC 5246, DOI 10.17487/ 864 RFC5246, August 2008, 865 . 867 [RFC5966] Bellis, R., "DNS Transport over TCP - Implementation 868 Requirements", RFC 5966, DOI 10.17487/RFC5966, August 869 2010, . 871 [RFC6066] Eastlake 3rd, D., "Transport Layer Security (TLS) 872 Extensions: Extension Definitions", RFC 6066, DOI 873 10.17487/RFC6066, January 2011, 874 . 876 [RFC6195] Eastlake 3rd, D., "Domain Name System (DNS) IANA 877 Considerations", RFC 6195, DOI 10.17487/RFC6195, March 878 2011, . 880 [RFC7673] Finch, T., Miller, M., and P. Saint-Andre, "Using DNS- 881 Based Authentication of Named Entities (DANE) TLSA Records 882 with SRV Records", RFC 7673, DOI 10.17487/RFC7673, October 883 2015, . 885 10.2. Informative References 887 [I-D.ietf-dnssd-hybrid] 888 Cheshire, S., "Hybrid Unicast/Multicast DNS-Based Service 889 Discovery", draft-ietf-dnssd-hybrid-01 (work in progress), 890 October 2015. 892 [I-D.sekar-dns-llq] 893 Sekar, K., "DNS Long-Lived Queries", draft-sekar-dns- 894 llq-01 (work in progress), August 2006. 896 [IPJ.9-4-TCPSYN] 897 Eddy, W., "Defenses Against TCP SYN Flooding Attacks", The 898 Internet Protocol Journal, Cisco Systems, Volume 9, Number 899 4, December 2006. 901 [RFC1996] Vixie, P., "A Mechanism for Prompt Notification of Zone 902 Changes (DNS NOTIFY)", RFC 1996, DOI 10.17487/RFC1996, 903 August 1996, . 905 [RFC4287] Nottingham, M., Ed. and R. Sayre, Ed., "The Atom 906 Syndication Format", RFC 4287, DOI 10.17487/RFC4287, 907 December 2005, . 909 [RFC5077] Salowey, J., Zhou, H., Eronen, P., and H. Tschofenig, 910 "Transport Layer Security (TLS) Session Resumption without 911 Server-Side State", RFC 5077, DOI 10.17487/RFC5077, 912 January 2008, . 914 [RFC6762] Cheshire, S. and M. Krochmal, "Multicast DNS", RFC 6762, 915 DOI 10.17487/RFC6762, February 2013, 916 . 918 [RFC6763] Cheshire, S. and M. Krochmal, "DNS-Based Service 919 Discovery", RFC 6763, DOI 10.17487/RFC6763, February 2013, 920 . 922 [RFC7525] Sheffer, Y., Holz, R., and P. Saint-Andre, 923 "Recommendations for Secure Use of Transport Layer 924 Security (TLS) and Datagram Transport Layer Security 925 (DTLS)", BCP 195, RFC 7525, DOI 10.17487/RFC7525, May 926 2015, . 928 [XEP-0060] 929 Millard, P., Saint-Andre, P., and R. Meijer, "Publish- 930 Subscribe", XSF XEP 0060, July 2010. 932 Authors' Addresses 934 Tom Pusateri 935 Seeking affiliation 936 Hilton Head Island, SC 937 USA 939 Phone: +1 843 473 7394 940 Email: pusateri@bangj.com 941 Stuart Cheshire 942 Apple Inc. 943 1 Infinite Loop 944 Cupertino, CA 95014 945 USA 947 Phone: +1 408 974 3207 948 Email: cheshire@apple.com