manetrouting_transmit10.test 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245
  1. %description:
  2. Testing manetrouting with AODV routing protocol, UDP forwarding
  3. manetrouting AODV UDP
  4. %#--------------------------------------------------------------------------------------------------------------
  5. %testprog: opp_run
  6. %#--------------------------------------------------------------------------------------------------------------
  7. %file: test.ned
  8. import inet.networklayer.configurator.ipv4.FlatNetworkConfigurator;
  9. import inet.node.aodv.AODVRouter;
  10. import inet.physicallayer.ieee80211.packetlevel.Ieee80211ScalarRadioMedium;
  11. //
  12. // Example network for testing aodv routing. Contains
  13. // fixed and mobile nodes. Mobile nodes are not moving,
  14. // but are scattered randomly on the playground.
  15. //
  16. network Net80211_aodv_test
  17. {
  18. parameters:
  19. int numHosts;
  20. int distance @unit(m) = default(350m);
  21. submodules:
  22. senderhost: AODVRouter {
  23. parameters:
  24. mobility.initialX = 1m;
  25. mobility.initialY = 200m;
  26. mobility.initialZ = 0m;
  27. @display("i=device/pocketpc_s;r=,,#707070");
  28. }
  29. rcvrhost: AODVRouter {
  30. parameters:
  31. mobility.initialX = 1m + (numHosts+1) * distance;
  32. mobility.initialY = 200m;
  33. mobility.initialZ = 0m;
  34. @display("i=device/pocketpc_s;r=,,#707070");
  35. }
  36. host[numHosts]: AODVRouter {
  37. parameters:
  38. mobility.initialX = 1m + (index+1) * distance;
  39. mobility.initialY = 200m;
  40. mobility.initialZ = 0m;
  41. @display("i=device/pocketpc_s;r=,,#707070");
  42. }
  43. radioMedium: Ieee80211ScalarRadioMedium {
  44. parameters:
  45. @display("p=60,50;i=misc/sun");
  46. }
  47. configurator: FlatNetworkConfigurator {
  48. parameters:
  49. networkAddress = "145.236.0.0";
  50. netmask = "255.255.0.0";
  51. @display("p=181,51;i=block/cogwheel_s");
  52. }
  53. connections allowunconnected:
  54. }
  55. %#--------------------------------------------------------------------------------------------------------------
  56. %inifile: omnetpp.ini
  57. [General]
  58. #debug-on-errors = true
  59. record-eventlog = false
  60. sim-time-limit = 101s
  61. seed-0-mt = 5
  62. network = Net80211_aodv_test
  63. cmdenv-express-mode = false
  64. tkenv-plugin-path = ../../../etc/plugins
  65. description = "Aodv Simple test"
  66. #**.drawCoverage=false
  67. *.numHosts = 10
  68. **.constraintAreaMinX = 0m
  69. **.constraintAreaMinY = 0m
  70. **.constraintAreaMinZ = 0m
  71. **.constraintAreaMaxX = 4000m
  72. **.constraintAreaMaxY = 300m
  73. **.constraintAreaMaxZ = 0m
  74. **.networkLayer.configurator.networkConfiguratorModule = ""
  75. # mobility
  76. **.mobility.initFromDisplayString = false
  77. **.host*.mobilityType = "StationaryMobility"
  78. **.*host.mobilityType = "StationaryMobility"
  79. # udp apps (on)
  80. **.senderhost.numUdpApps = 1
  81. **.senderhost.udpApp[*].typename = "UDPBasicBurst"
  82. **.udpApp[0].destAddresses = "rcvrhost"
  83. **.udpApp[0].localPort = 1234
  84. **.udpApp[0].destPort = 1234
  85. **.udpApp[0].messageLength = 512B #
  86. **.udpApp[0].sendInterval = 10s + uniform(-0.001s,0.001s)
  87. **.udpApp[0].burstDuration = 0
  88. **.udpApp[0].chooseDestAddrMode = "perBurst"
  89. **.udpApp[0].sleepDuration = 1s
  90. **.udpApp[0].stopTime = -1s
  91. **.udpApp[0].startTime = 10s
  92. **.udpApp[0].delayLimit = 20s
  93. **.udpApp[0].destAddrRNG = 0
  94. **.rcvrhost.udpApp[*].typename = "UDPSink"
  95. **.rcvrhost.numUdpApps = 1
  96. **.rcvrhost.udpApp[0].localPort = 1234
  97. # tcp apps (off)
  98. **.numTcpApps = 0
  99. # ping app (senderhost pinged by others)
  100. # ping app (off)
  101. **.pingApp.count = 0
  102. **.pingApp.startTime = 1s
  103. **.pingApp.stopTime = -1s
  104. **.pingApp.printPing = true
  105. # ip settings
  106. **.ip.procDelay = 10us
  107. # **.forwarding=false
  108. ######################################################################
  109. # manet routing
  110. **.routingProtocol = "AODVUU"
  111. #######################################################
  112. # nic settings
  113. #for validation
  114. **.wlan*.*.dataBitrate = 54Mbps
  115. **.wlan*.*.basicBitrate = 1Mbps
  116. **.wlan*.*.multicastBitrate = 54Mbps
  117. **.wlan*.*.controlBitrate = 1Mbps
  118. #for validation
  119. **.wlan*.mac.EDCA = false
  120. **.wlan*.mgmt.frameCapacity = 10
  121. **.wlan*.mac.maxQueueSize = 14
  122. **.wlan*.mac.rtsThresholdBytes = 3000B
  123. **.wlan*.mac.basicBitrate = 6Mbps # 24Mbps
  124. **.wlan*.mac.retryLimit = 7
  125. **.wlan*.mac.cwMinData = 31
  126. **.wlan*.mac.cwMinBroadcast = 31
  127. # channel physical parameters
  128. *.radioMedium.pMax = 2.0mW
  129. **.wlan*.radio.transmitterPower=2.0mW
  130. **.wlan*.radio.sensitivity=-90dBm
  131. **.wlan*.radio.receiver.errorModelType = "Ieee80211BerTableErrorModel"
  132. **.wlan*.radio.receiver.errorModel.berTableFile="../../files/per_table_80211g_Trivellato.dat"
  133. **.broadCastDelay=uniform(0s,0.005s)
  134. %#--------------------------------------------------------------------------------------------------------------
  135. %postrun-command: Rscript check.r
  136. %#--------------------------------------------------------------------------------------------------------------
  137. %file: check.r
  138. #!/usr/bin/env Rscript
  139. options(echo=FALSE)
  140. options(width=160)
  141. library("omnetpp", warn.conflicts=FALSE)
  142. #TEST parameters
  143. scafile <- 'results/General-#0.sca'
  144. linecount <- 1
  145. packets <- 10.0
  146. # begin TEST:
  147. dataset <- loadDataset(scafile)
  148. cat("\nOMNETPP TEST RESULT:\n")
  149. cat("\n MANETROUTING UDP TEST RESULT:\n")
  150. cat("\n CHECKS SENT PACKETS:\n")
  151. x <- dataset$scalars[dataset$scalars$name == "sentPk:count",]
  152. xx <- x[grep("\\.senderhost\\.udpApp\\[0\\]",x$module),]
  153. if(length(xx$value) != linecount)
  154. {
  155. cat(" LINECOUNT INCORRECT\n")
  156. print(xx)
  157. } else {
  158. cat(" LINECOUNT CORRECT\n")
  159. if(max(xx$value) != packets)
  160. {
  161. cat(" NUMBER OF PACKETS INCORRECT\n")
  162. print(xx)
  163. } else {
  164. cat(" NUMBER OF PACKETS CORRECT\n")
  165. }
  166. }
  167. cat("\n CHECKS RECEIVED PACKETS:\n")
  168. x <- dataset$scalars[dataset$scalars$name == "rcvdPk:count",]
  169. xx <- x[grep("\\.rcvrhost\\.udpApp\\[0\\]",x$module),]
  170. if(length(xx$value) != linecount)
  171. {
  172. cat(" LINECOUNT INCORRECT\n")
  173. print(xx)
  174. } else {
  175. cat(" LINECOUNT CORRECT\n")
  176. if(max(xx$value) < packets -1) # one packet different is acceptable.
  177. {
  178. cat(" NUMBER OF PACKETS INCORRECT\n")
  179. print(xx)
  180. } else {
  181. cat(" NUMBER OF PACKETS CORRECT\n")
  182. }
  183. }
  184. cat("\n")
  185. %#--------------------------------------------------------------------------------------------------------------
  186. %contains: postrun-command(1).out
  187. OMNETPP TEST RESULT:
  188. MANETROUTING UDP TEST RESULT:
  189. CHECKS SENT PACKETS:
  190. LINECOUNT CORRECT
  191. NUMBER OF PACKETS CORRECT
  192. CHECKS RECEIVED PACKETS:
  193. LINECOUNT CORRECT
  194. NUMBER OF PACKETS CORRECT
  195. %#--------------------------------------------------------------------------------------------------------------