lwip-users
[Top][All Lists]
Advanced

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

[lwip-users] netconn api problem


From: Tyrel Newton
Subject: [lwip-users] netconn api problem
Date: Wed, 27 Oct 2010 14:32:46 -0700

I have an 10Mbit Ethernet application that strictly uses TCP via the netconn 
API. All TCP writes are done with the NETCONN_COPY flag. I have 128MB of RAM in 
my system and all of the resource sizes set pretty high in lwipopts.h. I 
monitor the resources and I have yet to see the max come close to the avail.

A problem occurs when I do the following:

1) send a huge buffer via a single call to netconn_write with sizes well over 
64kB (usually in the 0.25~1 MB range)
2) immediately send a pretty small buffer (much less than the MSS for Ethernet) 
via a single call to netconn_write

The problem is that the first byte (and only the first byte) of the second 
netconn_write call seems to get dropped. This happens randomly and not terribly 
frequently (maybe 10% of the time at worst). I can mitigate the problem by 
inserting a few seconds of delay between the two calls to netconn_write. The 
delay, I think, gives lwIP plenty of time to empty the send buffer and process 
the numerous TCP ACKS that are required to send the large buffer of data. The 
longer the delay, the less likely the first byte of the second call gets 
dropped.

I'm connecting to lwIP from a Windows PC via a socket in python. I have a hard 
time believing the PC is dropping the byte. I know I could verify this with 
Wireshark, but since the problem is random and not too frequent, it would take 
me forever to wade through the lengthy packet history.

Anybody have any insight and/or guidance on where I might go in the code or 
what settings I might tweak to fix and/or understand this issue?

Thanks,
Tyrel

Other lwipopts.h settings that might be relevant:

MEM_LIBC_MALLOC = 1
TCP_OVERSIZE = 1
LWIP_TCPIP_CORE_LOCKING = 1
LWIP_TCPIP_CORE_LOCKING_INPUT = 1




reply via email to

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