l7mp/stunner

UDPRoute with media servers that dynamically choose the listener port

joyu6011 opened this issue · 3 comments

Issue
I am setting up WebRTC for a client to connect with a media server that dynamically chooses it ports out of the range of all possible UDP ports. I can't actually open all possible UDP ports in the media plane service spec because the manifest would be too large. Is there a way to workaround this? Im noticing that at least from the UDP greeter example the service needs to open the ports that the media server has a UDP listener on.

Resolved in the discord thanks guys!

I have the same problem.
What is the solution?

Yet another reason to join our Discord...:-)

Anyway, here is the answer from the Discord thread:

Don't worry about the UDP ports on your media server: STUNner will let your clients reach any port on the media server. In fact, I know of only one media server product that lets you fix the backend port, all other server products use dynamically assigned random ports.

As long as ICE negotiation is OK between the server and the clients, things will just work smoothly with STUNner

NB: the port in the backend Service is ignored by STUNner

And the answer to the question that "at least from the UDP greeter example the service needs to open the ports that the media server has a UDP listener on":

[In the case of the UDP greeter] there is no ICE negotiation between the backend (UDP greeter) and the client (turncat). If you look at the turncat command line carefully, you'll see that turncat specifies the particular port it wants to reach on the backend. In a normal WebRTC connection setup, that port is chosen dynamically by the backend and then sent back to the client as an ICE candidate (a host candidate, to be precise), that's how the client knows it. Since for UDP greeter there is no ICE conversation, we have to fix the port...