matrix-org / matrix-org/waterfall
Only use one UDP port
- Dominant language
- Go
- Stars
- 105
- Forks
- 5
- PR merge metrics
- No merged PRs in 30d
Description
@daniel-abramov:
As discussed during the daily, I'm adding a little bit more context here: we won't be able to achieve the desired effect by just setting a range of UDP ports to a single port, instead, what we need, is to enable a so-called UDP Muxing in Pion.
As we know, UDP (unlike TCP) does not really have a concept of a connection on a protocol level, so it's about sending and receiving datagrams from/to an address. Pion does not have a global WebRTC state out-of-the-box that would allow reading the information from a single UDP socket and then forwarding it to the appropriate peer connection that is meant to be associated with it. So to enable this behavior, we should rely upon `ice.NewMultiUDPMuxFromPort(ourPort)` and then configure the engine accordingly: `webrtc.SettingEngine.setICEUDPMux(ourConfig)` (then we can create a new peer connection specifying the configured settings engine).
Note, that it's probably not something we want to have before stabilizing the SFU since enabling this option might have some undesired side-effects that must be treated accordingly, there is an open issue about it: https://github.com/pion/ice/issues/518
Perhaps a better idea would be to start with something that LiveKit has, i.e. allow configuration of the range of ports used for the UDP along with the support of the ICE-TCP. This should give us a good starting point. Then we could embed a TURN server into the SFU (the TURN server normally has fixed configured ports for both UDP and TCP) and only after it consider the usage of the UDPMux.
Contributor guide
Research direction
No repository files or tests are named. Start by reviewing the SFU's peer-connection configuration and the Pion entry points `ice.NewMultiUDPMuxFromPort` and `webrtc.SettingEngine.setICEUDPMux`, then read the linked Pion ICE issue. Done criteria are not settled: the issue compares UDP muxing with configurable port ranges, ICE-TCP, and an embedded TURN server.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- audio-video-rtc, networking
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100