lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] Retransmit too quick?


From: Xun Chen
Subject: Re: [lwip-users] Retransmit too quick?
Date: Fri, 10 Jul 2015 11:20:00 -0400
User-agent: Mozilla/5.0 (Windows NT 5.1; rv:31.0) Gecko/20100101 Thunderbird/31.7.0

Hi Sergio,

Thanks again for your kind reply.

I am not an expert in lwip, but I did several projects on other TCP stack

The receiver's ACK is taken care inside lwip, not by the callback of tcp_sent

and tcp_sndbuff tells the size of available tx buffer

I agree with you about the timer may have some problem in the port

On 7/10/2015 10:20 AM, address@hidden wrote:

------------------------------

Message: 2
Date: Fri, 10 Jul 2015 09:22:14 -0300
From: "Sergio R. Caprile"<address@hidden>
To:address@hidden
Subject: Re: [lwip-users] Retransmit too quick?
Message-ID:<address@hidden>
Content-Type: text/plain; charset=utf-8

>    So I don't understand why calling sys_check_timeouts without any
>delay yields a poorer performance than calling it or tcp_tmr at 250ms
>pace.
Neither do I.
Either your port is broken or your code is not properly written and this
condition masks that out.

>    I think tcp_sent callback is only an option, not a requirement, in
>lwip.
You are free to think whatever you want. However, that doesn't
necessarily need to be correct.
Do you actually know TCP ? If you understand TCP, you'll understand why
tcp_sent() is not an option, unless you know exactly what you are doing.
Now, in my opinion, that is the reason why you are observing that
strange timer dependent performance change.

>    So I think it is OK to use the following flow:
>
>    use tcp_sndbuf to check available buffer
>    use tcp_write to write data to queue
>    finally use tcp_output to send out data asap.
>
>    Is my understanding correct?
No, afaik it is not.
TCP can't send more data than the receiver allows for, so if you don't
pay attention to the receiver's ACKs, you will end up with a full
buffer, won't be able to send anything, and will be wasting precious
time calling functions that can't do anything, hogging your CPU. Then,
automagically, you will adjust your timers and suddenly it somehow
approaches the receiver's ACK speed and you see an increase in performance.
Comer is your friend, Stallings too, be a good boy and read them.




reply via email to

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