casaroli opened a new pull request, #4101:
URL: https://github.com/apache/nuttx-apps/pull/4101

   ## Summary
   
   Add `cmocka_net_tun`: a TCP case against a peer that the program plays on a 
TUN device (`/dev/tun`), so the case controls every segment that the peer sends.
   
   `test_tun_tcp_lossy`: the link loses the first transmission of each segment. 
The peer opens a window of mss / 8 bytes, ignores a segment the first time and 
acknowledges it when it comes again. So each timeout of the server retransmits 
one segment, the peer acknowledges it, and the connection makes progress at 
each timeout. After 10 rounds (more than `TCP_MAXRTX`, 8) the window opens and 
the peer acknowledges everything. The server writes 8192 bytes in one `send()`. 
The case checks that each byte comes at its own sequence number, that the whole 
stream and the FIN come, and that the server does not reset the connection. 
When no segment comes for 2 s, the peer sends a window update, as a receiver 
that reads. The case takes about 16 s.
   
   With TCP write buffers, NuttX freed a write buffer at its eighth 
retransmission, also when the peer had acknowledged a part of it at each 
timeout. The next data then went out at the sequence numbers of the freed data, 
and the next timeout reset the connection. apache/nuttx#22132 fixes that.
   
   depends-on: apache/nuttx/pull/22132
   
   ## Impact
   
   New program, `CONFIG_TESTING_NET_TUN` (default y when `NET_TUN`, `NET_TCP` 
and `NET_IPv4` are set). No other test changes. Uses the addresses 10.78.0.1/24 
(the TUN interface) and 10.78.0.2 (the peer). No CI configuration enables both 
`NET_TUN` and `TESTING_NET_TEST` yet, so CI does not build or run the case.
   
   ## Testing
   
   qemu-armv8a:knsh (kernel build) and qemu-armv8a:nsh (flat build) under HVF 
(Apple M-series), 96 IOBs of 196 bytes, `IOB_THROTTLE` 8, TCP write buffers, 
`NET_TUN_PKTSIZE` 1500; nuttx master 5e4ecd1d603, 3 runs of `cmocka_net_tun` in 
one boot.
   
   | Configuration | nuttx master | with apache/nuttx#22132 |
   |---|---|---|
   | knsh, 1 CPU | FAIL 3 of 3: wrong data from stream offset 1456 (1457 bytes) 
after 7 rounds | PASS 3 of 3 (about 16 s each) |
   | knsh, 4 CPUs (`CONFIG_SMP`) | FAIL 3 of 3 | PASS 3 of 3 |
   | nsh (flat), 1 CPU | FAIL 3 of 3 | PASS 3 of 3 |
   | knsh, nuttx master + apache/nuttx#22078 | FAIL 3 of 3 | PASS 3 of 3 |
   
   Builds in the NuttX CI image (`EXTRAFLAGS="-Wno-cpp -Werror"`, nuttx with 
apache/nuttx#22132), all OK, 0 compiler warnings, `cmocka_net_tun` built: 
qemu-armv8a:netnsh + TCP write buffers + `NET_TUN` (Make, CMake, without write 
buffers, with `NET_IPv6`), sim:tcpblaster (`NET_TUN` is on there).
   
   `tools/checkpatch.sh -c -u -m -g` passes.
   


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