How does tcp sack work




















Monitoring Use Cases. Synthetic Monitoring. Monitor everything from development to production that can affect your end-user experience. Real User Monitoring. Resolve performance issues faster, optimize conversions, and make better business decisions. Network Insights. Get complete visibility of every network layer to detect and resolve issues quickly.

Endpoint Monitoring. Monitor your end-to-end employee experiences starting from their devices. Case Studies. Guide to Synthetic Monitoring. Guide to Network Admin. More specifically, for each block in the SACK option, the data sender will turn on the SACKed flags for all segments in the retransmission queue that are wholly contained within that block. This requires straightforward sequence number comparisons.

After the SACKed bit is turned on as the result of processing a received SACK option , the data sender will skip that segment during any later retransmission. The data sender MUST retransmit the segment at the left edge of the window after a retransmit timeout, whether or not the SACKed bit is on for that segment.

A segment will not be dequeued and its buffer freed until the left window edge is advanced over it. In particular, to preserve robustness in the presence of packets reordered by the network, recovery is not triggered by a single ACK reporting out-of- order packets at the receiver.

Further, during recovery the data sender limits the number of segments sent in response to each ACK. Existing implementations limit the data sender to sending one segment during Reno-style fast recovery, or to two segments during slow-start [ Jacobson88 ]. Other aspects of congestion control, such as reducing the congestion window in response to congestion, must similarly be preserved.

The use of time-outs as a fall-back mechanism for detecting dropped packets is unchanged by the SACK option. Future research into congestion control algorithms may take advantage of the additional information provided by SACK.

One such area for future research concerns modifications to TCP for a wireless or satellite environment where packet loss is not necessarily an indication of congestion. Every segment arriving while the data receiver holds discontinuous data would cause the data receiver to send an ACK with a SACK option containing the one altered block in the receiver's queue.

The data sender is thus able to construct a precise replica of the receiver's queue by taking the union of all the first SACK blocks. However, if all of the ACK packets reporting a particular SACK block are dropped, then the sender might assume that the data in that SACK block has not been received, and unnecessarily retransmit those segments.

The worst-case conditions necessary for the sender to needlessly retransmit data is discussed in more detail in a separate document [ Floyd96 ]. This issue is discussed in more detail in [ Floyd96 ]. Assume the left window edge is and that the data transmitter sends a burst of 8 segments, each containing data bytes. However, the second response packet is dropped somewhere on the network and never reaches the host. Let's walk through what happens. The client receives segment 3.

Upon examining the segment's sequence number, the client realizes this segment is out of order; there is data missing between the last segment received and this one. The client transmits a duplicate acknowledgment for packet 1 to alert the server that it has not received any reliable data beyond packet 1.

As the server is not yet aware that anything is wrong because it has not yet received the client's duplicate acknowledgment , it continues by sending segment 4. The client realizes that it is still missing data, and repeats its behavior in step three by sending another duplicate acknowledgment for packet 1. The server receives the client's first duplicate acknowledgment for packet 1. Because the client has only confirmed receipt of the first of the four segments, the server must retransmit all three remaining segments in the response.

You've probably noticed that this design is inefficient: although only packet 2 was lost, the server was required to retransmit packets 3 and 4 as well, because the client had no way to confirm that it had received those packets. SACKs work by appending to a duplicate acknowledgment packet a TCP option containing a range of noncontiguous data received.

In other words, it allows the client to say "I only have up to packet 1 in order, but I also have received packets 3 and 4". This allows the server to retransmit only the packet s that were not received by the client. Let's look at how our earlier example plays out with SACK enabled:. The client realizes it is missing a segment between segments 1 and 3.

It sends a duplicate acknowledgment for segment 1, and attaches a SACK option indicating that it has received segment 3. The client receives segment 4 and sends another duplicate acknowledgment for segment 1, but this time expands the SACK option to show that it has received segments 3 through 4.

From this, the server deduces that the client is missing segment 2, so segment 2 is retransmitted. The next SACK received by the server indicates that the client has also received segment 4 successfully, so no more segments need to be transmitted. The client receives segment 2 and sends an acknowledgment to indicate that it has received all data up to an including segment 4. This packet capture contains a demonstration of SACKs in action.

We know that both end hosts support selective acknowledgments by the presence of the SACK permitted option in the two SYN packets, 1 and 2. Toward the end of the capture, we can see that packet 30 was received out of order, and the client has sent a duplicate acknowledgment in packet This packet includes a SACK option indicating that the segment in packet 30 was received. Of course, the SACK option cannot simply specify which segment s were received. Rather, it specifies the left and right edges of data that has been received beyond the packet's acknowledgment number.

A single SACK option can specify multiple noncontiguous blocks of data e. We can see this duplicate acknowledgment repeated in packets 33, 35, and In each, the SACK is expanded to include the noncontiguous segments the server has continued sending. Finally, the server retransmits the missing segment in packet 38, and the client updates its acknowledgment number appropriately in packet Thanks again stretch - your first TCP post was on the day of a job interview, where I needed to understand this the company works in WAN acceleration products.

Sometimes it is not recommended to enable SACK feature, e. After a burst of loss, the throughput measured in their testbed is close to zero during 70 seconds. A timeout should occur after a few RTTs because one of the loss couldn't be repaired quickly enough and the sender should go back into slow start.

Most of these issues should have been fixed in Linux kernel 2. The following is closely based on a mail that Baruch Even sent to the pert-discuss mailing list on 25 Jan ' The Linux TCP SACK handling code has in the past been extremely inefficient - there were multiple passes on a linked list which holds all the sent packets.

This linked list on a large BDP link can span 20, packets. This meant multiple traversals of this list take longer than it takes for another packet to come.

There used to be an anti-DoS mechanism that would drop all packets until the queue had emptied - with a default of packets that took a long time and could easily drop all the outstanding ACKs resulting in a great degradation of performance.

This situation has been slightly improved in that though there is still a packet limit for the network queue, it acts as a normal buffer i.

Kernel 2. It is believed it has the fixes for all former major issues at least those fixes that were accepted to the kernel , but it should be noted that some other more minor bugs have appeared, and will need to be fixed in future releases.



0コメント

  • 1000 / 1000