我在 VACaMobil 中遇到了一些 TCP 问题。我正在使用 Inet 中构建的两个 TCP 模块:TCPBasicClientApp 和 TCPEchoApp。前者作为客户端工作,而前者作为服务器工作。
模拟中的汽车数量(模块名称为“coche”)为100,并发传输有5个:
CLIENT SERVER
Car 0 --> Car 99
Car 1 --> Car 98
Car 2 --> Car 97
Car 3 --> Car 96
Car 4 --> Car 95
我也在使用三种路由协议:AODV、DYMO 和 OLSR。但是,无论我运行什么配置,模拟中都会出现这样的错误:
Error in module (TCPBasicClientApp) Highway.coche[*].tcpApp[0] (id = 35) at event #49519, t = 166: IPvXAddressResolver: module 'coche[98]' not found.
在这种情况下,使用 AODV,汽车 1 无法与汽车 98 通信。我了解到 VACaMobil 在一段时间后删除了一些汽车,而它正在创建超过 100 的其他汽车,例如“coche[110]”、“coche[115]” ]“, ETC。
我不明白为什么它一直在删除和创建节点;我认为 VACaMobil 确实产生了恒定数量的车辆。
我怎样才能解决这个问题?任何帮助表示赞赏。
这是 omnetpp.ini:
[General]
network = Highway
debug-on-errors = false
cmdenv-express-mode = true
cmdenv-autoflush = true
cmdenv-status-frequency = 10000000s
#repeat = 10
tkenv-plugin-path = ../../../etc/plugins
tkenv-image-path = bitmaps
check-signals = true
**.manager.**.scalar-recording = true
**.manager.**.vector-recording = true
**.manetrouting.**.scalar-recording = true
**.movStats.**.scalar-recording = true
**.movStats.**.vector-recording = true
**.mac.**.scalar-recording = true
**.mac.**.vector-recording = true
**.scalar-recording = true
**.vector-recording = true
#ChannelControl
*.channelControl.carrierFrequency = 2.4GHz
*.channelControl.pMax = 2mW
*.channelControl.sat = -110dBm
*.channelControl.alpha = 2
*.channelControl.numChannels = 1
# TraCIScenarioManagerLaunchd
*.manager.updateInterval = 1s
*.manager.host = "localhost"
*.manager.port = 9999
*.manager.moduleType = "rcdp9.TAdhocHost"
*.manager.moduleName = "coche"
*.manager.moduleDisplayString = ""
*.manager.autoShutdown = true
*.manager.margin = 25
*.manager.warmUpSeconds = 0
*.manager.launchConfig = xmldoc("VACaMobil/Milan/downtown.launch.xml")
*.manager.getStatistics = true
*.manager.statFiles = "${resultdir}/${configname}-${runnumber}-"
# nic settings
**.wlan[*].bitrate = 24Mbps
**.wlan[*].opMode = "g"
**.wlan[*].mgmt.frameCapacity = 10
**.wlan[*].mgmtType = "Ieee80211MgmtAdhoc"
**.wlan[*].mac.basicBitrate = 24Mbps
**.wlan[*].mac.controlBitrate = 24Mbps
**.wlan[*].mac.address = "auto"
**.wlan[*].mac.maxQueueSize = 14
**.wlan[*].mac.rtsThresholdBytes = 3000B
**.wlan[*].mac.retryLimit = 7
**.wlan[*].mac.cwMinData = 7
**.wlan[*].radio.transmitterPower = 2mW
**.wlan[*].radio.thermalNoise = -110dBm
**.wlan[*].radio.sensitivity = -85dBm
**.wlan[*].radio.pathLossAlpha = 2
**.wlan[*].radio.snirThreshold = 4dB
**.channelNumber = 0
**.coche.networkLayer.configurator.networkConfiguratorModule = "configurator"
# manet routing
**.routingProtocol = ${"AODVUU", "DYMO", "OLSR"}
**.tcpAlgorithmClass = "TCPNewReno"
**.coche[0..4].numTcpApps = 1
**.coche[0..4].tcpApp[*].typename = "TCPBasicClientApp"
**.coche[0..4].tcpApp[*].localPort = -1
**.coche[0..4].tcpApp[*].connectPort = 1000
**.coche[0..4].tcpApp[*].dataTransferMode = "bytecount"
**.coche[0..4].tcpApp[*].startTime = 10s
**.coche[0..4].tcpApp[*].thinkTime = 1s
**.coche[0..4].tcpApp[*].idleInterval = 3s
**.coche[0..4].tcpApp[*].requestLength = 5000000B
**.coche[5..94].numTcpApps = 0
**.coche[95..99].numTcpApps = 1
**.coche[95..99].tcpApp[*].typename = "TCPEchoApp"
**.coche[95..99].tcpApp[*].localPort = 1000
**.coche[95..99].tcpApp[*].dataTransferMode = "bytecount"
**.coche[0].tcpApp[*].connectAddress = "coche[99]"
**.coche[1].tcpApp[*].connectAddress = "coche[98]"
**.coche[2].tcpApp[*].connectAddress = "coche[97]"
**.coche[3].tcpApp[*].connectAddress = "coche[96]"
**.coche[4].tcpApp[*].connectAddress = "coche[95]"
**.meanNumberOfCars = 100
**.autoShutdown = false
这是 TAdhocHost.ned:
package rcdp9;
import inet.networklayer.IManetRouting;
import inet.networklayer.autorouting.ipv4.HostAutoConfigurator2;
import inet.nodes.inet.AdhocHost;
module TAdhocHost extends AdhocHost
{
parameters:
@display("i=device/cellphone");
mobilityType = default("TraCIMobility");
IPForward = true;
submodules:
ac_wlan: HostAutoConfigurator2 {
@display("p=127,240");
}
connections:
}
这是 Highway.ned:
package rcdp9;
import inet.world.VACaMobil.VACaMobil;
import inet.networklayer.autorouting.ipv4.IPv4NetworkConfigurator;
import inet.networklayer.autorouting.ipv4.HostAutoConfigurator;
import inet.nodes.inet.AdhocHost;
import inet.world.radio.ChannelControl;
import inet.world.traci.TraCIScenarioManagerLaunchd;
network Highway
{
submodules:
configurator: IPv4NetworkConfigurator {
@display("p=396,221");
}
channelControl: ChannelControl {
@display("p=396,310");
}
manager: VACaMobil {
@display("p=322,405");
}
connections allowunconnected:
}