Postelの法則

Postel の法則

[3] ポステルの法則 (Postel's Law) (Robustness Principle) は、インターネットプロトコルの実装に関する大原則です。 受信に関してはより柔軟に、緩めの解釈を求め、 送信に関してはより正確に、厳密な仕様の順守を求めています。

[20] インターネット開発者であり本原則を確立した Jon Postel に因んでいます。

由来

[4]

Be liberal in what you accept, and conservative in what you send

[7]

In general, an implementation must be conservative in its sending behavior, and liberal in its receiving behavior.

[1]

TCP implementations will follow a general principle of robustness: be conservative in what you do, be liberal in what you accept from others.

文脈

[19] インターネットの多くのプロトコルの設計の基本原則となっています。

批判

[11] ポステルの法則に従った実装と、そのような実装の存在に依存して正確な送信を行わない実装が混在する場合、 次第に元々の厳密な仕様の範囲外であっても、正確な送信を行わない実装との相互運用性のために特定の受信動作が求められるようになってしまいます (バグ互換性)。

[12] 大抵はおおむね相互運用性が保たれているとみなされ放置されるので、 明文化されない暗黙の仕様が生じ、新規参入が困難になったり、 仕様の拡張に支障が生じたりします。

[13] これをポステルの法則の失敗とみなして draconian な受信動作が望ましいと考える人もいます。

[14] あるいはポステルの法則の精神に従いつつ、受信動作をも厳密に仕様の一部として規定するべきと考える人もいます。

[16] HTMLの構文解析は、元々ほとんど規定と言えるものがありませんでした。 90年代、著者は好き勝手な HTML文書を量産し、 Webブラウザーはどんな入力にもおおらかにできるだけ著者の意図 (と推測されるもの) に沿って処理するようかなりの力を注いでいました。

[17] 結果として世間で流通する HTML文書の解釈には明文化されていない相当量の複雑難解なバッドノウハウの蓄積が必要となり、 新規参入を著しく阻害していました。

[18] HTML5 (現在の HTML Standard) はこの状況を改善するため、 既存のWebブラウザーの動作と膨大なHTML文書の調査を経て、 HTML構文解析器の動作を完全に文書化しました。

[26] 失敗事例: URL parser

関連

[5] 日本では、しばしば標語人に優しく、自分に厳しく」で表現されます。

メモ

[2] IRC logs: freenode / #whatwg / 20100629 ( 版) http://krijnhoetmer.nl/irc-logs/whatwg/20100629#l-193

[6] RFC 1958 - Architectural Principles of the Internet ( ( 版)) http://tools.ietf.org/html/rfc1958#page-5

[8] RFC 5537 - Netnews Architecture and Protocols ( 版) http://tools.ietf.org/html/rfc5537#section-3.1

[9] draft-thomson-postel-was-wrong-00 - The Harmful Consequences of Postel's Maxim ( 版) https://tools.ietf.org/html/draft-thomson-postel-was-wrong-00

[10] The Robustness Principle Reconsidered | August 2011 | Communications of the ACM (Eric Allman 著, 版) http://cacm.acm.org/magazines/2011/8/114933-the-robustness-principle-reconsidered/fulltext

[15] Users, clients, and servers — Anne’s Blog () https://annevankesteren.nl/2016/05/client-server

[21] RFC 4648 - The Base16, Base32, and Base64 Data Encodings () https://tools.ietf.org/html/rfc4648#section-3.3

[22] martinthomson/postel-was-wrong: Tolerance is a bug () https://github.com/martinthomson/postel-was-wrong

[23] The Harmful Consequences of the Robustness Principle () https://martinthomson.github.io/postel-was-wrong/draft-thomson-postel-was-wrong.html

[24] The Harmful Consequences of the Robustness Principle () https://intarchboard.github.io/protocol-maintenance/draft-iab-protocol-maintenance.html

[25] intarchboard/protocol-maintenance: Don't apply the robustness principle, look after your protocol instead () https://github.com/intarchboard/protocol-maintenance