=== Week 0: TCP performance test and tunning === === May 13th to May 23th === * Implement TCP receive queue * Implement TCP SACK [RFC 2018] * Implement TCP Window Scale [RFC 1323] The test results can be found at these notes: * [[soc:2010:cooldavid:notes:tcpoorxtest|TCP out-of-order receive dstat test logs]] * [[soc:2010:cooldavid:notes:bkobench|Benchmarks for downloading image from boot.kernel.org]] == Found TCP FIN ACK number issue == Upper layer protocols stop the TCP xfer by calling tcp_xfer_close(). If the call path is: tcp_rx()->tcp_rx_data()->...Upper layer...->tcp_xfer_close(). Which is at lease happened in HTTP while received expected length of data. Sending FIN in tcp_xfer_close() in this case, will cause error ACK number, since the ACK number have not updated by that time. Later trying to send a correct one in tcp_rx() will fail too, due to the TCP state already changed. This patch let the TCP stack send FIN in normal tcp_rx() flow if the packet contains the last data of the session. * [[http://git.etherboot.org/?p=people/cooldavid/gpxe.git;a=commitdiff;h=d3661b67b1fa15c17b855b7e5cad47c1391835be|The git commit of my fix]] * [[https://git.ipxe.org/ipxe.git/commitdiff/9ff822969300a086ad13036c019aa981336017ed|mcb30's patch]]