OMNeT++ openflow wireless - wireless

i'm trying to integrate a wireless card into openflow switch(i wanna simulate a vanet with openflow, so i need wireless communications)
this is the code of the switch
package openflow.nodes;
import openflow.*;
import inet.linklayer.ieee80211.Ieee80211Nic;
module Wireless_Openflow_switch extends Open_Flow_Switch
{
parameters:
int numRadios = default(10); // the number of radios in the access point
submodules:
wlan[numRadios]: Ieee80211Nic{
mgmtType="Ieee80211MgmtAP";
}
}
i also created a scenario to test it, here's the code:
package openflow.scenarios;
import inet.nodes.ethernet.EtherSwitch;
import inet.nodes.inet.Router;
import inet.nodes.inet.StandardHost;
import inet.networklayer.autorouting.ipv4.FlatNetworkConfigurator;
import openflow.nodes.Open_Flow_Controller;
import openflow.nodes.Wireless_Openflow_switch;
import inet.util.ThruputMeteringChannel;
import inet.networklayer.autorouting.ipv4.IPv4NetworkConfigurator;
import inet.nodes.inet.AdhocHost;
import inet.world.radio.ChannelControl;
network test
{
#display("bgb=780,513");
types:
channel ethernetline extends ThruputMeteringChannel
{
delay = 1us;
datarate = 100Mbps;
thruputDisplayFormat = "u";
}
submodules:
wofs1 : Wireless_Openflow_switch
{
#display("p=537,306");
}
wofs2 : Wireless_Openflow_switch
{
#display("p=537,366");
}
wofs3 : Wireless_Openflow_switch
{
#display("p=437,366");
}
wofs4 : Wireless_Openflow_switch
{
#display("p=337,366");
}
host1 : AdhocHost
{
#display("p=200,306");
}
host2 : AdhocHost
{
#display("p=250,380");
}
host3 : AdhocHost
{
#display("p=500,125");
}
channelControl: ChannelControl {
parameters:
#display("p=60,50");
}
configurator: IPv4NetworkConfigurator {
config=xml("<config><interface hosts='*' address='192.168.1.x' netmask='255.255.255.0'/></config>");
#display("p=140,50");
}
controller: Open_Flow_Controller {
#display("p=338,167");
}
connections allowunconnected:
controller.ethg++ <--> ethernetline <--> wofs1.gate_controller++;
controller.ethg++ <--> ethernetline <--> wofs2.gate_controller++;
controller.ethg++ <--> ethernetline <--> wofs3.gate_controller++;
controller.ethg++ <--> ethernetline <--> wofs4.gate_controller++;
wofs1.ethg++ <--> ethernetline <--> wofs2.ethg++;
wofs1.ethg++ <--> ethernetline <--> wofs3.ethg++;
wofs1.ethg++ <--> ethernetline <--> wofs4.ethg++;
wofs2.ethg++ <--> ethernetline <--> wofs3.ethg++;
wofs2.ethg++ <--> ethernetline <--> wofs4.ethg++;
wofs4.ethg++ <--> ethernetline <--> wofs3.ethg++;
}
and finally here is the configuration code:
[General]
network = test
#record-eventlog = true
num-rngs = 3
**.mobility.rng-0 = 1
**.wlan[*].mac.rng-0 = 2
**.constraintAreaMinX = 0m
**.constraintAreaMinY = 0m
**.constraintAreaMinZ = 0m
**.constraintAreaMaxX = 600m
**.constraintAreaMaxY = 400m
**.constraintAreaMaxZ = 0m
**.debug = true
**.coreDebug = false
**.host*.**.channelNumber = 0
# channel physical parameters
*.channelControl.carrierFrequency = 2.4GHz
*.channelControl.pMax = 25.0mW
*.channelControl.sat = -110dBm
*.channelControl.alpha = 2
*.channelControl.numChannels = 1
# tcp apps
**.numTcpApps = 1
**.host*.tcpApp[0].typename = "TCPSessionApp"
**.host*.tcpApp[0].active = true
**.host*.tcpApp[0].localPort = -1
**.host*.tcpApp[0].connectAddress = "server1"
**.host*.tcpApp[0].connectPort = 1000
**.host*.tcpApp[0].tOpen = 2s
**.host*.tcpApp[0].tSend = 2s
**.host*.tcpApp[0].sendBytes = 3000000B
**.host*.tcpApp[0].sendScript = ""
**.host*.tcpApp[0].tClose = 100s
# mobility
**.host*.mobilityType = "MassMobility"
**.host*.mobility.initFromDisplayString = false
**.host*.mobility.changeInterval = truncnormal(2s, 0.5s)
**.host*.mobility.changeAngleBy = normal(0deg, 30deg)
**.host*.mobility.speed = truncnormal(20mps, 8mps)
**.host*.mobility.updateInterval = 100ms
# ping app (host[0] pinged by others)
**.pingApp[0].startTime = uniform(1s,5s)
**.pingApp[1].startTime = 5s+uniform(1s,5s)
**.pingApp[*].printPing = true
[Config Ping1]
description = "host1 pinging host2"
#openflow
**.controller.ofa_controller.port = 6633
**.controller.behavior = "Forwarding"
**.ofa_switch.connectPort = 6633
**.ofa_switch.connectAddress = "controller"
**.buffer.capacity = 10
**.ofa_switch.flow_timeout = 5s
**.wofs*.etherMAC[*].promiscuous = true
# NIC configuration
**.ppp[*].queueType = "FIFOQueue" # in routers
**.wofs*.tcp.mss = 800
**.controller.tcp.mss = 800
when i run this code, it gives me this error:
Error in module (IPv4NetworkConfigurator) test.configurator (id=10) during network initialization: Failed to find address prefix (using 192.168.1.0 with specified bits 255.255.255.0) and netmask (length from 24 bits to 24 bits) for interface test.wofs2.eth0 and 1 other interface(s). Please refine your parameters and try again!.
what is the right value of netmask and address prefix??
thanks in advance.

