NED文件:
import inet.networklayer.configurator.ipv4.IPv4NetworkConfigurator;
import inet.physicallayer.ieee80211.packetlevel.Ieee80211ScalarRadioMedium;
import inet.node.inet.WirelessHost;
import inet.node.wireless.AccessPoint;
import inet.visualizer.contract.IIntegratedVisualizer;
import inet.node.inet.StandardHost;
import ned.DatarateChannel;
import inet.physicallayer.contract.packetlevel.IRadioMedium;
import inet.linklayer.contract.IWirelessNic;
//import inet.physicallayer.commom.packetlevel.Radio;
//import inet.linklayer.contract.IWirelessNic;
channel Link extends ned.DatarateChannel
{
parameters:
int cost = default(0);
}
network clientserverWLAN
{
parameters:
string mediumType = default("IdealRadioMedium");
//**.mgmt.numChannels = 2;
submodules:
visualizer: <default("IntegratedCanvasVisualizer")> like IIntegratedVisualizer if hasVisualizer() {
parameters:
@display("p=100,50");
}
configurator: IPv4NetworkConfigurator {
parameters:
@display("p=100,150");
}
radioMedium: <mediumType> like IRadioMedium {
parameters:
@display("p=100,250");
}
host1: WirelessHost {
@display("r=,,#707070");
}
ap: AccessPoint {
@display("p=349,167;r=,,#707070");
}
server: StandardHost {
@display("p=224,168;i=device/server");
}
connections:
ap.ethg++ <--> DatarateChannel { delay = 0.1us; datarate = 10Mbps; } <--> server.ethg++;
}
INI文件:
[General]
network = clientserverWLAN
output-scalar-file-append = false
output-vector-file-append = false
runnumber-width = 0
sim-time-limit = 10s
record-eventlog = true
**.wlan[*].mgmtType = "Ieee80211MgmtAPSimplified"
**.wlan[*].radioType ="Ieee80211ScalarRadioMedium"
#**.wlan[*].radioType ="Ieee80211Nic"
#**.wlan[*].radioType ="IdealWirelessNic"
**.wlan[*].macType = "Ieee80211Mac"
**.wlan*.bitrate = 2Mbps
**.host1.numUdpApps=1
**.host1.udpApp[*].typename="UDPBasicApp"
**.host1.udpApp[*].destAddresses = "server"
**.host1.udpApp[*].destPort = 1000
**.host1.udpApp[*].messageLength = 1000B
**.host1.udpApp[*].startTime = 0s
**.host1.udpApp[*].sendInterval = 10s
**.host1.udpApp[*].stopTime = 300s
**.server.numUdpApps = 1
**.server.udpApp[*].typename="UDPSink"
**.server.udpApp[*].localPort = 1000
**.ap.wlan[*].mac.address = "10:00:00:00:00:00"
**.ap.wlan[*].radio.typename ="Ieee80211ScalarRadioMedium"
#**.ap.wlan[*].radio.typename ="Ieee80211Nic"
#**.ap.wlan[*].radio.typename ="IdealWirelessNic"
**.ap.wlan[*].mgmt.typename = "Ieee80211MgmtAPSimplified"
**.host1.wlan[*].radio.typename = "Ieee80211ScalarRadioMedium"
#**.host1.wlan[*].radio.typename = "Ieee80211Nic"
#**.host1.wlan[*].radio.typename = "IdealWirelessNic"
**.host1.wlan[*].mgmt.typename = "Ieee80211MgmtAPSimplified"
**.mac.address = "auto"
错误:
子模块无线电:没有名为'Ieee80211ScalarRadioMedium'的模块类型 发现实现模块接口 inet.physicallayer.contract.packetlevel.IRadio(不在加载的NED中 文件?),at /Users/ashish/omnetpp-5.3/samples/inet/src/inet/linklayer/ieee80211/Ieee80211Nic.ned:77 - 在网络设置期间的模块(omnetpp :: cModule)clientserverWLAN.host1.wlan [0](id = 42)
请帮助建立无线主机与AP和服务器之间的通信
尝试运行UDP应用
答案 0 :(得分:0)
您应该通过替换
来指定无线电频道的类型radioMedium: <mediumType> like IRadioMedium
带
radioMedium: Ieee80211ScalarRadioMedium