NAT Setting
STUN/TURN service is the foundation to ensure that Audio/Video Chat can work properly. You can build your own STUN/TURN Server or use open STUN/TURN services, such as Google's STUN Server.
ICE (Interactive Connectivity Establishment)
ICE, namely the interactive connection establishment, is a framework and protocol used to establish end-to-end communication connections in complex network environments.
When using applications such as real-time audio and video communication, due to the existence of network address translation (NAT), firewalls and other devices, it becomes difficult to establish direct communication connections between devices located in different network environments.
The emergence of ICE is to solve this problem. It can find an optimal communication path under various complex network conditions, enabling the successful establishment of a connection and data transmission between two endpoints.
STUN(Session Traversal Utilities for NAT)
STUN is mainly used to solve communication problems in a network address translation (NAT) environment. Devices behind NAT usually have private IP addresses. When they communicate with the external network, NAT performs address translation on data packets.
This may lead to some communication problems, especially when conducting real-time communications such as voice and video calls. The role of the STUN server is to help the client discover its own public IP address and port number behind NAT and return this information to the client. In this way, the client can use this information to communicate directly with other clients.
For example, when two users located behind different NATs conduct a video/audio call, STUN can help them determine each other's public addresses so as to establish a direct connection.
You can use open-source STUN services, such as Google STUN, or build a STUN environment by yourself.
TURN(Traversal Using Relays around NAT)
Although STUN can achieve direct communication in many cases, sometimes due to network restrictions or the complexity of NAT types, direct communication may not be established. At this time, TURN service is needed. The TURN server acts as a relay, and all communication data is forwarded through the TURN server. The client sends data to the TURN server, and the TURN server forwards the data to the target client.
Although this method will increase some latency and bandwidth consumption, it can ensure the reliability of communication. For example, in some strict network environments, firewalls may block direct P2P communication. At this time, TURN becomes an important means to ensure communication.
After configuring the NAT Setting, you can enable the Audio & Video Chat permission and set Maximum Audio/Video Concurrency for each tenant. You can find more details from Tenant Management.