Как реализовать функцию маршрутизации между составными модулями векторов (включая маршрутизаторы, хосты, мобильные модули и т. Д.)? - PullRequest
1 голос
/ 12 июня 2019

Как реализовать функцию маршрутизации между составными модулями векторов (включая маршрутизаторы, хосты, мобильные модули и т. Д.)?Например, как вы соединяете внутренние и внешние составные модули векторов?Как составной модуль в середине сети передает данные?

1. Я использую omnet ++ 5.4.1 и inet4.0 в Ubuntu 18.04

Я использую модуль спутникового моделирования-os3.Вот код спутникового модуля и код сети SatSGP4, код omnetpp.ini.

package os3.base;

//import inet.base.NotificationBoard;
import inet.mobility.contract.IMobility;
import inet.networklayer.ipv4.RoutingTableRecorder;
import inet.node.inet.Router;
import inet.node.inet.StandardHost;
import os3.mobility.Norad;
import os3.mobility.SatSGP4Mobility;
import inet.node.ethernet.Eth1G;

module Satellite
{
    parameters:
        @nodes();
        @node; //because of MobilityBase initialization
        string satelliteName = default(""); // Parameter for satellite name
        string mobilityType = default("SatSGP4Mobility"); // Define mobility module
        // Transmit Power of satellite (7dBW as example for CospasSarsat system)
        double transmitPower @unit(dBW) @display("i=device/satellite;bgb=324,226") = default(7dBW); // Symbol
        @display("t=$satelliteName;bgb=688,367");
    gates:
        //input radioIn; // Input gate
        //output radioOut; // Output gate
        inout ethg[];

    submodules:
        mobility: <mobilityType> like IMobility { // Module for mobility (parent class -> BasicMobility), BasicMobility -> IMobility
            @display("p=57,109");
        }
        //mobility : SatSGP4Mobility {
        //     parameters:
        //     @display("p=194,103");
        //}
        //        notificationBoard: NotificationBoard { // Module for event notification
        //            parameters:
        //                @display("p=221,94");
        //        }
        NoradModule: Norad { // Module for transformation between omnet and libNorad
            parameters:
                @display("p=51,36");
        }
        host: StandardHost {
            @display("p=204,101");
        }
        router: Router {
            @display("p=204,233");
        }
    connections allowunconnected:
        host.ethg++ <--> Eth1G <--> router.ethg++;              
        // towards other areas 
        router.ethg++ <--> ethg++;
}


package os3.examples.SatSGP4;

import inet.networklayer.configurator.ipv4.Ipv4NetworkConfigurator;
import os3.base.Satellite;
import os3.base.MissionControlCenter;
//import inet.world.radio.ChannelControl;
import inet.physicallayer.common.packetlevel.RadioMedium;
import os3.base.CNI_OS3;
import inet.node.ethernet.Eth100M;
//
// Network SatSGP4 enables satellite movement on worldmap
//
network SatSGP4
{
    parameters:
        int numOfSats; // Number of satellites
        int numOfMCCs; // Number of Mission Control Centers

        @display("bgi=background/background_earth,s;bgb=2160,1080");

    submodules:
        satellite[numOfSats]: Satellite {
            parameters:
                @display("p=116.315,384.11;r=10,,#707070;i=device/satellite_l");
        }
        MCC[numOfMCCs]: MissionControlCenter {
            parameters:
                @display("p=300.255,292.13998;i=misc/building;r=10,,black");
        }
        channelcontrol: RadioMedium {
            parameters:
                //numChannels = 2;
                @display("p=300.255,64.92;i=misc/sun");
        }
        cni_os3: CNI_OS3 {
            @display("p=80,70,i;i=old/bluebox");
        }
        configurator: Ipv4NetworkConfigurator {
            @display("p=562.64,67.625");
        }
    connections allowunconnected:
        satellite[0].ethg++ <--> Eth100M <--> satellite[1].ethg++;      
        satellite[1].ethg++ <--> Eth100M <--> satellite[2].ethg++;
}

[Config SatSGP4]
network = SatSGP4

SatSGP4.satellite[*].mobilityType = "SatSGP4Mobility"

**.constraintAreaMinX = 0m
**.constraintAreaMaxX = 2160m

**.constraintAreaMinY = 0m
**.constraintAreaMaxY = 1080m

**.constraintAreaMinZ = 0m
**.constraintAreaMaxZ = 0m
#-----------------------------radiomedium seetings---------
**.channelcontrol.propagation.typename ="ConstantTimePropagation"
**.channelcontrol.analogModel.typename ="ScalarAnalogModel"
**.channelcontrol.pathLoss.typename ="FreeSpacePathLoss"
#-------------------------------nic setting ---------------------

