在OMNeT ++中定期添加主机

时间:2016-08-24 13:02:02

标签: c++ omnet++ event-simulation

我有100个主机的网络设置,必须逐个进入网络,直到所有人都加入24小时模拟时间(一个选项是每864秒加一个)。

我有兴趣通过邻居发现协议计算机器之间交换的多播消息。是否可以在不更改IPv6NeighbourDiscovery.cc的源文件中的任何内容的情况下执行此操作?

这是我的NED文件:

package inet.examples.wireless.wiredandwirelesshostswithap;

import inet.networklayer.configurator.ipv6.FlatNetworkConfigurator6;
import inet.networklayer.icmpv6.IPv6NeighbourDiscovery;
import inet.node.ethernet.Eth100M;
import inet.node.ipv6.Router6;
import inet.node.xmipv6.WirelessHost6;
import inet.node.wireless.AccessPoint;
import inet.physicallayer.ieee80211.packetlevel.Ieee80211ScalarRadioMedium;


network WiredAndWirelessHostsWithAP
{
    parameters:
        int n;
        @display("bgb=503,434");
    submodules:
        wirelessHost[n]: WirelessHost6 {
            @display("p=58,88");
        }
        router6: Router6 {
            @display("p=412,88");
        }
        accessPoint: AccessPoint {
            @display("p=323,87");
        }
        configurator: FlatNetworkConfigurator6 {
            @display("p=323,165");
        }
        radioMedium: Ieee80211ScalarRadioMedium {
            @display("p=98,392");
        }
    connections:
        accessPoint.ethg++ <--> Eth100M <--> router6.ethg++;

}

和ini文件:

[General]
network = WiredAndWirelessHostsWithAP
sim-time-limit = 24h
tkenv-plugin-path = ../../../etc/plugins

# number of client computers
*.n = 100

**.*Host*.numUdpApps = 3

**.*Host*.udpApp[0].typename = "UDPEchoApp"
**.*Host*.udpApp[0].localPort = 1000

**.*Host*.udpApp[*].typename = "UDPBasicApp"
**.*Host*.udpApp[1..].destPort = 1000
**.*Host*.udpApp[1..].messageLength = 100B
**.*Host*.udpApp[1..].sendInterval = 1s
**.*Host*.udpApp[1..].stopTime = 300s

提前谢谢!

1 个答案:

答案 0 :(得分:0)

不,如果不修改C ++文件,就无法计算收到的IPv6NeighbourDiscovery消息数。