nuttx-mirror/net/tcp
meijian d1786507b6 net/tcp_timer: fix tcp RTO abnormally large after retransmission occurs
when tcp retransmission only double conn->timer in Karn(tcp_timer.c L602), after retransmission in Jacobson
M is is now rtt test will become a negative value.
```
  signed char m;
  m = conn->rto - conn->timer; // M is now rtt test

  /* This is taken directly from VJs original code in his paper */

  m = m - (conn->sa >> 3);
  conn->sa += m;              //conn->sa is a negative value
  if (m < 0)
	{
	  m = -m;
	}

  m = m - (conn->sv >> 2);
  conn->sv += m;
  conn->rto = (conn->sa >> 3) + conn->sv; //rto
```
For example,we lost one ack packet, we will set conn->timer = 6 by backoff,conn->rto still 3.
After retransmission we will Do RTT estimation, then will get
```
conn->sa = 253
conn->rto = 46
```
Then if any packets lost it will wait for a long time before triggering a retransmission.

Test method.
We can reproduce this issue by adding drop ACK packets in tcp_input, and debug conn->rto after Jacobson.

Signed-off-by: meijian <meijian@xiaomi.com>
2024-12-10 22:00:55 +08:00
..
CMakeLists.txt net: migrate to SPDX identifier 2024-09-12 01:08:11 +08:00
Kconfig tcp:set NET_TCP_NPOLLWAITERS default value to 2 & add warning of different events having same event bit 2024-11-03 02:55:02 +08:00
Make.defs net: migrate to SPDX identifier 2024-09-12 01:08:11 +08:00
tcp.h net: Move NET_TCP/UDP_HAVE_STACK to netconfig.h 2024-11-21 23:07:30 +08:00
tcp_accept.c net: migrate to SPDX identifier 2024-09-12 01:08:11 +08:00
tcp_appsend.c net: migrate to SPDX identifier 2024-09-12 01:08:11 +08:00
tcp_backlog.c net: migrate to SPDX identifier 2024-09-12 01:08:11 +08:00
tcp_callback.c tcp/tls: fix tcp tls bugs 2024-11-21 00:23:01 +08:00
tcp_cc.c net: migrate to SPDX identifier 2024-09-12 01:08:11 +08:00
tcp_close.c net: migrate to SPDX identifier 2024-09-12 01:08:11 +08:00
tcp_conn.c net: migrate to SPDX identifier 2024-09-12 01:08:11 +08:00
tcp_connect.c tcp/tls: fix tcp tls bugs 2024-11-21 00:23:01 +08:00
tcp_devpoll.c net: migrate to SPDX identifier 2024-09-12 01:08:11 +08:00
tcp_dump.c net: migrate to SPDX identifier 2024-09-12 01:08:11 +08:00
tcp_finddev.c net: migrate to SPDX identifier 2024-09-12 01:08:11 +08:00
tcp_getsockopt.c net: migrate to SPDX identifier 2024-09-12 01:08:11 +08:00
tcp_input.c tcp_input: if tcp->req > recvreq, send ack only when state is TCP_ESTABLISHED 2024-10-31 15:31:01 +08:00
tcp_ioctl.c net: migrate to SPDX identifier 2024-09-12 01:08:11 +08:00
tcp_ipselect.c net: migrate to SPDX identifier 2024-09-12 01:08:11 +08:00
tcp_listen.c net: migrate to SPDX identifier 2024-09-12 01:08:11 +08:00
tcp_monitor.c net: migrate to SPDX identifier 2024-09-12 01:08:11 +08:00
tcp_netpoll.c tcp:set NET_TCP_NPOLLWAITERS default value to 2 & add warning of different events having same event bit 2024-11-03 02:55:02 +08:00
tcp_notifier.c net: migrate to SPDX identifier 2024-09-12 01:08:11 +08:00
tcp_recvfrom.c tcp/tls: fix tcp tls bugs 2024-11-21 00:23:01 +08:00
tcp_recvwindow.c net: migrate to SPDX identifier 2024-09-12 01:08:11 +08:00
tcp_send.c net: migrate to SPDX identifier 2024-09-12 01:08:11 +08:00
tcp_send_buffered.c tcp/tls: fix tcp tls bugs 2024-11-21 00:23:01 +08:00
tcp_send_unbuffered.c tcp/tls: fix tcp tls bugs 2024-11-21 00:23:01 +08:00
tcp_sendfile.c net: migrate to SPDX identifier 2024-09-12 01:08:11 +08:00
tcp_seqno.c libc: Refine the arc4random_buf implementation 2024-10-26 18:04:21 -03:00
tcp_setsockopt.c net: migrate to SPDX identifier 2024-09-12 01:08:11 +08:00
tcp_shutdown.c net: migrate to SPDX identifier 2024-09-12 01:08:11 +08:00
tcp_timer.c net/tcp_timer: fix tcp RTO abnormally large after retransmission occurs 2024-12-10 22:00:55 +08:00
tcp_txdrain.c net: migrate to SPDX identifier 2024-09-12 01:08:11 +08:00
tcp_wrbuffer.c net: migrate to SPDX identifier 2024-09-12 01:08:11 +08:00