lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] socket write hangs, in LwIP 1.4.? (ppp-new branch but n


From: Mark Lakata
Subject: Re: [lwip-users] socket write hangs, in LwIP 1.4.? (ppp-new branch but not ppp related)
Date: Mon, 31 Dec 2012 15:27:55 -0800
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/17.0 Thunderbird/17.0

I've attached the pcapng file for a failed transfer.  The browser is Chrome at 192.168.0.72, LWIP is running on 192.168.0.73 (STM32F417). As a test, I'm sending a ASCII hex file to the http server, which is reformatting the text and sending it back as HTML. So the returned data stream (LWIP->browser) is slightly bigger than the original data stream (browser->LWIP).

With Chrome, I get four [TCP Window Full] diagnostics on the last packet the browser sends it hangs LWIP.
With Internet Explorer, I get 1 [TCP Window Full]
diagnostics before it hangs. It hangs in the same spot of the uploaded file, though.

It seems clear that the problem is definitely with the TCP Window handling, but I can't tell if it is due to LWIP or the browsers -- I don't understand enough of the TCP protocol.

BTW, I changed my lwipopts.h to this


#define TCP_SND_BUF             (4*TCP_MSS)
#define TCP_WND                 (4*TCP_MSS)

but that did not make a difference. It still hangs on the same line number (approximately) of the POST'ed file contents. It does not always hang on exactly the same line number, but it is pretty close, and never gets farther than 10% into the file (that is, it hangs after the browsers sends about 70000 bytes of POST data).



On 12/21/2012 2:11 AM, address@hidden wrote:
Mark Lakata wrote:
I'm not sure how to get the size of the "connections's TX/RX window sizes".

The easiest way is wiresharp. Posting a pcap here might help us to look at what's going on.

Here is a snippet from the lwipopts.h.
[..]
#define TCP_SND_BUF             (2*TCP_MSS)
#define TCP_WND                 (2*TCP_MSS)

Using half the MSS should work (if it doesn't, it should be a bug in lwIP), but it's not recommended to do so. TCP needs at leasst 4*MSS to work efficiently. I bet with TCP_SND_BUF and TCP_WND set to 2*TCP_MSS, your problems are gone.

The problem here is that TCP tries to prevent sending too many ACKs/window-updates. Most TCP implementations only send an ACK if the resulting change for the remote client is one MSS, this is why you easily run into problems with WND==2*MSS and lwIP splitting up send-data into MSS-sized chunks.

Simon


_______________________________________________
lwip-users mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/lwip-users

Attachment: hungupgrade2.pcapng
Description: Binary data


reply via email to

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