W5200 different speed with different PC

Hi,

I’m using the WIZ820io module which contains the W5200 in TCP mode and I need to transmit at the maximum speed from the module to a PC. The connection is direct, no switch in between. With my custom hardware I’m clocking the SPI at 70MHz, and connecting it to some PCs I’m able to obtain a continuous throughput of 70Mb/s. I’m using two sockets with 8kB memory for TX and RX for both. So far so good.

With other PCs instead the situation is different: I cannot go beyond 42Mb/s, and that is strange because they are very fast workstations with lot of RAM and multiple fast CPU. My custom hardware is behaving in the same way in both cases.

I start saying that I disabled delayed ack in the PC, so that if possible it should ack each single packet received. From my hardware I issue send commands of full buffers (8192 bytes) each time (eventually dividing it in two if exceeding the maximum socket address). I analyzed with Wireshark why this happens and I discovered one curious thing.

PC_1 trace:
Pkt1 received: 1460 bytes.
Pkt2 received: 1460 bytes.
PC ACK for packets 1 & 2.
Pkt3 received: 1460 bytes.
Pkt4 received: 1460 bytes.
PC ACK for packets 3 & 4.
Pkt5 received: 1460 bytes.
Pkt6 received: 892 bytes.
PC ACK for packets 5 & 6.
700 us delay.
Pkt1 received: 1460 bytes.
Pkt2 received: 1460 bytes.
PC ACK for packets 1 & 2.
Pkt3 received: 1460 bytes.
Pkt4 received: 1460 bytes.
PC ACK for packets 3 & 4.
Pkt5 received: 1460 bytes.
Pkt6 received: 892 bytes.
PC ACK for packets 5 & 6.
700 us delay.

PC_2 trace:
Pkt1 received: 1460 bytes.
Pkt2 received: 1460 bytes.
Pkt3 received: 1460 bytes.
Pkt4 received: 1460 bytes.
PC ACK for packets 1, 2, 3 & 4.
700 us delay.
Pkt5 received: 1460 bytes.
Pkt6 received: 892 bytes.
PC ACK for packets 5 & 6.
700 us delay.
Pkt1 received: 1460 bytes.
Pkt2 received: 1460 bytes.
Pkt3 received: 1460 bytes.
Pkt4 received: 1460 bytes.
PC ACK for packets 1, 2, 3 & 4.
700 us delay.
Pkt5 received: 1460 bytes.
Pkt6 received: 892 bytes.
PC ACK for packets 5 & 6.
700 us delay.

The W5200 divide each packet in MTU as expected and each packet is sent at maximum speed (about 70 Mb/s I think). But there are strange delays that make the overall throughput decrease for PC_2. For PC_2 the transfer speed is indeed 819228/(700us*4) = 46Mb/s. As you can see the only difference is that PC_1 is able to ack every two packets and that result in an high throughput. Instead PC_2 is maybe not fast enough to ack every two packets but ack after the first four. But it is indeed very fast too because (I didn’t indicate it) from Pkt4 to ack there are 10 us, so this delay isn’t the problem.

The problem I think is in some way inside the W5200, because after receiving the ack of the fourth packet it takes additional 700us to send the other data (and I send to W5200 full 8192 packets, so the chip should have already all the data). I’m not able still to understand why and how to overcome this. What is the reason of this delay in your opinion? Do you think it is better to send to W5200 MTU packet size instead of full buffer size to optimize the speed?

Thank you in advance.