🚀 Tutorial 11: QUIC, HTTP/3, and Modern Transport Protocols

University‑level treatment – COMP347 (TrustOpen University)

Table of Contents

🎯 Learning Objectives

After completing this tutorial, you should be able to:

🔍 Overview

QUIC (Quick UDP Internet Connections) is a modern transport protocol developed by Google and now being standardized by the IETF (RFC 9000). It runs over UDP and integrates features from TCP, TLS, and HTTP/2 to provide a secure, multiplexed, low‑latency transport for today's web. QUIC addresses many of TCP's shortcomings: head‑of‑line blocking, handshake latency, and lack of connection migration. This tutorial provides a comprehensive exploration of QUIC's design, its use in HTTP/3, and how it compares to traditional TCP‑based approaches.

📘 1. Motivation and Evolution

The traditional web stack uses HTTP/2 over TCP, which has several limitations:

QUIC was designed to overcome these issues by running over UDP, integrating TLS, and providing a flexible, user‑space transport.

📘 2. QUIC Architecture and Protocol Stack

QUIC is built directly on top of UDP. It provides:

The QUIC stack: HTTP/3 (or other applications) → QUIC (reliability, congestion, security) → UDP → IP.

📘 3. QUIC Packet and Frame Formats

QUIC packets are encapsulated in UDP datagrams. The long header is used during handshake; the short header is used after.

Key elements:

Frames are the building blocks; a single QUIC packet can contain multiple frames.

📘 4. Connection Establishment and Handshake

QUIC uses a 1‑RTT handshake for new connections:

  1. Client sends Initial packet with ClientHello (TLS).
  2. Server responds with Initial packet (ServerHello, certificates) and Handshake packet.
  3. Client sends Handshake packet with Finished, then can send data.

With 0‑RTT, a client can send data in the first packet if it has a previous session ticket, reducing latency.

📘 5. Stream Multiplexing and Reliability

QUIC supports multiple streams within one connection. Each stream is independent and has its own sequence numbers and reliability. This avoids head‑of‑line blocking: a loss on one stream does not affect others. Streams can be bidirectional or unidirectional, and are identified by stream IDs.

📘 6. Congestion Control in QUIC

QUIC implements congestion control similar to TCP (Reno, Cubic) but is more flexible and can be updated independently of the OS. It uses a separate congestion controller per connection. QUIC also supports pacing and implements algorithms like BBR.

📘 7. Security: TLS 1.3 Integration

QUIC integrates TLS 1.3 directly, encrypting most of the packet header (except flags and connection ID). This provides end‑to‑end encryption and protects against middlebox tampering. The handshake is protected, and 0‑RTT provides fast resumption.

📘 8. QUIC vs TCP: Comparative Analysis

FeatureTCPQUIC
TransportNative IPOver UDP
MultiplexingSingle byte‑streamMultiple streams
Head‑of‑line blockingYes (entire connection)No (per‑stream)
Handshake RTT3 RTT (TCP+TLS)1 RTT (or 0‑RTT)
Connection migrationNoYes (connection IDs)
Congestion controlKernel, hard to updateUser‑space, pluggable
SecurityTLS over TCPIntegrated TLS 1.3

📘 9. HTTP/3: Mapping and Benefits

HTTP/3 replaces HTTP/2's TCP with QUIC. It maps HTTP/2 frames to QUIC streams. Benefits include reduced latency (0‑RTT), no head‑of‑line blocking, and improved performance on lossy networks.

📘 10. Connection Migration and Mobility

QUIC uses connection IDs that are independent of IP addresses. When a client changes networks, it can continue using the same connection ID, and the server can associate the new IP with the existing connection. This is seamless for the application.

📘 11. Loss Recovery and Packet Numbering

QUIC uses packet numbers (increasing) and ACKs to detect loss. It uses a mechanism similar to TCP's SACK, but with more granularity. QUIC also uses time‑based and packet‑based detection.

📘 12. Deployment and Performance

QUIC is widely deployed (Google, Facebook, Cloudflare). Performance gains include faster page load times, especially on mobile networks. Challenges include middlebox interference (UDP may be blocked) and the need for careful tuning.

📝 Quiz

