lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] TCP Buffer Size Increment


From: Simon Goldschmidt
Subject: Re: [lwip-users] TCP Buffer Size Increment
Date: Wed, 3 Feb 2016 07:08:06 +0100

Gaurav Jain wrote:
> I have implemented a TCP server [..]
> I have set the buffer limit size at the client to 512 bytes. However,
> what I am observing is that the first packet the server receives is
> 512 bytes, but there onwards the packet size is randomly changing and
> most of the times being 1460 bytes.

Since TCP is a streaming protocol, you can never ensure the remote side
sends 512 byte segments. You need to handle the data as it comes in
instead or use UDP, where you can control the datagram size.

One thing you could do is put an upper limit to the segment size by
changing TCP_MSS. However, 536 is the lower limit for this, so when setting
it to 512, the remote side is still allowed to send 536 bytes. Plus it
is allowed to send less...


Simon



reply via email to

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