Live data from Hacker News

The 7-bit Internet

blog.tabini.ca

91–100 of 162 posts

Re: The 7-bit Internet

#91
post #20

For some reason, I feel as though the people in this thread against text-based protocols have never used telnet to inspect or debug an HTTP request/response. Or used telnet to help develop a client for something like memcached. The ease of discoverability of a protocol should not be underrated.

I've written a couple parsers and stacks for SIP, a HTTP-derived protocol.

The text-based aspect isn't bad in and of itself. It's the crazy moronic rules and pointlessly flexible syntax that makes it bad. It's the fact that "text-based" is often taken to mean "should allow humans to be flexible in writing it", instead of "uses ASCII". Oh, and UTF8 if you're lucky. If you dare want a non-ASCII value that needs to go into a header, you're toast.

HTTP: Comments inside headers, line folding, context-sensitive header value parsing, and on and on. There is zero legitimate need for these things, yet RFC writers cannot seem to help themselves and design the most complicated syntax as possible.

Text-based formats frequently trick people into thinking they're right because it looks easy on the surface to get something to work. Shit, most HTTP clients/servers aren't actually fully compliant.

It opens more possibility for security holes due to potentially ambiguous parsing (where one implementation misses an edge case, but another doesn't). Protocols are not programming languages. They don't need flexible syntax.

There's also crap left over from a time when people read/write these protocols by hand. Idiocy like the IETF preferred date formats "Sun, 06 Nov 1994". Really? Including "Sun", the English 3-letter abbreviation, in a protocol? How is that useful?

HTTP is being used more and more for high-performance work. Take a look at a high-perf text-based parser, and you see all sorts of ugly hacks. Like doing bitwise comparisons on word-sized integers to determine the request method. (Both my personal code and nginx ended up with similar solutions, so it's safe to say it's a common approach for perf.)

Having a proper binary format that can be quickly, unambiguously, and safely parsed is a huge boon for interoperability and performance. The slight detriment for analyzing raw bytes (which, when encrypted makes it all moot) is not worth it. For a popular protocol like HTTP, you're gonna have plenty of tools to properly parse and analyze.

IP, UDP and TCP aren't text based, and I have no problems regularly analyzing them, nor do they seem to have adoption issues. But you can bet your ass if UDP specified port numbers as a flexible text field, you'd find all sorts of fun bugs and implementation issues.

Edit: After skimming the HTTP 2.0 spec, implementing this as a text-based protocol sounds like a nightmare with no benefit. It's not like you're going to write multiple streams out by hand or something (and use some terrible multipart-mime approach, or another "fun" ASCII-delimiting-binary thing).

Re: The 7-bit Internet

#92
post #20

For some reason, I feel as though the people in this thread against text-based protocols have never used telnet to inspect or debug an HTTP request/response. Or used telnet to help develop a client for something like memcached. The ease of discoverability of a protocol should not be underrated.

What do you expect from a group that thinks trans-compiling C++ to JavaScript is a good idea...

Re: The 7-bit Internet

#93
post #20

For some reason, I feel as though the people in this thread against text-based protocols have never used telnet to inspect or debug an HTTP request/response. Or used telnet to help develop a client for something like memcached. The ease of discoverability of a protocol should not be underrated.

I've written a couple parsers and stacks for SIP, a HTTP-derived protocol. The text-based aspect isn't bad in and of itself. It's the crazy moronic rules and pointlessly flexible syntax that makes it bad. It's the fact that "text-based" is often taken to mean "should allow humans to be flexible in writing it", instead of "uses ASCII". Oh, and UTF8 if you're lucky. If you dare want a non-ASCII value that needs to go i…

> Protocols are not programming languages. They don't need flexible syntax.

Or, as the langsec crowd claims, protocols don't need flexible syntax, lest they actually become programming languages.

Re: The 7-bit Internet

#94
post #64
post #47

Earlier quoted context omitted.

Well actually, your assembly example is a good one because C#, Go and a bunch of other similar languages all have refractor information compiled into the output binary because debugging machine code is a pig (even with assembly mnemonics). So even the average developer enjoys the luxury of wasted information in modern specifications.

My point was that a average programmer does not understand a thing about assembly languages, because they are abstracted away by well working implementations of compilers and debuggers. I live under an assumption that such is also the case with HTTP, or at least should be, because for me it seems that a protocol as simple as HTTP would be abstracted away ages ago by libraries and implementations.

Plain text HTTP (and all the other ASCII-based networking protocols) is already a layer of abstraction on top of TCP/IP data packets. So a better comparison would be HTTP as the higher level programming language and the raw TCP/IP packets as the assembly. In which case we're back to the point that developers would care if they had to write websites in binary.

The problem with many web developers these days is that they don't understand or don't care about the networking side of things. Web development is such a high level view of programming that many developers who've only grown up with targeting the web, those kinds of developers don't also appreciate just how many layers of abstraction there are between them and the users navigating their site. As far as they're concerned, they just bang out some PHP, copy the files onto some shared hosting provider and let the sys admins worry about the rest. Which is fine if that's all they want to do, but there's a whole plethora of technology at work - even beneath the HTTP protocol.

As for tools to query HTTP, I swear by curl:

    curl -i --silent example.com | head    # http headers (written by web app)
    curl -I example.com                    # http headers (written by web daemon)
    curl -v --silent example.com | more    # verbose output; great for tracking down faults
    curl -H "host:example.com" ip.address  # set the host header; useful when using named based virtual hosts
    curl -A "opera mobile" example.com     # sets the user agent; useful for working around mobile / desktop redirects
...etc. Rarely does a day go by and I'm not using curl.

Re: The 7-bit Internet

#95
post #20

For some reason, I feel as though the people in this thread against text-based protocols have never used telnet to inspect or debug an HTTP request/response. Or used telnet to help develop a client for something like memcached. The ease of discoverability of a protocol should not be underrated.

I agree. Much of that attitude is also pompous.

Engineering should be about taking complex things and making them simple and easy (the best engineers do this), on the other hand you have engineers that try to add complexity because they understand something and over engineer it to obscure it on some premature optimization or cool factor. Taking something simple and making it more complex is the epitome of bad engineering.

Cool is useful and useful is simple or at least simple parts. Keep entry to technology simple, just like good games are simple to start, deeper in it gets more difficult. The door should be easy to enter even though the labyrinth might be immense.

Re: The 7-bit Internet

#97
post #4

I don't understand why SPDY / HTTP 2.0 is being framed as "fitting the needs of a few major players". Google is not the only one who benefits from reduced latency, fast page loads, efficient use of SSL sessions, and server pushed resources. If anything, the people who benefit the most are those who _can't_ afford massive forward deployed CDN networks, large servers, and fat network pipes.

The mind-bending complexity of the proposed HTTP 2.0 does very little to gain the little guy, or a young generation exploring the web: in fact it shuts them out. If the internet should have taught us one thing so far, it is that it's the open technologies which are built to be easy to understand and explore for humans which have driven the net forward. HTTP 2.0 is massive step backwards in that respect, and the only…

HTTP 2.0 is going to happen whether we complain about it here or not.

While we can certainly wait and see whether people will balk and make changes, the only true way to stop it is to replace it.

If you can write a better set of protocols that meet the requirements, do it. If you can't then work with or support those that will.

Re: The 7-bit Internet

#98
post #90
post #57

Earlier quoted context omitted.

You've never needed a basic TCP test without installing wget/nmap/etc? Most operating systems and hardware devices have telnet available for this kind of low-level troubleshooting. You've never needed to test an SMTP connection to see what the rejection message was on the remote server (when a user can't get you the bounced message you require)? You never wanted to see if an SSH port was open and what version was run…

When its easier to write tools, tools are more plentiful. Same binary protocols make it an afternoon's work to implement most protocols, and even less time if all you want to do is open up a socket and send some EHLOs. Text protocols, on the other hand, require writing a parser, dealing with encoding back and forth between string representations and binary data, handling line delimiters, etc. I'll take binary protoco…

It sounds like your argument is a preference for a pre-written parser library over having to write the parser yourself. Yeah, sure, no one would disagree with that for day to day use. It's when you don't have the pre-written library available that a text-only protocol will save your day.

Re: The 7-bit Internet

#99
post #86

Earlier quoted context omitted.

It's not just the binary. It's that HTTP 2 is hugely more complex. Excessive complexity is a general engineering smell. It can't be all that difficult to implement a protocol for applying a few verbs to URIs. Complex + non-discoverable = bad engineering

HTTP is already painfully complex to implement correctly. It's also a terribly wasteful and poor engineered protocol for anything other than fetching documents.

> It's also a terribly wasteful and poor engineered protocol for anything other than fetching documents.

I wonder if that was the original purpose of the protocol;)

Re: The 7-bit Internet

#100
post #20

For some reason, I feel as though the people in this thread against text-based protocols have never used telnet to inspect or debug an HTTP request/response. Or used telnet to help develop a client for something like memcached. The ease of discoverability of a protocol should not be underrated.

I've written a couple parsers and stacks for SIP, a HTTP-derived protocol. The text-based aspect isn't bad in and of itself. It's the crazy moronic rules and pointlessly flexible syntax that makes it bad. It's the fact that "text-based" is often taken to mean "should allow humans to be flexible in writing it", instead of "uses ASCII". Oh, and UTF8 if you're lucky. If you dare want a non-ASCII value that needs to go i…

What, exactly, prevents a binary protocol definition from being overly flexible and complex? I've seen quite a few like that, and I've seen quite a few simple and easy to parse text protocols.
Post reply on HN