Test your understanding with these 35 questions. Answers are hidden below each.

  1. What protocol does QUIC run on top of?
    AnswerUDP.
  2. What is the primary motivation for QUIC?
    AnswerTo reduce latency, avoid head‑of‑line blocking, and support connection migration.
  3. What is head‑of‑line blocking in TCP?
    AnswerA lost packet blocks all subsequent packets on the same connection, affecting all multiplexed streams.
  4. How does QUIC avoid head‑of‑line blocking?
    AnswerBy using multiple independent streams; a loss on one stream does not block others.
  5. What is the typical RTT for a QUIC full handshake?
    Answer1 RTT.
  6. What is 0‑RTT in QUIC?
    AnswerA feature that allows sending data in the first packet using a previous session ticket, reducing handshake latency.
  7. What is a Connection ID in QUIC?
    AnswerAn identifier used to demultiplex packets and support connection migration; it is independent of IP addresses.
  8. How does QUIC support connection migration?
    AnswerBy using connection IDs that are not tied to IP/port, allowing the endpoint to change networks without tearing down the connection.
  9. What security protocol is integrated into QUIC?
    AnswerTLS 1.3.
  10. Is QUIC header fully encrypted?
    AnswerMost of the header is encrypted; only the flags and connection ID are visible in the short header.
  11. What is the role of the ACK frame in QUIC?
    AnswerTo acknowledge received packets and provide loss detection information.
  12. How does QUIC congestion control compare to TCP?
    AnswerQUIC can implement similar algorithms (e.g., Cubic) but is more flexible and can be updated without kernel changes.
  13. What is HTTP/3?
    AnswerHTTP/3 is the version of HTTP that uses QUIC as its transport, replacing TCP.
  14. How does QUIC multiplex streams?
    AnswerEach stream is identified by a stream ID and is independent; frames are interleaved on the same connection.
  15. What is the purpose of the STREAM frame?
    AnswerTo carry application data within a specific stream.
  16. What is the difference between bidirectional and unidirectional streams in QUIC?
    AnswerBidirectional streams allow data flow in both directions; unidirectional only in one direction.
  17. What is a major challenge for QUIC deployment?
    AnswerMiddleboxes (firewalls, NATs) that block or interfere with UDP traffic.
  18. What is the QUIC packet number used for?
    AnswerTo order packets, detect losses, and provide acknowledgments.
  19. How does QUIC's loss detection differ from TCP?
    AnswerQUIC uses time‑based and packet‑based detection, and has more refined ACK mechanisms.
  20. What is the role of the PING frame?
    AnswerTo keep the connection alive or measure RTT.
  21. Can QUIC be used with applications other than HTTP?
    AnswerYes, QUIC is a general‑purpose transport and can be used for other protocols.
  22. What is the main advantage of 0‑RTT for web performance?
    AnswerIt eliminates the handshake latency, allowing data to be sent immediately.
  23. Is QUIC connection state maintained at the OS kernel?
    AnswerNo, QUIC is typically implemented in user space, making it easier to update and innovate.
  24. What is the spin bit in QUIC?
    AnswerA feature to allow passive latency measurement without exposing user data.
  25. How does QUIC handle packet reordering?
    AnswerIt uses packet numbers and ACKs; out‑of‑order packets are buffered and later delivered when gaps are filled.
  26. What is the purpose of the QUIC retransmission timer?
    AnswerTo trigger retransmission of lost packets when ACKs are not received.
  27. Does QUIC provide flow control?
    AnswerYes, QUIC has flow control per stream and per connection.
  28. How is flow control implemented in QUIC?
    AnswerUsing MAX_DATA and MAX_STREAM_DATA frames to advertise limits.
  29. What is the difference between QUIC's flow control and TCP's?
    AnswerQUIC has per‑stream flow control, while TCP has connection‑wide flow control.
  30. What is the effect of QUIC's 0‑RTT on security?
    Answer0‑RTT is vulnerable to replay attacks, so it is used with precautions.
  31. What is the typical size of a QUIC Connection ID?
    AnswerVariable, up to 20 bytes (IETF standard recommends 8 or more).
  32. How does QUIC handle congestion window growth?
    AnswerSimilar to TCP: slow start, congestion avoidance, and multiplicative decrease on loss.
  33. What is the role of the RESET_STREAM frame?
    AnswerTo abruptly terminate a stream.
  34. Why is QUIC considered more flexible than TCP?
    AnswerBecause it is implemented in user space and can be updated without OS changes.
  35. What is the main performance benefit of QUIC for mobile users?
    AnswerConnection migration allows seamless handoff between networks without restarting the connection.

