I am trying to make sure my device can handle the throughput requirements I 
have.  I am finding that when I start to send more data out, I begin dropping 
packets on the tcp_write function.  I tried playing with many of the settings 
in the lwipopts.h file and can't seem to find something that will work 
continuously.

I have a Cortex-M3 device running as a server and I only allow 1 client to 
connect.  With a light load, everything performs well.  However, when I start 
sending data packets of about 50 bytes every 10 ms, packets start dropping out 
and the data is lost.  In most configurations I have tried, it gets lost due to 
the  snd_queuelen getting too large.  I can't figure out why it is getting so 
big.  I also notice that if I send data for a brief period at a higher rate, 
that value climbs up and then when I stop sending, it doesn't always return 
back down to 0.  This makes the next blast of data spin the value up to and 
over the limit causing data lost.  Should it return to 0?

How do I prevent this error from occurring and are there other settings in the 
options file that I should change to obtain the performance without lost 
packets?  I included some of defines below.  I don't mind if several of the 50 
byte packets are combined into 1 TCP packet and I have about 30K of RAM to 
dedicate to the lwip for good performance.  I read the Tuning TCP wiki page but 
can't find the right combination of values.   Based on this information, can 
someone offer suggestions or point me to a better resource for my application?

//*****************************************************************************
// ---------- Memory options ----------
#define MEM_ALIGNMENT                   4           // default is 1
#define MEM_SIZE                        (22 * 1024)  // default is 1600, was 16K

//*****************************************************************************
// ---------- Internal Memory Pool Sizes ----------
#define MEMP_NUM_PBUF                     24    // Default 16, was 16
#define MEMP_NUM_TCP_PCB                  1    // Default 5, was 12


//*****************************************************************************
// ---------- TCP options ----------
LWIP_TCP                        1
#define TCP_WND                         4096   // default is 2048
#define TCP_MSS                        1024        // default is 128
#define TCP_SND_BUF                     (16 * TCP_MSS// default is 256, was 6 *
//#define TCP_SND_QUEUELEN                (4 * (TCP_SND_BUF/TCP_MSS))

_______________________________________________
lwip-users mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/lwip-users

Reply via email to