File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change 2727
2828// Max RTP size for WebRTC is 1200 bytes:
2929// - https://stackoverflow.com/questions/47635545/why-webrtc-chose-rtp-max-packet-size-to-1200-bytes
30- // We take this and substract 50 bytes for possible RTP extensions, see sdp.c
31- #define US_RTP_TOTAL_SIZE (1200 - 50)
30+ // But(!) Tailscale has 1200 MTU. So to fit it required to substract:
31+ // 1. possible RTP extensions (see sdp.c)
32+ // 2. additional SRTP fields (>= 10 bytes)
33+ // 3. UDP header (8 bytes)
34+ // 4. IPv6 header (40 bytes)
35+ // Finally it looks like 100 bytes for all above should be enough
36+ #define US_RTP_TOTAL_SIZE (1200 - 100)
3237#define US_RTP_HEADER_SIZE 12
3338#define US_RTP_PAYLOAD_SIZE (US_RTP_TOTAL_SIZE - US_RTP_HEADER_SIZE)
3439
You can’t perform that action at this time.
0 commit comments