在 Omnet++ 中通过 AP 将无线主机连接到标准主机
Posted
技术标签:
【中文标题】在 Omnet++ 中通过 AP 将无线主机连接到标准主机【英文标题】:Connecting Wireless Hosts to a Standard Host via AP in Omnet++ 【发布时间】:2018-05-31 06:21:31 【问题描述】: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中 文件?),在 /Users/ashish/omnetpp-5.3/samples/inet/src/inet/linklayer/ieee80211/Ieee80211Nic.ned:77 -- 在模块 (omnetpp::cModule) clientserverWLAN.host1.wlan[0] (id=42) 中,在网络设置期间
请帮助建立无线主机到 AP 和服务器之间的通信
尝试运行 UDP 应用程序
【问题讨论】:
【参考方案1】:您应该通过替换来指定无线电频道的类型
radioMedium: <mediumType> like IRadioMedium
与
radioMedium: Ieee80211ScalarRadioMedium
【讨论】:
以上是关于在 Omnet++ 中通过 AP 将无线主机连接到标准主机的主要内容,如果未能解决你的问题,请参考以下文章
用于从该框中通过 SSH 连接到 jumphost 和 sftp 的 Python 脚本
无线路由器提供AP、Client、Router、Bridge、Repeater五种工作模式 ,这五种工作模式都是啥意思呀