• Gerrit Renker's avatar
    [CCID2]: Deadlock and spurious timeouts when Ack Ratio > cwnd · d50ad163
    Gerrit Renker authored
    This patch removes a bug in the current code. I agree with Andrea's comment
    that there is a problem here but the way it is treated does not fix it.
    
    The problem is that whenever Ack Ratio > cwnd, starvation/deadlock occurs:
     * the receiver will not send an Ack until (Ack Ratio - cwnd) data packets
       have arrived;
     * the sender will not send any data packet before the receipt of an Ack
       advances the send window.
    The only way that the connection then progresses was via RTO timeout. In one
    extreme case (bulk transfer), it was observed that this happened for every single
    packet; i.e. hundreds of packets, each a RTO timeout of 1..3 seconds apart:
    a transfer which normally would take a fraction of a second thus grew to
    several minutes.
    
    The solution taken by this approach is to observe the relation
    
                       "Ack Ratio <= cwnd"
    
    by using the constraint (1) from RFC 4341, 6.1.2; i.e. set
    
                     Ack Ratio = ceil(cwnd / 2)
    
    and update it whenever either Ack Ratio or cwnd change. This ensures that
    the deadlock problem can not arise.
    Signed-off-by: default avatarGerrit Renker <gerrit@erg.abdn.ac.uk>
    Acked-by: default avatarIan McDonald <ian.mcdonald@jandi.co.nz>
    Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    d50ad163
ccid2.c 21.5 KB