Related

LTE and WI-FI in vehicular netwrok

I am trying to make a WI-FI offloading scenario, In vehicular network using Omnet++ simulator.
At the first step I want to run the simulator with both modules added to the car before adding the offloading algorithm. I have defined the car module as extend of StandardHost and added the LteNic modules to it,However when I am trying to run the initialize file I got the message "finish with errors".
the car module
package lte_opf_wifi.cars;
import inet.applications.contract.ITCPApp;
import inet.applications.contract.IUDPApp;
import inet.mobility.contract.IMobility;
import inet.networklayer.common.InterfaceTable;
import inet.networklayer.contract.IRoutingTable;
import inet.networklayer.contract.INetworkLayer;
import inet.networklayer.configurator.ipv4.HostAutoConfigurator;
import inet.transportlayer.tcp.TCP;
import inet.transportlayer.udp.UDP;
import lte.stack.ILteNic;
import inet.node.inet.StandardHost;
//
// Car Module
//
module Car extends StandardHost
{
parameters:
#networkNode();
#display("i=device/car;is=vs;bgb=400,518");
//# Node specs
string nodeType = "UE"; // DO NOT CHANGE
int masterId;
int macNodeId = default(0); // TODO: this is not a real parameter
int macCellId = default(0); // TODO: this is not a real parameter
//# D2D capability
string nicType = default("LteNicUe");
//# Network Layer specs
*.interfaceTableModule = default(absPath(".interfaceTable"));
*.routingTableModule = default(absPath(".routingTable"));
gates:
input radioInlte #directIn ;
submodules:
// NOTE: instance must be named "lteNic"
lteNic: <nicType> like ILteNic {
nodeType = nodeType;
#display("p=250,407");
}
// network layer
configurator: HostAutoConfigurator {
#display("p=49.068,22.968");
}
connections allowunconnected:
lteNic.radioIn <-- radioInlte;
networkLayer.ifOut++ --> lteNic.upperLayerIn;
networkLayer.ifIn++ <-- lteNic.upperLayerOut;
}
the network ned file
// SimuLTE
//
// This file is part of a software released under the license included in file
// "license.pdf". This license can be also found at http://www.ltesimulator.com/
// The above file and the present reference are part of the software itself,
// and cannot be removed from it.
//
package lte_opf_wifi.simulations.cars;
import inet.networklayer.configurator.ipv4.IPv4NetworkConfigurator;
import inet.networklayer.ipv4.RoutingTableRecorder;
import inet.node.inet.AdhocHost;
import inet.node.inet.Router;
import inet.node.inet.WirelessHost;
import inet.node.wireless.AccessPoint;
import inet.physicallayer.ieee80211.packetlevel.Ieee80211ScalarRadioMedium;
import inet.node.inet.StandardHost;
import inet.node.ethernet.Eth10G;
import inet.common.misc.ThruputMeteringChannel;
import openflow.nodes.Domain_wController;
import openflow.nodes.OpenFlow_Domain_fixed;
import openflow.nodes.Open_Flow_Controller;
import openflow.nodes.Open_Flow_Switch;
import lte.world.radio.LteChannelControl;
import lte.epc.PgwStandardSimplified;
import lte.corenetwork.binder.LteBinder;
import lte.corenetwork.nodes.eNodeB;
import lte_opf_wifi.cars.Car;
import lte_opf_wifi.veins_inet.VeinsInetManager;
network highway2
{
parameters:
**.mgmt.numChannels = 2;
double playgroundSizeX #unit(m); // x size of the area the nodes are in (in meters)
double playgroundSizeY #unit(m); // y size of the area the nodes are in (in meters)
double playgroundSizeZ #unit(m); // z size of the area the nodes are in (in meters)
#display("bgb=732,713");
types:
channel ethernetline extends ThruputMeteringChannel
{
delay = 1us;
datarate = 100Mbps;
thruputDisplayFormat = "u";
}
submodules:
routingRecorder: RoutingTableRecorder {
#display("p=50,75;is=s");
}
configurator: IPv4NetworkConfigurator {
#display("p=50,125");
config = xmldoc("demo.xml");
}
//# Veins manager module
veinsManager: VeinsInetManager {
#display("p=50,227;is=s");
}
//#RSU
radioMedium: Ieee80211ScalarRadioMedium {
parameters:
#display("p=100,250");
}
rsu[2]: AccessPoint {
#display("p=559.26,451.71;i=veins/sign/yellowdiamond;is=vs");
wlan[*].mgmtType = "Ieee80211MgmtAPSimplified"; // wireless Access point
}
epdg: Router {
#display("p=481.82397,355.632;i=device/smallrouter");
}
//# LTE modules
channelControl: LteChannelControl {
#display("p=50,25;is=s");
}
binder: LteBinder {
#display("p=50,175;is=s");
}
server1: StandardHost {
#display("p=652.47,240.91199;is=n;i=device/server");
}
pgw: PgwStandardSimplified {
nodeType = "PGW";
#display("p=212.232,348.462;is=l");
}
eNodeB1: eNodeB {
#display("p=94.644,507.636;is=vl");
}
eNodeB2: eNodeB {
#display("p=309.744,507.636;is=vl");
}
//#open-flow
open_Flow_Switch0: Open_Flow_Switch {
#display("p=354.198,240.91199;b=66,64");
}
open_Flow_Switch1: Open_Flow_Switch {
#display("p=516.24,240.91199;b=66,64");
}
SDN_Controller: Open_Flow_Controller {
#display("p=427.332,124.757996;b=85,66");
}
//#car
node[10]: Car {
parameters:
#display("p=250.95,629.526;is=vs;i=block/process");
}
connections allowunconnected:
SDN_Controller.ethg++ <--> ethernetline <--> open_Flow_Switch0.gate_controller++;
SDN_Controller.ethg++ <--> ethernetline <--> open_Flow_Switch1.gate_controller++;
open_Flow_Switch0.ethg++ <--> ethernetline <--> open_Flow_Switch1.ethg++;
open_Flow_Switch0.ethg++ <--> ethernetline <--> pgw.filterGate;
open_Flow_Switch1.ethg++ <--> ethernetline <--> server1.pppg++;
open_Flow_Switch0.ethg++ <--> ethernetline <--> epdg.pppg++;
pgw.pppg++ <--> Eth10G <--> eNodeB1.ppp;
pgw.pppg++ <--> Eth10G <--> eNodeB2.ppp;
//# X2 connections
eNodeB1.x2++ <--> Eth10G <--> eNodeB2.x2++;
//# RSU connections
rsu[0].ethg++ <--> Eth10G <--> epdg.ethg++;
rsu[1].ethg++ <--> Eth10G <--> epdg.ethg++;
}
the .ini file
[General]
cmdenv-express-mode = true
cmdenv-autoflush = true
cmdenv-status-frequency = 1s
**.cmdenv-log-level = info
image-path = ../../images
network = highway2
##########################################################
# Simulation parameters #
##########################################################
debug-on-errors = true
print-undisposed = true
sim-time-limit = 200s
**.sctp.**.scalar-recording = true
**.sctp.**.vector-recording = true
**.coreDebug = false
**.routingRecorder.enabled = false
*.playgroundSizeX = 20000m
*.playgroundSizeY = 20000m
*.playgroundSizeZ = 50m
##########################################################
# Openflow #
#########################################################
**.SDN_Controller.ofa_controller.port = 6633
**.open_Flow_Switch*.sendCompletePacket = false
**.SDN_Controller.behavior = "Forwarding"
**.ofa_switch.connectPort = 6633
**.ofa_switch.connectAddress = "controller"
**.buffer.capacity = 10
**.ofa_switch.flow_timeout = 5s
**.open_Flow_Switch*.etherMAC[*].promiscuous = true
#**.controller.ofa_controller.address =
# NIC configuration
**.ppp[*].queueType = "DropTailQueue" # in routers
**.ppp[*].queue.frameCapacity = 10 # in routers
*.configurator.networkAddress = "192.168.1.0"
#**.tcp.sendQueueClass="TCPMsgBasedSendQueue" //obsolote since version 2.0
#**.tcp.receiveQueueClass="TCPMsgBasedRcvQueue" //obsolote since version 2.0
#**.open_Flow_Switch*.tcp.mss = 800
#**.SDN_Controller.tcp.mss = 800
#**.open_flow_switch*.tcp.nagleEnabled = false
##########################################################
# VeinsManager parameters #
##########################################################
*.veinsManager.updateInterval = 0.1s
*.veinsManager.launchConfig = xmldoc("heterogeneous.launchd.xml")
##########################################################
# RSU SETTINGS #
# #
# #
##########################################################
**.rsu[1].wlan[*].mac.address = "10:00:00:00:00:00"
**.rsu[2].wlan[*].mac.address = "10:00:00:00:00:10"
**.node[*].**.mgmt.accessPointAddress = "10:00:00:00:00:00"
**.node[*].**.mgmt.accessPointAddress = "10:00:00:00:00:10"
**.mgmt.frameCapacity = 100
#########################################################
# 11p specific parameters #
# #
# NIC-Settings #
##########################################################
**.wlan*.bitrate = 2Mbps
**.mac.address = "auto"
**.mac.maxQueueSize = 14
**.mac.rtsThresholdBytes = 3000B
**.wlan[*].mac.retryLimit = 7
**.wlan[*].mac.cwMinData = 7
**.wlan[*].mac.cwMinBroadcast = 31
**.wlan[*].radio.transmitter.power = 20mW
**.wlan[*].radio.transmitter.bitrate = 2Mbps
**.wlan[*].radio.transmitter.headerBitLength = 100b
**.wlan[*].radio.transmitter.carrierFrequency = 2.4GHz
**.wlan[*].radio.transmitter.bandwidth = 2MHz
**.wlan[*].radio.receiver.sensitivity = -85dBm
**.wlan[*].radio.receiver.snirThreshold = 4dB
# relay unit configuration
**.relayUnitType = "MACRelayUnit"
**.relayUnit.addressTableSize = 100
**.relayUnit.agingTime = 120s
**.relayUnit.bufferSize = 1MiB
**.relayUnit.highWatermark = 512KiB
**.relayUnit.pauseUnits = 300 # pause for 300*512 bit (19200 byte) time
**.relayUnit.addressTableFile = ""
**.relayUnit.numCPUs = 2
**.relayUnit.processingTime = 2us
##########################################################
# channel parameters #
##########################################################
**.channelControl.pMax = 10W
**.channelControl.alpha = 1.0
**.channelControl.carrierFrequency = 2100e+6Hz
##########################################################
# LTE specific parameters #
##########################################################
# Enable dynamic association of UEs (based on best SINR)
*.node[*].lteNic.phy.dynamicCellAssociation = true
**.node[*].masterId = 1 # useless if dynamic association is disabled
**.node[*].macCellId = 1 # useless if dynamic association is disabled
**.eNodeB1.macCellId = 1
**.eNodeB1.macNodeId = 1
**.eNodeB2.macCellId = 2
**.eNodeB2.macNodeId = 2
**.eNodeBCount = 2
# AMC module parameters
**.rbAllocationType = "localized"
**.feedbackType = "ALLBANDS"
**.feedbackGeneratorType = "IDEAL"
**.maxHarqRtx = 3
**.numUe = ${numUEs=10}
# RUs
**.cellInfo.ruRange = 50
**.cellInfo.ruTxPower = "50,50,50;"
**.cellInfo.antennaCws = "2;" # !!MACRO + RUS (numRus + 1)
**.cellInfo.numRbDl = 25
**.cellInfo.numRbUl = 25
**.numBands = 25
**.fbDelay = 1
# Enable handover
*.node[*].lteNic.phy.enableHandover = true
*.eNodeB*.lteNic.phy.enableHandover = true
*.eNodeB*.lteNic.phy.broadcastMessageInterval = 0.5s
# X2 and SCTP configuration
*.eNodeB*.numX2Apps = 1 # one x2App per peering eNodeB
*.eNodeB*.x2App[*].server.localPort = 5000 + ancestorIndex(1) # Server ports (x2App[0]=5000, x2App[1]=5001, ...)
*.eNodeB1.x2App[0].client.connectAddress = "eNodeB2%x2ppp0"
*.eNodeB2.x2App[0].client.connectAddress = "eNodeB1%x2ppp0"
**.sctp.nagleEnabled = false # if true, transmission of small packets will be delayed on the X2
**.sctp.enableHeartbeats = false

