9 ms·
HTTP/2 and HTTP/3 explained
- GoblinSlayer 3y ago>In the diagram below, request 2 cannot be sent until response 1 arrives, considering that only one TCP connection is used. That's wrong, request 2 can be sent before response 1 arrives. Blocking is inability to receive response 2 until response 1 arrives. With HTTP/2 responses can be unordered.
- tialaramex 3y agohttps://en.wikipedia.org/wiki/HTTP_pipelining https://en.wikipedia.org/wiki/HTTP_pipelining In practice it's not wrong. HTTP 1.x servers, and especially "middleboxes" get this badly enough wrong that when you ship this feature ("HTTP 1 pipelining") your users will report a low but persistent error rate. Oops the password request and image download were kinda sorta fused together. You can (and some very minor browsers do) just insist it's not your bug and then painstakingly reject every incident where this is implicated, or you can just accept that this was never going to work in practice as the document you're disparaging does.
- anonymoushn 3y agoDo you get a mostly eliminated error rate if you only use pipelining over TLS, or have server operators situated their defective middleboxes behind their TLS termination?
- GoblinSlayer 3y agoI guess, it's about things like UserGate, they generate MITM certificates on the fly and decrypt traffic. On the other hand, if they can't handle http1, why they would handle http2?
- pornel 3y agoNot really, because broken proxies include anti-virus software that sits at the endpoint, as well as corporate TLS-MITMing boxes. Browsers have spent years trying to find a way to deploy pipelining, but nothing really worked. You can't even allowlist based on known-good User-Agent or Via headers, because the broken proxies are often transparent. It's also very hard to detect pipelining errors, because you don't just get responses out of order, you may get response bodies mangled or interleaved. The idea is truly dead. With H2 being widely supported now, and having superior pipelining in every way, there's no incentive to retry the pain of deossifying H1.
- ghusbands 3y agoTo be very clear/direct, the HTTP pipelining you're referring to never fully worked and was always hit with problems with middleboxes, problems with servers, significant security vulnerabilities around request smuggling and more besides. Every project I've been involved with that tried to use them eventually turned them off. So the quote is true in practise.
- GoblinSlayer 3y agoAIU request smuggling, it can't be prevented by disabling pipelining, only by validation.
- otbutz 3y ago> HTTP/3 was designed for unstable connections, such as cellphone and satellite networks. Satellite networks are not a good example. Regular HTTP/1.1, paired with a PEP, outperforms HTTP/3 by an order of magnitude.
- pi-e-sigma 3y ago[flagged]
- jeltz 3y agoYou will need to back up that accusation, because now you are accusing Daniel Stenberg of being a liar. On paper HTTP shouldperform much better than HTTP 1.1 and especially HTTP 2 on links with high packet loss since TCP handles packet loss very poorly. https://http3-explained.haxx.se/en/why-quic https://http3-explained.haxx.se/en/why-quic
- pi-e-sigma 3y ago[flagged]
- golebiewsky 3y agoI was actually curious why SACK's don't resolve issue, but according to https://stackoverflow.com/questions/67773211/why-do-tcp-selective-acks-not-prevent-hol-blocking-in-http-2 https://stackoverflow.com/questions/67773211/why-do-tcp-sele... > Even with selective ACK it is still necessary to get the missing data before forwarding the data stream to the application.
- pi-e-sigma 3y agoWhich is exactly the same in HTTP2/3. You can't forward a stream when it's missing some data.
- 3y ago
- sgloutnikov 3y agoEnjoyed these books on the same topic: - https://http2-explained.haxx.se https://http2-explained.haxx.se - https://http3-explained.haxx.se https://http3-explained.haxx.se
- sylware 3y agoIf HTTP[23] are more complex than HTTP1.1, it is a mistake.
- GuB-42 3y agoMost of the complexity actually comes from encryption. If you don't need encryption, HTTP/1.1 is great. Especially since unencrypted HTTP/2 and 3 are usually not supported. HTTP/2 is sometimes considered a mistake. HTTP/3 is certainly more complex than HTTP/1.1, but that's in large part because it is actually several protocols in one. It replaces TCP with QUIC and therefore implements its features. It also has encryption built-in, so it also provides some of TLS features. It is based on UDP, but ideally it should QUIC/IP, the only reason why UDP is in the middle is to facilitate adoption. So if you consider HTTP/3 with builtin TLS vs HTTP/1.1+TLS+TCP, I don't think there is much of a difference in complexity.
- sylware 3y agoThen HTTP[23] are significantly more costly to implement, they are a mistake then. Nothing to brag about then.
- aerfio 3y agoI don't really see how one leads to another, could you elaborate? Looking at these protocols, it seems to me that later versions of HTTP attempt to address errors resulting from the overly simplistic design of HTTP/1.1.
- jsnell 3y agoThat's a pretty silly take. You're basically asserting that implementation difficulty is always the main priority, and there can never be any worthwhile tradeoffs that could offset that complexity. But in reality, the world probably only needs a few dozen H3 implementations, just like there are only tens of production TCP stacks. But those implementations will be used by billions of people, hundreds of billions of machines, and handle effectively all data transmission of the entire humanity. The leverage is massive, even the most minor improvements will be able to pay off any level of engineering effort.
- KaiserPro 3y ago> This is called head-of-line blocking. In the diagram below, request 2 cannot be sent until response 1 arrives, considering that only one TCP connection is used. Thats not really head of line blocking, because in HTTP1.1 you'd just open up another connection. The issue with HTTP1.1 is that opening up lots of connections can introduce lots of latency, especially if you are doing Encryption. HTTP1.1 performs much much better over high latency or lossy links than http2 > With HTTP/2, this problem is solved with streams, each stream corresponds to a message. Many streams can be interleaved in a single TCP packet. If a stream can't emit its data for some reason, other streams can take its place in the TCP packet. This is where HTTP2 failed. It shoved everything into one single TCP connection which works fine on LAN and LAN like networks, and sucks balls in the real world. This is Top of line blocking and was entirely predictable had the HTTP2 team bothered to talk to anyone who did networking. Its part of the reason why I was greatly suspicious of QUIC, because it appeared like it was designed by the same people that thought http2 was a good idea. However QUIC seems to be actually reasonable. I've yet to fully test it in real world scenarios, but it does offer promise for highspeed latency resistant data streaming. One day I'll re-write my TCP multiplexor to compare the performance.
- ghusbands 3y ago> entirely predictable had the HTTP2 team bothered to talk to anyone who did networking I think it's good that things have evolved rather than being stuck behind naysaying. Sure, there were pitfalls/hurdles that could have been avoided, but it's not clear that maintaining perfection every step of the way would have got us to QUIC.
- blueflow 3y agoThis is not some pitfall. This is a major problem in tech and IMHO totally unacceptable. The same things are re-invented all over again and again without actually making much of an improvement. The result of this is that we get constant upgrades and "improvements", but overall reliability, UI usability, latency and performance in general are actually worsening every year.
- deleted 3y ago
- IgorPartola 3y ago> the UDP protocol wasn't optimized by routers and operating systems over the last decades due to its low usage, making it comparatively slower than TCP What exactly does this mean?
- subtra3t 3y agoI haven't read the article yet but I think that means that UDP was used less than TCP and so routers/operating systems didn't optimize for it as much as they did for TCP. Hope this helps.
- IgorPartola 3y agoRight that’s all it says on this subject. I am curious about what optimizations TCP has benefitted from that we’re not but could be applied to UDP.
- jsnell 3y agoFor example various kinds of hardware TCP offload, like: 1. Handing the NIC a single blob of data (> MSS) in a single operation, and having the NIC do the segmentation into multiple packets. 2. Having the NIC detect multiple exactly consecutive TCP packets on the same flow, and merging them to a single receive operation. Hardware offload is impossible to do for UDP, since neither the NIC or OS can assume anything about the payload semantics.
- chasd00 3y agothere's nothing to optimize with UDP, you put a datagram on the wire and off it goes. There's no sequence number like in TCP to re-order and construct a stream on the receiving side. There is no stream, it's UDP. You put a datagram on the wire and that's it. There no syn/ack either so no congestion control in routers, no back-off or anything.
- goodburb 3y agoWhen loading many images [0] different browsers load the image in a different order and parallelism[1], especially HTTP/3 with Firefox [2]: [0] https://github.com/TalalMash/100-Image-Load-Test https://github.com/TalalMash/100-Image-Load-Test [1] https://imgur.com/a/b8P3XvB https://imgur.com/a/b8P3XvB [2] https://forum.openwrt.org/uploads/default/original/3X/b/c/bce69eb146b8b2fae5dad5834c4314789894a22e.gif https://forum.openwrt.org/uploads/default/original/3X/b/c/bc...
- superkuh 3y agoThe biggest difference is that HTTP/3 (and to a lesser extent, 2) are designed and implemented entirely and exclusively for for profit-business use cases at the detriment to all other use cases and specifically longevity. Since there are no HTTP/3 implementations that allow the use of non-CA TLS or even just plain text that means in order to host a visitable website for major browsers you have to get continued re-approval from a third party corporation every ~3 months. This means that websites using HTTP/3 will have very short unmaintained lifetimes. HTTP/3 sites will not last many years. They'll simply become unvisitable in a fraction of a year if there's ever any problem in the huge chain of complexity that is acme2 (and when acme2 is deprecated and turned off a huge portion of the web will die, much more than died when acme1 was turned off on LE). There is one feasible change that can be made now: Firefox needs to change the flags in it's HTTP/3 library build so that self signed certs are allowed.
- JackSlateur 3y agoWhich is, in my opinion, good I am sick of seing all kind of unsecure websites (or other things over TLS) as well as private CA Those things should not be put in production. If people cannot willingly work properly, then their life should be made harder and harder.
- afavour 3y agoNope. It should be possible to set up infrastructure to serve web content without being beholden to a certificate authority. By all means there can be a bunch of warnings whenever anyone tries to access it but it should still be possible.
- JackSlateur 3y agoBut you can : you can do whatever horrors you want, privately. You want your own browser with specific compiled-options ? Then do it and deploy it on your private perimeter. However, if you want to expose something publicly, then your own ideas matters less than the interests of your clients (at least, this is how I see things) : so exposing to the internet something without TLS or with a self-signed / private CA certificates is something that should be denied (those three propositions are the same, if you think about it).
- globular-toast 3y agoSo we squeeze a tiny bit more performance out of existing networks, then that immediately becomes normal again. Except now we have protocols that are difficult to implement, debug and understand.
- kaycey2022 3y agoImplementing concurrency in network protocols seems to be more than just a tiny improvement
- JackSlateur 3y agoAbout QUIC evolutions : https://lwn.net/Articles/964377/ https://lwn.net/Articles/964377/
- kaycey2022 3y agoThis was such a nice, concise article. It laid out everything so clearly and now I'm off exploring this subject by myself.
- kiney 3y agoWhat I don't understand: Why was the multiplexing in HTTP/2 and 3 pulled into the application layer instead of using a layer 4 protocol like SCTP?