我在NS3中具有客户端/服务器拓扑,我想计算服务器的吞吐量。通常的“接收器= StaticCast(tcpServerApp.Get(0))”;将无法正常工作,因为它用于计数TCP数据包。如何计算收到的UDP数据报的吞吐量?
谢谢
您可以使用以下代码来计算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;