如何在OMNET++中获取丢包率(%)、吞吐量、E2E时延统计信息?

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

我已经尝试过@statistic[nameOfStatistic]来计算PacketLoss,但它仍然没有出现在.anf中。如何计算它?我无法找到足够的信息。请帮忙!

我应该使用哪个模块过滤器或结果名称过滤器来获得所需的结果,即丢包吞吐量和 E2E 延迟(所有这些分别针对每个节点)?

我已经浏览了 stackoverflow、文档/手册和 google groups。

谢谢你。

数据包类型:UDP 流量类型:视频流 OMNET 版本:6.0.1 INET 版本:4.5 NED文件代码和.ini代码如下:

.NED 文件:

mport inet.networklayer.configurator.ipv4.Ipv4NetworkConfigurator;
import inet.node.ethernet.EthernetSwitch;
import inet.node.inet.StandardHost;
import inet.node.inet.WirelessHost;
import inet.node.wireless.AccessPoint;
import inet.physicallayer.wireless.ieee80211.packetlevel.Ieee80211ScalarRadioMedium;
import inet.visualizer.common.IntegratedVisualizer;
import ned.DatarateChannel;
//WIRED-SCENARIO
network GiB
{
    parameters:
        @display("bgb=1986.9299,976.53595");
        @statistic[endToendDelay](title="end-to-end delay"; source="messageAge(rcvdPk)"; unit=s; record=vector);
        @statistic[throughput](title="throughput"; unit=bps; source="throughput(rcvdPk)"; record=vector);
   
        int numHosts;
        int numWHosts;
    types:
        channel Ether1000m extends DatarateChannel
        {
            datarate = 1000Mbps;
            delay = 0.1us;
        }
    submodules:
        standardHost[numHosts]: StandardHost;
        standardHost1[numHosts]: StandardHost;
        server: StandardHost {
            @display("p=985.446,69.498;i=device/server");
        }
        configurator: Ipv4NetworkConfigurator {
            @display("p=263.675,820.875");
        }
        centerSwitch: EthernetSwitch {
            @display("p=985.446,276.21");
        }
        ethernetSwitch1: EthernetSwitch {
            @display("p=518.562,441.936");
        }
        ethernetSwitch2: EthernetSwitch {
            @display("p=760.914,488.26797");
        }
        wirelessHost[numWHosts]: WirelessHost {
            @display("p=265.518,185.328");
        }
        wirelessHost1[numWHosts]: WirelessHost {
            @display("p=115.829994,367.09198");
        }
        accessPoint: AccessPoint {
            @display("p=504.306,276.21");
        }
        accessPoint1: AccessPoint {
            @display("p=311.85,422.33398");
        }
        radioMedium: Ieee80211ScalarRadioMedium {
            @display("p=450.2375,818.3875");
        }
        visualizer: IntegratedVisualizer {
            @display("p=114.424995,820.875");
        }
        ethernetSwitch3: EthernetSwitch {
            @display("p=1044.252,497.17798");
        }
        ethernetSwitch4: EthernetSwitch {
            @display("p=1309.77,506.08798");
        }
        ethernetSwitch5: EthernetSwitch {
            @display("p=1564.596,543.51");
        }
        standardHost2[numHosts]: StandardHost;
        standardHost3[numHosts]: StandardHost;
        standardHost4[numHosts]: StandardHost;
    connections:
        server.ethg++ <--> Ether1000m <--> centerSwitch.ethg++;
        ethernetSwitch1.ethg++ <--> Ether1000m <--> centerSwitch.ethg++;
        ethernetSwitch2.ethg++ <--> Ether1000m <--> centerSwitch.ethg++;
        centerSwitch.ethg++ <--> Ether1000m <--> ethernetSwitch3.ethg++;
        centerSwitch.ethg++ <--> Ether1000m <--> ethernetSwitch4.ethg++;
        centerSwitch.ethg++ <--> Ether1000m <--> ethernetSwitch5.ethg++;
        for i=0..numHosts-1 {
            ethernetSwitch1.ethg++ <--> Ether1000m <--> standardHost[i].ethg++;
            standardHost1[i].ethg++ <--> Ether1000m <--> ethernetSwitch2.ethg++;
            ethernetSwitch3.ethg++ <--> Ether1000m <--> standardHost2[i].ethg++;
            ethernetSwitch4.ethg++ <--> Ether1000m <--> standardHost3[i].ethg++;
            ethernetSwitch5.ethg++ <--> Ether1000m <--> standardHost4[i].ethg++;
        }
        ethernetSwitch1.ethg++ <--> Ether1000m <--> accessPoint1.ethg++;
        ethernetSwitch2.ethg++ <--> Ether1000m <--> accessPoint.ethg++;


}

