zephyrproject-rtos / zephyr

Primary Git Repository for the Zephyr Project. Zephyr is a new generation, scalable, optimized, secure RTOS for multiple hardware architectures.
https://docs.zephyrproject.org
Apache License 2.0
10.63k stars 6.5k forks source link

TCP connection fails if communication slows down. #2376

Closed zephyrbot closed 7 years ago

zephyrbot commented 8 years ago

Reported by Juan Manuel Cruz Alcaraz:

ENC28J60 ethernet device is a SPI device that can be sligthly slower that other similar devices because it depends on SPI communication interface with the board.

All TCP connections are failing with an Arduino 101 and an ENC28J60 device.

After testing and comparing TCP connection handshake between a Galileo (working ok) and an Arduino101/ENC28J60 I discovered that a slower SYN/ACK exchange makes the IP stack to ignore the connection established.

Galileo TCP handshake trace shows as follows: 0.000000000 ARP (client->server) 0.000048000 ARP (server->client) 0.595497000 SYN (client->server) 0.595548000 SYN,ACK (server->client) 1.595548000 PSH,ACK (client->server)

And the connection stablish succesfully, notice the timestamps in the TCP frames.

For Arduino 101 I got the following TCP handshake trace:

0.000000000 ARP (client->server) 0.000048000 ARP (server->client) 1.000518000 SYN (client->server) 1.000614000 SYN,ACK (server->client) 2.198899000 SYN,ACK (retransmission) 2.206924000 ACK (client->server)

Notice the timestamps and check the difference of response times (it should not be an issue for the TCP implementation). Notice the exchange is succesful but there is no PSH flag, and the TCP/IP stack does not send any data frames after this, because it does not recognize the connection. Nevertheless the server do states there is an open connection.

I attach the wireshark traces as additional reference

(Imported from Jira ZEP-869)

zephyrbot commented 8 years ago

by Juan Manuel Cruz Alcaraz:

zephyrbot commented 8 years ago

by Juan Manuel Cruz Alcaraz:

zephyrbot commented 8 years ago

by Sharron LIU:

Juan Manuel Cruz Alcaraz , priority = high in case this blocking the development of eth driver. Otherwise pleas adjust to medium priority. Thanks.

zephyrbot commented 7 years ago

by Mark Linkmeyer:

Andrei Laperie , just a friendly reminder to check on this bug (per review in today's Execution Checkpoint Meeting). Thx.

zephyrbot commented 7 years ago

by Sharron LIU:

detected on existing IP stack. Closing per WW46.4 bug grooming meeting.

zephyrbot commented 7 years ago

by Mark Linkmeyer:

Correcting the priority field