当前位置:网站首页>Capturing packets to find repeated acks and a large number of TCP retransmissions in TCP sessions -- sack (selective acknowledgement) technology

Capturing packets to find repeated acks and a large number of TCP retransmissions in TCP sessions -- sack (selective acknowledgement) technology

2022-06-23 07:56:00 Time cool spring shirt thin

Studying recently wireshark  See a useful knowledge point , There is always a problem between my ECs and my client tcp Retransmission problem , And the quantity is quite large , And the bandwidth is large enough, so there seems to be no abnormal situation in the service , But with the gradual increase of business flow , Gradually, the problem became obvious , The card is slow , adopt wireshark When grabbing the bag, I found , The sequence of packets in a file transfer session is a bit out of order , Generally, the client sends continuously 1,2,3,4,5,6,7,8 Packets arrive at the server in the same order 1,2,3,4,5,6,7,8. However, due to the uncertainty of the public network, there may be network congestion and so on , Therefore, the data packets will be out of order, and the order of data packets received by the server may be 1,3,2,4,5,7,6,8 In this case, the packets will be disordered , If the sequence of packets is continuous 3 More than ( for example :1,6,4,8,2,3,7,5) In this case, the server will tell the client that I haven't received it normally 2 Package No. returned by the server ack It will be sent many times , The client sees so many ack Are urging me to send 2 A good bag will think that this bag is lost , Then the client will generate tcp The retransmission mechanism . But in fact, the server can confirm that the packets have been received after waiting a little longer , This eliminates the need for the client to retransmit . In this case, the problem is not obvious when the traffic is small , But when there are several people or a very large packet of data , The situation is not so optimistic , a large number of tcp Retransmission will lead to the waste of your network resources ....

      So how to solve this problem ?

      answer :SACK(Selective Acknowledgment, Selective confirmation ) technology

 

TCP_sack Turn on

#vim /etc/sysctl.conf
net.ipv4.tcp_sack = 1
#sysctl -p

SACK(Selective Acknowledgment, Selective confirmation ) technology , send TCP Only resend lost packets , Do not send all subsequent packets , And provide corresponding mechanism to enable the receiver to tell the sender which data is lost , What data has been retransmitted , Which numbers It has been received in advance .

原网站

版权声明
本文为[Time cool spring shirt thin]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/174/202206230718356640.html