lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lwip-users] Raw api + multiple TCP Connections


From: Werner Motz
Subject: Re: [lwip-users] Raw api + multiple TCP Connections
Date: Fri, 26 May 2017 14:28:40 +0200

Thank you very much for your answers. I am able to receive my data from both
clients now at the same time.
One strange issue or at least something I do not understand still remains :

I can receive all incoming data but when I try to send dummy data back in
the receive callback, after 
about 20 seconds lwip sends out only ACK Frames.

In my example two clients are connected, but only one client is sending data
every 5ms. As you can see in the
Link  https://www.pic-upload.de/view-33230789/wireshark.png.html my client
with ip 192.168.0.8 sends data
periodically to the server (192.168.0.2) In reply I send back dummy data.
But suddenly the server does not send
back dummy data any longer. The client does not get dummy data + ack  and
because his timeout still did not 
occur, he sends new data in greater frames. 
In Frame 28094 the server only sends back an ACK without any data.

I debugged this issue and found out, that although tcp_write() does not
return an error, the send_wnd int tcp_output()
suddenly becomes too small. 

In tcp_output() I found the reason for the ACK Frame.

wnd = LWIP_MIN(pcb->snd_wnd, pcb->cwnd);

if (pcb->flags & TF_ACK_NOW && (seg == NULL ||
lwip_ntohl(seg->tcphdr->seqno) - pcb->lastack + seg->len > wnd)) 
{
     return tcp_send_empty_ack(pcb);
}

By setting a breakpoint to "return tcp_send_empty_ack(pcb)" I got the
arguments for the if case and because 
of lwip_ntohl(389349632) - 79127 + 16 > 4 ) I go there. 

Of course I watched the lwip stats but I did not get any errors. Neither
link, tcp nor  mem / memp.
What could be the reason for that behavior? I increased my TCP_SND_BUF and
TCP_SND_QUEULEN
but without any difference.

#define TCP_WND                            16 * TCP_MSS
#define TCP_MSS                            1460
#define TCP_SND_BUF                16 * TCP_MSS   
#define TCP_SND_QUEUELEN       48

Thank you very much. 

 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]