summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorChris Wilson <chris+github@qwirx.com>2012-02-12 13:33:41 +0000
committerChris Wilson <chris+github@qwirx.com>2012-02-12 13:33:41 +0000
commita9f8e0a0849516e2fe990d0f944168513ba12b64 (patch)
treec2328a1627456fc66f07c47f47d5d1b72caabe9d /lib
parent15a3e05144785bfcaddcf2d11b6c549edd9f62ee (diff)
Initialise the EWMA rate average to 0, and comment on variables in log message.
Diffstat (limited to 'lib')
-rw-r--r--lib/server/TcpNice.cpp17
1 files changed, 16 insertions, 1 deletions
diff --git a/lib/server/TcpNice.cpp b/lib/server/TcpNice.cpp
index 88d08bda..7cd2df24 100644
--- a/lib/server/TcpNice.cpp
+++ b/lib/server/TcpNice.cpp
@@ -35,7 +35,10 @@ TcpNice::TcpNice()
mGammaPercent(100),
mAlphaStar(100),
mDeltaPercent(10)
-{ }
+{
+ mRateEstimateMovingAverage[0] = 0;
+ mRateEstimateMovingAverage[1] = 0;
+}
// --------------------------------------------------------------------------
//
@@ -67,6 +70,18 @@ int TcpNice::GetNextWindowSize(int bytesChange, box_time_t timeElapsed,
(((100 - mDeltaPercent) * mRateEstimateMovingAverage[1]) / 100) +
((mDeltaPercent * rateLastPeriod) / 100);
+ /*
+ * b is the number of bytes sent during the previous control period
+ * T is the length (in us) of the previous control period
+ * rtt is the round trip time (in us) reported by the kernel on the socket
+ * e is epsilon, a parameter of the formula, calculated as alpha/rtt
+ * rb is the actual rate (goodput) over the previous period
+ * rbhat is the previous (last-but-one) EWMA rate estimate
+ * raw is the unscaled adjustment to the window size
+ * gamma is the scaled adjustment to the window size
+ * wb is the final window size
+ */
+
BOX_TRACE("TcpNice: "
"b=" << bytesChange << ", "
"T=" << timeElapsed << ", "