[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [lwip-devel] TCP ack timing
From: |
Mountifield, Tony |
Subject: |
RE: [lwip-devel] TCP ack timing |
Date: |
Fri, 30 Apr 2004 14:32:19 +0100 |
Kieran,
Many thanks for your interesting response:
> Sounds like there's something strange going on, but it's
> almost correct. TCP delays acknowledging data in order
> to avoid sending packets that only contain ACKs and no
> payload. As you're sending data in one direction only,
> it never gets a packet to send it with (and this is why
> sending data in the reverse direction solved the problem).
> However, there are supposed to be limits on the delay in the
> absence of traffic:
> - if its been 200ms since the acknowledgement was requested,
> send the ACK anyway;
> - if the amount of unacknowledged data is >2*TCP_MSS, send
> the ACK anyway.
OK, that sounds like an explaination of what I'm seeing...
> To do this relies on the TCP timers being called
> appropriately. As this is an embedded system, are you sure
> this is the case?
Yes, the timers are ok.
> Can anyone provide a (link to a) document/previous post
> that describes what is required? As you get ACKS sent
> after 0.2s (200ms) it sounds like it is working.
>
> This suggests that the second limit is not being obeyed.
> Having had a look at the code, lwIP uses a slightly
> different algorithm: it sends the ACK if *two ACKs* have
> been requested, not if *two MSS of data need ACKing*.
> This could result in the behaviour you're seeing if
> you have a large TCP_MSS (similar to the receive window),
> and send a single segment that closes the receive window
> entirely. Then you can't send a second segment, and so
> it waits for the 200ms limit to be hit.
Yes, I think that is what is happening. In lwipopts.h I have
2048 as the TCP window size (which is the default in opt.h),
and 1500 as the MSS (default was 128, and I changed it to
what I thought was more appropriate for Ethernet without
understanding its interaction with the window size).
> This is possibly a bug, but I think you might see similar
> problems even if lwIP did the standard 2*TCP_MSS check,
> as you'd still never reach 2*TCP_MSS if TCP_MSS is > TCP_WND/2.
>
> Could you verify if this is the case? If not, I'll give it some more
> thought.
Yes, I think you've hit the nail on the head, and I'll try
playing with the values.
Many thanks again
Tony
***********************************************************************************
This email, its content and any attachments is PRIVATE AND
CONFIDENTIAL to TANDBERG Television. If received in error please
notify the sender and destroy the original message and attachments.
www.tandbergtv.com
***********************************************************************************