lwip-users
[Top][All Lists]
Advanced

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

[lwip-users] TCP_WRITE_FLAG_MORE, tcp_write(), tcp_output() and real out


From: Giuseppe Modugno
Subject: [lwip-users] TCP_WRITE_FLAG_MORE, tcp_write(), tcp_output() and real output TCP segment
Date: Wed, 22 Nov 2017 11:51:38 +0100
User-agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0

I'm trying to understand the mechanisms under TCP_WRITE_FLAG_MORE, tcp_write() and tcp_output(). I'm using raw API.

First of all, I couldn't understand if tcp_output() is useful or not. I understood tcp_output() *really* outputs unsent data, pushing all data to netif driver. Here it's not clear:

  • if unacked data (data already sent but not yet acknlowedged) is sent too;
  • what happens if data in the output buffer is bigger than what netif driver could accept in its sending function (maybe a well written application checks tcp_sndbuf() before writing output data, so this event never happens).

For example:

tcp_write(...)
tcp_write(...)
tcp_write(...)
tcp_output()

Is tcp_output() really needed? It seems data are send even without calling tcp_output().

Another question is the correspondence between tcp_write() calls and output TCP segments, IP packets and Ethernet frames. Are three TCP segments, three IP packets and three Ethernet frames generated? Does lwip try to compact output data in a single TCP segment, IP packet and Ethernet frame?

Another question is about TCP_WRITE_FLAG_MORE flag. I understood this flag should be set in all tcp_write() except the last. However it seems it works with and without that flag in sending data.

reply via email to

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