Changeset 17b72dd5


Ignore:
Timestamp:
Dec 1, 2017 2:10:57 PM (3 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
dc13ed6
Parents:
9b2a85d
Message:

Streaming: Double the RTO on congestion (ticket #1939)
This prevents being stuck at a window size of 1, retransmitting every packet,
never updating the RTT or RTO. See RFC 6298 section 5 item 5.5.

Location:
apps/streaming/java/src/net/i2p/client/streaming/impl
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • apps/streaming/java/src/net/i2p/client/streaming/impl/Connection.java

    r9b2a85d r17b72dd5  
    14961496                            newWindowSize = 1;
    14971497                       
    1498                         // setRTT has its own ceiling
    1499                         //getOptions().setRTT(getOptions().getRTT() + 10*1000);
     1498                        // The timeout for _this_ packet will be doubled below, but we also
     1499                        // need to double the RTO for the _next_ packets.
     1500                        // See RFC 6298 section 5 item 5.5
     1501                        // This prevents being stuck at a window size of 1, retransmitting every packet,
     1502                        // never updating the RTT or RTO.
     1503                        getOptions().doubleRTO();
    15001504                        getOptions().setWindowSize(newWindowSize);
    15011505
  • apps/streaming/java/src/net/i2p/client/streaming/impl/ConnectionOptions.java

    r9b2a85d r17b72dd5  
    608608    }
    609609   
     610    /**
     611     * Double the RTO (after congestion).
     612     * See RFC 6298 section 5 item 5.5
     613     *
     614     * @since 0.9.33
     615     */
     616    synchronized void doubleRTO() {
     617        // we don't need to switch on _initState, _rto is set in constructor
     618        _rto *= 2;
     619        if (_rto > Connection.MAX_RESEND_DELAY)
     620            _rto = (int)Connection.MAX_RESEND_DELAY;
     621    }
     622   
    610623    /**
    611624     * If we have 3 consecutive rtt increases, we are trending upwards (1), or if we have
Note: See TracChangeset for help on using the changeset viewer.