incubator-nuttx/net/tcp
YAMAMOTO Takashi 837e1a72a4 tcp_send_buffered.c: improve tcp write buffering
* Send data chunk-by-chunk
  Note: A stream socket doesn't have atomicity requirement.

* Increase the chance to use full-sized segments

Benchmark numbers in my environment:

* Over ESP32 wifi
* The peer is NetBSD, which has traditional delayed ack TCP
* iperf uses 16384 bytes buffer

---

without this patch,
CONFIG_IOB_NBUFFERS=36
CONFIG_IOB_BUFSIZE=196

does not work.
see https://github.com/apache/incubator-nuttx/pull/2772#discussion_r592820639

---

without this patch,
CONFIG_IOB_NBUFFERS=128
CONFIG_IOB_BUFSIZE=196
```
nsh> iperf -c 192.168.8.1
       IP: 192.168.8.103

 mode=tcp-client sip=192.168.8.103:5001,dip=192.168.8.1:5001, interval=3, time=30

        Interval Bandwidth

   0-   3 sec,  4.11 Mbits/sec
   3-   6 sec,  4.63 Mbits/sec
   6-   9 sec,  4.89 Mbits/sec
   9-  12 sec,  4.63 Mbits/sec
  12-  15 sec,  4.85 Mbits/sec
  15-  18 sec,  4.85 Mbits/sec
  18-  21 sec,  5.02 Mbits/sec
  21-  24 sec,  3.67 Mbits/sec
  24-  27 sec,  4.94 Mbits/sec
  27-  30 sec,  4.81 Mbits/sec
   0-  30 sec,  4.64 Mbits/sec
nsh>
```

---

with this patch,
CONFIG_IOB_NBUFFERS=36
CONFIG_IOB_BUFSIZE=196
```
nsh> iperf -c 192.168.8.1
       IP: 192.168.8.103

 mode=tcp-client sip=192.168.8.103:5001,dip=192.168.8.1:5001, interval=3, time=30

        Interval Bandwidth

   0-   3 sec,  5.33 Mbits/sec
   3-   6 sec,  5.59 Mbits/sec
   6-   9 sec,  5.55 Mbits/sec
   9-  12 sec,  5.59 Mbits/sec
  12-  15 sec,  5.59 Mbits/sec
  15-  18 sec,  5.72 Mbits/sec
  18-  21 sec,  5.68 Mbits/sec
  21-  24 sec,  5.29 Mbits/sec
  24-  27 sec,  4.67 Mbits/sec
  27-  30 sec,  4.50 Mbits/sec
   0-  30 sec,  5.35 Mbits/sec
nsh>
```

---

with this patch,
CONFIG_IOB_NBUFFERS=128
CONFIG_IOB_BUFSIZE=196
```
nsh> iperf -c 192.168.8.1
       IP: 192.168.8.103

 mode=tcp-client sip=192.168.8.103:5001,dip=192.168.8.1:5001, interval=3, time=30

        Interval Bandwidth

   0-   3 sec,  5.51 Mbits/sec
   3-   6 sec,  4.67 Mbits/sec
   6-   9 sec,  4.54 Mbits/sec
   9-  12 sec,  5.42 Mbits/sec
  12-  15 sec,  5.37 Mbits/sec
  15-  18 sec,  5.11 Mbits/sec
  18-  21 sec,  5.07 Mbits/sec
  21-  24 sec,  5.29 Mbits/sec
  24-  27 sec,  5.77 Mbits/sec
  27-  30 sec,  4.63 Mbits/sec
   0-  30 sec,  5.14 Mbits/sec
nsh>
```
2021-03-22 01:12:59 -07:00
..
Kconfig net/tcp: implement the fast retransmit 2020-12-01 11:36:10 -06:00
Make.defs net: Author Gregory Nutt: update licenses to Apache 2021-02-20 00:38:18 -08:00
tcp.h tcp_send_buffered.c: improve tcp write buffering 2021-03-22 01:12:59 -07:00
tcp_accept.c net: Author Gregory Nutt: update licenses to Apache 2021-02-20 00:38:18 -08:00
tcp_appsend.c net/tcp/tcp_appsend.c: Fix syslog formats 2020-11-27 05:18:57 -06:00
tcp_backlog.c net: Author Gregory Nutt: update licenses to Apache 2021-02-20 00:38:18 -08:00
tcp_callback.c net: Author Gregory Nutt: update licenses to Apache 2021-02-20 00:38:18 -08:00
tcp_close.c net: Author Gregory Nutt: update licenses to Apache 2021-02-20 00:38:18 -08:00
tcp_conn.c net/tcp: correct the port byte order 2021-03-20 09:13:18 -07:00
tcp_connect.c net/tcp/handshake: send the SYN immediately. 2020-12-18 14:16:11 +09:00
tcp_devpoll.c
tcp_finddev.c net: Author Gregory Nutt: update licenses to Apache 2021-02-20 00:38:18 -08:00
tcp_getsockopt.c sourcefiles: Fix relative path in file header 2021-03-09 23:18:28 +08:00
tcp_input.c net/tcp: rename the winszie to snd_wnd to make the semantics more accurate 2020-12-10 12:23:47 +09:00
tcp_ipselect.c net: Author Gregory Nutt: update licenses to Apache 2021-02-20 00:38:18 -08:00
tcp_listen.c
tcp_monitor.c net: Author Gregory Nutt: update licenses to Apache 2021-02-20 00:38:18 -08:00
tcp_netpoll.c net: Author Gregory Nutt: update licenses to Apache 2021-02-20 00:38:18 -08:00
tcp_notifier.c net: Author Gregory Nutt: update licenses to Apache 2021-02-20 00:38:18 -08:00
tcp_recvfrom.c net/tcp: send the ack on nonblock mode 2020-12-18 14:16:11 +09:00
tcp_recvwindow.c net: Author Gregory Nutt: update licenses to Apache 2021-02-20 00:38:18 -08:00
tcp_send.c net/tcp: add a member to record the current receiving window 2020-12-10 12:23:47 +09:00
tcp_send_buffered.c tcp_send_buffered.c: improve tcp write buffering 2021-03-22 01:12:59 -07:00
tcp_send_unbuffered.c net: unify socket into file descriptor 2021-03-03 19:01:41 -08:00
tcp_sendfile.c tcp_sendfile.c: Remove an unused copy of CONFIG_NET_TCP_SPLIT_SIZE 2021-03-15 04:52:58 -07:00
tcp_seqno.c
tcp_setsockopt.c net: Author Gregory Nutt: update licenses to Apache 2021-02-20 00:38:18 -08:00
tcp_timer.c net/tcp: reset the connection ref count before tcp_free() 2021-03-22 10:55:30 +09:00
tcp_txdrain.c net: unify socket into file descriptor 2021-03-03 19:01:41 -08:00
tcp_wrbuffer.c net/tcp: implement the fast retransmit 2020-12-01 11:36:10 -06:00
tcp_wrbuffer_dump.c net: Author Gregory Nutt: update licenses to Apache 2021-02-20 00:38:18 -08:00