vasanthv / talk

Group video call for the web. No signups. No downloads.
https://vasanthv.github.io/talk
MIT License
3.92k stars 607 forks source link

I would like to know which UDP port you use #57

Open GitHub-XSF opened 1 year ago

GitHub-XSF commented 1 year ago

I would like to know which UDP port you use, and how do I edit the udp ports range? because I need to allow the specified range of ports.

Look forward to your reply~

miroslavpejic85 commented 1 year ago

Hello @GitHub-XSF,

In a WebRTC P2P (peer-to-peer) architecture (this one), the UDP ports used for communication are not fixed to a single port or a specific range. Instead, WebRTC dynamically negotiates and uses a range of UDP ports for various aspects of the communication, including media streams and data channels. The exact port numbers are negotiated during the WebRTC connection setup and can vary depending on network conditions, firewalls, and other factors.

WebRTC typically uses a range of UDP ports, often in the range of 50000 to 60000, for media and data transmission. These ports are used for both outgoing and incoming traffic.

If you need to allow a specified range of UDP ports for WebRTC communication, you would generally need to configure your network's firewall settings to allow incoming and outgoing traffic on that range of ports. However, keep in mind that WebRTC's port negotiation is dynamic and can involve a wider range of ports, so configuring a specific range might not be sufficient to cover all potential port usage.

In a WebRTC SFU (Selective Forwarding Unit) architecture, it is possible to have more control over the UDP ports used for WebRTC communication compared to a pure peer-to-peer architecture.

In an SFU setup, the SFU server acts as an intermediary between the participants in a WebRTC call. The SFU receives video and audio streams from each participant and then selectively forwards these streams to other participants. This architecture is commonly used in video conferencing platforms.

Because the SFU server is a central point of control, you can configure it to use specific UDP port ranges for receiving and forwarding media streams. This means that you can have more predictability and control over the ports that are being used for communication, as compared to a direct peer-to-peer connection.

If you're using an SFU, you would typically configure the server's media ports to ensure that they are open and properly routed through any firewalls or network equipment. The exact steps to configure the UDP port ranges for an SFU can depend on the software you're using for the SFU and the network setup you have.

If you need more information we are here to assist you.

BR. Miroslav