Re: [PR] net/tcp: Fix RTO reset after retransmissions [nuttx]

2026-05-29 Thread via GitHub


linguini1 commented on PR #18993:
URL: https://github.com/apache/nuttx/pull/18993#issuecomment-4577152205

   > Closing this PR. Will reopen with sim test logs after I can run the test 
in a proper interactive terminal environment.
   
   You can just mark it as a draft! For future reference, non-trivial changes 
need runtime testing and not just build tests. Is it possible to use QEMU in 
WSL instead?


-- 
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]



Re: [PR] net/tcp: Fix RTO reset after retransmissions [nuttx]

2026-05-29 Thread via GitHub


Zepp-Hanzj closed pull request #18993: net/tcp: Fix RTO reset after 
retransmissions
URL: https://github.com/apache/nuttx/pull/18993


-- 
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]



Re: [PR] net/tcp: Fix RTO reset after retransmissions [nuttx]

2026-05-29 Thread via GitHub


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

   Closing this PR. Will reopen with sim test logs after I can run the test in 
a proper interactive terminal environment.


-- 
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]



Re: [PR] net/tcp: Fix RTO reset after retransmissions [nuttx]

2026-05-29 Thread via GitHub


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 


-- 
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]



Re: [PR] net/tcp: Fix RTO reset after retransmissions [nuttx]

2026-05-29 Thread via GitHub


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

   Thank you for the review!
   
   ## Regarding the sim test logs
   
   The sim test was not fully completed due to WSL environment limitations. The 
NuttX sim (`./nuttx`) requires an interactive terminal (PTY) for proper I/O, 
which is not available in the automated testing environment.
   
   However, I can provide the following verification evidence:
   
   ### 1. Build Verification ✅
   ```
   $ make -j16
   Configuration: sim:tcpblaster
   Result: No warnings, no errors
   ```
   
   ### 2. Checkpatch Verification ✅
   ```
   $ ./tools/checkpatch.sh -g HEAD
   ✔️ All checks pass.
   ```
   
   ### 3. Code Review - Numerical Analysis ✅
   
   I verified the fix through detailed numerical analysis of the RTT estimation 
algorithm:
   
   **Scenario**: Initial RTO=3, 2 retransmissions, then ACK received
   
   | Event | Before Fix | After Fix |
   |---|---|---|
   | Initial RTO | 3 | 3 |
   | After 2 retransmissions | 12 | 12 |
   | On ACK receipt | **12** ❌ | **3** ✅ |
   | Subsequent transmissions | 8, 7, 6... | 3, 3, 3... |
   
   **Source code reference** (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;
   }
   ```
   
   ### 4. RFC Compliance ✅
   - Follows RFC 6298 Section 5
   - Respects Karn's Algorithm (doesn't use retransmitted segments for RTT 
estimation)
   
   ## Regarding AI usage
   
   Yes, I used AI assistance to help analyze the issue and draft the 
implementation. However:
   - The analysis of the bug was based on careful reading of the source code
   - The fix follows RFC 6298 recommendations
   - All verification was done through code review and numerical analysis
   - The code was reviewed for correctness before submission
   
   I will provide actual sim test logs when I can run the sim in a proper 
interactive terminal environment.
   
   Would you like me to add debug output to help verify the fix in a real test 
environment?


-- 
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]