🛠️ Exercises

Apply your knowledge with these 20 exercises. Solutions are provided below each.

  1. Exercise 1: Handshake RTT Comparison
    Compare the number of RTTs required for TCP+TLS (with full handshake) vs QUIC (1‑RTT and 0‑RTT).
    SolutionTCP+TLS: typically 3 RTT (SYN, SYN‑ACK, ACK + TLS handshake). QUIC 1‑RTT: 1 RTT; 0‑RTT: 0 RTT (if session resume).
  2. Exercise 2: Stream Multiplexing
    In QUIC, a connection has 10 streams. Packet 3 on stream 2 is lost. Does this affect stream 4?
    SolutionNo, streams are independent; the loss only affects stream 2.
  3. Exercise 3: Connection Migration
    A mobile device switches from WiFi to cellular. How does QUIC handle this without re‑establishing the connection?
    SolutionIt continues using the same connection ID; the new IP is associated with the existing connection.
  4. Exercise 4: 0‑RTT Security
    What is a potential security risk of 0‑RTT? How is it mitigated?
    SolutionReplay attacks. Mitigated by limiting the amount of data sent and using anti‑replay tokens.
  5. Exercise 5: Head‑of‑line Blocking
    Explain how QUIC eliminates head‑of‑line blocking and why it improves web performance.
    SolutionEach stream is independent; a loss on one stream does not block others, so overall page load is faster.
  6. Exercise 6: QUIC Frame Types
    List the main frame types in QUIC and their purposes.
    SolutionSTREAM (data), ACK (acknowledgment), PING (keep‑alive), RESET_STREAM (abort), MAX_DATA (flow control), etc.
  7. Exercise 7: Congestion Control Pluggability
    Why is it beneficial that QUIC's congestion control is pluggable?
    SolutionAllows experimentation and optimization without OS updates; can adapt to different network conditions.
  8. Exercise 8: HTTP/3 vs HTTP/2
    What are the main advantages of HTTP/3 over HTTP/2?
    SolutionLower latency (0‑RTT), no head‑of‑line blocking, better performance on lossy networks.
  9. Exercise 9: Flow Control
    How does QUIC's per‑stream flow control differ from TCP's connection‑wide flow control?
    SolutionQUIC allows finer control: if one stream is slow, it doesn't stall others.
  10. Exercise 10: Connection IDs
    Why are connection IDs not bound to IP addresses?
    SolutionTo support migration; the connection can survive changes in IP/port.
  11. Exercise 11: Loss Detection
    Describe how QUIC detects packet loss using ACK frames.
    SolutionACK frames contain packet numbers; gaps in acknowledged numbers indicate loss.
  12. Exercise 12: Security Integration
    What are the security benefits of integrating TLS 1.3 into QUIC?
    SolutionEnd‑to‑end encryption, protection against tampering, and reduced attack surface.
  13. Exercise 13: Middlebox Issues
    Why might some networks block QUIC?
    SolutionBecause it uses UDP on a non‑standard port, and some firewalls block UDP or throttle it.
  14. Exercise 14: 0‑RTT Data
    What kind of data is safe to send in 0‑RTT?
    SolutionIdempotent data (e.g., GET requests) that doesn't have side effects.
  15. Exercise 15: Packet Numbering
    Why does QUIC use separate packet number spaces for different packet types?
    SolutionTo avoid ambiguity and simplify loss recovery.
  16. Exercise 16: Performance Measurement
    How can the spin bit help measure latency?
    SolutionIt toggles on client‑to‑server packets; observers can measure RTT without decrypting.
  17. Exercise 17: Stream ID Assignment
    How are stream IDs assigned in QUIC?
    SolutionOdd IDs for client‑initiated, even for server‑initiated; specific ranges for unidirectional.
  18. Exercise 18: Retransmission Strategy
    How does QUIC handle retransmissions?
    SolutionIt uses packet number and ACK feedback; retransmits on timeout or when gaps are detected.
  19. Exercise 19: QUIC vs UDP
    What does QUIC add over bare UDP?
    SolutionReliability, ordering, congestion control, security, multiplexing.
  20. Exercise 20: Future of QUIC
    Do you think QUIC will replace TCP in the long term? Why?
    SolutionLikely for web and many applications, but TCP will remain for legacy and some constrained environments.

