TCP协议中的Push标志位

原:

The push flag tells the receiving end of the tcp connection to "push" all buffered data to the receiving application. It basically says "done for now".

译:

Push标志位通知TCP连接的接收方, 让它把所有缓存的数据给"push"到接收端的应用程序里去. 这个flag的意思基本上就是"传好了, 现在, 让你的应用程序先处理一下我传来的这些数据吧".

 

更多:

The Push flag, like the Urgent flag, exists to ensure that the data is given the priority (that it deserves) and is processed at the sending or receiving end. This particular flag is used quite frequently at the beginning and end of a data transfer, affecting the way the data is handled at both ends.

 

When a host sends its data, it is temporarily queued in the TCP buffer, a special area in the memory, until the segment has reached a certain size and is then sent to the receiver. This design guarantees that the data transfer is as efficient as possible, without waisting time and bandwidth by creating multiple segments, but combining them into one or more larger ones.

 

When the segment arrives at the receiving end, it is placed in the TCP incoming buffer before it is passed onto the application layer. The data queued in the incoming buffer will remain there until the other segments arrive and, once this is complete, the data is passed to the application layer that's waiting for it.

While this procedure works well in most cases, there are a lot of instances where this 'queueing' of data is undesirable because any delay during queuing can cause problems to the waiting application. A simple example would be a TCP stream, e.g real player, where data must be sent and processed (by the receiver) immediately to ensure a smooth stream without any cut offs.

 

A final point to mention here is that the Push flag is usually set on the last segment of a file to prevent buffer deadlocks. It is also seen when used to send HTTP or other types of requests through a proxy - ensuring the request is handled appropriately and effectively.

 

资料来源:

The TCP Datagram

http://www.daemon.org/tcp.html 

TCP Analysis - Section 4:TCP Flag Options

http://www.firewall.cx/tcp-analysis-section-4.php

posted on 2010-10-04 13:12  中道学友  阅读(6208)  评论(0编辑  收藏  举报

导航

技术追求准确,态度积极向上