123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285 |
- %description:
- Testing OSPF routing
- Backbone and 2 stub areas
- UDP communications through entire network
- %#--------------------------------------------------------------------------------------------------------------
- %file: test.ned
- import inet.linklayer.ethernet.EtherHub;
- import inet.networklayer.configurator.ipv4.IPv4NetworkConfigurator;
- import inet.node.inet.StandardHost;
- import inet.node.ospfv2.OSPFRouter;
- import inet.common.misc.ThruputMeteringChannel;
- network Test1
- {
- parameters:
- int numIRouters = default(0);
- @display("p=10,10;b=712,152");
- types:
- channel C extends ThruputMeteringChannel
- {
- delay = 0.1us;
- datarate = 100Mbps;
- thruputDisplayFormat = "#N";
- }
- submodules:
- H1: StandardHost {
- parameters:
- @display("p=56,92;i=device/laptop");
- gates:
- ethg[1];
- }
- N1: EtherHub {
- parameters:
- @display("p=184,182");
- gates:
- ethg[2];
- }
- RA1I[numIRouters]: OSPFRouter {
- gates:
- ethg[2];
- }
- R1: OSPFRouter {
- parameters:
- @display("p=296,92");
- gates:
- ethg[2];
- }
- RI[numIRouters]: OSPFRouter {
- gates:
- ethg[2];
- }
- R2: OSPFRouter {
- parameters:
- @display("p=416,92");
- gates:
- ethg[2];
- }
- RA2I[numIRouters]: OSPFRouter {
- gates:
- ethg[2];
- }
- N2: EtherHub {
- parameters:
- @display("p=532,182");
- gates:
- ethg[2];
- }
- H2: StandardHost {
- parameters:
- @display("p=660,92;i=device/laptop");
- gates:
- ethg[1];
- }
- configurator: IPv4NetworkConfigurator {
- parameters:
- config = xml("<config>"+
- "<interface among='H1 RA1I[*] R1' address='192.168.1.x' netmask='255.255.255.x' />"+
- "<interface among='H2 RA2I[*] R2' address='192.168.2.x' netmask='255.255.255.x' />"+
- "<interface among='R1 RI[*] R2' address='192.168.60.x' netmask='255.255.255.x' />"+
- "<route hosts='H1 H2' destination='*' netmask='0.0.0.0' interface='eth0' />"+
- "</config>");
- addStaticRoutes = false;
- addDefaultRoutes = false;
- @display("p=75,43");
- }
- connections:
- H1.ethg[0] <--> C <--> N1.ethg[0];
- N1.ethg[1] <--> C <--> R1.ethg[0] if numIRouters == 0;
- N1.ethg[1] <--> C <--> RA1I[0].ethg[0] if numIRouters > 0;
- for i = 1..numIRouters-1 {
- RA1I[i-1].ethg[1] <--> C <--> RA1I[i].ethg[0];
- }
- RA1I[numIRouters-1].ethg[1] <--> C <--> R1.ethg[0] if numIRouters > 0;
- R1.ethg[1] <--> C <--> R2.ethg[0] if numIRouters == 0;
- R1.ethg[1] <--> C <--> RI[0].ethg[0] if numIRouters > 0;
- for i = 1..numIRouters-1 {
- RI[i-1].ethg[1] <--> C <--> RI[i].ethg[0];
- }
- RI[numIRouters-1].ethg[1] <--> C <--> R2.ethg[0] if numIRouters > 0;
- R2.ethg[1] <--> C <--> N2.ethg[0] if numIRouters == 0;
- R2.ethg[1] <--> C <--> RA2I[0].ethg[0] if numIRouters > 0;
- for i = 1..numIRouters-1 {
- RA2I[i-1].ethg[1] <--> C <--> RA2I[i].ethg[0];
- }
- RA2I[numIRouters-1].ethg[1] <--> C <--> N2.ethg[0] if numIRouters > 0;
- N2.ethg[1] <--> C <--> H2.ethg[0];
- }
- %#--------------------------------------------------------------------------------------------------------------
- %inifile: omnetpp.ini
- [General]
- description = "Simple test"
- network = Test1
- ned-path = .;../../../../src;../../lib
- tkenv-plugin-path = ../../../etc/plugins
- sim-time-limit = 200s
- #omnetpp 5.0 - 5.1 compatibility:
- eventlog-file = "${resultdir}/${configname}-${runnumber}.elog"
- output-scalar-file = "${resultdir}/${configname}-${runnumber}.sca"
- output-vector-file = "${resultdir}/${configname}-${runnumber}.vec"
- snapshot-file = "${resultdir}/${configname}-${runnumber}.sna"
- **.ospf.ospfConfig = xmldoc("ASConfig.xml")
- **.numUdpApps = 2
- **.udpApp[0].typename = "UDPBasicApp"
- **.udpApp[0].destPort = 1234
- **.udpApp[0].messageLength = 32 bytes
- **.udpApp[0].sendInterval = 1s
- **.udpApp[0].startTime = 55s
- **.udpApp[0].stopTime = this.startTime + 100s
- **.H2.udpApp[0].destAddresses = "H1"
- **.H1.udpApp[0].destAddresses = "H2"
- **.udpApp[1].typename = "UDPEchoApp"
- **.udpApp[1].localPort = 1234
- **.arp.cacheTimeout = 1s
- **.numIRouters = ${0,1,2,3,5,7,8}
- %#--------------------------------------------------------------------------------------------------------------
- %file: ASConfig.xml
- <?xml version="1.0"?>
- <OSPFASConfig xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="OSPF.xsd">
- <!-- Areas -->
- <Area id="0.0.0.0">
- <AddressRange address="192.168.60.0" mask="255.255.255.0" status="Advertise" />
- </Area>
- <Area id="0.0.0.1">
- <Stub defaultCost="10" />
- </Area>
- <Area id="0.0.0.2">
- <Stub defaultCost="10" />
- </Area>
- <!-- Routers -->
- <Router name="RA1I[*]" RFC1583Compatible="true">
- <BroadcastInterface ifName="eth0" areaID="0.0.0.1" interfaceOutputCost="2" />
- <BroadcastInterface ifName="eth1" areaID="0.0.0.1" interfaceOutputCost="2" />
- </Router>
- <Router name="R1" RFC1583Compatible="true">
- <BroadcastInterface ifName="eth0" areaID="0.0.0.1" interfaceOutputCost="1" routerPriority="1" />
- <PointToPointInterface ifName="eth1" areaID="0.0.0.0" interfaceOutputCost="2" />
- </Router>
- <Router name="RI[*]" RFC1583Compatible="true">
- <PointToPointInterface ifName="eth0" areaID="0.0.0.0" interfaceOutputCost="2" />
- <PointToPointInterface ifName="eth1" areaID="0.0.0.0" interfaceOutputCost="2" />
- </Router>
- <Router name="R2" RFC1583Compatible="true">
- <PointToPointInterface ifName="eth0" areaID="0.0.0.0" interfaceOutputCost="2" />
- <BroadcastInterface ifName="eth1" areaID="0.0.0.2" interfaceOutputCost="1" routerPriority="2" />
- </Router>
- <Router name="RA2I[*]" RFC1583Compatible="true">
- <BroadcastInterface ifName="eth0" areaID="0.0.0.2" interfaceOutputCost="2" />
- <BroadcastInterface ifName="eth1" areaID="0.0.0.2" interfaceOutputCost="2" />
- </Router>
- </OSPFASConfig>
- %#--------------------------------------------------------------------------------------------------------------
- %contains: results/General-0.sca
- scalar Test1.H1.udpApp[0] sentPk:count 100
- %contains: results/General-0.sca
- scalar Test1.H1.udpApp[0] rcvdPk:count 100
- %contains: results/General-0.sca
- scalar Test1.H1.udpApp[1] echoedPk:count 100
- %contains: results/General-0.sca
- scalar Test1.H2.udpApp[0] sentPk:count 100
- %contains: results/General-0.sca
- scalar Test1.H2.udpApp[0] rcvdPk:count 100
- %contains: results/General-0.sca
- scalar Test1.H2.udpApp[1] echoedPk:count 100
- %contains: results/General-1.sca
- scalar Test1.H1.udpApp[0] sentPk:count 100
- %contains: results/General-1.sca
- scalar Test1.H1.udpApp[0] rcvdPk:count 100
- %contains: results/General-1.sca
- scalar Test1.H1.udpApp[1] echoedPk:count 100
- %contains: results/General-1.sca
- scalar Test1.H2.udpApp[0] sentPk:count 100
- %contains: results/General-1.sca
- scalar Test1.H2.udpApp[0] rcvdPk:count 100
- %contains: results/General-1.sca
- scalar Test1.H2.udpApp[1] echoedPk:count 100
- %contains: results/General-2.sca
- scalar Test1.H1.udpApp[0] sentPk:count 100
- %contains: results/General-2.sca
- scalar Test1.H1.udpApp[0] rcvdPk:count 100
- %contains: results/General-2.sca
- scalar Test1.H1.udpApp[1] echoedPk:count 100
- %contains: results/General-2.sca
- scalar Test1.H2.udpApp[0] sentPk:count 100
- %contains: results/General-2.sca
- scalar Test1.H2.udpApp[0] rcvdPk:count 100
- %contains: results/General-2.sca
- scalar Test1.H2.udpApp[1] echoedPk:count 100
- %contains: results/General-3.sca
- scalar Test1.H1.udpApp[0] sentPk:count 100
- %contains: results/General-3.sca
- scalar Test1.H1.udpApp[0] rcvdPk:count 100
- %contains: results/General-3.sca
- scalar Test1.H1.udpApp[1] echoedPk:count 100
- %contains: results/General-3.sca
- scalar Test1.H2.udpApp[0] sentPk:count 100
- %contains: results/General-3.sca
- scalar Test1.H2.udpApp[0] rcvdPk:count 100
- %contains: results/General-3.sca
- scalar Test1.H2.udpApp[1] echoedPk:count 100
- %contains: results/General-4.sca
- scalar Test1.H1.udpApp[0] sentPk:count 100
- %contains: results/General-4.sca
- scalar Test1.H1.udpApp[0] rcvdPk:count 100
- %contains: results/General-4.sca
- scalar Test1.H1.udpApp[1] echoedPk:count 100
- %contains: results/General-4.sca
- scalar Test1.H2.udpApp[0] sentPk:count 100
- %contains: results/General-4.sca
- scalar Test1.H2.udpApp[0] rcvdPk:count 100
- %contains: results/General-4.sca
- scalar Test1.H2.udpApp[1] echoedPk:count 100
- %contains: results/General-5.sca
- scalar Test1.H1.udpApp[0] sentPk:count 100
- %contains: results/General-5.sca
- scalar Test1.H1.udpApp[0] rcvdPk:count 100
- %contains: results/General-5.sca
- scalar Test1.H1.udpApp[1] echoedPk:count 100
- %contains: results/General-5.sca
- scalar Test1.H2.udpApp[0] sentPk:count 100
- %contains: results/General-5.sca
- scalar Test1.H2.udpApp[0] rcvdPk:count 100
- %contains: results/General-5.sca
- scalar Test1.H2.udpApp[1] echoedPk:count 100
- %contains: results/General-6.sca
- scalar Test1.H1.udpApp[0] sentPk:count 100
- %contains: results/General-6.sca
- scalar Test1.H1.udpApp[0] rcvdPk:count 100
- %contains: results/General-6.sca
- scalar Test1.H1.udpApp[1] echoedPk:count 100
- %contains: results/General-6.sca
- scalar Test1.H2.udpApp[0] sentPk:count 100
- %contains: results/General-6.sca
- scalar Test1.H2.udpApp[0] rcvdPk:count 100
- %contains: results/General-6.sca
- scalar Test1.H2.udpApp[1] echoedPk:count 100
- %#--------------------------------------------------------------------------------------------------------------
- %not-contains: stdout
- undisposed object:
- %not-contains: stdout
- -- check module destructor
- %#--------------------------------------------------------------------------------------------------------------
|