View | Details | Raw Unified | Return to bug 2594
Collapse All | Expand All

(-)a/examples/wireless/vht-wifi-network.cc (-7 / +4 lines)
 Lines 195-213    Link Here 
195
              Simulator::Run ();
195
              Simulator::Run ();
196
              Simulator::Destroy ();
196
              Simulator::Destroy ();
197
197
198
              double throughput = 0;
198
              uint64_t rxBytes = 0;
199
              if (udp)
199
              if (udp)
200
                {
200
                {
201
                  //UDP
201
                  rxBytes = payloadSize * DynamicCast<UdpServer> (serverApp.Get (0))->GetReceived ();
202
                  uint32_t totalPacketsThrough = DynamicCast<UdpServer> (serverApp.Get (0))->GetReceived ();
203
                  throughput = totalPacketsThrough * payloadSize * 8 / (simulationTime * 1000000.0); //Mbit/s
204
                }
202
                }
205
              else
203
              else
206
                {
204
                {
207
                  //TCP
205
                  rxBytes = payloadSize * DynamicCast<PacketSink> (sinkApp.Get (0))->GetTotalRx ();
208
                  uint32_t totalPacketsThrough = DynamicCast<PacketSink> (sinkApp.Get (0))->GetTotalRx ();
209
                  throughput = totalPacketsThrough * 8 / (simulationTime * 1000000.0); //Mbit/s
210
                }
206
                }
207
              double throughput = (rxBytes * 8) / (simulationTime * 1000000.0); //Mbit/s
211
              std::cout << i << "\t\t\t" << j << " MHz\t\t\t" << k << "\t\t\t" << throughput << " Mbit/s" << std::endl;
208
              std::cout << i << "\t\t\t" << j << " MHz\t\t\t" << k << "\t\t\t" << throughput << " Mbit/s" << std::endl;
212
            }
209
            }
213
          j *= 2;
210
          j *= 2;

Return to bug 2594