Description
Greetings advanced dev's, since I'm working on a Windows machine, I'm really mad about the ESP not sending more than one packet before waiting for an ACK. Here's what I observe with different clients on Windows:
- Small data (200 bytes), webbrowser: if CONTENT_LENGTH matches, connection is closed by instantly browser. Overall TX time: 10-15ms.
- Large data (~8000 bytes), web browser: each completely filled packet is ack'd after 200ms. Overall TX time: ~1s (sic!)
- if it's my own client (python etc.) I can set the timeout accordingly and teardown the connection earlier for one packet, but with more packets same as webbrowser. I don't have any influence.
Then, I tried playing with the options in lwipopts.h
. In theory, if the TCP_SND_BUF
buffer is at least twice the size of TCP_MSS
, the stack would send exactly this amount of data (because it has it in memory for retransmission) until RX window at the receiver (initially set to ~8k by Windows) is full. So, 1460 * 4 = 5840
(4 being set in the opts file) which fits perfectly into Windows' initial RX window. Long story short: as configured it should work.
Still, the ESP would send only one packet before waiting for an ACK. Then, I decreased TCP_MSS
in the lwipopts.h
to 128
, just to see if I can see this in Wireshark. Oh wonder, I cannot:
Same thing with TCP_CALCULATE_EFF_SEND_MSS
set to 0
by the way.
I tried to force the values by #define
ing those directly at the top of my sketch before any includes. Same result.
So, could it be that those limits are hardcoded in the SDK liblwip.a
library file? Can one of the dev's include lwIP's source in the github release in order to have a) the latest version and be) have it recompiled with new options?
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.