[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [lwip-devel] tcp_output does not force seg sent out
From: |
narke |
Subject: |
Re: [lwip-devel] tcp_output does not force seg sent out |
Date: |
Fri, 9 Mar 2012 15:50:32 +0800 |
On 9 March 2012 15:08, Simon Goldschmidt <address@hidden> wrote:
> narke <address@hidden> wrote:
>> I found it's not always that the tcp_output() call can make a segment
>> to be sent out. Sometimes it still accumulated data until TCP_MSS
>> reached before output a segment.
>
> That's the nagle algorithm (-> google). In short, it tries to limit the
> overhead of ACK segments by sending as little segments as possible by
> combining multiple calls to write() into a single segment.
>
>> In what situation that tcp_output()
>> does not output segment?
>
> A segment is sent tcp_do_output_nagle() results in 1:
>
> #define tcp_do_output_nagle(tpcb) ((((tpcb)->unacked == NULL) || \
> ((tpcb)->flags & (TF_NODELAY | TF_INFR)) || \
> (((tpcb)->unsent != NULL) &&
> (((tpcb)->unsent->next != NULL) || \
> ((tpcb)->unsent->len >= (tpcb)->mss))) || \
> ((tcp_sndbuf(tpcb) == 0) || (tcp_sndqueuelen(tpcb)
> >= TCP_SND_QUEUELEN)) \
> ) ? 1 : 0)
>
> In other words, if there is unacked data, we wait for it to be acked or to
> send a full segment (unless we are in fast retransmit or ran out of lwIP
> buffers).
>
>> And, how do I ensure the output behavior
>> really happen?
>
> Call tcp_nagle_enable(pcb).
>
>
> Simon
Thanks, Simon. But the naming is a little confusing to me. nagle
means no-agle?
> --
> Empfehlen Sie GMX DSL Ihren Freunden und Bekannten und wir
> belohnen Sie mit bis zu 50,- Euro! https://freundschaftswerbung.gmx.de
>
> _______________________________________________
> lwip-devel mailing list
> address@hidden
> https://lists.nongnu.org/mailman/listinfo/lwip-devel
--
Life is the only flaw in an otherwise perfect nonexistence
-- Schopenhauer
narke
public key at http://subkeys.pgp.net:11371 (address@hidden)