4

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.

0 Answers0