LEFT | RIGHT |
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ | 1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
2 /* | 2 /* |
3 * Copyright (c) 2016 ResiliNets, ITTC, University of Kansas | 3 * Copyright (c) 2016 ResiliNets, ITTC, University of Kansas |
4 * | 4 * |
5 * This program is free software; you can redistribute it and/or modify | 5 * This program is free software; you can redistribute it and/or modify |
6 * it under the terms of the GNU General Public License version 2 as | 6 * it under the terms of the GNU General Public License version 2 as |
7 * published by the Free Software Foundation; | 7 * published by the Free Software Foundation; |
8 * | 8 * |
9 * This program is distributed in the hope that it will be useful, | 9 * This program is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
212 } | 212 } |
213 NS_LOG_INFO ("In SlowStart, updated to cwnd " << m_cWnd << | 213 NS_LOG_INFO ("In SlowStart, updated to cwnd " << m_cWnd << |
214 " ssthresh " << m_ssThresh); | 214 " ssthresh " << m_ssThresh); |
215 } | 215 } |
216 else | 216 else |
217 { | 217 { |
218 uint32_t oldCwnd = segCwnd; | 218 uint32_t oldCwnd = segCwnd; |
219 | 219 |
220 if (m_segmentsAcked > 0) | 220 if (m_segmentsAcked > 0) |
221 { | 221 { |
222 m_ackCnt += static_cast<uint32_t>(m_segmentsAcked * m_alpha); | 222 m_ackCnt += static_cast<uint32_t> (m_segmentsAcked * m_alpha); |
223 } | 223 } |
224 | 224 |
225 while (m_ackCnt >= segCwnd) | 225 while (m_ackCnt >= segCwnd) |
226 { | 226 { |
227 m_ackCnt -= segCwnd; | 227 m_ackCnt -= segCwnd; |
228 segCwnd += 1; | 228 segCwnd += 1; |
229 } | 229 } |
230 | 230 |
231 if (segCwnd != oldCwnd) | 231 if (segCwnd != oldCwnd) |
232 { | 232 { |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
335 { | 335 { |
336 m_beta = betaMax.Get (); | 336 m_beta = betaMax.Get (); |
337 } | 337 } |
338 NS_LOG_INFO ("Updated to beta = " << m_beta); | 338 NS_LOG_INFO ("Updated to beta = " << m_beta); |
339 } | 339 } |
340 | 340 |
341 void | 341 void |
342 TcpIllinoisTest::GetSsThresh () | 342 TcpIllinoisTest::GetSsThresh () |
343 { | 343 { |
344 uint32_t segCwnd = m_cWnd / m_segmentSize; | 344 uint32_t segCwnd = m_cWnd / m_segmentSize; |
345 uint32_t ssThresh = static_cast<uint32_t>(std::max (2.0, (1.0 - m_beta) * segC
wnd)); | 345 uint32_t ssThresh = static_cast<uint32_t> (std::max (2.0, (1.0 - m_beta) * seg
Cwnd)); |
346 | 346 |
347 NS_LOG_DEBUG ("Calculated ssThresh (in segments) = " << ssThresh); | 347 NS_LOG_DEBUG ("Calculated ssThresh (in segments) = " << ssThresh); |
348 | 348 |
349 m_ssThresh = ssThresh * m_segmentSize; | 349 m_ssThresh = ssThresh * m_segmentSize; |
350 } | 350 } |
351 | 351 |
352 | 352 |
353 | 353 |
354 /** | 354 /** |
355 * \ingroup internet-test | 355 * \ingroup internet-test |
(...skipping 15 matching lines...) Expand all Loading... |
371 AddTestCase (new TcpIllinoisTest (38 * 1446, 40 * 1446, 1446, 5, MilliSecond
s (110), 2, SequenceNumber32 (2893), SequenceNumber32 (5785), | 371 AddTestCase (new TcpIllinoisTest (38 * 1446, 40 * 1446, 1446, 5, MilliSecond
s (110), 2, SequenceNumber32 (2893), SequenceNumber32 (5785), |
372 "Illinois test on cWnd and ssThresh when a
vg queueing delay is at maximum"), | 372 "Illinois test on cWnd and ssThresh when a
vg queueing delay is at maximum"), |
373 TestCase::QUICK); | 373 TestCase::QUICK); |
374 AddTestCase (new TcpIllinoisTest (40 * 1446, 38 * 1446, 1446, 2, MilliSecond
s (105), 55, SequenceNumber32 (2893), SequenceNumber32 (5785), | 374 AddTestCase (new TcpIllinoisTest (40 * 1446, 38 * 1446, 1446, 2, MilliSecond
s (105), 55, SequenceNumber32 (2893), SequenceNumber32 (5785), |
375 "Illinois test on cWnd and ssThresh when a
vg queueing delay is in between its min & max"), | 375 "Illinois test on cWnd and ssThresh when a
vg queueing delay is in between its min & max"), |
376 TestCase::QUICK); | 376 TestCase::QUICK); |
377 } | 377 } |
378 }; | 378 }; |
379 | 379 |
380 static TcpIllinoisTestSuite g_tcpIllinoisTest; //!< Static variable for test ini
tialization | 380 static TcpIllinoisTestSuite g_tcpIllinoisTest; //!< Static variable for test ini
tialization |
LEFT | RIGHT |