Increase MSS to 1280bytes to increase BWE ramp up speed

This increase how much reference window can grow per update.
It also matches the WebRTC MTU size.


Bug: webrtc:447037083
Change-Id: I7a32915213a2c26e18dbc387e10aa0f9ee6693a4
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/456246
Commit-Queue: Per Kjellander <perkj@webrtc.org>
Reviewed-by: Björn Terelius <terelius@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#47146}
diff --git a/modules/congestion_controller/scream/scream_network_controller.cc b/modules/congestion_controller/scream/scream_network_controller.cc
index d50ccc4..396c2be 100644
--- a/modules/congestion_controller/scream/scream_network_controller.cc
+++ b/modules/congestion_controller/scream/scream_network_controller.cc
@@ -44,6 +44,9 @@
       starting_rate_(
           config.constraints.starting_rate.value_or(kDefaultStartRate)),
       streams_config_(config.stream_based_config),
+      max_seen_total_allocated_bitrate_(
+          config.stream_based_config.max_total_allocated_bitrate.value_or(
+              DataRate::Zero())),
       last_padding_interval_started_(Timestamp::Zero()) {
   UpdateScreamTargetBitrateConstraints();
 }
diff --git a/modules/congestion_controller/scream/scream_network_controller_unittest.cc b/modules/congestion_controller/scream/scream_network_controller_unittest.cc
index 745f70d..1a9dcab 100644
--- a/modules/congestion_controller/scream/scream_network_controller_unittest.cc
+++ b/modules/congestion_controller/scream/scream_network_controller_unittest.cc
@@ -449,10 +449,10 @@
   TimeDelta padding_duration = result_1.padding_stop - result_1.padding_start;
   TimeDelta time_between_padding =
       result_2.padding_start - result_1.padding_stop;
-  EXPECT_GT(padding_duration, TimeDelta::Millis(2800));
+  EXPECT_GT(padding_duration, TimeDelta::Millis(2500));
   EXPECT_LT(padding_duration, TimeDelta::Millis(3100));
 
-  EXPECT_GT(time_between_padding, TimeDelta::Millis(2900));
+  EXPECT_GT(time_between_padding, TimeDelta::Millis(2500));
   EXPECT_LT(time_between_padding, TimeDelta::Millis(3300));
 }
 
diff --git a/modules/congestion_controller/scream/scream_v2_parameters.cc b/modules/congestion_controller/scream/scream_v2_parameters.cc
index 63c01c4..7c70de1 100644
--- a/modules/congestion_controller/scream/scream_v2_parameters.cc
+++ b/modules/congestion_controller/scream/scream_v2_parameters.cc
@@ -23,7 +23,7 @@
       l4s_avg_g_down("L4sAvgGDown", 1.0 / 128.0),
       smoothed_rtt_avg_g_up("SmoothedRttAvgGUp", 1.0 / 8.0),
       smoothed_rtt_avg_g_down("SmoothedRttAvgGDown", 1.0 / 8.0),
-      max_segment_size("MaxSegmentSize", DataSize::Bytes(1000)),
+      max_segment_size("MaxSegmentSize", DataSize::Bytes(1280)),
       bytes_in_flight_head_room("BytesInFlightHeadRoom", 1.1),
       beta_loss("BetaLoss", 0.7),
       post_congestion_delay_rtts("PostCongestionDelayRtts", 100),
diff --git a/modules/congestion_controller/scream/scream_v2_unittest.cc b/modules/congestion_controller/scream/scream_v2_unittest.cc
index df15e48..84ccf60 100644
--- a/modules/congestion_controller/scream/scream_v2_unittest.cc
+++ b/modules/congestion_controller/scream/scream_v2_unittest.cc
@@ -180,9 +180,9 @@
     clock.AdvanceTime(feedback_interval);
   }
   // Target rate can increase up to 1.1 * data_in_flight + Max Segment Size(
-  // default 1000 bytes) when no max target rate has been set.
+  // default 1280 bytes) when no max target rate has been set.
   EXPECT_EQ(scream.ref_window(),
-            1.1 * feedback.data_in_flight + DataSize::Bytes(1000));
+            1.1 * feedback.data_in_flight + DataSize::Bytes(1280));
 }
 
 TEST(ScreamV2Test, CalculatesL4sAlpha) {
diff --git a/test/peer_scenario/bwe_integration_tests/scream_test.cc b/test/peer_scenario/bwe_integration_tests/scream_test.cc
index 8ed6a43..0cf1d13 100644
--- a/test/peer_scenario/bwe_integration_tests/scream_test.cc
+++ b/test/peer_scenario/bwe_integration_tests/scream_test.cc
@@ -337,7 +337,7 @@
   EXPECT_THAT(
       result.caller().subspan(1, 3),
       Each(AvailableSendBitrateIsBetween(DataRate::KilobitsPerSec(10),
-                                         DataRate::KilobitsPerSec(120))));
+                                         DataRate::KilobitsPerSec(140))));
   EXPECT_THAT(result.caller()[3],
               CurrentRoundTripTimeIsBetween(TimeDelta::Millis(40),
                                             TimeDelta::Millis(200)));
@@ -698,16 +698,10 @@
                         DataRate::KilobitsPerSec(50000), TimeDelta::Millis(10));
   SendMediaTestResult result = SendMediaInOneDirection(std::move(params), s);
 
-  // TODO: bugs.webrtc.org/447037083 - On a good network, we should be able to
-  // let the bitrate increase by 50% every RTT.
-  // After 300ms.
-  EXPECT_THAT(result.caller_stats[2],
-              AvailableSendBitrateIsBetween(DataRate::KilobitsPerSec(500),
-                                            DataRate::KilobitsPerSec(5000)));
-  // After 1s.
-  EXPECT_THAT(result.caller_stats.back(),
-              AvailableSendBitrateIsBetween(DataRate::KilobitsPerSec(1500),
-                                            DataRate::KilobitsPerSec(5000)));
+  // After 400ms.
+  EXPECT_THAT(result.caller_stats[3],
+              AvailableSendBitrateIsBetween(DataRate::KilobitsPerSec(1200),
+                                            DataRate::KilobitsPerSec(2500)));
 }
 
 TEST(ScreamTest, MaybeTest(LinkCapacity100Kbit50msRttNoEcn)) {