Я хочу смоделировать SDN на основе VANET, я успешно интегрировал SUMO с OMNET, используя VEINS.Затем я импортировал INET, OpenFlow, появляется ошибка, когда я добавляю ворота в RSU и подключаюсь к переключателю OpenFlow, появляется следующая ошибка?Как я могу это исправить и что я должен изменить, чтобы мой сценарий VEINS работал с SDN?
<!> Gate 'RSUExampleScenario.rsu[0].In' is not connected to a submodule (or internally to another gate of the same module) -- in module (omnetpp::cModule) RSUExampleScenario.rsu[0] (id=7), during network setup
TRAPPING on the exception above, due to a debug-on-errors=true configuration option. Is your debugger ready?
Simulation terminated with exit code: -2147483645
Working directory: D:/omnetpp-5.1/samples/veins/examples/veins
Command line: ../../../../bin/opp_run.exe -m -n .;../../src/veins;../../../openflow;../../../inet/src;../../../inet/examples;../../../inet/tutorials;../../../inet/showcases --image-path=../../images;../../../openflow/images;../../../inet/images -l ../../src/veins -l ../../../inet/src/INET omnetpp.ini
Environment variables:
PATH=;D:/omnetpp-5.1/samples/veins/src;D:/omnetpp-5.1/samples/inet/src;D:\omnetpp-5.1\bin;D:\omnetpp-5.1\tools\win64\usr\bin;D:\omnetpp-5.1\tools\win64\mingw64\bin;D:/omnetpp-5.1/ide/jre/bin/server;D:/omnetpp-5.1/ide/jre/bin;D:/omnetpp-5.1/ide/jre/lib/amd64;.;D:\omnetpp-5.1\bin;D:\omnetpp-5.1\tools\win64\mingw64\bin;D:\omnetpp-5.1\tools\win64\usr\local\bin;D:\omnetpp-5.1\tools\win64\usr\bin;D:\omnetpp-5.1\tools\win64\usr\bin;C:\Windows\System32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;D:\omnetpp-5.1\tools\win64\usr\bin\site_perl;D:\omnetpp-5.1\tools\win64\usr\bin\vendor_perl;D:\omnetpp-5.1\tools\win64\usr\bin\core_perl;D:\omnetpp-5.1;
OMNETPP_ROOT=D:/omnetpp-5.1/
OMNETPP_IMAGE_PATH=D:\omnetpp-5.1\images
здесь код для RSU.ned, и я просто добавляю входные и выходные ворота.
package org.car2x.veins.nodes;
import org.car2x.veins.base.modules.*;
import org.car2x.veins.modules.nic.Nic80211p;
import inet.node.inet.AdhocHost;
import inet.node.xmipv6.MobileHost6;
import openflow.Flow_Table;
import openflow.nodes.Open_Flow_Controller;
import openflow.nodes.Open_Flow_Switch;
module RSU
{
parameters:
string applType; //type of the application layer
string nicType = default("Nic80211p"); // type of network interface card
gates:
input veinsradioIn; // gate for sendDirect
input In;
output Out;
submodules:
appl: <applType> like org.car2x.veins.base.modules.IBaseApplLayer {
parameters:
@display("p=60,50");
}
nic: <nicType> like org.car2x.veins.modules.nic.INic80211p {
parameters:
@display("p=60,166");
}
mobility: BaseMobility {
parameters:
@display("p=130,172;i=block/cogwheel");
}
connections:
nic.upperLayerOut --> appl.lowerLayerIn;
nic.upperLayerIn <-- appl.lowerLayerOut;
nic.upperControlOut --> appl.lowerControlIn;
nic.upperControlIn <-- appl.lowerControlOut;
veinsradioIn --> nic.radioIn;
}
и здесь OpenFlow_switch.ned. Также я просто добавляю входные и выходные ворота.
package openflow.nodes;
import inet.applications.pingapp.PingApp;
import inet.applications.contract.ITCPApp;
//import inet.base.NotificationBoard;
import inet.linklayer.ethernet.EtherMAC;
//import inet.linklayer.ext.ExtInterface;
import inet.linklayer.ppp.PPPInterface;
import inet.networklayer.common.InterfaceTable;
//import inet.networklayer.ipv4.RoutingTable;
//import inet.transport.ITCP;
//import inet.transport.udp.UDP;
//import inet.util.TCPDump;
//import inet.nodes.inet.NetworkLayer;
import inet.transportlayer.contract.ITCP;
import inet.linklayer.ppp.PPPInterface;
import inet.linklayer.ethernet.EthernetInterface;
import inet.linklayer.loopback.LoopbackInterface;
import inet.networklayer.ipv4.*;
import openflow.*;
// OpenFlow switch based on the OF Switch Specification 1.2.
// New implemented modules: FlowTable, Open_Flow_Processing, Buffer, OFA_Switch (Application)
// The OpenFlow switch is basically divided in two parts. The left path, which
//consists of a EtherMAC and a OpenFlowProcessing module, represents the data plane.
//All production trac, coming from different nodes connected
//to the switch, is handled here. The Processing module performs packet lookups in the
//ow table and executes instructions, if a matching entry is found.
//The right part with the modules EthernetInterface, NetworkLayer, TCP and
//OFASwitch is responsible for the communication with a remote controller via the
//OpenFlow protocol and is called control plane.
module Open_Flow_Switch
{
parameters:
// @node();
@networkNode; //Inet 3.6 changed @node to @networkNode
@OF_Switch();
@labels(node,ethernet-node);
@display("i=device/switch;i2=OpenFlow-Logo-small");
int numTcpApps = default(0);
int numUdpApps = default(0);
int numSctpApps = default(0);
string tcpAppType = default("n/a");
string udpAppType = default("n/a");
string sctpAppType = default("n/a");
string tcpType = default("TCP"); // tcp implementation (e.g. TCP, TCP_old, TCP_NSC)
bool forwarding = default(false);
int namid = default(-1);
string routingFile = default("");
int numExtInterfaces = default(0);
bool sendCompletePacket = default(false);
double serviceTime @unit("s") = default(0s);
//DANH added:
bool hasTcp = default(numTcpApps > 0);
bool hasUdp = default(numUdpApps > 0);
bool hasSctp = default(numSctpApps > 0);
*.interfaceTableModule = default(absPath(".interfaceTable"));
*.routingTableModule = default(absPath(".routingTable"));
gates:
inout gate_controller[] @labels(Controller-conn);
inout ethg[] @labels(EtherFrame-conn);
input In;
output Out;
submodules:
// notificationBoard: NotificationBoard {
// parameters:
// @display("p=57,54");
// }
interfaceTable: InterfaceTable {
parameters:
@display("p=57,134");
}
routingTable: IPv4RoutingTable {
parameters:
forwarding = forwarding;
routerId = "";
routingFile = routingFile;
@display("p=57,214");
}
tcp: <tcpType> like ITCP {
parameters:
@display("p=336,159");
}
networkLayer: IPv4NetworkLayer {
parameters:
proxyARP = false;
@display("p=336,262;q=queue");
gates:
ifIn[sizeof(gate_controller)];
ifOut[sizeof(gate_controller)];
}
eth[sizeof(gate_controller)]: EthernetInterface {
parameters:
@display("p=336,390,row,90;q=txQueue");
}
flow_Table: Flow_Table {
@display("p=192,134");
}
etherMAC[sizeof(ethg)]: EtherMAC {
parameters:
@display("p=137,390");
doRegisterAtIft = false; // this is to prevent OF-Switch from registering to interface table
}
open_Flow_Processing: Open_Flow_Processing {
@display("p=137,282");
serviceTime = serviceTime;
gates:
ifIn[sizeof(ethg)];
ifOut[sizeof(ethg)];
}
buffer: Buffer {
@display("p=192,53");
}
ofa_switch: OFA_switch {
@display("p=336,71");
sendCompletePacket = sendCompletePacket;
}
connections allowunconnected:
tcp.ipOut --> networkLayer.transportIn++ if hasTcp;
tcp.ipIn <-- networkLayer.transportOut++ if hasTcp;
for i=0..sizeof(gate_controller)-1 {
eth[i].phys <--> gate_controller[i];
eth[i].upperLayerOut --> networkLayer.ifIn[i];
eth[i].upperLayerIn <-- networkLayer.ifOut[i];
}
for i=0..sizeof(ethg)-1 {
etherMAC[i].phys <--> ethg[i];
open_Flow_Processing.ifOut[i] --> etherMAC[i].upperLayerIn;
etherMAC[i].upperLayerOut --> open_Flow_Processing.ifIn[i];
}
tcp.appOut++ --> ofa_switch.tcpIn;
ofa_switch.tcpOut --> tcp.appIn++;
}
здесь RSUExampleScenario.ned
import inet.node.ethernet.EtherHost;
import inet.node.inet.AdhocHost;
import inet.node.xmipv6.MobileHost6;
import openflow.nodes.Domain_wController;
import openflow.nodes.OpenFlow_Domain_fixed;
import openflow.nodes.Open_Flow_Controller;
import openflow.nodes.Open_Flow_Switch;
import org.car2x.veins.nodes.RSU;
import org.car2x.veins.nodes.Scenario;
network RSUExampleScenario extends Scenario
{
@display("bgb=634,315;bgl=2");
submodules:
rsu[1]: RSU {
@display("p=161,117;i=veins/sign/yellowdiamond;is=vs");
}
open_Flow_Switch: Open_Flow_Switch {
@display("p=257,235;b=66,64");
}
open_Flow_Controller: Open_Flow_Controller {
@display("p=427,221;b=85,66");
}
connections:
open_Flow_Switch.ethg++ <--> open_Flow_Controller.ethg++;
open_Flow_Controller.ethg++ <--> open_Flow_Switch.ethg++;
rsu[0].Out --> open_Flow_Switch.In;
open_Flow_Switch.Out --> rsu[0].In;
}
и, наконец, omnetpp.ini
[General]
cmdenv-express-mode = true
cmdenv-autoflush = true
cmdenv-status-frequency = 1s
**.cmdenv-log-level = info
ned-path = .
image-path = ../../images
network = RSUExampleScenario
##########################################################
# Simulation parameters #
##########################################################
debug-on-errors = true
print-undisposed = true
sim-time-limit = 3000s
**.scalar-recording = true
**.vector-recording = true
**.debug = false
**.coreDebug = false
*.playgroundSizeX = 5500m
*.playgroundSizeY = 5500m
*.playgroundSizeZ = 5500m
##########################################################
# Annotation parameters #
##########################################################
*.annotations.draw = true
##########################################################
# Obstacle parameters #
##########################################################
*.obstacles.debug = false
*.obstacles.obstacles = xmldoc("config.xml", "//AnalogueModel[@type='SimpleObstacleShadowing']/obstacles")
##########################################################
# TraCIScenarioManager parameters #
##########################################################
*.manager.updateInterval = 1s
*.manager.host = "localhost"
*.manager.port = 9999
*.manager.autoShutdown = true
*.manager.launchConfig = xmldoc("DammamMap.launchd.xml")
##########################################################
# RSU SETTINGS #
# #
# #
##########################################################
*.rsu[0].mobility.x = 2000
*.rsu[0].mobility.y = 2000
*.rsu[0].mobility.z = 3
*.rsu[*].applType = "TraCIDemoRSU11p"
*.rsu[*].appl.headerLength = 80 bit
*.rsu[*].appl.sendBeacons = false
*.rsu[*].appl.dataOnSch = false
*.rsu[*].appl.beaconInterval = 1s
*.rsu[*].appl.beaconUserPriority = 7
*.rsu[*].appl.dataUserPriority = 5
##########################################################
# 11p specific parameters #
# #
# NIC-Settings #
##########################################################
*.connectionManager.sendDirect = true
*.connectionManager.maxInterfDist = 2600m
*.connectionManager.drawMaxIntfDist = false
*.**.nic.mac1609_4.useServiceChannel = false
*.**.nic.mac1609_4.txPower = 20mW
*.**.nic.mac1609_4.bitrate = 6Mbps
*.**.nic.phy80211p.sensitivity = -89dBm
*.**.nic.phy80211p.useThermalNoise = true
*.**.nic.phy80211p.thermalNoise = -110dBm
*.**.nic.phy80211p.decider = xmldoc("config.xml")
*.**.nic.phy80211p.analogueModels = xmldoc("config.xml")
*.**.nic.phy80211p.usePropagationDelay = true
*.**.nic.phy80211p.antenna = xmldoc("antenna.xml", "/root/Antenna[@id='monopole']")
##########################################################
# WaveAppLayer #
##########################################################
*.node[*].applType = "TraCIDemo11p"
*.node[*].appl.headerLength = 80 bit
*.node[*].appl.sendBeacons = false
*.node[*].appl.dataOnSch = false
*.node[*].appl.beaconInterval = 1s
##########################################################
# Mobility #
##########################################################
*.node[*].veinsmobilityType.debug = true
*.node[*].veinsmobility.x = 0
*.node[*].veinsmobility.y = 0
*.node[*].veinsmobility.z = 1.895
*.node[*0].veinsmobility.accidentCount = 1
*.node[*0].veinsmobility.accidentStart = 75s
*.node[*0].veinsmobility.accidentDuration = 50s
[Config Default]
[Config WithBeaconing]
*.rsu[*].appl.sendBeacons = true
*.node[*].appl.sendBeacons = true
[Config WithChannelSwitching]
*.**.nic.mac1609_4.useServiceChannel = true
*.node[*].appl.dataOnSch = true
*.rsu[*].appl.dataOnSch = true
Любая помощь будет принята с благодарностью