Robustness principle

From Wikipedia, the free encyclopedia
  (Redirected from Robustness Principle)
Jump to navigation Jump to search

In computing, the robustness principle is a design guideline for software:

Be conservative in what you do, be liberal in what you accept from others (often reworded as "Be conservative in what you send, be liberal in what you accept").

The principle is also known as Postel's law, after Jon Postel, who wrote in an early specification of TCP:[1]

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

In other words, programs that send messages to other machines (or to other programs on the same machine) should conform completely to the specifications, but programs that receive messages should accept non-conformant input as long as the meaning is clear.

Among programmers, to produce compatible functions, the principle is popularized[citation needed] in the form be contravariant in the input type and covariant in the output type.

Interpretation[edit]

RFC 1122 (1989) expanded on Postel's principle by recommending that programmers "assume that the network is filled with malevolent entities that will send in packets designed to have the worst possible effect".[2] Protocols should allow for the addition of new codes for existing fields in future versions of protocols by accepting messages with unknown codes (possibly logging them). Programmers should avoid sending messages with "legal but obscure protocol features" that might expose deficiencies in receivers, and design their code "not just to survive other misbehaving hosts, but also to cooperate to limit the amount of disruption such hosts can cause to the shared communication facility".[3]

Criticism[edit]

In 2001, Marshall Rose characterized several deployment problems when applying Postel's principle in the design of a new application protocol.[4] For example, a defective implementation that sends non-conforming messages might be used only with implementations that tolerate those deviations from the specification until, possibly several years later, it is connected with a less tolerant application that rejects its messages. In such a situation, identifying the problem is often difficult, and deploying a solution can be costly. Rose therefore recommended "explicit consistency checks in a protocol ... even if they impose implementation overhead".

In an Internet-Draft of 2017, Martin Thomson argues that Postel's robustness principle actually leads to a lack of robustness, including security.[5]

In a published paper to the annual Privacy Enhancing Technologies Symposium (PETS)[6], Florentin Rochet and Olivier Pereira show how to exploit Postel's robustness principle inside the Tor routing protocol to compromise the anonymity of onion services and Tor clients.[7]

References[edit]

External links[edit]