diff --git a/RELEASE_NOTES b/RELEASE_NOTES index f7c4f638d..a333b460a 100644 --- a/RELEASE_NOTES +++ b/RELEASE_NOTES @@ -33,6 +33,7 @@ Bugs fixed - Bug 1678 - C++11 compliance problem with std::pair" - Bug 1683 - IPv6 autoconfigured don't use *infinite* lifetimes - Bug 1669 - ns-3 should support binding two and three (possibly more) arguments +- Bug 1675 - Throughput computation error in Wireless examples - Bug 1688 - Routers should advertise themselves from the link-local address - Bug 1689 - IPv6 shouldn't add a default gateway without checking the Router lifetime - Bug 1697 - ICMPv6 Redirect trigger contains multiple bugs diff --git a/examples/wireless/multirate.cc b/examples/wireless/multirate.cc index 48feee414..920bb33be 100644 --- a/examples/wireless/multirate.cc +++ b/examples/wireless/multirate.cc @@ -103,6 +103,7 @@ private: double totalTime; double expMean; + double samplingPeriod; uint32_t bytesTotal; uint32_t packetSize; @@ -129,6 +130,7 @@ Experiment::Experiment (std::string name) : m_output (name), totalTime (0.3), expMean (0.1), //flows being exponentially distributed + samplingPeriod(0.1), bytesTotal (0), packetSize (2000), gridSize (10), //10x10 grid for a total of 100 nodes @@ -172,12 +174,12 @@ Experiment::ReceivePacket (Ptr socket) void Experiment::CheckThroughput () { - double mbs = ((bytesTotal * 8.0) /1000000); + double mbs = ((bytesTotal * 8.0) /1000000 /samplingPeriod); bytesTotal = 0; m_output.Add ((Simulator::Now ()).GetSeconds (), mbs); - //check throughput every 1/10 of a second - Simulator::Schedule (Seconds (0.1), &Experiment::CheckThroughput, this); + //check throughput every samplingPeriod second + Simulator::Schedule (Seconds (samplingPeriod), &Experiment::CheckThroughput, this); } /** @@ -534,6 +536,17 @@ Experiment::CommandSetup (int argc, char **argv) CommandLine cmd; cmd.AddValue ("packetSize", "packet size", packetSize); cmd.AddValue ("totalTime", "simulation time", totalTime); + // according to totalTime, select an appropriate samplingPeriod automatically. + if (totalTime < 1.0) + { + samplingPeriod = 0.1; + } + else + { + samplingPeriod = 1.0; + } + // or user selects a samplingPeriod. + cmd.AddValue ("samplingPeriod", "sampling period", samplingPeriod); cmd.AddValue ("rtsThreshold", "rts threshold", rtsThreshold); cmd.AddValue ("rateManager", "type of rate", rateManager); cmd.AddValue ("outputFileName", "output filename", outputFileName); diff --git a/examples/wireless/wifi-hidden-terminal.cc b/examples/wireless/wifi-hidden-terminal.cc index 0a5c2449c..efddeea42 100644 --- a/examples/wireless/wifi-hidden-terminal.cc +++ b/examples/wireless/wifi-hidden-terminal.cc @@ -156,9 +156,10 @@ void experiment (bool enableCtsRts) if (i->first > 2) { Ipv4FlowClassifier::FiveTuple t = classifier->FindFlow (i->first); - std::cout << "Flow " << i->first - 2 << " (" << t.sourceAddress << " -> " << t.destinationAddress << ")\n"; std::cout << " Tx Bytes: " << i->second.txBytes << "\n"; + std::cout << "Flow " << i->first - 2 << " (" << t.sourceAddress << " -> " << t.destinationAddress << ")\n"; + std::cout << " Tx Bytes: " << i->second.txBytes << "\n"; std::cout << " Rx Bytes: " << i->second.rxBytes << "\n"; - std::cout << " Throughput: " << i->second.rxBytes * 8.0 / 10.0 / 1024 / 1024 << " Mbps\n"; + std::cout << " Throughput: " << i->second.rxBytes * 8.0 / 10.0 / 1000 / 1000 << " Mbps\n"; } }