From ed66ffad0dd85ba1af0840445825a9b3082a5251 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Deronne?= Date: Tue, 27 Dec 2016 09:29:00 +0100 Subject: [PATCH] examples: (fixes #2594) Fix throughput calculation in vht-wifi-network --- RELEASE_NOTES | 1 + examples/wireless/vht-wifi-network.cc | 11 ++++------- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/RELEASE_NOTES b/RELEASE_NOTES index 7a99978b6..073e5a829 100644 --- a/RELEASE_NOTES +++ b/RELEASE_NOTES @@ -53,6 +53,7 @@ Bugs fixed - Bug 2563 - Modify pybindgen version check to >= minimum version required - Bug 2564 - Simulation crashes when CtsTimeout is triggered for A-MPDU transmissions - Bug 2566 - BlockAckManager::GetNRetryNeededPackets missing some packets in the queue +- Bug 2594 - vht-wifi-network provides very low throughtput at MCS 6, 160 MHz, SGI Known issues ------------ diff --git a/examples/wireless/vht-wifi-network.cc b/examples/wireless/vht-wifi-network.cc index fcae415aa..5c9c8afb6 100644 --- a/examples/wireless/vht-wifi-network.cc +++ b/examples/wireless/vht-wifi-network.cc @@ -195,19 +195,16 @@ int main (int argc, char *argv[]) Simulator::Run (); Simulator::Destroy (); - double throughput = 0; + uint64_t rxBytes = 0; if (udp) { - //UDP - uint32_t totalPacketsThrough = DynamicCast (serverApp.Get (0))->GetReceived (); - throughput = totalPacketsThrough * payloadSize * 8 / (simulationTime * 1000000.0); //Mbit/s + rxBytes = payloadSize * DynamicCast (serverApp.Get (0))->GetReceived (); } else { - //TCP - uint32_t totalPacketsThrough = DynamicCast (sinkApp.Get (0))->GetTotalRx (); - throughput = totalPacketsThrough * 8 / (simulationTime * 1000000.0); //Mbit/s + rxBytes = payloadSize * DynamicCast (sinkApp.Get (0))->GetTotalRx (); } + double throughput = (rxBytes * 8) / (simulationTime * 1000000.0); //Mbit/s std::cout << i << "\t\t\t" << j << " MHz\t\t\t" << k << "\t\t\t" << throughput << " Mbit/s" << std::endl; } j *= 2;