TURN as in TURN server stands for Traversal Using Relays around NAT.
It is a standard method of NAT traversal used in WebRTC. It is defined in IETF RFC 5766.
TURN is used to relay media via a TURN server when the use of STUN isn’t possible.
The decision whether to use STUN or TURN is orchestrated by a protocol called ICE.
Since it relays all media through it, this can be a rather expensive endeavor (costing in bandwidth and CPU at a data center). This is why public TURN servers aren’t usually available and every service needs to install and maintain its own server (or pay for a hosted service).
TURN can use different transport protocols to relay its media:
- TURN/UDP – relaying media over UDP. This is the preferred method for handling real time media
- TURN/TCP – relaying media over TCP. This method can be seen as a fallback to UDP when UDP isn’t reachable from the device to the TURN server
- TURN/TLS – relaying media over TLS. This method is used for “worst case” scenario when nothing else can be used
Each of the mechanisms above is independent of the other. ICE is used to determine which of these transport protocols can be used for a given scenario.