Error in veins_inet: Mobility position is not a finite number after initialize (x=nan, y=nan, z= nan)

I'm very beginner to veins. I'm building a network in which ther is a standard host and a vehicle communoicate to each other via AccessPoint. I've successful done this simulation with wirelessHost and standard host. but when I used veins_inet to simulate adhocHost as a vehicle I get this error
""
My source code is following.
############################# .ned ############################
network ScenarioFOG
{
submodules:
radioMedium: Ieee80211ScalarRadioMedium {
#display("p=29,130");
}
manager: VeinsInetManager;
configurator: IPv4NetworkConfigurator {
parameters:
assignDisjunctSubnetAddresses = false;
#display("p=36,83");
}
vNode[0]: Car;
sNode: StandardHost {
#display("p=260,61");
}
AP: AccessPoint {
#display("p=197,79");
}
connections allowunconnected:
sNode.ethg++ <--> Eth100M <--> AP.ethg++;
}
############################# .ini ############################
[General]
network = ScenarioFOG
sim-time-limit = 60s
debug-on-errors = true
cmdenv-express-mode = true
image-path = ../../../../images
# UDPBasicApp
ScenarioFOG.*Node[*].numUdpApps = 1
ScenarioFOG.*Node[*].udpApp[0].typename = "UDPBasicApp"
ScenarioFOG.vNode[*].udpApp[0].destAddresses = "224.0.0.1"
ScenarioFOG.vNode[*].udpApp[0].multicastInterface = "wlan0"
ScenarioFOG.vNode[*].udpApp[0].joinLocalMulticastGroups = true
ScenarioFOG.sNode[*].udpApp[0].localPort = 9001
ScenarioFOG.vNode[*].udpApp[0].destPort = 9001
ScenarioFOG.vNode[*].udpApp[0].destAddresses = "sNode"
ScenarioFOG.sNode[*].udpApp[0].destAddresses = "vNode"
ScenarioFOG.vNode[*].udpApp[0].messageLength = 100B
ScenarioFOG.vNode[*].udpApp[0].startTime = uniform(0s, 5s)
ScenarioFOG.vNode[*].udpApp[0].sendInterval = 5s
# Ieee80211MgmtAdhoc
ScenarioFOG.vNode[*].wlan[0].mgmtType = "Ieee80211MgmtAdhoc"
ScenarioFOG.vNode[*].wlan[0].bitrate = 6Mbps
ScenarioFOG.vNode[*].wlan[0].radio.transmitter.power = 2mW
# HostAutoConfigurator
ScenarioFOG.vNode[*].ac_wlan.interfaces = "wlan0"
ScenarioFOG.vNode[*].ac_wlan.mcastGroups = "224.0.0.1"
# VeinsInetMobility
**.vNode[*].mobilityType = "VeinsInetMobility"
**.vNode[*].mobility.constraintAreaMinX = 0m
**.vNode[*].mobility.constraintAreaMinY = 0m
**.vNode[*].mobility.constraintAreaMinZ = 0m
**.vNode[*].mobility.constraintAreaMaxX = 1000m
**.vNode[*].mobility.constraintAreaMaxY = 1000m
**.vNode[*].mobility.constraintAreaMaxZ = 0m
**.vNode[*].mobility.initFromDisplayString = false
**.vNode[*].mobility.initialX = 200m
**.vNode[*].mobility.initialY = 100m
**.vNode[*].mobility.initialZ = 0m
# VeinsInetManager
ScenarioFOG.manager.updateInterval = 0.1s
ScenarioFOG.manager.host = "localhost"
ScenarioFOg.manager.port = 9999
ScenarioFOG.manager.autoShutdown = true
**.manager.launchConfig = xmldoc("square.launchd.xml")
ScenarioFOG.manager.moduleType = "org.car2x.veins.subprojects.veins_inet.example.Car"
**.vector-recording = true

