summaryrefslogtreecommitdiffstats
path: root/net/quic/congestion_control
diff options
context:
space:
mode:
authorrtenneti@chromium.org <rtenneti@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-10-27 03:40:44 +0000
committerrtenneti@chromium.org <rtenneti@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-10-27 03:40:44 +0000
commit2cfc6bb8891f4eaac2146c97fe562ca698a9883c (patch)
tree064ab3652329edc1a33845aa58c0aef2f8322a7b /net/quic/congestion_control
parenta9f5730af67a9838ea3e68efa5beb54f861f02cb (diff)
downloadchromium_src-2cfc6bb8891f4eaac2146c97fe562ca698a9883c.zip
chromium_src-2cfc6bb8891f4eaac2146c97fe562ca698a9883c.tar.gz
chromium_src-2cfc6bb8891f4eaac2146c97fe562ca698a9883c.tar.bz2
Land Recent QUIC changes.
Rename ambiquious ConnectionClose method to OnConnectionClosed. Merge internal change: 54774694 Change TCP cubic's max packet size used to calculate the initial and subsequent congestion window in bytes to the default of 1460 from QUIC's artificially low 1200. Merge internal change: 54772582 QUIC: make the SCID a hash of the rest of the server config. We need to ensure that the SCID changes whenever the rest of the server config does. For example, cl/54004815 changed the server config, but not the SCID. This could lead to bad 0-RTT handshakes where the server believes the handshake is good, but will derive different keys than the client. The easiest change to ensure that the SCID is changed is to make it a hash of the rest of the message. Merge internal change: 54659325 EndToEndTest to fix TSAN. Merge internal change: 54090381 Don't add a zero-length public key to kPUBS if P-256 support is disabled. kKEXS and kPUBS should have the same number of elements. Merge internal change: 54004815 Make the QuicConnectionHelper no longer owned by the QuicConnection. Instead a single helper is owned by the Dispatcher or Client, and shared among each Connection. Merge internal change: 53974968 R=rch@chromium.org Review URL: https://codereview.chromium.org/45733002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@231244 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/quic/congestion_control')
-rw-r--r--net/quic/congestion_control/tcp_cubic_sender.cc2
-rw-r--r--net/quic/congestion_control/tcp_cubic_sender.h3
-rw-r--r--net/quic/congestion_control/tcp_cubic_sender_test.cc30
3 files changed, 19 insertions, 16 deletions
diff --git a/net/quic/congestion_control/tcp_cubic_sender.cc b/net/quic/congestion_control/tcp_cubic_sender.cc
index 36164b1..14804a9 100644
--- a/net/quic/congestion_control/tcp_cubic_sender.cc
+++ b/net/quic/congestion_control/tcp_cubic_sender.cc
@@ -13,7 +13,7 @@ namespace net {
namespace {
// Constants based on TCP defaults.
const int64 kHybridStartLowWindow = 16;
-const QuicByteCount kMaxSegmentSize = kMaxPacketSize;
+const QuicByteCount kMaxSegmentSize = kDefaultTCPMSS;
const QuicByteCount kDefaultReceiveWindow = 64000;
const int64 kInitialCongestionWindow = 10;
const int kMaxBurstLength = 3;
diff --git a/net/quic/congestion_control/tcp_cubic_sender.h b/net/quic/congestion_control/tcp_cubic_sender.h
index 603c73f..f83de11 100644
--- a/net/quic/congestion_control/tcp_cubic_sender.h
+++ b/net/quic/congestion_control/tcp_cubic_sender.h
@@ -20,6 +20,9 @@
namespace net {
+// Default maximum packet size used in Linux TCP implementations.
+const QuicByteCount kDefaultTCPMSS = 1460;
+
namespace test {
class TcpCubicSenderPeer;
} // namespace test
diff --git a/net/quic/congestion_control/tcp_cubic_sender_test.cc b/net/quic/congestion_control/tcp_cubic_sender_test.cc
index f8013bc0..5c2db40 100644
--- a/net/quic/congestion_control/tcp_cubic_sender_test.cc
+++ b/net/quic/congestion_control/tcp_cubic_sender_test.cc
@@ -12,7 +12,7 @@
namespace net {
namespace test {
-const uint32 kDefaultWindowTCP = 10 * kMaxPacketSize;
+const uint32 kDefaultWindowTCP = 10 * kDefaultTCPMSS;
// TODO(ianswett): Remove 10000 once b/10075719 is fixed.
const QuicTcpCongestionWindow kDefaultMaxCongestionWindowTCP = 10000;
@@ -43,7 +43,7 @@ class TcpCubicSenderTest : public ::testing::Test {
void SendAvailableSendWindow() {
QuicByteCount bytes_to_send = sender_->AvailableSendWindow();
while (bytes_to_send > 0) {
- QuicByteCount bytes_in_packet = std::min(kMaxPacketSize, bytes_to_send);
+ QuicByteCount bytes_in_packet = std::min(kDefaultTCPMSS, bytes_to_send);
sender_->OnPacketSent(clock_.Now(), sequence_number_++, bytes_in_packet,
NOT_RETRANSMISSION, HAS_RETRANSMITTABLE_DATA);
bytes_to_send -= bytes_in_packet;
@@ -57,7 +57,7 @@ class TcpCubicSenderTest : public ::testing::Test {
void AckNPackets(int n) {
for (int i = 0; i < n; ++i) {
acked_sequence_number_++;
- sender_->OnIncomingAck(acked_sequence_number_, kMaxPacketSize, rtt_);
+ sender_->OnIncomingAck(acked_sequence_number_, kDefaultTCPMSS, rtt_);
}
clock_.AdvanceTime(one_ms_); // 1 millisecond.
}
@@ -115,7 +115,7 @@ TEST_F(TcpCubicSenderTest, ExponentialSlowStart) {
AckNPackets(2);
}
QuicByteCount bytes_to_send = sender_->SendWindow();
- EXPECT_EQ(kDefaultWindowTCP + kMaxPacketSize * 2 * kNumberOfAck,
+ EXPECT_EQ(kDefaultWindowTCP + kDefaultTCPMSS * 2 * kNumberOfAck,
bytes_to_send);
}
@@ -144,12 +144,12 @@ TEST_F(TcpCubicSenderTest, SlowStartAckTrain) {
AckNPackets(2);
}
QuicByteCount expected_send_window =
- kDefaultWindowTCP + (kMaxPacketSize * 2 * kNumberOfAck);
+ kDefaultWindowTCP + (kDefaultTCPMSS * 2 * kNumberOfAck);
EXPECT_EQ(expected_send_window, sender_->SendWindow());
// We should now have fallen out of slow start.
SendAvailableSendWindow();
AckNPackets(2);
- expected_send_window += kMaxPacketSize;
+ expected_send_window += kDefaultTCPMSS;
EXPECT_EQ(expected_send_window, sender_->SendWindow());
// Testing Reno phase.
@@ -162,7 +162,7 @@ TEST_F(TcpCubicSenderTest, SlowStartAckTrain) {
}
SendAvailableSendWindow();
AckNPackets(2);
- expected_send_window += kMaxPacketSize;
+ expected_send_window += kDefaultTCPMSS;
EXPECT_EQ(expected_send_window, sender_->SendWindow());
}
@@ -188,7 +188,7 @@ TEST_F(TcpCubicSenderTest, SlowStartPacketLoss) {
}
SendAvailableSendWindow();
QuicByteCount expected_send_window = kDefaultWindowTCP +
- (kMaxPacketSize * 2 * kNumberOfAck);
+ (kDefaultTCPMSS * 2 * kNumberOfAck);
EXPECT_EQ(expected_send_window, sender_->SendWindow());
sender_->OnIncomingLoss(clock_.Now());
@@ -204,13 +204,13 @@ TEST_F(TcpCubicSenderTest, SlowStartPacketLoss) {
// Testing Reno phase.
// We need to ack half of the pending packet before we can send again.
- int number_of_packets_in_window = expected_send_window / kMaxPacketSize;
+ int number_of_packets_in_window = expected_send_window / kDefaultTCPMSS;
AckNPackets(number_of_packets_in_window);
EXPECT_EQ(expected_send_window, sender_->SendWindow());
EXPECT_EQ(0u, sender_->AvailableSendWindow());
AckNPackets(1);
- expected_send_window += kMaxPacketSize;
+ expected_send_window += kDefaultTCPMSS;
number_of_packets_in_window++;
EXPECT_EQ(expected_send_window, sender_->SendWindow());
@@ -223,7 +223,7 @@ TEST_F(TcpCubicSenderTest, SlowStartPacketLoss) {
}
SendAvailableSendWindow();
AckNPackets(1);
- expected_send_window += kMaxPacketSize;
+ expected_send_window += kDefaultTCPMSS;
EXPECT_EQ(expected_send_window, sender_->SendWindow());
}
@@ -280,7 +280,7 @@ TEST_F(TcpCubicSenderTest, SlowStartMaxSendWindow) {
AckNPackets(2);
}
QuicByteCount expected_send_window =
- kMaxCongestionWindowTCP * kMaxPacketSize;
+ kMaxCongestionWindowTCP * kDefaultTCPMSS;
EXPECT_EQ(expected_send_window, sender_->SendWindow());
}
@@ -314,7 +314,7 @@ TEST_F(TcpCubicSenderTest, TcpRenoMaxCongestionWindow) {
}
QuicByteCount expected_send_window =
- kMaxCongestionWindowTCP * kMaxPacketSize;
+ kMaxCongestionWindowTCP * kDefaultTCPMSS;
EXPECT_EQ(expected_send_window, sender_->SendWindow());
}
@@ -348,7 +348,7 @@ TEST_F(TcpCubicSenderTest, TcpCubicMaxCongestionWindow) {
}
QuicByteCount expected_send_window =
- kMaxCongestionWindowTCP * kMaxPacketSize;
+ kMaxCongestionWindowTCP * kDefaultTCPMSS;
EXPECT_EQ(expected_send_window, sender_->SendWindow());
}
@@ -357,7 +357,7 @@ TEST_F(TcpCubicSenderTest, SendWindowNotAffectedByAcks) {
// Send a packet with no retransmittable data, and ensure that the congestion
// window doesn't change.
- QuicByteCount bytes_in_packet = std::min(kMaxPacketSize, send_window);
+ QuicByteCount bytes_in_packet = std::min(kDefaultTCPMSS, send_window);
sender_->OnPacketSent(clock_.Now(), sequence_number_++, bytes_in_packet,
NOT_RETRANSMISSION, NO_RETRANSMITTABLE_DATA);
EXPECT_EQ(send_window, sender_->AvailableSendWindow());