What is TCP window?

Source: Internet
Author: User

TCP window may be the most important part of the data transmission process to be understood, especially for data centers, because the backup work is performed every day. in today's data centers, high-bandwidth high availability and high-speed connection make applications availableProgramThe several g throughput between the server and the backup server has become easier. As the Wan (Wide Area Network) connection increases, it is faster and more efficient. End users can access more throughput than previously.

 

With the availability of all these cutting-edge technologies, many people do not know why applications still look so slow. it may take many hours to even use a 10 Gb backup connection. one of the many reasons for the latency of data migration applications is TCP window. some applications are still using the old TCP stack, which was written for the network in 1980s. At that time, the 2400bps dial-up connection still seemed fast. some of today's applications ignore the impact of TCP windows in the data transfer process. network engineers may skip the transmission layer when troubleshooting backup slowness and application latency. in this articleArticleWe will clearly define the TCP window to see how it affects performance and how to monitor it using Wireshark.

 

What is a TCP window?

When discussing TCP window, we almost always refer to TCP receive window. to put it simply, the TCP receive window is a buffer at both ends of the TCP connection. It is used to temporarily save incoming data. data in this buffer zone will be sent to the application to free up space for the new data. if the buffer is full, the receiver will warn the sender that more data cannot be collected before the buffer is cleared. this involves some details, but it is very basic. generally, the device notifies the recipient of the current tcpwindows size in the TCP header information.

 

In the screenshot above, the sender of this package tells the other end of the connection that its TCP receive buffer is 65535 bytes. this is the maximum size of the standard TCP window. the option in TCP can be that the value is greater, but now we think this is the maximum value.

 

Any segment of the TCP connection has its own TCP receive window. therefore, the sizes of the two windows may be different at any time. for example, a Web server usually sends data to users instead of obtaining data from users. for this reason, the web server does not need a TCP window as large as a common user. therefore, the web server will tell it that the receive window is 8192 bytes, while the client's window is 65535 bytes.

 

How does TCP Window affect performance?

Data is transferred from one machine to another during file transmission. the data receiver needs to prevent its TCP window from dropping to 0, which means the window is full. if a TCP window changes to 0 or is close to 0, this will warn the data sender that there is no more space to accept more data. the file transfer stops until an update is received, indicating that the buffer has been cleared.

 

In the original example file, there is a TCP window that keeps falling and finally terminates the file transfer packet.

 

If this happens, and the application has used the maximum size of the window, and it is not enough, there is nothing to do from the perspective of analysis.CodeModify.

The TCP window is based on connections. That is, if other TCP connections between the two machines are in progress, the interrupted window of one connection will not stop other connections. therefore, in multi-threaded applications, data can still be transmitted over other connections when a connection is being recovered.

 

The following paragraph will not be translated. If you are interested or need it, you can check it yourself.

==========================================================

Using Wireshark, how can I monitor the TCP window?

During large file transfers, keep an eye on the TCP window being advertised in the tcp ack packets of the specified er. there are a few ways to do this with Wireshark. by default, the TCP window ofPacketSender is displayed in the info summary view for each ACK packet.

Another way to show this is by using the I/O graphs looking for the TCP window size to drop. to do this, use the TCP. analysis. window_update filter. try it with the sample trace file using these settings.

This graph shows the full size TCP Window dropping to nothing several times. while the window is down near zero, data is halted while the sender waits for the receive buffer to clear. watch for these dips during large data transfers. the I/O graph makes them easier to see than combing through packet by packet!

 

References

========================

Practical TCP series-the TCP window (by Chris Greer)

Http://www.lovemytool.com/blog/2010/07/practical-tcp-series-the-tcp-window-by-chris-greer.html

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.