%description:
This example tests a single route request with two intermediate nodes
between the sender and the receiver. The two intermediate nodes are
placed to the same distance from both the receiver and the sender.
%#--------------------------------------------------------------------------------------------------------------
%file: test.ned

import inet.common.lifecycle.LifecycleController;
import inet.networklayer.configurator.ipv4.IPv4NetworkConfigurator;
import inet.networklayer.ipv4.RoutingTableRecorder;
import inet.node.aodv.AODVRouter;
import inet.physicallayer.idealradio.IdealRadioMedium;
import inet.common.scenario.ScenarioManager;


network AODVTest
{
    parameters:
        @display("bgb=961,662");
    submodules:
        radioMedium: IdealRadioMedium {
            parameters:
                @display("p=50,50");
        }
        configurator: IPv4NetworkConfigurator {
            parameters:
                addDefaultRoutes = false;
                addStaticRoutes = false;
                addSubnetRoutes = false;
                config = xml("<config><interface hosts='*' address='145.236.x.x' netmask='255.255.0.0'/></config>");
                @display("p=50,100");
        }

        routingTableRecorder: RoutingTableRecorder {
            parameters:
                @display("p=50,150");
        }
        lifecycleController: LifecycleController {
            parameters:
                @display("p=50,200");
        }
        scenarioManager: ScenarioManager {
            parameters:
                script = default(xml("<scenario/>"));
                @display("p=50,250");
        }
        sender: AODVRouter {
            parameters:
                @display("i=device/pocketpc_s;r=,,#707070;p=284,51");
        }
        intermediateNodeA: AODVRouter {
            parameters:
                @display("i=device/pocketpc_s;r=,,#707070;p=203,206");
        }
        intermediateNodeB: AODVRouter {
            parameters:
                @display("i=device/pocketpc_s;r=,,#707070;p=386,206");
        }
        receiver: AODVRouter {
            parameters:
                @display("i=device/pocketpc_s;r=,,#707070;p=284,378");
        }
    connections allowunconnected:
}

%#--------------------------------------------------------------------------------------------------------------
%inifile: omnetpp.ini
[General]
network = AODVTest
record-eventlog = true
sim-time-limit = 100s
num-rngs = 3
tkenv-plugin-path = ../../../etc/plugins
ned-path = .;../../../../src;../../lib

#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"

**.mobility.rng-0 = 1
**.wlan[*].mac.rng-0 = 2
**.aodv.useHelloMessages = false
*.sender.aodv.jitter = 1ms
*.receiver.aodv.jitter = 2ms
*.intermediateNodeA.aodv.jitter = 3ms
*.intermediateNodeB.aodv.jitter = 4ms
# mobility
**.mobilityType = "StationaryMobility"
**.mobility.constraintAreaMinZ = 0m
**.mobility.constraintAreaMaxZ = 0m
**.mobility.constraintAreaMinX = 0m
**.mobility.constraintAreaMinY = 0m
**.mobility.constraintAreaMaxX = 600m
**.mobility.constraintAreaMaxY = 600m

# ping app (host[0] pinged by others)
**.sender.numPingApps = 1
**.sender.pingApp[0].startTime = uniform(1s,5s)
**.sender.pingApp[0].printPing = true
**.sender.pingApp[0].destAddr = "receiver(ipv4)"

# nic settings
**.wlan[*].typename = "IdealWirelessNic"
**.wlan[*].radio.transmitter.communicationRange = 240m
**.wlan[*].bitrate = 2Mbps
**.wlan[*].mac.address = "auto"
**.wlan[*].mac.headerLength = 20B

%#--------------------------------------------------------------------------------------------------------------
%contains-regex: results/General-0.rt
.*
\+R \d+  3\.1965\d+  8  145\.236\.0\.2  145\.236\.0\.1  32  145\.236\.0\.1
\+R \d+  3\.1965\d+  9  145\.236\.0\.3  145\.236\.0\.1  32  145\.236\.0\.1
\+R \d+  3\.1998\d+  7  145\.236\.0\.1  145\.236\.0\.2  32  145\.236\.0\.2
\+R \d+  3\.1998\d+  9  145\.236\.0\.3  145\.236\.0\.2  32  145\.236\.0\.2
\+R \d+  3\.1998\d+  10  145\.236\.0\.4  145\.236\.0\.2  32  145\.236\.0\.2
\+R \d+  3\.1998\d+  10  145\.236\.0\.4  145\.236\.0\.1  32  145\.236\.0\.2
\+R \d+  3\.2004\d+  8  145\.236\.0\.2  145\.236\.0\.4  32  145\.236\.0\.4
\+R \d+  3\.2008\d+  8  145\.236\.0\.2  145\.236\.0\.3  32  145\.236\.0\.3
\+R \d+  3\.2008\d+  7  145\.236\.0\.1  145\.236\.0\.3  32  145\.236\.0\.3
\+R \d+  3\.2008\d+  10  145\.236\.0\.4  145\.236\.0\.3  32  145\.236\.0\.3
\+R \d+  3\.2041\d+  7  145\.236\.0\.1  145\.236\.0\.4  32  145\.236\.0\.2
\-R \d+  21\.1998\d+  9  145\.236\.0\.3  145\.236\.0\.2  32  145\.236\.0\.2
\-R \d+  21\.2008\d+  8  145\.236\.0\.2  145\.236\.0\.3  32  145\.236\.0\.3
\-R \d+  21\.2008\d+  7  145\.236\.0\.1  145\.236\.0\.3  32  145\.236\.0\.3
\-R \d+  21\.2008\d+  10  145\.236\.0\.4  145\.236\.0\.3  32  145\.236\.0\.3
\-R \d+  23\.7165\d+  9  145\.236\.0\.3  145\.236\.0\.1  32  145\.236\.0\.1
%#--------------------------------------------------------------------------------------------------------------
%not-contains: stdout
undisposed object:
%not-contains: stdout
-- check module destructor
%#--------------------------------------------------------------------------------------------------------------
