Overview
Traversal Using Relays around NAT (TURN) is a protocol that assists in traversal of network address translators (NAT) or firewalls for multimedia applications. It may be used with the Transmission control protocol and user datagram protocol.
TURN is most useful for clients on networks masqueraded by symmetric NAT devices. It supports the connection of a user behind a NAT to only a single peer, as in telephony, for example[1].
- Traversal Using Relays around NAT
- In case of Symmetric NAT we use TURN
- It's just a server that relays packets
- TURN default server port 3478, 5349 for TLS
- Expensive to maintain and run
Problems TURN Solves
- NAT Traversal: TURN is used to overcome the problem of NAT traversal. It allows network devices to establish peer-to-peer (P2P) connections through Network Address Translation (NAT) when direct connections are not possible[2].
- Firewall Traversal: TURN can work around firewalls and other security measures that prevent devices from communicating directly[3].
Pros of TURN
- Reliability: TURN servers can relay traffic between clients when direct connections are not possible due to NAT restrictions or firewalls[2:1].
- Security: TURN servers support authentication and encryption to protect against unauthorized use and interception[2:2].
- Use in Various Applications: TURN is used in several different network implementations and scenarios, one of which is in WebRTC implementations[4].
Cons of TURN
- Resource Intensive: Since TURN relays all media through it, this can be a rather expensive endeavor, costing in bandwidth and CPU at a data center[4:1].
- Quality Impact: TURN might affect quality depending on deployment[4:2].
- Limited Use: TURN is used as a fallback when the use of STUN isn’t possible[4:3].
In the context of 59.33 WebRTC, TURN is usually deployed with 59.28 STUN servers. Configuring TURN implicitly also implements the STUN protocol[5]. It's important to note that TURN does not aid in running servers on well-known ports in the private network through a 59.24 NAT[1:1].
COTURN open source project
https: //github.com/coturn/coturn