wireless communication between host and server by using AccessPoint as an intermediate node

I'm doing very basic simulations in which I want that a wireless host communicate with server (Standard Host) by using accesspoint as intermediate node. But unfortunately only beacon message is passed to access point and server don't recieve any message.My code is here.
I'll be very thankful for your help.
######--------VFsim.ned-------##########
package vf.simulations.simulation;
import inet.linklayer.contract.IWirelessNic;
import inet.networklayer.configurator.ipv4.IPv4NetworkConfigurator;
import inet.node.inet.StandardHost;
import inet.node.inet.WirelessHost;
import inet.node.wireless.AccessPoint;
import inet.physicallayer.common.packetlevel.RadioMedium;
import inet.physicallayer.ieee80211.packetlevel.Ieee80211ScalarRadioMedium;
//
// TODO documentation
//
network VFsim
{
#display("bgb=377,307");
types:
channel C extends ned.DatarateChannel
{
datarate = 100Mbps;
delay = 0.1us;
}
submodules:
server: StandardHost {
#display("p=81,85");
}
Configurator: IPv4NetworkConfigurator {
#display("p=283,78");
}
host: WirelessHost {
#display("p=276,183");
}
accessPoint: AccessPoint {
#display("p=78,155");
}
radioMedium: Ieee80211ScalarRadioMedium {
#display("p=282,26");
}
connections:
accessPoint.ethg++ <--> C <--> server.ethg++;
}
################---------VFsim.ini--------##############
[General]
network = VFsim
**.arp.typename = "GlobalArp"
**.wlan[*].radio.typename = Ieee80211Interface
*.accessPoint.numWlanInterfaces = 1
*.accessPoint.wlan[0].mgmt.ssid = "wlan1"
*.accessPoint.wlan[0].radio.bandName = "5 GHz"
*.accessPoint.app[0].destAddresses = "server"
*.accessPoint.app[0].destPort = 5000
#*.Configurator.config = xmldoc("config.xml")
**.networkLayer.configurator.networkConfiguratorModule = ""
*.host.wlan[*].agent.defaultSsid = "wlan1"
*.host.wlan[*].radio.bandName = "5 GHz"
*.host.numApps = 1
*.host.app[0].typename = "UdpBasicApp"
*.host.app[0].destAddresses = "accessPoint"
*.host.app[0].destPort = 5000
*.host.app[0].messageLength = 1000B
*.host.app[0].sendInterval = exponential(12ms)
*.host.app[0].packetName = "UDPData"
*.server.numApps = 1
*.server.app[0].typename = "UdpSink"
*.server.app[0].localPort = 5000
*.server.app[0].destAddresses = "accessPoint"
**.wlan[*].mac.useAck = false
**.wlan[*].mac.fullDuplex = false
**.radio.transmitter.power = 3.5mW
**.wlan[*].radio.transmitter.communicationRange = 500m
**.wlan[*].radio.receiver.ignoreInterference = true
**.wlan[*].mac.headerLength = 23B
**.bitrate = 1Mbps
For host set server as destination for the UDP traffic. In your ini file set:
*.host.app[0].destAddresses = "server"
EDIT
The instance of IPv4NetworkConfigurator must have the name configurator, not Configurator. Therefore in VFsim.ned change into:
configurator: IPv4NetworkConfigurator
Moreover, remove this line from ini:
**.networkLayer.configurator.networkConfiguratorModule = ""

