ESP8266 TCP Source Port Uses Fixed Sequence #108
Description
There is an issue with the esp8266 lwip library where the tcp_new() function uses a fixed sequence of source ports every time. This means that a node that is rebooting frequently and reconnecting to the same server may experience issues due to the host perceiving the packets as being retransmissions of old traffic - they have the exact same source, destination, and initial sequence number.
This has been reported and discussed in the Arduino core in esp8266/Arduino#632; their fix was to allow the user to call setLocalPortStart()
, which sets an initial source port that is used (and incremented) to override local_port
within the tcp_pcb
returned by tcp_new()
.
Does ESPAsyncTCP have a work-around for this issue, and if not, could one be added? I believe I'm experiencing occasional dropped traffic caused by this oddity.