TCP ACKs in kernel code
Hello,
I am interested in two points of TCP implementation for kernel 2.6. The first point is about the 'quickack mode' used to make the congestion window to grow faster during the 'slow-start' phase. The code on tcp_input.c shows that number of quick acks to be sent is equal to the half of the receiver window worth of packets: tcp_input.c/tcp_incr_quickack Code:
unsigned quickacks = tp->rcv_wnd/(2*tp->ack.rcv_mss); The second point is that I understood that the linux implementation can send a delayed ack for more than two packets as the delayed ack mechanism is not based on the number of packets, but in the 'ato' (ack time out?!). And thus *not* following recommendation the RFC 2581 ("The requirement that an ACK "SHOULD" be generated for at least every second full-sized segment..."). Which is OK, as it is a SHOULD. What I cannot understand is how the timer is controlled. I do not understand how "about to expire" is tested on the code bellow: tcp_output.c/tcp_send_delayed_ack Code:
/* If delack timer was blocked or is about to expire, Thanks, Rafael |
Question 1: IMO not always. There's window scalling possible. For details look into tcp_output.c: tcp_select_window
Question 2: This piece of code sends the ack if it's not worth it to set a timer, because the time is too close. ato will usually be HZ/25. So ato/4 is HZ/100. Really short period of time :) |
Quote:
I've been working in other stuff for a while but now I back on the TCP code. Still trying to understand how ACKs are sent. I think I got most of it figured out. There is a part that I do not quite understand though. On tcp_input.c , one ack is generated imediatelly in 3 cases by __tcp_ack_snd_check : Code:
/* More than one full frame received... */ - What it means to receive a packet larger than the MSS? - My understanding is that Code:
__tcp_select_window(sk) >= tp->rcv_wnd - Summarizing, what is the first option testing?? Thanks, Rafael |
All times are GMT -5. The time now is 09:35 PM. |