220 points · by homarp · 4y ago · 156 comments
https://curvecp.org/addressing.html
"A CurveCP connection remains fully functional even if the client changes IP address."
HTTP/2 came out in 2014, and since then I still haven't seen it used in production in the jobs I worked at.
Now, I wonder again, will HTTP/4 be released before we migrate to HTTP/3 ?
The real question here is, what are the arguments in favor of a migration? When starting a new web project, should you really consider anything else than HTTP/1.1?
Browsers allow for somewhere around 6 simultaneous TCP connections (which means around 6 concurrent requests with http1.1). Http2 allows for http requests at the speed of the clients upload connection (effectively unlimited).
Whereas with H1 browser opens up to 6 connections, downloads 1 file on each, then once the response comes it tells "ok now gimme another file" etc. (Another RTT until it comes back). That's many round-trips saved.
This is probably mostly useful when downloading many small images. It can be also useful for splitting JS into smaller bundles to favor cache hits for returning visitors. (An be also useful to serve ES modules without or with minimal bundling; however in practice bundling is still useful given that modern JS apps have 100s/1000s of files and small files overhead still matters at such numbers).
H2 has built-in support for interesting concepts like prioritization and re-prioritization of requests. Unfortunately, most impls in clients and servers are either not full or not very good:
I recommend googling "http/2 prioritization" and checking blogs and talks from Andy Davies and Pat Meenan. The subject is super interesting and inherently hard; browsers need to make certain assumptions whether scripts, fonts or CSS are more important and should be prioritized and it's non-obvious how to handle it best.
https://github.com/andydavies/http2-prioritization-issues
https://medium.com/dev-channel/javascript-loading-priorities...
It's useful for much more than that; I'd actually argue stream multiplexing is most useful outside of the browser in bespoke HTTP APIs, because that's a place where you can just stumble on cases where high fan-out requests are useful. For the browser case you're often limited by things like pagination, while JS/CSS can be amalgamated.
Not that it isn't good for small images too! But APIs benefit a lot as well and I think that's easily forgotten.
> If your website has a lot of small files served
What about JSON/GraphQL APIs?
Reponses need to be sent in the order the requests were made, since there is no _request id_ for the client to know which response is for which request.
This is a major annoyance with HTTP/1.1 pipelining, since it then becomes the client responsibility to send requests in an order that minimizes latency.
Say you want to retrieve 1) a huge background image of the website and 2) a small js script at page load time. If you send 1) then 2), you have to wait for the background image to come first.
Not only this is bad for client user experience, but it also means that the server cannot send responses in real-time, it has to buffer all subsequent responses until the previous ones are sent, creating bloat.
HTTP/1.1 is the worst.
HTTP/1.1 as documented looks like the simplest pipelining should work. But too many HTTP/1.1 servers in the wild by the point browsers began trying to enable pipelining were getting this wrong. Users don't care that "technically your bank's web server is non-conforming and you should contact them to report the issue" what they hear is just "Don't use our broken web browser".
As far as whether you should consider migrating, it’s worth doing a quick spike to determine level of effort. I expect the number of use cars which:
- can’t trivially update
- aren’t directly providing HTTP functionality to users who expect that
… is a rather small niche.
We already have an HTTP/2 and HTTP/3 capable load balancer because we host on GCP these days. Mostly this stuff just happens without intervention. HTTP/1.1 is a fallback for people with crappy network infrastructure.
If you are starting a web project, you should probably use one of the major cloud providers unless you have a good reason not to. You'll use this stuff by default mostly unless you explicitly turn this off. But why would you want to do that?
If you are managing your own load balancers; consider using something modern/up to date that would be able to support this. Also from a security point of view probably not something you should skip. And if you are using something modern, it shouldn't be that hard to turn on the feature.
If you manage some legacy stuff that just doesn't matter; don't bother of course. HTTP 1.1 will continue working just fine. If you have mobile users though, you are not doing them any favors by making things needlessly slow and this would probably be an easy upgrade.
How do you know? Most of the Alexa top 100k web sites are HTTP/2 but I suspect a great many of the people working on those web sites have no idea HTTP/2 exists, it simply has no impact on their work. It probably has no impact on your work.
Every single one of them was deploying the projects on the internal infrastructure, sometimes a small Kubernetes cluster, some other times just an EC2 instance, most of the time just one or two VMs.
Each employee was given a computer with a VPN client pre-installed, to connect to the internal infra.
The biggest company I've worked with had 10k employees, still not enough to see any impact on performance on the slowest single-threaded service we made.
When deploying, we were simply adding to the internal DNS server an A record "service.internal-domain.tld" pointing to the IP of our server. No load balancer, no reverse proxies, no HTTP/2 in the stack.
It's cheap, it works, it's certainly not something you would do if you were serving a SaaS application to millions of user on the world wide web, but it's definitely enough for internal stuff.
Even Google does not have more than 100k of employees.
However, turning on http2 for an org might mean nothing more than toggling some settings on a reverse proxy, no code changes required and little to no visibility or fuss for developers.
Alphabet has over 150k employees.
https://www.sec.gov/Archives/edgar/data/1652044/000165204422...
This makes it sound like the HTTP version you use is as major of a decision as the programming language you use, but can't you change HTTP versions basically by just flipping a switch?
NTLM auth… broken.
Client cert auth (mTLS)… broken.
Etc…
Monopolies are dangerous because they can accidentally lock out their competition without even trying.
They just have to focus on their own problems and ignore other people’s problems… because they can.
NTLM auth is garbage. Google didn't break it, Microsoft acknowledged many years ago that this is trash and you should stop using it, so unsurprisingly they didn't put in the engineering effort to support using this broken trash over HTTP/2 on IIS or Edge.
Personally I'm not sure why current HTTP2 stacks prevent Negotiate mechanism, but I suspect it's because of connection reuse and Negotiate doing connection-oriented auth - so I suspect Microsoft temporarily banned such feature (I can't find reference to other implementations downgrading, but outside of Microsoft on IIS not many do kerberos over http)
I know that's not used a lot but it is still used sometime when accessing critical systems.
I suppose that in the long run, mtls will completely disappear because of that, strange for a protocol that advertise itself as more secure to remove this option.
I'm not. My go-to web frameworks are Elixir/Phoenix, Python/Django, NodeJS/ApolloServer.
I have an irrational hatred for the Go language, but still use it to develop quickly some CLI tools.
Do you mind sharing why?
The widespread deployment of caching utilities and other frontend application middleware was, in a paradoxical way, a huge boon that lead to easy success for HTTP/2 (and now /3) while making it appear a bit bland to everyone else. "Nobody uses this, right? I mean, I've never changed anything." You weren't supposed to! For many purposes this is intended: service providers, operational admins etc can largely tweak this all independently at the caching service layer, for instance. Taken together it's mostly just "free performance" for the case of a user who has a reasonably reliable network.
Now, don't get me wrong, you need to understand caching and the HTTP connection lifecycle. There are aspects of newer HTTP versions that do impact the development experience. For example if you're sure you're using HTTP/2, you can rely on multiplexing. That means that, for instance, if your user has a dashboard with many panels, and each panel is doing independent requests to get metrics data (like Grafana, for instance), then all of those HTTP requests for data happen over 1 TCP connection. If you had to use many connections, you'd either have to throttle/serialize updates, use pipelining, or it might not work at all since the browser will refuse to open too many at once. But you can rely on this working with HTTP/2. If you rely on multiplexing, the penalty of having many small files on a single domain is much smaller. So those user avatars hosted on mybusiness-static-content.net will load much faster for all users too. That's just free performance on the table. But you have to design with it in mind.
So to answer your question: why should you migrate? Well, in general the answer is simple: better performance and better security (HTTP/2 and HTTP/3 both mandate TLS, for example), and HTTP/3 handles flaky mobile connections much better than either v1 or v2. That might really help for something like an API endpoint that mobile device clients access, for instance.
If you start a new project, should you consider anything except HTTP/1.1? Yes! Because HTTP/2 and HTTP/3 are here to stay, so it's not like you're betting the farm on something untested. You do need to consider client library availability; you can't get away with a half-baked "HTTP/2" implementation as easily as you could with HTTP/1.1 (this is the dark side of people who complain about binary-vs-text formats: it was very easy to get HTTP/1.1 very wrong). But they have tangible benefits for end users, and, taken into consideration, can help you do some stuff you couldn't before. Ignoring any claims it's a sign of website bloat, "download a lot of small files" is actually a legitimate, huge use case you couldn't do efficiently before in the browser or otherwise! Some non-browser workloads I've had see incredible performance improvement just from this alone. And if you're writing server software? Well, a good reason is "because it's easy to deploy". You might only need to change a configuration in your existing terminator.
Will there be an HTTP/4? I guess nothing is impossible here but I wouldn't bet on it. HTTP/2 was the big change. HTTP/3 was a "big" change not for HTTP, but because fixing HOL blocking at the TCP layer can only be done by, well, not using TCP! It's otherwise the exact same thing you know already, just in binary form, over a different transport stream. There could of course be other things down the line, but it seems like if anything continues to evolve, it will be QUIC itself, and less-so for HTTP.
Depends on what you mean with web project. How the server delivers data might not be of importance.
I'd already be happy if I could use IPv6.
Kind of sucks that SCTP, which also allows for multiplexing, never caught on for general use—probably because lack of support in various mid-network network boxen.
I guess we're generally stuck with tunnelling everything over HTTP (TCP and UDP) going forward. Every other kind of protocol implementation is out of the question because of NAT and various proxies.
Your device and my device could have the same MAC address and everything works fine until we find ourselves on the same L2 network. And there's practical limits to how large a single L2 network can be, and it's way smaller than 48 bits of space.
I do know Vint Cerf has stated using the IP address as the connection endpoint identifier in TCP and UDP was a mistake.[2]
[0] https://www.itu.int/rec/dologin_pub.asp?lang=e&id=T-REC-X.22...
[1] https://www.itu.int/rec/dologin_pub.asp?lang=e&id=T-REC-X.22...
alt-svc: h3="nodes.jrock.us:31313"; ma=300, h3-29="nodes.jrock.us:31313"; ma=300
Chrome will not request subsequent resources with HTTP/3. Firefox will.Obviously I am using a super-weird setup. I'm not using port 443 since I use managed Kubernetes which has a nodePort range that doesn't include 443. Then, h3.jrock.us is a CNAME for public-ingress.jrock.us which is an A record for 206.189.254.193. nodes.jrock.us is an A record that is a list of all nodes in my cluster. (This is because DigtialOcean doesn't support UDP load balancing, and I don't want to run my own load balancer, though I probably should. I am also missing out on IPv6 support, which annoys me greatly.) Everything is handled by Envoy; any load balancing is at the TCP level (load balancer) or UDP level (Kubernetes service).
I can't see anything in the standards that should prevent this from working, but it is indeed prevented from working. Sigh! Guess I should just run my own fleet of load balancers.
(Oh, ya know what, I'll interject another piece of annoyance here. I don't really want to use this pattern for non-test traffic, since there is some latency between nodes becoming unavailable and DNS caches noticing that. So if I roll all of my nodes, my website will break through the nodes.jrock.us route in that case. Even if I only roll one, browsers don't really know that they should fall back to another A record. This forces people to do load balancing at the IP layer, instead of at the application layer, which is really annoying. I wish there was a protocol where I could specify retry policies at the DNS layer. So you'd look up "jrock.us", get A 1.2.3.1, 1.2.3.2, 1.2.3.4, and "hey, if any of those fail to connect in 1 second, try the next and use that for 60 seconds". Each browser appears to do their own thing, and in-cluster I have a TON more control with things like xDS.)
I'm assuming they meant "user space congestion control" ? Even so, there's nothing about the protocol that says congestion control has to occur in user space.
I think it's pretty obvious that the feature/quirk of QUIC that the author is trying to summarize is that it's a UDP protocol (the most noteworthy thing about QUIC!) that provides its own congestion control, which is what makes it possible to run as a bulk transport for ~all Internet traffic, which is the premise of any new HTTP protocol.
I know Chrome had to implement a race between tcp and quic to detect various forms of broken firewalls, content filtering devices, etc. Maybe it would be better just to let things break and force the issue?
If you can't inpect --- and alter --- what your devices are sending and receiving, it's not yours.
Big Tech seems to be on a race to own the Internet through increasing complexity and "upgrade treadmilling", and I block everything except HTTP 1.1 and 1.0 as a form of protest.
I've always found it ironic that a lot of the anti-MITM-proxy folks are the same ones who work at or approve of the companies which are bringing more pervasive-surveillance "smart" devices to the market, locking down end-user-devices against the user, or trying to get you to consume more of their ads. Everything they say they do is for "security" and "privacy". They obviously don't want you getting in the way. Coincidence or not? You decide...
I think it would be better, but unfortunately it won't happen. Too much money riding on it. I still hope newer versions of http continue to be designed to be more resistant against these garbage tools.
What are we missing out on, because of the refusal to let go of pointless legacy systems?
Well, ECH instead of eSNI now, but yes, I would have loved this. Since browsers are all going to be willing to fall back to sending the website name in cleartext, anyone evil enough to be willing to do censorship or surveillance will just block eSNI and ECH.
HTTPX and Hyper didn't work either (probably due to ALPN?)
Had to call Curl from Python to make it work
I suppose since it's hard to scrape anything without a headless browser these days, the http[s] scraping libraries are stagnated.
“Speeding up HTTP with minimal protocol changes”
https://blog.jgc.org/2012/12/speeding-up-http-with-minimal-p...
It’s basically HTTP2s out of order pipelining but implemented as a simple extension to HTTP1.1 text protocol.
I think it would have been nice to maintain and improve the text protocol in that way.
Previous discussions:
Let me guess: those are all behind Cloudflare
Anyone with more experience on this care to weigh in?
I know there's WebSockets but that's typically implemented over HTTP/1.1 with durable TCP connections.
Let's say I wanted to do near real time (lowest possible latency preferably) synchronization in a server/client architecture, can HTTP/3 make sense here?
1. Make as many requests/responses as you require, and let the mulitiplexing of the protocol level do the job for you. Still might mean extra latency for sending another request to get the next chunk of data, but you might be able to send it ahead of time (long-polling style).
2. Make a single request, and stream all data bidirectionally in the request and resopnse body. bodies can be almost infinite and if you are using a custom library you can use them however you want. E.g. put small delimited messages into it in either direction - which is what gRPC streaming is doing. This will require libraries which actually support streaming, and not just Request->Response. Especially browsers are tricky here.
All those options have in common that you get reliability and flow-control in them. If you don't want to have that - because you maybe e.g. rather want to skip outdated data - then building on a lower layer like directly on QUIC makes more sense. This capability might come to browsers with WebTransport.
I guess DNS works over TCP (and TCP/HTTP) these days...
And 100% support HTTP/1.1. HTTP.1.1, while not new, sounds quite useful.
Being a mostly non-commercial, text-only web user, I only request resources from the host domain. The browser does not automatically follow URLs sourced in a page nor does it process Javascript to fetch or make XHR for additional resources. Often I do not use a browser to make HTTP requests, preferring to use smaller command line utilities instead, as for me this can be faster and more flexible. There is never any delay for a website to "load". For example, if I request the resource "index.html" from the host example.com, I do not make connections to any third party host domains, e.g., doubleclick.net. Thus, "head-of-line blocking" is generally not an issue.
Perhaps if I were requesting multiple resources, e.g., index0001.html through index1500.html, from example.com, then HTTP/3 might be faster than HTTP/1.1 pipelining, but I have not seen any evidence to support that idea. I have been using HTTP/1.1 pipelining to request multiple resources from the same host for a long time. Year after year it keeps working, and in some cases working better than ever before. In the years before Nginx was popular, when Apache was the most popular web server, it was common to see maximums set at 100 HTTP requests per TCP connection. Today, in some cases, maximums seem to have no upper bound. I have made thousands of HTTP requests over a single TCP connection.
The so-called "head-of-line blocking" problem seems to be restricted to "complex" websites that use resources from multiple hosts, especially trackers and ad servers. Those are often websites with lots of advertising, distractions and annoyances.
I enjoy using the web without invoking the "complex" website model. Nearly 100% of websites look great in the text-only browser, meaning I can read all the text and glean the information conveyed. For me, most "complex" websites can still be treated as if they were "simple" websites without losing information. When I visit example.com, I only request index.html from example.com. Nothing more. I do not make additional connections to third party domains, and, as such, there are no "blocking" problems to worry about.
HTTP/3 may be optimised for certain types of websites, i.e., complex ones, and a certain type of web usage, i.e., consumption of "complex" websites that include third party "content" and/or hidden elements. The biggest push for "HTTP/3/" comes from companies with vested interests in "complex" websites, the proliferation of online advertising and the attraction of "eyeballs".
HTTP/1.1 feels less corporate, from a time before Google et al.'s takeover of the web.
I do like the idea of QUIC (though I do no think Google was the first to implement the idea of reliable transmission over UDP), and I look forward to potentially using other (less web browser-centric, advertising-oriented) protocols over QUIC "connections".
Huh, what? The resources from different hosts are on different HTTP/1.1 connections, so they cannot head-of-line block one another.
Multiple hosts? You mean like in a app level proxy so its actually over the same connection?
I think its more relevant for multiple multiplexed requests to an API server in the B2B setting. Now the connection isn't bogged down by slow responses.
Perhaps a better way to explain why "head-of-line blocking" is a problem for "complex" web pages is that this model of a web page is one where the page is built from various components. They could come over different connections or the same one. HOL blocking may only apply to the second case. Regardless, the HOL problem arises because the page is not deemed "complete" until all the needed resources have been retrieved. Further, one retrieval might need to precede another. This gives rise to this idea of "loading" a web page. Please wait... (for header bidding to finish)
This delay while a page "loads" was used to thwart competition as part of "Jedi Blue" as alleged in the Texas, Arkansas, Idaho, Indiana, Mississippi, Missouri, North Dakota, South Dakota and Utah v Google, LLC., based on internal documents produced by Google: https://www.texasattorneygeneral.gov/sites/default/files/ima...
The way I do HTTP pipelining does not require mutiple components to "complete" a page. There is no "loading". There is no header bidding. We treat a complex page as "simple". No external resources. No Javascript. No CSS. The process is simply a sequential downloading of one page then another, catenated them into one HTML file. Some HN commenters loathe this usage of HTTP because it is useless for building complex web pages and inserting resources hosted by third parties into the page, namely, advertising. It restricts the ability to create highly artistic pages. This type of web use is basic. Boring. Rudimentary. Efficient. It works consistently. It's fast. (Yes, even when we have to wait for one request to finish before the next one begins, it is still fast. Plus, we do not have to worry about putting the responses into the correct order. They come back ordered correctly.) Catenated HTML pages look great in a text-only browser. Plaintext information for rapid consumption. No ads. No BS.
If one is not building a "complex" web page, then HTTP/1.1 works well. As I mentioned I have not seen any proof that HTTP/3 is superior for this type of web usage. Until such proof is presented, I will be sticking with HTTP/1.1, which works on 100% of websites, not 8% of the top 10 million.
How is it to debug? How do I troubleshoot? How do I dump a stream and see what is going on?
And that's just the tip of the iceberg of what I need to know before I can consider using it...
Sorry, couldn’t help my inner troll, take my karma.
> [list of obstacles to be overcome in deploying HTTP/3] includes getting the technology to work with (...) deep packet inspection devices
How do you reconcile this with the alleged increased used security? I know that everything relying on TLS for security is already just theatre in practice but still.
> the protocol is much easier than TCP to evolve/tweak and new best practices will emerge
Knowing only Google and/or other $big_corp will influence those evolutions, this does not strike me as a benefit either. I can wait before facing wire level DRM enforcement, for instance.
Certainly on the public internet this is a security win.
Internally, some organizations want to monitor or forensically record network sessions.... for security!
So you trade one form of security for another. Depends entirely on your security requirements.
Could you expand on that?
- adding a compromised certificate authority to the set of trusted ones in the clients (won't work reliably any longer for most servers I believe)
- copying around the servers private keys and forcing those servers to nehociate below perfect forward secrecy so that traffic can be decrypted on the fly from many places (for when you control the servers, but still copying private keys around and decrypting at the perimeter is not great)
- enforcing the use of a compromised browser/ssl lib on the client machines that will just store/forward the traffic
- installing "security" agents on controlled clients that forward all session keys on the fly or optionally tunnel the whole clear traffic to another box (I know a startup whom this is the only product)
I've personally been professionally involved with several of these tools at this point, even authored one, and I'm not even particularly interested in these topics, so I guess anyone working in security could bring more stories.
In conclusion, I believe TLS is both too complex and too flawed to be relied upon, and is just delaying the adoption of better protocols (some with no trusted authority, mandatory anonymous clients authorisation, mandatory secure encryption, you name it, again I'm not much into this, maybe some already well known protocol fits the bill)
TLS can't make you want security. The Socialist Millionaire's Protocol allows Alice and Bob to compare their fortunes to find out if they're equally wealthy without revealing who has how much. But the Protocol can't stop Alice from just blurting out "I'm worth a cool $84.6 million" if she chooses.