manetrouting_transmit1.test 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242
  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 = 1
  68. **.constraintAreaMinX = 0m
  69. **.constraintAreaMinY = 0m
  70. **.constraintAreaMinZ = 0m
  71. **.constraintAreaMaxX = 1000m
  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. ######################################################################
  108. # manet routing
  109. **.routingProtocol = "AODVUU"
  110. #######################################################
  111. # nic settings
  112. **.wlan*.*.dataBitrate = 54Mbps
  113. **.wlan*.*.mgmtBitrate = 54Mbps
  114. **.wlan*.*.multicastBitrate = 54Mbps
  115. **.wlan*.*.controlBitrate = 54Mbps
  116. **.wlan*.mac.EDCA = false
  117. **.wlan*.mgmt.frameCapacity = 10
  118. **.wlan*.mac.maxQueueSize = 14
  119. **.wlan*.mac.rtsThresholdBytes = 3000B
  120. **.wlan*.mac.basicBitrate = 6Mbps # 24Mbps
  121. **.wlan*.mac.retryLimit = 7
  122. **.wlan*.mac.cwMinData = 31
  123. **.wlan*.mac.cwMinBroadcast = 31
  124. # channel physical parameters
  125. *.radioMedium.pMax = 2.0mW
  126. **.wlan*.radio.transmitterPower=2.0mW
  127. **.wlan*.radio.sensitivity=-90dBm
  128. **.wlan*.radio.receiver.errorModelType = "Ieee80211BerTableErrorModel"
  129. **.wlan*.radio.receiver.errorModel.berTableFile="../../files/per_table_80211g_Trivellato.dat"
  130. **.broadCastDelay=uniform(0s,0.005s)
  131. %#--------------------------------------------------------------------------------------------------------------
  132. %postrun-command: Rscript check.r
  133. %#--------------------------------------------------------------------------------------------------------------
  134. %file: check.r
  135. #!/usr/bin/env Rscript
  136. options(echo=FALSE)
  137. options(width=160)
  138. library("omnetpp", warn.conflicts=FALSE)
  139. #TEST parameters
  140. scafile <- 'results/General-#0.sca'
  141. linecount <- 1
  142. packets <- 10.0
  143. # begin TEST:
  144. dataset <- loadDataset(scafile)
  145. cat("\nOMNETPP TEST RESULT:\n")
  146. cat("\n MANETROUTING UDP TEST RESULT:\n")
  147. cat("\n CHECKS SENT PACKETS:\n")
  148. x <- dataset$scalars[dataset$scalars$name == "sentPk:count",]
  149. xx <- x[grep("\\.senderhost\\.udpApp\\[0\\]",x$module),]
  150. if(length(xx$value) != linecount)
  151. {
  152. cat(" LINECOUNT INCORRECT\n")
  153. print(xx)
  154. } else {
  155. cat(" LINECOUNT CORRECT\n")
  156. if(max(xx$value) != packets)
  157. {
  158. cat(" NUMBER OF PACKETS INCORRECT\n")
  159. print(xx)
  160. } else {
  161. cat(" NUMBER OF PACKETS CORRECT\n")
  162. }
  163. }
  164. cat("\n CHECKS RECEIVED PACKETS:\n")
  165. x <- dataset$scalars[dataset$scalars$name == "rcvdPk:count",]
  166. xx <- x[grep("\\.rcvrhost\\.udpApp\\[0\\]",x$module),]
  167. if(length(xx$value) != linecount)
  168. {
  169. cat(" LINECOUNT INCORRECT\n")
  170. print(xx)
  171. } else {
  172. cat(" LINECOUNT CORRECT\n")
  173. if(max(xx$value) < packets -1) # one packet different is acceptable.
  174. {
  175. cat(" NUMBER OF PACKETS INCORRECT\n")
  176. print(xx)
  177. } else {
  178. cat(" NUMBER OF PACKETS CORRECT\n")
  179. }
  180. }
  181. cat("\n")
  182. %#--------------------------------------------------------------------------------------------------------------
  183. %contains: postrun-command(1).out
  184. OMNETPP TEST RESULT:
  185. MANETROUTING UDP TEST RESULT:
  186. CHECKS SENT PACKETS:
  187. LINECOUNT CORRECT
  188. NUMBER OF PACKETS CORRECT
  189. CHECKS RECEIVED PACKETS:
  190. LINECOUNT CORRECT
  191. NUMBER OF PACKETS CORRECT
  192. %#--------------------------------------------------------------------------------------------------------------