Temporal Blog 09月30日
端到端设计原则解析
index_new5.html
../../../zaker_core/zaker_tpl_static/wap/tpl_guoji1.html

 

端到端设计原则由Saltzer、Reed和Clark在1984年提出,主张某些功能只能完全正确地在应用层实现,平台层无法做到。该原则基于应用层拥有完整信息而平台层只有部分信息,因此平台层缺乏上下文。文章以可靠文件传输为例,说明平台层只能检测和缓解传输失败(如重传数据块),而应用层才能检测和缓解组装失败(如重传整个文件),并最终确定传输成功与否。该原则是系统设计的指导方针,但应用需根据具体需求分析确定功能归属。

📚 端到端设计原则的核心观点是:某些功能(如完整性和正确性)只能在应用层实现,因为应用层拥有完整信息,而平台层只有部分信息,缺乏上下文。这意味着平台层无法完全正确地实现这些功能,即使它能部分实现或重复功能也仅作为优化。

📈 以可靠文件传输为例:平台层可以通过校验和检测数据块传输失败,并通过重传数据块来缓解失败。然而,平台层无法检测文件组装失败(如文件损坏或缺失部分),这需要应用层通过校验和检测文件完整性,并决定是否重传整个文件。最终,只有应用层能判断文件传输是否成功。

🔄 该原则强调平台层的优化作用:虽然某些核心功能(如文件传输的完整性和正确性)必须由应用层负责,但平台层可以提供部分实现或重复功能作为优化,例如通过重传数据块来提高性能。这种优化利用了平台层功能的成熟性和稳定性,弥补应用层的不足。

🔍 该原则是系统设计的指导方针,但应用时需根据具体需求进行细致分析。例如,确定哪些功能应完全由应用层实现,哪些可以作为平台层的优化。以可靠文件传输为例,平台层的重传机制是性能优化,而应用层的完整性检查是确保正确性的关键。

J. H. Saltzer, D. P. Reed, and D. D. Clark. 1984. End-to-end arguments in system design. ACM Transactions on Computer Systems 2, 4 (Nov. 1984), 277–288.

Key Words Function, Completeness, Correctness, Application Layer, Platform Layer, Failure, Failure Detection, Failure Mitigation.

In their 1984 paper End-to-End Arguments in System Design, Saltzer, Reed, and Clark present a design principle that helps guide placement of functions among the modules of a distributed system. In his paper, the term functions refers to functionality, not a particular function definition in a programming language. Similarly, the term modules refers to layers, not a particular organizational construct in a programming language.

Saltzer, Reed, and Clark assume a layered architectural style. The basic idea of a layered architecture is simple: components are arranged in a layered fashion where components at layer Lₙ can make a downcall to components at layer Lₘ (n < m), generally expecting a response. Exceptionally, components at layer Lₘ can make an upcall to components at layer Lₙ, generally via a previously registered callback.

For this blog post, we limit our discussion to two layers, we will refer to the top layer as the application layer and the lower layer as the platform layer.

The End-to-End Argument#

The End-to-End Argument states that some functions may “completely and correctly be implemented only” on an application level, implementing said functions completely and correctly on a platform level is not possible. This impossibility is rooted in the fact that the application layer has total information, the platform layer may only have partial information - informally, the platform layer lacks context.

However, the End-to-End Argument does not preclude to provide a partial, incomplete implementation of a function or to duplicate a function on a platform level, not for completeness and correctness but strictly as an optimization.

In addition, the paper stresses that the End-to-End Argument is a guideline that helps in application and platform design analysis; however, identifying the endpoints to which the argument should be applied requires subtlety of analysis of application requirements.

Example#

The significance of the End-to-End Argument is most apparent when reasoning about layers and failures: Is a layer able to detect a failure? If a layer is able to detect a failure, what should that layer do? Should the layer mitigate the failure? Should the layer present the failure to the next higher layer?

Reliable File Transfer#

The paper discusses several examples, however this blog posts limits itself to discussing one example: Reliable File Transfer.

The object is to move a file from computer A’s storage to computer B’s storage without damage. A popular implementation to transfer a file is to transfer the file in chunks:

    On the sender side, the application layer splits the data into chunks before handing each chunk downwards to the platform layer for transfer.

    On the receiver side, the platform layer receives a chunk before handing the chunk upwards to the application layer for assembly.

    So now the question arises, can you implement file transfer completely and correctly by limiting failure detection and failure mitigation to the platform layer or do you need failure detection and failure mitigation (also) on the application layer?

    Failure Detection and Mitigation#

    While the platform layer may indeed detect transmission failures of a chunks via checksums on chunks and mitigate failures via retransmissions of chunks, only the application layer may detect assembly failures on files via checksums on files and mitigate failures via retransmission of files.

    Failure Presentation#

    While the platform layer may indeed try to mitigate transmission failures via retransmissions, eventually, in order to avoid an infinite loop, the platform level has to present repeated transmission failures to the application level.

    In summary, although the platform layer implements partial failure detection and mitigation, ultimately only the application layer is able to implement total failure detection and mitigation - only the application layer may determine if a file transfer was a success, was a failure, and how to handle that failure.

    Conclusion#

    The End-to-End Argument states that some functions may "completely and correctly be implemented only" on an application level, even though the End-to-End Argument does not preclude partially implementing functions on a platform level as an optimization.

    For example, failure detection and mitigation of a file transfer can (and should) happen on an application level and a platform level but only the application layer can ensure completeness and correctness of the transfer.

    Types of Optimization#

      Performance. If the application layer detects a failure in the transmission of the file, the application layer may mitigate that failure by retransmitting the file. However, if the platform layer detects a failure in the transmission of a chunk, the platform layer may mitigate that failure by retransmitting only the chunk. We may be able to avoid retransmitting the file if retransmission of the chunk is successful. Maturity. Even though some functions may completely and correctly be implemented only on the application layer, duplicating functionality on the platform layer may aid correctness; some functions are complex and therefore error prone, encapsulating these functions in the platform layer enables us to take advantage of their maturity and “fill in the gap” of these functions in the application layer

Fish AI Reader

Fish AI Reader

AI辅助创作,多种专业模板,深度分析,高质量内容生成。从观点提取到深度思考,FishAI为您提供全方位的创作支持。新版本引入自定义参数,让您的创作更加个性化和精准。

FishAI

FishAI

鱼阅,AI 时代的下一个智能信息助手,助你摆脱信息焦虑

联系邮箱 441953276@qq.com

相关标签

端到端设计原则 系统设计 应用层 平台层 可靠文件传输 End-to-End Argument System Design Application Layer Platform Layer Reliable File Transfer
相关文章