问题描述
我一直致力于向 INET 吞吐量示例添加多个主机。
inet/showcases/无线/吞吐量
然而,当我在添加更多主机后运行代码时,生成的图形看起来与原始图形非常相似,我预计会有某种明显的差异 - 这让我相信代码有问题。
原始示例代码:
throughput.ini
[General]
[Config Throughput]
network = Throughput
sim-time-limit = 1s
*.*Host.ipv4.arp.typename = "GlobalArp"
*.*Host.wlan[*].mgmt.typename = "Ieee80211MgmtAdhoc"
*.*Host.wlan[*].agent.typename = ""
*.*Host.wlan[*].opMode = "g(erp)"
*.*Host.wlan[*].bitrate = ${bitrate = 6,9,12,18,24,36,48,54}Mbps
*.*Host.wlan[*].mac.dcf.originatorMacDataService.fragmentationPolicy.fragmentationThreshold = 2304B + 28B
*.*Host.wlan[*].radio.separateReceptionParts = true
*.*Host.wlan[*].radio.separateTransmissionParts = true
*.sourceHost.numApps = 1
*.sourceHost.app[0].typename = "UdpBasicApp"
*.sourceHost.app[*].destAddresses = "destinationHost"
*.sourceHost.app[*].destPort = 5000
*.sourceHost.app[*].packetName = "UDPData-"
*.sourceHost.app[*].startTime = 0s
*.sourceHost.app[*].messageLength = ${packetLength = 100,1000,2268}byte
*.sourceHost.app[*].sendInterval = ${packetLength} * 8 / ${bitrate} * 1us
*.destinationHost.numApps = 1
*.destinationHost.app[0].typename = "UdpSink"
*.destinationHost.app[*].localPort = 5000
throughput.ned
package inet.showcases.wireless.throughput;
import inet.networklayer.configurator.ipv4.Ipv4NetworkConfigurator;
import inet.node.inet.WirelessHost;
import inet.physicallayer.ieee80211.packetlevel.Ieee80211ScalarRadioMedium;
network Throughput
{
@display("bgb=6,4");
@statistic[throughput](source=liveThroughput(destinationHost.app[0].packetReceived)/1000000; record=figure; targetFigure=panel.throughput; checkSignals=false);
@statistic[numRcvdPk](source=count(destinationHost.app[0].packetReceived); record=figure; targetFigure=panel.numRcvdPkCounter; checkSignals=false);
@figure[panel](type=panel; pos=1.5,0.1);
// @figure[panel.throughput](type=gauge; pos=0,0; size=100,100; minValue=0; maxValue=40; tickSize=5; label="App level throughput [Mbps]");
@figure[panel.throughput](type=linearGauge; pos=250,50; size=250,30; minValue=0; maxValue=54; tickSize=6; label="Application level throughput [Mbps]");
@figure[panel.numRcvdPkCounter](type=counter; pos=50,50; label="Packets received"; decimalPlaces=6);
submodules:
sourceHost: WirelessHost {
@display("p=3.019269,2.746169");
}
destinationHost: WirelessHost {
@display("p=4.369595,1.8054924");
}
configurator: Ipv4NetworkConfigurator {
@display("p=1.0772266,0.6220604");
}
radioMedium: Ieee80211ScalarRadioMedium {
@display("p=1.03171,1.9723867");
}
}
我这样做的方法是复制 throughput.ned
中的源主机子模块,并为其命名为 sourceHost2
。然后,我修改了 ini
文件以适应更改,例如更改
*.*Host.ipv4.arp.typename = "GlobalArp"
到
*.*Host*.ipv4.arp.typename = "GlobalArp"
这运行良好,但根本没有真正改变吞吐量 - 图中有一两个稍微粗糙的峰/谷,但没有什么明显的 - 有什么想法吗?
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)