lwip-users
[Top][All Lists]
Advanced

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

[lwip-users] Efficient sending small data packets


From: ella
Subject: [lwip-users] Efficient sending small data packets
Date: Tue, 12 Nov 2013 02:52:44 -0800 (PST)

I need to send 100 data packets of small (up to 16 bytes) but variable size.
I'm using RAW API TCP server.

1.
My first attempt was to do something like this:
tcp_write( buf1 ... )
tcp_output( ... )
wait for completion
tcp_write( buf2 ... )
tcp_output( ... )
wait for completion
...
It worked but I noticed a relatively big latency (about 200ms or more)
between arrival of buf_n and buf_n+1.
Where does it come from? How lwip stack schedule an actual transmission upon
receipt of tcp_output?

2.
My second attempt was to post all data with tcp_write( buf_n,
TCP_WRITE_FLAG_COPY ) and push it with tcp_output( ... )
It fails on TCP_SND_QUEUELEN check. 
Here I have a question about pbufs allocation. Are pbufs allocated
dynamically (like malloc blocks) and why should a number of queue be limited
by number of pbufs and not by total size of lwip memory pool?

Now I do not know what to do. How to send my 100 buffers efficiently?
Thanks.




--
View this message in context: 
http://lwip.100.n7.nabble.com/Efficient-sending-small-data-packets-tp22041.html
Sent from the lwip-users mailing list archive at Nabble.com.



reply via email to

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