|Subject:||Re: [lwip-users] LwIP 1.4.1: Outgoing TCP connection does not work - LwIP sends RST, ACK|
|Date:||Thu, 20 Dec 2012 09:12:31 +0100|
|User-agent:||Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:16.0) Gecko/20121010 Thunderbird/16.0.1|
Marco Jakobs wrote:
Has anyone on this list ever heard that we favour pcap files over short text cutouts? ;-)
I cannot be sure because I don't have the pcap (which contains much more info on the packets above), but I guess your TCP client just booted up and reuses the same port as before (which the server already knows), but the SYN has a Seqno that is not valid for the server, so it sends an ACK with the Seqno it expects (note the server sends an ACK, not a SYN/ACK). This leads to the device sending a RST. Perfectly valid so far.
a) Make the device use a different initial Seqno on every boot (i.e. random number). You can do that in lwIP by defining TCP_LOCAL_PORT_RANGE_START and TCP_LOCAL_PORT_RANGE_END yourself (see tcp.c).
b) Just live with the RST once (now you know where it comes from) and open the connection a second time. The RST from packet 57 should ensure that the first connection is closed on the server as well.
|[Prev in Thread]||Current Thread||[Next in Thread]|