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: Joel Cunningham
Subject: Re: [lwip-users] Raw api + multiple TCP Connections
Date: Sat, 27 May 2017 21:48:08 -0600

You're seeing the send stop from the server because the client's receive window 
is smaller than the next segment to send. At packet 28091, the receiver's 
window drops to 4 bytes and the sender's next segment is 8 bytes

LwIP (on the server) is treating this as a zero window rather than splitting 
the next segment to be 4 bytes.

You may want to check your client application to make sure it's updating the 
window when processing received data. See tcp_received()

Joel

> On May 26, 2017, at 06:28, Werner Motz <address@hidden> wrote:
> 
> 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. 
> 
> 
> 
> 
> _______________________________________________
> lwip-users mailing list
> address@hidden
> https://lists.nongnu.org/mailman/listinfo/lwip-users



reply via email to

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