K66 ethernet lwIP TCP
I got TCP client and server working on K66. Blasting TCP packets from linux to K66, the receive rate is 51 mbs (faster than mbed K64F with lwIP+RTOS). Alas, blasting TCP packets from K66 to linux achieved less than 1 mbs??? So some tuning/configuration required... Default TCP window size is 2*1460, not really an issue for local ether tests.
more info in post
#686
fyi, here is a tcptrace of k66 TCP sending 100 1000-byte packets as measured by tcpdump on the receiving host, there are some large pauses: 250ms between SYN-ACK and first data packet, then some 500ms pauses ?? The lwIP fast timer for TCP is 250ms, and the slow timer period is 500ms.
The instantaneous bandwidth has peaks at 24mbs. The data rate for sloping sequence is 1000 bytes/ 40 ms or 0.2mbs
EDIT:
I reduced the TCP fast timer to 50ms, and doubled the window-size to 4*1460, here is the resulting TCP trace
The delay after the SYN-ACK was only 48ms. The data rate for the 100 1000-byte tcp_write()s was 1.4 mbs, but the initial spike was 52 mbs, and the latter steps were 4*1000 bytes every 40ms (0.8 mbs). I can't yet explain the 40 ms delays.
EDIT 2:
The 40 ms delay was actually delayed-ACK on the linux side, induced by the way I was doing tcp_write() on the k66. With tcp_write loop fixed, i get the following TCPtrace
There is the unexplained initial pause of 100ms after SYN-ACK, and the resulting data rate is 6.6 mbs. if you discount the 100ms pause, the data rate is 38 mbs.
EDIT 3:
Adding tcp_output() to tcp_write loop fixed initial pause. TCP send data rate is 59 mbs.