< draft-ietf-tram-turnbis-25.txt   draft-ietf-tram-turnbis-26.txt >
TRAM WG T. Reddy, Ed. TRAM WG T. Reddy, Ed.
Internet-Draft McAfee Internet-Draft McAfee
Obsoletes: 5766, 6156 (if approved) A. Johnston, Ed. Obsoletes: 5766, 6156 (if approved) A. Johnston, Ed.
Intended status: Standards Track Villanova University Intended status: Standards Track Villanova University
Expires: November 15, 2019 P. Matthews Expires: December 25, 2019 P. Matthews
Alcatel-Lucent Alcatel-Lucent
J. Rosenberg J. Rosenberg
jdrosen.net jdrosen.net
May 14, 2019 June 23, 2019
Traversal Using Relays around NAT (TURN): Relay Extensions to Session Traversal Using Relays around NAT (TURN): Relay Extensions to Session
Traversal Utilities for NAT (STUN) Traversal Utilities for NAT (STUN)
draft-ietf-tram-turnbis-25 draft-ietf-tram-turnbis-26
Abstract Abstract
If a host is located behind a NAT, then in certain situations it can If a host is located behind a NAT, then in certain situations it can
be impossible for that host to communicate directly with other hosts be impossible for that host to communicate directly with other hosts
(peers). In these situations, it is necessary for the host to use (peers). In these situations, it is necessary for the host to use
the services of an intermediate node that acts as a communication the services of an intermediate node that acts as a communication
relay. This specification defines a protocol, called TURN (Traversal relay. This specification defines a protocol, called TURN (Traversal
Using Relays around NAT), that allows the host to control the Using Relays around NAT), that allows the host to control the
operation of the relay and to exchange packets with its peers using operation of the relay and to exchange packets with its peers using
the relay. TURN differs from some other relay control protocols in the relay. TURN differs from other relay control protocols in that
that it allows a client to communicate with multiple peers using a it allows a client to communicate with multiple peers using a single
single relay address. relay address.
The TURN protocol was designed to be used as part of the ICE The TURN protocol was designed to be used as part of the ICE
(Interactive Connectivity Establishment) approach to NAT traversal, (Interactive Connectivity Establishment) approach to NAT traversal,
though it also can be used without ICE. though it also can be used without ICE.
This document obsoletes RFC 5766 and RFC 6156. This document obsoletes RFC 5766 and RFC 6156.
Status of This Memo Status of This Memo
This Internet-Draft is submitted in full conformance with the This Internet-Draft is submitted in full conformance with the
skipping to change at page 2, line 4 skipping to change at page 2, line 4
Internet-Drafts are working documents of the Internet Engineering Internet-Drafts are working documents of the Internet Engineering
Task Force (IETF). Note that other groups may also distribute Task Force (IETF). Note that other groups may also distribute
working documents as Internet-Drafts. The list of current Internet- working documents as Internet-Drafts. The list of current Internet-
Drafts is at https://datatracker.ietf.org/drafts/current/. Drafts is at https://datatracker.ietf.org/drafts/current/.
Internet-Drafts are draft documents valid for a maximum of six months Internet-Drafts are draft documents valid for a maximum of six months
and may be updated, replaced, or obsoleted by other documents at any and may be updated, replaced, or obsoleted by other documents at any
time. It is inappropriate to use Internet-Drafts as reference time. It is inappropriate to use Internet-Drafts as reference
material or to cite them other than as "work in progress." material or to cite them other than as "work in progress."
This Internet-Draft will expire on November 15, 2019. This Internet-Draft will expire on December 25, 2019.
Copyright Notice Copyright Notice
Copyright (c) 2019 IETF Trust and the persons identified as the Copyright (c) 2019 IETF Trust and the persons identified as the
document authors. All rights reserved. document authors. All rights reserved.
This document is subject to BCP 78 and the IETF Trust's Legal This document is subject to BCP 78 and the IETF Trust's Legal
Provisions Relating to IETF Documents Provisions Relating to IETF Documents
(https://trustee.ietf.org/license-info) in effect on the date of (https://trustee.ietf.org/license-info) in effect on the date of
publication of this document. Please review these documents publication of this document. Please review these documents
carefully, as they describe your rights and restrictions with respect carefully, as they describe your rights and restrictions with respect
to this document. Code Components extracted from this document must to this document. Code Components extracted from this document must
include Simplified BSD License text as described in Section 4.e of include Simplified BSD License text as described in Section 4.e of
the Trust Legal Provisions and are provided without warranty as the Trust Legal Provisions and are provided without warranty as
described in the Simplified BSD License. described in the Simplified BSD License.
Table of Contents Table of Contents
1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 4 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 4
2. Overview of Operation . . . . . . . . . . . . . . . . . . . . 6 2. Terminology . . . . . . . . . . . . . . . . . . . . . . . . . 6
2.1. Transports . . . . . . . . . . . . . . . . . . . . . . . 9 3. Overview of Operation . . . . . . . . . . . . . . . . . . . . 8
2.2. Allocations . . . . . . . . . . . . . . . . . . . . . . . 10 3.1. Transports . . . . . . . . . . . . . . . . . . . . . . . 11
2.3. Permissions . . . . . . . . . . . . . . . . . . . . . . . 12 3.2. Allocations . . . . . . . . . . . . . . . . . . . . . . . 12
2.4. Send Mechanism . . . . . . . . . . . . . . . . . . . . . 13 3.3. Permissions . . . . . . . . . . . . . . . . . . . . . . . 14
2.5. Channels . . . . . . . . . . . . . . . . . . . . . . . . 15 3.4. Send Mechanism . . . . . . . . . . . . . . . . . . . . . 15
2.6. Unprivileged TURN Servers . . . . . . . . . . . . . . . . 17 3.5. Channels . . . . . . . . . . . . . . . . . . . . . . . . 17
2.7. Avoiding IP Fragmentation . . . . . . . . . . . . . . . . 17 3.6. Unprivileged TURN Servers . . . . . . . . . . . . . . . . 19
2.8. RTP Support . . . . . . . . . . . . . . . . . . . . . . . 19 3.7. Avoiding IP Fragmentation . . . . . . . . . . . . . . . . 19
2.9. Happy Eyeballs for TURN . . . . . . . . . . . . . . . . . 19 3.8. RTP Support . . . . . . . . . . . . . . . . . . . . . . . 21
3. Terminology . . . . . . . . . . . . . . . . . . . . . . . . . 20 3.9. Happy Eyeballs for TURN . . . . . . . . . . . . . . . . . 21
4. Discovery of TURN server . . . . . . . . . . . . . . . . . . 22 4. Discovery of TURN server . . . . . . . . . . . . . . . . . . 22
4.1. TURN URI Scheme Semantics . . . . . . . . . . . . . . . . 22 4.1. TURN URI Scheme Semantics . . . . . . . . . . . . . . . . 22
5. General Behavior . . . . . . . . . . . . . . . . . . . . . . 22 5. General Behavior . . . . . . . . . . . . . . . . . . . . . . 23
6. Allocations . . . . . . . . . . . . . . . . . . . . . . . . . 25 6. Allocations . . . . . . . . . . . . . . . . . . . . . . . . . 25
7. Creating an Allocation . . . . . . . . . . . . . . . . . . . 26 7. Creating an Allocation . . . . . . . . . . . . . . . . . . . 26
7.1. Sending an Allocate Request . . . . . . . . . . . . . . . 26 7.1. Sending an Allocate Request . . . . . . . . . . . . . . . 26
7.2. Receiving an Allocate Request . . . . . . . . . . . . . . 28 7.2. Receiving an Allocate Request . . . . . . . . . . . . . . 28
7.3. Receiving an Allocate Success Response . . . . . . . . . 33 7.3. Receiving an Allocate Success Response . . . . . . . . . 33
7.4. Receiving an Allocate Error Response . . . . . . . . . . 34 7.4. Receiving an Allocate Error Response . . . . . . . . . . 34
8. Refreshing an Allocation . . . . . . . . . . . . . . . . . . 36 8. Refreshing an Allocation . . . . . . . . . . . . . . . . . . 36
8.1. Sending a Refresh Request . . . . . . . . . . . . . . . . 36 8.1. Sending a Refresh Request . . . . . . . . . . . . . . . . 36
8.2. Receiving a Refresh Request . . . . . . . . . . . . . . . 37 8.2. Receiving a Refresh Request . . . . . . . . . . . . . . . 37
8.3. Receiving a Refresh Response . . . . . . . . . . . . . . 38 8.3. Receiving a Refresh Response . . . . . . . . . . . . . . 38
9. Permissions . . . . . . . . . . . . . . . . . . . . . . . . . 38 9. Permissions . . . . . . . . . . . . . . . . . . . . . . . . . 38
10. CreatePermission . . . . . . . . . . . . . . . . . . . . . . 39 10. CreatePermission . . . . . . . . . . . . . . . . . . . . . . 39
10.1. Forming a CreatePermission Request . . . . . . . . . . . 39 10.1. Forming a CreatePermission Request . . . . . . . . . . . 39
10.2. Receiving a CreatePermission Request . . . . . . . . . . 40 10.2. Receiving a CreatePermission Request . . . . . . . . . . 40
10.3. Receiving a CreatePermission Response . . . . . . . . . 40 10.3. Receiving a CreatePermission Response . . . . . . . . . 41
11. Send and Data Methods . . . . . . . . . . . . . . . . . . . . 41 11. Send and Data Methods . . . . . . . . . . . . . . . . . . . . 41
11.1. Forming a Send Indication . . . . . . . . . . . . . . . 41 11.1. Forming a Send Indication . . . . . . . . . . . . . . . 41
11.2. Receiving a Send Indication . . . . . . . . . . . . . . 41 11.2. Receiving a Send Indication . . . . . . . . . . . . . . 41
11.3. Receiving a UDP Datagram . . . . . . . . . . . . . . . . 42 11.3. Receiving a UDP Datagram . . . . . . . . . . . . . . . . 42
11.4. Receiving a Data Indication . . . . . . . . . . . . . . 42 11.4. Receiving a Data Indication . . . . . . . . . . . . . . 43
11.5. Receiving an ICMP Packet . . . . . . . . . . . . . . . . 43 11.5. Receiving an ICMP Packet . . . . . . . . . . . . . . . . 43
11.6. Receiving a Data Indication with an ICMP attribute . . . 44 11.6. Receiving a Data Indication with an ICMP attribute . . . 44
12. Channels . . . . . . . . . . . . . . . . . . . . . . . . . . 44 12. Channels . . . . . . . . . . . . . . . . . . . . . . . . . . 44
12.1. Sending a ChannelBind Request . . . . . . . . . . . . . 46 12.1. Sending a ChannelBind Request . . . . . . . . . . . . . 46
12.2. Receiving a ChannelBind Request . . . . . . . . . . . . 47 12.2. Receiving a ChannelBind Request . . . . . . . . . . . . 47
12.3. Receiving a ChannelBind Response . . . . . . . . . . . . 48 12.3. Receiving a ChannelBind Response . . . . . . . . . . . . 48
12.4. The ChannelData Message . . . . . . . . . . . . . . . . 48 12.4. The ChannelData Message . . . . . . . . . . . . . . . . 48
12.5. Sending a ChannelData Message . . . . . . . . . . . . . 49 12.5. Sending a ChannelData Message . . . . . . . . . . . . . 49
12.6. Receiving a ChannelData Message . . . . . . . . . . . . 49 12.6. Receiving a ChannelData Message . . . . . . . . . . . . 49
12.7. Relaying Data from the Peer . . . . . . . . . . . . . . 50 12.7. Relaying Data from the Peer . . . . . . . . . . . . . . 50
13. Packet Translations . . . . . . . . . . . . . . . . . . . . . 51 13. Packet Translations . . . . . . . . . . . . . . . . . . . . . 51
13.1. IPv4-to-IPv6 Translations . . . . . . . . . . . . . . . 51 13.1. IPv4-to-IPv6 Translations . . . . . . . . . . . . . . . 51
13.2. IPv6-to-IPv6 Translations . . . . . . . . . . . . . . . 52 13.2. IPv6-to-IPv6 Translations . . . . . . . . . . . . . . . 52
13.3. IPv6-to-IPv4 Translations . . . . . . . . . . . . . . . 53 13.3. IPv6-to-IPv4 Translations . . . . . . . . . . . . . . . 54
14. IP Header Fields for UDP-to-UDP translation . . . . . . . . . 54 14. UDP-to-UDP relay . . . . . . . . . . . . . . . . . . . . . . 54
15. IP Header Fields for TCP-to-UDP translation . . . . . . . . . 56 15. TCP-to-UDP relay . . . . . . . . . . . . . . . . . . . . . . 56
16. STUN Methods . . . . . . . . . . . . . . . . . . . . . . . . 59 16. UDP-to-TCP relay . . . . . . . . . . . . . . . . . . . . . . 58
17. STUN Attributes . . . . . . . . . . . . . . . . . . . . . . . 59 17. STUN Methods . . . . . . . . . . . . . . . . . . . . . . . . 59
17.1. CHANNEL-NUMBER . . . . . . . . . . . . . . . . . . . . . 60 18. STUN Attributes . . . . . . . . . . . . . . . . . . . . . . . 59
17.2. LIFETIME . . . . . . . . . . . . . . . . . . . . . . . . 60 18.1. CHANNEL-NUMBER . . . . . . . . . . . . . . . . . . . . . 60
17.3. XOR-PEER-ADDRESS . . . . . . . . . . . . . . . . . . . . 60 18.2. LIFETIME . . . . . . . . . . . . . . . . . . . . . . . . 60
17.4. DATA . . . . . . . . . . . . . . . . . . . . . . . . . . 60 18.3. XOR-PEER-ADDRESS . . . . . . . . . . . . . . . . . . . . 60
17.5. XOR-RELAYED-ADDRESS . . . . . . . . . . . . . . . . . . 60 18.4. DATA . . . . . . . . . . . . . . . . . . . . . . . . . . 60
17.6. REQUESTED-ADDRESS-FAMILY . . . . . . . . . . . . . . . . 61 18.5. XOR-RELAYED-ADDRESS . . . . . . . . . . . . . . . . . . 61
17.7. EVEN-PORT . . . . . . . . . . . . . . . . . . . . . . . 61 18.6. REQUESTED-ADDRESS-FAMILY . . . . . . . . . . . . . . . . 61
17.8. REQUESTED-TRANSPORT . . . . . . . . . . . . . . . . . . 62 18.7. EVEN-PORT . . . . . . . . . . . . . . . . . . . . . . . 61
17.9. DONT-FRAGMENT . . . . . . . . . . . . . . . . . . . . . 62 18.8. REQUESTED-TRANSPORT . . . . . . . . . . . . . . . . . . 62
17.10. RESERVATION-TOKEN . . . . . . . . . . . . . . . . . . . 62 18.9. DONT-FRAGMENT . . . . . . . . . . . . . . . . . . . . . 62
17.11. ADDITIONAL-ADDRESS-FAMILY . . . . . . . . . . . . . . . 62 18.10. RESERVATION-TOKEN . . . . . . . . . . . . . . . . . . . 62
17.12. ADDRESS-ERROR-CODE Attribute . . . . . . . . . . . . . . 63 18.11. ADDITIONAL-ADDRESS-FAMILY . . . . . . . . . . . . . . . 63
17.13. ICMP Attribute . . . . . . . . . . . . . . . . . . . . . 63 18.12. ADDRESS-ERROR-CODE Attribute . . . . . . . . . . . . . . 63
18. STUN Error Response Codes . . . . . . . . . . . . . . . . . . 64 18.13. ICMP Attribute . . . . . . . . . . . . . . . . . . . . . 64
19. Detailed Example . . . . . . . . . . . . . . . . . . . . . . 65 19. STUN Error Response Codes . . . . . . . . . . . . . . . . . . 64
20. Security Considerations . . . . . . . . . . . . . . . . . . . 73 20. Detailed Example . . . . . . . . . . . . . . . . . . . . . . 65
20.1. Outsider Attacks . . . . . . . . . . . . . . . . . . . . 73 21. Security Considerations . . . . . . . . . . . . . . . . . . . 73
20.1.1. Obtaining Unauthorized Allocations . . . . . . . . . 73 21.1. Outsider Attacks . . . . . . . . . . . . . . . . . . . . 73
20.1.2. Offline Dictionary Attacks . . . . . . . . . . . . . 73 21.1.1. Obtaining Unauthorized Allocations . . . . . . . . . 73
20.1.3. Faked Refreshes and Permissions . . . . . . . . . . 74 21.1.2. Offline Dictionary Attacks . . . . . . . . . . . . . 73
20.1.4. Fake Data . . . . . . . . . . . . . . . . . . . . . 74 21.1.3. Faked Refreshes and Permissions . . . . . . . . . . 74
20.1.5. Impersonating a Server . . . . . . . . . . . . . . . 75 21.1.4. Fake Data . . . . . . . . . . . . . . . . . . . . . 74
20.1.6. Eavesdropping Traffic . . . . . . . . . . . . . . . 75 21.1.5. Impersonating a Server . . . . . . . . . . . . . . . 75
20.1.7. TURN Loop Attack . . . . . . . . . . . . . . . . . . 76 21.1.6. Eavesdropping Traffic . . . . . . . . . . . . . . . 75
21.1.7. TURN Loop Attack . . . . . . . . . . . . . . . . . . 76
20.2. Firewall Considerations . . . . . . . . . . . . . . . . 76 21.2. Firewall Considerations . . . . . . . . . . . . . . . . 76
20.2.1. Faked Permissions . . . . . . . . . . . . . . . . . 77 21.2.1. Faked Permissions . . . . . . . . . . . . . . . . . 77
20.2.2. Blacklisted IP Addresses . . . . . . . . . . . . . . 77 21.2.2. Blacklisted IP Addresses . . . . . . . . . . . . . . 77
20.2.3. Running Servers on Well-Known Ports . . . . . . . . 78 21.2.3. Running Servers on Well-Known Ports . . . . . . . . 78
20.3. Insider Attacks . . . . . . . . . . . . . . . . . . . . 78 21.3. Insider Attacks . . . . . . . . . . . . . . . . . . . . 78
20.3.1. DoS against TURN Server . . . . . . . . . . . . . . 78 21.3.1. DoS against TURN Server . . . . . . . . . . . . . . 78
20.3.2. Anonymous Relaying of Malicious Traffic . . . . . . 78 21.3.2. Anonymous Relaying of Malicious Traffic . . . . . . 78
20.3.3. Manipulating Other Allocations . . . . . . . . . . . 79 21.3.3. Manipulating Other Allocations . . . . . . . . . . . 79
20.4. Tunnel Amplification Attack . . . . . . . . . . . . . . 79 21.4. Tunnel Amplification Attack . . . . . . . . . . . . . . 79
20.5. Other Considerations . . . . . . . . . . . . . . . . . . 80 21.5. Other Considerations . . . . . . . . . . . . . . . . . . 80
21. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 80 22. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 80
22. IAB Considerations . . . . . . . . . . . . . . . . . . . . . 81 23. IAB Considerations . . . . . . . . . . . . . . . . . . . . . 81
23. Changes since RFC 5766 . . . . . . . . . . . . . . . . . . . 83 24. Changes since RFC 5766 . . . . . . . . . . . . . . . . . . . 83
24. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 83 25. Updates to RFC 6156 . . . . . . . . . . . . . . . . . . . . . 83
25. References . . . . . . . . . . . . . . . . . . . . . . . . . 84 26. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 83
25.1. Normative References . . . . . . . . . . . . . . . . . . 84 27. References . . . . . . . . . . . . . . . . . . . . . . . . . 84
25.2. Informative References . . . . . . . . . . . . . . . . . 86 27.1. Normative References . . . . . . . . . . . . . . . . . . 84
Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 89 27.2. Informative References . . . . . . . . . . . . . . . . . 86
Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 90
1. Introduction 1. Introduction
A host behind a NAT may wish to exchange packets with other hosts, A host behind a NAT may wish to exchange packets with other hosts,
some of which may also be behind NATs. To do this, the hosts some of which may also be behind NATs. To do this, the hosts
involved can use "hole punching" techniques (see [RFC5128]) in an involved can use "hole punching" techniques (see [RFC5128]) in an
attempt discover a direct communication path; that is, a attempt discover a direct communication path; that is, a
communication path that goes from one host to another through communication path that goes from one host to another through
intervening NATs and routers, but does not traverse any relays. intervening NATs and routers, but does not traverse any relays.
As described in [RFC5128] and [RFC4787], hole punching techniques As described in [RFC5128] and [RFC4787], hole punching techniques
will fail if both hosts are behind NATs that are not well behaved. will fail if both hosts are behind NATs that are not well behaved.
For example, if both hosts are behind NATs that have a mapping For example, if both hosts are behind NATs that have a mapping
behavior of "address-dependent mapping" or "address- and port- behavior of "address-dependent mapping" or "address- and port-
dependent mapping", then hole punching techniques generally fail. dependent mapping" (Section 4.1 in [RFC4787]), then hole punching
techniques generally fail.
When a direct communication path cannot be found, it is necessary to When a direct communication path cannot be found, it is necessary to
use the services of an intermediate host that acts as a relay for the use the services of an intermediate host that acts as a relay for the
packets. This relay typically sits in the public Internet and relays packets. This relay typically sits in the public Internet and relays
packets between two hosts that both sit behind NATs. packets between two hosts that both sit behind NATs.
This specification defines a protocol, called TURN, that allows a This specification defines a protocol, called TURN, that allows a
host behind a NAT (called the TURN client) to request that another host behind a NAT (called the TURN client) to request that another
host (called the TURN server) act as a relay. The client can arrange host (called the TURN server) act as a relay. The client can arrange
for the server to relay packets to and from certain other hosts for the server to relay packets to and from certain other hosts
skipping to change at page 5, line 14 skipping to change at page 5, line 17
knows the peer from which the transport protocol data was relayed by knows the peer from which the transport protocol data was relayed by
the server. If the server receives an ICMP error packet, the server the server. If the server receives an ICMP error packet, the server
also relays certain layer 3/4 header fields from the ICMP header to also relays certain layer 3/4 header fields from the ICMP header to
the client. When the client sends a packet to the server, the server the client. When the client sends a packet to the server, the server
relays the transport protocol data from the packet to the intended relays the transport protocol data from the packet to the intended
peer using the relayed transport address as the source. peer using the relayed transport address as the source.
A client using TURN must have some way to communicate the relayed A client using TURN must have some way to communicate the relayed
transport address to its peers, and to learn each peer's IP address transport address to its peers, and to learn each peer's IP address
and port (more precisely, each peer's server-reflexive transport and port (more precisely, each peer's server-reflexive transport
address, see Section 2). How this is done is out of the scope of the address, see Section 3). How this is done is out of the scope of the
TURN protocol. One way this might be done is for the client and TURN protocol. One way this might be done is for the client and
peers to exchange email messages. Another way is for the client and peers to exchange email messages. Another way is for the client and
its peers to use a special-purpose "introduction" or "rendezvous" its peers to use a special-purpose "introduction" or "rendezvous"
protocol (see [RFC5128] for more details). protocol (see [RFC5128] for more details).
If TURN is used with ICE [RFC8445], then the relayed transport If TURN is used with ICE [RFC8445], then the relayed transport
address and the IP addresses and ports of the peers are included in address and the IP addresses and ports of the peers are included in
the ICE candidate information that the rendezvous protocol must the ICE candidate information that the rendezvous protocol must
carry. For example, if TURN and ICE are used as part of a multimedia carry. For example, if TURN and ICE are used as part of a multimedia
solution using SIP [RFC3261], then SIP serves the role of the solution using SIP [RFC3261], then SIP serves the role of the
rendezvous protocol, carrying the ICE candidate information inside rendezvous protocol, carrying the ICE candidate information inside
the body of SIP messages. If TURN and ICE are used with some other the body of SIP messages [I-D.ietf-mmusic-ice-sip-sdp]. If TURN and
rendezvous protocol, then [I-D.rosenberg-mmusic-ice-nonsip] provides ICE are used with some other rendezvous protocol, then ICE provides
guidance on the services the rendezvous protocol must perform. guidance on the services the rendezvous protocol must perform.
Though the use of a TURN server to enable communication between two Though the use of a TURN server to enable communication between two
hosts behind NATs is very likely to work, it comes at a high cost to hosts behind NATs is very likely to work, it comes at a high cost to
the provider of the TURN server, since the server typically needs a the provider of the TURN server, since the server typically needs a
high-bandwidth connection to the Internet. As a consequence, it is high-bandwidth connection to the Internet. As a consequence, it is
best to use a TURN server only when a direct communication path best to use a TURN server only when a direct communication path
cannot be found. When the client and a peer use ICE to determine the cannot be found. When the client and a peer use ICE to determine the
communication path, ICE will use hole punching techniques to search communication path, ICE will use hole punching techniques to search
for a direct path first and only use a TURN server when a direct path for a direct path first and only use a TURN server when a direct path
skipping to change at page 6, line 14 skipping to change at page 6, line 16
TURN is an extension to the STUN (Session Traversal Utilities for TURN is an extension to the STUN (Session Traversal Utilities for
NAT) protocol [I-D.ietf-tram-stunbis]. Most, though not all, TURN NAT) protocol [I-D.ietf-tram-stunbis]. Most, though not all, TURN
messages are STUN-formatted messages. A reader of this document messages are STUN-formatted messages. A reader of this document
should be familiar with STUN. should be familiar with STUN.
The TURN specification was originally published as [RFC5766], which The TURN specification was originally published as [RFC5766], which
was updated by [RFC6156] to add IPv6 support. This document was updated by [RFC6156] to add IPv6 support. This document
supersedes and obsoletes both [RFC5766] and [RFC6156]. supersedes and obsoletes both [RFC5766] and [RFC6156].
2. Overview of Operation 2. Terminology
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
"SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
document are to be interpreted as described in RFC 2119 [RFC2119].
Readers are expected to be familiar with [I-D.ietf-tram-stunbis] and
the terms defined there.
The following terms are used in this document:
TURN: The protocol spoken between a TURN client and a TURN server.
It is an extension to the STUN protocol [I-D.ietf-tram-stunbis].
The protocol allows a client to allocate and use a relayed
transport address.
TURN client: A STUN client that implements this specification.
TURN server: A STUN server that implements this specification. It
relays data between a TURN client and its peer(s).
Peer: A host with which the TURN client wishes to communicate. The
TURN server relays traffic between the TURN client and its
peer(s). The peer does not interact with the TURN server using
the protocol defined in this document; rather, the peer receives
data sent by the TURN server and the peer sends data towards the
TURN server.
Transport Address: The combination of an IP address and a port.
Host Transport Address: A transport address on a client or a peer.
Server-Reflexive Transport Address: A transport address on the
"external side" of a NAT. This address is allocated by the NAT to
correspond to a specific host transport address.
Relayed Transport Address: A transport address on the TURN server
that is used for relaying packets between the client and a peer.
A peer sends to this address on the TURN server, and the packet is
then relayed to the client.
TURN Server Transport Address: A transport address on the TURN
server that is used for sending TURN messages to the server. This
is the transport address that the client uses to communicate with
the server.
Peer Transport Address: The transport address of the peer as seen by
the server. When the peer is behind a NAT, this is the peer's
server-reflexive transport address.
Allocation: The relayed transport address granted to a client
through an Allocate request, along with related state, such as
permissions and expiration timers.
5-tuple: The combination (client IP address and port, server IP
address and port, and transport protocol (currently one of UDP,
TCP, DTLS/UDP or TLS/TCP) used to communicate between the client
and the server. The 5-tuple uniquely identifies this
communication stream. The 5-tuple also uniquely identifies the
Allocation on the server.
Transport Protocol: The protocols above IP that carries TURN
Requests, Responses, and Indications as well as providing
identifiable flows using a 5-tuple. In this specification, UDP
and TCP are defined as transport protocols, as well as their
combination with a security layer using DTLS and TLS respectively.
Channel: A channel number and associated peer transport address.
Once a channel number is bound to a peer's transport address, the
client and server can use the more bandwidth-efficient ChannelData
message to exchange data.
Permission: The IP address and transport protocol (but not the port)
of a peer that is permitted to send traffic to the TURN server and
have that traffic relayed to the TURN client. The TURN server
will only forward traffic to its client from peers that match an
existing permission.
Realm: A string used to describe the server or a context within the
server. The realm tells the client which username and password
combination to use to authenticate requests.
Nonce: A string chosen at random by the server and included in the
message-digest. To prevent replay attacks, the server should
change the nonce regularly.
(D)TLS: This term is used for statements that apply to both
Transport Layer Security [RFC8446] and Datagram Transport Layer
Security [RFC6347].
3. Overview of Operation
This section gives an overview of the operation of TURN. It is non- This section gives an overview of the operation of TURN. It is non-
normative. normative.
In a typical configuration, a TURN client is connected to a private In a typical configuration, a TURN client is connected to a private
network [RFC1918] and through one or more NATs to the public network [RFC1918] and through one or more NATs to the public
Internet. On the public Internet is a TURN server. Elsewhere in the Internet. On the public Internet is a TURN server. Elsewhere in the
Internet are one or more peers with which the TURN client wishes to Internet are one or more peers with which the TURN client wishes to
communicate. These peers may or may not be behind one or more NATs. communicate. These peers may or may not be behind one or more NATs.
The client uses the server as a relay to send packets to these peers The client uses the server as a relay to send packets to these peers
skipping to change at page 9, line 5 skipping to change at page 11, line 5
Each allocation on the server belongs to a single client and has Each allocation on the server belongs to a single client and has
exactly one relayed transport address that is used only by that exactly one relayed transport address that is used only by that
allocation. Thus, when a packet arrives at a relayed transport allocation. Thus, when a packet arrives at a relayed transport
address on the server, the server knows for which client the data is address on the server, the server knows for which client the data is
intended. intended.
The client may have multiple allocations on a server at the same The client may have multiple allocations on a server at the same
time. time.
2.1. Transports 3.1. Transports
TURN, as defined in this specification, always uses UDP between the TURN, as defined in this specification, always uses UDP between the
server and the peer. However, this specification allows the use of server and the peer. However, this specification allows the use of
any one of UDP, TCP, Transport Layer Security (TLS) over TCP or any one of UDP, TCP, Transport Layer Security (TLS) over TCP or
Datagram Transport Layer Security (DTLS) over UDP to carry the TURN Datagram Transport Layer Security (DTLS) over UDP to carry the TURN
messages between the client and the server. messages between the client and the server.
+----------------------------+---------------------+ +----------------------------+---------------------+
| TURN client to TURN server | TURN server to peer | | TURN client to TURN server | TURN server to peer |
+----------------------------+---------------------+ +----------------------------+---------------------+
skipping to change at page 10, line 26 skipping to change at page 12, line 26
In some applications for TURN, the client may send and receive In some applications for TURN, the client may send and receive
packets other than TURN packets on the host transport address it uses packets other than TURN packets on the host transport address it uses
to communicate with the server. This can happen, for example, when to communicate with the server. This can happen, for example, when
using TURN with ICE. In these cases, the client can distinguish TURN using TURN with ICE. In these cases, the client can distinguish TURN
packets from other packets by examining the source address of the packets from other packets by examining the source address of the
arriving packet: those arriving from the TURN server will be TURN arriving packet: those arriving from the TURN server will be TURN
packets. The algorithm of demultiplexing packets received from packets. The algorithm of demultiplexing packets received from
multiple protocols on the host transport address is discussed in multiple protocols on the host transport address is discussed in
[RFC7983]. [RFC7983].
2.2. Allocations 3.2. Allocations
To create an allocation on the server, the client uses an Allocate To create an allocation on the server, the client uses an Allocate
transaction. The client sends an Allocate request to the server, and transaction. The client sends an Allocate request to the server, and
the server replies with an Allocate success response containing the the server replies with an Allocate success response containing the
allocated relayed transport address. The client can include allocated relayed transport address. The client can include
attributes in the Allocate request that describe the type of attributes in the Allocate request that describe the type of
allocation it desires (e.g., the lifetime of the allocation). Since allocation it desires (e.g., the lifetime of the allocation). Since
relaying data has security implications, the server requires that the relaying data has security implications, the server requires that the
client authenticate itself, typically using STUN's long-term client authenticate itself, typically using STUN's long-term
credential mechanism or the STUN Extension for Third-Party credential mechanism or the STUN Extension for Third-Party
skipping to change at page 12, line 39 skipping to change at page 14, line 39
requests be authenticated using STUN's long-term credential requests be authenticated using STUN's long-term credential
mechanism, the server rejects the request with a 401 (Unauthorized) mechanism, the server rejects the request with a 401 (Unauthorized)
error code. The client then tries again, this time including error code. The client then tries again, this time including
credentials. This time, the server accepts the Allocate request and credentials. This time, the server accepts the Allocate request and
returns an Allocate success response containing (amongst other returns an Allocate success response containing (amongst other
things) the relayed transport address assigned to the allocation. things) the relayed transport address assigned to the allocation.
Sometime later, the client decides to refresh the allocation and thus Sometime later, the client decides to refresh the allocation and thus
sends a Refresh request to the server. The refresh is accepted and sends a Refresh request to the server. The refresh is accepted and
the server replies with a Refresh success response. the server replies with a Refresh success response.
2.3. Permissions 3.3. Permissions
To ease concerns amongst enterprise IT administrators that TURN could To ease concerns amongst enterprise IT administrators that TURN could
be used to bypass corporate firewall security, TURN includes the be used to bypass corporate firewall security, TURN includes the
notion of permissions. TURN permissions mimic the address-restricted notion of permissions. TURN permissions mimic the address-restricted
filtering mechanism of NATs that comply with [RFC4787]. filtering mechanism of NATs that comply with [RFC4787].
An allocation can have zero or more permissions. Each permission An allocation can have zero or more permissions. Each permission
consists of an IP address and a lifetime. When the server receives a consists of an IP address and a lifetime. When the server receives a
UDP datagram on the allocation's relayed transport address, it first UDP datagram on the allocation's relayed transport address, it first
checks the list of permissions. If the source IP address of the checks the list of permissions. If the source IP address of the
skipping to change at page 13, line 22 skipping to change at page 15, line 22
refreshed with a single request -- this is important for applications refreshed with a single request -- this is important for applications
that use ICE. For security reasons, permissions can only be that use ICE. For security reasons, permissions can only be
installed or refreshed by transactions that can be authenticated; installed or refreshed by transactions that can be authenticated;
thus, Send indications and ChannelData messages (which are used to thus, Send indications and ChannelData messages (which are used to
send data to peers) do not install or refresh any permissions. send data to peers) do not install or refresh any permissions.
Note that permissions are within the context of an allocation, so Note that permissions are within the context of an allocation, so
adding or expiring a permission in one allocation does not affect adding or expiring a permission in one allocation does not affect
other allocations. other allocations.
2.4. Send Mechanism 3.4. Send Mechanism
There are two mechanisms for the client and peers to exchange There are two mechanisms for the client and peers to exchange
application data using the TURN server. The first mechanism uses the application data using the TURN server. The first mechanism uses the
Send and Data methods, the second mechanism uses channels. Common to Send and Data methods, the second mechanism uses channels. Common to
both mechanisms is the ability of the client to communicate with both mechanisms is the ability of the client to communicate with
multiple peers using a single allocated relayed transport address; multiple peers using a single allocated relayed transport address;
thus, both mechanisms include a means for the client to indicate to thus, both mechanisms include a means for the client to indicate to
the server which peer should receive the data, and for the server to the server which peer should receive the data, and for the server to
indicate to the client which peer sent the data. indicate to the client which peer sent the data.
skipping to change at page 14, line 27 skipping to change at page 16, line 27
term credential mechanism of STUN does not support authenticating term credential mechanism of STUN does not support authenticating
indications. This is not as big an issue as it might first appear, indications. This is not as big an issue as it might first appear,
since the client-to-server leg is only half of the total path to the since the client-to-server leg is only half of the total path to the
peer. Applications that want proper security should encrypt the data peer. Applications that want proper security should encrypt the data
sent between the client and a peer. sent between the client and a peer.
Because Send indications are not authenticated, it is possible for an Because Send indications are not authenticated, it is possible for an
attacker to send bogus Send indications to the server, which will attacker to send bogus Send indications to the server, which will
then relay these to a peer. To partly mitigate this attack, TURN then relay these to a peer. To partly mitigate this attack, TURN
requires that the client install a permission towards a peer before requires that the client install a permission towards a peer before
sending data to it using a Send indication. sending data to it using a Send indication. The technique to fully
mitigate the attack is discussed in Section 21.1.4.
TURN TURN Peer Peer TURN TURN Peer Peer
client server A B client server A B
| | | | | | | |
|-- CreatePermission req (Peer A) -->| | | |-- CreatePermission req (Peer A) -->| | |
|<-- CreatePermission success resp --| | | |<-- CreatePermission success resp --| | |
| | | | | | | |
|--- Send ind (Peer A)-------------->| | | |--- Send ind (Peer A)-------------->| | |
| |=== data ===>| | | |=== data ===>| |
| | | | | | | |
skipping to change at page 15, line 21 skipping to change at page 17, line 21
to Peer A using a Send indication; at the server, the application to Peer A using a Send indication; at the server, the application
data is extracted and forwarded in a UDP datagram to Peer A, using data is extracted and forwarded in a UDP datagram to Peer A, using
the relayed transport address as the source transport address. When the relayed transport address as the source transport address. When
a UDP datagram from Peer A is received at the relayed transport a UDP datagram from Peer A is received at the relayed transport
address, the contents are placed into a Data indication and forwarded address, the contents are placed into a Data indication and forwarded
to the client. Later, the client attempts to exchange data with Peer to the client. Later, the client attempts to exchange data with Peer
B; however, no permission has been installed for Peer B, so the Send B; however, no permission has been installed for Peer B, so the Send
indication from the client and the UDP datagram from the peer are indication from the client and the UDP datagram from the peer are
both dropped by the server. both dropped by the server.
2.5. Channels 3.5. Channels
For some applications (e.g., Voice over IP), the 36 bytes of overhead For some applications (e.g., Voice over IP), the 36 bytes of overhead
that a Send indication or Data indication adds to the application that a Send indication or Data indication adds to the application
data can substantially increase the bandwidth required between the data can substantially increase the bandwidth required between the
client and the server. To remedy this, TURN offers a second way for client and the server. To remedy this, TURN offers a second way for
the client and server to associate data with a specific peer. the client and server to associate data with a specific peer.
This second way uses an alternate packet format known as the This second way uses an alternate packet format known as the
ChannelData message. The ChannelData message does not use the STUN ChannelData message. The ChannelData message does not use the STUN
header used by other TURN messages, but instead has a 4-byte header header used by other TURN messages, but instead has a 4-byte header
skipping to change at page 17, line 10 skipping to change at page 19, line 10
message to send additional data to Peer A. The client might decide message to send additional data to Peer A. The client might decide
to do this, for example, so it can use the DONT-FRAGMENT attribute to do this, for example, so it can use the DONT-FRAGMENT attribute
(see the next section). However, once a channel is bound, the server (see the next section). However, once a channel is bound, the server
will always use a ChannelData message, as shown in the call flow. will always use a ChannelData message, as shown in the call flow.
Note that ChannelData messages can only be used for peers to which Note that ChannelData messages can only be used for peers to which
the client has bound a channel. In the example above, Peer A has the client has bound a channel. In the example above, Peer A has
been bound to a channel, but Peer B has not, so application data to been bound to a channel, but Peer B has not, so application data to
and from Peer B would use the Send mechanism. and from Peer B would use the Send mechanism.
2.6. Unprivileged TURN Servers 3.6. Unprivileged TURN Servers
This version of TURN is designed so that the server can be This version of TURN is designed so that the server can be
implemented as an application that runs in user space under commonly implemented as an application that runs in user space under commonly
available operating systems without requiring special privileges. available operating systems without requiring special privileges.
This design decision was made to make it easy to deploy a TURN This design decision was made to make it easy to deploy a TURN
server: for example, to allow a TURN server to be integrated into a server: for example, to allow a TURN server to be integrated into a
peer-to-peer application so that one peer can offer NAT traversal peer-to-peer application so that one peer can offer NAT traversal
services to another peer. services to another peer.
This design decision has the following implications for data relayed This design decision has the following implications for data relayed
skipping to change at page 17, line 38 skipping to change at page 19, line 38
o The Explicit Congestion Notification (ECN) field may be reset by o The Explicit Congestion Notification (ECN) field may be reset by
the server; the server;
o There is no end-to-end fragmentation, since the packet is re- o There is no end-to-end fragmentation, since the packet is re-
assembled at the server. assembled at the server.
Future work may specify alternate TURN semantics that address these Future work may specify alternate TURN semantics that address these
limitations. limitations.
2.7. Avoiding IP Fragmentation 3.7. Avoiding IP Fragmentation
For reasons described in [Frag-Harmful], applications, especially For reasons described in [Frag-Harmful], applications, especially
those sending large volumes of data, should try hard to avoid having those sending large volumes of data, should avoid having their
their packets fragmented. Applications using TCP can more or less packets fragmented. Applications using TCP can more or less ignore
ignore this issue because fragmentation avoidance is now a standard this issue because fragmentation avoidance is now a standard part of
part of TCP, but applications using UDP (and thus any application TCP, but applications using UDP (and thus any application using this
using this version of TURN) need to handle fragmentation avoidance version of TURN) need to avoid IP fragmentation by sending
themselves. sufficiently small messages or use UDP fragmentation
[I-D.ietf-tsvwg-udp-options].
The application running on the client and the peer can take one of The application running on the client and the peer can take one of
two approaches to avoid IP fragmentation. two approaches to avoid IP fragmentation until UDP fragmentation
support is available. The first uses messages that are limited to a
predetermined fixed maximum and the second relies on network feedback
to adapt that maximum.
The first approach is to avoid sending large amounts of application The first approach is to avoid sending large amounts of application
data in the TURN messages/UDP datagrams exchanged between the client data in the TURN messages/UDP datagrams exchanged between the client
and the peer. This is the approach taken by most VoIP (Voice-over- and the peer. This is the approach taken by most VoIP (Voice-over-
IP) applications. In this approach, the application MUST assume a IP) applications. In this approach, the application MUST assume a
PMTU of 1280 bytes, as IPv6 requires that every link in the Internet PMTU of 1280 bytes, as IPv6 requires that every link in the Internet
have an MTU of 1280 octets or greater as specified in [RFC8200]. If have an MTU of 1280 octets or greater as specified in [RFC8200]. If
IPv4 support on legacy or otherwise unusual networks is a IPv4 support on legacy or otherwise unusual networks is a
consideration, the application MAY assume on a PMTU of 576 bytes for consideration, the application MAY assume on an effective MTU of 576
IPv4 datagrams, as every IPv4 host must be capable of receiving a bytes for IPv4 datagrams, as every IPv4 host must be capable of
packet whose length is equal to 576 bytes as discussed in [RFC0791]. receiving a packet whose length is equal to 576 bytes as discussed in
[RFC0791] and [RFC1122].
The exact amount of application data that can be included while The exact amount of application data that can be included while
avoiding fragmentation depends on the details of the TURN session avoiding fragmentation depends on the details of the TURN session
between the client and the server: whether UDP, TCP, or (D)TLS between the client and the server: whether UDP, TCP, or (D)TLS
transport is used, whether ChannelData messages or Send/Data transport is used, whether ChannelData messages or Send/Data
indications are used, and whether any additional attributes (such as indications are used, and whether any additional attributes (such as
the DONT-FRAGMENT attribute) are included. Another factor, which is the DONT-FRAGMENT attribute) are included. Another factor, which is
hard to determine, is whether the MTU is reduced somewhere along the hard to determine, is whether the MTU is reduced somewhere along the
path for other reasons, such as the use of IP-in-IP tunneling. path for other reasons, such as the use of IP-in-IP tunneling.
skipping to change at page 19, line 13 skipping to change at page 21, line 19
FRAGMENT attribute in a Send indication, this tells the server to set FRAGMENT attribute in a Send indication, this tells the server to set
the DF bit in the resulting UDP datagram that it sends to the peer. the DF bit in the resulting UDP datagram that it sends to the peer.
Since some servers may be unable to set the DF bit, the client should Since some servers may be unable to set the DF bit, the client should
also include this attribute in the Allocate request -- any server also include this attribute in the Allocate request -- any server
that does not support the DONT-FRAGMENT attribute will indicate this that does not support the DONT-FRAGMENT attribute will indicate this
by rejecting the Allocate request. If the TURN server carrying out by rejecting the Allocate request. If the TURN server carrying out
packet translation from IPv4-to-IPv6 cannot get the Don't Fragment packet translation from IPv4-to-IPv6 cannot get the Don't Fragment
(DF) bit in the IPv4 header, it MUST reject the Allocate request with (DF) bit in the IPv4 header, it MUST reject the Allocate request with
DONT-FRAGMENT attribute. DONT-FRAGMENT attribute.
2.8. RTP Support 3.8. RTP Support
One of the envisioned uses of TURN is as a relay for clients and One of the envisioned uses of TURN is as a relay for clients and
peers wishing to exchange real-time data (e.g., voice or video) using peers wishing to exchange real-time data (e.g., voice or video) using
RTP. To facilitate the use of TURN for this purpose, TURN includes RTP. To facilitate the use of TURN for this purpose, TURN includes
some special support for older versions of RTP. some special support for older versions of RTP.
Old versions of RTP [RFC3550] required that the RTP stream be on an Old versions of RTP [RFC3550] required that the RTP stream be on an
even port number and the associated RTP Control Protocol (RTCP) even port number and the associated RTP Control Protocol (RTCP)
stream, if present, be on the next highest port. To allow clients to stream, if present, be on the next highest port. To allow clients to
work with peers that still require this, TURN allows the client to work with peers that still require this, TURN allows the client to
request that the server allocate a relayed transport address with an request that the server allocate a relayed transport address with an
even port number, and to optionally request the server reserve the even port number, and to optionally request the server reserve the
next-highest port number for a subsequent allocation. next-highest port number for a subsequent allocation.
2.9. Happy Eyeballs for TURN 3.9. Happy Eyeballs for TURN
If an IPv4 path to reach a TURN server is found, but the TURN If an IPv4 path to reach a TURN server is found, but the TURN
server's IPv6 path is not working, a dual-stack TURN client can server's IPv6 path is not working, a dual-stack TURN client can
experience a significant connection delay compared to an IPv4-only experience a significant connection delay compared to an IPv4-only
TURN client. To overcome these connection setup problems, the TURN TURN client. To overcome these connection setup problems, the TURN
client needs to query both A and AAAA records for the TURN server client needs to query both A and AAAA records for the TURN server
specified using a domain name and try connecting to the TURN server specified using a domain name and try connecting to the TURN server
using both IPv6 and IPv4 addresses in a fashion similar to the Happy using both IPv6 and IPv4 addresses in a fashion similar to the Happy
Eyeballs mechanism defined in [RFC8305]. The TURN client performs Eyeballs mechanism defined in [RFC8305]. The TURN client performs
the following steps based on the transport protocol being used to the following steps based on the transport protocol being used to
skipping to change at page 20, line 24 skipping to change at page 22, line 30
families as discussed in [RFC8305] and use the first DTLS session families as discussed in [RFC8305] and use the first DTLS session
that is established. If the DTLS session is established on both that is established. If the DTLS session is established on both
IP address families then the client sends DTLS close_notify alert IP address families then the client sends DTLS close_notify alert
to terminate the DTLS session using the IP address family with to terminate the DTLS session using the IP address family with
lower precedence. If TURN over DTLS server has been configured to lower precedence. If TURN over DTLS server has been configured to
require a cookie exchange (Section 4.2 in [RFC6347]) and require a cookie exchange (Section 4.2 in [RFC6347]) and
HelloVerifyRequest is received from the TURN servers on both IP HelloVerifyRequest is received from the TURN servers on both IP
address families then the client can silently abandon the address families then the client can silently abandon the
connection on the IP address family with lower precedence. connection on the IP address family with lower precedence.
3. Terminology
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
"SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
document are to be interpreted as described in RFC 2119 [RFC2119].
Readers are expected to be familiar with [I-D.ietf-tram-stunbis] and
the terms defined there.
The following terms are used in this document:
TURN: The protocol spoken between a TURN client and a TURN server.
It is an extension to the STUN protocol [I-D.ietf-tram-stunbis].
The protocol allows a client to allocate and use a relayed
transport address.
TURN client: A STUN client that implements this specification.
TURN server: A STUN server that implements this specification. It
relays data between a TURN client and its peer(s).
Peer: A host with which the TURN client wishes to communicate. The
TURN server relays traffic between the TURN client and its
peer(s). The peer does not interact with the TURN server using
the protocol defined in this document; rather, the peer receives
data sent by the TURN server and the peer sends data towards the
TURN server.
Transport Address: The combination of an IP address and a port.
Host Transport Address: A transport address on a client or a peer.
Server-Reflexive Transport Address: A transport address on the
"external side" of a NAT. This address is allocated by the NAT to
correspond to a specific host transport address.
Relayed Transport Address: A transport address on the TURN server
that is used for relaying packets between the client and a peer.
A peer sends to this address on the TURN server, and the packet is
then relayed to the client.
TURN Server Transport Address: A transport address on the TURN
server that is used for sending TURN messages to the server. This
is the transport address that the client uses to communicate with
the server.
Peer Transport Address: The transport address of the peer as seen by
the server. When the peer is behind a NAT, this is the peer's
server-reflexive transport address.
Allocation: The relayed transport address granted to a client
through an Allocate request, along with related state, such as
permissions and expiration timers.
5-tuple: The combination (client IP address and port, server IP
address and port, and transport protocol (currently one of UDP,
TCP, DTLS/UDP or TLS/TCP) used to communicate between the client
and the server. The 5-tuple uniquely identifies this
communication stream. The 5-tuple also uniquely identifies the
Allocation on the server.
Transport Protocol: The protocols above IP that carries TURN
Requests, Responses, and Indications as well as providing
identifiable flows using a 5-tuple. In this specification, UDP
and TCP are defined as transport protocols, as well as their
combination with a security layer using DTLS and TLS respectively.
Channel: A channel number and associated peer transport address.
Once a channel number is bound to a peer's transport address, the
client and server can use the more bandwidth-efficient ChannelData
message to exchange data.
Permission: The IP address and transport protocol (but not the port)
of a peer that is permitted to send traffic to the TURN server and
have that traffic relayed to the TURN client. The TURN server
will only forward traffic to its client from peers that match an
existing permission.
Realm: A string used to describe the server or a context within the
server. The realm tells the client which username and password
combination to use to authenticate requests.
Nonce: A string chosen at random by the server and included in the
message-digest. To prevent replay attacks, the server should
change the nonce regularly.
(D)TLS: This term is used for statements that apply to both
Transport Layer Security [RFC8446] and Datagram Transport Layer
Security [RFC6347].
4. Discovery of TURN server 4. Discovery of TURN server
Methods of TURN server discovery, including using anycast, are Methods of TURN server discovery, including using anycast, are
described in [RFC8155]. The syntax of the "turn" and "turns" URIs described in [RFC8155]. The syntax of the "turn" and "turns" URIs
are defined in Section 3.1 of [RFC7065]. DTLS as a transport are defined in Section 3.1 of [RFC7065]. DTLS as a transport
protocol for TURN is defined in [RFC7350]. protocol for TURN is defined in [RFC7350].
4.1. TURN URI Scheme Semantics 4.1. TURN URI Scheme Semantics
The "turn" and "turns" URI schemes are used to designate a TURN The "turn" and "turns" URI schemes are used to designate a TURN
skipping to change at page 24, line 50 skipping to change at page 25, line 15
[I-D.ietf-tram-stunbis]). Some implementations may choose to meet [I-D.ietf-tram-stunbis]). Some implementations may choose to meet
this requirement by remembering all received requests and the this requirement by remembering all received requests and the
corresponding responses for 40 seconds. Other implementations may corresponding responses for 40 seconds. Other implementations may
choose to reprocess the request and arrange that such reprocessing choose to reprocess the request and arrange that such reprocessing
returns essentially the same response. To aid implementors who returns essentially the same response. To aid implementors who
choose the latter approach (the so-called "stateless stack choose the latter approach (the so-called "stateless stack
approach"), this specification includes some implementation notes on approach"), this specification includes some implementation notes on
how this might be done. Implementations are free to choose either how this might be done. Implementations are free to choose either
approach or choose some other approach that gives the same results. approach or choose some other approach that gives the same results.
When TCP transport is used between the client and the server, it is
possible that a bit error will cause a length field in a TURN packet
to become corrupted, causing the receiver to lose synchronization
with the incoming stream of TURN messages. A client or server that
detects a long sequence of invalid TURN messages over TCP transport
SHOULD close the corresponding TCP connection to help the other end
detect this situation more rapidly.
To mitigate either intentional or unintentional denial-of-service To mitigate either intentional or unintentional denial-of-service
attacks against the server by clients with valid usernames and attacks against the server by clients with valid usernames and
passwords, it is RECOMMENDED that the server impose limits on both passwords, it is RECOMMENDED that the server impose limits on both
the number of allocations active at one time for a given username and the number of allocations active at one time for a given username and
on the amount of bandwidth those allocations can use. The server on the amount of bandwidth those allocations can use. The server
should reject new allocations that would exceed the limit on the should reject new allocations that would exceed the limit on the
allowed number of allocations active at one time with a 486 allowed number of allocations active at one time with a 486
(Allocation Quota Exceeded) (see Section 7.2), and should discard (Allocation Quota Exceeded) (see Section 7.2), and should discard
application data traffic that exceeds the bandwidth quota. application data traffic that exceeds the bandwidth quota.
skipping to change at page 26, line 49 skipping to change at page 27, line 5
by allowing the underlying OS to pick a currently unused port. by allowing the underlying OS to pick a currently unused port.
The client then picks a transport protocol that the client supports The client then picks a transport protocol that the client supports
to use between the client and the server based on the transport to use between the client and the server based on the transport
protocols supported by the server. Since this specification only protocols supported by the server. Since this specification only
allows UDP between the server and the peers, it is RECOMMENDED that allows UDP between the server and the peers, it is RECOMMENDED that
the client pick UDP unless it has a reason to use a different the client pick UDP unless it has a reason to use a different
transport. One reason to pick a different transport would be that transport. One reason to pick a different transport would be that
the client believes, either through configuration or discovery or by the client believes, either through configuration or discovery or by
experiment, that it is unable to contact any TURN server using UDP. experiment, that it is unable to contact any TURN server using UDP.
See Section 2.1 for more discussion. See Section 3.1 for more discussion.
The client also picks a server transport address, which SHOULD be The client also picks a server transport address, which SHOULD be
done as follows. The client uses one or more procedures described in done as follows. The client uses one or more procedures described in
[RFC8155] to discover a TURN server and uses the TURN server [RFC8155] to discover a TURN server and uses the TURN server
resolution mechanism defined in [RFC5928] and [RFC7350] to get a list resolution mechanism defined in [RFC5928] and [RFC7350] to get a list
of server transport addresses that can be tried to create a TURN of server transport addresses that can be tried to create a TURN
allocation. allocation.
The client MUST include a REQUESTED-TRANSPORT attribute in the The client MUST include a REQUESTED-TRANSPORT attribute in the
request. This attribute specifies the transport protocol between the request. This attribute specifies the transport protocol between the
server and the peers (note that this is NOT the transport protocol server and the peers (note that this is NOT the transport protocol
that appears in the 5-tuple). In this specification, the REQUESTED- that appears in the 5-tuple). In this specification, the REQUESTED-
TRANSPORT type is always UDP. This attribute is included to allow TRANSPORT type is always UDP. This attribute is included to allow
skipping to change at page 29, line 9 skipping to change at page 29, line 15
3. The server checks if the request contains a REQUESTED-TRANSPORT 3. The server checks if the request contains a REQUESTED-TRANSPORT
attribute. If the REQUESTED-TRANSPORT attribute is not included attribute. If the REQUESTED-TRANSPORT attribute is not included
or is malformed, the server rejects the request with a 400 (Bad or is malformed, the server rejects the request with a 400 (Bad
Request) error. Otherwise, if the attribute is included but Request) error. Otherwise, if the attribute is included but
specifies a protocol other than UDP that is not supported by the specifies a protocol other than UDP that is not supported by the
server, the server rejects the request with a 442 (Unsupported server, the server rejects the request with a 442 (Unsupported
Transport Protocol) error. Transport Protocol) error.
4. The request may contain a DONT-FRAGMENT attribute. If it does, 4. The request may contain a DONT-FRAGMENT attribute. If it does,
but the server does not support sending UDP datagrams with the but the server does not support sending UDP datagrams with the
DF bit set to 1 (see Section 14), then the server treats the DF bit set to 1 (see Section 14 and Section 15), then the server
DONT-FRAGMENT attribute in the Allocate request as an unknown treats the DONT-FRAGMENT attribute in the Allocate request as an
comprehension-required attribute. unknown comprehension-required attribute.
5. The server checks if the request contains a RESERVATION-TOKEN 5. The server checks if the request contains a RESERVATION-TOKEN
attribute. If yes, and the request also contains an EVEN-PORT attribute. If yes, and the request also contains an EVEN-PORT
or REQUESTED-ADDRESS-FAMILY or ADDITIONAL-ADDRESS-FAMILY or REQUESTED-ADDRESS-FAMILY or ADDITIONAL-ADDRESS-FAMILY
attribute, the server rejects the request with a 400 (Bad attribute, the server rejects the request with a 400 (Bad
Request) error. Otherwise, it checks to see if the token is Request) error. Otherwise, it checks to see if the token is
valid (i.e., the token is in range and has not expired and the valid (i.e., the token is in range and has not expired and the
corresponding relayed transport address is still available). If corresponding relayed transport address is still available). If
the token is not valid for some reason, the server rejects the the token is not valid for some reason, the server rejects the
request with a 508 (Insufficient Capacity) error. request with a 508 (Insufficient Capacity) error.
skipping to change at page 42, line 22 skipping to change at page 42, line 27
the allocation, where the allocation is determined by the 5-tuple the allocation, where the allocation is determined by the 5-tuple
on which the Send indication arrived; on which the Send indication arrived;
o the destination transport address is taken from the XOR-PEER- o the destination transport address is taken from the XOR-PEER-
ADDRESS attribute; ADDRESS attribute;
o the data following the UDP header is the contents of the value o the data following the UDP header is the contents of the value
field of the DATA attribute. field of the DATA attribute.
The handling of the DONT-FRAGMENT attribute (if present), is The handling of the DONT-FRAGMENT attribute (if present), is
described in Section 14. described in Section 14 and Section 15.
The resulting UDP datagram is then sent to the peer. The resulting UDP datagram is then sent to the peer.
11.3. Receiving a UDP Datagram 11.3. Receiving a UDP Datagram
When the server receives a UDP datagram at a currently allocated When the server receives a UDP datagram at a currently allocated
relayed transport address, the server looks up the allocation relayed transport address, the server looks up the allocation
associated with the relayed transport address. The server then associated with the relayed transport address. The server then
checks to see whether the set of permissions for the allocation allow checks to see whether the set of permissions for the allocation allow
the relaying of the UDP datagram as described in Section 9. the relaying of the UDP datagram as described in Section 9.
skipping to change at page 45, line 25 skipping to change at page 45, line 29
| [64..79] | TURN Channel | | [64..79] | TURN Channel |
| | | | | |
+-------------------------------------------+ +-------------------------------------------+
| [128..191] | RTP/RTCP | | [128..191] | RTP/RTCP |
| | | | | |
+-------------------------------------------+ +-------------------------------------------+
| Others | Reserved, MUST be dropped | | Others | Reserved, MUST be dropped |
| | and an alert MAY be logged | | | and an alert MAY be logged |
+-------------------------------------------+ +-------------------------------------------+
Figure 5
Reserved values may be used in the future by other protocols. When Reserved values may be used in the future by other protocols. When
the client uses channel binding, it MUST comply with the the client uses channel binding, it MUST comply with the
demultiplexing scheme discussed above. demultiplexing scheme discussed above.
Channel bindings are always initiated by the client. The client can Channel bindings are always initiated by the client. The client can
bind a channel to a peer at any time during the lifetime of the bind a channel to a peer at any time during the lifetime of the
allocation. The client may bind a channel to a peer before allocation. The client may bind a channel to a peer before
exchanging data with it, or after exchanging data with it (using Send exchanging data with it, or after exchanging data with it (using Send
and Data indications) for some time, or may choose never to bind a and Data indications) for some time, or may choose never to bind a
channel to it. The client can also bind channels to some peers while channel to it. The client can also bind channels to some peers while
skipping to change at page 49, line 41 skipping to change at page 49, line 44
message (including padding) is (4 + Length) rounded up to the nearest message (including padding) is (4 + Length) rounded up to the nearest
multiple of 4. Over UDP, the padding is not required but MAY be multiple of 4. Over UDP, the padding is not required but MAY be
included. included.
The ChannelData message is then sent on the 5-tuple associated with The ChannelData message is then sent on the 5-tuple associated with
the allocation. the allocation.
12.6. Receiving a ChannelData Message 12.6. Receiving a ChannelData Message
The receiver of the ChannelData message uses the first byte to The receiver of the ChannelData message uses the first byte to
distinguish it from other multiplexed protocols, as described above. distinguish it from other multiplexed protocols, as described in
If the message uses a value in the reserved range (0x5000 through Figure 5. If the message uses a value in the reserved range (0x5000
0xFFFF), then the message is silently discarded. through 0xFFFF), then the message is silently discarded.
If the ChannelData message is received in a UDP datagram, and if the If the ChannelData message is received in a UDP datagram, and if the
UDP datagram is too short to contain the claimed length of the UDP datagram is too short to contain the claimed length of the
ChannelData message (i.e., the UDP header length field value is less ChannelData message (i.e., the UDP header length field value is less
than the ChannelData header length field value + 4 + 8), then the than the ChannelData header length field value + 4 + 8), then the
message is silently discarded. message is silently discarded.
If the ChannelData message is received over TCP or over TLS-over-TCP, If the ChannelData message is received over TCP or over TLS-over-TCP,
then the actual length of the ChannelData message is as described in then the actual length of the ChannelData message is as described in
Section 12.5. Section 12.5.
skipping to change at page 51, line 12 skipping to change at page 51, line 12
destination of the UDP datagram that triggered the reception of the destination of the UDP datagram that triggered the reception of the
ICMP packet. ICMP packet.
13. Packet Translations 13. Packet Translations
This section addresses IPv4-to-IPv6, IPv6-to-IPv4, and IPv6-to-IPv6 This section addresses IPv4-to-IPv6, IPv6-to-IPv4, and IPv6-to-IPv6
translations. Requirements for translation of the IP addresses and translations. Requirements for translation of the IP addresses and
port numbers of the packets are described above. The following port numbers of the packets are described above. The following
sections specify how to translate other header fields. sections specify how to translate other header fields.
As discussed in Section 2.6, translations in TURN are designed so As discussed in Section 3.6, translations in TURN are designed so
that a TURN server can be implemented as an application that runs in that a TURN server can be implemented as an application that runs in
userland under commonly available operating systems and that does not user space under commonly available operating systems and that does
require special privileges. The translations specified in the not require special privileges. The translations specified in the
following sections follow this principle. following sections follow this principle.
The descriptions below have two parts: a preferred behavior and an The descriptions below have two parts: a preferred behavior and an
alternate behavior. The server SHOULD implement the preferred alternate behavior. The server SHOULD implement the preferred
behavior. Otherwise, the server MUST implement the alternate behavior. Otherwise, the server MUST implement the alternate
behavior and MUST NOT do anything else for the reasons detailed in behavior and MUST NOT do anything else for the reasons detailed in
[RFC7915]. The TURN server solely relies on the DF bit in the IPv4 [RFC7915]. The TURN server solely relies on the DF bit in the IPv4
header and Fragmentation header in IPv6 header to handle header and Fragmentation header in IPv6 header to handle
fragmentation and does not rely on the DONT-FRAGMENT attribute. fragmentation and does not rely on the DONT-FRAGMENT attribute.
13.1. IPv4-to-IPv6 Translations 13.1. IPv4-to-IPv6 Translations
Time to Live (TTL) field
Preferred Behavior: As specified in Section 4 of [RFC7915].
Alternate Behavior: Set the outgoing value to the default for
outgoing packets.
Traffic Class Traffic Class
Preferred behavior: As specified in Section 4 of [RFC7915]. Preferred behavior: As specified in Section 4 of [RFC7915].
Alternate behavior: The TURN server sets the Traffic Class to the Alternate behavior: The TURN server sets the Traffic Class to the
default value for outgoing packets. default value for outgoing packets.
Flow Label Flow Label
Preferred behavior: The TURN server can use the 5-tuple of relayed Preferred behavior: The TURN server can use the 5-tuple of relayed
skipping to change at page 52, line 18 skipping to change at page 52, line 25
Alternate behavior: The TURN server assembles incoming fragments. Alternate behavior: The TURN server assembles incoming fragments.
The TURN server follows its default behavior to send outgoing The TURN server follows its default behavior to send outgoing
packets. packets.
For both preferred and alternate behavior, the DONT-FRAGMENT For both preferred and alternate behavior, the DONT-FRAGMENT
attribute MUST be ignored by the server. attribute MUST be ignored by the server.
Extension Headers Extension Headers
Preferred behavior: The TURN server sends outgoing packet without Preferred behavior: The outgoing packet uses the system defaults
any IPv6 extension headers, with the exception of the for IPv6 extension headers, with the exception of the
Fragmentation header as described above. Fragmentation header as described above.
Alternate behavior: Same as preferred. Alternate behavior: Same as preferred.
13.2. IPv6-to-IPv6 Translations 13.2. IPv6-to-IPv6 Translations
Flow Label Flow Label
The TURN server should consider that it is handling two different The TURN server should consider that it is handling two different
IPv6 flows. Therefore, the Flow label [RFC6437] SHOULD NOT be copied IPv6 flows. Therefore, the Flow label [RFC6437] SHOULD NOT be copied
skipping to change at page 53, line 39 skipping to change at page 53, line 48
Alternate behavior: The TURN server assembles incoming fragments. Alternate behavior: The TURN server assembles incoming fragments.
The TURN server follows its default behavior to send outgoing The TURN server follows its default behavior to send outgoing
packets. packets.
For both preferred and alternate behavior, the DONT-FRAGMENT For both preferred and alternate behavior, the DONT-FRAGMENT
attribute MUST be ignored by the server. attribute MUST be ignored by the server.
Extension Headers Extension Headers
Preferred behavior: The TURN server sends outgoing packet without Preferred behavior: The outgoing packet uses the system defaults
any IPv6 extension headers, with the exception of the for IPv6 extension headers, with the exception of the
Fragmentation header as described above. Fragmentation header as described above.
Alternate behavior: Same as preferred. Alternate behavior: Same as preferred.
13.3. IPv6-to-IPv4 Translations 13.3. IPv6-to-IPv4 Translations
Type of Service and Precedence Type of Service and Precedence
Preferred behavior: As specified in Section 5 of [RFC7915]. Preferred behavior: As specified in Section 5 of [RFC7915].
skipping to change at page 54, line 32 skipping to change at page 54, line 40
reported in the ICMP message by 48 bytes to allow room for the reported in the ICMP message by 48 bytes to allow room for the
overhead of a Data indication. overhead of a Data indication.
Alternate behavior: The TURN server assembles incoming fragments. Alternate behavior: The TURN server assembles incoming fragments.
The TURN server follows its default behavior to send outgoing The TURN server follows its default behavior to send outgoing
packets. packets.
For both preferred and alternate behavior, the DONT-FRAGMENT For both preferred and alternate behavior, the DONT-FRAGMENT
attribute MUST be ignored by the server. attribute MUST be ignored by the server.
14. IP Header Fields for UDP-to-UDP translation 14. UDP-to-UDP relay
This section describes how the server sets various fields in the IP This section describes how the server sets various fields in the IP
header for UDP-to-UDP translation when relaying between the client header for UDP-to-UDP relay from the client to the peer or vice
and the peer or vice versa. The descriptions in this section apply: versa. The descriptions in this section apply: (a) when the server
(a) when the server sends a UDP datagram to the peer, or (b) when the sends a UDP datagram to the peer, or (b) when the server sends a Data
server sends a Data indication or ChannelData message to the client indication or ChannelData message to the client over UDP transport.
over UDP transport. The descriptions in this section do not apply to The descriptions in this section do not apply to TURN messages sent
TURN messages sent over TCP or TLS transport from the server to the over TCP or TLS transport from the server to the client.
client.
The descriptions below have two parts: a preferred behavior and an The descriptions below have two parts: a preferred behavior and an
alternate behavior. The server SHOULD implement the preferred alternate behavior. The server SHOULD implement the preferred
behavior, but if that is not possible for a particular field, then it behavior, but if that is not possible for a particular field, then it
SHOULD implement the alternative behavior. SHOULD implement the alternative behavior.
Time to Live (TTL) field
Preferred Behavior: If the incoming value is 0, then drop the
incoming packet. Otherwise, set the outgoing Time to Live/Hop
Count to one less than the incoming value.
Alternate Behavior: Set the outgoing value to the default for
outgoing packets.
Differentiated Services Code Point (DSCP) field [RFC2474] Differentiated Services Code Point (DSCP) field [RFC2474]
Preferred Behavior: Set the outgoing value to the incoming value, Preferred Behavior: Set the outgoing value to the incoming value,
unless the server includes a differentiated services classifier unless the server includes a differentiated services classifier
and marker [RFC2474]. and marker [RFC2474].
Alternate Behavior: Set the outgoing value to a fixed value, which Alternate Behavior: Set the outgoing value to a fixed value, which
by default is Best Effort unless configured otherwise. by default is Best Effort unless configured otherwise.
In both cases, if the server is immediately adjacent to a In both cases, if the server is immediately adjacent to a
skipping to change at page 55, line 36 skipping to change at page 55, line 35
SHOULD behave as a ECN aware router [RFC3168] and can mark traffic SHOULD behave as a ECN aware router [RFC3168] and can mark traffic
with Congestion Experienced (CE) instead of dropping the packet. with Congestion Experienced (CE) instead of dropping the packet.
The use of ECT(1) is subject to experimental usage [RFC8311]. The use of ECT(1) is subject to experimental usage [RFC8311].
Alternate Behavior: Set the outgoing value to Not-ECT (=0b00). Alternate Behavior: Set the outgoing value to Not-ECT (=0b00).
IPv4 Fragmentation fields IPv4 Fragmentation fields
Preferred Behavior: When the server sends a packet to a peer in Preferred Behavior: When the server sends a packet to a peer in
response to a Send indication containing the DONT-FRAGMENT response to a Send indication containing the DONT-FRAGMENT
attribute, then set the DF bit in the outgoing IP header to 1. In attribute, then set the outgoing UDP packet to not fragment. In
all other cases when sending an outgoing packet containing all other cases when sending an outgoing packet containing
application data (e.g., Data indication, ChannelData message, or application data (e.g., Data indication, ChannelData message, or
DONT-FRAGMENT attribute not included in the Send indication), copy DONT-FRAGMENT attribute not included in the Send indication), copy
the DF bit from the DF bit of the incoming packet that contained the DF bit from the DF bit of the incoming packet that contained
the application data. the application data.
Set the other fragmentation fields (Identification, More Set the other fragmentation fields (Identification, More
Fragments, Fragment Offset) as appropriate for a packet Fragments, Fragment Offset) as appropriate for a packet
originating from the server. originating from the server.
Alternate Behavior: As described in the Preferred Behavior, except Alternate Behavior: As described in the Preferred Behavior, except
always assume the incoming DF bit is 0. always assume the incoming DF bit is 0.
In both the Preferred and Alternate Behaviors, the resulting In both the Preferred and Alternate Behaviors, the resulting
packet may be too large for the outgoing link. If this is the packet may be too large for the outgoing link. If this is the
case, then the normal fragmentation rules apply [RFC1122]. case, then the normal fragmentation rules apply [RFC1122].
IPv4 Options IPv4 Options
Preferred Behavior: The outgoing packet is sent without any IPv4 Preferred Behavior: The outgoing packet uses the system defaults
options. for IPv4 options.
Alternate Behavior: Same as preferred. Alternate Behavior: Same as preferred.
15. IP Header Fields for TCP-to-UDP translation 15. TCP-to-UDP relay
This section describes how the server sets various fields in the IP This section describes how the server sets various fields in the IP
header for TCP-to-UDP translation when relaying between the client header for TCP-to-UDP relay from the client to the peer. The
and the peer, and UDP-to-TCP translation when relaying between the descriptions in this section apply when the server sends a UDP
peer and the client. The descriptions in this section apply: (a) datagram to the peer. Note that the server does not perform per-
when the server sends a UDP datagram to the peer, or (b) when the packet translation for TCP-to-UDP relaying.
server sends a Data indication or ChannelData message to the client
over TCP or TLS transport. The descriptions in this section do not TCP multi-path [RFC6824] is not supported by this version of TURN
apply to TURN messages sent over UDP transport from the server to the because TCP multi-path is not used by both SIP and WebRTC protocols
client. [RFC7478] for media and non-media data. If the TCP connection
between the TURN client and server uses TCP-AO [RFC5925] or TLS, the
client must secure application data (e.g. using SRTP) to provide
confidentially, message authentication and replay protection to
protect the application data relayed from the server to the peer
using UDP. Attacker attempting to spoof in fake data is discussed in
Section 21.1.4. Note that TCP-AO option obsoletes TCP MD5 option.
Unlike UDP, TCP without the TCP Fast Open extension [RFC7413] does
not support 0-RTT session resumption. The TCP user timeout [RFC5482]
equivalent for application data relayed by the TURN is the use of RTP
control protocol (RTCP). As a reminder, RTCP is a fundamental and
integral part of RTP.
The descriptions below have two parts: a preferred behavior and an The descriptions below have two parts: a preferred behavior and an
alternate behavior. The server SHOULD implement the preferred alternate behavior. The server SHOULD implement the preferred
behavior, but if that is not possible for a particular field, then it behavior, but if that is not possible for a particular field, then it
SHOULD implement the alternative behavior. SHOULD implement the alternative behavior.
For the UDP datagram sent to the peer based on Send Indication or For the UDP datagram sent to the peer based on Send Indication or
ChannelData message arriving at the TURN server over a TCP Transport, ChannelData message arriving at the TURN server over a TCP Transport,
the server sets various fields in the IP header as follows: the server sets various fields in the IP header as follows:
Time to Live (TTL) field
Preferred Behavior: Set to default outgoing value.
Alternate Behavior: Same as preferred.
Differentiated Services Code Point (DSCP) field [RFC2474] Differentiated Services Code Point (DSCP) field [RFC2474]
Preferred Behavior: Set the outgoing value to the incoming value, Preferred Behavior: The TCP connection can only use a single DSCP
unless the server includes a differentiated services classifier code point so inter flow differentiation is not possible, see
and marker [RFC2474]. Note, the TCP connection can only use a Section 5.1 of [RFC7657]. The server sets the outgoing value to
single DSCP code point so inter flow differentiation is not the DSCP code point used by the TCP connection, unless the server
possible, see Section 5.1 of [RFC7657]. includes a differentiated services classifier and marker
[RFC2474].
Alternate Behavior: Set the outgoing value to a fixed value, which Alternate Behavior: Set the outgoing value to a fixed value, which
by default is Best Effort unless configured otherwise. by default is Best Effort unless configured otherwise.
In both cases, if the server is immediately adjacent to a In both cases, if the server is immediately adjacent to a
differentiated services classifier and marker, then DSCP MAY be differentiated services classifier and marker, then DSCP MAY be
set to any arbitrary value in the direction towards the set to any arbitrary value in the direction towards the
classifier. classifier.
Explicit Congestion Notification (ECN) field [RFC3168] Explicit Congestion Notification (ECN) field [RFC3168]
skipping to change at page 57, line 25 skipping to change at page 57, line 29
Preferred Behavior: No mechanism is defined to indicate what ECN Preferred Behavior: No mechanism is defined to indicate what ECN
value should be used for the outgoing UDP datagrams of an value should be used for the outgoing UDP datagrams of an
allocation, therefore set the outgoing value to Not-ECT (=0b00). allocation, therefore set the outgoing value to Not-ECT (=0b00).
Alternate Behavior: Same as preferred. Alternate Behavior: Same as preferred.
IPv4 Fragmentation fields IPv4 Fragmentation fields
Preferred Behavior: When the server sends a packet to a peer in Preferred Behavior: When the server sends a packet to a peer in
response to a Send indication containing the DONT-FRAGMENT response to a Send indication containing the DONT-FRAGMENT
attribute, then set the DF bit in the outgoing IP header to 1. In attribute, then set the outgoing UDP packet to not fragment. In
all other cases when sending an outgoing packet containing all other cases when sending an outgoing UDP packet containing
application data (e.g., Data indication, ChannelData message, or application data (e.g., Data indication, ChannelData message, or
DONT-FRAGMENT attribute not included in the Send indication), set DONT-FRAGMENT attribute not included in the Send indication), set
the DF bit in the outgoing IP header to 0. the DF bit in the outgoing IP header to 0.
Alternate Behavior: Same as preferred. Alternate Behavior: Same as preferred.
IPv6 Fragmentation IPv6 Fragmentation fields
Preferred Behavior: If the TCP traffic arrives over IPv4 or IPv6, Preferred Behavior: If the TCP traffic arrives over IPv6, the
the server will ignore the DF bit in the IPv4 header or the server relies on the presence of DON'T-FRAGMENT attribute in the
Fragment header in IPv6, and relies on the presence of send indication to set the outgoing UDP packet to not fragment.
DON'T-FRAGMENT attribute in the send indication to not include the
Fragment header for the outgoing IPv6 packet.
Alternate Behavior: Same as preferred. Alternate Behavior: Same as preferred.
IPv4 Options IPv4 Options
Preferred Behavior: The outgoing packet is sent without any IPv4 Preferred Behavior: The outgoing packet uses the system defaults
options. for IPv4 options.
Alternate Behavior: Same as preferred. Alternate Behavior: Same as preferred.
For the Data indication or ChannelData message sent to the client 16. UDP-to-TCP relay
over TCP or TLS transport based on the UDP datagram from the peer,
the server sets various fields in the IP header as follows:
Time to Live (TTL) field This section describes how the server sets various fields in the IP
header for UDP-to-TCP relay from the peer to the client. The
descriptions in this section apply when the server sends a Data
indication or ChannelData message to the client over TCP or TLS
transport. Note that the server does not perform per-packet
translation for UDP-to-TCP relaying.
Preferred Behavior: If TTL value is zero then drop the packet, The descriptions below have two parts: a preferred behavior and an
else ignore. alternate behavior. The server SHOULD implement the preferred
behavior, but if that is not possible for a particular field, then it
SHOULD implement the alternative behavior.
Alternate Behavior: Same as preferred. The TURN server sets IP header fields in the TCP packets on a per-
connection basis for the TCP connection as follows:
Differentiated Services Code Point (DSCP) field [RFC2474] Differentiated Services Code Point (DSCP) field [RFC2474]
Preferred Behavior: Ignore the incoming DSCP value, the DSCP value Preferred Behavior: Ignore the incoming DSCP value. When TCP is
for the server to client direction of the TCP connection should be used between the client and the server, a single DSCP should be
based on the value used for the client to server direction. used for all traffic on that TCP connection. Note, TURN/ICE
occurs before application data is exchanged.
Alternate Behavior: Same as preferred. Alternate Behavior: Same as preferred.
Explicit Congestion Notification (ECN) field [RFC3168] Explicit Congestion Notification (ECN) field [RFC3168]
Preferred Behavior: Ignore, ECN signals are dropped in the TURN Preferred Behavior: Ignore, ECN signals are dropped in the TURN
server for the incoming UDP datagrams from the peer. server for the incoming UDP datagrams from the peer.
Alternate Behavior: Same as preferred. Alternate Behavior: Same as preferred.
skipping to change at page 58, line 43 skipping to change at page 59, line 7
Preferred Behavior: Any fragmented packets are reassembled in the Preferred Behavior: Any fragmented packets are reassembled in the
server and then forwarded to the client over the TCP connection. server and then forwarded to the client over the TCP connection.
ICMP messages resulting from the UDP datagrams sent to the peer ICMP messages resulting from the UDP datagrams sent to the peer
MUST be forwarded to the client using TURN's mechanism for MUST be forwarded to the client using TURN's mechanism for
relevant ICMP types and codes. relevant ICMP types and codes.
Alternate Behavior: Same as preferred. Alternate Behavior: Same as preferred.
Extension Headers Extension Headers
Preferred behavior: The TURN server sends outgoing packet without Preferred behavior: The outgoing packet uses the system defaults
any IPv6 extension headers. for IPv6 extension headers.
Alternate behavior: Same as preferred. Alternate behavior: Same as preferred.
IPv4 Options IPv4 Options
Preferred Behavior: The outgoing packet is sent without any IPv4
options. Preferred Behavior: The outgoing packet uses the system defaults
for IPv4 options.
Alternate Behavior: Same as preferred. Alternate Behavior: Same as preferred.
16. STUN Methods 17. STUN Methods
This section lists the codepoints for the STUN methods defined in This section lists the codepoints for the STUN methods defined in
this specification. See elsewhere in this document for the semantics this specification. See elsewhere in this document for the semantics
of these methods. of these methods.
0x003 : Allocate (only request/response semantics defined) 0x003 : Allocate (only request/response semantics defined)
0x004 : Refresh (only request/response semantics defined) 0x004 : Refresh (only request/response semantics defined)
0x006 : Send (only indication semantics defined) 0x006 : Send (only indication semantics defined)
0x007 : Data (only indication semantics defined) 0x007 : Data (only indication semantics defined)
0x008 : CreatePermission (only request/response semantics defined 0x008 : CreatePermission (only request/response semantics defined
0x009 : ChannelBind (only request/response semantics defined) 0x009 : ChannelBind (only request/response semantics defined)
17. STUN Attributes 18. STUN Attributes
This STUN extension defines the following attributes: This STUN extension defines the following attributes:
0x000C: CHANNEL-NUMBER 0x000C: CHANNEL-NUMBER
0x000D: LIFETIME 0x000D: LIFETIME
0x0010: Reserved (was BANDWIDTH) 0x0010: Reserved (was BANDWIDTH)
0x0012: XOR-PEER-ADDRESS 0x0012: XOR-PEER-ADDRESS
0x0013: DATA 0x0013: DATA
0x0016: XOR-RELAYED-ADDRESS 0x0016: XOR-RELAYED-ADDRESS
0x0017: REQUESTED-ADDRESS-FAMILY 0x0017: REQUESTED-ADDRESS-FAMILY
skipping to change at page 60, line 5 skipping to change at page 60, line 11
TBD-CA: ADDITIONAL-ADDRESS-FAMILY TBD-CA: ADDITIONAL-ADDRESS-FAMILY
TBD-CA: ADDRESS-ERROR-CODE TBD-CA: ADDRESS-ERROR-CODE
TBD-CA: ICMP TBD-CA: ICMP
Some of these attributes have lengths that are not multiples of 4. Some of these attributes have lengths that are not multiples of 4.
By the rules of STUN, any attribute whose length is not a multiple of By the rules of STUN, any attribute whose length is not a multiple of
4 bytes MUST be immediately followed by 1 to 3 padding bytes to 4 bytes MUST be immediately followed by 1 to 3 padding bytes to
ensure the next attribute (if any) would start on a 4-byte boundary ensure the next attribute (if any) would start on a 4-byte boundary
(see [I-D.ietf-tram-stunbis]). (see [I-D.ietf-tram-stunbis]).
17.1. CHANNEL-NUMBER 18.1. CHANNEL-NUMBER
The CHANNEL-NUMBER attribute contains the number of the channel. The The CHANNEL-NUMBER attribute contains the number of the channel. The
value portion of this attribute is 4 bytes long and consists of a value portion of this attribute is 4 bytes long and consists of a
16-bit unsigned integer, followed by a two-octet RFFU (Reserved For 16-bit unsigned integer, followed by a two-octet RFFU (Reserved For
Future Use) field, which MUST be set to 0 on transmission and MUST be Future Use) field, which MUST be set to 0 on transmission and MUST be
ignored on reception. ignored on reception.
0 1 2 3 0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Channel Number | RFFU = 0 | | Channel Number | RFFU = 0 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
17.2. LIFETIME 18.2. LIFETIME
The LIFETIME attribute represents the duration for which the server The LIFETIME attribute represents the duration for which the server
will maintain an allocation in the absence of a refresh. The TURN will maintain an allocation in the absence of a refresh. The TURN
client can include the LIFETIME attribute with the desired lifetime client can include the LIFETIME attribute with the desired lifetime
in Allocate and Refresh requests. The value portion of this in Allocate and Refresh requests. The value portion of this
attribute is 4-bytes long and consists of a 32-bit unsigned integral attribute is 4-bytes long and consists of a 32-bit unsigned integral
value representing the number of seconds remaining until expiration. value representing the number of seconds remaining until expiration.
17.3. XOR-PEER-ADDRESS 18.3. XOR-PEER-ADDRESS
The XOR-PEER-ADDRESS specifies the address and port of the peer as The XOR-PEER-ADDRESS specifies the address and port of the peer as
seen from the TURN server. (For example, the peer's server-reflexive seen from the TURN server. (For example, the peer's server-reflexive
transport address if the peer is behind a NAT.) It is encoded in the transport address if the peer is behind a NAT.) It is encoded in the
same way as XOR-MAPPED-ADDRESS [I-D.ietf-tram-stunbis]. same way as XOR-MAPPED-ADDRESS [I-D.ietf-tram-stunbis].
17.4. DATA 18.4. DATA
The DATA attribute is present in all Send and Data indications. The The DATA attribute is present in all Send and Data indications. The
value portion of this attribute is variable length and consists of value portion of this attribute is variable length and consists of
the application data (that is, the data that would immediately follow the application data (that is, the data that would immediately follow
the UDP header if the data was been sent directly between the client the UDP header if the data was been sent directly between the client
and the peer). The application data is equivalent to the "UDP user and the peer). The application data is equivalent to the "UDP user
data" and does not include the "surplus area" defined in Section 4 of data" and does not include the "surplus area" defined in Section 4 of
[I-D.ietf-tsvwg-udp-options]. If the length of this attribute is not [I-D.ietf-tsvwg-udp-options]. If the length of this attribute is not
a multiple of 4, then padding must be added after this attribute. a multiple of 4, then padding must be added after this attribute.
17.5. XOR-RELAYED-ADDRESS 18.5. XOR-RELAYED-ADDRESS
The XOR-RELAYED-ADDRESS is present in Allocate responses. It The XOR-RELAYED-ADDRESS is present in Allocate responses. It
specifies the address and port that the server allocated to the specifies the address and port that the server allocated to the
client. It is encoded in the same way as XOR-MAPPED-ADDRESS client. It is encoded in the same way as XOR-MAPPED-ADDRESS
[I-D.ietf-tram-stunbis]. [I-D.ietf-tram-stunbis].
17.6. REQUESTED-ADDRESS-FAMILY 18.6. REQUESTED-ADDRESS-FAMILY
This attribute is used in Allocate and Refresh requests to specify This attribute is used in Allocate and Refresh requests to specify
the address type requested by the client. The value of this the address type requested by the client. The value of this
attribute is 4 bytes with the following format: attribute is 4 bytes with the following format:
0 1 2 3 0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Family | Reserved | | Family | Reserved |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Family: there are two values defined for this field and specified in Family: there are two values defined for this field and specified in
[I-D.ietf-tram-stunbis], Section 14.1: 0x01 for IPv4 addresses and [I-D.ietf-tram-stunbis], Section 14.1: 0x01 for IPv4 addresses and
0x02 for IPv6 addresses. 0x02 for IPv6 addresses.
Reserved: at this point, the 24 bits in the Reserved field MUST be Reserved: at this point, the 24 bits in the Reserved field MUST be
set to zero by the client and MUST be ignored by the server. set to zero by the client and MUST be ignored by the server.
17.7. EVEN-PORT 18.7. EVEN-PORT
This attribute allows the client to request that the port in the This attribute allows the client to request that the port in the
relayed transport address be even, and (optionally) that the server relayed transport address be even, and (optionally) that the server
reserve the next-higher port number. The value portion of this reserve the next-higher port number. The value portion of this
attribute is 1 byte long. Its format is: attribute is 1 byte long. Its format is:
0 0
0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7
+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+
|R| RFFU | |R| RFFU |
skipping to change at page 62, line 5 skipping to change at page 62, line 11
0, no such reservation is requested. 0, no such reservation is requested.
RFFU: Reserved For Future Use. RFFU: Reserved For Future Use.
The other 7 bits of the attribute's value must be set to zero on The other 7 bits of the attribute's value must be set to zero on
transmission and ignored on reception. transmission and ignored on reception.
Since the length of this attribute is not a multiple of 4, padding Since the length of this attribute is not a multiple of 4, padding
must immediately follow this attribute. must immediately follow this attribute.
17.8. REQUESTED-TRANSPORT 18.8. REQUESTED-TRANSPORT
This attribute is used by the client to request a specific transport This attribute is used by the client to request a specific transport
protocol for the allocated transport address. The value of this protocol for the allocated transport address. The value of this
attribute is 4 bytes with the following format: attribute is 4 bytes with the following format:
0 1 2 3 0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Protocol | RFFU | | Protocol | RFFU |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
The Protocol field specifies the desired protocol. The codepoints The Protocol field specifies the desired protocol. The codepoints
used in this field are taken from those allowed in the Protocol field used in this field are taken from those allowed in the Protocol field
in the IPv4 header and the NextHeader field in the IPv6 header in the IPv4 header and the NextHeader field in the IPv6 header
[Protocol-Numbers]. This specification only allows the use of [Protocol-Numbers]. This specification only allows the use of
codepoint 17 (User Datagram Protocol). codepoint 17 (User Datagram Protocol).
The RFFU field MUST be set to zero on transmission and MUST be The RFFU field MUST be set to zero on transmission and MUST be
ignored on reception. It is reserved for future uses. ignored on reception. It is reserved for future uses.
17.9. DONT-FRAGMENT 18.9. DONT-FRAGMENT
This attribute is used by the client to request that the server set This attribute is used by the client to request that the server set
the DF (Don't Fragment) bit in the IP header when relaying the the DF (Don't Fragment) bit in the IP header when relaying the
application data onward to the peer, and for determining the server application data onward to the peer, and for determining the server
capability in Allocate requests. This attribute has no value part capability in Allocate requests. This attribute has no value part
and thus the attribute length field is 0. and thus the attribute length field is 0.
17.10. RESERVATION-TOKEN 18.10. RESERVATION-TOKEN
The RESERVATION-TOKEN attribute contains a token that uniquely The RESERVATION-TOKEN attribute contains a token that uniquely
identifies a relayed transport address being held in reserve by the identifies a relayed transport address being held in reserve by the
server. The server includes this attribute in a success response to server. The server includes this attribute in a success response to
tell the client about the token, and the client includes this tell the client about the token, and the client includes this
attribute in a subsequent Allocate request to request the server use attribute in a subsequent Allocate request to request the server use
that relayed transport address for the allocation. that relayed transport address for the allocation.
The attribute value is 8 bytes and contains the token value. The attribute value is 8 bytes and contains the token value.
17.11. ADDITIONAL-ADDRESS-FAMILY 18.11. ADDITIONAL-ADDRESS-FAMILY
This attribute is used by clients to request the allocation of a IPv4 This attribute is used by clients to request the allocation of a IPv4
and IPv6 address type from a server. It is encoded in the same way and IPv6 address type from a server. It is encoded in the same way
as REQUESTED-ADDRESS-FAMILY Section 17.6. The ADDITIONAL-ADDRESS- as REQUESTED-ADDRESS-FAMILY Section 18.6. The ADDITIONAL-ADDRESS-
FAMILY attribute MAY be present in Allocate request. The attribute FAMILY attribute MAY be present in Allocate request. The attribute
value of 0x02 (IPv6 address) is the only valid value in Allocate value of 0x02 (IPv6 address) is the only valid value in Allocate
request. request.
17.12. ADDRESS-ERROR-CODE Attribute 18.12. ADDRESS-ERROR-CODE Attribute
This attribute is used by servers to signal the reason for not This attribute is used by servers to signal the reason for not
allocating the requested address family. The value portion of this allocating the requested address family. The value portion of this
attribute is variable length with the following format: attribute is variable length with the following format:
0 1 2 3 0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Family | Reserved |Class| Number | | Family | Reserved |Class| Number |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
skipping to change at page 63, line 36 skipping to change at page 63, line 45
Class: The Class represents the hundreds digit of the error code and Class: The Class represents the hundreds digit of the error code and
is defined in section 14.8 of [I-D.ietf-tram-stunbis]. is defined in section 14.8 of [I-D.ietf-tram-stunbis].
Number: this 8-bit field contains the reason server cannot allocate Number: this 8-bit field contains the reason server cannot allocate
one of the requested address types. The error code values could one of the requested address types. The error code values could
be either 440 (unsupported address family) or 508 (insufficient be either 440 (unsupported address family) or 508 (insufficient
capacity). The number representation is defined in section 14.8 capacity). The number representation is defined in section 14.8
of [I-D.ietf-tram-stunbis]. of [I-D.ietf-tram-stunbis].
Reason Phrase: The recommended reason phrases for error codes 440 Reason Phrase: The recommended reason phrases for error codes 440
and 508 are explained in Section 18. The reason phrase MUST be a and 508 are explained in Section 19. The reason phrase MUST be a
UTF-8 [RFC3629] encoded sequence of less than 128 characters UTF-8 [RFC3629] encoded sequence of less than 128 characters
(which can be as long as 509 bytes when encoding them or 763 bytes (which can be as long as 509 bytes when encoding them or 763 bytes
when decoding them). when decoding them).
17.13. ICMP Attribute 18.13. ICMP Attribute
This attribute is used by servers to signal the reason an UDP packet This attribute is used by servers to signal the reason an UDP packet
was dropped. The following is the format of the ICMP attribute. was dropped. The following is the format of the ICMP attribute.
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Reserved | ICMP Type | ICMP Code | | Reserved | ICMP Type | ICMP Code |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Error Data | | Error Data |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
skipping to change at page 64, line 31 skipping to change at page 64, line 36
IPv6. IPv6.
Error Data: This field size is 4 bytes long. If the ICMPv6 type is Error Data: This field size is 4 bytes long. If the ICMPv6 type is
2 (Packet Too Big Message) or ICMPv4 type is 3 ( Destination 2 (Packet Too Big Message) or ICMPv4 type is 3 ( Destination
Unreachable) and Code is 4 (fragmentation needed and DF set), the Unreachable) and Code is 4 (fragmentation needed and DF set), the
Error Data field will be set to the Maximum Transmission Unit of Error Data field will be set to the Maximum Transmission Unit of
the next-hop link (Section 3.2 of [RFC4443]) and Section 4 of the next-hop link (Section 3.2 of [RFC4443]) and Section 4 of
[RFC1191]). For other ICMPv6 types and ICMPv4 types and codes, [RFC1191]). For other ICMPv6 types and ICMPv4 types and codes,
Error Data field MUST be set to zero. Error Data field MUST be set to zero.
18. STUN Error Response Codes 19. STUN Error Response Codes
This document defines the following error response codes: This document defines the following error response codes:
403 (Forbidden): The request was valid but cannot be performed due 403 (Forbidden): The request was valid but cannot be performed due
to administrative or similar restrictions. to administrative or similar restrictions.
437 (Allocation Mismatch): A request was received by the server that 437 (Allocation Mismatch): A request was received by the server that
requires an allocation to be in place, but no allocation exists, requires an allocation to be in place, but no allocation exists,
or a request was received that requires no allocation, but an or a request was received that requires no allocation, but an
allocation exists. allocation exists.
skipping to change at page 65, line 21 skipping to change at page 65, line 27
486 (Allocation Quota Reached): No more allocations using this 486 (Allocation Quota Reached): No more allocations using this
username can be created at the present time. username can be created at the present time.
508 (Insufficient Capacity): The server is unable to carry out the 508 (Insufficient Capacity): The server is unable to carry out the
request due to some capacity limit being reached. In an Allocate request due to some capacity limit being reached. In an Allocate
response, this could be due to the server having no more relayed response, this could be due to the server having no more relayed
transport addresses available at that time, having none with the transport addresses available at that time, having none with the
requested properties, or the one that corresponds to the specified requested properties, or the one that corresponds to the specified
reservation token is not available. reservation token is not available.
19. Detailed Example 20. Detailed Example
This section gives an example of the use of TURN, showing in detail This section gives an example of the use of TURN, showing in detail
the contents of the messages exchanged. The example uses the network the contents of the messages exchanged. The example uses the network
diagram shown in the Overview (Figure 1). diagram shown in the Overview (Figure 1).
For each message, the attributes included in the message and their For each message, the attributes included in the message and their
values are shown. For convenience, values are shown in a human- values are shown. For convenience, values are shown in a human-
readable format rather than showing the actual octets; for example, readable format rather than showing the actual octets; for example,
"XOR-RELAYED-ADDRESS=192.0.2.15:9000" shows that the XOR-RELAYED- "XOR-RELAYED-ADDRESS=192.0.2.15:9000" shows that the XOR-RELAYED-
ADDRESS attribute is included with an address of 192.0.2.15 and a ADDRESS attribute is included with an address of 192.0.2.15 and a
skipping to change at page 73, line 5 skipping to change at page 73, line 5
in Allocate and Refresh messages. When the server receives the in Allocate and Refresh messages. When the server receives the
Refresh request, it notices that the nonce value has expired, and so Refresh request, it notices that the nonce value has expired, and so
replies with 438 (Stale Nonce) error given a new nonce value. The replies with 438 (Stale Nonce) error given a new nonce value. The
client then reattempts the request, this time with the new nonce client then reattempts the request, this time with the new nonce
value. This second attempt is accepted, and the server replies with value. This second attempt is accepted, and the server replies with
a success response. Note that the client did not include a LIFETIME a success response. Note that the client did not include a LIFETIME
attribute in the request, so the server refreshes the allocation for attribute in the request, so the server refreshes the allocation for
the default lifetime of 10 minutes (as can be seen by the LIFETIME the default lifetime of 10 minutes (as can be seen by the LIFETIME
attribute in the success response). attribute in the success response).
20. Security Considerations 21. Security Considerations
This section considers attacks that are possible in a TURN This section considers attacks that are possible in a TURN
deployment, and discusses how they are mitigated by mechanisms in the deployment, and discusses how they are mitigated by mechanisms in the
protocol or recommended practices in the implementation. protocol or recommended practices in the implementation.
Most of the attacks on TURN are mitigated by the server requiring Most of the attacks on TURN are mitigated by the server requiring
requests be authenticated. Thus, this specification requires the use requests be authenticated. Thus, this specification requires the use
of authentication. The mandatory-to-implement mechanism is the long- of authentication. The mandatory-to-implement mechanism is the long-
term credential mechanism of STUN. Other authentication mechanisms term credential mechanism of STUN. Other authentication mechanisms
of equal or stronger security properties may be used. However, it is of equal or stronger security properties may be used. However, it is
important to ensure that they can be invoked in an inter-operable important to ensure that they can be invoked in an inter-operable
way. way.
20.1. Outsider Attacks 21.1. Outsider Attacks
Outsider attacks are ones where the attacker has no credentials in Outsider attacks are ones where the attacker has no credentials in
the system, and is attempting to disrupt the service seen by the the system, and is attempting to disrupt the service seen by the
client or the server. client or the server.
20.1.1. Obtaining Unauthorized Allocations 21.1.1. Obtaining Unauthorized Allocations
An attacker might wish to obtain allocations on a TURN server for any An attacker might wish to obtain allocations on a TURN server for any
number of nefarious purposes. A TURN server provides a mechanism for number of nefarious purposes. A TURN server provides a mechanism for
sending and receiving packets while cloaking the actual IP address of sending and receiving packets while cloaking the actual IP address of
the client. This makes TURN servers an attractive target for the client. This makes TURN servers an attractive target for
attackers who wish to use it to mask their true identity. attackers who wish to use it to mask their true identity.
An attacker might also wish to simply utilize the services of a TURN An attacker might also wish to simply utilize the services of a TURN
server without paying for them. Since TURN services require server without paying for them. Since TURN services require
resources from the provider, it is anticipated that their usage will resources from the provider, it is anticipated that their usage will
come with a cost. come with a cost.
These attacks are prevented using the long-term credential mechanism, These attacks are prevented using the long-term credential mechanism,
which allows the TURN server to determine the identity of the which allows the TURN server to determine the identity of the
requestor and whether the requestor is allowed to obtain the requestor and whether the requestor is allowed to obtain the
allocation. allocation.
20.1.2. Offline Dictionary Attacks 21.1.2. Offline Dictionary Attacks
The long-term credential mechanism used by TURN is subject to offline The long-term credential mechanism used by TURN is subject to offline
dictionary attacks. An attacker that is capable of eavesdropping on dictionary attacks. An attacker that is capable of eavesdropping on
a message exchange between a client and server can determine the a message exchange between a client and server can determine the
password by trying a number of candidate passwords and seeing if one password by trying a number of candidate passwords and seeing if one
of them is correct. This attack works when the passwords are low of them is correct. This attack works when the passwords are low
entropy, such as a word from the dictionary. This attack can be entropy, such as a word from the dictionary. This attack can be
mitigated by using strong passwords with large entropy. In mitigated by using strong passwords with large entropy. In
situations where even stronger mitigation is required, (D)TLS situations where even stronger mitigation is required, (D)TLS
transport between the client and the server can be used. transport between the client and the server can be used.
20.1.3. Faked Refreshes and Permissions 21.1.3. Faked Refreshes and Permissions
An attacker might wish to attack an active allocation by sending it a An attacker might wish to attack an active allocation by sending it a
Refresh request with an immediate expiration, in order to delete it Refresh request with an immediate expiration, in order to delete it
and disrupt service to the client. This is prevented by and disrupt service to the client. This is prevented by
authentication of refreshes. Similarly, an attacker wishing to send authentication of refreshes. Similarly, an attacker wishing to send
CreatePermission requests to create permissions to undesirable CreatePermission requests to create permissions to undesirable
destinations is prevented from doing so through authentication. The destinations is prevented from doing so through authentication. The
motivations for such an attack are described in Section 20.2. motivations for such an attack are described in Section 21.2.
20.1.4. Fake Data 21.1.4. Fake Data
An attacker might wish to send data to the client or the peer, as if An attacker might wish to send data to the client or the peer, as if
they came from the peer or client, respectively. To do that, the they came from the peer or client, respectively. To do that, the
attacker can send the client a faked Data Indication or ChannelData attacker can send the client a faked Data Indication or ChannelData
message, or send the TURN server a faked Send Indication or message, or send the TURN server a faked Send Indication or
ChannelData message. ChannelData message.
Since indications and ChannelData messages are not authenticated, Since indications and ChannelData messages are not authenticated,
this attack is not prevented by TURN. However, this attack is this attack is not prevented by TURN. However, this attack is
generally present in IP-based communications and is not substantially generally present in IP-based communications and is not substantially
skipping to change at page 75, line 19 skipping to change at page 75, line 19
To mitigate this attack, TURN requires that the client establish a To mitigate this attack, TURN requires that the client establish a
permission to a host before sending it data. Thus, an attacker can permission to a host before sending it data. Thus, an attacker can
only attack hosts with which the client is already communicating, only attack hosts with which the client is already communicating,
unless the attacker is able to create authenticated requests. unless the attacker is able to create authenticated requests.
Furthermore, the server administrator may configure the server to Furthermore, the server administrator may configure the server to
restrict the range of IP addresses and ports to which it will relay restrict the range of IP addresses and ports to which it will relay
data. To provide even greater security, the server administrator can data. To provide even greater security, the server administrator can
require that the client use (D)TLS for all communication between the require that the client use (D)TLS for all communication between the
client and the server. client and the server.
20.1.5. Impersonating a Server 21.1.5. Impersonating a Server
When a client learns a relayed address from a TURN server, it uses When a client learns a relayed address from a TURN server, it uses
that relayed address in application protocols to receive traffic. that relayed address in application protocols to receive traffic.
Therefore, an attacker wishing to intercept or redirect that traffic Therefore, an attacker wishing to intercept or redirect that traffic
might try to impersonate a TURN server and provide the client with a might try to impersonate a TURN server and provide the client with a
faked relayed address. faked relayed address.
This attack is prevented through the long-term credential mechanism, This attack is prevented through the long-term credential mechanism,
which provides message integrity for responses in addition to which provides message integrity for responses in addition to
verifying that they came from the server. Furthermore, an attacker verifying that they came from the server. Furthermore, an attacker
cannot replay old server responses as the transaction id in the STUN cannot replay old server responses as the transaction id in the STUN
header prevents this. Replay attacks are further thwarted through header prevents this. Replay attacks are further thwarted through
frequent changes to the nonce value. frequent changes to the nonce value.
20.1.6. Eavesdropping Traffic 21.1.6. Eavesdropping Traffic
TURN concerns itself primarily with authentication and message TURN concerns itself primarily with authentication and message
integrity. Confidentiality is only a secondary concern, as TURN integrity. Confidentiality is only a secondary concern, as TURN
control messages do not include information that is particularly control messages do not include information that is particularly
sensitive. The primary protocol content of the messages is the IP sensitive. The primary protocol content of the messages is the IP
address of the peer. If it is important to prevent an eavesdropper address of the peer. If it is important to prevent an eavesdropper
on a TURN connection from learning this, TURN can be run over (D)TLS. on a TURN connection from learning this, TURN can be run over (D)TLS.
Confidentiality for the application data relayed by TURN is best Confidentiality for the application data relayed by TURN is best
provided by the application protocol itself, since running TURN over provided by the application protocol itself, since running TURN over
(D)TLS does not protect application data between the server and the (D)TLS does not protect application data between the server and the
peer. If confidentiality of application data is important, then the peer. If confidentiality of application data is important, then the
application should encrypt or otherwise protect its data. For application should encrypt or otherwise protect its data. For
example, for real-time media, confidentiality can be provided by example, for real-time media, confidentiality can be provided by
using SRTP. using SRTP.
20.1.7. TURN Loop Attack 21.1.7. TURN Loop Attack
An attacker might attempt to cause data packets to loop indefinitely An attacker might attempt to cause data packets to loop indefinitely
between two TURN servers. The attack goes as follows. First, the between two TURN servers. The attack goes as follows. First, the
attacker sends an Allocate request to server A, using the source attacker sends an Allocate request to server A, using the source
address of server B. Server A will send its response to server B, address of server B. Server A will send its response to server B,
and for the attack to succeed, the attacker must have the ability to and for the attack to succeed, the attacker must have the ability to
either view or guess the contents of this response, so that the either view or guess the contents of this response, so that the
attacker can learn the allocated relayed transport address. The attacker can learn the allocated relayed transport address. The
attacker then sends an Allocate request to server B, using the source attacker then sends an Allocate request to server B, using the source
address of server A. Again, the attacker must be able to view or address of server A. Again, the attacker must be able to view or
skipping to change at page 76, line 48 skipping to change at page 76, line 48
the attacker to have credentials acceptable to the server, which the attacker to have credentials acceptable to the server, which
turns this from an outsider attack into an insider attack and allows turns this from an outsider attack into an insider attack and allows
the attack to be traced back to the client initiating it. the attack to be traced back to the client initiating it.
The attack can be further mitigated by imposing a per-username limit The attack can be further mitigated by imposing a per-username limit
on the bandwidth used to relay data by allocations owned by that on the bandwidth used to relay data by allocations owned by that
username, to limit the impact of this attack on other allocations. username, to limit the impact of this attack on other allocations.
More mitigation can be achieved by decrementing the TTL when relaying More mitigation can be achieved by decrementing the TTL when relaying
data packets (if the underlying OS allows this). data packets (if the underlying OS allows this).
20.2. Firewall Considerations 21.2. Firewall Considerations
A key security consideration of TURN is that TURN should not weaken A key security consideration of TURN is that TURN should not weaken
the protections afforded by firewalls deployed between a client and a the protections afforded by firewalls deployed between a client and a
TURN server. It is anticipated that TURN servers will often be TURN server. It is anticipated that TURN servers will often be
present on the public Internet, and clients may often be inside present on the public Internet, and clients may often be inside
enterprise networks with corporate firewalls. If TURN servers enterprise networks with corporate firewalls. If TURN servers
provide a 'backdoor' for reaching into the enterprise, TURN will be provide a 'backdoor' for reaching into the enterprise, TURN will be
blocked by these firewalls. blocked by these firewalls.
TURN servers therefore emulate the behavior of NAT devices that TURN servers therefore emulate the behavior of NAT devices that
skipping to change at page 77, line 28 skipping to change at page 77, line 28
client, unless the client has tried to contact the attacker first. client, unless the client has tried to contact the attacker first.
It is important to note that some firewalls have policies that are It is important to note that some firewalls have policies that are
even more restrictive than address-dependent filtering. Firewalls even more restrictive than address-dependent filtering. Firewalls
can also be configured with address- and port-dependent filtering, or can also be configured with address- and port-dependent filtering, or
can be configured to disallow inbound traffic entirely. In these can be configured to disallow inbound traffic entirely. In these
cases, if a client is allowed to connect the TURN server, cases, if a client is allowed to connect the TURN server,
communications to the client will be less restrictive than what the communications to the client will be less restrictive than what the
firewall would normally allow. firewall would normally allow.
20.2.1. Faked Permissions 21.2.1. Faked Permissions
In firewalls and NAT devices, permissions are granted implicitly In firewalls and NAT devices, permissions are granted implicitly
through the traversal of a packet from the inside of the network through the traversal of a packet from the inside of the network
towards the outside peer. Thus, a permission cannot, by definition, towards the outside peer. Thus, a permission cannot, by definition,
be created by any entity except one inside the firewall or NAT. With be created by any entity except one inside the firewall or NAT. With
TURN, this restriction no longer holds. Since the TURN server sits TURN, this restriction no longer holds. Since the TURN server sits
outside the firewall, at attacker outside the firewall can now send a outside the firewall, at attacker outside the firewall can now send a
message to the TURN server and try to create a permission for itself. message to the TURN server and try to create a permission for itself.
This attack is prevented because all messages that create permissions This attack is prevented because all messages that create permissions
(i.e., ChannelBind and CreatePermission) are authenticated. (i.e., ChannelBind and CreatePermission) are authenticated.
20.2.2. Blacklisted IP Addresses 21.2.2. Blacklisted IP Addresses
Many firewalls can be configured with blacklists that prevent a Many firewalls can be configured with blacklists that prevent a
client behind the firewall from sending packets to, or receiving client behind the firewall from sending packets to, or receiving
packets from, ranges of blacklisted IP addresses. This is packets from, ranges of blacklisted IP addresses. This is
accomplished by inspecting the source and destination addresses of accomplished by inspecting the source and destination addresses of
packets entering and exiting the firewall, respectively. packets entering and exiting the firewall, respectively.
This feature is also present in TURN, since TURN servers are allowed This feature is also present in TURN, since TURN servers are allowed
to arbitrarily restrict the range of addresses of peers that they to arbitrarily restrict the range of addresses of peers that they
will relay to. will relay to.
20.2.3. Running Servers on Well-Known Ports 21.2.3. Running Servers on Well-Known Ports
A malicious client behind a firewall might try to connect to a TURN A malicious client behind a firewall might try to connect to a TURN
server and obtain an allocation which it then uses to run a server. server and obtain an allocation which it then uses to run a server.
For example, a client might try to run a DNS server or FTP server. For example, a client might try to run a DNS server or FTP server.
This is not possible in TURN. A TURN server will never accept This is not possible in TURN. A TURN server will never accept
traffic from a peer for which the client has not installed a traffic from a peer for which the client has not installed a
permission. Thus, peers cannot just connect to the allocated port in permission. Thus, peers cannot just connect to the allocated port in
order to obtain the service. order to obtain the service.
20.3. Insider Attacks 21.3. Insider Attacks
In insider attacks, a client has legitimate credentials but defies In insider attacks, a client has legitimate credentials but defies
the trust relationship that goes with those credentials. These the trust relationship that goes with those credentials. These
attacks cannot be prevented by cryptographic means but need to be attacks cannot be prevented by cryptographic means but need to be
considered in the design of the protocol. considered in the design of the protocol.
20.3.1. DoS against TURN Server 21.3.1. DoS against TURN Server
A client wishing to disrupt service to other clients might obtain an A client wishing to disrupt service to other clients might obtain an
allocation and then flood it with traffic, in an attempt to swamp the allocation and then flood it with traffic, in an attempt to swamp the
server and prevent it from servicing other legitimate clients. This server and prevent it from servicing other legitimate clients. This
is mitigated by the recommendation that the server limit the amount is mitigated by the recommendation that the server limit the amount
of bandwidth it will relay for a given username. This won't prevent of bandwidth it will relay for a given username. This won't prevent
a client from sending a large amount of traffic, but it allows the a client from sending a large amount of traffic, but it allows the
server to immediately discard traffic in excess. server to immediately discard traffic in excess.
Since each allocation uses a port number on the IP address of the Since each allocation uses a port number on the IP address of the
TURN server, the number of allocations on a server is finite. An TURN server, the number of allocations on a server is finite. An
attacker might attempt to consume all of them by requesting a large attacker might attempt to consume all of them by requesting a large
number of allocations. This is prevented by the recommendation that number of allocations. This is prevented by the recommendation that
the server impose a limit of the number of allocations active at a the server impose a limit of the number of allocations active at a
time for a given username. time for a given username.
20.3.2. Anonymous Relaying of Malicious Traffic 21.3.2. Anonymous Relaying of Malicious Traffic
TURN servers provide a degree of anonymization. A client can send TURN servers provide a degree of anonymization. A client can send
data to peers without revealing its own IP address. TURN servers may data to peers without revealing its own IP address. TURN servers may
therefore become attractive vehicles for attackers to launch attacks therefore become attractive vehicles for attackers to launch attacks
against targets without fear of detection. Indeed, it is possible against targets without fear of detection. Indeed, it is possible
for a client to chain together multiple TURN servers, such that any for a client to chain together multiple TURN servers, such that any
number of relays can be used before a target receives a packet. number of relays can be used before a target receives a packet.
Administrators who are worried about this attack can maintain logs Administrators who are worried about this attack can maintain logs
that capture the actual source IP and port of the client, and perhaps that capture the actual source IP and port of the client, and perhaps
even every permission that client installs. This will allow for even every permission that client installs. This will allow for
forensic tracing to determine the original source, should it be forensic tracing to determine the original source, should it be
discovered that an attack is being relayed through a TURN server. discovered that an attack is being relayed through a TURN server.
20.3.3. Manipulating Other Allocations 21.3.3. Manipulating Other Allocations
An attacker might attempt to disrupt service to other users of the An attacker might attempt to disrupt service to other users of the
TURN server by sending Refresh requests or CreatePermission requests TURN server by sending Refresh requests or CreatePermission requests
that (through source address spoofing) appear to be coming from that (through source address spoofing) appear to be coming from
another user of the TURN server. TURN prevents this by requiring another user of the TURN server. TURN prevents this by requiring
that the credentials used in CreatePermission, Refresh, and that the credentials used in CreatePermission, Refresh, and
ChannelBind messages match those used to create the initial ChannelBind messages match those used to create the initial
allocation. Thus, the fake requests from the attacker will be allocation. Thus, the fake requests from the attacker will be
rejected. rejected.
20.4. Tunnel Amplification Attack 21.4. Tunnel Amplification Attack
An attacker might attempt to cause data packets to loop numerous An attacker might attempt to cause data packets to loop numerous
times between a TURN server and a tunnel between IPv4 and IPv6. The times between a TURN server and a tunnel between IPv4 and IPv6. The
attack goes as follows. attack goes as follows.
Suppose an attacker knows that a tunnel endpoint will forward Suppose an attacker knows that a tunnel endpoint will forward
encapsulated packets from a given IPv6 address (this doesn't encapsulated packets from a given IPv6 address (this doesn't
necessarily need to be the tunnel endpoint's address). Suppose he necessarily need to be the tunnel endpoint's address). Suppose he
then spoofs two packets from this address: then spoofs two packets from this address:
skipping to change at page 80, line 34 skipping to change at page 80, line 34
increase traffic volume by sending multiple packets or by increase traffic volume by sending multiple packets or by
establishing multiple channels spoofed from different addresses establishing multiple channels spoofed from different addresses
behind the same tunnel endpoint. behind the same tunnel endpoint.
The attack is mitigated as follows. It is RECOMMENDED that TURN The attack is mitigated as follows. It is RECOMMENDED that TURN
servers not accept allocation or channel binding requests from servers not accept allocation or channel binding requests from
addresses known to be tunneled, and that they not forward data to addresses known to be tunneled, and that they not forward data to
such addresses. In particular, a TURN server MUST NOT accept Teredo such addresses. In particular, a TURN server MUST NOT accept Teredo
or 6to4 addresses in these requests. or 6to4 addresses in these requests.
20.5. Other Considerations 21.5. Other Considerations
Any relay addresses learned through an Allocate request will not Any relay addresses learned through an Allocate request will not
operate properly with IPsec Authentication Header (AH) [RFC4302] in operate properly with IPsec Authentication Header (AH) [RFC4302] in
transport or tunnel mode. However, tunnel-mode IPsec Encapsulating transport or tunnel mode. However, tunnel-mode IPsec Encapsulating
Security Payload (ESP) [RFC4303] should still operate. Security Payload (ESP) [RFC4303] should still operate.
21. IANA Considerations 22. IANA Considerations
[Paragraphs in braces should be removed by the RFC Editor upon [Paragraphs in braces should be removed by the RFC Editor upon
publication] publication]
The codepoints for the STUN methods defined in this specification are The codepoints for the STUN methods defined in this specification are
listed in Section 16. [IANA is requested to update the reference listed in Section 17. [IANA is requested to update the reference
from [RFC5766] to RFC-to-be for the STUN methods listed in from [RFC5766] to RFC-to-be for the STUN methods listed in
Section 16.] Section 17.]
The codepoints for the STUN attributes defined in this specification The codepoints for the STUN attributes defined in this specification
are listed in Section 17. [IANA is requested to update the reference are listed in Section 18. [IANA is requested to update the reference
from [RFC5766] to RFC-to-be for the STUN attributes CHANNEL-NUMBER, from [RFC5766] to RFC-to-be for the STUN attributes CHANNEL-NUMBER,
LIFETIME, Reserved (was BANDWIDTH), XOR-PEER-ADDRESS, DATA, XOR- LIFETIME, Reserved (was BANDWIDTH), XOR-PEER-ADDRESS, DATA, XOR-
RELAYED-ADDRESS, REQUESTED-ADDRESS-FAMILY, EVEN-PORT, REQUESTED- RELAYED-ADDRESS, REQUESTED-ADDRESS-FAMILY, EVEN-PORT, REQUESTED-
TRANSPORT, DONT-FRAGMENT, Reserved (was TIMER-VAL) and RESERVATION- TRANSPORT, DONT-FRAGMENT, Reserved (was TIMER-VAL) and RESERVATION-
TOKEN listed in Section 17.] TOKEN listed in Section 18.]
[The ADDITIONAL-ADDRESS-FAMILY, ADDRESS-ERROR-CODE and ICMP [The ADDITIONAL-ADDRESS-FAMILY, ADDRESS-ERROR-CODE and ICMP
attributes requires that IANA allocate a value in the "STUN attributes requires that IANA allocate a value in the "STUN
attributes Registry" from the comprehension-optional range attributes Registry" from the comprehension-optional range
(0x8000-0xFFFF), to be replaced for TBD-CA throughout this document] (0x8000-0xFFFF), to be replaced for TBD-CA throughout this document]
The codepoints for the STUN error codes defined in this specification The codepoints for the STUN error codes defined in this specification
are listed in Section 18. [IANA is requested to update the reference are listed in Section 19. [IANA is requested to update the reference
from [RFC5766] to RFC-to-be for the STUN error codes listed in from [RFC5766] to RFC-to-be for the STUN error codes listed in
Section 18.] Section 19.]
IANA has allocated the SRV service name of "turn" for TURN over UDP IANA has allocated the SRV service name of "turn" for TURN over UDP
or TCP, and the service name of "turns" for TURN over (D)TLS. or TCP, and the service name of "turns" for TURN over (D)TLS.
IANA has created a registry for TURN channel numbers, initially IANA has created a registry for TURN channel numbers, initially
populated as follows: populated as follows:
o 0x0000 through 0x3FFF: Reserved and not available for use, since o 0x0000 through 0x3FFF: Reserved and not available for use, since
they conflict with the STUN header. they conflict with the STUN header.
o 0x4000 through 0x4FFF: A TURN implementation is free to use o 0x4000 through 0x4FFF: A TURN implementation is free to use
channel numbers in this range. channel numbers in this range.
o 0x5000 through 0xFFFF: Unassigned. o 0x5000 through 0xFFFF: Unassigned.
Any change to this registry must be made through an IETF Standards Any change to this registry must be made through an IETF Standards
Action. Action.
22. IAB Considerations 23. IAB Considerations
The IAB has studied the problem of "Unilateral Self Address Fixing" The IAB has studied the problem of "Unilateral Self Address Fixing"
(UNSAF), which is the general process by which a client attempts to (UNSAF), which is the general process by which a client attempts to
determine its address in another realm on the other side of a NAT determine its address in another realm on the other side of a NAT
through a collaborative protocol-reflection mechanism [RFC3424]. The through a collaborative protocol-reflection mechanism [RFC3424]. The
TURN extension is an example of a protocol that performs this type of TURN extension is an example of a protocol that performs this type of
function. The IAB has mandated that any protocols developed for this function. The IAB has mandated that any protocols developed for this
purpose document a specific set of considerations. These purpose document a specific set of considerations. These
considerations and the responses for TURN are documented in this considerations and the responses for TURN are documented in this
section. section.
skipping to change at page 83, line 8 skipping to change at page 83, line 8
Consideration 5: Discussion of the impact of the noted practical Consideration 5: Discussion of the impact of the noted practical
issues with existing deployed NATs and experience reports. issues with existing deployed NATs and experience reports.
Response: Some NATs deployed today exhibit a mapping behavior other Response: Some NATs deployed today exhibit a mapping behavior other
than Endpoint-Independent mapping. These NATs are difficult to work than Endpoint-Independent mapping. These NATs are difficult to work
with, as they make it difficult or impossible for protocols like ICE with, as they make it difficult or impossible for protocols like ICE
to use server-reflexive transport addresses on those NATs. A client to use server-reflexive transport addresses on those NATs. A client
behind such a NAT is often forced to use a relay protocol like TURN behind such a NAT is often forced to use a relay protocol like TURN
because "UDP hole punching" techniques [RFC5128] do not work. because "UDP hole punching" techniques [RFC5128] do not work.
23. Changes since RFC 5766 24. Changes since RFC 5766
This section lists the major changes in the TURN protocol from the This section lists the major changes in the TURN protocol from the
original [RFC5766] specification. original [RFC5766] specification.
o IPv6 support. o IPv6 support.
o REQUESTED-ADDRESS-FAMILY, ADDITIONAL-ADDRESS-FAMILY, AND ADDRESS- o REQUESTED-ADDRESS-FAMILY attribute.
ERR-CODE attributes.
o 440 (Address Family not Supported) and 443 (Peer Address Family
Mismatch) responses.
o Description of the tunnel amplification attack. o Description of the tunnel amplification attack.
o DTLS support. o DTLS support.
o More details on packet translations.
o Add support for receiving ICMP packets. o Add support for receiving ICMP packets.
o Updates PMTUD. o Updates PMTUD.
24. Acknowledgements o Discovery of TURN server.
o TURN URI Scheme Semantics.
o Happy Eyeballs for TURN.
o Align with the changes in STUNbis.
25. Updates to RFC 6156
This section lists the major updates to [RFC6156] in this
specification.
o ADDITIONAL-ADDRESS-FAMILY, AND ADDRESS-ERR-CODE attributes.
o 440 (Address Family not Supported) and 443 (Peer Address Family
Mismatch) responses.
o More details on packet translation.
o TCP-to-UDP and UDP-to-TCP relaying.
26. Acknowledgements
Most of the text in this note comes from the original TURN Most of the text in this note comes from the original TURN
specification, [RFC5766]. The authors would like to thank Rohan Mahy specification, [RFC5766]. The authors would like to thank Rohan Mahy
co-author of original TURN specification and everyone who had co-author of original TURN specification and everyone who had
contributed to that document. The authors would also like to contributed to that document. The authors would also like to
acknowledge that this document inherits material from [RFC6156]. acknowledge that this document inherits material from [RFC6156].
Thanks to Justin Uberti, Pal Martinsen, Oleg Moskalenko, Aijun Wang Thanks to Justin Uberti, Pal Martinsen, Oleg Moskalenko, Aijun Wang
and Simon Perreault for their help on the ADDITIONAL-ADDRESS-FAMILY and Simon Perreault for their help on the ADDITIONAL-ADDRESS-FAMILY
mechanism. Authors would like to thank Gonzalo Salgueiro, Simon mechanism. Authors would like to thank Gonzalo Salgueiro, Simon
Perreault, Jonathan Lennox, Brandon Williams, Karl Stahl, Noriyuki Perreault, Jonathan Lennox, Brandon Williams, Karl Stahl, Noriyuki
Torii, Nils Ohlmeier, Dan Wing, Justin Uberti and Oleg Moskalenko for Torii, Nils Ohlmeier, Dan Wing, Vijay Gurbani, Joseph Touch, Justin
comments and review. The authors would like to thank Marc for his Uberti and Oleg Moskalenko for comments and review. The authors
contributions to the text. would like to thank Marc for his contributions to the text.
Special thanks to Magnus Westerlund for the detailed AD review. Special thanks to Magnus Westerlund for the detailed AD review.
25. References 27. References
25.1. Normative References 27.1. Normative References
[I-D.ietf-tram-stunbis] [I-D.ietf-tram-stunbis]
Petit-Huguenin, M., Salgueiro, G., Rosenberg, J., Wing, Petit-Huguenin, M., Salgueiro, G., Rosenberg, J., Wing,
D., Mahy, R., and P. Matthews, "Session Traversal D., Mahy, R., and P. Matthews, "Session Traversal
Utilities for NAT (STUN)", draft-ietf-tram-stunbis-21 Utilities for NAT (STUN)", draft-ietf-tram-stunbis-21
(work in progress), March 2019. (work in progress), March 2019.
[Protocol-Numbers] [Protocol-Numbers]
"IANA Protocol Numbers Registry", 2005, "IANA Protocol Numbers Registry", 2005,
<http://www.iana.org/assignments/protocol-numbers>. <http://www.iana.org/assignments/protocol-numbers>.
skipping to change at page 86, line 5 skipping to change at page 86, line 24
[RFC8305] Schinazi, D. and T. Pauly, "Happy Eyeballs Version 2: [RFC8305] Schinazi, D. and T. Pauly, "Happy Eyeballs Version 2:
Better Connectivity Using Concurrency", RFC 8305, Better Connectivity Using Concurrency", RFC 8305,
DOI 10.17487/RFC8305, December 2017, DOI 10.17487/RFC8305, December 2017,
<https://www.rfc-editor.org/info/rfc8305>. <https://www.rfc-editor.org/info/rfc8305>.
[RFC8446] Rescorla, E., "The Transport Layer Security (TLS) Protocol [RFC8446] Rescorla, E., "The Transport Layer Security (TLS) Protocol
Version 1.3", RFC 8446, DOI 10.17487/RFC8446, August 2018, Version 1.3", RFC 8446, DOI 10.17487/RFC8446, August 2018,
<https://www.rfc-editor.org/info/rfc8446>. <https://www.rfc-editor.org/info/rfc8446>.
25.2. Informative References 27.2. Informative References
[Frag-Harmful] [Frag-Harmful]
"Fragmentation Considered Harmful", <Proc. SIGCOMM '87, "Fragmentation Considered Harmful", <Proc. SIGCOMM '87,
vol. 17, No. 5, October 1987>. vol. 17, No. 5, October 1987>.
[I-D.ietf-mmusic-ice-sip-sdp]
Petit-Huguenin, M., Nandakumar, S., and A. Keranen,
"Session Description Protocol (SDP) Offer/Answer
procedures for Interactive Connectivity Establishment
(ICE)", draft-ietf-mmusic-ice-sip-sdp-36 (work in
progress), June 2019.
[I-D.ietf-tram-stun-pmtud] [I-D.ietf-tram-stun-pmtud]
Petit-Huguenin, M. and G. Salgueiro, "Path MTU Discovery Petit-Huguenin, M. and G. Salgueiro, "Path MTU Discovery
Using Session Traversal Utilities for NAT (STUN)", draft- Using Session Traversal Utilities for NAT (STUN)", draft-
ietf-tram-stun-pmtud-10 (work in progress), September ietf-tram-stun-pmtud-10 (work in progress), September
2018. 2018.
[I-D.ietf-tsvwg-udp-options] [I-D.ietf-tsvwg-udp-options]
Touch, J., "Transport Options for UDP", draft-ietf-tsvwg- Touch, J., "Transport Options for UDP", draft-ietf-tsvwg-
udp-options-07 (work in progress), March 2019. udp-options-07 (work in progress), March 2019.
[I-D.rosenberg-mmusic-ice-nonsip]
Rosenberg, J., "Guidelines for Usage of Interactive
Connectivity Establishment (ICE) by non Session Initiation
Protocol (SIP) Protocols", draft-rosenberg-mmusic-ice-
nonsip-01 (work in progress), July 2008.
[Port-Numbers] [Port-Numbers]
"IANA Port Numbers Registry", 2005, "IANA Port Numbers Registry", 2005,
<http://www.iana.org/assignments/port-numbers>. <http://www.iana.org/assignments/port-numbers>.
[RFC0791] Postel, J., "Internet Protocol", STD 5, RFC 791, [RFC0791] Postel, J., "Internet Protocol", STD 5, RFC 791,
DOI 10.17487/RFC0791, September 1981, DOI 10.17487/RFC0791, September 1981,
<https://www.rfc-editor.org/info/rfc791>. <https://www.rfc-editor.org/info/rfc791>.
[RFC1191] Mogul, J. and S. Deering, "Path MTU discovery", RFC 1191, [RFC1191] Mogul, J. and S. Deering, "Path MTU discovery", RFC 1191,
DOI 10.17487/RFC1191, November 1990, DOI 10.17487/RFC1191, November 1990,
skipping to change at page 88, line 5 skipping to change at page 88, line 23
[RFC4821] Mathis, M. and J. Heffner, "Packetization Layer Path MTU [RFC4821] Mathis, M. and J. Heffner, "Packetization Layer Path MTU
Discovery", RFC 4821, DOI 10.17487/RFC4821, March 2007, Discovery", RFC 4821, DOI 10.17487/RFC4821, March 2007,
<https://www.rfc-editor.org/info/rfc4821>. <https://www.rfc-editor.org/info/rfc4821>.
[RFC5128] Srisuresh, P., Ford, B., and D. Kegel, "State of Peer-to- [RFC5128] Srisuresh, P., Ford, B., and D. Kegel, "State of Peer-to-
Peer (P2P) Communication across Network Address Peer (P2P) Communication across Network Address
Translators (NATs)", RFC 5128, DOI 10.17487/RFC5128, March Translators (NATs)", RFC 5128, DOI 10.17487/RFC5128, March
2008, <https://www.rfc-editor.org/info/rfc5128>. 2008, <https://www.rfc-editor.org/info/rfc5128>.
[RFC5482] Eggert, L. and F. Gont, "TCP User Timeout Option",
RFC 5482, DOI 10.17487/RFC5482, March 2009,
<https://www.rfc-editor.org/info/rfc5482>.
[RFC5766] Mahy, R., Matthews, P., and J. Rosenberg, "Traversal Using [RFC5766] Mahy, R., Matthews, P., and J. Rosenberg, "Traversal Using
Relays around NAT (TURN): Relay Extensions to Session Relays around NAT (TURN): Relay Extensions to Session
Traversal Utilities for NAT (STUN)", RFC 5766, Traversal Utilities for NAT (STUN)", RFC 5766,
DOI 10.17487/RFC5766, April 2010, DOI 10.17487/RFC5766, April 2010,
<https://www.rfc-editor.org/info/rfc5766>. <https://www.rfc-editor.org/info/rfc5766>.
[RFC5925] Touch, J., Mankin, A., and R. Bonica, "The TCP
Authentication Option", RFC 5925, DOI 10.17487/RFC5925,
June 2010, <https://www.rfc-editor.org/info/rfc5925>.
[RFC5928] Petit-Huguenin, M., "Traversal Using Relays around NAT [RFC5928] Petit-Huguenin, M., "Traversal Using Relays around NAT
(TURN) Resolution Mechanism", RFC 5928, (TURN) Resolution Mechanism", RFC 5928,
DOI 10.17487/RFC5928, August 2010, DOI 10.17487/RFC5928, August 2010,
<https://www.rfc-editor.org/info/rfc5928>. <https://www.rfc-editor.org/info/rfc5928>.
[RFC6056] Larsen, M. and F. Gont, "Recommendations for Transport- [RFC6056] Larsen, M. and F. Gont, "Recommendations for Transport-
Protocol Port Randomization", BCP 156, RFC 6056, Protocol Port Randomization", BCP 156, RFC 6056,
DOI 10.17487/RFC6056, January 2011, DOI 10.17487/RFC6056, January 2011,
<https://www.rfc-editor.org/info/rfc6056>. <https://www.rfc-editor.org/info/rfc6056>.
[RFC6062] Perreault, S., Ed. and J. Rosenberg, "Traversal Using [RFC6062] Perreault, S., Ed. and J. Rosenberg, "Traversal Using
Relays around NAT (TURN) Extensions for TCP Allocations", Relays around NAT (TURN) Extensions for TCP Allocations",
RFC 6062, DOI 10.17487/RFC6062, November 2010, RFC 6062, DOI 10.17487/RFC6062, November 2010,
<https://www.rfc-editor.org/info/rfc6062>. <https://www.rfc-editor.org/info/rfc6062>.
[RFC6156] Camarillo, G., Novo, O., and S. Perreault, Ed., "Traversal [RFC6156] Camarillo, G., Novo, O., and S. Perreault, Ed., "Traversal
Using Relays around NAT (TURN) Extension for IPv6", Using Relays around NAT (TURN) Extension for IPv6",
RFC 6156, DOI 10.17487/RFC6156, April 2011, RFC 6156, DOI 10.17487/RFC6156, April 2011,
<https://www.rfc-editor.org/info/rfc6156>. <https://www.rfc-editor.org/info/rfc6156>.
[RFC6824] Ford, A., Raiciu, C., Handley, M., and O. Bonaventure,
"TCP Extensions for Multipath Operation with Multiple
Addresses", RFC 6824, DOI 10.17487/RFC6824, January 2013,
<https://www.rfc-editor.org/info/rfc6824>.
[RFC7413] Cheng, Y., Chu, J., Radhakrishnan, S., and A. Jain, "TCP
Fast Open", RFC 7413, DOI 10.17487/RFC7413, December 2014,
<https://www.rfc-editor.org/info/rfc7413>.
[RFC7478] Holmberg, C., Hakansson, S., and G. Eriksson, "Web Real-
Time Communication Use Cases and Requirements", RFC 7478,
DOI 10.17487/RFC7478, March 2015,
<https://www.rfc-editor.org/info/rfc7478>.
[RFC7635] Reddy, T., Patil, P., Ravindranath, R., and J. Uberti, [RFC7635] Reddy, T., Patil, P., Ravindranath, R., and J. Uberti,
"Session Traversal Utilities for NAT (STUN) Extension for "Session Traversal Utilities for NAT (STUN) Extension for
Third-Party Authorization", RFC 7635, Third-Party Authorization", RFC 7635,
DOI 10.17487/RFC7635, August 2015, DOI 10.17487/RFC7635, August 2015,
<https://www.rfc-editor.org/info/rfc7635>. <https://www.rfc-editor.org/info/rfc7635>.
[RFC7657] Black, D., Ed. and P. Jones, "Differentiated Services [RFC7657] Black, D., Ed. and P. Jones, "Differentiated Services
(Diffserv) and Real-Time Communication", RFC 7657, (Diffserv) and Real-Time Communication", RFC 7657,
DOI 10.17487/RFC7657, November 2015, DOI 10.17487/RFC7657, November 2015,
<https://www.rfc-editor.org/info/rfc7657>. <https://www.rfc-editor.org/info/rfc7657>.
 End of changes. 120 change blocks. 
340 lines changed or deleted 389 lines changed or added

This html diff was produced by rfcdiff 1.47. The latest version is available from http://tools.ietf.org/tools/rfcdiff/