today I have a question about the performance of the xtcp LWIP stack.
As I already wrote in another thread I am currently writing my bachelor thesis and thus working with the TCP/IP stack of XMOS to implement different SSL/TLS libraries.
One of the parts of the thesis is the performance evaluation of the SSL/TLS libraries, so currently I am benchmarking them.
To be more precise, currently I am benchmarking the raw LWIP stack, so plain TCP only without any encryption.
My benchmark is working as follows:
Use the XMOS (eXplorerKIT), as the client, the server is hostet by a python script on my laptop (gigabit ethernet home network, no negative performance impacts).
My PC and my laptop are able to get data rates of 250 Mbit/s, so the script does not affect the xmos performance.
So, the first step is to connect the XMOS to the laptop tcp server, then the client (XMOS) sends 1024 times messages with different length (64, 128, 256, 512, 1024 bytes).
Just to clarify: Each message length is sent 1024 times, to we have a total of 5120 sent messages.
After the messages are sent, the python script calculates the time needed, the bytes received and the Mbit/s.
The results are as follows (data length, Mbit/s):
64 bytes: 0.7177576103839429
128 bytes: 1.3773611413365363
256 bytes: 2.8633973350361006
512 bytes: 5.490116417918642
1024 bytes: 0.20186308525218072
So, as you can see, the results start quite ok: We have a linear increase in the data rate when increasing the packet size, so the stack is scaling properly and it is the amount of messages, that are limiting the data rate.
But when the message length is 1024 bytes, then we have an extremely poor performance I can't explain. To examine this problem a little more, I made some tests and that's what I got:
535 bytes: 5.774755936146872
536 bytes: 0.11135052619139878
So, when sending messages with a length of 535 bytes everything is fine, but when using 536 bytes or more, then the data rate is so bad I don't event want to look at it.
I already testet the stack with the maximum message size of 1472 bytes (xtcp.h XTCP_CLIENT_BUF_SIZE) and the results are even stranger:
1472 bytes: 15.100920105627655
To find out whats going on I captured the benchmark using wireshark and thats what it captured:
(see the attached image at this point)
So, as you might guess, my laptop has the IP 192.168.178.70, the XMOS has IP 192.168.178.104.
What surprises me is, that the message is split into parts (see the Len=1460 and Len=12 what makes 1472 bytes in total again). So, I don't know why the messages are split (even more suprising is that I got one message with 2920 bytes), but thats ok for me. What is more surprising is, that the performance is extremely well compared to the other message sizes. Well, I expected this result as 512 * 3 is only a little more than the 1472 I used, but why is the performance from messages sizes with 536 to 14xx bytes so bad?
I expected a linar growth in data rate with growing message length, but it seems like the stack is performing or behaving not like I expected.
Has anyone an idea why I am experiencing this behavior, how to further investigate or something like this?
Any kind of help is imporant,
Tobias
