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) 2015 NITK Surathkal | 3 * Copyright (c) 2015 NITK Surathkal |
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 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
233 Config::SetDefault ("ns3::TcpL4Protocol::SocketType", StringValue ("ns3::TcpNe
wReno")); | 233 Config::SetDefault ("ns3::TcpL4Protocol::SocketType", StringValue ("ns3::TcpNe
wReno")); |
234 // 42 = headers size | 234 // 42 = headers size |
235 Config::SetDefault ("ns3::TcpSocket::SegmentSize", UintegerValue (1000 - 42)); | 235 Config::SetDefault ("ns3::TcpSocket::SegmentSize", UintegerValue (1000 - 42)); |
236 Config::SetDefault ("ns3::TcpSocket::DelAckCount", UintegerValue (1)); | 236 Config::SetDefault ("ns3::TcpSocket::DelAckCount", UintegerValue (1)); |
237 GlobalValue::Bind ("ChecksumEnabled", BooleanValue (false)); | 237 GlobalValue::Bind ("ChecksumEnabled", BooleanValue (false)); |
238 | 238 |
239 uint32_t meanPktSize = 1000; | 239 uint32_t meanPktSize = 1000; |
240 | 240 |
241 // RED params | 241 // RED params |
242 NS_LOG_INFO ("Set RED params"); | 242 NS_LOG_INFO ("Set RED params"); |
243 Config::SetDefault ("ns3::RedQueueDisc::Mode", StringValue ("QUEUE_MODE_PACKET
S")); | 243 Config::SetDefault ("ns3::RedQueueDisc::Mode", StringValue ("QUEUE_DISC_MODE_P
ACKETS")); |
244 Config::SetDefault ("ns3::RedQueueDisc::MeanPktSize", UintegerValue (meanPktSi
ze)); | 244 Config::SetDefault ("ns3::RedQueueDisc::MeanPktSize", UintegerValue (meanPktSi
ze)); |
245 Config::SetDefault ("ns3::RedQueueDisc::Wait", BooleanValue (true)); | 245 Config::SetDefault ("ns3::RedQueueDisc::Wait", BooleanValue (true)); |
246 Config::SetDefault ("ns3::RedQueueDisc::Gentle", BooleanValue (true)); | 246 Config::SetDefault ("ns3::RedQueueDisc::Gentle", BooleanValue (true)); |
247 Config::SetDefault ("ns3::RedQueueDisc::QW", DoubleValue (0.002)); | 247 Config::SetDefault ("ns3::RedQueueDisc::QW", DoubleValue (0.002)); |
248 Config::SetDefault ("ns3::RedQueueDisc::MinTh", DoubleValue (5)); | 248 Config::SetDefault ("ns3::RedQueueDisc::MinTh", DoubleValue (5)); |
249 Config::SetDefault ("ns3::RedQueueDisc::MaxTh", DoubleValue (15)); | 249 Config::SetDefault ("ns3::RedQueueDisc::MaxTh", DoubleValue (15)); |
250 Config::SetDefault ("ns3::RedQueueDisc::QueueLimit", UintegerValue (1000)); | 250 Config::SetDefault ("ns3::RedQueueDisc::QueueLimit", UintegerValue (1000)); |
251 | 251 |
252 if (aredTest == 1) // test 1: red1 | 252 if (aredTest == 1) // test 1: red1 |
253 { | 253 { |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
288 Config::SetDefault ("ns3::RedQueueDisc::LInterm", DoubleValue (10)); | 288 Config::SetDefault ("ns3::RedQueueDisc::LInterm", DoubleValue (10)); |
289 } | 289 } |
290 else if (aredTest == 10) // test 10: fastlinkAllAdapt | 290 else if (aredTest == 10) // test 10: fastlinkAllAdapt |
291 { | 291 { |
292 Config::SetDefault ("ns3::RedQueueDisc::ARED", BooleanValue (true)); | 292 Config::SetDefault ("ns3::RedQueueDisc::ARED", BooleanValue (true)); |
293 Config::SetDefault ("ns3::RedQueueDisc::LInterm", DoubleValue (10)); | 293 Config::SetDefault ("ns3::RedQueueDisc::LInterm", DoubleValue (10)); |
294 } | 294 } |
295 else if (aredTest == 11) // test 11: fastlinkAllAdaptECN······ | 295 else if (aredTest == 11) // test 11: fastlinkAllAdaptECN······ |
296 { | 296 { |
297 Config::SetDefault ("ns3::RedQueueDisc::ARED", BooleanValue (true)); | 297 Config::SetDefault ("ns3::RedQueueDisc::ARED", BooleanValue (true)); |
| 298 Config::SetDefault ("ns3::RedQueueDisc::UseHardDrop", BooleanValue (false)
); |
298 Config::SetDefault ("ns3::RedQueueDisc::LInterm", DoubleValue (10)); | 299 Config::SetDefault ("ns3::RedQueueDisc::LInterm", DoubleValue (10)); |
299 Config::SetDefault ("ns3::TcpSocketBase::UseEcn", BooleanValue (true)); | 300 Config::SetDefault ("ns3::TcpSocketBase::UseEcn", BooleanValue (true)); |
300 Config::SetDefault ("ns3::RedQueueDisc::UseEcn", BooleanValue (true));············ | 301 Config::SetDefault ("ns3::RedQueueDisc::UseEcn", BooleanValue (true));············ |
301 } | 302 } |
302 else if (aredTest == 12) // test 12: fastlinkAllAdapt1 | 303 else if (aredTest == 12) // test 12: fastlinkAllAdapt1 |
303 { | 304 { |
304 Config::SetDefault ("ns3::RedQueueDisc::ARED", BooleanValue (true)); | 305 Config::SetDefault ("ns3::RedQueueDisc::ARED", BooleanValue (true)); |
305 Config::SetDefault ("ns3::RedQueueDisc::LInterm", DoubleValue (10)); | 306 Config::SetDefault ("ns3::RedQueueDisc::LInterm", DoubleValue (10)); |
306 Config::SetDefault ("ns3::RedQueueDisc::TargetDelay", TimeValue (Seconds (
0.2))); | 307 Config::SetDefault ("ns3::RedQueueDisc::TargetDelay", TimeValue (Seconds (
0.2))); |
307 } | 308 } |
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
507 std::cout << "There should be some unforced drops or marks" << std::endl; | 508 std::cout << "There should be some unforced drops or marks" << std::endl; |
508 exit (1); | 509 exit (1); |
509 } | 510 } |
510 | 511 |
511 if (aredTest == 1 || aredTest == 2 || aredTest == 3 || aredTest == 4 || aredTe
st == 13) | 512 if (aredTest == 1 || aredTest == 2 || aredTest == 3 || aredTest == 4 || aredTe
st == 13) |
512 { | 513 { |
513 if (st.qLimDrop == 0) | 514 if (st.qLimDrop == 0) |
514 { | 515 { |
515 std::cout << "There should be some drops due to queue full" << std::en
dl; | 516 std::cout << "There should be some drops due to queue full" << std::en
dl; |
516 exit (1); | 517 exit (1); |
517 } | 518 } |
518 } | 519 } |
519 else | 520 else |
520 { | 521 { |
521 if (st.qLimDrop != 0) | 522 if (st.qLimDrop != 0) |
522 { | 523 { |
523 std::cout << "There should be zero drops due to queue full" << std::en
dl; | 524 std::cout << "There should be zero drops due to queue full" << std::en
dl; |
524 exit (1); | 525 exit (1); |
525 } | 526 } |
526 } | 527 } |
527 | 528 |
528 if (flowMonitor) | 529 if (flowMonitor) |
529 { | 530 { |
530 std::stringstream stmp; | 531 std::stringstream stmp; |
531 stmp << pathOut << "/ared.flowmon"; | 532 stmp << pathOut << "/ared.flowmon"; |
532 | 533 |
533 flowmon->SerializeToXmlFile (stmp.str ().c_str (), false, false); | 534 flowmon->SerializeToXmlFile (stmp.str ().c_str (), false, false); |
534 } | 535 } |
535 | 536 |
536 if (printAredStats) | 537 if (printAredStats) |
537 { | 538 { |
538 std::cout << "*** ARED stats from Node 2 queue ***" << std::endl; | 539 std::cout << "*** ARED stats from Node 2 queue ***" << std::endl; |
539 std::cout << "\t " << st.unforcedDrop << " drops due to prob mark" << std:
:endl; | 540 std::cout << "\t " << st.unforcedDrop << " drops due to prob mark" << std:
:endl; |
540 std::cout << "\t " << st.unforcedMark << " marks due to prob mark" << std:
:endl; | 541 std::cout << "\t " << st.unforcedMark << " marks due to prob mark" << std:
:endl; |
541 std::cout << "\t " << st.forcedDrop << " drops due to hard mark" << std::e
ndl; | 542 std::cout << "\t " << st.forcedDrop << " drops due to hard mark" << std::e
ndl; |
| 543 std::cout << "\t " << st.forcedMark << " drops due to hard mark" << std::e
ndl; |
542 std::cout << "\t " << st.qLimDrop << " drops due to queue full" << std::en
dl; | 544 std::cout << "\t " << st.qLimDrop << " drops due to queue full" << std::en
dl; |
543 } | 545 } |
544 | 546 |
545 Simulator::Destroy (); | 547 Simulator::Destroy (); |
546 | 548 |
547 return 0; | 549 return 0; |
548 } | 550 } |
LEFT | RIGHT |