RTCS TCP window size issue

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

RTCS TCP window size issue

1,347 Views
brieuc
Contributor II

Hello

 

     I'm currently evaluating the network performances of the Cortex-M4 core in the Vybrid VF6 SoC. For that I'm running a TCP server on MQX to receive any incoming tcp packet. A client sends packets to the server and records the debit. The server is a modified version of the eth-to-serial example.

 

                           The problem is that the TCP rx buffer isn't flushed by the software (I think), as a result the tcp window size decreases until I get a "TCP WINDOW FULL" packet . Increasing the size of the buffer using the OPT_RBSIZE option isn't a solution since the error is still present but appears later. The measured debit is very low compared to what I could expect (about 10 times less).

 

                   Do you have any idea why the buffer isn't emptied fast or hint about the origin of this error. Please find attached the modified demo.c file and the wireshark capture of the packets (192.168.0.44 is the Vybrid).

 

 

 

Brieuc

Original Attachment has been moved to: mqx_capture.zip

Original Attachment has been moved to: demo.c.zip

Labels (1)
0 Kudos
5 Replies

809 Views
chris-quin
Contributor I

The Reason is, that the window size depends on the buffer size of the socket. Every single time a packet is received, the function TCP_Advertise_receive_window checks if it has to send an acknowledge with the new window size. The information about the new window size will only send, if half of the buffersize was used and only increment ist about the half of the buffer size.

So the solution is to increase the buffersize of the socket 2 times larger then the maximum expected packet size.

0 Kudos

809 Views
chris-quin
Contributor I

Hello,

i got the same Problem. Every transmission the window size is reducing when a packages is received and after x packages it returns to normal.

Example:

I have a window size of 300Bytes and i'm sending packages with about 250bytes. After every package the window is reducing by 10Bytes.

1. -> 300

2. -> 290

....

6. -> 240

After 6 Transmission the window size is to small to receive a complete packages and Data is lost.

If i sending packages with about 100bytes the windows size is also counting down, but after about 12 packages it returns to normal.

So, are there news about this issue??

Best regards, Chris

0 Kudos

809 Views
alejandrolozan1
NXP Employee
NXP Employee

Hi,

Let me test your code, I will see if I can find the problem.

Best Regards,

Alejandro

0 Kudos

809 Views
brieuc
Contributor II

Hello

Do you want the linux executable i'm using to inject data packets ?

Regards

Brieuc

0 Kudos

809 Views
alejandrolozan1
NXP Employee
NXP Employee

Sure!!, If it is possible

0 Kudos