idnits 2.17.1 draft-hallambaker-web-service-discovery-06.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 : ---------------------------------------------------------------------------- ** The document seems to lack an Authors' Addresses Section. == There are 4 instances of lines with private range IPv4 addresses in the document. If these are generic example addresses, they should be changed to use any of the ranges defined in RFC 6890 (or successor): 192.0.2.x, 198.51.100.x or 203.0.113.x. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year -- The document date (5 August 2021) is 992 days in the past. Is this intentional? Checking references for intended status: Informational ---------------------------------------------------------------------------- == Missing Reference: 'RFC2119' is mentioned on line 136, but not defined ** Obsolete normative reference: RFC 5785 (Obsoleted by RFC 8615) Summary: 2 errors (**), 0 flaws (~~), 3 warnings (==), 1 comment (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 Network Working Group P. M. Hallam-Baker 3 Internet-Draft 5 August 2021 4 Intended status: Informational 5 Expires: 6 February 2022 7 DNS Web Service Discovery 8 draft-hallambaker-web-service-discovery-06 10 Abstract 12 This document describes a standardized approach to discovering Web 13 Service Endpoints from a DNS name. Services are advertised using the 14 DNS SRV and TXT records and the HTTP Well Known Service conventions. 16 This document is also available online at 17 http://mathmesh.com/Documents/draft-hallambaker-web-service- 18 discovery.html. 20 Status of This Memo 22 This Internet-Draft is submitted in full conformance with the 23 provisions of BCP 78 and BCP 79. 25 Internet-Drafts are working documents of the Internet Engineering 26 Task Force (IETF). Note that other groups may also distribute 27 working documents as Internet-Drafts. The list of current Internet- 28 Drafts is at https://datatracker.ietf.org/drafts/current/. 30 Internet-Drafts are draft documents valid for a maximum of six months 31 and may be updated, replaced, or obsoleted by other documents at any 32 time. It is inappropriate to use Internet-Drafts as reference 33 material or to cite them other than as "work in progress." 35 This Internet-Draft will expire on 6 February 2022. 37 Copyright Notice 39 Copyright (c) 2021 IETF Trust and the persons identified as the 40 document authors. All rights reserved. 42 This document is subject to BCP 78 and the IETF Trust's Legal 43 Provisions Relating to IETF Documents (https://trustee.ietf.org/ 44 license-info) in effect on the date of publication of this document. 45 Please review these documents carefully, as they describe your rights 46 and restrictions with respect to this document. 48 Table of Contents 50 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2 51 2. Definitions . . . . . . . . . . . . . . . . . . . . . . . . . 3 52 2.1. Requirements Language . . . . . . . . . . . . . . . . . . 3 53 2.2. Defined Terms . . . . . . . . . . . . . . . . . . . . . . 3 54 3. Service Discovery . . . . . . . . . . . . . . . . . . . . . . 4 55 3.1. Host Identification . . . . . . . . . . . . . . . . . . . 4 56 3.1.1. SRV Host discovery . . . . . . . . . . . . . . . . . 4 57 3.2. Service Description . . . . . . . . . . . . . . . . . . . 4 58 3.2.1. TXT Service and Host Description . . . . . . . . . . 4 59 3.3. Service Selection . . . . . . . . . . . . . . . . . . . . 5 60 3.4. Web Service Endpoint Determination . . . . . . . . . . . 5 61 3.5. DNS Fallback . . . . . . . . . . . . . . . . . . . . . . 5 62 3.6. Example . . . . . . . . . . . . . . . . . . . . . . . . . 6 63 4. Further Work . . . . . . . . . . . . . . . . . . . . . . . . 7 64 4.1. Additional Description Keys . . . . . . . . . . . . . . . 8 65 4.2. Service Scaling . . . . . . . . . . . . . . . . . . . . . 8 66 5. Security Considerations . . . . . . . . . . . . . . . . . . . 8 67 6. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 8 68 6.1. Well-Known URIs . . . . . . . . . . . . . . . . . . . . . 8 69 7. Normative References . . . . . . . . . . . . . . . . . . . . 9 70 8. Informative References . . . . . . . . . . . . . . . . . . . 9 72 1. Introduction 74 Web services are traditionally identified by means of a URI 75 specifying a Web Service Endpoint (WSE). This is approach is 76 unsatisfactory in many situations: 78 * Specification of the Web Service requires the transport and 79 presentation protocols to be fixed. 81 * The discovery mechanism does not provide support for load 82 balancing or fault tolerance. 84 * The identifiers are unsuited for human interaction. 86 The last consideration is a particular concern where an account 87 identifier is exposed to the user. Attempts to 'teach' users to use 88 URIs as account identifiers have been predictably unsuccessful. 89 Users expect and require accounts to be of the form user@example.com 90 and not http://service.example.com/service/user. 92 The Web Service discovery process described in this specification 93 builds on the approach specified in DNS-Based Service Discovery 94 [RFC6763]. This uses DNS SRV records as the basis for service 95 discovery and TXT records as the basis for service description. This 96 approach allows Web Services to make use of the load balancing and 97 fault tolerance features of SRV and the service negotiation 98 capabilities provided by the service description. 100 One difficulty that is frequently encountered in attempting to make 101 use of DNS records for service discovery is that it is not always 102 possible for an application process to access this information. 103 Specifications address the world as it actually is rather than as 104 some believe it should be have proven more robust in real world 105 deployment than those that do not. The discovery process defined 106 includes a fallback strategy to enable clients to achieve Web Service 107 discovery in these circumstances. 109 Another difficulty that is encountered is that the SRV record maps 110 service names to host names rather than Web Service Endpoints. A 111 convention is thus required to map a host name and protocol prefix to 112 a Web Service Endpoint. The HTTP Well Known Service [RFC5785] 113 mechanism is used for this purpose. 115 While the approach adopted in this specification closely follows that 116 of [RFC6763], there is an important difference in that the earlier 117 specification sets out a framework which Web Services may apply to 118 develop a discovery approach that suits their particular needs while 119 this specification defines exactly one such approach. In particular, 120 the use of a common set of TXT keys to specify service parameters 121 enables service discovery and negotiation to be delegated to common 122 support libraries rather than being implemented independently in each 123 application. 125 2. Definitions 127 This section presents the related specifications and standard, the 128 terms that are used as terms of art within the documents and the 129 terms used as requirements language. 131 2.1. Requirements Language 133 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 134 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 135 document are to be interpreted as described in [RFC2119]. 137 2.2. Defined Terms 139 Web Service An Internet service provided by one or more Web Service 140 Hosts that are addressable by a single Web Service Endpoint and 141 are intended to provide logically equivalent services. 143 Web Service Endpoint (WSE) A URI that specifies a Web Service or Web 144 Service Host. 146 Web Service Host The actual machine (physical or virtual) that 147 provides a Web Service 149 3. Service Discovery 151 Service discovery is the process of resolving the address of a Web 152 Service to a Web Service Endpoint, a URI [RFC3986] at which the 153 service is provided. 155 3.1. Host Identification 157 The first step in service discovery is to resolve the and 158 identifiers to the IP address of a host that provides that 159 service. 161 3.1.1. SRV Host discovery 163 A client attempting to connect to the service first attempts to 164 locate an SRV record [RFC2782] for the specified service: 166 _._tcp. SRV 168 Where is the IANA assigned service name, and 169 are the SRV priority and weight parameters specified in 170 [RFC2782], is the TCP port number and is the DNS name 171 of the host for which the service advertisement is made. 173 If no SRV records are found, the client MAY abort the connection or 174 attempt use of the Fallback Discovery process described below. 176 3.2. Service Description 178 The second step in service discovery is to identify the attributes of 179 the Web Service and Web Service Hosts providing that service. 181 3.2.1. TXT Service and Host Description 183 A service MAY advertise service and/or host description information 184 using TXT records as described in DNS-Based Service Discovery 185 [RFC6763] . These have the following format: 187 _._tcp. TXT "= [=]*" 188 _._tcp. TXT "= [=]*" 190 Where and are the domain names specified in the 191 corresponding SRV records. 193 Service descriptions specified under the domain address of the 194 service apply to all host instances of the service. Descriptions 195 specified under the domain address of a host instance apply only to 196 that host instance and take precedence over values specified at the 197 service level. 199 The following keys are currently defined: 201 path The path to use to construct the Web Service Endpoint. 203 version The service version(s) supported in the format - 205 encoding An IANA media type specifying a supported encoding format 207 3.3. Service Selection 209 Web Service Hosts that do not meet the requirements of the client 210 attempting to create a connection are eliminated before applying SRV 211 service selection criteria specified in [RFC2782]. 213 Clients SHOULD limit the number of connections attempted before 214 abandoning the attempt to connect. 216 3.4. Web Service Endpoint Determination 218 Having selected a Web Service Host, the client determines the Web 219 Service Endpoint as follows: 221 * If the description of the host specifies a path key, the 222 corresponding value is used as the path, otherwise, 224 * if the description of the service specifies a path key, the 225 corresponding value is used as the path, otherwise, 227 * the path is /.well-known/srv/ 229 3.5. DNS Fallback 231 Despite the fact that SRV records have been a part of the DNS 232 standard for 20 years, it is not uncommon for network intermediaries 233 to implement SRV record resolution incorrectly or block it entirely. 234 If no SRV record is found, a client MAY perform fallback discovery if 235 explicitly authorized to do so by the corresponding Web Service 236 protocol specification. 238 The Web Service Endpoint used is: 240 https://./.well-known/srv/ 241 Fallback discovery constrains the service provider to use a specific 242 DNS configuration and provides inferior load balancing or fault 243 tolerance capabilities to use of SRV records. It does however ensure 244 that the service is reachable in situations where it would otherwise 245 be unavailable. 247 3.6. Example 249 The Mathematical Mesh has the Well-Known Service name of '"MMM"'. 250 Accounts used in the Mathematical Mesh follow the [RFC5322] format of 251 @. 253 Alice has the account alice@example.com and the DNS configuration 254 file for example.com has the following entries: 256 _mmm._tcp.example.com SRV host1.example.com 0 10 80 host1.example.com 257 _mmm._tcp.example.com SRV host2.example.com 0 40 80 host2.example.com 258 _mmm._tcp.example.com TXT "version=1.0-2.0" 259 mmm.example.com CNAME host3.example.com 260 host1.example.com A 10.0.1.1 261 host2.example.com A 10.0.1.2 262 _mmm._tcp.host2.example.com TXT "path=/service" 263 host3.example.com A 10.0.1.1 264 host3.example.com A 10.0.1.2 266 The client attempts to resolve the address alice@example.com as 267 follows: 269 0. Client attempts to resolve SRV and TXT records for 270 "_mmm._tcp.example.com" 272 1. DNS resolver returns two SRV entries and one TXT entry 274 2. Client makes a random selection between host1 (20% weighting) 275 and host2 (80% weighting). Chooses host1. 277 3. Client resolves A/AAAA for host1.example.com and TXT for 278 "_mmm._tcp.host1.example.com" 280 4. DNS resolver returns A="10.0.1.1" and TXT=none 282 5. Client attempts to POST Web Service request to 283 "http://host1example.com/.well-known/srv/mmm" at host address 284 "10.0.1.1" 286 6. The host at "10.0.1.1" returns 503 Service Unavailable 287 7. Client resolves A/AAAA for "host2.example.com" and TXT for 288 "_mmm._tcp.host2.example.com" 290 8. DNS resolver returns A="10.0.1.2" and TXT ""path=/service"" 292 9. Client attempts to POST Web Service request to 293 "http://host2example.com/service" at host address "10.0.1.2" 295 10. Request succeeds, session proceeds. 297 If the same client is used in a network location where the SRV record 298 resolution fails due to a faulty firewall configuration, the 299 resolution proceeds as follows: 301 0. Client attempts to resolve SRV record for "_mmm._tcp.example.com" 303 1. DNS resolver returns 'not found' 305 2. Client attempts to resolve A and AAAA record 307 3. DNS resolver returns "10.0.1.1", "10.0.1.2" 309 4. Client makes a random selection between "10.0.1.1" (50% 310 weighting) and "10.0.1.2" (50% weighting). Chooses host1. 312 5. Client attempts to POST Web Service request to 313 "http://example.com/.well-known/srv/mmm" at host address 314 "10.0.1.1" 316 6. The host at "10.0.1.1" returns 503 Service Unavailable 318 7. Client attempts to POST Web Service request to 319 "http://example.com/.well-known/srv/mmm" at host address 320 "10.0.1.2" 322 8. Request succeeds, session proceeds. 324 Note that the main differences between these two scenarios is that 325 the use of the SRV record allows the service configuration to account 326 for load balancing with tiers of fallback support and use of service 327 description information while the use of round robin A/AAAA records 328 does not. 330 4. Further Work 331 4.1. Additional Description Keys 333 The use of service and host descriptions to specify security 334 enhancements is currently being considered. This provides a superset 335 of the capabilities specified in [RFC6698]. 337 * Specify minimum TLS version. 339 * Specify trust roots more flexibly 341 * Specify client authentication requirements 343 * Use of security enhancements other than TLS. 345 * Publish public keys to be used to protect negotiation of security 346 enhancements 348 The use of service and host descriptions to specify use of non-HTTP 349 presentation transports is currently being considered. 351 4.2. Service Scaling 353 This document considers the problem of establishing a connection to a 354 Host providing a particular Web Service. When constructing services 355 at very large scale (e.g. millions of concurrent users), it becomes 356 desirable to enable discovery of a Web Service Host responsible for a 357 particular partition of that data (e.g. a particular user account). 359 Since this is clearly a different problem, it is judged that the best 360 approach is to give it a different name and rule it out of scope of 361 the present work. 363 5. Security Considerations 365 A treatment of the security considerations will follow. 367 6. IANA Considerations 369 The following registrations are required: 371 6.1. Well-Known URIs 373 The following registration is requested in the well-known URI 374 registry in accordance with [RFC5785] 376 URI suffix 378 srv 379 Change controller 381 Phillip Hallam-Baker, phill@hallambaker.com 383 Specification document(s): 385 [This document] 387 Related information 389 [draft-hallambaker-web-service-discovery] 391 7. Normative References 393 [RFC2782] Gulbrandsen, A., Vixie, P., and L. Esibov, "A DNS RR for 394 specifying the location of services (DNS SRV)", RFC 2782, 395 DOI 10.17487/RFC2782, February 2000, 396 . 398 [RFC3986] Berners-Lee, T., Fielding, R., and L. Masinter, "Uniform 399 Resource Identifier (URI): Generic Syntax", STD 66, 400 RFC 3986, DOI 10.17487/RFC3986, January 2005, 401 . 403 [RFC5785] Nottingham, M. and E. Hammer-Lahav, "Defining Well-Known 404 Uniform Resource Identifiers (URIs)", RFC 5785, 405 DOI 10.17487/RFC5785, April 2010, 406 . 408 [RFC6763] Cheshire, S. and M. Krochmal, "DNS-Based Service 409 Discovery", RFC 6763, DOI 10.17487/RFC6763, February 2013, 410 . 412 8. Informative References 414 [draft-hallambaker-web-service-discovery] 415 Hallam-Baker, P., "DNS Web Service Discovery", Work in 416 Progress, Internet-Draft, draft-hallambaker-web-service- 417 discovery-05, 13 January 2021, 418 . 421 [RFC5322] Resnick, P., "Internet Message Format", RFC 5322, 422 DOI 10.17487/RFC5322, October 2008, 423 . 425 [RFC6698] Hoffman, P. and J. Schlyter, "The DNS-Based Authentication 426 of Named Entities (DANE) Transport Layer Security (TLS) 427 Protocol: TLSA", RFC 6698, DOI 10.17487/RFC6698, August 428 2012, .