123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142 |
- %description:
- In this example there are two possible routes between the sender and the receiver.
- This tests demonstrates that the AODV chooses the shortest path, that is, the route
- which has the lowest hop count.
- %#--------------------------------------------------------------------------------------------------------------
- %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=283,63");
- }
- intermediateNodeA: AODVRouter {
- parameters:
- @display("i=device/pocketpc_s;r=,,#707070;p=203,206");
- }
- intermediateNodeB: AODVRouter {
- parameters:
- @display("i=device/pocketpc_s;r=,,#707070;p=385,256");
- }
- intermediateNodeC: AODVRouter {
- parameters:
- @display("i=device/pocketpc_s;r=,,#707070;p=292,325");
- }
- receiver: AODVRouter {
- parameters:
- @display("i=device/pocketpc_s;r=,,#707070;p=292,454");
- }
- connections allowunconnected:
- }
- %#--------------------------------------------------------------------------------------------------------------
- %inifile: omnetpp.ini
- [General]
- network = AODVTest
- record-eventlog = true
- tkenv-plugin-path = ../../../etc/plugins
- ned-path = .;../../../../src;../../lib
- num-rngs = 3
- sim-time-limit = 100s
- #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+ 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\.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\.2008\d+ 10 145\.236\.0\.4 145\.236\.0\.3 32 145\.236\.0\.3
- \+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+ 11 145\.236\.0\.5 145\.236\.0\.3 32 145\.236\.0\.3
- \+R \d+ 3\.2008\d+ 11 145\.236\.0\.5 145\.236\.0\.1 32 145\.236\.0\.3
- \+R \d+ 3\.2014\d+ 9 145\.236\.0\.3 145\.236\.0\.5 32 145\.236\.0\.5
- \+R \d+ 3\.2061\d+ 7 145\.236\.0\.1 145\.236\.0\.5 32 145\.236\.0\.3
- -R \d+ 21\.1998\d+ 10 145\.236\.0\.4 145\.236\.0\.2 32 145\.236\.0\.2
- -R \d+ 21\.1998\d+ 7 145\.236\.0\.1 145\.236\.0\.2 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+ 10 145\.236\.0\.4 145\.236\.0\.3 32 145\.236\.0\.3
- -R \d+ 21\.2008\d+ 8 145\.236\.0\.2 145\.236\.0\.3 32 145\.236\.0\.3
- -R \d+ 23\.6398\d+ 10 145\.236\.0\.4 145\.236\.0\.1 32 145\.236\.0\.2
- -R \d+ 23\.7165\d+ 8 145\.236\.0\.2 145\.236\.0\.1 32 145\.236\.0\.1
- %#--------------------------------------------------------------------------------------------------------------
- %not-contains: stdout
- undisposed object:
- %not-contains: stdout
- -- check module destructor
- %#--------------------------------------------------------------------------------------------------------------
|