%description:
Testing OSPF routing
Backbone and 2 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];
}
RA1: OSPFRouter {
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];
}
RA2: 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(""+
""+
""+
""+
""+
"");
addStaticRoutes = false;
addDefaultRoutes = false;
@display("p=75,43");
}
connections:
H1.ethg[0] <--> C <--> N1.ethg[0];
N1.ethg[1] <--> C <--> RA1.ethg[0];
RA1.ethg[1] <--> C <--> R1.ethg[0] if numIRouters == 0;
RA1.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 <--> RA2.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 <--> RA2.ethg[0] if numIRouters > 0;
RA2.ethg[1] <--> C <--> N2.ethg[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 = 51s
**.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
%#--------------------------------------------------------------------------------------------------------------
%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
%#--------------------------------------------------------------------------------------------------------------