Summary
Highlights
The WebTransport protocol is gaining traction, with experimental support released by Chrome and recent enablement in Firefox 114. Despite still being in draft mode, it aims to introduce new capabilities to web communication. The video will explore what WebTransport is, its features, and its significance in the evolving web landscape.
HTTP/1.1 was designed for simple request-response interactions. To achieve more interactivity, techniques like long-polling and Server-Sent Events (SSE) were introduced, allowing for server-initiated data streams. However, true bi-directional communication was lacking, leading to the development of WebSockets. WebSockets provided bi-directional communication by upgrading an HTTP connection but introduced its own overhead and challenges, such as operating solely over TCP.
HTTP/2 introduced multiplexing and streams, allowing multiple requests and responses over a single connection, significantly improving efficiency. HTTP/3, built on QUIC, aimed to solve the head-of-line blocking problem inherent in TCP-based protocols like HTTP/2. While these advancements offered more concurrency and performance, they still had limitations regarding application-level control over reliability and ordering, and added processing overhead.
WebTransport offers unprecedented flexibility by allowing developers to create various types of streams: bi-directional, unidirectional, and, notably, unreliable datagrams (UDP-like communication). This enables use cases where out-of-order or dropped packets are acceptable, such as real-time audio/video, giving application developers fine-grained control over data delivery. This level of control was previously only partially available through WebRTC.
WebTransport can operate over HTTP/2 or HTTP/3, but with significant differences. WebTransport over HTTP/2 does not support unreliable datagrams because HTTP/2 is TCP-based, which guarantees order. WebTransport over HTTP/3, leveraging QUIC, fully supports unreliable datagrams, offering true UDP-like functionality for specific application needs. This highlights the importance of the underlying transport layer for WebTransport's features.
Unlike HTTP/1.1's connection upgrade for WebSockets, WebTransport establishes sessions differently in HTTP/2 and HTTP/3. It utilizes an extended CONNECT method to create a dedicated stream for WebTransport within an existing HTTP/2 or HTTP/3 connection. This means that a single connection can simultaneously handle regular HTTP requests and multiple WebTransport sessions, optimizing resource utilization and performance. Each WebTransport session can then host multiple streams, providing a powerful and flexible communication model.
The video briefly touches on the issues with server push mechanisms, as seen with HTTP/2 push, where servers push resources to clients that might not need them, leading to inefficiencies. This underscores the importance of client-initiated communication and proper flow control, concepts that WebTransport incorporates to manage data transfer effectively and prevent client overload. Browsers implement throttling and flow control mechanisms to handle potential server-pushed data within WebTransport.
The presenter speculates that WebTransport, with its capabilities like bi-directional, unidirectional, and unreliable data delivery over HTTP/3, has the potential to eventually supersede protocols like WebRTC, gRPC, and WebSockets. Its seamless integration with the web platform and flexible features could make it the preferred choice for various real-time and interactive web applications in the future.