128 points · by xngzng · 12y ago · 71 comments
1. The well-known resilience of mail can be largely attributed to its use of MX records to specify the use of backup servers and/or load balancing. SRV records are essentially a generalization of MX records for any service, not just mail, so using SRV records would bring this benefit to any protocol which uses them.
2. The problem of “www” or no “www” would be entirely eliminated; no need for non-standard so-called ANAME or ALIAS “records”. Just imagine – if, in an alternate universe, mail servers hadn’t used MX records, it would then have been necessary to have an A record on the bare domain name, and later, when the Web was created in this alternate universe, the web server would have to be the same server as the mail server, since both now would use the bare domain name. In our universe, this position is now solely occupied by the HTTP protocol, which causes lots of pain in the DNS when redundant (and harder to update) A records need to be put on the bare domain name just for HTTP. Not to mention IPv6, which, for HTTP to work, requires an additional AAAA record on the bare domain.
3. The “everything is on port 80, let’s reinvent everything on top of HTTP” problem could certainly have been entirely avoided, and could be slowly fixed, by using SRV records. (A server concerned about clients needing to traverse old-style restrictive firewalls could provide a low-priority port 80 server as a fallback.)
① A DNS RR for specifying the location of services (DNS SRV) https://tools.ietf.org/html/rfc2782
This was discussed by the WG. The best rationale is given in the thread starting from this mail[0] from Will Chan at Google, followed up by this one[1] from Amos Jeffries (Squid Proxy). The summary is: waiting for SRV lookups can be slower than just doing straight-up A records, so no client in a competitive space is going to do it.
Everyone agrees that in an ideal world this would be great, but in practice no-one is going to be the first person to move on that front. The wins aren't big enough and the cost is too high.
[0]: http://lists.w3.org/Archives/Public/ietf-http-wg/2014JanMar/... [1]: http://lists.w3.org/Archives/Public/ietf-http-wg/2014JanMar/...
If the language says "You MUST consult SRV records for _http2._tcp before you use the result of an A lookup", then anything that delays that SRV lookup will delay page resolution. Browsers are strongly disincentivised from making anything slow, so it's just safer not to add the extra delay point. If we specced that, no-one would do it.
Better to have what we have now, which is: do SRV if you want.
I regard this as the worst-case scenario. It is a baffling omission. The HTTP URI scheme [RFC7230] does nothing to clarify matters:
"If host is a registered name, the registered name is an indirect identifier for use with a name resolution service, such as DNS..."
In my view the WG has the opportunity to definitively fix the problems of dual-stack discovery and of apex record service names, and the refusal to do so is exceedingly disappointing. We're left with implementations of Happy Eyeballs that have lookup race conditions and therefore nondeterministic behaviour.
All the arguments against using service records are actually complaints about artefacts arising from the current ambiguity in resolution practices, and thereby perpetuate the problem.
The proper choice should be that all IPv6 sites should be resolved via SRV rather than raw AAAA lookup - this is the soft introduction that over the years will ramp up to a global first preference for service records, and remains compatible as a variation on Happy Eyeballs.
But entrenched positions don't change and I have no clout with the WG or with browser product managers, so I gave up.
Reading that I'm not sure the problem is that SRV lookups are slower, but that forcing clients to do a SRV lookup, wait, and then a A/AAAA queries is slower:
If I own a popular client and I switch to mandatory SRV lookup, and don't issue A and AAAA queries until the SRV lookup fails, then for the services and paths where SRV lookup doesn't work, user experience will be vastly degraded.[1]
However,it appears that making SRV optional remains a possibility:
Note that none of what I've said necessarily applies to optionally doing SRV and using it when the results are available.
[1] http://lists.w3.org/Archives/Public/ietf-http-wg/2014JanMar/...
Few if any resolvers support this feature, but it show that the problem we have is because of legacy assumption that are no longer true. Fix those, and the problem goes away.
I agree it's a pretty decent system, and something I'd like to see more systems adopt it.
Interestingly, I can't actually think of a reason why a (customised) web browser couldn't use it now. If a browser understood SRV records it could use the correct port. There might be some odd interactions with the HTTP 1.1 Host header, but I haven't thought about it much.
Of course, browsers that don't understand it wouldn't be able to follow links that use it which is something of a downside I guess.
(I wrote about this previously here on HN: https://news.ycombinator.com/item?id=7522208)
Indeed, since the HTTP/1.1 RFC was issued in 1999 and the SRV RFC in 2000 there is no way it could have mentioned it.
If there are technical reasons why it can't work that's one thing. If some verbiage in the RFC is all that holds it back it's easy to fix: try it out, then issue a new RFC.
The whole RFC process embraces changes like this.
Have they actually worked out how to implement a HTTP/2 front end cache in the face of ill-behaved clients, crashy servers, and the way wireless breaks a lot of the assumptions that would make "one big TCP session" a good idea in the first place?
If TCP+TLS handshakes are so expensive, wouldn't it be a better investment of everyone's resources to work on an L3 protocol for setting up a fast second session? Leave the multiplexing to packet people.
A client can say it does not want push in the settings frame up front. And then it can make one request at a time, effectively avoiding multiplexing, although each frame in the response will have a 9-byte frame header (similar to the overhead in chunking today in 1.x).
By saying it does not want push, it relieves itself of having an object cache. It will still be on the hook for having an HPACK table as state. (In practice this will be coded once in each language in a library and most developers will never think about it.)
> Have they actually worked out how to implement a HTTP/2 front end cache in the face of ill-behaved clients, crashy servers, and the way wireless breaks a lot of the assumptions that would make "one big TCP session" a good idea in the first place?
The community has indeed been working on a corpus of interoperability libraries, servers, clients, and proxies: https://github.com/http2/http2-spec/wiki/Implementations
> If TCP+TLS handshakes are so expensive, wouldn't it be a better investment of everyone's resources to work on an L3 protocol for setting up a fast second session? Leave the multiplexing to packet people.
It's multiplexing with declared weighting and dependency trees. So for example, the client can tell the server that it wants files A, B, C, and D, but to have B, C, D is useless until it has A, and once A is finished, the relative importance of B is twice as much as C or D. That's much easier to do on one socket.
Also one socket gets the header compression in HPACK to benefit from all the headers going through the same state engine. Giant sets of cookies (more common than we'd like to believe) are now more efficiently expressed.
One socket also helps the server-side keep statistics and logs more organized as related requests are together.
I understand your suggestion to do it on a lower level, and that's a fine idea, but I also understand why the working group did it on an HTTP layer, especially with SPDY as precedent.
I work at Akamai, and I'm one of the open source library contributors (the Common Lisp one). These opinions are my own.
The rare occasion where this will be a big difference for me is telnetting to port 80 and typing HTTP by hand. Honestly, I only do that out of habit; I can do the same things just as well with curl. But even when HTTP/2 ships, I'm sure it will be at least a decade before servers stop supporting HTTP/1.1. Probably longer. So I'm not expecting this to make a big difference to my debugging habits.
Their more involved properties require dozens to even hundreds of requests in order to perform complex tasks like showing a list of plain text posts.
And, of course, they can't possibly impose any kind of discipline on the way they do things, so instead the entire internet has to change to accommodate them.
Now I could optimize that even more by inlining everything with data-inline: but that would impact caching code and be strictly worse for the network.
A property from google even websearch has fancy transitions and animations and dynamic content. And Google has every incentive to limit the number of connections to their page. When I worked there I worked on some of those technologies specifically to avoid too many connections.
Blaming Google for not being disciplined enough disregards their economic incentives to be disciplined enough. They invested a lot of energy in this before SPDY came out. There comes a time where you just have to recognize that the protocol is fighting against you and either give up or evolve the protocol.
No, wait a sec. That doesn't sound right. Could it be that our tools exist to serve humans? And that rather than putting effort into accommodating ourselves to the limitations of our current tools, we should instead put our effort into making tools that work the way we want?
Nah, sounds crazy. If HTTP/1 was good enough for my grand-dad, it's good enough for me.
(1) index.html, (2) app.nocache.js (3) A56284CFC0D680C7DBA0F93CA9AE8F75.cache.js (cache fragment for given page/state) (4) XHR for page data/state to display
Now, if you've got some CSS and minor images/fonts, these can be an your options request (5) resource bundle. On many Google properties, (2 and 5) are inlined into (1).
The take away? These technologies and frameworks have been out there for a long time (8 years in the case of GWT), so you don't have to make hundreds of requests if you're disciplined. I can only assume Google has thrown in the towel trying to get script kiddies to ever be disciplined.
SPDY and HTTP/2 can multiplex their data streams across a single connection. That is to say, they can receive 2+ datastreams on the same TCP connection at the same time.
I think the better route is to investigate how HTTP/1.1 could be layered atop multiplexing transport protocols like SCTP.
It might take 10 years to reach wide deployment, but HTTP/1.1 over TCP is working just fine anyways.
And as the FAQ says, if you don't use header compression then response headers alone will take many RTTs to transmit due to slow start.
But it would allow multiple HTTP requests to be multiplexed over a single connection.
SCTP is also using some form of slow start congestion control, but since it would multiplex the HTTP requests over a single connection there would only be one initial slow start for all the requests.
Which is worse than HTTP/1.1. Avoiding that problem is why HTTP/2 uses hpack.
While this is true, I don't think HTTP/2 will or should negate some of these. Precomputing things like minification and concatenation will certainly reduce load and always increase capacity. Human-readable code is only useful for humans, and during transfer, storage, parsing, etc., it's just plain inefficient. Also, with spriting and concat, fewer files means more of the information you know you need is at the same place in disk or memory, speeding access at a low level.
That said...the other 50% was frequently so bad that it more than cancelled out the benefit on the other side. Which is why no one uses Flash anymore [1].
[1] Everyone still uses Flash.
Further, technically speaking, the URL scheme has little to with the protocol used , it is merely a way of linking a hierarchical namespace to a spec (or more) that tells a developer how to resolve it. That means we have a lot of flexibility in terms of protocol (we don't even need a protocol defined in some cases - mailto: URIs for example).
Or you just run two servers (or a single server that speaks both), you know, like you'll have to for the next 30 years anyway.
> and would create a separate web with content that existing clients or intermediaries would be excluded from.
If you have an HTTP2-only site, aren't you doing that anyway?
> Much more evolvable to keep the wire protocol version orthogonal to URI.
> Further, the URL scheme has little to with the protocol used
That first part, before the colon, is a protocol descriptor. It would be perfectly reasonable to change the protocol descriptor.
What should have been done was use the Upgrade header (like websockets) or specify using SRV records.
As a counterexample, look at how long we've been working on IPv6. [1] We've been working on that for 20 years, and we're not even close.
And all that aside, URLs aren't primarily API. They're UI. You don't go messing with a UI that billions of people use without a strong reason to do so.
[1] http://www.ipv6.com/articles/general/timeline-of-ipv6.htm
The point is not that origin servers need to be upgraded, it's that clients and intermediaries should not be forced to upgrade. That means the actual content of the web (HTML pages) should not require revision to support the wire protocol upgrade, especially considering HTTP has an upgrade mechanism already built in.
There's almost no benefit that I can see to require a new scheme, and tremendous downside.
> That first part, before the colon, is a protocol descriptor. It would be perfectly reasonable to change the protocol descriptor.
Actually, if you look at the specs, the first part is a scheme identifier, not a protocol identifier. There's a big difference. Schemes point you here: http://www.iana.org/assignments/uri-schemes/uri-schemes.xhtm...
And then you look up the spec for how to interpret and/or resolve the rest of the URI. That may or may not involve a mapping to a wire protocol (e.g. the "about" scheme, or the "geo" scheme).
Granted, I think it was overall a poor decision to introduce that scheme prefix as well. It's just that, many arguments against a new scheme prefix also applied in that case, and many arguments for that new scheme prefix would apply in this case.