AODVShortestPath.test 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. %description:
  2. In this example there are two possible routes between the sender and the receiver.
  3. This tests demonstrates that the AODV chooses the shortest path, that is, the route
  4. which has the lowest hop count.
  5. %#--------------------------------------------------------------------------------------------------------------
  6. %file: test.ned
  7. import inet.common.lifecycle.LifecycleController;
  8. import inet.networklayer.configurator.ipv4.IPv4NetworkConfigurator;
  9. import inet.networklayer.ipv4.RoutingTableRecorder;
  10. import inet.node.aodv.AODVRouter;
  11. import inet.physicallayer.idealradio.IdealRadioMedium;
  12. import inet.common.scenario.ScenarioManager;
  13. network AODVTest
  14. {
  15. parameters:
  16. @display("bgb=961,662");
  17. submodules:
  18. radioMedium: IdealRadioMedium {
  19. parameters:
  20. @display("p=50,50");
  21. }
  22. configurator: IPv4NetworkConfigurator {
  23. parameters:
  24. addDefaultRoutes = false;
  25. addStaticRoutes = false;
  26. addSubnetRoutes = false;
  27. config = xml("<config><interface hosts='*' address='145.236.x.x' netmask='255.255.0.0'/></config>");
  28. @display("p=50,100");
  29. }
  30. routingTableRecorder: RoutingTableRecorder {
  31. parameters:
  32. @display("p=50,150");
  33. }
  34. lifecycleController: LifecycleController {
  35. parameters:
  36. @display("p=50,200");
  37. }
  38. scenarioManager: ScenarioManager {
  39. parameters:
  40. script = default(xml("<scenario/>"));
  41. @display("p=50,250");
  42. }
  43. sender: AODVRouter {
  44. parameters:
  45. @display("i=device/pocketpc_s;r=,,#707070;p=283,63");
  46. }
  47. intermediateNodeA: AODVRouter {
  48. parameters:
  49. @display("i=device/pocketpc_s;r=,,#707070;p=203,206");
  50. }
  51. intermediateNodeB: AODVRouter {
  52. parameters:
  53. @display("i=device/pocketpc_s;r=,,#707070;p=385,256");
  54. }
  55. intermediateNodeC: AODVRouter {
  56. parameters:
  57. @display("i=device/pocketpc_s;r=,,#707070;p=292,325");
  58. }
  59. receiver: AODVRouter {
  60. parameters:
  61. @display("i=device/pocketpc_s;r=,,#707070;p=292,454");
  62. }
  63. connections allowunconnected:
  64. }
  65. %#--------------------------------------------------------------------------------------------------------------
  66. %inifile: omnetpp.ini
  67. [General]
  68. network = AODVTest
  69. record-eventlog = true
  70. tkenv-plugin-path = ../../../etc/plugins
  71. ned-path = .;../../../../src;../../lib
  72. num-rngs = 3
  73. sim-time-limit = 100s
  74. #omnetpp 5.0 - 5.1 compatibility:
  75. eventlog-file = "${resultdir}/${configname}-${runnumber}.elog"
  76. output-scalar-file = "${resultdir}/${configname}-${runnumber}.sca"
  77. output-vector-file = "${resultdir}/${configname}-${runnumber}.vec"
  78. snapshot-file = "${resultdir}/${configname}-${runnumber}.sna"
  79. **.mobility.rng-0 = 1
  80. **.wlan[*].mac.rng-0 = 2
  81. **.aodv.useHelloMessages = false
  82. *.sender.aodv.jitter = 1ms
  83. *.receiver.aodv.jitter = 2ms
  84. *.intermediateNodeA.aodv.jitter = 3ms
  85. *.intermediateNodeB.aodv.jitter = 4ms
  86. # mobility
  87. **.mobilityType = "StationaryMobility"
  88. **.mobility.constraintAreaMinZ = 0m
  89. **.mobility.constraintAreaMaxZ = 0m
  90. **.mobility.constraintAreaMinX = 0m
  91. **.mobility.constraintAreaMinY = 0m
  92. **.mobility.constraintAreaMaxX = 600m
  93. **.mobility.constraintAreaMaxY = 600m
  94. # ping app (host[0] pinged by others)
  95. **.sender.numPingApps = 1
  96. **.sender.pingApp[0].startTime = uniform(1s,5s)
  97. **.sender.pingApp[0].printPing = true
  98. **.sender.pingApp[0].destAddr = "receiver(ipv4)"
  99. # nic settings
  100. **.wlan[*].typename = "IdealWirelessNic"
  101. **.wlan[*].radio.transmitter.communicationRange = 240m
  102. **.wlan[*].bitrate = 2Mbps
  103. **.wlan[*].mac.address = "auto"
  104. **.wlan[*].mac.headerLength = 20B
  105. %#--------------------------------------------------------------------------------------------------------------
  106. %contains-regex: results/General-0.rt
  107. .*
  108. \+R \d+ 3\.1965\d+ 8 145\.236\.0\.2 145\.236\.0\.1 32 145\.236\.0\.1
  109. \+R \d+ 3\.1965\d+ 9 145\.236\.0\.3 145\.236\.0\.1 32 145\.236\.0\.1
  110. \+R \d+ 3\.1998\d+ 10 145\.236\.0\.4 145\.236\.0\.2 32 145\.236\.0\.2
  111. \+R \d+ 3\.1998\d+ 10 145\.236\.0\.4 145\.236\.0\.1 32 145\.236\.0\.2
  112. \+R \d+ 3\.1998\d+ 7 145\.236\.0\.1 145\.236\.0\.2 32 145\.236\.0\.2
  113. \+R \d+ 3\.1998\d+ 9 145\.236\.0\.3 145\.236\.0\.2 32 145\.236\.0\.2
  114. \+R \d+ 3\.2008\d+ 10 145\.236\.0\.4 145\.236\.0\.3 32 145\.236\.0\.3
  115. \+R \d+ 3\.2008\d+ 8 145\.236\.0\.2 145\.236\.0\.3 32 145\.236\.0\.3
  116. \+R \d+ 3\.2008\d+ 7 145\.236\.0\.1 145\.236\.0\.3 32 145\.236\.0\.3
  117. \+R \d+ 3\.2008\d+ 11 145\.236\.0\.5 145\.236\.0\.3 32 145\.236\.0\.3
  118. \+R \d+ 3\.2008\d+ 11 145\.236\.0\.5 145\.236\.0\.1 32 145\.236\.0\.3
  119. \+R \d+ 3\.2014\d+ 9 145\.236\.0\.3 145\.236\.0\.5 32 145\.236\.0\.5
  120. \+R \d+ 3\.2061\d+ 7 145\.236\.0\.1 145\.236\.0\.5 32 145\.236\.0\.3
  121. -R \d+ 21\.1998\d+ 10 145\.236\.0\.4 145\.236\.0\.2 32 145\.236\.0\.2
  122. -R \d+ 21\.1998\d+ 7 145\.236\.0\.1 145\.236\.0\.2 32 145\.236\.0\.2
  123. -R \d+ 21\.1998\d+ 9 145\.236\.0\.3 145\.236\.0\.2 32 145\.236\.0\.2
  124. -R \d+ 21\.2008\d+ 10 145\.236\.0\.4 145\.236\.0\.3 32 145\.236\.0\.3
  125. -R \d+ 21\.2008\d+ 8 145\.236\.0\.2 145\.236\.0\.3 32 145\.236\.0\.3
  126. -R \d+ 23\.6398\d+ 10 145\.236\.0\.4 145\.236\.0\.1 32 145\.236\.0\.2
  127. -R \d+ 23\.7165\d+ 8 145\.236\.0\.2 145\.236\.0\.1 32 145\.236\.0\.1
  128. %#--------------------------------------------------------------------------------------------------------------
  129. %not-contains: stdout
  130. undisposed object:
  131. %not-contains: stdout
  132. -- check module destructor
  133. %#--------------------------------------------------------------------------------------------------------------