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
+11 -13
View File
@@ -210,20 +210,18 @@ 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;
RTT_hit = true;
} else {
const double alpha = 1.0 / 8.0;
const double beta = 1.0 / 4.0;
if ( !RTT_hit ) { /* first measurement */
SRTT = R;
RTTVAR = R / 2;
RTT_hit = true;
} else {
const double alpha = 1.0 / 8.0;
const double beta = 1.0 / 4.0;
RTTVAR = (1 - beta) * RTTVAR + ( beta * fabs( SRTT - R ) );
SRTT = (1 - alpha) * SRTT + ( alpha * R );
RTTVAR = (1 - beta) * RTTVAR + ( beta * fabs( SRTT - R ) );
SRTT = (1 - alpha) * SRTT + ( alpha * R );
}
}
}
+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 );