This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

RTOS/PROCESSOR-SDK-AM57X: TCP socket performance issue

Part Number: PROCESSOR-SDK-AM57X


Tool/software: TI-RTOS

Hello

I'm using AM572x IDK board with TI-RTOS SDK 05.03.00.07 and detected TCP performance issue with simple stress-test.

I'm using the NIMU FTP example project for my board for TCP speed measure.

First of all, I patched my PDK with that patch:

diff --git a/packages/ti/transport/ndk/nimu/example/am572x/armv7/bios/nimu_idk.cfg b/packages/ti/transport/ndk/nimu/example/am572x/armv7/bios/nimu_idk.cfg
index 35028250..ee1377f6 100644
--- a/packages/ti/transport/ndk/nimu/example/am572x/armv7/bios/nimu_idk.cfg
+++ b/packages/ti/transport/ndk/nimu/example/am572x/armv7/bios/nimu_idk.cfg
@@ -172,9 +172,9 @@ if (enableStaticIP)
 	Ip.ResolveIP = false;
 	Ip.CallByIP = false;
 	Ip.autoIp = false;
-    Ip.address = "192.168.1.4";
+    Ip.address = "192.168.6.4";
     Ip.mask = "255.255.255.0";
-    Ip.gatewayIpAddr = "192.168.1.1";
+    Ip.gatewayIpAddr = "192.168.6.1";
 }
 else
 {
diff --git a/packages/ti/transport/ndk/nimu/example/ftpApp/ftpserver/ftp_filerout.c b/packages/ti/transport/ndk/nimu/example/ftpApp/ftpserver/ftp_filerout.c
index ed16f464..c2c01862 100644
--- a/packages/ti/transport/ndk/nimu/example/ftpApp/ftpserver/ftp_filerout.c
+++ b/packages/ti/transport/ndk/nimu/example/ftpApp/ftpserver/ftp_filerout.c
@@ -14,7 +14,7 @@ int32_t ftp_filerout_read(io_handler_t *ioh, char *path)
 {
     int32_t i;
 
-    for (i=0; i<5000;i++)
+    for (i=0; i<50000;i++)
     {
         send(ioh->data_socket, ioh->DataBuf, DATA_BUFFER_SIZE, 0);
         Task_yield();
diff --git a/packages/ti/transport/ndk/nimu/example/ftpApp/ftpserver/ftpserver.h b/packages/ti/transport/ndk/nimu/example/ftpApp/ftpserver/ftpserver.h
index f8a08ef5..edb83b88 100644
--- a/packages/ti/transport/ndk/nimu/example/ftpApp/ftpserver/ftpserver.h
+++ b/packages/ti/transport/ndk/nimu/example/ftpApp/ftpserver/ftpserver.h
@@ -58,7 +58,7 @@ extern "C" {
 #define INPUT_STRING_SIZE				(1024)
 #define BUFFER_SIZES					(1024)
 #define NAME_AND_PASSWD_LEN				(64)
-#define DATA_BUFFER_SIZE				(512) //1560*3
+#define DATA_BUFFER_SIZE				(1560*3)
 
 
 /**

Then I build & load that example project on IDK board & measure download speed (using wget command wget user:password@192.168.6.4/test --no-passive).

I see the attached output in my console & capture attached file with Wireshark tool:

alex@alex-B250M-D3H:~/tmp/ftp_test$ wget ftp://user:password@192.168.6.4/test --no-passive
--2019-07-08 09:15:08--  ftp://user:*password*@192.168.6.4/test
           => ‘test.6’
Connecting to 192.168.6.4:21... connected.
Logging in as user ... Logged in!
==> SYST ... done.    ==> PWD ... done.
==> TYPE I ... done.  ==> CWD not needed.
==> SIZE test ... done.

==> PORT ... done.    ==> RETR test ... done.

test.6                                                 [      <=>                                                                                                        ]  22.32M  20.1MB/s    in 1.1s    

2019-07-08 09:15:09 (20.1 MB/s) - ‘test.6’ saved [23400000]

alex@alex-B250M-D3H:~/tmp/ftp_test$ wget ftp://user:password@192.168.6.4/test --no-passive
--2019-07-08 09:15:12--  ftp://user:*password*@192.168.6.4/test
           => ‘test.7’
Connecting to 192.168.6.4:21... connected.
Logging in as user ... Logged in!
==> SYST ... done.    ==> PWD ... done.
==> TYPE I ... done.  ==> CWD not needed.
==> SIZE test ... done.

==> PORT ... done.    ==> RETR test ... done.

test.7                                                 [       <=>                                                                                                       ]  22.32M   195KB/s    in 54s     

2019-07-08 09:16:06 (422 KB/s) - ‘test.7’ saved [23400000]

alex@alex-B250M-D3H:~/tmp/ftp_test$ 


ftp_speed_issue_1560x3_gzip_bad.pcapng.zip

As you can see in the log file, TCP speed was downgraded from ~22MB/s to ~100-200KB/s in second receiving.

FTP connection transactions were sequential, not concurrent.

If packages/ti/transport/ndk/nimu/example/ftpApp/ftpserver/ftpserver.h file diff applying was disabled, all works file after fifth connection too (log & Wireshark capture were attached too).

alex@alex-B250M-D3H:~/tmp/ftp_test$ wget ftp://user:password@192.168.6.4/test --no-passive
--2019-07-08 09:27:48--  ftp://user:*password*@192.168.6.4/test
           => ‘test.21’
Connecting to 192.168.6.4:21... connected.
Logging in as user ... Logged in!
==> SYST ... done.    ==> PWD ... done.
==> TYPE I ... done.  ==> CWD not needed.
==> SIZE test ... done.

==> PORT ... done.    ==> RETR test ... done.

test.21                                                [      <=>                                                                                                        ]  24.41M  21.5MB/s    in 1.1s    

2019-07-08 09:27:50 (21.5 MB/s) - ‘test.21’ saved [25600000]

alex@alex-B250M-D3H:~/tmp/ftp_test$ 


ftp_speed_issue_512_gzip_good.pcapng.zip

How can I send big file parts (more than ~2KB) with good speed without manual splitting it?

My working environment: CCS v8.1.0, TI-RTOS SDK 05.03.00.07, Ubuntu x64 16.04.6 LTS. I'm connected to IDK board J10 (Gb Ethernet 0) using the second NIC.

With regards,
Alex

P.S. It looks like TCP retransmit timeout detection timer bad configuration.