One simple reason will be not enough pbufs allocated. Each received segment
will take at lease one pbuf. Depending on the memory allocation scheme you
have used each pbuf might be a pre-allocated size (say 1518 + header). In
such a case each received segment in the win XP case will use a 1518 pbuf
to store a 128 byte segment...it's easy to run out! For Win 7 you are less
likely to run out since each segment is 536 so fewer pbufs are need to save
the full payload.

(at lease this is my understanding of how TCP works in lwip - someone
please correct me if I'm wrong!)

You can have dynamic pbuf allocation - slow but possibly better use of
memory.
Pre-allocated fixed size pbufs pools - good performance but sizing pbufs to
give optimal memory use is tricky.
custom pools i.e. varying size pre-allocated pbufs, picked based on best
fit.

Which you select depends on your needs and sometimes the capability if the
device driver (if it uses DMA then dynamic pbuf allocation may not be
possible)

Niall.



On 1 November 2013 07:17, ThomasJ <[email protected]> wrote:

> Hi
>
> I see. Thanks for reply.
>
> But I also wonder, why the lwip crashes when the same amount of data comes
> in segments of 128 from WindowsXP. But do not crash when the same data
> comes
> from Win7 in 536 bytes chunks?
>
> There is enough memory to receive the data (it can be received when send
> from Win7).
>
> I have changed the MSS to 536 and increased the MEM_SIZE a bit. Seems to
> have helped.
>
> Thomas
>
>
>
> --
> View this message in context:
> http://lwip.100.n7.nabble.com/Works-with-Win7-not-Windows-XP-tp22003p22020.html
> Sent from the lwip-users mailing list archive at Nabble.com.
>
> _______________________________________________
> lwip-users mailing list
> [email protected]
> https://lists.nongnu.org/mailman/listinfo/lwip-users
>
_______________________________________________
lwip-users mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/lwip-users

Reply via email to