summaryrefslogtreecommitdiffstats
path: root/net/quic/quic_connection.h
diff options
context:
space:
mode:
authorrtenneti <rtenneti@chromium.org>2014-09-15 22:22:15 -0700
committerCommit bot <commit-bot@chromium.org>2014-09-16 05:23:16 +0000
commit31e9fd65aa1f2d7753f356fc267743a039fbd980 (patch)
treefe6404d4d65a47db1f36c622ff15e0cdeb4bd563 /net/quic/quic_connection.h
parentea09faed7faa245e638caedc2b871550a2139d76 (diff)
downloadchromium_src-31e9fd65aa1f2d7753f356fc267743a039fbd980.zip
chromium_src-31e9fd65aa1f2d7753f356fc267743a039fbd980.tar.gz
chromium_src-31e9fd65aa1f2d7753f356fc267743a039fbd980.tar.bz2
Landing Recent QUIC Changes.
Discard all useless QUIC retransmissions instead of only the most recent useless retransmission. May reduce the chances of truncated acks. Merge internal change: 75561951 https://codereview.chromium.org/564663005/ Add a separate QUIC_CONNECTION_OVERALL_TIMED_OUT to identify overall timeouts from idle timeouts and increase the initial overall timeout from 5s to 10s. Merge internal change: 75544619 https://codereview.chromium.org/572083003/ Fix QUIC crash on ConnectionClose, protected behind renamed flag FLAGS_close_quic_connection_unfinished_streams_2 (defaulted to false). With this change we avoid trying to close the connection while driving the QUIC internal server response pipeline, as the call to SendConnectionClose now happens during PostProcessAfterData, which is only ever called after receiving new data. With a hacky client/QUIC internal server combo (sending > 100 requests, but never sending FIN/RST) I've verified that with this change we don't hit the DFATAL from the attached bug. Still not entirely sure why Chrome would trigger this, b/17402744 is open to investigate why it ever opens more than kMaxStreams. Merge internal change: 75541290 https://codereview.chromium.org/575593002/ Add a LOG(DFATAL) to a case where packets are acked before being sent. Merge internal change: 75537267 https://codereview.chromium.org/575573003/ Allow number of open QUIC streams to grow 10% beyond configured limit at the QUIC internal server before closing connection. In the following situation Chrome may open more streams than the configured limit: * opens kMaxStreams streams * sends a FIN for one of the streams, now has kMaxStreams-1 streams open * opens a new stream * FIN gets lost on way to QUIC internal server * QUIC internal server terminates connection when new stream packet arrives Rather than making Chrome keep track of when the server has acknowledged a FIN, just give 10% breathing room which should avoid this case. Merge internal change: 75393293 https://codereview.chromium.org/557363003/ client-only - Change QUIC clients to use the initial RTT estimate that they provide to the server instead of the default. Re-enabled LimitCongestionWindowAndRTT end_to_end unittest (since we have fixed lot of flaky tests). Will test chromeos valgrind. Merge internal change: 75389539 https://codereview.chromium.org/573763003/ BUG=321870 Increase flow control receive window of quic_client_bin.cc, by adding a flag that defaults to 10 Mb. Added --flow-control-window-bytes as argument. Merge internal change: 75381087 https://codereview.chromium.org/569353003/ Call QuicSentPacketManager's OnPacketSerialized or OnRetransmittedPacket right before OnPacketSent, in preparation for combining the three methods into one. Merge internal change: 75340764 https://codereview.chromium.org/566743003/ Instead of initializing QuicSession::next_stream_id_ to 3 in the construct, and then setting it to 5 in InitializeSession simply initialize it to 5 in the constructor. Merge internal change: 75335114 https://codereview.chromium.org/562793003/ Do not allow a QUIC connection to timeout if no packets have been sent or received. Protected by FLAGS_quic_timeouts_require_activity. This seems to happen on windows from time to time and causes problems there. Merge internal change: 75304108 https://codereview.chromium.org/571993002/ Minor change to QUIC's retransmission to not link old retransmissions with new ones when the version or encryption changes. Allows the least_unacked to be raised more quickly, preventing spurious acks. Merge internal change: 75290729 https://codereview.chromium.org/572703003/ Removed unnecessary static_cast and replaced it with "lu". Minor change to keep the code similar to internal code. Merge internal change: 75263809 https://codereview.chromium.org/566373003/ QUIC cleanup to remove an unused bool argument in SendOrQueuePacket and OnSerializedPacket. Merge internal change: 75208575 https://codereview.chromium.org/553583007/ R=rch@chromium.org Review URL: https://codereview.chromium.org/559373003 Cr-Commit-Position: refs/heads/master@{#295014}
Diffstat (limited to 'net/quic/quic_connection.h')
-rw-r--r--net/quic/quic_connection.h71
1 files changed, 37 insertions, 34 deletions
diff --git a/net/quic/quic_connection.h b/net/quic/quic_connection.h
index c734387..25b8014 100644
--- a/net/quic/quic_connection.h
+++ b/net/quic/quic_connection.h
@@ -53,6 +53,7 @@ class QuicFecGroup;
class QuicRandom;
namespace test {
+class PacketSavingConnection;
class QuicConnectionPeer;
} // namespace test
@@ -374,7 +375,7 @@ class NET_EXPORT_PRIVATE QuicConnection
virtual QuicAckFrame* CreateAckFrame() OVERRIDE;
virtual QuicCongestionFeedbackFrame* CreateFeedbackFrame() OVERRIDE;
virtual QuicStopWaitingFrame* CreateStopWaitingFrame() OVERRIDE;
- virtual bool OnSerializedPacket(const SerializedPacket& packet) OVERRIDE;
+ virtual void OnSerializedPacket(const SerializedPacket& packet) OVERRIDE;
// QuicSentPacketManager::NetworkChangeVisitor
virtual void OnCongestionWindowChange(
@@ -452,11 +453,11 @@ class NET_EXPORT_PRIVATE QuicConnection
void OnRetransmissionTimeout();
// Retransmits all unacked packets with retransmittable frames if
- // |retransmission_type| is ALL_PACKETS, otherwise retransmits only initially
- // encrypted packets. Used when the negotiated protocol version is different
- // from what was initially assumed and when the visitor wants to re-transmit
- // initially encrypted packets when the initial encrypter changes.
- void RetransmitUnackedPackets(RetransmissionType retransmission_type);
+ // |retransmission_type| is ALL_UNACKED_PACKETS, otherwise retransmits only
+ // initially encrypted packets. Used when the negotiated protocol version is
+ // different from what was initially assumed and when the initial encryption
+ // changes.
+ void RetransmitUnackedPackets(TransmissionType retransmission_type);
// Calls |sent_packet_manager_|'s NeuterUnencryptedPackets. Used when the
// connection becomes forward secure and hasn't received acks for all packets.
@@ -521,23 +522,32 @@ class NET_EXPORT_PRIVATE QuicConnection
};
protected:
+ // Packets which have not been written to the wire.
+ // Owns the QuicPacket* packet.
+ struct QueuedPacket {
+ QueuedPacket(SerializedPacket packet,
+ EncryptionLevel level);
+ QueuedPacket(SerializedPacket packet,
+ EncryptionLevel level,
+ TransmissionType transmission_type,
+ QuicPacketSequenceNumber original_sequence_number);
+
+ SerializedPacket serialized_packet;
+ const EncryptionLevel encryption_level;
+ TransmissionType transmission_type;
+ // The packet's original sequence number if it is a retransmission.
+ // Otherwise it must be 0.
+ QuicPacketSequenceNumber original_sequence_number;
+ };
+
// Do any work which logically would be done in OnPacket but can not be
// safely done until the packet is validated. Returns true if the packet
// can be handled, false otherwise.
virtual bool ProcessValidatedPacket();
- // Send a packet to the peer using encryption |level|. If |sequence_number|
- // is present in the |retransmission_map_|, then contents of this packet will
- // be retransmitted with a new sequence number if it's not acked by the peer.
- // Deletes |packet| if WritePacket call succeeds, or transfers ownership to
- // QueuedPacket, ultimately deleted in WriteQueuedPackets. Updates the
- // entropy map corresponding to |sequence_number| using |entropy_hash|.
- // |transmission_type| and |retransmittable| are supplied to the congestion
- // manager, and when |forced| is true, it bypasses the congestion manager.
- // TODO(wtc): none of the callers check the return value.
- virtual bool SendOrQueuePacket(EncryptionLevel level,
- const SerializedPacket& packet,
- TransmissionType transmission_type);
+ // Send a packet to the peer, and takes ownership of the packet if the packet
+ // cannot be written immediately.
+ virtual void SendOrQueuePacket(QueuedPacket packet);
QuicConnectionHelperInterface* helper() { return helper_; }
@@ -556,30 +566,23 @@ class NET_EXPORT_PRIVATE QuicConnection
private:
friend class test::QuicConnectionPeer;
-
- // Packets which have not been written to the wire.
- // Owns the QuicPacket* packet.
- struct QueuedPacket {
- QueuedPacket(SerializedPacket packet,
- EncryptionLevel level,
- TransmissionType transmission_type);
-
- SerializedPacket serialized_packet;
- const EncryptionLevel encryption_level;
- TransmissionType transmission_type;
- };
+ friend class test::PacketSavingConnection;
typedef std::list<QueuedPacket> QueuedPacketList;
typedef std::map<QuicFecGroupNumber, QuicFecGroup*> FecGroupMap;
// Writes the given packet to socket, encrypted with packet's
// encryption_level. Returns true on successful write, and false if the writer
- // was blocked and the write needs to be tried again. Behavior is undefined
- // if connection is not established or broken. Notifies the SentPacketManager
- // when the write is successful.
+ // was blocked and the write needs to be tried again. Notifies the
+ // SentPacketManager when the write is successful and sets
+ // retransmittable frames to NULL.
// Saves the connection close packet for later transmission, even if the
// writer is write blocked.
- bool WritePacket(const QueuedPacket& packet);
+ bool WritePacket(QueuedPacket* packet);
+
+ // Does the main work of WritePacket, but does not delete the packet or
+ // retransmittable frames upon success.
+ bool WritePacketInner(QueuedPacket* packet);
// Make sure an ack we got from our peer is sane.
bool ValidateAckFrame(const QuicAckFrame& incoming_ack);