📚 Homework

These advanced problems require synthesis, research, and quantitative analysis. Sample answers are provided below.

  1. Problem 1: Derive the latency reduction of 0‑RTT.
    For a typical web page load, calculate the time saved by using 0‑RTT compared to a 3‑RTT handshake, assuming RTT=50ms.
    Sample Answer3‑RTT handshake takes 150ms; 0‑RTT takes 0ms handshake latency, saving 150ms.
  2. Problem 2: Stream Independence Analysis.
    Explain how QUIC's stream independence reduces the impact of packet loss on web page loading, using an example with multiple objects.
    Sample AnswerIf a loss occurs on one object's stream, other objects continue to load, so the page appears faster.
  3. Problem 3: Connection Migration in Practice.
    Describe the sequence of events when a mobile device switches from WiFi to LTE while using a QUIC connection.
    Sample AnswerThe device sends a packet from the new IP with the same connection ID; the server validates and updates the address.
  4. Problem 4: Security Analysis of 0‑RTT.
    Discuss the security risks of 0‑RTT and how QUIC mitigates them.
    Sample AnswerReplay attacks; mitigated by using limited data and anti‑replay tokens.
  5. Problem 5: QUIC Congestion Control vs. TCP.
    Compare the congestion control mechanisms of QUIC and TCP. Which is more adaptable?
    Sample AnswerQUIC is more adaptable because it is user‑space and can implement any algorithm; TCP is kernel‑bound.
  6. Problem 6: HTTP/3 Performance on Lossy Networks.
    Explain why HTTP/3 performs better than HTTP/2 on networks with high packet loss.
    Sample AnswerBecause loss on one stream does not block others, and 0‑RTT reduces handshake delays.
  7. Problem 7: Flow Control in QUIC.
    Detail how QUIC implements flow control at the stream and connection levels.
    Sample AnswerMAX_STREAM_DATA limits per‑stream; MAX_DATA limits total connection data.
  8. Problem 8: Packet Number Spaces.
    Why does QUIC use separate packet number spaces for Initial, Handshake, and Application Data?
    Sample AnswerTo simplify processing and avoid ambiguity across different encryption keys.
  9. Problem 9: QUIC vs TCP for Real‑Time Media.
    Discuss the advantages of using QUIC for real‑time media (e.g., video conferencing) over TCP.
    Sample AnswerQUIC provides low latency (0‑RTT), independent streams, and better loss recovery.
  10. Problem 10: Middlebox Traversal.
    What are the challenges for QUIC in traversing NATs and firewalls? How does it address them?
    Sample AnswerChallenges: UDP may be blocked; QUIC uses standard UDP ports (443) and can fallback to TCP.
  11. Problem 11: QUIC and Multipath.
    Can QUIC support multipath (using multiple network paths)? How?
    Sample AnswerNot yet standardized, but extensions are being developed to use multiple paths.
  12. Problem 12: Performance Measurement.
    Describe how to measure the performance of QUIC versus TCP in a controlled environment.
    Sample AnswerUse tools like iperf3 (with QUIC support) or http3‑test to measure latency and throughput.
  13. Problem 13: 0‑RTT and Idempotency.
    Explain why 0‑RTT data should be idempotent. Give examples of non‑idempotent requests.
    Sample AnswerNon‑idempotent requests (e.g., POST) may have side effects; repeated due to replay could cause issues.
  14. Problem 14: QUIC's Impact on Web Architecture.
    How might QUIC change the design of web servers and load balancers?
    Sample AnswerServers need to handle connection IDs and migration; load balancers must use connection IDs for affinity.
  15. Problem 15: Future of Transport Protocols.
    Do you think QUIC will eventually replace TCP for all Internet traffic? Justify your answer.
    Sample AnswerUnlikely to replace entirely; TCP will remain for legacy and some applications, but QUIC will dominate web and real‑time traffic.

📌 Summary

In the next tutorial, we will explore Transport‑Layer Security (TLS) in detail.

COMP347 – Computer Networks (Rev. 10) · TrustOpen University · Based on Kurose & Ross, Computer Networking: A Top‑Down Approach, 9th ed. (2025).