idnits 2.17.1 draft-ietf-dnssd-push-04.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 (January 11, 2016) is 3022 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-05 == Outdated reference: A later version (-06) exists of draft-ietf-dnsop-edns-tcp-keepalive-05 == Outdated reference: A later version (-28) exists of draft-ietf-tls-tls13-11 ** 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-02 == 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: July 14, 2016 Apple Inc. 6 January 11, 2016 8 DNS Push Notifications 9 draft-ietf-dnssd-push-04 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 July 14, 2016. 38 Copyright Notice 40 Copyright (c) 2016 IETF Trust and the persons identified as the 41 document authors. All rights reserved. 43 This document is subject to BCP 78 and the IETF Trust's Legal 44 Provisions Relating to IETF Documents 45 (http://trustee.ietf.org/license-info) in effect on the date of 46 publication of this document. Please review these documents 47 carefully, as they describe your rights and restrictions with respect 48 to this document. Code Components extracted from this document must 49 include Simplified BSD License text as described in Section 4.e of 50 the Trust Legal Provisions and are provided without warranty as 51 described in the Simplified BSD License. 53 Table of Contents 55 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2 56 1.1. Requirements Language . . . . . . . . . . . . . . . . . . 3 57 2. Motivation . . . . . . . . . . . . . . . . . . . . . . . . . 3 58 3. Overview . . . . . . . . . . . . . . . . . . . . . . . . . . 4 59 4. Transport . . . . . . . . . . . . . . . . . . . . . . . . . . 5 60 5. State Considerations . . . . . . . . . . . . . . . . . . . . 6 61 6. Protocol Operation . . . . . . . . . . . . . . . . . . . . . 7 62 6.1. Discovery . . . . . . . . . . . . . . . . . . . . . . . . 8 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 . . . . . . . . 17 68 7. Security Considerations . . . . . . . . . . . . . . . . . . . 18 69 7.1. Security Services . . . . . . . . . . . . . . . . . . . . 18 70 7.2. TLS Name Authentication . . . . . . . . . . . . . . . . . 19 71 7.3. TLS Compression . . . . . . . . . . . . . . . . . . . . . 19 72 7.4. TLS Session Resumption . . . . . . . . . . . . . . . . . 19 73 8. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 20 74 9. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 20 75 10. References . . . . . . . . . . . . . . . . . . . . . . . . . 20 76 10.1. Normative References . . . . . . . . . . . . . . . . . . 20 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 than 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 7.2 for details. 234 5. State Considerations 236 Each DNS Push Notification server is capable of 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. Note that a client MUST be prepared to 259 receive (and silently discard) Push Notifications for subscriptions 260 it has previously removed, since there is no way to prevent the 261 situation where a Push Notification is in flight from server to 262 client while the client's UNSUBSCRIBE message cancelling that 263 subscription is simultaneously in flight from client to server. 265 The exchange between client and server terminates when either end 266 closes the TCP connection with a TCP FIN or RST. 268 A client SHOULD NOT make multiple TLS/TCP connections to the same DNS 269 Push Notification server. A client SHOULD share a single TLS/TCP 270 connection for all requests to the same DNS Push Notification server. 271 This shared connection should be used for all DNS Queries and DNS 272 Push Notification Queries queries to that server, and for DNS Update 273 requests too when the "_dns-update-tls._tcp." SRV record 274 indicates that the same server also handles DNS Update requests. 275 This is to reduce unnecessary load on the DNS Push Notification 276 server. 278 For the purposes here, the determination of "same server" is made by 279 inspecting the target host and port, regardless of the name being 280 queried, or what zone if falls within. A given server may support 281 Push Notifications (and possibly DNS Updates too) for multiple DNS 282 zones. When a client discovers that the DNS Push Notification server 283 (and/or DNS Update server) for several different names (including 284 names that fall within different zones) is the same target host and 285 port, the client SHOULD use a single shared TCP connection for all 286 relevant operations on those names. A client SHOULD NOT open 287 multiple TCP connections to the same target host and port just 288 because the names being queried (or updated) happen to fall within 289 different zones. 291 However, a single client device may be home to multiple independent 292 client software instances that don't know about each other, so a DNS 293 Push Notification server MUST be prepared to accept multiple 294 connections from the same client IP address. This is undesirable 295 from an efficiency stanpoint, but may be unavoidable in some 296 situations, so a DNS Push Notification server MUST be prepared to 297 accept multiple connections from the same client IP address. 299 6.1. Discovery 301 The first step in DNS Push Notification subscription is to discover 302 an appropriate DNS server that supports DNS Push Notifications for 303 the desired zone. The client MUST also determine which TCP port on 304 the server is listening for connections, which need not be (and often 305 is not) the typical TCP port 53 used for conventional DNS. 307 1. The client begins the discovery by sending a DNS query to the 308 local resolver with record type SOA [RFC1035] for the name of the 309 record it wishes to subscribe. 311 2. If the SOA record exists, it MUST be returned in the Answer 312 Section of the reply. If not, the server SHOULD include the SOA 313 record for the zone of the requested name in the Authority 314 Section. 316 3. If no SOA record is returned, the client then strips off the 317 leading label from the requested name. If the resulting name has 318 at least one label in it, the client sends a new SOA query and 319 processing continues at step 2 above. If the resulting name is 320 empty (the root label) then this is a network configuration error 321 and the client gives up. The client MAY retry the operation at a 322 later time. 324 4. Once the SOA is known, the client sends a DNS query with type SRV 325 [RFC2782] for the record name "_dns-push-tls._tcp.", where 326 is the owner name of the discovered SOA record. 328 5. If the zone in question does not offer DNS Push Notifications 329 then SRV record MUST NOT exist and the SRV query will return a 330 negative answer. 332 6. If the zone in question is set up to offer DNS Push Notifications 333 then this SRV record MUST exist. The SRV "target" contains the 334 name of the server providing DNS Push Notifications for the zone. 335 The port number on which to contact the server is in the SRV 336 record "port" field. The address(es) of the target host MAY be 337 included in the Additional Section, however, the address records 338 SHOULD be authenticated before use as described below in 339 Section 7.2 [RFC7673]. 341 7. More than one SRV record may be returned. In this case, the 342 "priority" and "weight" values in the returned SRV records are 343 used to determine the order in which to contact the servers for 344 subscription requests. As described in the SRV specification 345 [RFC2782], the server with the lowest "priority" is first 346 contacted. If more than one server has the same "priority", the 347 "weight" is indicates the weighted probability that the client 348 should contact that server. Higher weights have higher 349 probabilities of being selected. If a server is not reachable or 350 is not willing to accept a subscription request, then a 351 subsequent server is to be contacted. 353 If a server closes a DNS Push Notification subscription connection, 354 the client SHOULD repeat the discovery process in order to determine 355 the preferred DNS server for subscriptions at that time. 357 6.2. DNS Push Notification SUBSCRIBE 359 A DNS Push Notification client indicates its desire to receive DNS 360 Push Notifications for a given domain name by sending a SUBSCRIBE 361 request over the established TCP connection to the server. A 362 SUBSCRIBE request is formatted identically to a conventional DNS 363 QUERY request [RFC1035], except that the opcode is SUBSCRIBE (6) 364 instead of QUERY (0). If neither QTYPE nor QCLASS are ANY (255) then 365 this is a specific subscription to changes for the given name, type 366 and class. If one or both of QTYPE or QCLASS are ANY (255) then this 367 subscription matches any type and/or any class, as appropriate. 369 In a SUBSCRIBE request the DNS Header QR bit MUST be zero. 370 If the QR bit is not zero the message is not a SUBSCRIBE request. 372 The AA, TC, RD, RA, Z, AD, and CD bits, the ID field, and the RCODE 373 field, MUST be zero on transmission, and MUST be silently ignored on 374 reception. 376 Like a DNS QUERY request, a SUBSCRIBE request MUST contain exactly 377 one question. Since SUBSCRIBE requests are sent over TCP, multiple 378 SUBSCRIBE requests can be concatenated in a single TCP stream and 379 packed efficiently into TCP segments, so the ability to pack multiple 380 SUBSCRIBE operations into a single DNS message within that TCP stream 381 would add extra complexity for little benefit. 383 ANCOUNT MUST be zero, and the Answer Section MUST be empty. 384 Any records in the Answer Section MUST be silently ignored. 386 NSCOUNT MUST be zero, and the Authority Section MUST be empty. 387 Any records in the Authority Section MUST be silently ignored. 389 ARCOUNT MUST be zero, and the Additional Section MUST be empty. 390 Any records in the Additional Section MUST be silently ignored. 392 Each SUBSCRIBE request generates exactly one SUBSCRIBE response from 393 the server. 395 In the SUBSCRIBE response the RCODE indicates whether or not the 396 subscription was accepted. Supported RCODEs are as follows: 398 +----------+-------+------------------------------------------------+ 399 | Mnemonic | Value | Description | 400 +----------+-------+------------------------------------------------+ 401 | NOERROR | 0 | SUBSCRIBE successful | 402 | FORMERR | 1 | Server failed to process request due to a | 403 | | | malformed request | 404 | SERVFAIL | 2 | Server failed to process request due to | 405 | | | resource exhaustion | 406 | NOTIMP | 4 | Server does not implement DNS Push | 407 | | | Notifications | 408 | REFUSED | 5 | Server refuses to process request for policy | 409 | | | or security reasons | 410 +----------+-------+------------------------------------------------+ 412 Table 1: Response codes 414 In a SUBSCRIBE response the DNS Header QR bit MUST be one. 415 If the QR bit is not one the message is not a SUBSCRIBE response. 417 The AA, TC, RD, RA, Z, AD, and CD bits, and the ID field, MUST be 418 zero on transmission, and MUST be silently ignored on reception. 420 The Question Section MUST echo back the values provided by the client 421 in the SUBSCRIBE request that generated this SUBSCRIBE response. 423 ANCOUNT MUST be zero, and the Answer Section MUST be empty. 424 Any records in the Answer Section MUST be silently ignored. 425 If the subscription was accepted and there are positive answers for 426 the requested name, type and class, then these positive answers MUST 427 be communicated to the client in an immediately following Push 428 Notification Update, not in the Answer Section of the SUBSCRIBE 429 response. This simplifying requirement is made so that there is only 430 a single way that information is communicated to a DNS Push 431 Notification client. Since a DNS Push Notification client has to 432 parse information received via Push Notification Updates anyway, it 433 is simpler if it does not also have to parse information received via 434 the Answer Section of a SUBSCRIBE response. 436 NSCOUNT MUST be zero, and the Authority Section MUST be empty. 437 Any records in the Authority Section MUST be silently ignored. 439 ARCOUNT MUST be zero, and the Additional Section MUST be empty. 441 Any records in the Additional Section MUST be silently ignored. 443 If accepted, the subscription will stay in effect until the client 444 revokes the subscription or until the connection between the client 445 and the server is closed. 447 SUBSCRIBE requests on a given connection MUST be unique. A client 448 MUST NOT send a SUBSCRIBE message that duplicates the name, type and 449 class of an existing active subscription on that TLS/TCP connection. 450 For the purpose of this matching, the established DNS case- 451 insensitivity for US-ASCII letters applies (e.g., "foo.com" and 452 "Foo.com" are the same). If a server receives such a duplicate 453 SUBSCRIBE message this is an error and the server MUST immediately 454 close the TCP connection. 456 DNS wildcarding is not supported. That is, a wildcard ("*") in a 457 SUBSCRIBE message matches only a wildcard ("*") in the zone, and 458 nothing else. 460 Aliasing is not supported. That is, a CNAME in a SUBSCRIBE message 461 matches only a CNAME in the zone, and nothing else. 463 A client may SUBSCRIBE to records that are unknown to the server at 464 the time of the request (providing that the name falls within one of 465 the zone(s) the server is responsible for) and this is not an error. 466 The server MUST accept these requests and send Push Notifications if 467 and when matches are found in the future. 469 Since all SUBSCRIBE operations are implicitly long-lived operations, 470 the server MUST interpret a SUBSCRIBE request as if it contained an 471 EDNS0 TCP Keepalive option [I-D.ietf-dnsop-edns-tcp-keepalive]. A 472 client MUST NOT include an actual EDNS0 TCP Keepalive option in the 473 request, since it is automatic, and implied by the semantics of 474 SUBSCRIBE. If a server receives a SUBSCRIBE request that does 475 contain an actual EDNS0 TCP Keepalive option this is an error and the 476 server MUST immediately close the TCP connection. In a SUBSCRIBE 477 response the server MUST include an EDNS0 TCP Keepalive option 478 specifying the idle timeout so that the client knows the frequency of 479 keepalives it must generate to keep the connection alive. If the 480 client receives a SUBSCRIBE response that does not contain an EDNS0 481 TCP Keepalive option this is an error and the client MUST immediately 482 close the TCP connection. 484 6.3. DNS Push Notification UNSUBSCRIBE 486 To cancel an individual subscription without closing the entire 487 connection, the client sends an UNSUBSCRIBE message over the 488 established TCP connection to the server. The UNSUBSCRIBE message is 489 formatted identically to the SUBSCRIBE message which created the 490 subscription, with the exact same name, type and class, except that 491 the opcode is UNSUBSCRIBE (7) instead of SUBSCRIBE (6). 493 A client MUST NOT send an UNSUBSCRIBE message that does not exactly 494 match the name, type and class of an existing active subscription on 495 that TLS/TCP connection. If a server receives such an UNSUBSCRIBE 496 message this is an error and the server MUST immediately close the 497 connection. 499 No response message is generated as a result of processing an 500 UNSUBSCRIBE message. 502 Having being successfully revoked with a correctly-formatted 503 UNSUBSCRIBE message, the previously referenced subscription is no 504 longer active and the server MAY discard the state associated with it 505 immediately, or later, at the server's discretion. 507 6.4. DNS Push Notification Update Messages 509 Once a subscription has been successfully established, the server 510 generates Push Notification Updates to send to the client as 511 appropriate. An initial Push Notification Update will be sent 512 immediately in the case that the answer set was non-empty at the 513 moment the subscription was established. Subsequent changes to the 514 answer set are then communicated to the client in subsequent Push 515 Notification Updates. 517 The format of Push Notification Updates borrows from the existing DNS 518 Update [RFC2136] protocol, with some simplifications. 520 The following figure shows the existing DNS Update header format: 522 1 1 1 1 1 1 523 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 524 +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ 525 | ID | 526 +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ 527 |QR| Opcode | Z | RCODE | 528 +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ 529 | ZOCOUNT | 530 +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ 531 | PRCOUNT | 532 +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ 533 | UPCOUNT | 534 +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ 535 | ADCOUNT | 536 +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ 538 Figure 1 540 For DNS Push Notifications the following rules apply: 542 The QR bit MUST be zero, and the Opcode MUST be UPDATE (5). 543 Messages received where this is not true are not Push Notification 544 Update Messages and should be silently ignored for the purposes of 545 Push Notification Update Message handling. 547 ID, the Z bits, and RCODE MUST be zero on transmission, 548 and MUST be silently ignored on reception. 550 ZOCOUNT MUST be zero, and the Zone Section MUST be empty. 551 Any records in the Zone Section MUST be silently ignored. 553 PRCOUNT MUST be zero, and the Prerequisite Section MUST be empty. 554 Any records in the Prerequisite Section MUST be silently ignored. 556 ADCOUNT MUST be zero, and the Additional Data Section MUST be empty. 557 Any records in the Additional Data Section MUST be silently ignored. 559 The Update Section contains the relevant change information for the 560 client, formatted identically to a DNS Update [RFC2136]. To recap: 562 Delete all RRsets from a name: 563 TTL=0, CLASS=ANY, RDLENGTH=0, TYPE=ANY. 565 Delete an RRset from a name: 566 TTL=0, CLASS=ANY, RDLENGTH=0; 567 TYPE specifies the RRset being deleted. 569 Delete an individual RR from a name: 570 TTL=0, CLASS=NONE; 571 TYPE, RDLENGTH and RDATA specifies the RR being deleted. 573 Add an individual RR to a name: 574 TTL, CLASS, TYPE, RDLENGTH and RDATA specifies the RR being added. 576 Upon reception of a Push Notification Update Message, the client 577 receiving the message MUST validate that the records being added or 578 deleted correspond with at least one currently active subscription on 579 that connection. Specifically, the record name MUST match the name 580 given in the SUBSCRIBE request, subject to the usual established DNS 581 case-insensitivity for US-ASCII letters. If the QTYPE was not ANY 582 (255) then the TYPE of the record must match the QTYPE given in the 583 SUBSCRIBE request. If the QCLASS was not ANY (255) then the CLASS of 584 the record must match the QCLASS given in the SUBSCRIBE request. If 585 a matching active subscription on that connection is not found, then 586 that individual record addition/deletion is silently ignored. 587 Processing of other additions and deletions in this message is not 588 affected. The TCP connection is not closed. This is to allow for 589 the race condition where a client sends an outbound UNSUBSCRIBE while 590 inbound Push Notification Updates for that subscription from the 591 server are still in flight. 593 In the case where a single change affects more than one active 594 subscription, only one update is sent. For example, an update adding 595 a given record may match both a SUBSCRIBE request with the same QTYPE 596 and a different SUBSCRIBE request with QTYPE=ANY. It is not the case 597 that two updates are sent because the new record matches two active 598 subscriptions. 600 The server SHOULD encode change notifications in the most efficient 601 manner possible. For example, when three AAAA records are deleted 602 from a given name, and no other AAAA records exist for that name, the 603 server SHOULD send a "delete an RRset from a name" update, not three 604 separate "delete an individual RR from a name" updates. Similarly, 605 when both an SRV and a TXT record are deleted from a given name, and 606 no other records of any kind exist for that name, the server SHOULD 607 send a "delete all RRsets from a name" update, not two separate 608 "delete an RRset from a name" updates. 610 All Push Notification Update Messages MUST contain an EDNS0 TCP 611 Keepalive option [I-D.ietf-dnsop-edns-tcp-keepalive] specifying the 612 idle timeout so that the client knows the frequency of keepalives it 613 must generate to keep the connection alive. If the client receives a 614 Push Notification Update Message that does not contain an EDNS0 TCP 615 Keepalive option this is an error and the client MUST immediately 616 close the TCP connection. 618 Reception of a Push Notification Update Message results in no 619 response back to the server. 621 The TTL of an added record is stored by the client and decremented as 622 time passes, with the caveat that for as long as a relevant 623 subscription is active, the TTL does not decrement below 1 second. 624 For as long as a relevant subscription remains active, the client 625 SHOULD assume that when a record goes away the server will notify it 626 of that fact. Consequently, a client does not have to poll to verify 627 that the record is still there. Once a subscription is cancelled 628 (individually, or as a result of the TCP connection being closed) 629 record aging resumes and records are removed from the local cache 630 when their TTL reaches zero. 632 6.5. DNS RECONFIRM 634 Sometimes, particularly when used with a Hybrid Proxy 635 [I-D.ietf-dnssd-hybrid], a DNS Zone may contain stale data. When a 636 client encounters data that it believe may be stale (e.g., an SRV 637 record referencing a target host+port that is not responding to 638 connection requests) the client sends a DNS RECONFIRM message to 639 request that the server re-verify that the data is still valid. For 640 a Hybrid Proxy, this causes it to issue new Multicast DNS requests to 641 ascertain whether the target device is still present. For other 642 kinds of DNS server the RECONFIRM operation is currently undefined 643 and should be sliently ignored. A RECONFIRM request is formatted 644 similarly to a conventional DNS QUERY request [RFC1035], except that 645 the opcode is RECONFIRM (8) instead of QUERY (0). QTYPE MUST NOT be 646 the value ANY (255). QCLASS MUST NOT be the value ANY (255). 648 In a RECONFIRM request the DNS Header QR bit MUST be zero. 649 If the QR bit is not zero the message is not a RECONFIRM request. 651 The AA, TC, RD, RA, Z, AD, and CD bits, the ID field, and the RCODE 652 field, MUST be zero on transmission, and MUST be silently ignored on 653 reception. 655 Like a DNS QUERY request, a RECONFIRM request MUST contain exactly 656 one question. Since RECONFIRM requests are sent over TCP, multiple 657 RECONFIRM requests can be concatenated in a single TCP stream and 658 packed efficiently into TCP segments, so the ability to pack multiple 659 RECONFIRM operations into a single DNS message within that TCP stream 660 would add extra complexity for little benefit. 662 ANCOUNT MUST be nonzero, and the Answer Section MUST contain the 663 rdata for the record(s) that the client believes to be in doubt. 665 NSCOUNT MUST be zero, and the Authority Section MUST be empty. 666 Any records in the Authority Section MUST be silently ignored. 668 ARCOUNT MUST be zero, and the Additional Section MUST be empty. 669 Any records in the Additional Section MUST be silently ignored. 671 DNS wildcarding is not supported. That is, a wildcard ("*") in a 672 SUBSCRIBE message matches only a wildcard ("*") in the zone, and 673 nothing else. 675 Aliasing is not supported. That is, a CNAME in a SUBSCRIBE message 676 matches only a CNAME in the zone, and nothing else. 678 No response message is generated as a result of processing a 679 RECONFIRM message. 681 If the server receiving the RECONFIRM request determines that the 682 records are in fact no longer valid, then subsequent DNS Push 683 Notification Update Messages will be generated to inform interested 684 clients. Thus, one client discovering that a previously-advertised 685 printer is no longer present has the side effect of informing all 686 other interested clients that the printer in question is now gone. 688 6.6. DNS Push Notification Termination Message 690 If a server is low on resources it MAY simply terminate a client 691 connection with a TCP RST. However, the likely behavour of the 692 client may be simply to reconnect immediately, putting more burden on 693 the server. Therefore, a server MAY instead choose to shed client 694 load by (a) sending a DNS Push Notification Termination Message and 695 then (b) closing the client connection with a TCP FIN instead of RST, 696 thereby facilitating reliable delivery of the Termination Message. 698 The format of a Termination Message is similar to a Push Notification 699 Update. 701 The following figure shows the existing DNS Update header format: 703 1 1 1 1 1 1 704 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 705 +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ 706 | ID | 707 +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ 708 |QR| Opcode | Z | RCODE | 709 +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ 710 | ZOCOUNT | 711 +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ 712 | PRCOUNT | 713 +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ 714 | UPCOUNT | 715 +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ 716 | ADCOUNT | 717 +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ 719 Figure 2 721 For Termination Messages the following rules apply: 723 The QR bit MUST be zero, and the Opcode MUST be UPDATE (5). 724 Messages received where this is not true are not Termination Messages 725 and should be silently ignored. 727 ID and the Z bits MUST be zero on transmission, 728 and MUST be silently ignored on reception. 730 ZOCOUNT MUST be zero, and the Zone Section MUST be empty. 731 Any records in the Zone Section MUST be silently ignored. 733 PRCOUNT MUST be zero, and the Prerequisite Section MUST be empty. 734 Any records in the Prerequisite Section MUST be silently ignored. 736 UPCOUNT MUST be zero, and the Update Section MUST be empty. 737 Any records in the Update Section MUST be silently ignored. 739 ADCOUNT MUST be zero, and the Additional Data Section MUST be empty. 740 Any records in the Additional Data Section MUST be silently ignored. 742 The RCODE MUST contain a code giving the reason for termination. 743 [Codes to be determined.] The Termination Message MUST contain an 744 EDNS0 TCP Keepalive option [I-D.ietf-dnsop-edns-tcp-keepalive] where 745 the idle timeout indicates the time the client SHOULD wait before 746 attempting to reconnect. 748 7. Security Considerations 750 TLS support is REQUIRED in DNS Push Notifications. There is no 751 provision for opportunistic encryption using a mechanism like 752 "STARTTLS". 754 DNSSEC is RECOMMENDED for DNS Push Notifications. TLS alone does not 755 provide complete security. TLS certificate verification can provide 756 reasonable assurance that the client is really talking to the server 757 associated with the desired host name, but since the desired host 758 name is learned via a DNS SRV query, if the SRV query is subverted 759 then the client may have a secure connection to a rogue server. 760 DNSSEC can provided added confidence that the SRV query has not been 761 subverted. 763 7.1. Security Services 765 It is the goal of using TLS to provide the following security 766 services: 768 Confidentiality All application-layer communication is encrypted 769 with the goal that no party should be able to decrypt it except 770 the intended receiver. 772 Data integrity protection Any changes made to the communication in 773 transit are detectable by the receiver. 775 Authentication An end-point of the TLS communication is 776 authenticated as the intended entity to communicate with. 778 Deployment recommendations on the appropriate key lengths and cypher 779 suites are beyond the scope of this document. Please refer to TLS 780 Recommendations [RFC7525] for the best current practices. Keep in 781 mind that best practices only exist for a snapshot in time and 782 recommendations will continue to change. Updated versions or errata 783 may exist for these recommendations. 785 7.2. TLS Name Authentication 787 As described in Section 6.1, the client discovers the DNS Push 788 Notification server using an SRV lookup for the record name 789 "_dns-push-tls._tcp.". The server connection endpoint SHOULD 790 then be authenticated using DANE TLSA records for the associated SRV 791 record. This associates the target's name and port number with a 792 trusted TLS certificate [RFC7673]. This procedure uses the TLS Sever 793 Name Indication (SNI) extension [RFC6066] to inform the server of the 794 name the client has authenticated through the use of TLSA records. 795 Therefore, if the SRV record passes DNSSEC validation and a TLSA 796 record matching the target name is useable, an SNI extension MUST be 797 used for the target name to ensure the client is connecting to the 798 server it has authenticated. If the target name does not have a 799 usable TLSA record, then the use of the SNI extension is optional. 801 7.3. TLS Compression 803 In order to reduce the chances of compression related attacks, TLS- 804 level compression SHOULD be disabled when using TLS versions 1.2 and 805 earlier. In the draft version of TLS 1.3 [I-D.ietf-tls-tls13], TLS- 806 level compression has been removed completely. 808 7.4. TLS Session Resumption 810 TLS Session Resumption is permissible on DNS Push Notification 811 servers. The server may keep TLS state with Session IDs [RFC5246] or 812 operate in stateless mode by sending a Session Ticket [RFC5077] to 813 the client for it to store. However, once the connection is closed, 814 any existing subscriptions will be dropped. When the TLS session is 815 resumed, the DNS Push Notification server will not have any 816 subscription state and will proceed as with any other new connection. 817 Use of TLS Session Resumption allows a new TLS connection to be set 818 up more quickly, but the client will still have to recreate any 819 desired subscriptions. 821 8. IANA Considerations 823 This document defines the service name: "_dns-push-tls._tcp". 824 It is only applicable for the TCP protocol. 825 This name is to be published in the IANA Service Name Registry. 827 This document defines three DNS OpCodes: SUBSCRIBE with (tentative) 828 value 6, UNSUBSCRIBE with (tentative) value 7, and RECONFIRM with 829 (tentative) value 8. 831 9. Acknowledgements 833 The authors would like to thank Kiren Sekar and Marc Krochmal for 834 previous work completed in this field. 836 This draft has been improved due to comments from Ran Atkinson, Mark 837 Delany, and Markus Stenberg. 839 10. References 841 10.1. Normative References 843 [I-D.ietf-dnsop-5966bis] 844 Dickinson, J., Dickinson, S., Bellis, R., Mankin, A., and 845 D. Wessels, "DNS Transport over TCP - Implementation 846 Requirements", draft-ietf-dnsop-5966bis-05 (work in 847 progress), December 2015. 849 [I-D.ietf-dnsop-edns-tcp-keepalive] 850 Wouters, P., Abley, J., Dickinson, S., and R. Bellis, "The 851 edns-tcp-keepalive EDNS0 Option", draft-ietf-dnsop-edns- 852 tcp-keepalive-05 (work in progress), January 2016. 854 [I-D.ietf-tls-tls13] 855 Rescorla, E., "The Transport Layer Security (TLS) Protocol 856 Version 1.3", draft-ietf-tls-tls13-11 (work in progress), 857 December 2015. 859 [RFC0768] Postel, J., "User Datagram Protocol", STD 6, RFC 768, DOI 860 10.17487/RFC0768, August 1980, 861 . 863 [RFC0793] Postel, J., "Transmission Control Protocol", STD 7, RFC 864 793, DOI 10.17487/RFC0793, September 1981, 865 . 867 [RFC1034] Mockapetris, P., "Domain names - concepts and facilities", 868 STD 13, RFC 1034, DOI 10.17487/RFC1034, November 1987, 869 . 871 [RFC1035] Mockapetris, P., "Domain names - implementation and 872 specification", STD 13, RFC 1035, DOI 10.17487/RFC1035, 873 November 1987, . 875 [RFC1123] Braden, R., Ed., "Requirements for Internet Hosts - 876 Application and Support", STD 3, RFC 1123, DOI 10.17487/ 877 RFC1123, October 1989, 878 . 880 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 881 Requirement Levels", BCP 14, RFC 2119, DOI 10.17487/ 882 RFC2119, March 1997, 883 . 885 [RFC2136] Vixie, P., Ed., Thomson, S., Rekhter, Y., and J. Bound, 886 "Dynamic Updates in the Domain Name System (DNS UPDATE)", 887 RFC 2136, DOI 10.17487/RFC2136, April 1997, 888 . 890 [RFC2782] Gulbrandsen, A., Vixie, P., and L. Esibov, "A DNS RR for 891 specifying the location of services (DNS SRV)", RFC 2782, 892 DOI 10.17487/RFC2782, February 2000, 893 . 895 [RFC4953] Touch, J., "Defending TCP Against Spoofing Attacks", RFC 896 4953, DOI 10.17487/RFC4953, July 2007, 897 . 899 [RFC5246] Dierks, T. and E. Rescorla, "The Transport Layer Security 900 (TLS) Protocol Version 1.2", RFC 5246, DOI 10.17487/ 901 RFC5246, August 2008, 902 . 904 [RFC5966] Bellis, R., "DNS Transport over TCP - Implementation 905 Requirements", RFC 5966, DOI 10.17487/RFC5966, August 906 2010, . 908 [RFC6066] Eastlake 3rd, D., "Transport Layer Security (TLS) 909 Extensions: Extension Definitions", RFC 6066, DOI 910 10.17487/RFC6066, January 2011, 911 . 913 [RFC6195] Eastlake 3rd, D., "Domain Name System (DNS) IANA 914 Considerations", RFC 6195, DOI 10.17487/RFC6195, March 915 2011, . 917 [RFC7673] Finch, T., Miller, M., and P. Saint-Andre, "Using DNS- 918 Based Authentication of Named Entities (DANE) TLSA Records 919 with SRV Records", RFC 7673, DOI 10.17487/RFC7673, October 920 2015, . 922 10.2. Informative References 924 [I-D.ietf-dnssd-hybrid] 925 Cheshire, S., "Hybrid Unicast/Multicast DNS-Based Service 926 Discovery", draft-ietf-dnssd-hybrid-02 (work in progress), 927 November 2015. 929 [I-D.sekar-dns-llq] 930 Sekar, K., "DNS Long-Lived Queries", draft-sekar-dns- 931 llq-01 (work in progress), August 2006. 933 [IPJ.9-4-TCPSYN] 934 Eddy, W., "Defenses Against TCP SYN Flooding Attacks", The 935 Internet Protocol Journal, Cisco Systems, Volume 9, Number 936 4, December 2006. 938 [RFC1996] Vixie, P., "A Mechanism for Prompt Notification of Zone 939 Changes (DNS NOTIFY)", RFC 1996, DOI 10.17487/RFC1996, 940 August 1996, . 942 [RFC4287] Nottingham, M., Ed. and R. Sayre, Ed., "The Atom 943 Syndication Format", RFC 4287, DOI 10.17487/RFC4287, 944 December 2005, . 946 [RFC5077] Salowey, J., Zhou, H., Eronen, P., and H. Tschofenig, 947 "Transport Layer Security (TLS) Session Resumption without 948 Server-Side State", RFC 5077, DOI 10.17487/RFC5077, 949 January 2008, . 951 [RFC6762] Cheshire, S. and M. Krochmal, "Multicast DNS", RFC 6762, 952 DOI 10.17487/RFC6762, February 2013, 953 . 955 [RFC6763] Cheshire, S. and M. Krochmal, "DNS-Based Service 956 Discovery", RFC 6763, DOI 10.17487/RFC6763, February 2013, 957 . 959 [RFC7525] Sheffer, Y., Holz, R., and P. Saint-Andre, 960 "Recommendations for Secure Use of Transport Layer 961 Security (TLS) and Datagram Transport Layer Security 962 (DTLS)", BCP 195, RFC 7525, DOI 10.17487/RFC7525, May 963 2015, . 965 [XEP-0060] 966 Millard, P., Saint-Andre, P., and R. Meijer, "Publish- 967 Subscribe", XSF XEP 0060, July 2010. 969 Authors' Addresses 971 Tom Pusateri 972 Seeking affiliation 973 Hilton Head Island, SC 974 USA 976 Phone: +1 843 473 7394 977 Email: pusateri@bangj.com 979 Stuart Cheshire 980 Apple Inc. 981 1 Infinite Loop 982 Cupertino, CA 95014 983 USA 985 Phone: +1 408 974 3207 986 Email: cheshire@apple.com