Live data from Hacker News

TCP is harder than it looks

jsnell.iki.fi

31–40 of 66 posts

Re: TCP is harder than it looks

#31
What is the general lesson we should learn from this?

Postel's law aka robustness principle [1] can easily lead into accumulating complexity when implementations adapt to the bugs in other implementations. How could protocol designers mitigate this problem beforehand?

[1]: https://en.wikipedia.org/wiki/Robustness_principle

Re: TCP is harder than it looks

#32
post #31

What is the general lesson we should learn from this? Postel's law aka robustness principle [1] can easily lead into accumulating complexity when implementations adapt to the bugs in other implementations. How could protocol designers mitigate this problem beforehand? [1]: https://en.wikipedia.org/wiki/Robustness_principle

The lesson is "be strict in what you accept, since the beginning".

For instance, a lesson learned by the Linux kernel developers: when adding a new system call to an operating system, if you have a flags parameter (and you should, which is another lesson they learned), if any unknown flag is set, fail with -EINVAL (or equivalent). Otherwise, buggy programs will depend on these flags being ignored, and you won't be able to use them later for new features.

But it has to be since the beginning; once the protocol is "in the field", you can't increase the strictness without pain.

Re: TCP is harder than it looks

#33
post #7

This reminded me of the best TCP timeout story I've ever heard, the case of the 500-mile email: http://www.ibiblio.org/harris/500milemail.html

Great story with the added bonus of showing me the GNU Units command. What a fantastic program, no more Googling when I need to convert stuff.

Take a look at qalculator. You won't even remember about Units after it.

Re: TCP is harder than it looks

#34

Earlier quoted context omitted.

Great story with the added bonus of showing me the GNU Units command. What a fantastic program, no more Googling when I need to convert stuff.

Indeed, I just checked OSX - sadly, units doesn't know about millilightseconds ("586 units, 56 prefixes").

GNU Units (available in Homebrew) is much more complete than the OS X version.

Re: TCP is harder than it looks

#35
post #7

This reminded me of the best TCP timeout story I've ever heard, the case of the 500-mile email: http://www.ibiblio.org/harris/500milemail.html

Great story with the added bonus of showing me the GNU Units command. What a fantastic program, no more Googling when I need to convert stuff.

Also good: http://futureboy.us/frinkdocs/

Re: TCP is harder than it looks

#36
post #34

Earlier quoted context omitted.

Indeed, I just checked OSX - sadly, units doesn't know about millilightseconds ("586 units, 56 prefixes").

GNU Units (available in Homebrew) is much more complete than the OS X version.

Much better: "2562 units, 85 prefixes, 66 nonlinear units"

Since it took me a moment to figure it out, heres how to install it:

brew install gnu-units

then run as: gunits

So it lives happily besides the default units command.

Re: TCP is harder than it looks

#37
post #32
post #31

What is the general lesson we should learn from this? Postel's law aka robustness principle [1] can easily lead into accumulating complexity when implementations adapt to the bugs in other implementations. How could protocol designers mitigate this problem beforehand? [1]: https://en.wikipedia.org/wiki/Robustness_principle

The lesson is "be strict in what you accept, since the beginning". For instance, a lesson learned by the Linux kernel developers: when adding a new system call to an operating system, if you have a flags parameter (and you should, which is another lesson they learned), if any unknown flag is set, fail with -EINVAL (or equivalent). Otherwise, buggy programs will depend on these flags being ignored, and you won't be ab…

Otherwise, buggy programs will depend on these flags being ignored, and you won't be able to use them later for new features.

I don't understand why that's true. Just add the new flag and use it for your new feature. Aren't buggy programs who were already sending the flag responsible for their own bugs?

Re: TCP is harder than it looks

#38
post #34

Earlier quoted context omitted.

Indeed, I just checked OSX - sadly, units doesn't know about millilightseconds ("586 units, 56 prefixes").

GNU Units (available in Homebrew) is much more complete than the OS X version.

It still won't let me convert 'bytes / square mm' to my prefered data density format, 'libraries of congress / football field'. So it needs work.

Re: TCP is harder than it looks

#39
post #32

Earlier quoted context omitted.

The lesson is "be strict in what you accept, since the beginning". For instance, a lesson learned by the Linux kernel developers: when adding a new system call to an operating system, if you have a flags parameter (and you should, which is another lesson they learned), if any unknown flag is set, fail with -EINVAL (or equivalent). Otherwise, buggy programs will depend on these flags being ignored, and you won't be ab…

Otherwise, buggy programs will depend on these flags being ignored, and you won't be able to use them later for new features. I don't understand why that's true. Just add the new flag and use it for your new feature. Aren't buggy programs who were already sending the flag responsible for their own bugs?

Yes and no. If you push an update and sysadmins all over the world dutifully upgrade and immediately notice programs breaking, their first thought is not going to be "oh, those programs must have had latent bugs." No, they're going to blame you. Besides, having stuff work correctly is always more fun than assigning blame, and validating flags is an easy way to avoid these scenarios.

Re: TCP is harder than it looks

#40
post #32

Earlier quoted context omitted.

The lesson is "be strict in what you accept, since the beginning". For instance, a lesson learned by the Linux kernel developers: when adding a new system call to an operating system, if you have a flags parameter (and you should, which is another lesson they learned), if any unknown flag is set, fail with -EINVAL (or equivalent). Otherwise, buggy programs will depend on these flags being ignored, and you won't be ab…

Otherwise, buggy programs will depend on these flags being ignored, and you won't be able to use them later for new features. I don't understand why that's true. Just add the new flag and use it for your new feature. Aren't buggy programs who were already sending the flag responsible for their own bugs?

Aren't buggy programs who were already sending the flag responsible for their own bugs?

When the kernel breaks userspace, it's a kernel bug. It's a philosophy for system robustness that the kernel has and other operating systems tend to adopt as well. As you get higher up the stack into 3rd party libraries and other programming tools the maintainers often take a more cavalier approach to maintaining compatibility.

Post reply on HN