NS3中的UDP吞吐量计算

问题描述 投票:0回答:1

我在NS3中具有客户端/服务器拓扑,我想计算服务器的吞吐量。通常的“接收器= StaticCast(tcpServerApp.Get(0))”;将无法正常工作,因为它用于计数TCP数据包。如何计算收到的UDP数据报的吞吐量?

谢谢

udp throughput
1个回答
0
投票

您可以使用以下代码来计算UDP数据包的吞吐量。您应该在Simulation::Run();

之后使用此代码
      uint64_t rxBytes = 0;

      rxBytes = payloadSize * DynamicCast<UdpServer> (serverApp.Get (0))->GetReceived ();
      double throughput = (rxBytes * 8) / (simulationTime * 1000000.0); //Mbit/s
      std::cout << "throughput = " << throughput << " Mbit/s" << std::endl;
© www.soinside.com 2019 - 2024. All rights reserved.