TURN URIs: Traversal Using Relays around NAT (TURN) Uniform Resource Identifiers
Two URI schemes, turn: and turns:, for naming a TURN relay server in a consistent way.
Petit-Huguenin, M., Nandakumar, S., Salgueiro, G., and P. Jones, "Traversal Using Relays around NAT (TURN) Uniform Resource Identifiers", RFC 7065, DOI 10.17487/RFC7065, November 2013, <https://www.rfc-editor.org/info/rfc7065>.
@misc{rfc7065,
series = {Request for Comments},
number = 7065,
howpublished = {RFC 7065},
publisher = {RFC Editor},
doi = {10.17487/RFC7065},
url = {https://www.rfc-editor.org/info/rfc7065},
author = {M. Petit-Huguenin and S. Nandakumar and G. Salgueiro and P. Jones},
title = {{Traversal Using Relays around NAT (TURN) Uniform Resource Identifiers}},
pagetotal = 9,
year = 2013,
month = nov,
} RFC text
Contents
Internet Engineering Task Force (IETF) M. Petit-Huguenin
Request for Comments: 7065 Impedance Mismatch
Category: Standards Track S. Nandakumar
ISSN: 2070-1721 G. Salgueiro
P. Jones
Cisco Systems
November 2013
Traversal Using Relays around NAT (TURN) Uniform Resource Identifiers
Abstract
This document specifies the syntax of Uniform Resource Identifier
(URI) schemes for the Traversal Using Relays around NAT (TURN)
protocol. It defines two URI schemes to provision the TURN
Resolution Mechanism (RFC 5928).
Status of This Memo
This is an Internet Standards Track document.
This document is a product of the Internet Engineering Task Force
(IETF). It represents the consensus of the IETF community. It has
received public review and has been approved for publication by the
Internet Engineering Steering Group (IESG). Further information on
Internet Standards is available in Section 2 of RFC 5741.
Information about the current status of this document, any errata,
and how to provide feedback on it may be obtained at
http://www.rfc-editor.org/info/rfc7065.
Copyright Notice
Copyright (c) 2013 IETF Trust and the persons identified as the
document authors. All rights reserved.
This document is subject to BCP 78 and the IETF Trust's Legal
Provisions Relating to IETF Documents
(http://trustee.ietf.org/license-info) in effect on the date of
publication of this document. Please review these documents
carefully, as they describe your rights and restrictions with respect
to this document. Code Components extracted from this document must
include Simplified BSD License text as described in Section 4.e of
the Trust Legal Provisions and are provided without warranty as
described in the Simplified BSD License.
Table of Contents
1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 3
2. Terminology . . . . . . . . . . . . . . . . . . . . . . . . . 3
3. Definitions of the "turn" and "turns" URI . . . . . . . . . . 4
3.1. URI Scheme Syntax . . . . . . . . . . . . . . . . . . . . 4
3.2. URI Scheme Semantics . . . . . . . . . . . . . . . . . . 4
4. Security Considerations . . . . . . . . . . . . . . . . . . . 5
5. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 5
5.1. "turn" URI Registration . . . . . . . . . . . . . . . . . 5
5.2. "turns" URI Registration . . . . . . . . . . . . . . . . 6
6. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 6
7. References . . . . . . . . . . . . . . . . . . . . . . . . . 7
7.1. Normative References . . . . . . . . . . . . . . . . . . 7
7.2. Informative References . . . . . . . . . . . . . . . . . 7
Appendix A. Examples . . . . . . . . . . . . . . . . . . . . . . 8
Appendix B. Design Notes . . . . . . . . . . . . . . . . . . . . 8
1. Introduction
This document specifies the syntax and semantics of the Uniform
Resource Identifier (URI) scheme for the Traversal Using Relays
around NAT (TURN) protocol.
The TURN protocol is a specification allowing hosts behind NAT to
control the operation of a relay server. The relay server allows
hosts to exchange packets with its peers. The peers themselves may
also be behind NATs. RFC 5766 [RFC5766] defines the specifics of the
TURN protocol.
The "turn" and "turns" URI schemes are used to designate a TURN
server (also known as a relay) on Internet hosts accessible using the
TURN protocol. With the advent of standards such as WebRTC [WEBRTC],
we anticipate a plethora of endpoints and web applications to be able
to identify and communicate with such a TURN server to carry out the
TURN protocol. This implies that endpoints and/or applications must
be provisioned with the appropriate configuration to identify the
TURN server. Having an inconsistent syntax adds ambiguity and can
result in non-interoperable solutions and implementation limitations.
The "turn" and "turns" URI schemes help alleviate most of these
issues by providing a consistent way to describe, configure, and
exchange the information identifying a TURN server.
[RFC5928] defines a resolution mechanism to convert a secure flag, a
host name or IP address, a potentially empty port, and a potentially
empty transport to a list of IP address, port, and TURN transport
tuples.
To simplify the provisioning of TURN clients, this document defines
the "turn" and "turns" URI schemes that can carry the four components
needed for the resolution mechanism.
2. Terminology
The key words "MUST", "MUST NOT", "REQUIRED", "MAY", and "OPTIONAL"
in this document are to be interpreted as described in [RFC2119] when
they appear in ALL CAPS. When these words are not in ALL CAPS (such
as "should" or "Should"), they have their usual English meanings, and
are not to be interpreted as RFC 2119 key words.
3. Definitions of the "turn" and "turns" URI
3.1. URI Scheme Syntax
The "turn" and "turns" URIs have the following formal ABNF syntax
[RFC5234]:
turnURI = scheme ":" host [ ":" port ]
[ "?transport=" transport ]
scheme = "turn" / "turns"
transport = "udp" / "tcp" / transport-ext
transport-ext = 1*unreserved
<host> and <port> are specified in [RFC3986]. While these two ABNF
productions are defined in [RFC3986] as components of the generic
hierarchical URI, this does not imply that the "turn" and "turns"
schemes are hierarchical URIs. Developers MUST NOT use a generic
hierarchical URI parser to parse a "turn" or "turns" URI.
The <host>, <port>, and <transport> components are passed without
modification to the [RFC5928] algorithm. <secure> is set to false if
<scheme> is equal to "turn", and set to true if <scheme> is equal to
"turns" and passed to the [RFC5928] algorithm with the other
components.
3.2. URI Scheme Semantics
The "turn" and "turns" URI schemes are used to designate a TURN
server (also known as a relay) on Internet hosts accessible using the
TURN protocol. The TURN protocol supports sending messages over UDP,
TCP, or TLS-over-TCP. The "turns" URI scheme MUST be used when TURN
is run over TLS-over-TCP (or, in the future, DTLS-over-UDP), and the
"turn" scheme MUST be used otherwise.
The required <host> part of the "turn" URI denotes the TURN server
host.
As specified in [RFC5766] and [RFC5928], the <port> part, if present,
denotes the port on which the TURN server is awaiting connection
requests. If it is absent, the default port is 3478 for both UDP and
TCP. The default port for TURN over TLS is 5349.
4. Security Considerations
Security considerations for the resolution mechanism are discussed in
Section 5 of [RFC5928]. Note that this section contains normative
text defining authentication procedures to be followed by turn
clients when TLS is used.
The "turn" and "turns" URI schemes do not introduce any specific
security issues beyond the security considerations discussed in
[RFC3986].
Although a "turn" or "turns" URI does not itself include the username
or password that will be used to authenticate the TURN client, in
certain environments, such as WebRTC, the username and password will
almost certainly be provisioned remotely by an external agent at the
same time as a "turns" URI is sent to that client. Thus, in such
situations, if the username and password were received in the clear,
there would be little or no benefit to using a "turns" URI. For this
reason, a TURN client MUST ensure that the username, password,
"turns" URI, and any other security-relevant parameters are received
with equivalent security before using the "turns" URI. Receiving
those parameters over another TLS session can provide the appropriate
level of security, if both TLS sessions are similarly parameterised,
e.g., with commensurate strength ciphersuites.
5. IANA Considerations
This section contains the registration information for the "turn" and
"turns" URI Schemes (in accordance with [RFC4395]).
5.1. "turn" URI Registration
URI scheme name: turn
Status: permanent
URI scheme syntax: See Section 3.1.
URI scheme semantics: See Section 3.2.
Encoding considerations: There are no encoding considerations beyond
those in [RFC3986].
Applications/protocols that use this URI scheme name:
The "turn" URI scheme is intended to be used by applications with
a need to identify a TURN server to be used for NAT traversal.
Interoperability considerations: N/A
Security considerations: See Section 4.
Contact: Marc Petit-Huguenin <petithug@acm.org>
Author/Change controller: The IESG
References: RFC 7065
5.2. "turns" URI Registration
URI scheme name: turns
Status: permanent
URI scheme syntax: See Section 3.1.
URI scheme semantics: See Section 3.2.
Encoding considerations: There are no encoding considerations beyond
those in [RFC3986].
Applications/protocols that use this URI scheme name:
The "turns" URI scheme is intended to be used by applications with
a need to identify a TURN server to be used for NAT traversal over
a secure connection.
Interoperability considerations: N/A
Security considerations: See Section 4.
Contact: Marc Petit-Huguenin <petithug@acm.org>
Author/Change controller: The IESG
References: RFC 7065
6. Acknowledgements
Thanks to Margaret Wasserman, Magnus Westerlund, Juergen
Schoenwaelder, Sean Turner, Ted Hardie, Dave Thaler, Alfred E.
Heggestad, Eilon Yardeni, Dan Wing, Alfred Hoenes, and Jim Kleck for
the comments, suggestions, and questions that helped improve
"Traversal Using Relays around NAT (TURN) Uniform Resource
Identifiers" by M. Petit-Huguenin (October 2011).
Many thanks to Cullen Jennings for his detailed review and thoughtful
comments on "URI Scheme for Traversal Using Relays around NAT (TURN)
Protocol" by S. Nandakumar, et al. (October 2011).
Thanks to Bjoern Hoehrmann, Dan Wing, Russ Housley, S. Moonesamy,
Graham Klyne, Harald Alvestrand, Hadriel Kaplan, Tina Tsou, Spencer
Dawkins, Ted Lemon, Barry Leiba, Pete Resnick, and Stephen Farrell
for the comments, suggestions, and questions that helped improve this
document.
The authors would also like to express their gratitude to Dan Wing
for his assistance in shepherding this document. We also want to
thank Gonzalo Camarillo, the Real-time Applications and
Infrastructure Area Director, for sponsoring this document as well as
his careful reviews.
7. References
7.1. Normative References
[RFC2119] Bradner, S., "Key words for use in RFCs to Indicate
Requirement Levels", BCP 14, RFC 2119, March 1997.
[RFC3986] Berners-Lee, T., Fielding, R., and L. Masinter, "Uniform
Resource Identifier (URI): Generic Syntax", STD 66, RFC
3986, January 2005.
[RFC5234] Crocker, D. and P. Overell, "Augmented BNF for Syntax
Specifications: ABNF", STD 68, RFC 5234, January 2008.
[RFC5766] Mahy, R., Matthews, P., and J. Rosenberg, "Traversal Using
Relays around NAT (TURN): Relay Extensions to Session
Traversal Utilities for NAT (STUN)", RFC 5766, April 2010.
[RFC5928] Petit-Huguenin, M., "Traversal Using Relays around NAT
(TURN) Resolution Mechanism", RFC 5928, August 2010.
7.2. Informative References
[RFC4395] Hansen, T., Hardie, T., and L. Masinter, "Guidelines and
Registration Procedures for New URI Schemes", BCP 35, RFC
4395, February 2006.
[WEBRTC] Bergkvist, A., Burnett, D., Jennings, C., and A.
Narayanan, "WebRTC 1.0: Real-time Communication Between
Browsers", World Wide Web Consortium WD
WD-webrtc-20120821, August 2012,
<http://www.w3.org/TR/2012/WD-webrtc-20120821>.
Appendix A. Examples
Table 1 shows how the <secure>, <port>, and <transport> components
are populated from various URIs. For all these examples, the <host>
component is populated with "example.org".
+---------------------------------+----------+--------+-------------+
| URI | <secure> | <port> | <transport> |
+---------------------------------+----------+--------+-------------+
| turn:example.org | false | | |
| turns:example.org | true | | |
| turn:example.org:8000 | false | 8000 | |
| turn:example.org?transport=udp | false | | UDP |
| turn:example.org?transport=tcp | false | | TCP |
| turns:example.org?transport=tcp | true | | TLS |
+---------------------------------+----------+--------+-------------+
Table 1
Appendix B. Design Notes
o One recurring comment was to stop using the suffix "s" on the URI
scheme, and to move the secure option to a parameter (e.g.
";proto=tls"). We decided against this idea because the STUN URI
does not have a ";proto=" parameter and we would have lost the
symmetry between the TURN and STUN URIs.
o Following the advice of Section 2.2 of RFC 4395, and because the
TURN URI does not describe a hierarchical structure, the TURN URIs
are opaque URIs.
o <password> is not used in the URIs because it is deprecated
[RFC3986]. <username> and <auth> are not used in the URIs because
they do not guide the resolution mechanism.
o As discussed at IETF 72 in Dublin, there are no generic parameters
in the URI to prevent compatibility issues.
Authors' Addresses
Marc Petit-Huguenin
Impedance Mismatch
EMail: petithug@acm.org
Suhas Nandakumar
Cisco Systems
170 West Tasman Drive
San Jose, CA 95134
US
EMail: snandaku@cisco.com
Gonzalo Salgueiro
Cisco Systems
7200-12 Kit Creek Road
Research Triangle Park, NC 27709
US
EMail: gsalguei@cisco.com
Paul E. Jones
Cisco Systems
7025 Kit Creek Road
Research Triangle Park, NC 27709
US
EMail: paulej@packetizer.com
AI ELI5
On this page
§1Why TURN Needs URIs
TURN lets hosts behind a NAT control a relay server, which exchanges packets with their peers. The peers may be behind NATs too. The protocol itself is defined in RFC 5766.
With standards such as WebRTC, the RFC expects many endpoints and web applications to need to identify a TURN server. They must be provisioned with the right configuration, and inconsistent syntax adds ambiguity and can cause non-interoperable solutions. The turn and turns URI schemes give a consistent way to describe, configure and exchange this information.
RFC 5928 defines a resolution mechanism that turns a secure flag, a host name or IP address, a possibly empty port and a possibly empty transport into a list of address, port and transport tuples. The new URIs carry exactly those four components.
A helper computer needs an address everyone writes the same way. Otherwise one app writes it one way, another app a different way, and they cannot understand each other.
§3.1URI Syntax
The formal ABNF is: a scheme of turn or turns, a colon, a host, an optional colon and port, and an optional ?transport= followed by udp, tcp or an extension made of one or more unreserved characters. The host and port productions come from RFC 3986.
That does not make these hierarchical URIs. Developers MUST NOT use a generic hierarchical URI parser on a turn or turns URI.
The host, port and transport are passed unchanged to the RFC 5928 algorithm. The secure flag is false for turn and true for turns.
The address has a few fixed slots: which door type, which house, which room number and how to deliver. You fill in what you know and skip the rest.
§3.2Meaning of the Schemes
Both schemes designate a TURN server, also called a relay. TURN can run over UDP, TCP or TLS-over-TCP. The turns scheme MUST be used when TURN runs over TLS-over-TCP (or, in the future, DTLS-over-UDP), and turn MUST be used otherwise.
The host is required and names the server. If the port is absent, the default is 3478 for both UDP and TCP, and 5349 for TURN over TLS.
turns is the version with a lock on the door. If you do not say which door number, there are standard ones to try.
§4Examples
The appendix shows how URIs map to the secure flag, port and transport, with example.org as the host. For instance, turn:example.org gives secure false and nothing else, turns:example.org gives secure true, and turn:example.org:8000 sets port 8000. Adding ?transport=udp or ?transport=tcp to turn: sets UDP or TCP, and turns:example.org?transport=tcp yields secure true with transport TLS.
A few sample addresses show what each one means, like a cheat sheet next to the envelope.
| URI | secure | port | transport |
|---|---|---|---|
| turn:example.org | false | none | none |
| turns:example.org | true | none | none |
| turn:example.org:8000 | false | 8000 | none |
| turn:example.org?transport=udp | false | none | UDP |
| turn:example.org?transport=tcp | false | none | TCP |
| turns:example.org?transport=tcp | true | none | TLS |
§4Security Considerations
The schemes add no specific security issues beyond those in RFC 3986. The resolution mechanism's security considerations are in Section 5 of RFC 5928, which contains normative text on how clients authenticate when TLS is used.
A turns URI does not carry the username or password. In environments such as WebRTC, those are likely sent by an external agent along with the URI. If they arrived in the clear, using turns would bring little or no benefit, so a TURN client MUST make sure the username, password, turns URI and any other security-relevant parameters are received with equivalent security. Another TLS session can do this if both sessions are similarly parameterised, for example with commensurate strength ciphersuites.
A locked door does not help if you shout the key across the street. The key has to travel as safely as the address.
§5IANA Registration
The RFC registers both turn and turns as permanent URI schemes, following RFC 4395. The turn scheme is for applications that need to identify a TURN server for NAT traversal, and turns is the same over a secure connection. The change controller is the IESG.
Both names were written into the official list of address types, so nobody else can use them for something different.
§7Design Notes
The authors record several choices. They kept the s suffix rather than a parameter such as ;proto=tls, to keep symmetry with the STUN URI. Following RFC 4395, and because the URI is not hierarchical, these are opaque URIs.
No password appears in the URI because it is deprecated in RFC 3986, and no username or auth because they do not guide resolution. No generic parameters exist, to prevent compatibility issues.
The authors explain why they kept the address simple: only the parts that help find the helper are in it.