Skip to content

Commit

Permalink
more adequate initial RTT
Browse files Browse the repository at this point in the history
  • Loading branch information
orignal committed Nov 25, 2024
1 parent 6fb3c7c commit 5f1b312
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions libi2pd/Streaming.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -537,7 +537,7 @@ namespace stream
m_LocalDestination.DeletePacket (sentPacket);
acknowledged = true;
if (m_WindowSize < MAX_WINDOW_SIZE && !m_IsFirstACK)
if (m_RTT < m_LocalDestination.GetRandom () % INITIAL_RTT) // dirty
if (m_RTT < m_LocalDestination.GetRandom () % INITIAL_RTO) // dirty
m_WindowIncCounter++;
}
else
Expand Down Expand Up @@ -1143,7 +1143,7 @@ namespace stream
CancelRemoteLeaseChange ();
UpdateCurrentRemoteLease (true);
}
if (m_RemoteLeaseChangeTime && m_IsRemoteLeaseChangeInProgress && ts > m_RemoteLeaseChangeTime + INITIAL_RTT)
if (m_RemoteLeaseChangeTime && m_IsRemoteLeaseChangeInProgress && ts > m_RemoteLeaseChangeTime + INITIAL_RTO)
{
CancelRemoteLeaseChange ();
m_CurrentRemoteLease = m_NextRemoteLease;
Expand Down
2 changes: 1 addition & 1 deletion libi2pd/Streaming.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ namespace stream
const double SLOWRTT_EWMA_ALPHA = 0.05;
const double PREV_SPEED_KEEP_TIME_COEFF = 0.35; // 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
const int INITIAL_RTT = 8000; // in milliseconds
const int INITIAL_RTT = 1500; // in milliseconds
const int INITIAL_RTO = 9000; // in milliseconds
const int INITIAL_PACING_TIME = 1000 * INITIAL_RTT / INITIAL_WINDOW_SIZE; // in microseconds
const int MIN_SEND_ACK_TIMEOUT = 2; // in milliseconds
Expand Down

0 comments on commit 5f1b312

Please sign in to comment.