How could nodes receive packets from sensors and on the other hand send them to Mobile Elements?

I am using OMNet++ to simulate a wireless network.
The scenario is : "sensor nodes send sensory data to some nodes (called RN)(send to the nearest RN). and some mobile elements collect data from these points." sensors distribute uniform in field and position of RNs are determined.also MEs follow BonnMobility with predefined path.
I'm using omnet 5.4 with inet 3.6.
numHost=500 ** numME=5 ** numRN=50
NED file:
network MyNet
{
parameters:
int numHost;
int numME;
int numRN;
string hostType = default("WirelessHost");
string mediumType = default("IdealRadioMedium");
#display("bgb=600,600;bgu=m");
submodules:
visualizer: IntegratedCanvasVisualizer {
parameters:
#display("p=47,16");
}
configurator: IPv4NetworkConfigurator {
parameters:
#display("p=398.63998,15.7039995");
}
radioMedium: <mediumType> like IRadioMedium {
parameters:
#display("p=280.256,15.7039995");
}
lifecycleController: LifecycleController {
parameters:
#display("p=513.4,15.7039995");
}
host[numHost]: <hostType> like INetworkNode {
parameters:
#display("p=300,300;i=device/cellphone");
}
ME[numME]: <hostType> like INetworkNode {
#display("p=577.424,506.152;i=device/pocketpc");
}
RN[numRN]: <hostType> like INetworkNode {
#display("p=300.792,413.136;i=device/server");
}
physicalEnvironment: PhysicalEnvironment {
#display("p=157.04,15.7039995");
}
sinkNode: SinkNode {
#display("p=300,565.344;i=device/antennatower;is=l");
}
}
the question is:
how can i set udp traffic in .ini file? How could RN receive packets from sensors and on the other hand send them to MEs?
After running this simulation, all nodes send packet to all others, provided I set a specific destination node. Is it correct or not?
this is a part of ini file.
*.*.networkLayer.arpType = "GlobalARP"
*.host[*].numUdpApps = 1
*.host[*].udpApp[0].typename = "UDPBasicApp"
*.host[*].udpApp[0].destAddresses=moduleListByPath("**.RN[*]")
*.host[*].udpApp[0].destPort = 1000
*.host[*].udpApp[0].messageLength = 100 bytes
*.host[*].udpApp[0].sendInterval = exponential(12s)
*.host[*].udpApp[0].startTime = uniform(0s,10s)
*.host[*].udpApp[0].packetName = "UDPData"
*.RN[*].numUdpApps =2
*.RN[*].udpApp[0].typename = "UDPBasicApp" # or "UDPSink"???
*.RN[*].udpApp[0].localPort = 1000
*.RN[*].udpApp[0].destPort = 1001
*.RN[*].udpApp[0].destAddresses = moduleListByPath("**.ME[*]")
*.RN[*].udpApp[0].messageLength = 100 bytes
*.RN[*].udpApp[0].sendInterval = exponential(40s)
*.RN[*].udpApp[1].typename = "UDPSink"
*.RN[*].udpApp[1].localPort = 1002
*.RN[*].udpApp[1].destPort = 1001
*.RN[*].udpApp[1].messageLength = 100 bytes
*.RN[*].udpApp[1].sendInterval = exponential(40s)
*.RN[*].udpApp[1].packetName = "UDPData"
*.ME[*].numUdpApps = 1
*.ME[*].udpApp[0].typename = "UDPSink"
*.ME[*].udpApp[0].localPort = 1001
NED file
INI file

