QUIC - Quick UDP Internet Connections
Total Page:16
File Type:pdf, Size:1020Kb
QUIC - Quick UDP Internet Connections Florian Gratzer Betreuer: Sebastian Gallenmüller, Quirin Scheitle Seminar Innovative Internet-Technologien und Mobilkommunikation SS2016 Lehrstuhl Netzarchitekturen und Netzdienste Fakultät für Informatik, Technische Universität München Email: fl[email protected] ABSTRACT ences between TCP and QUIC connections are that QUIC QUIC is a transport protocol on top of UDP, developed by connections are always encrypted and connection establish- Google. It uses mechanisms of TCP and introduces new ment takes 0 RTTs when a server is known by a client and features not used by other transport protocols. QUIC is 1 RTT for the first connection to an unknown server. Figure optimized to be used for HTTP/2 connections and aims to 1 shows the connection establishment of QUIC compared to reduce the end-to-end latency. QUIC works best (compared the TCP three-way handshake [10]. to TCP) for slow connections with high latency. This pa- per addresses the problems of TCP and the mechanisms of QUIC are discussed. QUIC packet and frame types are ex- amined. The performance of HTTP over QUIC is compared to HTTP over TCP and HTTP + SPDY over TCP. The re- sults show that QUIC is not better than the other protocols in all scenarios, but it can outperform TCP under certain network conditions. Keywords QUIC, Quick UDP Internet Connections, TCP, UDP, Layer 4, Google, Transport Protocol, HTTP/2, congestion control Figure 1: Connection Establishment of TCP and 1. INTRODUCTION QUIC These days, the Internet is used for read the latest news or watching videos on platforms like YouTube. When the page TCP cannot be used to establish an encrypted connection load time is high, the user experience can become very bad. within 0 RTT. Consequently, a different protocol is used as Transport Layer protocol. Therefore UDP is used, because it In the last years, many approaches were considered to make is already supported by most devices. Google’s services like Internet surfing faster. Internet Service Providers (ISPs) try YouTube are already supporting QUIC , as well as Google’s to reduce page load times by increasing the bandwidth and Browser Chrome [6]. In 2016, QUIC is still in development, using faster networking devices. Developers of web browsers so it is likely that the protocol changes in the near future. tempt to make their software more efficient. Google’s recent For this reason, Internet drafts of the IETF are used as approach is to reduce the latency in the middle of the OSI sources instead of RFCs. These drafts can be updated or model, namely in Layer 4, called Transport Layer. replaced by other documents at any time [9, 14]. Today, TCP and UDP are the most used protocols in the This paper discusses the mechanisms of QUIC compared Transport Layer. While TCP is connection oriented, UDP is to TCP. Moreover, the QUIC packet and frame types are connectionless. Both protocols have advantages and disad- observed and the performance of QUIC is evaluated. vantages. TCP provides a reliable connection, but the TCP three-way handshake increases the latency for establishing 2. OVERVIEW OVER QUIC a connection. This can be problematic for short living con- QUIC is a transport protocol built upon UDP, designed to nections. In contrast, UDP establishes no connection, which be used mainly for HTTP/2 [10], but it can be used by results in a fast, but unreliable data transfer. To unite the every application layer protocol. It is developed by Google advantages of both protocols, Google is developing a new and aims to reduce the connection establishment latency transport protocol called QUIC - Quick UDP Internet [10]. In contrast to TCP and UDP, QUIC connections are Connections [8]. always encrypted and authenticated (see Section 5.7). The handshake is inspired by the handshake of TLS [5]. QUIC According to Google, QUIC performs better than TCP in can be compared to TCP + TLS + HTTP/2. According to scenarios with high Round Trip Time (RTT) and at least Google, QUIC has a better congestion control compared to as good as TCP in most other scenarios [4]. This claim TCP [10]. In Section 10, different scenarios are considered will be evaluated in Section 10. The most important differ- to evaluate this claim. Seminars FI / IITM SS 16, 39 doi: 10.2313/NET-2016-09-1_06 Network Architectures and Services, September 2016 3. PROBLEMS OF TCP mechanism triggers and the connection changes to/stays in Today, TCP is widely used. It is more reliable than UDP the Congestion Avoidance phase (more details in Section but nevertheless it has several problems, especially when us- 4.1) [16]. ing it for HTTP/1.1. When designing a protocol based on TCP, these problems have to be addressed. To establish 4.1 Fast Retransmit a TCP connection, the TCP three-way handshake is used. Fast Retransmit is a mechanism to avoid retransmission This handshake increases the connection establishment la- timeouts (RTOs). It triggers, when the sender receives three tency significantly. This is not problematic for long lasting duplicate acknowledgments (ACKs) (this threshold is used connections, but can decrease the user experience for web in TCP as well as in QUIC) [4, 16]. A duplicate ACK is surfing significantly. HTTP/1.1 uses a new TCP connection an acknowledgment for a segment, which has already been for each fetched URL [17]. acknowledged and indicates a packet loss. When a RTO occurs, the congestion window is set to one maximum seg- Another problem is that a TCP segment can only carry a ment size (MSS), while the Fast Retransmit mechanism sets single HTTP/1.1 Request/Response. Consequently it is pos- the congestion windows (and the Slow Start threshold) to a sible that a large number of small segments are sent within value dependent on the value it was before the loss. Also, an HTTP/1.1 session. This can lead to a large overhead. the connection stays in the Congestion Avoidance phase and does not start with a new Slow Start as it is done after a Also, HTTP/1.1 transfers are always initiated by the client RTO. According to evaluations by Google, over 99% of the [17]. This decreases the performance of HTTP/1.1 signifi- packet losses are recognized by duplicate ACKs and so the cantly when loading embedded files, because a server has to Fast Retransmit mechanism kicks in in most cases [10]. wait for a request from the client, even if the server knows that the client needs a specific resource [7]. 4.2 Tail Loss Probe (TLP) The last problem discussed in this Section is Head-of-line When a receiver does not receive the last segment of a trans- (HOL) blocking. It occurs, when a packet is lost and consec- mission, Fast Retransmit cannot be triggered, because the utive packets arrive at the destination. The receiving host receiver needs to receive (any) segments to identify the loss has then to wait for the retransmission of the lost packet and therefore to send duplicate ACKs. To overcome this until it can process consecutive packets, which arrived at problem, QUIC uses Tail Loss Probes (TLPs). Before a the host without a loss. In scenarios like video streaming, a RTO, the sender sends two TLPs containing the last unac- small number of lost packets do not have a notable influence knowledged segment [4]. The receiver then triggers the fast on the user experience. Nevertheless, a TCP receiver has to recovery mechanism [21]. wait for the lost packet before it is able to continue playing the video. 4.3 Forward RTO-Recovery (F-RTO) F-RTO aims to avoid unnecessary retransmissions to im- One way to overcome this problem with TCP is to open mul- prove the performance of TCP/QUIC. TCP and QUIC use tiple connection between the same endpoints. This can work two mechanisms to trigger retransmission. As described in satisfyingly for a small number of connections, but when too Section 4.1, Fast Retransmit kicks in, when the sender re- many connections are opened, the connections tend to oscil- ceives three duplicate ACKs. The second reason for retrans- late between very small and too large congestion windows missions are RTOs. After RTOs, a sender sets the congestion when losses occur. This leads to a bad throughput and a window to one MSS and continues with a new Slow Start bad user experience. phase. 4. TCP MECHANISMS IN QUIC It is possible that a RTO occurs, even without a packet loss Although QUIC uses UDP, many mechanisms are inspired [18]. There are several reasons for spurious retransmissions, by TCP. QUIC uses acknowledgments like TCP to inform including delay spikes in mobile networks and different pri- the sender, that segments arrived at the receiver. The con- orities of the sent data from the sender and the acknowl- gestion control and loss recovery of QUIC is a reimplemen- edgments of the receiver [18]. After reducing the congestion tation of TCP cubic with additional mechanisms [10]. TCP window caused by delayed (but not lost) ACKs, the delayed Cubic is optimized for high bandwidth networks with high ACKs reach the sender. As a result of the reduced conges- latency [2]. In this section, the most important mechanisms tion window, the ACKs are not inside the congestion window of TCP used in QUIC are discussed. More can be found in and trigger additional spurious retransmissions [18]. QUIC the according Internet draft [14]. The mechanisms not used avoids this problem by not reducing the congestion window in TCP are focused in Section 5. QUIC uses a retransmis- (and the Slow Start threshold) until the sender receives a sion timer.