Slow frame rate and make header estimate more conservative. Ignore large RTTs vs. capping

This commit is contained in:
Keith Winstein
2011-08-10 02:59:02 -04:00
parent 6ebc686661
commit e9aeb482df
2 changed files with 13 additions and 15 deletions
+2 -4
View File
@@ -210,10 +210,7 @@ string Connection::recv( void )
assert( now >= p.timestamp_reply );
double R = now - p.timestamp_reply;
if ( R > 5000 ) { /* cap large values, e.g. server was Ctrl-Zed */
R = 5000;
}
if ( R < 5000 ) { /* ignore large values, e.g. server was Ctrl-Zed */
if ( !RTT_hit ) { /* first measurement */
SRTT = R;
RTTVAR = R / 2;
@@ -226,6 +223,7 @@ string Connection::recv( void )
SRTT = (1 - alpha) * SRTT + ( alpha * R );
}
}
}
dos_assert( p.direction == (server ? TO_SERVER : TO_CLIENT) ); /* prevent malicious playback to sender */
+2 -2
View File
@@ -48,9 +48,9 @@ namespace Network {
class Transport
{
private:
static const int SEND_INTERVAL = 20; /* ms between frames */
static const int SEND_INTERVAL = 50; /* ms between frames */
static const int ACK_INTERVAL = 1000; /* ms between empty acks */
static const int HEADER_LEN = 100;
static const int HEADER_LEN = 120;
/* helper methods for tick() */
void update_assumed_receiver_state( void );