AnsweredAssumed Answered

Problem with TCP socket on board based on imx6q.

Question asked by Philippe VERDIER on Mar 18, 2014

We have developed a card -based IMX6Q processor that is integrated in our signal analyzer. We use Linux 3.0.35 as the operating system . We have on this board a server application that enables a host PC to control our analyzer through a GigaBit Ethernet connection. We found delays of several hundred milliseconds between sending a command from the PC and his acquittal by IMX6 card. To hold harmless our application we wrote a python script that simulates the operation of our client / server application. The operation is as follows :
- The client connects to the server via a TCP -IP socket and in an infinite loop :
  
- Sends a command to read a data table on the server (the size is specified in the command)
  
- Reading data sent by the server
- The server waits for a connection from a client, then, after a client is connected, wait loop playback control data and sends to the client the amount of data requested.


With our board we find the following problem:
If the size of data requested by the client is less than the payload of a TCP-IP frame there is no problem. As soon as the data size requires the server sending 2 frames TCP-IP then periodically the server application sends 2 times the second part of the data. With WireShark (on the host PC) we observe the following procedure:
a) Normal operation
The client on the PC sends the command frame reading 1604 bytes (frame size = 66 bytes)
The server on IMX6 card sends 2 data frames ~150us after the command (1514 bytes for the first and 198 for the second).
The PC performs the second data frame sent by the IMX6 card.
b) malfunction

The client on the PC sends the command frame reading 1604 bytes (frame size = 66 bytes)
The server on IMX6 card sends 1 data frames ~150us after the command (1514 bytes).

The client acknowledge the last server frame after ~200 ms

The client receive the second data frame (198 bytes) after ~200 ms

The client receive again the second data frame (198 bytes) after less than ~10 us

The client acknowledge the last received frame


If the server is running on the PC and the client on the IMX6 board there are far more less problems (some times the client need to retransmit the command).


We have reproduce almost the same problem on 2 SABRE-LITE evaluation board (one board equipped with a silicon revision 1.0 IMX6 processor and the other with a revision 1.2).

The python script "pcomor3x.py" can be used to reproduce the problem.

On the server side enter :

python pcomor3x.py serveur 3000

 

where 3000 is the port number

 

On the client side enter :

python pcomor3x.py tcp-ip-server-adress 3000 1604

 

where 3000 is the port number and 1604 is the requested data size (in number of bytes).

 

 

Someone has already encountered this kind of problem?

Original Attachment has been moved to: pcomor3x.py.txt.zip

Outcomes