Zepp-Hanzj commented on PR #18993:
URL: https://github.com/apache/nuttx/pull/18993#issuecomment-4576801932

   Thank you for the review.
   
   ## Sim test logs
   
   The NuttX sim requires an interactive PTY for proper I/O. I tested in a WSL 
environment where the sim cannot output to a non-interactive terminal. I will 
provide full logs when I can run in a proper terminal environment.
   
   ## Verification evidence
   
   ### Build
   ```
   $ make -j16 (sim:tcpblaster + CONFIG_DEBUG_NET_INFO=y)
   Result: No warnings, no errors
   ```
   
   ### Checkpatch
   ```
   $ ./tools/checkpatch.sh -g HEAD
   ✔️ All checks pass.
   ```
   
   ### Code analysis
   
   The fix resets RTO when receiving an ACK after retransmissions. Key code in 
`net/tcp/tcp_input.c` (~line 1236):
   
   ```c
   if (conn->nrtx > 0)
   {
     uint8_t new_rto = (conn->sa >> 3) + conn->sv;
     if (new_rto < TCP_RTO_MIN)
       new_rto = TCP_RTO_MIN;
     else if (new_rto > TCP_RTO_MAX)
       new_rto = TCP_RTO_MAX;
     conn->rto = new_rto;
   }
   ```
   
   After ACK: `conn->rto` goes from 12 → 3 (current RTT estimate), then 
`conn->nrtx = 0`.
   
   This follows RFC 6298 Section 5 and Karn's Algorithm.
   
   Signed-off-by: hanzj <[email protected]>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to