.ini文件代码:

[General]
network = GiB
sim-time-limit = 3600s

#**.numHosts = ${5..25 step 10}
**.numHosts = ask
**.numWHosts = ask

**.channel.throughput.statistic-recording = true
**.channel.throughput.result-recording-modes = all
**.*.vector-recording = true
**.*.vector-recording-intervals = 0..900
**.*.scalar-recording = true

**.standardHost[*].numApps = 1
**.standardHost[*].app[*].typename = "UdpVideoStreamClient"
**.standardHost[*].app[*].serverAddress = "server"
**.standardHost[*].app[*].serverPort = 1000

**.constraintAreaMinX = 0m
**.constraintAreaMinY = 0m
**.constraintAreaMinZ = 0m
**.constraintAreaMaxX = 800m
**.constraintAreaMaxY = 500m
**.constraintAreaMaxZ = 0m


**.standardHost1[*].numApps = 1
**.standardHost1[*].app[*].typename = "UdpVideoStreamClient"
**.standardHost1[*].app[*].serverAddress = "server"
**.standardHost1[*].app[*].serverPort = 1000

**.standardHost2[*].numApps = 1
**.standardHost2[*].app[*].typename = "UdpVideoStreamClient"
**.standardHost2[*].app[*].serverAddress = "server"
**.standardHost2[*].app[*].serverPort = 1000

**.standardHost3[*].numApps = 1
**.standardHost3[*].app[*].typename = "UdpVideoStreamClient"
**.standardHost3[*].app[*].serverAddress = "server"
**.standardHost3[*].app[*].serverPort = 1000

**.standardHost4[*].numApps = 1
**.standardHost4[*].app[*].typename = "UdpVideoStreamClient"
**.standardHost4[*].app[*].serverAddress = "server"
**.standardHost4[*].app[*].serverPort = 1000

**.server.numApps = 1
**.server.app[*].typename = "UdpVideoStreamServer"
**.server.app[*].localPort = 1000
**.server.app[*].sendInterval = 0.001s
**.server.app[*].packetLen = 1400B
**.server.app[*].videoSize = 1Gb


**.addDefaultRoutes = false

#Assigning SSID to access point and configuring wireless hosts

*.accessPoint.numApps = 1
*.accessPoint.numWlanInterfaces = default
*.accessPoint.wlan[*].mgmt.ssid = "AP"
*.accessPoint1.numApps = 1
*.accessPoint1.numWlanInterfaces = default
*.accessPoint1.wlan[*].mgmt.ssid = "AP1"

*.wirelessHost[*].numApps = 1
*.wirelessHost[*].wlan[*].agent.defaultSsid = "AP"
*.wirelessHost[*].app[*].typename = "UdpVideoStreamClient"
*.wirelessHost[*].app[*].serverAddress = "server"
*.wirelessHost[*].app[*].serverPort = 1000

*.wirelessHost1[*].numApps = 1
*.wirelessHost1[*].wlan[*].agent.defaultSsid = "AP1"
*.wirelessHost1[*].app[*].typename = "UdpVideoStreamClient"
*.wirelessHost1[*].app[*].serverAddress = "server"
*.wirelessHost1[*].app[*].serverPort = 1000
networking simulation omnet++ inet packet-loss
1个回答
0
投票

我已经检查了您的模拟:

numHosts=3
numWHosts=3
time of simulation: 36 s

结果确实包含您的 NED 统计数据中指定的内容,即

endToendDelay
throughput

看到他们:

  • 进入目录
    results
  • 双击任意 *.sca 文件并确认创建新分析文件 (*.anf)
  • 选择底部的
    Browse data
    ,转到
    Vectors
    选项卡
  • 在字段中
    result name filter
    写下
    endToEndDelay*

您应该看到记录的矢量:

双击任意行后,将绘制统计数据,例如:

当您在

throughput*
中设置
result name filter
时,您将看到吞吐量的统计数据:

© www.soinside.com 2019 - 2024. All rights reserved.