Socket issues

permal
Posts: 384
Joined: Sun May 14, 2017 5:36 pm

Re: Socket issues

Postby permal » Wed Aug 09, 2017 6:50 pm

I'd love to hear what @ESP_igrr has to say about this. I've spoken to some other devs and the current consensus is that it is a bug in the TCP-stack in ESP-IDF, but I'd love to be proven wrong as I then can do something about it.

enitalp
Posts: 60
Joined: Thu Jan 12, 2017 10:03 pm

Re: Socket issues

Postby enitalp » Wed Aug 09, 2017 7:32 pm

i've asked my IT departement to give me another high end recent routeur to do some other test in real situation.
I'm not in the best environment to do wifi test, 3000 people in a tech company building with wifi devices and network everywhere is a nightmare environment to test an esp32. At least i know that in the best case scenario with a direct connection i have good timing (and almost) no lag. i was expected no lag/repeat at all, would love to put that on a bug and get the fix for it.

permal
Posts: 384
Joined: Sun May 14, 2017 5:36 pm

Re: Socket issues

Postby permal » Wed Aug 09, 2017 7:35 pm

@enitalp This issue isn't about lag, its about the inability to connect, presumably due to a bug in the TCP stack that causes it to stop sending SYN-packets at the connection phase.

WiFive
Posts: 3529
Joined: Tue Dec 01, 2015 7:35 am

Re: Socket issues

Postby WiFive » Wed Aug 09, 2017 10:14 pm

Are you using latest IDF master?
Can you reproduce with any example code like tcp-perf?
Have you turned on lwip debugging?

ESP_igrr
Posts: 2072
Joined: Tue Dec 01, 2015 8:37 am

Re: Socket issues

Postby ESP_igrr » Wed Aug 09, 2017 11:35 pm

permal: thanks for reporting this, what you have found may very well be a bug in LwIP. I can't personally help you with this but I'm going to point my colleagues working on LwIP to your post.

permal
Posts: 384
Joined: Sun May 14, 2017 5:36 pm

Re: Socket issues

Postby permal » Thu Aug 10, 2017 7:30 am

WiFive wrote:Are you using latest IDF master?
Can you reproduce with any example code like tcp-perf?
Have you turned on lwip debugging?
My master was a few days old, but same thing with a sparkling fresh copy.

If I configure tcp_perf as a client to connect to the (turned off) mqtt broker in my (running) docker it shows the same behavior as my code, i.e. sometimes a single SYN-packet, sometimes SYN with retransmissions, as seen below. The empty lines between the rows is me pressing enter a few times to separate the data before resetting the ESP32.

Where do I find the switch to enable lwIP debugging? I've looked in the lwip section of menuconfig, but see nothing of use?

Code: Select all

>tshark -i eno1 port 1883
1980 2098.790586383 192.168.10.24 -> 192.168.10.247 TCP 60 40576 > mqtt [SYN] Seq=0 Win=5744 Len=0 MSS=1436
1981 2104.246940256 192.168.10.24 -> 192.168.10.247 TCP 60 [TCP Retransmission] 40576 > mqtt [SYN] Seq=0 Win=5744 Len=0 MSS=1436
1982 2107.107092519 192.168.10.24 -> 192.168.10.247 TCP 60 [TCP Retransmission] 40576 > mqtt [SYN] Seq=0 Win=5744 Len=0 MSS=1436
1983 2109.956449130 192.168.10.24 -> 192.168.10.247 TCP 60 [TCP Retransmission] 40576 > mqtt [SYN] Seq=0 Win=5744 Len=0 MSS=1436
1984 2112.815185016 192.168.10.24 -> 192.168.10.247 TCP 60 [TCP Retransmission] 40576 > mqtt [SYN] Seq=0 Win=5744 Len=0 MSS=1436
1985 2115.698250068 192.168.10.24 -> 192.168.10.247 TCP 60 [TCP Retransmission] 40576 > mqtt [SYN] Seq=0 Win=5744 Len=0 MSS=1436



1986 2153.268541863 192.168.10.24 -> 192.168.10.247 TCP 60 neod2 > mqtt [SYN] Seq=0 Win=5744 Len=0 MSS=1436


