How many UDP ports Mediasoup needs per session?

  1. There are rtcMinPort and rtcMaxPort settings https://mediasoup.org/documentation/v3/mediasoup/api/

I wonder how many ports are required for each “room” in case when there are:

  • 1 video publisher
  • 2 video consumers
  • 2 audio publishers
  • 3 audio consumers

I didn’t count gstreamer, which I use for recording, as a consumer. If gstreamer is a consumer too, then will it use more UDP ports for RTC?

  1. I’ve found this checklist https://github.com/versatica/mediasoup/wiki/Multi-Stream that mentions draft-ietf-avtcore-multiplex-guidelines: Guidelines for using the Multiplexing Features of RTP to Support Multiple Media Streams

Is it implemented in Mediasoup v2 or v3 by any chance? The checklist hasn’t been updated since 2017 so I am not sure it’s up to date. As I understand, this feature is going to affect the number of ports required per room.

Each SendTransport or RecvTransport you create in mediasoup-client requires separate WebRtcTransport in the server, so the number of ports will be:

  • number of WebRtcTransport in the server multiplied by the number of listenIps you pass to the router.createWebRtcTransport() in the server.
1 Like

What about the 2nd part of the question about Multiplexing Features of RTP?

Yes, we implement that draft (the thing related to SFUs). But forget about that. We do BUNDLE (N streams over the same ICE/RTP connection, etc). This is in documented in the website.

@ibc How this is being applied to the number of CPUs and piping between routes (if the number of routes = number of workers/CPUs)?