diff -U2 -r /var/lib/copr-rpmbuild/results/i2pd-git/upstream-unpacked/Source0/i2pd-openssl/libi2pd/Streaming.cpp /var/lib/copr-rpmbuild/results/i2pd-git/srpm-unpacked/i2pd-openssl.tar.gz-extract/i2pd-openssl/libi2pd/Streaming.cpp --- /var/lib/copr-rpmbuild/results/i2pd-git/upstream-unpacked/Source0/i2pd-openssl/libi2pd/Streaming.cpp 2026-01-18 15:02:35.000000000 +0000 +++ /var/lib/copr-rpmbuild/results/i2pd-git/srpm-unpacked/i2pd-openssl.tar.gz-extract/i2pd-openssl/libi2pd/Streaming.cpp 2026-01-18 14:44:26.000000000 +0000 @@ -747,5 +747,5 @@ m_PrevRTTSample = rttSample; m_Jitter = rttSample / 5; // 20% - m_Jitter += 5; // for low-latency connections + m_Jitter += 3; // for low-latency connections m_JitterAccum = m_Jitter; m_JitterDiv = 1; @@ -768,5 +768,5 @@ if (jitter) { - jitter += 5; // for low-latency connections + jitter += 3; // for low-latency connections m_JitterAccum += jitter; m_Jitter = m_JitterAccum / m_JitterDiv; @@ -780,5 +780,5 @@ } } - if (m_IsBufferEmpty || m_FastRTT >= m_MinRTT + m_Jitter*4 || m_RTT >= m_MinRTT + m_Jitter*4 || m_SlowRTT >= m_MinRTT + m_Jitter*4 || m_RTT > m_FastRTT) + if (m_IsBufferEmpty || m_FastRTT >= m_MinRTT + m_Jitter*3 || m_RTT >= m_MinRTT + m_Jitter*3 || m_SlowRTT >= m_MinRTT + m_Jitter*3 || m_RTT > m_FastRTT) { incCounter = 0; @@ -788,5 +788,5 @@ // // delay-based CC - if ((m_RTT > m_SlowRTT) && (m_SlowRTT >= m_FastRTT) && (m_FastRTT > m_MinRTT + m_Jitter*8) && (m_SlowRTT > m_MinRTT + m_Jitter*8) && !m_IsWinDropped && !m_IsClientChoked) // Drop window if RTT grows too fast + if ((m_SlowRTT > m_MinRTT + m_Jitter*6) && !m_IsWinDropped && !m_IsClientChoked) // Drop window if RTT grows too fast { LogPrint (eLogDebug, "Streaming: Congestion detected, reduce window size"); @@ -797,5 +797,5 @@ bool wasInitial = m_RTO == INITIAL_RTO; - m_RTO = std::max (MIN_RTO, (int)(m_RTT + m_Jitter*2 + m_ACKRecieveInterval)); // TODO: implement it better + m_RTO = std::max (MIN_RTO, (int)(m_RTT * 1.3 + m_Jitter + m_ACKRecieveInterval)); // TODO: implement it better if (wasInitial) @@ -1987,7 +1987,5 @@ void Stream::UpdatePacingTime () { - double rtt = m_MinRTT; - if (m_IsWinDropped) - rtt = m_SlowRTT; + double rtt = m_MinRTT + m_Jitter*2; if (m_WindowDropTargetSize) m_PacingTime = std::round (rtt*1000/m_WindowDropTargetSize); @@ -2001,13 +1999,8 @@ { if (m_WindowDropTargetSize) - { - m_LastWindowDropSize = m_WindowDropTargetSize * ((m_MinRTT + m_Jitter*6) / m_SlowRTT); - m_WindowDropTargetSize = m_LastWindowDropSize * m_MinRTT / m_SlowRTT; // we start send faster when rtt will decrease - } + m_LastWindowDropSize = m_WindowDropTargetSize * ((m_MinRTT + m_Jitter*4) / m_FastRTT); else - { - m_LastWindowDropSize = m_WindowSize * ((m_MinRTT + m_Jitter*6) / m_SlowRTT); - m_WindowDropTargetSize = m_WindowSize * m_MinRTT / m_SlowRTT; // we start send faster when rtt will decrease - } + m_LastWindowDropSize = m_WindowSize * ((m_MinRTT + m_Jitter*4) / m_FastRTT); + m_WindowDropTargetSize = m_LastWindowDropSize * 0.5; // -50% to drain queue if (m_WindowDropTargetSize < MIN_WINDOW_SIZE) m_WindowDropTargetSize = MIN_WINDOW_SIZE; diff -U2 -r /var/lib/copr-rpmbuild/results/i2pd-git/upstream-unpacked/Source0/i2pd-openssl/libi2pd/Streaming.h /var/lib/copr-rpmbuild/results/i2pd-git/srpm-unpacked/i2pd-openssl.tar.gz-extract/i2pd-openssl/libi2pd/Streaming.h --- /var/lib/copr-rpmbuild/results/i2pd-git/upstream-unpacked/Source0/i2pd-openssl/libi2pd/Streaming.h 2026-01-18 15:02:35.000000000 +0000 +++ /var/lib/copr-rpmbuild/results/i2pd-git/srpm-unpacked/i2pd-openssl.tar.gz-extract/i2pd-openssl/libi2pd/Streaming.h 2026-01-18 14:44:26.000000000 +0000 @@ -65,5 +65,5 @@ const int MAX_WINDOW_SIZE_INC_PER_RTT = 512; // TODO: remove const double RTT_EWMA_ALPHA = 0.1; - const double SLOWRTT_EWMA_ALPHA = 0.03; + const double SLOWRTT_EWMA_ALPHA = 0.02; const double PREV_SPEED_KEEP_TIME_COEFF = 0.2; // 0.1 - 1 // how long will the window size stay around the previous drop level, less is longer const int MIN_RTO = 20; // in milliseconds