1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725
|
<pre>Internet Engineering Task Force (IETF) S. Perreault, Ed.
Request for Comments: 6062 Viagenie
Category: Standards Track J. Rosenberg
ISSN: 2070-1721 jdrosen.net
November 2010
Traversal Using Relays around NAT (TURN) Extensions for TCP Allocations
Abstract
This specification defines an extension of Traversal Using Relays
around NAT (TURN), a relay protocol for Network Address Translator
(NAT) traversal. This extension allows a TURN client to request TCP
allocations, and defines new requests and indications for the TURN
server to open and accept TCP connections with the client's peers.
TURN and this extension both purposefully restrict the ways in which
the relayed address can be used. In particular, it prevents users
from running general-purpose servers from ports obtained from the
TURN server.
Status of This Memo
This is an Internet Standards Track document.
This document is a product of the Internet Engineering Task Force
(IETF). It represents the consensus of the IETF community. It has
received public review and has been approved for publication by the
Internet Engineering Steering Group (IESG). Further information on
Internet Standards is available in <a href="./rfc5741#section-2">Section 2 of RFC 5741</a>.
Information about the current status of this document, any errata,
and how to provide feedback on it may be obtained at
<a href="http://www.rfc-editor.org/info/rfc6062">http://www.rfc-editor.org/info/rfc6062</a>.
<span class="grey">Perreault & Rosenberg Standards Track [Page 1]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-2" ></span>
<span class="grey"><a href="./rfc6062">RFC 6062</a> TURN TCP November 2010</span>
Copyright Notice
Copyright (c) 2010 IETF Trust and the persons identified as the
document authors. All rights reserved.
This document is subject to <a href="https://www.rfc-editor.org/bcp/bcp78">BCP 78</a> and the IETF Trust's Legal
Provisions Relating to IETF Documents
(<a href="http://trustee.ietf.org/license-info">http://trustee.ietf.org/license-info</a>) in effect on the date of
publication of this document. Please review these documents
carefully, as they describe your rights and restrictions with respect
to this document. Code Components extracted from this document must
include Simplified BSD License text as described in Section 4.e of
the Trust Legal Provisions and are provided without warranty as
described in the Simplified BSD License.
Table of Contents
<a href="#section-1">1</a>. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . <a href="#page-3">3</a>
<a href="#section-2">2</a>. Conventions . . . . . . . . . . . . . . . . . . . . . . . . . <a href="#page-3">3</a>
<a href="#section-3">3</a>. Overview of Operation . . . . . . . . . . . . . . . . . . . . <a href="#page-4">4</a>
<a href="#section-4">4</a>. Client Processing . . . . . . . . . . . . . . . . . . . . . . <a href="#page-6">6</a>
<a href="#section-4.1">4.1</a>. Creating an Allocation . . . . . . . . . . . . . . . . . . <a href="#page-6">6</a>
<a href="#section-4.2">4.2</a>. Refreshing an Allocation . . . . . . . . . . . . . . . . . <a href="#page-7">7</a>
<a href="#section-4.3">4.3</a>. Initiating a Connection . . . . . . . . . . . . . . . . . <a href="#page-7">7</a>
<a href="#section-4.4">4.4</a>. Receiving a Connection . . . . . . . . . . . . . . . . . . <a href="#page-7">7</a>
<a href="#section-4.5">4.5</a>. Sending and Receiving Data . . . . . . . . . . . . . . . . <a href="#page-8">8</a>
<a href="#section-4.6">4.6</a>. Data Connection Maintenance . . . . . . . . . . . . . . . <a href="#page-8">8</a>
<a href="#section-5">5</a>. TURN Server Behavior . . . . . . . . . . . . . . . . . . . . . <a href="#page-8">8</a>
<a href="#section-5.1">5.1</a>. Receiving a TCP Allocate Request . . . . . . . . . . . . . <a href="#page-8">8</a>
<a href="#section-5.2">5.2</a>. Receiving a Connect Request . . . . . . . . . . . . . . . <a href="#page-9">9</a>
5.3. Receiving a TCP Connection on a Relayed Transport
Address . . . . . . . . . . . . . . . . . . . . . . . . . <a href="#page-10">10</a>
<a href="#section-5.4">5.4</a>. Receiving a ConnectionBind Request . . . . . . . . . . . . <a href="#page-11">11</a>
<a href="#section-5.5">5.5</a>. Data Connection Maintenance . . . . . . . . . . . . . . . <a href="#page-11">11</a>
<a href="#section-6">6</a>. IANA Considerations . . . . . . . . . . . . . . . . . . . . . <a href="#page-11">11</a>
<a href="#section-6.1">6.1</a>. New STUN Methods . . . . . . . . . . . . . . . . . . . . . <a href="#page-11">11</a>
<a href="#section-6.2">6.2</a>. New STUN Attributes . . . . . . . . . . . . . . . . . . . <a href="#page-12">12</a>
<a href="#section-6.2.1">6.2.1</a>. CONNECTION-ID . . . . . . . . . . . . . . . . . . . . <a href="#page-12">12</a>
<a href="#section-6.3">6.3</a>. New STUN Error Codes . . . . . . . . . . . . . . . . . . . <a href="#page-12">12</a>
<a href="#section-7">7</a>. Security Considerations . . . . . . . . . . . . . . . . . . . <a href="#page-12">12</a>
<a href="#section-8">8</a>. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . <a href="#page-12">12</a>
<a href="#section-9">9</a>. References . . . . . . . . . . . . . . . . . . . . . . . . . . <a href="#page-12">12</a>
<a href="#section-9.1">9.1</a>. Normative References . . . . . . . . . . . . . . . . . . . <a href="#page-12">12</a>
<a href="#section-9.2">9.2</a>. Informative References . . . . . . . . . . . . . . . . . . <a href="#page-13">13</a>
<span class="grey">Perreault & Rosenberg Standards Track [Page 2]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-3" ></span>
<span class="grey"><a href="./rfc6062">RFC 6062</a> TURN TCP November 2010</span>
<span class="h2"><a class="selflink" id="section-1" href="#section-1">1</a>. Introduction</span>
Traversal Using Relays around NAT (TURN) [<a href="./rfc5766" title=""Traversal Using Relays around NAT (TURN): Relay Extensions to Session Traversal Utilities for NAT (STUN)"">RFC5766</a>] is an extension to
the Session Traversal Utilities for NAT [<a href="./rfc5389" title=""Session Traversal Utilities for NAT (STUN)"">RFC5389</a>] protocol. TURN
allows for clients to communicate with a TURN server and ask it to
allocate ports on one of its host interfaces, and then relay traffic
between that port and the client itself. TURN, when used in concert
with STUN and Interactive Connectivity Establishment (ICE) [<a href="./rfc5245" title=""Interactive Connectivity Establishment (ICE): A Protocol for Network Address Translator (NAT) Traversal for Offer/Answer Protocols"">RFC5245</a>],
forms a solution for NAT traversal for UDP-based media sessions.
However, TURN itself does not provide a way for a client to allocate
a TCP-based port on a TURN server. Such an allocation is needed for
cases where a TCP-based session is desired with a peer, and NATs
prevent a direct TCP connection. Examples include application
sharing between desktop softphones, or transmission of pictures
during a voice communications session.
This document defines an extension to TURN that allows a client to
obtain a TCP allocation. It also allows the client to initiate
outgoing TCP connections from that allocation to peers and to accept
incoming TCP connection requests from peers made towards that
allocation.
The term "TCP allocation" means a TURN allocation where TCP is used
as the transport protocol instead of UDP. Such an allocation is
uniquely identified by its relayed transport address, which consists
of an IP address and TCP port (defined in [<a href="./rfc5766" title=""Traversal Using Relays around NAT (TURN): Relay Extensions to Session Traversal Utilities for NAT (STUN)"">RFC5766</a>]).
<span class="h2"><a class="selflink" id="section-2" href="#section-2">2</a>. Conventions</span>
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 [<a href="./rfc2119" title=""Key words for use in RFCs to Indicate Requirement Levels"">RFC2119</a>].
<span class="grey">Perreault & Rosenberg Standards Track [Page 3]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-4" ></span>
<span class="grey"><a href="./rfc6062">RFC 6062</a> TURN TCP November 2010</span>
<span class="h2"><a class="selflink" id="section-3" href="#section-3">3</a>. Overview of Operation</span>
+--------+
| |
| Peer1 |
/ | |
/ | |
/ +--------+
/
/
/ Peer Data 1
/
+--------+ Control +--------+ /
| | -------------- | | /
| Client | Client Data 1 | TURN |
| | -------------- | Server | \
| | -------------- | | \
+--------+ Client Data 2 +--------+ \
\
\
\ +--------+
\ | |
Peer Data 2 \ | Peer2 |
\ | |
| |
+--------+
Figure 1: TURN TCP Model
The overall model for TURN-TCP is shown in Figure 1. The client will
have two different types of connections to its TURN server. For each
allocated relayed transport address, it will have a single control
connection. Control connections are used to obtain allocations and
open up new connections. Furthermore, for each connection to a peer,
the client will have a single connection to its TURN server. These
connections are called data connections. Consequently, there is a
data connection from the client to its TURN server (the client data
connection) and one from the TURN server to a peer (the peer data
connection). Actual application data is sent on these connections.
Indeed, after an initial TURN message that binds the client data
connection to a peer data connection, only application data can be
sent -- no TURN messaging. This is in contrast to the control
connection, which only allows TURN messages and not application data.
To obtain a TCP-based allocation, a client first opens a TCP or TLS
connection to its TURN server. The client then sends an Allocate
request over that control connection. That request contains a
REQUESTED-TRANSPORT attribute, which indicates a TCP-based allocation
<span class="grey">Perreault & Rosenberg Standards Track [Page 4]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-5" ></span>
<span class="grey"><a href="./rfc6062">RFC 6062</a> TURN TCP November 2010</span>
is desired. A server that supports this extension will allocate a
TCP relayed transport address and begin listening for connection
requests on it. It then returns the allocated relayed transport
address to the client in the response to the Allocate request. The
connection on which the Allocate request was sent is the control
connection.
If a client wishes to establish a TCP connection to a peer from that
relayed transport address, it issues a Connect request to the TURN
server over the control connection. That request contains an XOR-
PEER-ADDRESS attribute identifying the peer IP address and port
(i.e., its "transport address") to which a connection is to be made.
The TURN server attempts to open the TCP connection, and assuming it
succeeds, then responds to the Connect request with a success
response. The server also creates a connection identifier associated
with this connection and passes that connection identifier back to
the client in the success response. Note that a maximum of one
connection to a given peer transport address can be established per
allocation.
Note: Establishing a relayed connection from the client to a peer
is done in two steps. First, the allocation is created, and
second, the connection is established. Combining the two is not
desirable for NAT traversal. It is expected that, between the
first and second steps, the client will communicate off-band with
the peer (e.g., using ICE [<a href="./rfc5245" title=""Interactive Connectivity Establishment (ICE): A Protocol for Network Address Translator (NAT) Traversal for Offer/Answer Protocols"">RFC5245</a>]) and tell it the relayed
transport address that the TURN server allocated and from which it
is about to initiate a connection. The peer can then "get ready":
open holes in its firewall, try to poke holes in a NAT, attempt a
TCP simultaneous open, etc.
In order to actually send data on the new connection or otherwise
utilize it in any way, the client establishes a new TCP connection to
its TURN server. Once established, it issues a ConnectionBind
request to the server over this new connection. That request echoes
back the connection identifier to the TURN server. The TURN server
uses it to correlate the two connections. As a consequence, the TCP
connection to the peer is associated with a TCP connection to the
client one-to-one. The two connections are now data connections. At
this point, if the server receives data from the peer, it forwards
that data towards the client, without any kind of encapsulation. Any
data received by the TURN server from the client over the client data
connection is forwarded to the peer, again without encapsulation or
framing of any kind. Once a connection has been bound using the
ConnectionBind request, TURN messaging is no longer permitted on the
connection.
<span class="grey">Perreault & Rosenberg Standards Track [Page 5]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-6" ></span>
<span class="grey"><a href="./rfc6062">RFC 6062</a> TURN TCP November 2010</span>
In a similar way, when a peer opens a TCP connection towards the
relayed transport address, the server checks if there is a permission
in place for that peer. If there is none, the connection is closed.
Permissions are created with the CreatePermission request sent over
the control connection, just as for UDP TURN. If there is a
permission in place, the TURN server sends to the client a
ConnectionAttempt Indication over the control connection. That
indication contains a connection identifier. Once again, the client
initiates a separate TCP connection to its TURN server, and over that
connection, issues a ConnectionBind request. Once received, the TURN
server will begin relaying data back and forth. The server closes
the peer data connection if no ConnectionBind request is received
after a timeout.
If the client closes a client data connection, the corresponding peer
data connection is closed. If the peer closes a peer data
connection, the corresponding client data connection is closed. In
this way, the status of the connection is directly known to the
client.
The TURN server will relay the data between the client and peer data
connections. End-to-end flow control is maintained by the relay
process: if the relay process is no longer able to write data to the
destination of the relayed data, the relay process stops reading data
from the source.
<span class="h2"><a class="selflink" id="section-4" href="#section-4">4</a>. Client Processing</span>
<span class="h3"><a class="selflink" id="section-4.1" href="#section-4.1">4.1</a>. Creating an Allocation</span>
To create a TCP allocation, a client MUST initiate a new TCP or TLS
connection to its TURN server, identical to the TCP or TLS procedures
defined in [<a href="./rfc5766" title=""Traversal Using Relays around NAT (TURN): Relay Extensions to Session Traversal Utilities for NAT (STUN)"">RFC5766</a>]. TCP allocations cannot be obtained using a UDP
association between client and server.
Once set up, a client MUST send a TURN Allocate request. That
request MUST contain a REQUESTED-TRANSPORT attribute whose value is
6, corresponding to TCP.
The request MUST NOT include a DONT-FRAGMENT, RESERVATION-TOKEN, or
EVEN-PORT attribute. The corresponding features are specific to UDP-
based capabilities and are not utilized by TURN-TCP. However, a
LIFETIME attribute MAY be included, with semantics identical to the
UDP case.
The procedures for authentication of the Allocate request and
processing of success and failure responses are identical to those
for UDP.
<span class="grey">Perreault & Rosenberg Standards Track [Page 6]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-7" ></span>
<span class="grey"><a href="./rfc6062">RFC 6062</a> TURN TCP November 2010</span>
Once a success response is received, the TCP connection to the TURN
server is called the control connection for that allocation.
<span class="h3"><a class="selflink" id="section-4.2" href="#section-4.2">4.2</a>. Refreshing an Allocation</span>
The procedures for refreshing an allocation are identical to those
for UDP. Note that the Refresh MUST be sent on the control
connection.
<span class="h3"><a class="selflink" id="section-4.3" href="#section-4.3">4.3</a>. Initiating a Connection</span>
To initiate a TCP connection to a peer, a client MUST send a Connect
request over the control connection for the desired allocation. The
Connect request MUST include an XOR-PEER-ADDRESS attribute containing
the transport address of the peer to which a connection is desired.
If the connection is successfully established, the client will
receive a success response. That response will contain a
CONNECTION-ID attribute. The client MUST initiate a new TCP
connection to the server, utilizing the same destination transport
address to which the control connection was established. This
connection MUST be made using a different local transport address.
Authentication of the client by the server MUST use the same method
and credentials as for the control connection. Once established, the
client MUST send a ConnectionBind request over the new connection.
That request MUST include the CONNECTION-ID attribute, echoed from
the Connect Success response. When a response to the ConnectionBind
request is received, if it is a success, the TCP connection on which
it was sent is called the client data connection corresponding to the
peer.
If the result of the Connect request was an Error Response, and the
response code was 447 (Connection Timeout or Failure), it means that
the TURN server was unable to connect to the peer. The client MAY
retry with the same XOR-PEER-ADDRESS attribute, but MUST wait at
least 10 seconds.
As with any other request, multiple Connect requests MAY be sent
simultaneously. However, Connect requests with the same XOR-PEER-
ADDRESS parameter MUST NOT be sent simultaneously.
<span class="h3"><a class="selflink" id="section-4.4" href="#section-4.4">4.4</a>. Receiving a Connection</span>
After an Allocate request is successfully processed by the server,
the client will start receiving a ConnectionAttempt indication each
time a peer for which a permission has been installed attempts a new
connection to the relayed transport address. This indication will
contain CONNECTION-ID and XOR-PEER-ADDRESS attributes. If the client
<span class="grey">Perreault & Rosenberg Standards Track [Page 7]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-8" ></span>
<span class="grey"><a href="./rfc6062">RFC 6062</a> TURN TCP November 2010</span>
wishes to accept this connection, it MUST initiate a new TCP
connection to the server, utilizing the same destination transport
address to which the control connection was established. This
connection MUST be made using a different local transport address.
Authentication of the client by the server MUST use the same method
and credentials as for the control connection. Once established, the
client MUST send a ConnectionBind request over the new connection.
That request MUST include the CONNECTION-ID attribute, echoed from
the ConnectionAttempt indication. When a response to the
ConnectionBind request is received, if it is a success, the TCP
connection on which it was sent is called the client data connection
corresponding to the peer.
<span class="h3"><a class="selflink" id="section-4.5" href="#section-4.5">4.5</a>. Sending and Receiving Data</span>
Once a client data connection is established, data sent on it by the
client will be relayed as-is to the peer by the server. Similarly,
data sent by the peer to the server will be relayed as-is to the
client over the data connection.
<span class="h3"><a class="selflink" id="section-4.6" href="#section-4.6">4.6</a>. Data Connection Maintenance</span>
The client MUST refresh the allocation (corresponding to a data
connection) using the Refresh request as defined in [<a href="./rfc5766" title=""Traversal Using Relays around NAT (TURN): Relay Extensions to Session Traversal Utilities for NAT (STUN)"">RFC5766</a>] for as
long as it wants to keep the data connection alive.
When the client wishes to terminate its relayed connection to the
peer, it closes the data connection to the server.
Note: No mechanism for keeping alive the NAT bindings (potentially
on the client data connection as well as on the peer data
connection) is included. This service is not provided by TURN-
TCP. If such a feature is deemed necessary, it can be implemented
higher up the stack, in the application protocol being tunneled
inside TURN-TCP. Also, TCP keep-alives MAY be used to keep the
NAT bindings on the client data connection alive.
<span class="h2"><a class="selflink" id="section-5" href="#section-5">5</a>. TURN Server Behavior</span>
<span class="h3"><a class="selflink" id="section-5.1" href="#section-5.1">5.1</a>. Receiving a TCP Allocate Request</span>
The process is similar to that defined in <a href="./rfc5766#section-6.2">[RFC5766], Section 6.2</a>,
with the following exceptions:
1. If the REQUESTED-TRANSPORT attribute is included and specifies a
protocol other than UDP or TCP, the server MUST reject the
request with a 442 (Unsupported Transport Protocol) error. If
the value is UDP, and if UDP transport is allowed by local
<span class="grey">Perreault & Rosenberg Standards Track [Page 8]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-9" ></span>
<span class="grey"><a href="./rfc6062">RFC 6062</a> TURN TCP November 2010</span>
policy, the server MUST continue with the procedures of [<a href="./rfc5766" title=""Traversal Using Relays around NAT (TURN): Relay Extensions to Session Traversal Utilities for NAT (STUN)"">RFC5766</a>]
instead of this document. If the value is UDP, and if UDP
transport is forbidden by local policy, the server MUST reject
the request with a 403 (Forbidden) error.
2. If the client connection transport is not TCP or TLS, the server
MUST reject the request with a 400 (Bad Request) error.
3. If the request contains the DONT-FRAGMENT, EVEN-PORT, or
RESERVATION-TOKEN attribute, the server MUST reject the request
with a 400 (Bad Request) error.
4. A TCP relayed transport address MUST be allocated instead of a
UDP one.
5. The RESERVATION-TOKEN attribute MUST NOT be present in the
success response.
If all checks pass, the server MUST start accepting incoming TCP
connections on the relayed transport address. Refer to <a href="#section-5.3">Section 5.3</a>
for details.
<span class="h3"><a class="selflink" id="section-5.2" href="#section-5.2">5.2</a>. Receiving a Connect Request</span>
When the server receives a Connect request, it processes the request
as follows.
If the request is received on a TCP connection for which no
allocation exists, the server MUST return a 437 (Allocation Mismatch)
error.
If the server is currently processing a Connect request for this
allocation with the same XOR-PEER-ADDRESS, it MUST return a 446
(Connection Already Exists) error.
If the server has already successfully processed a Connect request
for this allocation with the same XOR-PEER-ADDRESS, and the resulting
client and peer data connections are either pending or active, it
MUST return a 446 (Connection Already Exists) error.
If the request does not contain an XOR-PEER-ADDRESS attribute, or if
such attribute is invalid, the server MUST return a 400 (Bad Request)
error.
If the new connection is forbidden by local policy, the server MUST
reject the request with a 403 (Forbidden) error.
<span class="grey">Perreault & Rosenberg Standards Track [Page 9]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-10" ></span>
<span class="grey"><a href="./rfc6062">RFC 6062</a> TURN TCP November 2010</span>
Otherwise, the server MUST initiate an outgoing TCP connection. The
local endpoint is the relayed transport address associated with the
allocation. The remote endpoint is the one indicated by the XOR-
PEER-ADDRESS attribute. If the connection attempt fails or times
out, the server MUST return a 447 (Connection Timeout or Failure)
error. The timeout value MUST be at least 30 seconds.
If the connection is successful, it is now called a peer data
connection. The server MUST buffer any data received from the
client. The server adjusts its advertised TCP receive window to
reflect the amount of empty buffer space.
The server MUST include the CONNECTION-ID attribute in the Connect
success response. The attribute's value MUST uniquely identify the
peer data connection.
If no ConnectionBind request associated with this peer data
connection is received after 30 seconds, the peer data connection
MUST be closed.
<span class="h3"><a class="selflink" id="section-5.3" href="#section-5.3">5.3</a>. Receiving a TCP Connection on a Relayed Transport Address</span>
When a server receives an incoming TCP connection on a relayed
transport address, it processes the request as follows.
The server MUST accept the connection. If it is not successful,
nothing is sent to the client over the control connection.
If the connection is successfully accepted, it is now called a peer
data connection. The server MUST buffer any data received from the
peer. The server adjusts its advertised TCP receive window to
reflect the amount of empty buffer space.
If no permission for this peer has been installed for this
allocation, the server MUST close the connection with the peer
immediately after it has been accepted.
Otherwise, the server sends a ConnectionAttempt indication to the
client over the control connection. The indication MUST include an
XOR-PEER-ADDRESS attribute containing the peer's transport address,
as well as a CONNECTION-ID attribute uniquely identifying the peer
data connection.
If no ConnectionBind request associated with this peer data
connection is received after 30 seconds, the peer data connection
MUST be closed.
<span class="grey">Perreault & Rosenberg Standards Track [Page 10]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-11" ></span>
<span class="grey"><a href="./rfc6062">RFC 6062</a> TURN TCP November 2010</span>
<span class="h3"><a class="selflink" id="section-5.4" href="#section-5.4">5.4</a>. Receiving a ConnectionBind Request</span>
When a server receives a ConnectionBind request, it processes the
request as follows.
If the client connection transport is not TCP or TLS, the server MUST
return a 400 (Bad Request) error.
If the request does not contain the CONNECTION-ID attribute, or if
this attribute does not refer to an existing pending connection, the
server MUST return a 400 (Bad Request) error.
Otherwise, the client connection is now called a client data
connection. Data received on it MUST be sent as-is to the associated
peer data connection.
Data received on the associated peer data connection MUST be sent
as-is on this client data connection. This includes data that was
received after the associated Connect or request was successfully
processed and before this ConnectionBind request was received.
<span class="h3"><a class="selflink" id="section-5.5" href="#section-5.5">5.5</a>. Data Connection Maintenance</span>
If the allocation associated with a data connection expires, the data
connection MUST be closed.
When a client data connection is closed, the server MUST close the
corresponding peer data connection.
When a peer data connection is closed, the server MUST close the
corresponding client data connection.
<span class="h2"><a class="selflink" id="section-6" href="#section-6">6</a>. IANA Considerations</span>
This specification defines several new STUN methods, STUN attributes,
and STUN error codes. IANA added these new protocol elements to the
Session Traversal Utilities for NAT (STUN) Parameters registry.
<span class="h3"><a class="selflink" id="section-6.1" href="#section-6.1">6.1</a>. New STUN Methods</span>
This section lists the codepoints for the new STUN methods defined in
this specification. See Sections <a href="#section-4">4</a> and <a href="#section-5">5</a> for the semantics of these
new methods.
0x000a : Connect
0x000b : ConnectionBind
0x000c : ConnectionAttempt
<span class="grey">Perreault & Rosenberg Standards Track [Page 11]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-12" ></span>
<span class="grey"><a href="./rfc6062">RFC 6062</a> TURN TCP November 2010</span>
<span class="h3"><a class="selflink" id="section-6.2" href="#section-6.2">6.2</a>. New STUN Attributes</span>
This STUN extension defines the following new attributes:
0x002a : CONNECTION-ID
<span class="h4"><a class="selflink" id="section-6.2.1" href="#section-6.2.1">6.2.1</a>. CONNECTION-ID</span>
The CONNECTION-ID attribute uniquely identifies a peer data
connection. It is a 32-bit unsigned integral value.
<span class="h3"><a class="selflink" id="section-6.3" href="#section-6.3">6.3</a>. New STUN Error Codes</span>
446 Connection Already Exists
447 Connection Timeout or Failure
<span class="h2"><a class="selflink" id="section-7" href="#section-7">7</a>. Security Considerations</span>
After a TCP connection is established between the server and a peer,
and before a ConnectionBind request is received from the client, the
server buffers all data received from the peer. This protocol
specification lets the server drop the connection if the buffer size
is about to exceed a limit defined by local policy. This policy
should ensure that memory resources are not exceeded. See also
<a href="./rfc4732#section-2.1.3">[RFC4732], Section 2.1.3</a>.
All the security considerations applicable to STUN [<a href="./rfc5389" title=""Session Traversal Utilities for NAT (STUN)"">RFC5389</a>] and TURN
[<a href="./rfc5766" title=""Traversal Using Relays around NAT (TURN): Relay Extensions to Session Traversal Utilities for NAT (STUN)"">RFC5766</a>] are applicable to this document as well.
<span class="h2"><a class="selflink" id="section-8" href="#section-8">8</a>. Acknowledgements</span>
Thanks to Rohan Mahy and Philip Matthews for their initial work on
getting this document started.
The authors would also like to thank Alfred E. Heggestad, Ari
Keranen, Marc Petit-Huguenin, Dave Thaler, and Dan Wing for their
comments and suggestions.
<span class="h2"><a class="selflink" id="section-9" href="#section-9">9</a>. References</span>
<span class="h3"><a class="selflink" id="section-9.1" href="#section-9.1">9.1</a>. Normative References</span>
[<a id="ref-RFC2119">RFC2119</a>] Bradner, S., "Key words for use in RFCs to Indicate
Requirement Levels", <a href="https://www.rfc-editor.org/bcp/bcp14">BCP 14</a>, <a href="./rfc2119">RFC 2119</a>, March 1997.
[<a id="ref-RFC5389">RFC5389</a>] Rosenberg, J., Mahy, R., Matthews, P., and D. Wing,
"Session Traversal Utilities for NAT (STUN)", <a href="./rfc5389">RFC 5389</a>,
October 2008.
<span class="grey">Perreault & Rosenberg Standards Track [Page 12]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-13" ></span>
<span class="grey"><a href="./rfc6062">RFC 6062</a> TURN TCP November 2010</span>
[<a id="ref-RFC5766">RFC5766</a>] Mahy, R., Matthews, P., and J. Rosenberg, "Traversal Using
Relays around NAT (TURN): Relay Extensions to Session
Traversal Utilities for NAT (STUN)", <a href="./rfc5766">RFC 5766</a>, April 2010.
<span class="h3"><a class="selflink" id="section-9.2" href="#section-9.2">9.2</a>. Informative References</span>
[<a id="ref-RFC4732">RFC4732</a>] Handley, M., Rescorla, E., and IAB, "Internet Denial-of-
Service Considerations", <a href="./rfc4732">RFC 4732</a>, December 2006.
[<a id="ref-RFC5245">RFC5245</a>] Rosenberg, J., "Interactive Connectivity Establishment
(ICE): A Protocol for Network Address Translator (NAT)
Traversal for Offer/Answer Protocols", <a href="./rfc5245">RFC 5245</a>,
April 2010.
Authors' Addresses
Simon Perreault (editor)
Viagenie
2875 boul. Laurier, suite D2-630
Quebec, QC G1V 2M2
Canada
Phone: +1 418 656 9254
EMail: simon.perreault@viagenie.ca
URI: <a href="http://www.viagenie.ca">http://www.viagenie.ca</a>
Jonathan Rosenberg
jdrosen.net
Monmouth, NJ
US
EMail: jdrosen@jdrosen.net
URI: <a href="http://www.jdrosen.net">http://www.jdrosen.net</a>
Perreault & Rosenberg Standards Track [Page 13]
</pre>
|