SPRACT8 September 2020 66AK2H06 , 66AK2H12 , 66AK2H14
Test result shows that 2,560,000 bytes data is transferred in a short duration. It is good to run a longer transfer with more data for measurement accuracy.
The transmitting is controlled inside ftp_filerout.c file:
int32_t ftp_filerout_read(io_handler_t *ioh, char *path)
{
……
for (i=0; i<5000;i++)
{
send(ioh->data_socket, ioh->DataBuf, DATA_BUFFER_SIZE, 0);
Task_yield();
}
.….
}
The DATA_BUFFER_SIZE is defined as 512. This is how 2,560,000 bytes (5,000 x 512) comes from. The packets captured on the wire show the packet size is 566 bytes, as a result of 54 bytes header (14 bytes Ethernet + 20 bytes IP + 20 bytes TCP) in addition to the 512 bytes data payload. This will not fully utilize the maximum Ethernet packet size which can be up to 1,514 bytes without fragmentation. One may update the DATA_BUFFER_SIZE to 1,460 (=1,514 – 54) and use a larger for() loop, e.g. 200,000 for test. This effectively transmits 292,000,000 bytes data with Maximum Transmission Unit (MTU) size.
Task_yield() is used to yield current task to other tasks with the same priority. It is unnecessary in such a simple test, so it can be commented out to tighten the for() loop.