AODVLifecycleTest.test 6.0 KB

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