OMNeT++ doesn't recognize nodes created by VACaMobil

I am starting to use VACaMobil in a project. However, I am having a problem.
I don't know if I am wrong, but I understand that TraCIScenarioManagerLaunchd
(ant therefore, VACaMobil) creates dynamically the nodes representing each vehicle, i. e.
the car module isn't defined in the network file, but it's declared in the omnetpp.ini file, in
parameters ".manager.moduleType" and ".manager.moduleName". In my case, the module
type is a custom car module based in the Car module of inet/examples/VACaMobil/Cars, and
the module name is "coche".
Here is the omnetpp.ini file:
[General]
network = Cars
cmdenv-express-mode = true
cmdenv-autoflush = true
cmdenv-status-frequency = 10000000s
repeat = 10
tkenv-plugin-path = ../../../etc/plugins
tkenv-image-path = bitmaps
#sim-time-limit = 6000s
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.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.doNothing = false
# 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
**.getStatistics = true
**.statFiles = "${resultdir}/${configname}-${runnumber}-"
**.channelNumber = 0
[Config RCDP]
**.coche[0..49].app1.localPort = 1000
**.coche[0..49].app1.destPort = 1000
**.coche[0..49].app1.messageLength = ${50000000B ! length}
**.coche[0..49].app1.burstSize = 10
**.coche[0..49].app1.bandWidth = 147200bps
**.coche[0..49].app1.alpha = 0.5
**.coche[0..49].app1.beta = 0.8
**.coche[0..49].app1.destAddresses = moduleListByPath("**.coche[50..99]")
**.coche[0..49].networkLayer.configurator.networkConfiguratorModule = "configurator"
**.coche[50..99].app2.localPort = 1000
**.coche[50..99].app2.messageLength = ${length = 50000000B}
**.coche[50..99].app2.bandWidth = 147200bps
**.coche[50..99].app2.maxBandWidth = 24Mbps
#**.meanNumberOfCars = ${100, 200, 300, 400}
**.meanNumberOfCars = 100
**.warmUpSeconds = 0s
**.autoShutdown = false
*.manager.launchConfig = xmldoc("VACaMobil/Milan/downtown.launch.xml")
# manet routing
**.routingProtocol = ${"AODVUU", "DYMO", "OLSR"}
[Config TCP]
**.coche[0..49].app3.localPort = 1000
**.coche[0..49].app3.startTime = 0s
**.coche[0..49].app3.stopTime = 100s
**.coche[0..49].app3.thinkTime = 1s
**.coche[0..49].app3.idleInterval =3s
**.coche[0..49].app3.requestLength = 50000000B
**.coche[0..49].app3.numRequestsPerSession = 100
**.coche[0..49].app3.connectAddress = moduleListByPath("**.coche[50..99]")
**.coche[0..49].networkLayer.configurator.networkConfiguratorModule = "configurator"
**.coche[50..99].app4.dataTransferMode = "object"
#carGRCnator
**.getStatistics = true
**.statFiles = "${resultdir}/${configname}-${runnumber}-"
#**.meanNumberOfCars = ${100, 200, 300, 400}
**.meanNumberOfCars = 100
**.warmUpSeconds = 0s
**.autoShutdown = false
*.manager.launchConfig = xmldoc("VACaMobil/Milan/downtown.launch.xml")
# manet routing
**.routingProtocol = ${"AODVUU", "DYMO", "OLSR"}
Here is the car module (TAdhocHost.ned):
package rcdp9;
import inet.base.NotificationBoard;
import inet.networklayer.autorouting.ipv4.HostAutoConfigurator;
import inet.networklayer.common.InterfaceTable;
import inet.mobility.single.TraCIMobility;
import inet.networklayer.ipv4.RoutingTable;
import inet.transport.tcp.TCP;
import inet.transport.udp.UDP;
import inet.nodes.inet.NetworkLayer;
import inet.linklayer.ieee80211.Ieee80211Nic;
import inet.networklayer.IManetRouting;
module TAdhocHost
{
parameters:
#node();
string routingProtocol #enum("AODVUU","DYMOUM","DYMO","DSRUU","OLSR","OLSR_ETX","DSDV_2","Batman") = default("");
gates:
input radioIn #directIn;
submodules:
notificationBoard: NotificationBoard {
parameters:
#display("p=60,160");
}
interfaceTable: InterfaceTable {
parameters:
#display("p=60,240");
}
app1: RCDPClient {
parameters:
#display("p=304,56");
}
app2: RCDPServer {
parameters:
#display("p=210,56");
}
app3: TCPClient {
parameters:
#display("p=378,56");
}
app4: TCPServer {
parameters:
#display("p=147,56");
}
mobility: TraCIMobility {
parameters:
#display("p=60,459");
}
routingTable: RoutingTable {
parameters:
IPForward = true;
routerId = "";
routingFile = "";
#display("p=60,326");
}
udp: UDP {
parameters:
#display("p=304,192");
}
tcp: TCP {
parameters:
#display("p=219,192");
}
networkLayer: NetworkLayer {
parameters:
proxyARP = false;
#display("p=304,327;q=queue");
gates:
ifIn[1];
ifOut[1];
}
manetrouting: <routingProtocol> like IManetRouting if routingProtocol != "" {
#display("p=522,307");
}
wlan: Ieee80211Nic {
parameters:
#display("p=304,461;q=queue");
}
ac_wlan: HostAutoConfigurator {
#display("p=60,401");
}
connections allowunconnected:
udp.appOut++ --> app1.udpIn;
udp.appIn++ <-- app1.udpOut;
udp.appOut++ --> app2.udpIn;
udp.appIn++ <-- app2.udpOut;
udp.ipOut --> networkLayer.transportIn++;
udp.ipIn <-- networkLayer.transportOut++;
tcp.appOut++ --> app3.tcpIn;
tcp.appIn++ <-- app3.tcpOut;
tcp.appOut++ --> app4.tcpIn;
tcp.appIn++ <-- app4.tcpOut;
tcp.ipOut --> networkLayer.transportIn++;
tcp.ipIn <-- networkLayer.transportOut++;
wlan.upperLayerOut --> networkLayer.ifIn[0];
wlan.upperLayerIn <-- networkLayer.ifOut[0];
networkLayer.transportOut++ --> manetrouting.from_ip if routingProtocol != "";
networkLayer.transportIn++ <-- manetrouting.to_ip if routingProtocol != "";
radioIn --> wlan.radioIn;
}
Here is the network file (Cars.ned):
package rcdp9;
import inet.world.VACaMobil.VACaMobil;
import inet.networklayer.autorouting.ipv4.IPv4NetworkConfigurator;
import inet.nodes.inet.AdhocHost;
import inet.world.radio.ChannelControl;
import inet.world.traci.TraCIScenarioManagerLaunchd;
network Cars
{
submodules:
configurator: IPv4NetworkConfigurator {
#display("p=396,221");
}
channelControl: ChannelControl {
#display("p=396,310");
}
manager: VACaMobil {
#display("p=322,405");
}
connections allowunconnected:
}
The problem is that in the omnetpp.ini, OMNeT++ gives the following warning
in lines beginning in ".channelNumber", ".wlan.", ".coche", and ".routingProtocol":
"Warning: Unused entry (does not match any parameters) Does not match any module parameters."
Apparently, OMNeT++ complains because the module TAdhocHost, whose name is "coche",
isn't defined in Cars.ned, but isn't assumed that OMNeT++ automatically recognizes that "coche"
is created by VACaMobil? I am doing something wrong? I would appreciate any help.
In the simplest case (all modules are created via appropriate statements in a simulation's .ned files) the IDE can simply parse all .ned files to know what modules exist.
However, the Veins TraCIScenarioManager directly uses the OMNeT++ C++ API to create additional modules at runtime. Before the simulation is run, the OMNeT++ IDE has no way of knowing that this will happen.
Without understanding what your C++ code does, it cannot know that the module parameters in your .ini file will (not at the start, but at a later point in the simulation) refer to a module that will exist.
There might be ways around this (declaring in a .ned file that a module should not be created automatically, but can be assumed to exist anyway), but I don't recall any that is not a hack.

Resources