# tcp apps
**.satellite[0].host.numApps = 1
**.satellite[0].host.app[*].typename = "TcpSessionApp"
**.satellite[0].host.app[0].active = true
**.satellite[0].host.app[0].localAddress = ""
**.satellite[0].host.app[0].localPort = -1
**.satellite[0].host.app[0].connectAddress = "SatSGP4.satellite[2].host"
**.satellite[0].host.app[0].connectPort = 1000
**.satellite[0].host.app[0].tOpen = exponential(0.1s)
**.satellite[0].host.app[0].tSend = 0s
**.satellite[0].host.app[0].sendBytes = 1MiB
**.satellite[0].host.app[0].sendScript = ""
**.satellite[0].host.app[0].tClose = 0s

**.satellite[2].host.numApps = 1
**.satellite[2].host.app[*].typename = "TcpSinkApp"
**.satellite[2].host.app[0].localAddress = ""
**.satellite[2].host.app[0].localPort = 1000

# NIC configuration
**.ppp[*].queue.typename = "DropTailQueue" # in routers
**.ppp[*].queue.frameCapacity = 10  # in routers


[General]
# location of NED files
ned-path = ../../../inet/src;../../src/os3;.;
# location of images for GUI
image-path = ../../images/os3
#
sim-time-limit = 1500s

# Network parameters
**.updateInterval = 10s   # Interval to update the satellite positions on the map
**.numOfSats = 3          # Number of satellites used in simulation. ATTENTION! Must be smaller or equal to number of satellites in choosen TLEfile

# Parameters for UserConfig
**.userConfig.frequency = 1e9Hz
**.userConfig.min_snr = 0dBHz

#
# Parameters for WebServiceControl
#
# Insert you own API Key. You can register at http://www.worldweatheronline.com/free-weather-feed.aspx
**.webServiceControl.apiKeyWeather = ""
# Insert your own username from http://www.geonames.org/login
**.webServiceControl.usernameAltitude = ""
# (default = 100) Maximum number of saved altitude values. Be careful when changing!
**.webServiceControl.altitudeCacheThreshold = 100
# (default = 10) Maximum number of saved TLE data strings. Be careful when changing!
**.webServiceControl.tleCacheThreshold = 10
# (default = 10) Maximum number of saved weather data strings. Be careful when changing!
**.webServiceControl.weatherCacheThreshold = 10

#
# Parameters for WeatherControl
#
# (default = -1 means using live weather data) Precip per hour (unit mm/(m2*h))
**.weatherControl.defaultPrecipPerHour = -1

#
# Parameters for Norad
#
# Provide the filename of the TLEs. Used by Webservice if GUI not used,
# must fit the names from http://celestrak.com/NORAD/elements/xxx.txt
*.satellite[*].NoradModule.TLEfile = "gps-ops.txt"

#
# Parameters for Calculation
#
# Provide the name of the Table for the Rain parameters. DO NOT CHANGE!
**.calculation.rainTableFile = "../../data/TablespecRain.csv"

#
# Parameters for Satellite
#
# (default = 7dBW) Transmit power of satellites (Can be choosen individually for each satellite, see MCCs for example)
*.satellite[*].transmitPower = 10dBW
# default = "", satelliteName is only used if a specific satellite from a TLE file should be used instead of the first numOfSats.
#*.satellite[0].satelliteName = "GPS BIIA-10 (PRN 32)"

#
# Parameters for Channelcontrol (INET module) 
#
# Variable. Maximum transmit Power of a Base Station found in Germany (Usingen).
# Default(20mW) Maximum sending power used for this network (in mW)
*.channelcontrol.pMax = 100000W

#----------------------------------------------------
# Mission Control Centers all over the world
#----------------------------------------------------

**.numOfMCCs = 4

# Algier
SatSGP4.MCC[0].mobility.latitude = 36.46
SatSGP4.MCC[0].mobility.longitude = 3.03
SatSGP4.MCC[0].cityName = "Algier"

# Ourgla
SatSGP4.MCC[1].mobility.latitude = 31.57
SatSGP4.MCC[1].mobility.longitude = 5.20
SatSGP4.MCC[1].cityName = "Ourgla"

# Parana, Argentinia
SatSGP4.MCC[2].mobility.latitude = -31.43
SatSGP4.MCC[2].mobility.longitude = -60.30
SatSGP4.MCC[2].cityName = "Parana"

# Rio Grande
SatSGP4.MCC[3].mobility.latitude = -53.47
SatSGP4.MCC[3].mobility.longitude = -67.42
SatSGP4.MCC[3].cityName = "Rio Grande"

Я хочу, чтобы хост спутниковой [0] передавал данные tcp на хостsatellite [2], но он не может этого сделать. Когда я запускаю ini-файл, в satellite [0] хост отправляет arpREQ на маршрутизатор, маршрутизатор получает arpREQ и отправляет arpReply на хост, но когда хост снова отправляет SYN на маршрутизатор,маршрутизатор отправляет ICMP-ошибку- # 3-type3-code0. Неправильно ли указаны ссылки, неверно ли задан ini или есть ли другие ошибки? Заранее спасибо за помощь.

...