blob: bf530fff4ef20ee88945eef46279fe4dfaf5ca9f [file] [log] [blame]
Davide Pesaventobf1c0692017-01-15 19:15:09 -05001/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
Chavoosh Ghasemi4d36ed52017-10-31 22:26:25 +00002/*
Chavoosh Ghasemi3dae1092017-12-21 12:39:08 -07003 * Copyright (c) 2016-2018, Regents of the University of California,
Davide Pesaventocd65c2c2017-01-15 16:10:38 -05004 * Colorado State University,
5 * University Pierre & Marie Curie, Sorbonne University.
Weiwei Liu245d7912016-07-28 00:04:25 -07006 *
7 * This file is part of ndn-tools (Named Data Networking Essential Tools).
8 * See AUTHORS.md for complete list of ndn-tools authors and contributors.
9 *
10 * ndn-tools is free software: you can redistribute it and/or modify it under the terms
11 * of the GNU General Public License as published by the Free Software Foundation,
12 * either version 3 of the License, or (at your option) any later version.
13 *
14 * ndn-tools is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
15 * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
16 * PURPOSE. See the GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License along with
19 * ndn-tools, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
20 *
21 * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
22 *
23 * @author Shuo Yang
24 * @author Weiwei Liu
Chavoosh Ghasemi4d36ed52017-10-31 22:26:25 +000025 * @author Chavoosh Ghasemi
Weiwei Liu245d7912016-07-28 00:04:25 -070026 */
27
28#include "pipeline-interests-aimd.hpp"
Davide Pesavento44b3b232017-12-23 16:58:25 -050029#include "data-fetcher.hpp"
Weiwei Liu245d7912016-07-28 00:04:25 -070030
31#include <cmath>
Chavoosh Ghasemi3dae1092017-12-21 12:39:08 -070032#include <iomanip>
Weiwei Liu245d7912016-07-28 00:04:25 -070033
34namespace ndn {
35namespace chunks {
36namespace aimd {
37
Chavoosh Ghasemi641f5932017-11-06 22:45:11 +000038constexpr double PipelineInterestsAimd::MIN_SSTHRESH;
39
Weiwei Liu245d7912016-07-28 00:04:25 -070040PipelineInterestsAimd::PipelineInterestsAimd(Face& face, RttEstimator& rttEstimator,
41 const Options& options)
42 : PipelineInterests(face)
43 , m_options(options)
44 , m_rttEstimator(rttEstimator)
45 , m_scheduler(m_face.getIoService())
Davide Pesaventocd65c2c2017-01-15 16:10:38 -050046 , m_checkRtoEvent(m_scheduler)
Weiwei Liu245d7912016-07-28 00:04:25 -070047 , m_highData(0)
48 , m_highInterest(0)
49 , m_recPoint(0)
50 , m_nInFlight(0)
Weiwei Liu245d7912016-07-28 00:04:25 -070051 , m_nLossEvents(0)
52 , m_nRetransmitted(0)
Chavoosh Ghasemi641f5932017-11-06 22:45:11 +000053 , m_nCongMarks(0)
Weiwei Liu245d7912016-07-28 00:04:25 -070054 , m_cwnd(m_options.initCwnd)
55 , m_ssthresh(m_options.initSsthresh)
56 , m_hasFailure(false)
57 , m_failedSegNo(0)
58{
59 if (m_options.isVerbose) {
60 std::cerr << m_options;
61 }
62}
63
64PipelineInterestsAimd::~PipelineInterestsAimd()
65{
66 cancel();
67}
68
69void
70PipelineInterestsAimd::doRun()
71{
Weiwei Liu245d7912016-07-28 00:04:25 -070072 // schedule the event to check retransmission timer
Davide Pesaventocd65c2c2017-01-15 16:10:38 -050073 m_checkRtoEvent = m_scheduler.scheduleEvent(m_options.rtoCheckInterval, [this] { checkRto(); });
Weiwei Liu245d7912016-07-28 00:04:25 -070074
Davide Pesavento958896e2017-01-19 00:52:04 -050075 schedulePackets();
Weiwei Liu245d7912016-07-28 00:04:25 -070076}
77
78void
79PipelineInterestsAimd::doCancel()
80{
81 for (const auto& entry : m_segmentInfo) {
Davide Pesaventocd65c2c2017-01-15 16:10:38 -050082 m_face.removePendingInterest(entry.second.interestId);
Weiwei Liu245d7912016-07-28 00:04:25 -070083 }
Davide Pesaventocd65c2c2017-01-15 16:10:38 -050084 m_checkRtoEvent.cancel();
Weiwei Liu245d7912016-07-28 00:04:25 -070085 m_segmentInfo.clear();
Weiwei Liu245d7912016-07-28 00:04:25 -070086}
87
88void
89PipelineInterestsAimd::checkRto()
90{
91 if (isStopping())
92 return;
93
Davide Pesavento958896e2017-01-19 00:52:04 -050094 bool hasTimeout = false;
Weiwei Liu245d7912016-07-28 00:04:25 -070095
96 for (auto& entry : m_segmentInfo) {
97 SegmentInfo& segInfo = entry.second;
98 if (segInfo.state != SegmentState::InRetxQueue && // do not check segments currently in the retx queue
99 segInfo.state != SegmentState::RetxReceived) { // or already-received retransmitted segments
100 Milliseconds timeElapsed = time::steady_clock::now() - segInfo.timeSent;
101 if (timeElapsed.count() > segInfo.rto.count()) { // timer expired?
Davide Pesavento958896e2017-01-19 00:52:04 -0500102 hasTimeout = true;
103 enqueueForRetransmission(entry.first);
Weiwei Liu245d7912016-07-28 00:04:25 -0700104 }
105 }
106 }
107
Davide Pesavento958896e2017-01-19 00:52:04 -0500108 if (hasTimeout) {
109 recordTimeout();
110 schedulePackets();
Weiwei Liu245d7912016-07-28 00:04:25 -0700111 }
112
113 // schedule the next check after predefined interval
Davide Pesaventocd65c2c2017-01-15 16:10:38 -0500114 m_checkRtoEvent = m_scheduler.scheduleEvent(m_options.rtoCheckInterval, [this] { checkRto(); });
Weiwei Liu245d7912016-07-28 00:04:25 -0700115}
116
117void
118PipelineInterestsAimd::sendInterest(uint64_t segNo, bool isRetransmission)
119{
120 if (isStopping())
121 return;
122
123 if (m_hasFinalBlockId && segNo > m_lastSegmentNo && !isRetransmission)
124 return;
125
126 if (!isRetransmission && m_hasFailure)
127 return;
128
129 if (m_options.isVerbose) {
Davide Pesavento958896e2017-01-19 00:52:04 -0500130 std::cerr << (isRetransmission ? "Retransmitting" : "Requesting")
131 << " segment #" << segNo << std::endl;
Weiwei Liu245d7912016-07-28 00:04:25 -0700132 }
133
134 if (isRetransmission) {
Davide Pesavento958896e2017-01-19 00:52:04 -0500135 // keep track of retx count for this segment
136 auto ret = m_retxCount.emplace(segNo, 1);
Weiwei Liu245d7912016-07-28 00:04:25 -0700137 if (ret.second == false) { // not the first retransmission
138 m_retxCount[segNo] += 1;
Davide Pesavento44b3b232017-12-23 16:58:25 -0500139 if (m_options.maxRetriesOnTimeoutOrNack != DataFetcher::MAX_RETRIES_INFINITE &&
140 m_retxCount[segNo] > m_options.maxRetriesOnTimeoutOrNack) {
Weiwei Liu245d7912016-07-28 00:04:25 -0700141 return handleFail(segNo, "Reached the maximum number of retries (" +
142 to_string(m_options.maxRetriesOnTimeoutOrNack) +
143 ") while retrieving segment #" + to_string(segNo));
144 }
145
146 if (m_options.isVerbose) {
147 std::cerr << "# of retries for segment #" << segNo
148 << " is " << m_retxCount[segNo] << std::endl;
149 }
150 }
151
152 m_face.removePendingInterest(m_segmentInfo[segNo].interestId);
153 }
154
155 Interest interest(Name(m_prefix).appendSegment(segNo));
156 interest.setInterestLifetime(m_options.interestLifetime);
157 interest.setMustBeFresh(m_options.mustBeFresh);
158 interest.setMaxSuffixComponents(1);
159
160 auto interestId = m_face.expressInterest(interest,
161 bind(&PipelineInterestsAimd::handleData, this, _1, _2),
162 bind(&PipelineInterestsAimd::handleNack, this, _1, _2),
Davide Pesaventoe9c69852017-11-04 18:08:37 -0400163 bind(&PipelineInterestsAimd::handleLifetimeExpiration, this, _1));
Weiwei Liu245d7912016-07-28 00:04:25 -0700164 m_nInFlight++;
165
166 if (isRetransmission) {
167 SegmentInfo& segInfo = m_segmentInfo[segNo];
Weiwei Liu245d7912016-07-28 00:04:25 -0700168 segInfo.timeSent = time::steady_clock::now();
Davide Pesavento958896e2017-01-19 00:52:04 -0500169 segInfo.rto = m_rttEstimator.getEstimatedRto();
170 segInfo.state = SegmentState::Retransmitted;
Weiwei Liu245d7912016-07-28 00:04:25 -0700171 m_nRetransmitted++;
172 }
173 else {
174 m_highInterest = segNo;
Davide Pesavento958896e2017-01-19 00:52:04 -0500175 m_segmentInfo[segNo] = {interestId,
176 time::steady_clock::now(),
177 m_rttEstimator.getEstimatedRto(),
178 SegmentState::FirstTimeSent};
Weiwei Liu245d7912016-07-28 00:04:25 -0700179 }
180}
181
182void
183PipelineInterestsAimd::schedulePackets()
184{
Davide Pesaventobf1c0692017-01-15 19:15:09 -0500185 BOOST_ASSERT(m_nInFlight >= 0);
186 auto availableWindowSize = static_cast<int64_t>(m_cwnd) - m_nInFlight;
187
Weiwei Liu245d7912016-07-28 00:04:25 -0700188 while (availableWindowSize > 0) {
189 if (!m_retxQueue.empty()) { // do retransmission first
190 uint64_t retxSegNo = m_retxQueue.front();
191 m_retxQueue.pop();
192
193 auto it = m_segmentInfo.find(retxSegNo);
194 if (it == m_segmentInfo.end()) {
195 continue;
196 }
197 // the segment is still in the map, it means that it needs to be retransmitted
198 sendInterest(retxSegNo, true);
199 }
200 else { // send next segment
201 sendInterest(getNextSegmentNo(), false);
202 }
203 availableWindowSize--;
204 }
205}
206
207void
208PipelineInterestsAimd::handleData(const Interest& interest, const Data& data)
209{
210 if (isStopping())
211 return;
212
213 // Data name will not have extra components because MaxSuffixComponents is set to 1
214 BOOST_ASSERT(data.getName().equals(interest.getName()));
215
216 if (!m_hasFinalBlockId && !data.getFinalBlockId().empty()) {
217 m_lastSegmentNo = data.getFinalBlockId().toSegment();
218 m_hasFinalBlockId = true;
219 cancelInFlightSegmentsGreaterThan(m_lastSegmentNo);
220 if (m_hasFailure && m_lastSegmentNo >= m_failedSegNo) {
221 // previously failed segment is part of the content
222 return onFailure(m_failureReason);
Chavoosh Ghasemi4d36ed52017-10-31 22:26:25 +0000223 }
224 else {
Weiwei Liu245d7912016-07-28 00:04:25 -0700225 m_hasFailure = false;
226 }
227 }
228
Davide Pesaventobf1c0692017-01-15 19:15:09 -0500229 uint64_t recvSegNo = getSegmentFromPacket(data);
Weiwei Liu245d7912016-07-28 00:04:25 -0700230 SegmentInfo& segInfo = m_segmentInfo[recvSegNo];
231 if (segInfo.state == SegmentState::RetxReceived) {
232 m_segmentInfo.erase(recvSegNo);
233 return; // ignore already-received segment
234 }
235
236 Milliseconds rtt = time::steady_clock::now() - segInfo.timeSent;
Weiwei Liu245d7912016-07-28 00:04:25 -0700237 if (m_options.isVerbose) {
238 std::cerr << "Received segment #" << recvSegNo
239 << ", rtt=" << rtt.count() << "ms"
240 << ", rto=" << segInfo.rto.count() << "ms" << std::endl;
241 }
242
Davide Pesavento958896e2017-01-19 00:52:04 -0500243 if (m_highData < recvSegNo) {
244 m_highData = recvSegNo;
245 }
246
247 // for segments in retx queue, we must not decrement m_nInFlight
248 // because it was already decremented when the segment timed out
249 if (segInfo.state != SegmentState::InRetxQueue) {
Weiwei Liu245d7912016-07-28 00:04:25 -0700250 m_nInFlight--;
251 }
252
Chavoosh Ghasemi641f5932017-11-06 22:45:11 +0000253 // upon finding congestion mark, decrease the window size
254 // without retransmitting any packet
255 if (data.getCongestionMark() > 0) {
256 m_nCongMarks++;
257 if (!m_options.ignoreCongMarks) {
258 if (m_options.disableCwa || m_highData > m_recPoint) {
259 m_recPoint = m_highInterest; // react to only one congestion event (timeout or congestion mark)
260 // per RTT (conservative window adaptation)
261 decreaseWindow();
262
263 if (m_options.isVerbose) {
264 std::cerr << "Received congestion mark, value = " << data.getCongestionMark()
265 << ", new cwnd = " << m_cwnd << std::endl;
266 }
267 }
268 }
269 else {
270 increaseWindow();
271 }
272 }
273 else {
274 increaseWindow();
275 }
276
Davide Pesaventoe9c69852017-11-04 18:08:37 -0400277 onData(data);
Weiwei Liu245d7912016-07-28 00:04:25 -0700278
279 if (segInfo.state == SegmentState::FirstTimeSent ||
280 segInfo.state == SegmentState::InRetxQueue) { // do not sample RTT for retransmitted segments
Davide Pesaventobf1c0692017-01-15 19:15:09 -0500281 auto nExpectedSamples = std::max<int64_t>((m_nInFlight + 1) >> 1, 1);
282 BOOST_ASSERT(nExpectedSamples > 0);
283 m_rttEstimator.addMeasurement(recvSegNo, rtt, static_cast<size_t>(nExpectedSamples));
Weiwei Liu245d7912016-07-28 00:04:25 -0700284 m_segmentInfo.erase(recvSegNo); // remove the entry associated with the received segment
285 }
286 else { // retransmission
Davide Pesavento958896e2017-01-19 00:52:04 -0500287 BOOST_ASSERT(segInfo.state == SegmentState::Retransmitted);
Weiwei Liu245d7912016-07-28 00:04:25 -0700288 segInfo.state = SegmentState::RetxReceived;
289 }
290
291 BOOST_ASSERT(m_nReceived > 0);
Davide Pesaventobf1c0692017-01-15 19:15:09 -0500292 if (m_hasFinalBlockId &&
293 static_cast<uint64_t>(m_nReceived - 1) >= m_lastSegmentNo) { // all segments have been received
Weiwei Liu245d7912016-07-28 00:04:25 -0700294 cancel();
Davide Pesaventof6991e12018-01-08 20:58:50 -0500295 if (!m_options.isQuiet) {
Weiwei Liu245d7912016-07-28 00:04:25 -0700296 printSummary();
297 }
298 }
299 else {
300 schedulePackets();
301 }
302}
303
304void
305PipelineInterestsAimd::handleNack(const Interest& interest, const lp::Nack& nack)
306{
307 if (isStopping())
308 return;
309
310 if (m_options.isVerbose)
311 std::cerr << "Received Nack with reason " << nack.getReason()
312 << " for Interest " << interest << std::endl;
313
Davide Pesaventobf1c0692017-01-15 19:15:09 -0500314 uint64_t segNo = getSegmentFromPacket(interest);
Weiwei Liu245d7912016-07-28 00:04:25 -0700315
316 switch (nack.getReason()) {
Davide Pesavento958896e2017-01-19 00:52:04 -0500317 case lp::NackReason::DUPLICATE:
318 // ignore duplicates
Weiwei Liu245d7912016-07-28 00:04:25 -0700319 break;
Davide Pesavento958896e2017-01-19 00:52:04 -0500320 case lp::NackReason::CONGESTION:
321 // treated the same as timeout for now
322 enqueueForRetransmission(segNo);
323 recordTimeout();
324 schedulePackets();
325 break;
326 default:
Weiwei Liu245d7912016-07-28 00:04:25 -0700327 handleFail(segNo, "Could not retrieve data for " + interest.getName().toUri() +
328 ", reason: " + boost::lexical_cast<std::string>(nack.getReason()));
329 break;
Weiwei Liu245d7912016-07-28 00:04:25 -0700330 }
331}
332
333void
334PipelineInterestsAimd::handleLifetimeExpiration(const Interest& interest)
335{
336 if (isStopping())
337 return;
338
Davide Pesavento958896e2017-01-19 00:52:04 -0500339 enqueueForRetransmission(getSegmentFromPacket(interest));
340 recordTimeout();
341 schedulePackets();
Weiwei Liu245d7912016-07-28 00:04:25 -0700342}
343
344void
Davide Pesavento958896e2017-01-19 00:52:04 -0500345PipelineInterestsAimd::recordTimeout()
Weiwei Liu245d7912016-07-28 00:04:25 -0700346{
Weiwei Liu245d7912016-07-28 00:04:25 -0700347 if (m_options.disableCwa || m_highData > m_recPoint) {
348 // react to only one timeout per RTT (conservative window adaptation)
349 m_recPoint = m_highInterest;
350
351 decreaseWindow();
352 m_rttEstimator.backoffRto();
353 m_nLossEvents++;
354
355 if (m_options.isVerbose) {
Chavoosh Ghasemi641f5932017-11-06 22:45:11 +0000356 std::cerr << "Packet loss event, new cwnd = " << m_cwnd
Weiwei Liu245d7912016-07-28 00:04:25 -0700357 << ", ssthresh = " << m_ssthresh << std::endl;
358 }
359 }
Davide Pesavento958896e2017-01-19 00:52:04 -0500360}
Weiwei Liu245d7912016-07-28 00:04:25 -0700361
Davide Pesavento958896e2017-01-19 00:52:04 -0500362void
363PipelineInterestsAimd::enqueueForRetransmission(uint64_t segNo)
364{
365 BOOST_ASSERT(m_nInFlight > 0);
366 m_nInFlight--;
367 m_retxQueue.push(segNo);
368 m_segmentInfo.at(segNo).state = SegmentState::InRetxQueue;
Weiwei Liu245d7912016-07-28 00:04:25 -0700369}
370
371void
372PipelineInterestsAimd::handleFail(uint64_t segNo, const std::string& reason)
373{
374 if (isStopping())
375 return;
376
377 // if the failed segment is definitely part of the content, raise a fatal error
378 if (m_hasFinalBlockId && segNo <= m_lastSegmentNo)
379 return onFailure(reason);
380
381 if (!m_hasFinalBlockId) {
382 m_segmentInfo.erase(segNo);
Davide Pesavento958896e2017-01-19 00:52:04 -0500383 m_nInFlight--;
Weiwei Liu245d7912016-07-28 00:04:25 -0700384
385 if (m_segmentInfo.empty()) {
386 onFailure("Fetching terminated but no final segment number has been found");
387 }
388 else {
389 cancelInFlightSegmentsGreaterThan(segNo);
390 m_hasFailure = true;
391 m_failedSegNo = segNo;
392 m_failureReason = reason;
393 }
394 }
395}
396
397void
398PipelineInterestsAimd::increaseWindow()
399{
400 if (m_cwnd < m_ssthresh) {
401 m_cwnd += m_options.aiStep; // additive increase
Chavoosh Ghasemi4d36ed52017-10-31 22:26:25 +0000402 }
403 else {
Weiwei Liu245d7912016-07-28 00:04:25 -0700404 m_cwnd += m_options.aiStep / std::floor(m_cwnd); // congestion avoidance
405 }
Davide Pesavento958896e2017-01-19 00:52:04 -0500406
Davide Pesaventobf1c0692017-01-15 19:15:09 -0500407 afterCwndChange(time::steady_clock::now() - getStartTime(), m_cwnd);
Weiwei Liu245d7912016-07-28 00:04:25 -0700408}
409
410void
411PipelineInterestsAimd::decreaseWindow()
412{
413 // please refer to RFC 5681, Section 3.1 for the rationale behind it
Chavoosh Ghasemi641f5932017-11-06 22:45:11 +0000414 m_ssthresh = std::max(MIN_SSTHRESH, m_cwnd * m_options.mdCoef); // multiplicative decrease
Weiwei Liu245d7912016-07-28 00:04:25 -0700415 m_cwnd = m_options.resetCwndToInit ? m_options.initCwnd : m_ssthresh;
Davide Pesavento958896e2017-01-19 00:52:04 -0500416
Davide Pesaventobf1c0692017-01-15 19:15:09 -0500417 afterCwndChange(time::steady_clock::now() - getStartTime(), m_cwnd);
Weiwei Liu245d7912016-07-28 00:04:25 -0700418}
419
Weiwei Liu245d7912016-07-28 00:04:25 -0700420void
Davide Pesavento958896e2017-01-19 00:52:04 -0500421PipelineInterestsAimd::cancelInFlightSegmentsGreaterThan(uint64_t segNo)
Weiwei Liu245d7912016-07-28 00:04:25 -0700422{
423 for (auto it = m_segmentInfo.begin(); it != m_segmentInfo.end();) {
424 // cancel fetching all segments that follow
Davide Pesavento958896e2017-01-19 00:52:04 -0500425 if (it->first > segNo) {
Weiwei Liu245d7912016-07-28 00:04:25 -0700426 m_face.removePendingInterest(it->second.interestId);
427 it = m_segmentInfo.erase(it);
Davide Pesavento958896e2017-01-19 00:52:04 -0500428 m_nInFlight--;
Weiwei Liu245d7912016-07-28 00:04:25 -0700429 }
430 else {
431 ++it;
432 }
433 }
434}
435
436void
437PipelineInterestsAimd::printSummary() const
438{
Chavoosh Ghasemi4d36ed52017-10-31 22:26:25 +0000439 PipelineInterests::printSummary();
440 std::cerr << "Total # of packet loss events: " << m_nLossEvents << "\n"
Weiwei Liu245d7912016-07-28 00:04:25 -0700441 << "Packet loss rate: "
442 << static_cast<double>(m_nLossEvents) / static_cast<double>(m_nReceived) << "\n"
Chavoosh Ghasemi641f5932017-11-06 22:45:11 +0000443 << "Total # of retransmitted segments: " << m_nRetransmitted << "\n"
Chavoosh Ghasemi3dae1092017-12-21 12:39:08 -0700444 << "Total # of received congestion marks: " << m_nCongMarks << "\n"
445 << "RTT min/avg/max = " << std::fixed << std::setprecision(3)
446 << m_rttEstimator.getMinRtt() << "/"
447 << m_rttEstimator.getAvgRtt() << "/"
448 << m_rttEstimator.getMaxRtt() << " ms\n";
Weiwei Liu245d7912016-07-28 00:04:25 -0700449}
450
451std::ostream&
452operator<<(std::ostream& os, SegmentState state)
453{
454 switch (state) {
455 case SegmentState::FirstTimeSent:
456 os << "FirstTimeSent";
457 break;
458 case SegmentState::InRetxQueue:
459 os << "InRetxQueue";
460 break;
461 case SegmentState::Retransmitted:
462 os << "Retransmitted";
463 break;
464 case SegmentState::RetxReceived:
465 os << "RetxReceived";
466 break;
467 }
Weiwei Liu245d7912016-07-28 00:04:25 -0700468 return os;
469}
470
471std::ostream&
472operator<<(std::ostream& os, const PipelineInterestsAimdOptions& options)
473{
Davide Pesavento44b3b232017-12-23 16:58:25 -0500474 os << "AIMD pipeline parameters:\n"
Weiwei Liu245d7912016-07-28 00:04:25 -0700475 << "\tInitial congestion window size = " << options.initCwnd << "\n"
476 << "\tInitial slow start threshold = " << options.initSsthresh << "\n"
Weiwei Liu245d7912016-07-28 00:04:25 -0700477 << "\tAdditive increase step = " << options.aiStep << "\n"
Davide Pesavento958896e2017-01-19 00:52:04 -0500478 << "\tMultiplicative decrease factor = " << options.mdCoef << "\n"
Weiwei Liu245d7912016-07-28 00:04:25 -0700479 << "\tRTO check interval = " << options.rtoCheckInterval << "\n"
Davide Pesavento44b3b232017-12-23 16:58:25 -0500480 << "\tMax retries on timeout or Nack = " << (options.maxRetriesOnTimeoutOrNack == DataFetcher::MAX_RETRIES_INFINITE ?
481 "infinite" : to_string(options.maxRetriesOnTimeoutOrNack)) << "\n"
Chavoosh Ghasemi641f5932017-11-06 22:45:11 +0000482 << "\tReaction to congestion marks " << (options.ignoreCongMarks ? "disabled" : "enabled") << "\n"
Davide Pesavento44b3b232017-12-23 16:58:25 -0500483 << "\tConservative window adaptation " << (options.disableCwa ? "disabled" : "enabled") << "\n"
Davide Pesavento958896e2017-01-19 00:52:04 -0500484 << "\tResetting cwnd to " << (options.resetCwndToInit ? "initCwnd" : "ssthresh") << " upon loss event\n";
Weiwei Liu245d7912016-07-28 00:04:25 -0700485 return os;
486}
487
488} // namespace aimd
489} // namespace chunks
490} // namespace ndn