Does HTTP use UDP?

前端 未结 14 1310
夕颜
夕颜 2020-11-29 18:12

This might be a silly question:

  • Does HTTP ever use the User Datagram Protocol?

For example:

If one is

相关标签:
14条回答
  • 2020-11-29 18:49

    In theory yes it is possible to use UDP for http but that might be problematic. Say for instance in your example a mp3 or a video is being streamed there will be problem of ordering and some bits might go missing as UDP is not connection oriented there is no retransmit mechanism.

    0 讨论(0)
  • 2020-11-29 18:50

    (This is an old question, but it deserves an updated answer.)

    In all likelihood, HTTP/3 will be using the QUIC protocol, which is described as

    multiplexed transport over UDP

    So, from a certain point of view, you could say that HTTP/3 will be using UDP.

    0 讨论(0)
  • 2020-11-29 18:51

    From RFC 2616:

    HTTP communication usually takes place over TCP/IP connections. The default port is TCP 80, but other ports can be used. This does not preclude HTTP from being implemented on top of any other protocol on the Internet, or on other networks. HTTP only presumes a reliable transport; any protocol that provides such guarantees can be used; the mapping of the HTTP/1.1 request and response structures onto the transport data units of the protocol in question is outside the scope of this specification.

    So although it doesn't explicitly say so, UDP is not used because it is not a "reliable transport".

    EDIT - more recently, the QUIC protocol (which is more strictly a pseudo-transport or a session layer protocol) does use UDP for carrying HTTP/2.0 traffic and much of Google's traffic already uses this protocol. It's currently progressing towards standardisation as HTTP/3.

    0 讨论(0)
  • 2020-11-29 18:51

    Maybe some change on this topic with QUIC

    QUIC (Quick UDP Internet Connections, pronounced quick) is an experimental transport layer network protocol developed by Google and implemented in 2013. QUIC supports a set of multiplexed connections between two endpoints over User Datagram Protocol (UDP), and was designed to provide security protection equivalent to TLS/SSL, along with reduced connection and transport latency, and bandwidth estimation in each direction to avoid congestion. QUIC's main goal is to optimize connection-oriented web applications currently using TCP.

    0 讨论(0)
  • 2020-11-29 18:51

    Try run HTTP over UDP with node-httpp:

    https://github.com/InstantWebP2P/node-httpp

    0 讨论(0)
  • 2020-11-29 18:54

    http over udp is used by some torrent tracker implementations (and supporteb by all main clients)

    0 讨论(0)
提交回复
热议问题