lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] pbuf pool size / mss size in low memoryenvironmentand r


From: David Empson
Subject: Re: [lwip-users] pbuf pool size / mss size in low memoryenvironmentand routing to slow link
Date: Thu, 03 Dec 2009 10:28:51 +1300


"Simon Goldschmidt" <address@hidden> wrote:
"Marco Jakobs" address@hidden wrote:
I'm just wondering how the PPP of LWIP is handling the pbuf's, maybe
someone can drop a line about this ...

I don't know that by heart but I think I remember the PPP code (as it is ported from sources that don't know pbufs) needs the input packets in contigouous memory and copies from PBUF_POOL to PBUF_RAM if the input packet is a linked list of pbufs (i.e. p->len != p->tot_len).

I can't see any evidence of that.

The code appears to be correctly dealing with pbufs that are smaller than the MTU.

On the transmit side, the IP packet supplied by LWIP is processed by pppifOutput(). It steps through each pbuf in the supplied chain (relying on pb->next = NULL to detect the end of the packet). The IP packet is copied into a new chain of pbufs (of type PBUF_RAW), adding the PPP framing and control character escaping. The expanded PPP frame could be up to twice as big as the MTU in the worst case. The transmit code then steps through the pbufs holding the PPP frame and writes each of them in turn.

The receive side is reading one byte at a time and state machine allocates new pbufs as required to hold the data, allocating a new pbuf each time it has accumulated PBUF_POOL_BUFSIZE bytes. pbuf_cat() is used to attach each pbuf to the existing chain.





reply via email to

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