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