123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242 |
- %description:
- Testing manetrouting with AODV routing protocol, UDP forwarding
- manetrouting AODV UDP
- %#--------------------------------------------------------------------------------------------------------------
- %testprog: opp_run
- %#--------------------------------------------------------------------------------------------------------------
- %file: test.ned
- import inet.networklayer.configurator.ipv4.FlatNetworkConfigurator;
- import inet.node.aodv.AODVRouter;
- import inet.physicallayer.ieee80211.packetlevel.Ieee80211ScalarRadioMedium;
- //
- // Example network for testing aodv routing. Contains
- // fixed and mobile nodes. Mobile nodes are not moving,
- // but are scattered randomly on the playground.
- //
- network Net80211_aodv_test
- {
- parameters:
- int numHosts;
- int distance @unit(m) = default(350m);
- submodules:
- senderhost: AODVRouter {
- parameters:
- mobility.initialX = 1m;
- mobility.initialY = 200m;
- mobility.initialZ = 0m;
- @display("i=device/pocketpc_s;r=,,#707070");
- }
- rcvrhost: AODVRouter {
- parameters:
- mobility.initialX = 1m + (numHosts+1) * distance;
- mobility.initialY = 200m;
- mobility.initialZ = 0m;
- @display("i=device/pocketpc_s;r=,,#707070");
- }
- host[numHosts]: AODVRouter {
- parameters:
- mobility.initialX = 1m + (index+1) * distance;
- mobility.initialY = 200m;
- mobility.initialZ = 0m;
- @display("i=device/pocketpc_s;r=,,#707070");
- }
- radioMedium: Ieee80211ScalarRadioMedium {
- parameters:
- @display("p=60,50;i=misc/sun");
- }
- configurator: FlatNetworkConfigurator {
- parameters:
- networkAddress = "145.236.0.0";
- netmask = "255.255.0.0";
- @display("p=181,51;i=block/cogwheel_s");
- }
- connections allowunconnected:
- }
- %#--------------------------------------------------------------------------------------------------------------
- %inifile: omnetpp.ini
- [General]
- #debug-on-errors = true
- record-eventlog = false
- sim-time-limit = 101s
- seed-0-mt = 5
- network = Net80211_aodv_test
- cmdenv-express-mode = false
- tkenv-plugin-path = ../../../etc/plugins
- description = "Aodv Simple test"
- #**.drawCoverage=false
- *.numHosts = 1
- **.constraintAreaMinX = 0m
- **.constraintAreaMinY = 0m
- **.constraintAreaMinZ = 0m
- **.constraintAreaMaxX = 1000m
- **.constraintAreaMaxY = 300m
- **.constraintAreaMaxZ = 0m
- **.networkLayer.configurator.networkConfiguratorModule = ""
- # mobility
- **.mobility.initFromDisplayString = false
- **.host*.mobilityType = "StationaryMobility"
- **.*host.mobilityType = "StationaryMobility"
- # udp apps (on)
- **.senderhost.numUdpApps = 1
- **.senderhost.udpApp[*].typename = "UDPBasicBurst"
- **.udpApp[0].destAddresses = "rcvrhost"
- **.udpApp[0].localPort = 1234
- **.udpApp[0].destPort = 1234
- **.udpApp[0].messageLength = 512B #
- **.udpApp[0].sendInterval = 10s + uniform(-0.001s,0.001s)
- **.udpApp[0].burstDuration = 0
- **.udpApp[0].chooseDestAddrMode = "perBurst"
- **.udpApp[0].sleepDuration = 1s
- **.udpApp[0].stopTime = -1s
- **.udpApp[0].startTime = 10s
- **.udpApp[0].delayLimit = 20s
- **.udpApp[0].destAddrRNG = 0
- **.rcvrhost.udpApp[*].typename = "UDPSink"
- **.rcvrhost.numUdpApps = 1
- **.rcvrhost.udpApp[0].localPort = 1234
- # tcp apps (off)
- **.numTcpApps = 0
- # ping app (senderhost pinged by others)
- # ping app (off)
- **.pingApp.count = 0
- **.pingApp.startTime = 1s
- **.pingApp.stopTime = -1s
- **.pingApp.printPing = true
- # ip settings
- **.ip.procDelay = 10us
- ######################################################################
- # manet routing
- **.routingProtocol = "AODVUU"
- #######################################################
- # nic settings
- **.wlan*.*.dataBitrate = 54Mbps
- **.wlan*.*.mgmtBitrate = 54Mbps
- **.wlan*.*.multicastBitrate = 54Mbps
- **.wlan*.*.controlBitrate = 54Mbps
- **.wlan*.mac.EDCA = false
- **.wlan*.mgmt.frameCapacity = 10
- **.wlan*.mac.maxQueueSize = 14
- **.wlan*.mac.rtsThresholdBytes = 3000B
- **.wlan*.mac.basicBitrate = 6Mbps # 24Mbps
- **.wlan*.mac.retryLimit = 7
- **.wlan*.mac.cwMinData = 31
- **.wlan*.mac.cwMinBroadcast = 31
- # channel physical parameters
- *.radioMedium.pMax = 2.0mW
- **.wlan*.radio.transmitterPower=2.0mW
- **.wlan*.radio.sensitivity=-90dBm
- **.wlan*.radio.receiver.errorModelType = "Ieee80211BerTableErrorModel"
- **.wlan*.radio.receiver.errorModel.berTableFile="../../files/per_table_80211g_Trivellato.dat"
- **.broadCastDelay=uniform(0s,0.005s)
- %#--------------------------------------------------------------------------------------------------------------
- %postrun-command: Rscript check.r
- %#--------------------------------------------------------------------------------------------------------------
- %file: check.r
- #!/usr/bin/env Rscript
- options(echo=FALSE)
- options(width=160)
- library("omnetpp", warn.conflicts=FALSE)
- #TEST parameters
- scafile <- 'results/General-#0.sca'
- linecount <- 1
- packets <- 10.0
- # begin TEST:
- dataset <- loadDataset(scafile)
- cat("\nOMNETPP TEST RESULT:\n")
- cat("\n MANETROUTING UDP TEST RESULT:\n")
- cat("\n CHECKS SENT PACKETS:\n")
- x <- dataset$scalars[dataset$scalars$name == "sentPk:count",]
- xx <- x[grep("\\.senderhost\\.udpApp\\[0\\]",x$module),]
- if(length(xx$value) != linecount)
- {
- cat(" LINECOUNT INCORRECT\n")
- print(xx)
- } else {
- cat(" LINECOUNT CORRECT\n")
- if(max(xx$value) != packets)
- {
- cat(" NUMBER OF PACKETS INCORRECT\n")
- print(xx)
- } else {
- cat(" NUMBER OF PACKETS CORRECT\n")
- }
- }
- cat("\n CHECKS RECEIVED PACKETS:\n")
- x <- dataset$scalars[dataset$scalars$name == "rcvdPk:count",]
- xx <- x[grep("\\.rcvrhost\\.udpApp\\[0\\]",x$module),]
- if(length(xx$value) != linecount)
- {
- cat(" LINECOUNT INCORRECT\n")
- print(xx)
- } else {
- cat(" LINECOUNT CORRECT\n")
- if(max(xx$value) < packets -1) # one packet different is acceptable.
- {
- cat(" NUMBER OF PACKETS INCORRECT\n")
- print(xx)
- } else {
- cat(" NUMBER OF PACKETS CORRECT\n")
- }
- }
- cat("\n")
- %#--------------------------------------------------------------------------------------------------------------
- %contains: postrun-command(1).out
- OMNETPP TEST RESULT:
- MANETROUTING UDP TEST RESULT:
- CHECKS SENT PACKETS:
- LINECOUNT CORRECT
- NUMBER OF PACKETS CORRECT
- CHECKS RECEIVED PACKETS:
- LINECOUNT CORRECT
- NUMBER OF PACKETS CORRECT
- %#--------------------------------------------------------------------------------------------------------------
|