123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250 |
- %description:
- Testing OSPF routing
- Backbone only with n routers
- UDP communications through entire backbone
- %#--------------------------------------------------------------------------------------------------------------
- %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];
- }
- 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];
- }
- 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 R1' address='192.168.1.x' netmask='255.255.255.0' />"+
- "<interface among='H2 R2' address='192.168.2.x' netmask='255.255.255.0' />"+
- "<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];
- 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];
- 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 = 4s
- **.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,10,25}
- %#--------------------------------------------------------------------------------------------------------------
- %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.1.0" mask="255.255.255.0" status="Advertise" />
- <AddressRange address="192.168.2.0" mask="255.255.255.0" status="Advertise" />
- <AddressRange address="192.168.60.0" mask="255.255.255.0" status="Advertise" />
- </Area>
- <!-- Routers -->
- <Router name="R1" RFC1583Compatible="true">
- <HostInterface ifName="eth0" areaID="0.0.0.0" attachedHost="H1" linkCost="10" />
- <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" />
- <HostInterface ifName="eth1" areaID="0.0.0.0" attachedHost="H2" linkCost="10" />
- </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
- %#--------------------------------------------------------------------------------------------------------------
|