'the impact of sending large data using tcp protocol

can someone explain why a TCP sender might automatically slow down when sending a large file? I understand that one reason could be the increased packet volume from the large data file, which would increase wait time and increase ACKS.

I was thinking that a second reason could be that the data caused a timeout, and following a timeout the cwnd is set to 1. If this second explanation is wrong could someone explain another reason for me?



Solution 1:[1]

The high level answer is that there is a saturation effect.

The most likely low level cause of this would be that the receiver, via the TCP protocol, is indicating its Receive Queue (Recv-Q) is full. This typically happens when the Userspace application is not ingesting the data as fast as it is being sent. This causes a traffic jam on the sender's Send Queue (Send-Q) as well. Both of these queues/buffers are in the operating system and can be examined with netstat or the more modern ss commands. The more exact ss command would look like: ss -tn state established.

That being said other saturation effects are possible. If there is a throughput bottleneck somewhere, and you could be contesting with other application for throughput. The longer you hog the channel the higher the chance of contention. This would likely show in a high Send-Q but a low Recv-Q.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1