lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] TCP retransmissions and duplicate ACKs


From: dii
Subject: Re: [lwip-users] TCP retransmissions and duplicate ACKs
Date: Tue, 10 Sep 2013 07:34:30 -0700 (PDT)

Hi Marty,

I'm not using any OS, it's bare metal (you could say cooperative multitasking through non-blocking sub-system state machines). The network is serviced at more than 3kHz. I print out the min and max main cycle times (every 5s for each of the last 5 x 1s), and the max is usually around 1ms (the highest I've seen was 53ms), so I don't think that is the issue.

I did enable some more lwip debugging output and saw that at some point pbuf fails to allocate memory on receiving a packet. This does not make sense to me as the packets are small and infrequent (every 20s), and I do see pbuf free messages in the debugging output. I expect that the number of buffers should be quite sufficient for the small and infrequent frames as they should get reused. This is a memory setup that I tested yesterday (and that also failed):
/* MEMP_NUM_PBUF: the number of memp struct pbufs. If the application
   sends a lot of data out of ROM (or other static memory), this
   should be set high. */
#define MEMP_NUM_PBUF           40
/* MEMP_NUM_UDP_PCB: the number of UDP protocol control blocks. One
   per active UDP "connection". */
#define MEMP_NUM_UDP_PCB        4
/* MEMP_NUM_TCP_PCB: the number of simultaneously active TCP
   connections. */
#define MEMP_NUM_TCP_PCB        4
/* MEMP_NUM_TCP_PCB_LISTEN: the number of listening TCP
   connections. */
#define MEMP_NUM_TCP_PCB_LISTEN 4
/* MEMP_NUM_TCP_SEG: the number of simultaneously queued TCP
   segments. */
#define MEMP_NUM_TCP_SEG        20
/* MEMP_NUM_SYS_TIMEOUT: the number of simultaneously active
   timeouts. */
#define MEMP_NUM_SYS_TIMEOUT    5


/* ---------- Pbuf options ---------- */
/* PBUF_POOL_SIZE: the number of buffers in the pbuf pool. */
#define PBUF_POOL_SIZE          16

/* PBUF_POOL_BUFSIZE: the size of each pbuf in the pbuf pool. */
#define PBUF_POOL_BUFSIZE       1536

Regards,
Dawid


View this message in context: Re: TCP retransmissions and duplicate ACKs
Sent from the lwip-users mailing list archive at Nabble.com.

reply via email to

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