WIZnet Developer Forum

W5500: maximum parallel requests from same client

Hello,

I have a problem with a W5500 based system, using the latest Wiznet lib from github.
I have a server running on an STM32F103C8T8 board, and checking the incoming requests. When a client requests is received, it is served, only one request at a time.
The requested HTML page, loaded from an SD card, has 4 images asserted.
The client (browser) request the HTML page and before it is loaded completely, the asserted four images are also requested in parallel.

However, it seems that the request for the forth (last) image is rejected by the W5500 chip, the browser receives “ERR_CONNECTION_REFUSED”.

Attached the client (Google Chrome) network log:

[I cannot attach a picture (68kB JPG), “HTTP error” message is shown…]
Also see here: stm32duino.com/viewtopic.php?f=9 … 011#p22011

and the server log:

urrent date and time: 17-01-06 11:40:32 ---> request from: 192.168.100.51 --- Socket status --- Socket 0 is ESTABLISHED, port: 80, D: 192.168.100.51(58303), RX: 420 Socket 1 is LISTEN, port: 80, D: 192.168.100.1(123), RX: 0 Socket 2 is CLOSED, port: 80, D: 192.168.100.51(57950), RX: 0 Socket 3 is CLOSED, port: 80, D: 192.168.100.51(58096), RX: 0 GET /web/index.htm HTTP/1.1 Checking request: web/index.htm ...processed in: 258 --- Socket status --- Socket 0 is ESTABLISHED, port: 80, D: 192.168.100.51(58303), RX: 0 Socket 1 is ESTABLISHED, port: 80, D: 192.168.100.51(58304), RX: 371 Socket 2 is CLOSED, port: 80, D: 192.168.100.51(57950), RX: 0 Socket 3 is CLOSED, port: 80, D: 192.168.100.51(58096), RX: 0 <--- client end. Current date and time: 17-01-06 11:40:32 ---> request from: 192.168.100.51 --- Socket status --- Socket 0 is SYNRECV, port: 80, D: 192.168.100.51(58305), RX: 0 Socket 1 is ESTABLISHED, port: 80, D: 192.168.100.51(58304), RX: 371 Socket 2 is CLOSED, port: 80, D: 192.168.100.51(57950), RX: 0 Socket 3 is CLOSED, port: 80, D: 192.168.100.51(58096), RX: 0 GET /web/img/backgrnd.png HTTP/1.1 Checking request: web/img/backgrnd.png ...processed in: 596 --- Socket status --- Socket 0 is ESTABLISHED, port: 80, D: 192.168.100.51(58305), RX: 370 Socket 1 is ESTABLISHED, port: 80, D: 192.168.100.51(58304), RX: 0 Socket 2 is CLOSED, port: 80, D: 192.168.100.51(57950), RX: 0 Socket 3 is CLOSED, port: 80, D: 192.168.100.51(58096), RX: 0 <--- client end. Current date and time: 17-01-06 11:40:33 ---> request from: 192.168.100.51 --- Socket status --- Socket 0 is ESTABLISHED, port: 80, D: 192.168.100.51(58305), RX: 370 Socket 1 is LISTEN, port: 80, D: 192.168.100.51(58304), RX: 0 Socket 2 is CLOSED, port: 80, D: 192.168.100.51(57950), RX: 0 Socket 3 is CLOSED, port: 80, D: 192.168.100.51(58096), RX: 0 GET /web/img/pump-on.png HTTP/1.1 Checking request: web/img/pump-on.png ...processed in: 34 --- Socket status --- Socket 0 is ESTABLISHED, port: 80, D: 192.168.100.51(58305), RX: 0 Socket 1 is LISTEN, port: 80, D: 192.168.100.51(58304), RX: 0 Socket 2 is CLOSED, port: 80, D: 192.168.100.51(57950), RX: 0 Socket 3 is CLOSED, port: 80, D: 192.168.100.51(58096), RX: 0 <--- client end. Current date and time: 17-01-06 11:40:33 ---> request from: 192.168.100.51 --- Socket status --- Socket 0 is LISTEN, port: 80, D: 192.168.100.51(58305), RX: 0 Socket 1 is ESTABLISHED, port: 80, D: 192.168.100.51(58306), RX: 365 Socket 2 is CLOSED, port: 80, D: 192.168.100.51(57950), RX: 0 Socket 3 is CLOSED, port: 80, D: 192.168.100.51(58096), RX: 0 GET /web/img/ww.png HTTP/1.1 Checking request: web/img/ww.png ...processed in: 27 --- Socket status --- Socket 0 is LISTEN, port: 80, D: 192.168.100.51(58305), RX: 0 Socket 1 is ESTABLISHED, port: 80, D: 192.168.100.51(58306), RX: 0 Socket 2 is CLOSED, port: 80, D: 192.168.100.51(57950), RX: 0 Socket 3 is CLOSED, port: 80, D: 192.168.100.51(58096), RX: 0 <--- client end.

As one can see, the requests are handled consecutively by the server, but the request for the last image (compress.png) seems to be rejected by the W5500 hardware before is transmitted to the server software.

Can someone give a hint what am I missing?
Or it is a well known limitation of the W5500 chip to be able to receive only up to 4 parallel request from the same client?

As a follow up to the solution provided @stm32duino.com.
I was writing server for W5100 which has only 4 sockets. All 4 sockets were used at the same time, but if browser concurrently tries additional connection, it is refused. I even opened thread on Chrome support, did not help much. Thus I stuck to using Firefox as you do. For tuning it see here rs.gr8bit.ru/Documentation/GR8NET-manual.pdf section “MSX server”. In other words - do not use Google Chrome, it is not tunable and opens persistent connections which occupy sockets, but do not use them, for the time enough for other client/request to fail (average time of open socket is about 10 seconds).

@Eugeny,
nice project.
I am thinking on changing the Ethernet lib so that 4 sockets shall be listening at a time instead of only one in the current version (although 8 sockets available), and see whether the processing of simultaneous requests will be improved or not.

Copyright © 2017 WIZnet Co., Ltd. All Rights Reserved.