From: Camille Oudot <camille+ffmpeg-devel@voila.events>
To: ffmpeg-devel@ffmpeg.org
Subject: Re: [FFmpeg-devel] [PATCH] avformat/rtpproto: add support for RTP/UDP socket reuse
Date: Tue, 03 Jan 2023 10:03:30 +0100
Message-ID: <61a2d014dae2970ffa0a68097b26eec8cac9a399.camel@voila.events> (raw)
In-Reply-To: <12120876.O9o76ZdvQC@basile.remlab.net>
Hi, I'm back on the topic. Thanks to all of you for your comments.
> So I agree that SO_REUSEADDR is "absolutely not a hack"... if you use
> it to recycle IP/port pair without waiting for the time-out. But
> that's mainly of interest of listening/receiving sockets.
That is indeed the case for TCP sockets, but as far as I know this does
not apply to UDP as there is no TIME_WAIT state associated to datagram
sockets.
The classical use of this option would be for having a process binding
on udp:0.0.0.0:1234 then another one binding on e.g.
udp:192.168.1.10:1234 without triggering a "address in use" error. This
is indeed a matter of listening socket.
> If you use it to bind two concurrent sockets on the same IP/port
> pair, then it is absolutely not just a hack but a platform-dependent
> non-portable hack and a latent vulnerability in the OS (since one
> process can hijack datagrams for another).
The use of REUSEPORT instead of REUSEADDR is meant to mitigate this
risk (but it's far from perfect).
I definitely agree that using these options instead of refactoring or
rewriting the RTP protocol to support RTP bundle and RTCP mux is a
hack. I should take some time in the future to look into a proper
solution. In the meantime, several people are looking for this feature:
- http://ffmpeg.org/pipermail/ffmpeg-user/2018-September/041393.html
- https://trac.ffmpeg.org/ticket/1774
-
https://mediasoup.discourse.group/t/simulcast-with-plainrtptransport-and-ffmpeg/863
When the REUSEADDR option was added in FFmpeg UDP protocol what was the
reason back then? And wouldn't this reason also apply for RTP? If we
enable it for some legit reason, this could provide a (hacky and OS-
dependent) solution for RTP bundle and RTCP mux, until the RTP protocol
is properly refactored.
Regards
--
Camille
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
next prev parent reply other threads:[~2023-01-03 9:03 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-22 15:28 Camille Oudot
2022-12-22 15:42 ` Camille Oudot
2022-12-22 19:32 ` Nicolas George
2022-12-24 11:36 ` Rémi Denis-Courmont
2022-12-24 13:07 ` Camille Oudot
2022-12-25 10:00 ` Rémi Denis-Courmont
2022-12-25 23:52 ` Camille Oudot
2022-12-26 3:20 ` "zhilizhao(赵志立)"
2022-12-26 21:47 ` Nicolas George
2022-12-27 0:46 ` "zhilizhao(赵志立)"
2022-12-31 19:34 ` Rémi Denis-Courmont
2023-01-03 9:03 ` Camille Oudot [this message]
2023-01-03 16:03 ` Rémi Denis-Courmont
2023-01-03 19:13 ` Camille Oudot
2023-01-03 19:43 ` Nicolas George
2023-01-04 11:24 ` Camille Oudot
2023-01-05 12:16 ` Nicolas George
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=61a2d014dae2970ffa0a68097b26eec8cac9a399.camel@voila.events \
--to=camille+ffmpeg-devel@voila.events \
--cc=ffmpeg-devel@ffmpeg.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
This inbox may be cloned and mirrored by anyone:
git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
ffmpegdev@gitmailbox.com
public-inbox-index ffmpegdev
Example config snippet for mirrors.
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git