rfc-8016

Mobility with Traversal Using Relays around NAT (TURN)

T. Reddy, D. Wing, P. Patil, P. Martinsen
date2016-11 streamIETF areatsv wgtram statusPROPOSED STANDARD pages13 canonicalhttps://www.rfc-editor.org/rfc/rfc8016 doi10.17487/RFC8016 errataview
It is desirable to minimize traffic disruption caused by changing IP address during a mobility event. One mechanism to minimize disruption is to expose a shorter network path to the mobility event so that only the local network elements are aware of the changed IP address and the remote peer is unaware of the changed IP address. This document provides such an IP address mobility solution using Traversal Using Relays around NAT (TURN). This is achieved by allowing a client to retain an allocation on the TURN server when the IP address of the client changes.

Extracted elements (25)

design-rationale §1

Mobility is achieved entirely by the client and TURN server; the remote peer does not need to support mobility or be aware of address changes. This design hides the IP address change from upper-layer protocols and peer endpoints, avoiding the costly ICE re-negotiation required under the existing TURN specification.

nat

design-rationale §3.1.2

The mobility ticket is opaque to the client and its internal structure is not subject to interoperability requirements — implementations may diverge from the Appendix A example. This design allows the TURN server to store arbitrary system-internal state (encrypted and integrity-protected) without constraining the server implementation.

nat, security

design-rationale §3.2.2

The old 5-tuple is retained after a successful mobility Refresh (rather than immediately deleted) to support both Break-Before-Make and Make-Before-Break handover scenarios and to handle potential loss of the Refresh response — the client can continue sending data on the old path until the new path is confirmed.

nat

design-rationale §3.1.2

The TURN server supporting mobility MUST assume that the path MTU is unknown and size the ticket accordingly per STUN UDP fragmentation guidance (RFC 5389 Section 7.1). This is because a roaming client may move between networks with different MTUs and between address families (e.g., IPv6 to IPv4).

nat, ip

interoperability-note §3.1.2

If the server does not understand the MOBILITY-TICKET attribute (per RFC 5389 comprehension-optional rules), it ignores the attribute and processes the Allocate request normally without providing a ticket, allowing backward compatibility with non-mobility-aware TURN servers.

nat

interoperability-note §1

When (D)TLS is used as the STUN transport and the client's IP address changes, the client uses TLS Session Resumption without Server-Side State (RFC 5077) to resume secure communication with the TURN server from the new IP address, allowing the mobility mechanism to work seamlessly with (D)TLS.

tls, nat

normative-requirement §3.2.1 MUST NOT

A client MUST NOT include a MOBILITY-TICKET attribute in a Refresh request if its IP address and source port have not changed, as the server will reject such a request and the client would need to retransmit without the attribute.

nat

normative-requirement §3.2.2 MUST

A server MUST retain the old MOBILITY-TICKET for at least 30 seconds after issuing a new one, so it can recognize retransmissions of the Refresh request from the client using the old ticket.

nat

normative-requirement §3.2.2 MUST

After a successful mobility Refresh, the TURN server MUST continue receiving and processing data on the old 5-tuple and MUST continue transmitting data on the old 5-tuple until it receives a Send Indication, ChannelData message on the new 5-tuple, or a message closing the old connection.

nat

normative-requirement §3.1.4 SHOULD NOT

After receiving a 405 (Mobility Forbidden) response to an Allocate request containing MOBILITY-TICKET, the client SHOULD NOT retry sending an Allocate request containing MOBILITY-TICKET to that server until it believes the problem has been fixed.

nat

normative-requirement §5 MUST

If (D)TLS is not used or the (D)TLS handshake fails, and authentication also fails, the TURN client and server MUST fail and not proceed with TURN mobility.

security, nat, tls

normative-requirement §3.1.2 MUST

If MOBILITY-TICKET is included in an Allocate request with a non-zero length, the server MUST generate a 400 (Bad Request) error response, as a non-zero length is only valid in Refresh requests.

nat

normative-requirement §3.2.2 MUST

If the MOBILITY-TICKET presented in a Refresh request is invalid (fails decryption or integrity check), the server MUST reject the request with a 400 (Bad Request) error.

nat, security

normative-requirement §3.2.2 RECOMMENDED

It is RECOMMENDED that the client avoid transmitting a Send indication or ChannelData message until it has received an acknowledgement for the Refresh request containing MOBILITY-TICKET, since the server MAY discard or queue such messages before the Refresh succeeds.

nat

normative-requirement §3.2.2 MUST

The new MOBILITY-TICKET sent in a Refresh success response MUST be different from the old ticket. The old ticket may only be used for retransmission purposes.

nat, security

normative-requirement §5 MUST

The TURN server MUST always ensure the mobility ticket is authenticated and encrypted using strong cryptographic algorithms, and the ticket MUST be constructed to have strong entropy so nothing can be gleaned by examining it alone.

security, crypto, nat

normative-requirement §3.2.2 MUST

When a server receives a Refresh request with MOBILITY-TICKET and the decrypted ticket's 5-tuple does not identify an existing allocation, the server MUST reject the request with a 437 (Allocation Mismatch) error.

nat

normative-requirement §3.2.2 MUST

When validating a Refresh with MOBILITY-TICKET, if the source IP address and port differ from the stored 5-tuple, the server performs MESSAGE-INTEGRITY validation; if it fails, the server MUST reject with a 441 (Wrong Credentials) error.

nat, security

protocol-element §3.4

A new STUN error response code 405 (Mobility Forbidden) is defined. It is returned when a mobility request (MOBILITY-TICKET in Allocate or Refresh) is valid but cannot be performed due to administrative or similar restrictions on the server.

nat, registry

protocol-element §3.3

The MOBILITY-TICKET is a new STUN attribute used to retain a TURN allocation across client IP address changes. Its value is encrypted, of variable length, and opaque to the client. It is carried in Allocate requests (length=0 to request a ticket), Allocate success responses (server-issued ticket), and Refresh requests/responses (ticket presentation and renewal).

nat, security

registry §4

IANA has added MOBILITY-TICKET (value 0x8030, in the comprehension-optional range) to the 'STUN Attributes' registry, and has added error code 405 'Mobility Forbidden' to the 'STUN Error Codes' registry.

registry, nat

security-consideration §5

An attacker monitoring traffic between the TURN client and server can impersonate the client and refresh the allocation using an intercepted ticket with the attacker's IP address. To prevent this, TURN client and server MUST use STUN long-term credential mechanism, STUN Third-Party Authorization (RFC 7635), or a (D)TLS connection.

security, nat, tls

security-consideration §5

The ticket used for mobility MUST be authenticated and encrypted with strong cryptographic algorithms and MUST have strong entropy. This prevents modification or eavesdropping by an attacker and ensures that allocation ownership cannot be determined from the ticket contents alone.

security, crypto, nat

state-machine §3.2.2

On receiving a valid mobility Refresh, the server transitions the allocation's active 5-tuple from old to new: it adds the new client IP/port to state while retaining the old 5-tuple; upon receiving a Send Indication or ChannelData on the new 5-tuple (or a connection-close signal on the old), the server discards the old 5-tuple and old ticket, fully completing the transition.

nat

wire-format §A

The example ticket structure (Appendix A) consists of: key_name (16 octets), iv (16 octets), encrypted_state (variable, up to 2^16-1 octets), and mac (16 octets). Encryption uses AES_128_CBC; integrity uses HMAC-SHA-256-128 over key_name, IV, and encrypted_state length and contents.

nat, crypto