lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] tcp_write function merges 2 different packets while sen


From: Rod Boyce
Subject: Re: [lwip-users] tcp_write function merges 2 different packets while sending
Date: Sat, 21 Dec 2019 14:52:15 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0

On 21/12/2019 08:53, goldsimon wrote:
>
> Urvi wrote:
>> [..]
>>
>> But when I send 1 data packet of size=6 bytes (call tcp_write() and
>> then
>> tcp_output()) and next packet of size=45 bytes (call tcp_write() and
>> then
>> tcp_output()), then at server side it receives as a one single data
>> packet
>> of size=51 bytes; due to this my complete data packet becomes garbage
>> and I
>> got failure in communication. (this is just one packet example, but it
>> happens often).
>>
>>
>> How to solve this issue?
> That's expected TCP behaviour, not an lwIP issue. Of you need datagrams 
> strictly separated, use UDP.
>
> Regards,
> Simon
>
> _______________________________________________
> lwip-users mailing list
> address@hidden
> https://lists.nongnu.org/mailman/listinfo/lwip-users


TCP is a streaming protocol this means that packets can be joined
together either at the sender or the receiver.

UDP will keep the packets separate but sending a 6 byte packet is very
inefficient over Ethernet. 

The minimum Ethernet packet size is 64-bytes, if you are the protocol
owner I would suggest some sort of packet ageration to merge smaller
packets and make for a more efficient transfer over Ethernet.


Rod





reply via email to

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