本文介绍了NS3中UDP吞吐量计算的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在 NS3 中有一个客户端/服务器拓扑结构,我想计算服务器上 UDP 流量的吞吐量.这行代码 sink = StaticCast(tcpServerApp.Get(0));
不起作用,因为它只能用于计算 TCP 数据包的吞吐量.如何计算服务器上接收到的 UDP 流量的吞吐量?
I have a client/server topology in NS3 and I want to calculate the throughput of UDP traffic on the server.This line of code sink = StaticCast<PacketSink> (tcpServerApp.Get (0));
does not work because it can only be used in calculating the throughput of TCP packets. How can I calculate throughput for the received UDP traffic on the server?
谢谢
推荐答案
感谢您的回答.我实现了代码:
Thanks because of the answer.I implemented the code:
uint64_t rxBytes = 0;
rxBytes = 1400 * DynamicCast<UdpServer> (ServerApp.Get (0))->GetReceived ();
double throughput = (rxBytes * 8) / (10 * 1000000.0); //Mbit/s
std::cout << "throughput = " << throughput << " Mbit/s" << std::end
但是我收到了 SIGSEGV 错误.可能是什么问题?
But I got the SIGSEGV Error.What can be the problem?
谢谢
这篇关于NS3中UDP吞吐量计算的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!