所以,我尝试在 OMNET++ 中进行非常基本的有线网络模拟(稍后我将添加无线节点): 数据包类型: UDP 流量类型:视频流 OMNET版本:6.0.1 INET版本:4.5
模拟在没有正常运行的情况下结束,当我运行它时它只是说“模拟定时结束”。没有错误。因此,也没有记录任何结果。
log也向我展示了这一点:
INFO (Tcp)GiB.standardHost1[20].tcp:GiB.standardHost1[20].tcp:完成并打开 0 个连接。 INFO (Tcp)GiB.standardHost1[21].tcp:GiB.standardHost1[21].tcp:完成并打开 0 个连接。 INFO (Tcp)GiB.standardHost1[22].tcp:GiB.standardHost1[22].tcp:完成并打开 0 个连接。 INFO (Tcp)GiB.standardHost1[23].tcp:GiB.standardHost1[23].tcp:完成并打开 0 个连接。 INFO (Tcp)GiB.standardHost1[24].tcp:GiB.standardHost1[24].tcp:完成并打开 0 个连接。 信息 (Tcp)GiB.server.tcp:GiB.server.tcp:已完成,打开 0 个连接。
这是我的 .NED 文件:
import inet.networklayer.configurator.ipv4.Ipv4NetworkConfigurator;
import inet.node.ethernet.EthernetSwitch;
import inet.node.inet.StandardHost;
import ned.DatarateChannel;
//WIRED-SCENARIO
network GiB
{
parameters:
int numHosts;
@display("bgb=650,520");
@statistic[endToEndDelay](title="end-to-end delay"; source="messageAge(rcvdPk)"; unit=s; record=histogram,vector; interpolationmode=none);
@statistic[throughput](title="throughput"; unit=bps; source="throughput(rcvdPk)"; record=histogram,vector);
types:
channel Ether1000m extends DatarateChannel
{
datarate = 1000Mbps;
delay = 0.1us;
}
submodules:
standardHost[numHosts]: StandardHost {
@display("p=85,179");
}
standardHost1[numHosts]: StandardHost {
@display("p=302,374");
}
server: StandardHost {
@display("p=531,67;i=device/server");
}
configurator: Ipv4NetworkConfigurator {
@display("p=46,39");
}
centerSwitch: EthernetSwitch {
@display("p=418,146");
}
ethernetSwitch1: EthernetSwitch {
@display("p=256,146");
}
ethernetSwitch2: EthernetSwitch {
@display("p=341,260");
}
connections:
server.ethg++ <--> Ether1000m <--> centerSwitch.ethg++;
ethernetSwitch1.ethg++ <--> Ether1000m <--> centerSwitch.ethg++;
ethernetSwitch2.ethg++ <--> Ether1000m <--> centerSwitch.ethg++;
for i=0..numHosts-1 {
ethernetSwitch1.ethg++ <--> Ether1000m <--> standardHost[i].ethg++;
standardHost1[i].ethg++ <--> Ether1000m <--> ethernetSwitch2.ethg++;
}
}
和 ini 文件:
[General]
network = GiB
#wiredscenario
sim-time-limit = 5400s
**.numHosts = ${5..25 step 10}
*.*.numUdpApps = 1
**.channel.throughput.statistic-recording = true
**.channel.throughput.result-recording-modes = all
**.*.vector-recording = true
**.*.vector-recording-intervals = 0..900
**.*.scalar-recording = true
[Config UDP]
**.standardHost[*].udpApp[*].typename = "UdpVideoStreamClient"
**.standardHost[*].udpApp[*].serverAddress = "server"
**.standardHost[*].udpApp[*].serverPort = 1000
**.standardHost[*].udpApp[*].startTime = 5s
**.standardHost1[*].udpApp[*].typename = "UdpVideoStreamClient"
**.standardHost1[*].udpApp[*].serverAddress = "server"
**.standardHost1[*].udpApp[*].serverPort = 1000
**.server.udpApp[*].typename = "UdpVideoStreamServer"
**.server.udpApp[*].localPort = 1000
**.server.udpApp[*].sendInterval = 0.001s
**.server.udpApp[*].packetLen = 1400B
**.server.udpApp[*].videoSize = 1Gb
我需要帮助。谢谢你:)
您的
omnetpp.ini
有两个问题:
INET
使用 numApps
代替 numUdpApps
或 numTcpApps
。StandardHost
有 app[]
用于存储应用程序 - 既不是 udpApp[]
也不是 tcpApp[]
。所以更正后的
omnetpp.ini
应该看起来像这样:
[General]
network = GiB
sim-time-limit = 5400s
**.numHosts = ${5..25 step 10}
**.channel.throughput.statistic-recording = true
**.channel.throughput.result-recording-modes = all
**.*.vector-recording = true
**.*.vector-recording-intervals = 0..900
**.*.scalar-recording = true
[Config UDP]
**.standardHost[*].numApps = 1
**.standardHost[*].app[*].typename = "UdpVideoStreamClient"
**.standardHost[*].app[*].serverAddress = "server"
**.standardHost[*].app[*].serverPort = 1000
**.standardHost[*].app[*].startTime = 5s
**.standardHost1[*].numApps = 1
**.standardHost1[*].app[*].typename = "UdpVideoStreamClient"
**.standardHost1[*].app[*].serverAddress = "server"
**.standardHost1[*].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
此外,在您的 NED 文件中,我建议删除主机的
@display
,因为它会导致在同一位置显示所有主机:
submodules:
standardHost[numHosts]: StandardHost;
standardHost1[numHosts]: StandardHost;