1987 2436.692502958 192.168.10.24 -> 192.168.10.247 TCP 60 14914 > mqtt [SYN] Seq=0 Win=5744 Len=0 MSS=1436
1988 2439.291783175 192.168.10.24 -> 192.168.10.247 TCP 60 [TCP Retransmission] 14914 > mqtt [SYN] Seq=0 Win=5744 Len=0 MSS=1436
1989 2442.171294493 192.168.10.24 -> 192.168.10.247 TCP 60 [TCP Retransmission] 14914 > mqtt [SYN] Seq=0 Win=5744 Len=0 MSS=1436



1990 2454.521440268 192.168.10.24 -> 192.168.10.247 TCP 60 49361 > mqtt [SYN] Seq=0 Win=5744 Len=0 MSS=1436


1991 2487.147499942 192.168.10.24 -> 192.168.10.247 TCP 60 55229 > mqtt [SYN] Seq=0 Win=5744 Len=0 MSS=1436
1992 2489.751086379 192.168.10.24 -> 192.168.10.247 TCP 60 [TCP Retransmission] 55229 > mqtt [SYN] Seq=0 Win=5744 Len=0 MSS=1436
1993 2495.502530035 192.168.10.24 -> 192.168.10.247 TCP 60 [TCP Retransmission] 55229 > mqtt [SYN] Seq=0 Win=5744 Len=0 MSS=1436
1994 2498.362315774 192.168.10.24 -> 192.168.10.247 TCP 60 [TCP Retransmission] 55229 > mqtt [SYN] Seq=0 Win=5744 Len=0 MSS=1436
ESP_igrr wrote:permal: thanks for reporting this, what you have found may very well be a bug in LwIP. I can't personally help you with this but I'm going to point my colleagues working on LwIP to your post.
That would be very appreciated. As tcp_perf exhibits the same symptoms we can rule out any coding errors on my part which should make it easier to track down the issue, but keep in mind that the symptoms only happens when I connect to an inactive/turned off endpoint/container in Docker so presumably you'll need to set up Docker and Mosquitto like I have, then stop the container to reproduce the issue.

