webrtc

What is the purpose of defining TURN client besides Peer in TURN RFC?


RFC 8445 Terminology makes a distinction between "TURN client" and "Peer".

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.

In my understanding, WebRTC communication is bi-directional Peer to Peer, not Client/Server. Why does the RFC need the term "client" instead of just "Peer"? Without the term "client", what aspect of the TURN protocol cannot be specified clearly?

Both Peer L and R can be behind NAT and use STUN to know its Server Reflexive Address. Then both L and R will be TURN client. Is the term "client" required to uniquely handle the situation where one Peer is Not behind NAT?

Does "client" mean "The one that initiated the session", so that the protocol procedure definition can be clear who initiated the session? But I suppose it can be defined without defining "TURN client".

enter image description here


Solution

  • The difference is meaningful. Peer L is a TURN client towards the TURN server and sending TURN packets (such as channeldata). This channeldata is unwrapped by the TURN server and the content is forwarded over UDP and does not have to be STUN packet (but Peer L can wrap STUN packets inside the TURN messages)