Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Evaluate uv_udp_try_send2 available in libuv 1.50.0 #1480

Open
ibc opened this issue Jan 16, 2025 · 6 comments
Open

Evaluate uv_udp_try_send2 available in libuv 1.50.0 #1480

ibc opened this issue Jan 16, 2025 · 6 comments
Assignees
Milestone

Comments

@ibc
Copy link
Member

ibc commented Jan 16, 2025

Details

Add a version of uv_udp_try_send that can send multiple datagrams.

Uses sendmmsg on platforms that support it (Linux, FreeBSD, macOS), falls back to a regular sendmsgloop elsewhere.

@ibc ibc added this to the v3 updates milestone Jan 16, 2025
@ibc ibc assigned ibc and jmillan Jan 16, 2025
@jmillan
Copy link
Member

jmillan commented Jan 16, 2025

The only use case I find is when sending NACK-ed RTP packets. In that case we may want to send N packets at once to a single socket.

@ibc
Copy link
Member Author

ibc commented Jan 16, 2025

Or when we send RTCP compound packets.

@fippo
Copy link
Contributor

fippo commented Jan 28, 2025

how would compound RTCP which needs to be SRTP-encrypted in a single call work?
NACK, FEC and maybe pacing... I hear @ggarber ponders re-pacing ;-)

@ibc
Copy link
Member Author

ibc commented Jan 28, 2025

how would compound RTCP which needs to be SRTP-encrypted in a single call work?

I fail to understand the problem you mean. The RTCP compound packet is not split into N datagrams. It's not that way. When mediasoup needs to generate RTCP compound packets it calculates the total size it would need and instead generates N RTCP compound packets of size less than hardcoded MTU (13XX bytes AFAIR) and then it encrypts each compound packet independently before sending each one. Nothing changes here regarding that.

@fippo
Copy link
Contributor

fippo commented Jan 28, 2025

yeah but how often does the get bigger than the MTU?

@ibc
Copy link
Member Author

ibc commented Jan 28, 2025

yeah but how often does the get bigger than the MTU?

How is that related to using this new UDP api in libuv? Absolutely nothing changes here no matter the total size of data to place in RTCP Compound packets.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

3 participants