Skip to content

Commit

Permalink
Change the safe SCTP MTU size to 1191
Browse files Browse the repository at this point in the history
Bug: webrtc:12495
Change-Id: Ie149391a5a9f61095cf3f31db141c9bbc8be8bee
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/208642
Reviewed-by: Taylor <deadbeef@webrtc.org>
Reviewed-by: Philipp Hancke <philipp.hancke@googlemail.com>
Commit-Queue: Tommi <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33338}
  • Loading branch information
Tomas Gunnarsson authored and Commit Bot committed Feb 25, 2021
1 parent dfe1971 commit c500977
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions media/sctp/sctp_transport.cc
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,19 @@ constexpr int kSctpSuccessReturn = 1;
namespace {

// The biggest SCTP packet. Starting from a 'safe' wire MTU value of 1280,
// take off 80 bytes for DTLS/TURN/TCP/IP overhead.
static constexpr size_t kSctpMtu = 1200;
// take off 85 bytes for DTLS/TURN/TCP/IP and ciphertext overhead.
//
// Additionally, it's possible that TURN adds an additional 4 bytes of overhead
// after a channel has been established, so we subtract an additional 4 bytes.
//
// 1280 IPV6 MTU
// -40 IPV6 header
// -8 UDP
// -24 GCM Cipher
// -13 DTLS record header
// -4 TURN ChannelData
// = 1191 bytes.
static constexpr size_t kSctpMtu = 1191;

// Set the initial value of the static SCTP Data Engines reference count.
ABSL_CONST_INIT int g_usrsctp_usage_count = 0;
Expand Down

0 comments on commit c500977

Please sign in to comment.