For reference, my Mosquitto is run like this (I'm using a volume to store persistent data):

Code: Select all

docker run -d --restart always -p 1883:1883 -p 9001:9001 -v Mosquitto:/mosquitto/ eclipse-mosquitto
The image I'm using is "eclipse-mosquitto:latest"

WiFive
Posts: 3529
Joined: Tue Dec 01, 2015 7:35 am

Re: Socket issues

Postby WiFive » Thu Aug 10, 2017 8:50 am

permal wrote:Where do I find the switch to enable lwIP debugging? I've looked in the lwip section of menuconfig, but see nothing of use?
https://github.com/espressif/esp-idf/bl ... pts.h#L603

permal
Posts: 384
Joined: Sun May 14, 2017 5:36 pm

Re: Socket issues

Postby permal » Thu Aug 10, 2017 11:15 am

Enabling TCP_INPUT_DEBUG and TCP_OUTPUT_DEBUG yields the following. Notice the difference between the two.

The following is a connection attempt that shows the symptoms where connections failes; a single SYN-packet is seen on the receiving side.

Code: Select all

I (347) tcp_perf:: task tcp_conn.
I (457) wifi: n:11 0, o:1 0, ap:255 255, sta:11 0, prof:1
I (1437) wifi: state: init -> auth (b0)
I (1447) wifi: state: auth -> assoc (0)
I (1457) wifi: state: assoc -> run (10)
I (1477) wifi: connected with Our place, channel 11
I (3557) event: ip: 192.168.10.24, mask: 255.255.255.0, gw: 192.168.10.254
I (3557) tcp_perf:: got ip:192.168.10.24

I (3557) tcp_perf:: sta has connected to ap.
I (3557) tcp_perf:: tcp_client will start after 20s...
I (5567) tcp_perf:: create_tcp_client.
I (5567) tcp_perf:: client socket....serverip:port=192.168.10.247:1883

I (5567) tcp_perf:: connecting to server...
tcp_enqueue_flags: queueing 6509:6510 (0x2)
tcp_output_segment: 6509:6509
tcp_output: nothing to send (0x0)
tcp_output: nothing to send (0x0)
tcp_output_segment: 6509:6509
tcp_output: nothing to send (0x0)
+-+-+-+-+-+-+-+-+-+-+-+-+-+- tcp_input: flags -+-+-+-+-+-+-+-+-+-+-+-+-+-+
tcp_process: unacceptable reset seqno 0 rcv_nxt 0
tcp_output: nothing to send (0x0)
tcp_output: nothing to send (0x0)
tcp_output: nothing to send (0x0)
tcp_output_segment: 6509:6509
tcp_output: nothing to send (0x0)
+-+-+-+-+-+-+-+-+-+-+-+-+-+- tcp_input: flags -+-+-+-+-+-+-+-+-+-+-+-+-+-+
tcp_process: unacceptable reset seqno 0 rcv_nxt 0
tcp_output: nothing to send (0x0)
I (11457) wifi: pm start, type:0

I (11457) wifi: active cnt: 17
tcp_output: nothing to send (0x0)
tcp_output: nothing to send (0x0)
tcp_output_segment: 6509:6509
tcp_output: nothing to send (0x0)
+-+-+-+-+-+-+-+-+-+-+-+-+-+- tcp_input: flags -+-+-+-+-+-+-+-+-+-+-+-+-+-+
tcp_process: unacceptable reset seqno 0 rcv_nxt 0
tcp_output: nothing to send (0x0)
tcp_output: nothing to send (0x0)
tcp_output: nothing to send (0x0)
tcp_output_segment: 6509:6509
tcp_output: nothing to send (0x0)
+-+-+-+-+-+-+-+-+-+-+-+-+-+- tcp_input: flags -+-+-+-+-+-+-+-+-+-+-+-+-+-+
tcp_process: unacceptable reset seqno 0 rcv_nxt 0
tcp_output: nothing to send (0x0)
tcp_output: nothing to send (0x0)
tcp_output: nothing to send (0x0)
tcp_output_segment: 6509:6509
tcp_output: nothing to send (0x0)
+-+-+-+-+-+-+-+-+-+-+-+-+-+- tcp_input: flags -+-+-+-+-+-+-+-+-+-+-+-+-+-+
tcp_process: unacceptable reset seqno 0 rcv_nxt 0
tcp_output: nothing to send (0x0)
tcp_output: nothing to send (0x0)
I (21457) wifi: active cnt: 3
tcp_output: nothing to send (0x0)
tcp_output_segment: 6509:6509
tcp_output: nothing to send (0x0)
+-+-+-+-+-+-+-+-+-+-+-+-+-+- tcp_input: flags -+-+-+-+-+-+-+-+-+-+-+-+-+-+
tcp_process: unacceptable reset seqno 0 rcv_nxt 0
tcp_output: nothing to send (0x0)
W (22927) tcp_perf:: socket error 113 Software caused connection abort
I (22927) tcp_perf:: create tcp socket error,stop.
I (31457) wifi: active cnt: 1
I (41457) wifi: send null to keep active
I (51457) wifi: send null to keep active
I (61457) wifi: send null to keep active
I (71457) wifi: send null to keep active
The following is a connection attempt that looks healthy, multiple retransmissions are seen on the receiving side.

Code: Select all

I (457) wifi: n:11 0, o:1 0, ap:255 255, sta:11 0, prof:1
I (1437) wifi: state: init -> auth (b0)
I (1437) wifi: state: auth -> assoc (0)
I (1447) wifi: state: assoc -> run (10)
I (1457) wifi: connected with Our place, channel 11
I (3677) event: ip: 192.168.10.24, mask: 255.255.255.0, gw: 192.168.10.254
I (3677) tcp_perf:: got ip:192.168.10.24

I (3677) tcp_perf:: sta has connected to ap.
I (3677) tcp_perf:: tcp_client will start after 20s...
I (5687) tcp_perf:: create_tcp_client.
I (5687) tcp_perf:: client socket....serverip:port=192.168.10.247:1883

I (5687) tcp_perf:: connecting to server...
tcp_enqueue_flags: queueing 6509:6510 (0x2)
tcp_output_segment: 6509:6509
tcp_output: nothing to send (0x0)
tcp_output: nothing to send (0x0)
tcp_output_segment: 6509:6509
tcp_output: nothing to send (0x0)
tcp_output: nothing to send (0x0)
tcp_output: nothing to send (0x0)
tcp_output_segment: 6509:6509
tcp_output: nothing to send (0x0)
I (11447) wifi: pm start, type:0

I (11447) wifi: active cnt: 17
tcp_output: nothing to send (0x0)
tcp_output: nothing to send (0x0)
tcp_output_segment: 6509:6509
tcp_output: nothing to send (0x0)
tcp_output: nothing to send (0x0)
tcp_output: nothing to send (0x0)
tcp_output_segment: 6509:6509
tcp_output: nothing to send (0x0)
tcp_output: nothing to send (0x0)
tcp_output: nothing to send (0x0)
tcp_output_segment: 6509:6509
tcp_output: nothing to send (0x0)
tcp_output: nothing to send (0x0)
I (21447) wifi: active cnt: 3
tcp_output: nothing to send (0x0)
tcp_output_segment: 6509:6509
tcp_output: nothing to send (0x0)
W (23197) tcp_perf:: socket error 113 Software caused connection abort
I (23197) tcp_perf:: create tcp socket error,stop.
Also enabling TCPIP_DEBUG yields the following data.

Connection attempt showing symptoms; a single SYN-packet is seen on the receiving side.

Code: Select all

I (347) tcp_perf:: task tcp_conn.
I (467) wifi: n:11 0, o:1 0, ap:255 255, sta:11 0, prof:1
I (1447) wifi: state: init -> auth (b0)
I (1447) wifi: state: auth -> assoc (0)
I (1457) wifi: state: assoc -> run (10)
I (1467) wifi: connected with Our place, channel 11
tcpip_thread: API message 0x3ffbc500
tcpip_thread: API message 0x3ffbc500
tcpip_thread: PACKET 0x3ffaf2b0
tcpip_thread: PACKET 0x3ffaf2b0
tcpip_thread: PACKET 0x3ffaf2b0
tcpip_thread: PACKET 0x3ffaf2b0
tcpip_thread: PACKET 0x3ffaf2b0
tcpip_thread: PACKET 0x3ffaf2b0
tcpip_thread: PACKET 0x3ffaf2b0
I (3697) event: ip: 192.168.10.24, mask: 255.255.255.0, gw: 192.168.10.254
I (3697) tcp_perf:: got ip:192.168.10.24

I (3697) tcp_perf:: sta has connected to ap.
I (3697) tcp_perf:: tcp_client will start after 20s...
tcpip_thread: PACKET 0x3ffaf2c4
tcpip_thread: PACKET 0x3ffaf2c4
tcpip_thread: PACKET 0x3ffaf2d0
tcpip_thread: PACKET 0x3ffaf2d0
I (5707) tcp_perf:: create_tcp_client.
I (5707) tcp_perf:: client socket....serverip:port=192.168.10.247:1883

tcpip_thread: API message 0x3ffc6080
I (5707) tcp_perf:: connecting to server...
tcpip_thread: API message 0x3ffc6040
tcp_enqueue_flags: queueing 6509:6510 (0x2)
tcp_output_segment: 6509:6509
tcpip_thread: PACKET 0x3ffba394
tcpip_thread: PACKET 0x3ffba394
tcpip_thread: PACKET 0x3ffba394
tcpip_thread: PACKET 0x3ffba394
tcpip_thread: PACKET 0x3ffba394
tcp_output: nothing to send (0x0)
tcpip_thread: PACKET 0x3ffba394
tcp_output: nothing to send (0x0)
tcpip_thread: PACKET 0x3ffba394
tcpip_thread: PACKET 0x3ffba394
tcp_output_segment: 6509:6509
tcp_output: nothing to send (0x0)
tcpip_thread: PACKET 0x3ffba394
+-+-+-+-+-+-+-+-+-+-+-+-+-+- tcp_input: flags -+-+-+-+-+-+-+-+-+-+-+-+-+-+
tcp_process: unacceptable reset seqno 0 rcv_nxt 0
tcp_output: nothing to send (0x0)
tcpip_thread: PACKET 0x3ffba394
tcpip_thread: PACKET 0x3ffba394
tcp_output: nothing to send (0x0)
tcpip_thread: PACKET 0x3ffba394
tcpip_thread: PACKET 0x3ffba394
tcpip_thread: PACKET 0x3ffba394
tcp_output: nothing to send (0x0)
tcpip_thread: PACKET 0x3ffba394
tcpip_thread: PACKET 0x3ffba394
tcp_output_segment: 6509:6509
tcp_output: nothing to send (0x0)
I (11457) wifi: pm start, type:0

I (11457) wifi: active cnt: 17
tcpip_thread: PACKET 0x3ffba394
tcpip_thread: PACKET 0x3ffba394
tcp_output: nothing to send (0x0)
tcpip_thread: PACKET 0x3ffba394
tcpip_thread: PACKET 0x3ffba394
tcp_output: nothing to send (0x0)
tcpip_thread: PACKET 0x3ffba394
tcpip_thread: PACKET 0x3ffba394
tcpip_thread: PACKET 0x3ffba394
tcp_output_segment: 6509:6509
tcp_output: nothing to send (0x0)
tcpip_thread: PACKET 0x3ffba394
+-+-+-+-+-+-+-+-+-+-+-+-+-+- tcp_input: flags -+-+-+-+-+-+-+-+-+-+-+-+-+-+
tcp_process: unacceptable reset seqno 0 rcv_nxt 0
tcp_output: nothing to send (0x0)
tcpip_thread: PACKET 0x3ffba394
tcpip_thread: PACKET 0x3ffba394
tcp_output: nothing to send (0x0)
tcpip_thread: PACKET 0x3ffba394
tcp_output: nothing to send (0x0)
tcpip_thread: PACKET 0x3ffba394
tcpip_thread: PACKET 0x3ffba394
tcp_output_segment: 6509:6509
tcp_output: nothing to send (0x0)
tcpip_thread: PACKET 0x3ffba394
+-+-+-+-+-+-+-+-+-+-+-+-+-+- tcp_input: flags -+-+-+-+-+-+-+-+-+-+-+-+-+-+
tcp_process: unacceptable reset seqno 0 rcv_nxt 0
tcp_output: nothing to send (0x0)
tcpip_thread: PACKET 0x3ffba394
tcpip_thread: PACKET 0x3ffba394
tcp_output: nothing to send (0x0)
tcpip_thread: PACKET 0x3ffba394
tcpip_thread: PACKET 0x3ffba394
tcpip_thread: PACKET 0x3ffba394
tcpip_thread: PACKET 0x3ffba394
tcp_output: nothing to send (0x0)
tcpip_thread: PACKET 0x3ffba394
tcpip_thread: PACKET 0x3ffba394
tcpip_thread: PACKET 0x3ffba394
tcp_output_segment: 6509:6509
tcp_output: nothing to send (0x0)
tcpip_thread: PACKET 0x3ffba394
+-+-+-+-+-+-+-+-+-+-+-+-+-+- tcp_input: flags -+-+-+-+-+-+-+-+-+-+-+-+-+-+
tcp_process: unacceptable reset seqno 0 rcv_nxt 0
tcp_output: nothing to send (0x0)
tcpip_thread: PACKET 0x3ffba394
tcpip_thread: PACKET 0x3ffba394
tcpip_thread: PACKET 0x3ffba394
tcp_output: nothing to send (0x0)
tcpip_thread: PACKET 0x3ffba394
tcpip_thread: PACKET 0x3ffba394
I (21457) wifi: active cnt: 3
tcp_output: nothing to send (0x0)
tcpip_thread: PACKET 0x3ffba394
tcpip_thread: PACKET 0x3ffba394
tcpip_thread: PACKET 0x3ffba394
tcpip_thread: PACKET 0x3ffba394
tcpip_thread: PACKET 0x3ffba394
tcpip_thread: PACKET 0x3ffba394
tcpip_thread: PACKET 0x3ffba394
tcpip_thread: PACKET 0x3ffba394
tcpip_thread: PACKET 0x3ffc3a38
tcpip_thread: PACKET 0x3ffb8c70
tcp_output_segment: 6509:6509
tcp_output: nothing to send (0x0)
tcpip_thread: PACKET 0x3ffba394
+-+-+-+-+-+-+-+-+-+-+-+-+-+- tcp_input: flags -+-+-+-+-+-+-+-+-+-+-+-+-+-+
tcp_process: unacceptable reset seqno 0 rcv_nxt 0
tcp_output: nothing to send (0x0)
tcpip_thread: PACKET 0x3ffba394
tcpip_thread: PACKET 0x3ffba394
tcpip_thread: CALLBACK 0x3ffaf294
W (23237) tcp_perf:: socket error 113 Software caused connection abort
I (23237) tcp_perf:: create tcp socket error,stop.
tcpip_thread: PACKET 0x3ffaf4f8
tcpip_thread: PACKET 0x3ffaf4f8
tcpip_thread: PACKET 0x3ffaf4f8
tcpip_thread: PACKET 0x3ffaf4f8
tcpip_thread: PACKET 0x3ffaf4f8
tcpip_thread: PACKET 0x3ffaf4f8
Connection attempt that looks healthy; SYN and retransmissions.

Code: Select all

tcpip_thread: PACKET 0x3ffaf2c4
tcpip_thread: PACKET 0x3ffaf2d0
tcpip_thread: PACKET 0x3ffaf2d0
tcpip_thread: PACKET 0x3ffaf70c
I (5707) tcp_perf:: create_tcp_client.
I (5707) tcp_perf:: client socket....serverip:port=192.168.10.247:1883

tcpip_thread: API message 0x3ffc6080
I (5707) tcp_perf:: connecting to server...
tcpip_thread: API message 0x3ffc6040
tcp_enqueue_flags: queueing 6509:6510 (0x2)
tcp_output_segment: 6509:6509
tcpip_thread: PACKET 0x3ffba394
tcpip_thread: PACKET 0x3ffaf2c0
tcpip_thread: PACKET 0x3ffc5164
tcpip_thread: PACKET 0x3ffc5164
tcp_output: nothing to send (0x0)
tcpip_thread: PACKET 0x3ffc5164
tcpip_thread: PACKET 0x3ffc3a38
tcpip_thread: PACKET 0x3ffc3a38
tcp_output: nothing to send (0x0)
tcpip_thread: PACKET 0x3ffc3a38
tcpip_thread: PACKET 0x3ffc3a38
tcpip_thread: PACKET 0x3ffc3a38
tcp_output_segment: 6509:6509
tcp_output: nothing to send (0x0)
tcpip_thread: PACKET 0x3ffc3a38
+-+-+-+-+-+-+-+-+-+-+-+-+-+- tcp_input: flags -+-+-+-+-+-+-+-+-+-+-+-+-+-+
tcp_process: unacceptable reset seqno 0 rcv_nxt 0
tcp_output: nothing to send (0x0)
tcpip_thread: PACKET 0x3ffc3a38
tcpip_thread: PACKET 0x3ffc3a38
tcp_output: nothing to send (0x0)
tcpip_thread: PACKET 0x3ffc3a38
tcpip_thread: PACKET 0x3ffc3a38
tcp_output: nothing to send (0x0)
tcpip_thread: PACKET 0x3ffc3a38
tcpip_thread: PACKET 0x3ffc3a38
tcp_output_segment: 6509:6509
tcp_output: nothing to send (0x0)
tcpip_thread: PACKET 0x3ffb9df8
tcpip_thread: PACKET 0x3ffc3a38
I (11467) wifi: pm start, type:0

I (11467) wifi: active cnt: 19
tcpip_thread: PACKET 0x3ffc3a38
tcpip_thread: PACKET 0x3ffc3a38
tcp_output: nothing to send (0x0)
tcpip_thread: PACKET 0x3ffc3a38
tcp_output: nothing to send (0x0)
tcpip_thread: PACKET 0x3ffc3a38
tcpip_thread: PACKET 0x3ffc3a38
tcp_output_segment: 6509:6509
tcp_output: nothing to send (0x0)
tcpip_thread: PACKET 0x3ffc3a38
tcpip_thread: PACKET 0x3ffc3a38
tcpip_thread: PACKET 0x3ffc3a38
tcp_output: nothing to send (0x0)
tcpip_thread: PACKET 0x3ffc3a38
tcpip_thread: PACKET 0x3ffc3a38
tcp_output: nothing to send (0x0)
tcpip_thread: PACKET 0x3ffc3a38
tcpip_thread: PACKET 0x3ffc3a38
tcpip_thread: PACKET 0x3ffaf6bc
tcpip_thread: PACKET 0x3ffc3a38
tcp_output_segment: 6509:6509
tcp_output: nothing to send (0x0)
tcpip_thread: PACKET 0x3ffc3a38
tcpip_thread: PACKET 0x3ffc3a38
tcpip_thread: PACKET 0x3ffc3a38
tcpip_thread: PACKET 0x3ffc3a38
tcpip_thread: PACKET 0x3ffc3a38
tcp_output: nothing to send (0x0)
tcpip_thread: PACKET 0x3ffc3a38
tcpip_thread: PACKET 0x3ffc3a38
tcp_output: nothing to send (0x0)
tcpip_thread: PACKET 0x3ffc3a38
tcpip_thread: PACKET 0x3ffc3a38
tcp_output_segment: 6509:6509
tcp_output: nothing to send (0x0)
tcpip_thread: PACKET 0x3ffc3a38
tcpip_thread: PACKET 0x3ffc3a38
tcpip_thread: PACKET 0x3ffc3a38
tcp_output: nothing to send (0x0)
tcpip_thread: PACKET 0x3ffc3a38
tcpip_thread: PACKET 0x3ffc3a38
I (21467) wifi: active cnt: 3
tcpip_thread: PACKET 0x3ffc3a38
tcp_output: nothing to send (0x0)
tcpip_thread: PACKET 0x3ffc3a38
tcpip_thread: PACKET 0x3ffc3a38
tcp_output_segment: 6509:6509
tcp_output: nothing to send (0x0)
tcpip_thread: PACKET 0x3ffc3a38
tcpip_thread: PACKET 0x3ffc3a38
tcpip_thread: PACKET 0x3ffc3a38
tcpip_thread: CALLBACK 0x3ffaf654
W (23227) tcp_perf:: socket error 113 Software caused connection abort
I (23227) tcp_perf:: create tcp socket error,stop.
tcpip_thread: PACKET 0x3ffaf654
tcpip_thread: PACKET 0x3ffaf4f8
tcpip_thread: PACKET 0x3ffaf4f8
tcpip_thread: PACKET 0x3ffaf4f8
tcpip_thread: PACKET 0x3ffaf4f8
tcpip_thread: PACKET 0x3ffaf4f8
tcpip_thread: PACKET 0x3ffaf4f8

WiFive
Posts: 3529
Joined: Tue Dec 01, 2015 7:35 am

Re: Socket issues

Postby WiFive » Thu Aug 10, 2017 10:05 pm

Looks like they both send 7x tcp_output_segment, but one case receives many unacceptable reset and the other only receives 1 or none. So is there firewall or something else rejecting these packets before they get to wireshark/docker?

heyinling
Posts: 19
Joined: Thu Mar 23, 2017 7:21 am

Re: Socket issues

Postby heyinling » Fri Aug 11, 2017 8:01 am

Hi Permal,

I failed to reproduce your issue:

1. create TCP socket on ESP32
2. do connect to TCP server, server do not reply, let ESP32 re-transmit SYN and timeout (connect() return error, it take around 18 seconds, 3s timeout value * 6 re-transmit times)
3. close socket
4. repeat step 1-3 several times
5. create TCP server on PC
6. create TCP socket and connect to server

I successfully connect to server in step 6.

There might some difference between our test:

1. my PC will reply reset when recv SYN on invalid port. So I block IP packet on NIC to let ESP32 retransmit SYN
2. I tried 3 times before unblock IP packets on NIC

And could you paste the packet capture log after you setup server? did ESP32 send SYN to server?

Thanks!

Who is online

Users browsing this forum: No registered users and 293 guests