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.

recv packet delay

Hi

I have a CC3000 (service pack version 1.28) setup as a tcp server with recv in an infinite loop.

while(1){
receive_bytes = recv(socket_accept, receive_buffer, 1460, 0);
debug_write_u32(receive_bytes);
debug_write(" ");
debug_write_u32(timer_count);
debug_write_line("");
}

when i send data continuously with “cat /dev/zero | nc 192.168.1.109 1111“ I get a delay in between recv calls that doubles with every 1460 bytes received.

recv return value - timer (ms)
730 - 2
730 - 3
1460 - 4
1460 - 5
1460 - 7
1460 - 10
730 - 102
730 - 104
730 - 309
730 - 312
730 - 722
730 - 725
730 - 1549
730 - 1553
730 - 3200
730 - 3203
730 - 6485
730 - 6489
730 - 13060
730 - 13062
730 - 26211
730 - 26214
730 - 52548
730 - 52551


When I set the SO_SNDBUF size to anything under 2240 like so “cat /dev/zero | nc -O 2240 192.168.1.109 1111“ the problem goes away.

730 - 2
1318 - 4
1460 - 6
1460 - 7
1460 - 8
1460 - 9
1460 - 11
892 - 14
730 - 110
730 - 112
1460 - 113
1460 - 115
1176 - 118
588 - 211
730 - 213
1318 - 214
1460 - 217
1460 - 218
1176 - 219
730 - 316
730 - 317
1318 - 319
1460 - 321
1460 - 322

I have implemented my own flow control on top of tcp to get around this problem. But I’d like to not have to do this and just rely on tcp to manage flow control. Is the behaviour coming from the CC3000.

Thanks Matt