구글 크롬을 이용해서 구글 사이트에 접속하면 HTTP/2가 아닌 QUIC+SPDY/3.1로
동작하게 된다. 왜 HTTP/2가 아닌 SPDY/3.1을 사용하는 것일까?
내 생각엔 명세상 QUIC과 HTTP/2를 동시에 사용할 수 없어서가 아닐까 싶다.
HTTP 명세를 살펴보자. 우선 HTTP/1.1은 TCP를 강제하지 않는다. 신뢰할 수 있는
transport layer 위에서 구현되어 있기만 하면 된다.
HTTP is a stateless request/response protocol that operates by
exchanging messages (Section 3) across a reliable transport- or
session-layer “connection” (Section 6).
다음 문장에서도 그 사실을 확인할 수 있다.
Although HTTP is independent of the transport protocol, the “http”
scheme is specific to TCP-based services because the name delegation
process depends on TCP for establishing authority.
TCP를 강제하지 않는 것은 SPDY/3.1 역시 마찬가지다.
SPDY adds a framing layer for multiplexing multiple, concurrent streams
across a single TCP connection (or any reliable transport stream).— https://www.chromium.org/spdy/spdy-protocol/spdy-protocol-draft3-1
반면에 HTTP/2는 명시적으로 TCP를 요구한다.
An HTTP/2 connection is an application-layer protocol running on top
of a TCP connection ([TCP]).
구글에서 구현한 QUIC 프로토콜은 TCP의 영역인 transport layer를 포함한다.
따라서 QUIC을 사용한다는 것은 TCP를 사용하지 않는다는 것이므로 QUIC 위에서
HTTP/2를 동작시키는 것은 HTTP/2 명세의 정의상 불가능하다.
변정훈님의 트윗을 보고 생각나서 적어보았다.
ps. Brian Hong님의 트윗에 따르면 QUIC은 TCP만을 대체하는 것이 아니라 SPDY도 대체하는 것이라고 한다. 확인해보니 QUIC은 TCP+TLS+SPDY 혹은 TCP+TLS+HTTP/2와 동등하다고 한다.