• Yuchung Cheng's avatar
    tcp: do not use cached RTT for RTT estimation · 1b7fdd2a
    Yuchung Cheng authored
    RTT cached in the TCP metrics are valuable for the initial timeout
    because SYN RTT usually does not account for serialization delays
    on low BW path.
    
    However using it to seed the RTT estimator maybe disruptive because
    other components (e.g., pacing) require the smooth RTT to be obtained
    from actual connection.
    
    The solution is to use the higher cached RTT to set the first RTO
    conservatively like tcp_rtt_estimator(), but avoid seeding the other
    RTT estimator variables such as srtt.  It is also a good idea to
    keep RTO conservative to obtain the first RTT sample, and the
    performance is insured by TCP loss probe if SYN RTT is available.
    
    To keep the seeding formula consistent across SYN RTT and cached RTT,
    the rttvar is twice the cached RTT instead of cached RTTVAR value. The
    reason is because cached variation may be too small (near min RTO)
    which defeats the purpose of being conservative on first RTO. However
    the metrics still keep the RTT variations as they might be useful for
    user applications (through ip).
    Signed-off-by: default avatarYuchung Cheng <ycheng@google.com>
    Signed-off-by: default avatarNeal Cardwell <ncardwell@google.com>
    Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
    Tested-by: default avatarEric Dumazet <edumazet@google.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    1b7fdd2a
tcp_metrics.c 26.5 KB