omnetpp.ini.commented 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315
  1. ######################################################################################################
  2. [Config Wireless01]
  3. description = Two hosts communicating wirelessly
  4. network = WirelessA
  5. # At this point you should take a look at the NED files corresponding to this Ini file.
  6. # They are rather simple. The only interesting thing is that they are using parametrized types
  7. # (i.e. like) so we will be able to change the type of the different modules from the Ini file.
  8. # This allows us go through the tutorial only by changing parameter values in this file.
  9. # Limit the simulation to 25s
  10. sim-time-limit = 25s
  11. # Now we are ready to jump into the tutorial
  12. # Let's configure ARP
  13. # ARP in the real world is used to figure out the MAC address of a node from its IPv4 address.
  14. # We do not want to use it in this wireless tutorial as it just adds some uninteresting
  15. # message exchanges before the real communication between the nodes can start. We will use
  16. # the GlobalARP module instead that can automatically provide all the MAC-IP assocoations
  17. # for the nodes out of band.
  18. **.arpType = "GlobalARP"
  19. # Configure an aplication for hostA that sends a constant
  20. # UDP traffic around 800Kbps (+ protocol overhead)
  21. *.hostA.numUdpApps = 1
  22. *.hostA.udpApp[0].typename = "UDPBasicApp"
  23. *.hostA.udpApp[0].destAddresses = "hostB"
  24. *.hostA.udpApp[0].destPort = 5000
  25. *.hostA.udpApp[0].messageLength = 1000B
  26. *.hostA.udpApp[0].sendInterval = exponential(10ms)
  27. # Configure an app that receives the USP traffic (and simply drops the data)
  28. *.hostB.numUdpApps = 1
  29. *.hostB.udpApp[0].typename = "UDPSink"
  30. *.hostB.udpApp[0].localPort = 5000
  31. # Configure the hosts to have a single "ideal" wireless NIC. An IdealWirelessNic
  32. # can be configured with a maximum communication range. All packets withing range
  33. # are always received successfully while out of range messages are never received.
  34. # This is useful if we are not interested how the actual messages get to their destination,
  35. # we just want to be sure that they get there once the nodes are in range.
  36. *.host*.wlan[*].typename = "IdealWirelessNic"
  37. # All radios and MACs should run on 1Mbps in our examples
  38. **.bitrate = 1Mbps
  39. # Mandatory physical layer parameters
  40. *.host*.wlan[*].radio.transmitter.maxCommunicationRange = 500m
  41. # Simplify the IdealWirelessNic even further. We do not care even if there are
  42. # transmission collisions. Any number of nodes in range can transmit at the same time
  43. # and the packets will be still successfully delivered.
  44. *.host*.wlan[*].radio.receiver.ignoreInterference = true
  45. # Result: HostA can send data to hostB using almost the whole 1Mbps bandwidth.
  46. ######################################################################################################
  47. [Config Wireless02]
  48. description = Setting up some animations
  49. extends = Wireless01
  50. # Allow the medium to animate the transmissions using the OMNeT++ Canvas API
  51. # (We no longer need the default message animation so let's turn it off manually
  52. # in the Tkenv's animation settings dialog.)
  53. *.visualizer.mediumVisualizer.displaySignals = true
  54. # To have a bit more smoother animation, turn on periodic self messages
  55. # from the medium. This will generate canvas updates to animate the
  56. # transmission animation. Instead of seeing only important events, we will see
  57. # how the transmission propagates through space.
  58. *.visualizer.mediumVisualizer.signalPropagationUpdateInterval = 100ns
  59. # Allow the medium to draw a fading trail of successful transmissions (will show the communication paths).
  60. *.visualizer.mediumVisualizer.displayCommunicationTrail = true
  61. # Result: We can see nice expanding bubbles representing the transmissions.
  62. ######################################################################################################
  63. [Config Wireless03]
  64. description = Adding more nodes and decreasing the communication range
  65. extends = Wireless02
  66. network = WirelessB
  67. # Decrease the communication range so hostA and hostB can no longer
  68. # communicate directly.
  69. *.host*.wlan[*].radio.transmitter.maxCommunicationRange = 250m
  70. # Result: With decreased communication range, hostA and hostB can no longer talk to each other directly.
  71. # Unfortunately the extra nodes we have added to relay the information are not properly configured for
  72. # routing.
  73. ######################################################################################################
  74. [Config Wireless04]
  75. description = Setting up static routing
  76. extends = Wireless03
  77. # Enable static routing
  78. *.host*.forwarding = true
  79. # To have proper communication, we have to add static route entries in all hosts.
  80. # It is too much work to do it manually so we instruct the network configurator
  81. # to use the estimated error rate between the nodes to set up static routes.
  82. # Nodes out of range will have an error rate of 1 while nodes within range
  83. # will have configurator.minLinkWeight error rate (by default it is 1e-3)
  84. # when using the IdealRadio. This will generate a properly configured IPv4 network
  85. # without any additional manual configuration.
  86. *.configurator.config = xml("<config><interface hosts='**' address='10.0.0.x' netmask='255.255.255.0'/><autoroute metric='errorRate'/></config>")
  87. # By disabling the routing table entry optimization we will have a separate entry for
  88. # each destination host. The routing tables will be longer, but they are much easier to
  89. # understand.
  90. *.configurator.optimizeRoutes = false
  91. # Disable routing table entries generated from the netmask (will disable default routes too.)
  92. **.routingTable.netmaskRoutes = ""
  93. # Enable route visualization
  94. *.visualizer.routeVisualizer.packetNameFilter = "UDPBasicAppData-*"
  95. # Result: Data is now correctly routed by the R1 node. In reality we would expect that
  96. # the throughput between the hosts drops becuase two nodes (hostA and hostR1) are using
  97. # the medium at the same time with a datarate that is around the capacity of the medium.
  98. # The simulation does not show this, because we have disabled the handling of the radio
  99. # interference in step 1 (ignoreInterference = true)
  100. ######################################################################################################
  101. [Config Wireless05]
  102. description = Taking interference into account
  103. extends = Wireless04
  104. # In this step we will try to more accurately model the communication by taking into account
  105. # the interference betweeen transmissions at the radio receiver.
  106. *.host*.wlan[*].radio.receiver.ignoreInterference = false
  107. # Let's make the interference range the double of the communication range.
  108. *.host*.wlan[*].radio.transmitter.maxInterferenceRange = 500m
  109. # Result: This change resulted in an almost constant collision at hostB becuase both hostA and hostR1 is
  110. # transmitting at almost the capacity of the medium. The only packets that get through are
  111. # the ones that are sent from hostR1 to hostB while the hostA happens not to transmit by chance.
  112. # Because of this, we are seeing and extremely low throughput. HostA and hostR1 should use some
  113. # form of media access so they could minimize the interference.
  114. ######################################################################################################
  115. [Config Wireless06]
  116. description = Using CSMA to better utilize the medium
  117. extends = Wireless05
  118. # We will use CSMA for the MAC so transmitters will sniff into the medium and will not
  119. # transmit if there is an ongoing transmission in their interference range.
  120. # Let's switch the NIC to WirlessNic (from IdealWireless).
  121. *.host*.wlan[*].typename = "WirelessNic"
  122. # Still using IdealRadio. We have to set this, because the default radio for WirelessNic is Ieee80211.
  123. *.host*.wlan[*].radioType = "IdealRadio"
  124. # The MAC protocol is now CSMA
  125. *.host*.wlan[*].macType = "CSMA"
  126. # No ACKs for now
  127. *.host*.wlan[*].mac.useMACAcks = false
  128. # Result: After CSMA was configured, we should see an increased throughput (compared to the previous step
  129. # where the medium was not checked before transmission)
  130. ######################################################################################################
  131. [Config Wireless07]
  132. description = Turning on ACKs in CSMA
  133. extends = Wireless06
  134. # We need MAC acknowledgements to detect if a link is broken between two nodes
  135. *.host*.wlan[*].mac.useMACAcks = true
  136. # Result: About the same number of packets go through, but the the link lsyer is now reliable
  137. # (packets arriving at hostB are of consecutive sequence numbers)
  138. ######################################################################################################
  139. [Config Wireless08]
  140. description = Configuring node movements
  141. extends = Wireless07
  142. # Turn bubble off, we don't need them anymore
  143. *.visualizer.mediumVisualizer.displaySignals = false
  144. # Configure the relay nodes (R1-3) to move straight north during the simulation
  145. # TIP: run the simulation in Fast mode to see some screen updates
  146. *.hostR*.mobilityType = "LinearMobility"
  147. *.hostR*.mobility.speed = 12mps
  148. *.hostR*.mobility.angle = 270deg
  149. # Result: we are seeig lower throughput than previously. This is because the
  150. # static routing tables were configured based on the topology (node distances) at
  151. # the beginning of the simulation. Data was routed from A to B through the R1 node.
  152. # Unfortunately R1 node gets out of range around 13s and after that time the original
  153. # route is no longer usable. We could use A->R2->R3->B after this point, but that would
  154. # require an active protocol that reconfigures routing tables in response to the
  155. # lost connectivity.
  156. ######################################################################################################
  157. [Config Wireless09]
  158. description = Configuring ad-hoc routing (AODV)
  159. extends = Wireless08
  160. # Turn off the static configuration added by the IPv4NetworkConfigurator so it will not interfere
  161. # with the dynamic routing protocol. We are only assigning IP addresses now
  162. *.configurator.addStaticRoutes = false
  163. *.configurator.addDefaultRoutes = false
  164. *.configurator.addSubnetRoutes = false
  165. # Let's use AODV by using AODVRouters in the network. See Wireless07
  166. # While running the simulation we see that the communication is broken areound 13s
  167. # and AODV re-establishes the routes through A->R2->R3->B around 16s
  168. *.hostType = "AODVRouter"
  169. # Result: The MANET routing protocol now dynamically reconfigures the routes so data keeps flowing
  170. # even after some nodes get out of range.
  171. ######################################################################################################
  172. [Config Wireless10]
  173. description = Modeling energy consumption
  174. extends = Wireless09
  175. # Set up a model for the energy consumption of the nodes
  176. **.energyConsumerType = "StateBasedEnergyConsumer"
  177. # Configure an energy storage device (inifite energy). We are not interested
  178. # in the actual storage behavior.
  179. *.host*.energyStorageType = "IdealEnergyStorage"
  180. # Result: We can check the energy use of a module by looking at the energyBalance value in the module
  181. # (hostA.energyStorage.energyBalance) or it is possible to see the energy use
  182. # over time by displaying the residualCapacity signal.
  183. ######################################################################################################
  184. [Config Wireless11]
  185. description = Adding obstacles to the environment
  186. extends = Wireless10
  187. network = WirelessC
  188. ### XXX because of an incorrect default we should configure an empty object cache for an infinite space environment
  189. # We would not need this if we would limit the size of the play ground.
  190. # (once this is fixed in INET the below line can be removed)
  191. *.physicalEnvironment.objectCacheType = ""
  192. # Configure the physical environment to contain a single brick wall
  193. *.physicalEnvironment.config = xmldoc("walls.xml")
  194. # Set up how the loss is calculated (using line of sight tracing)
  195. *.radioMedium.obstacleLossType = "TracingObstacleLoss"
  196. # Result: Unfortunately we don't see any difference. :( Our radio model is too simple to take into account
  197. # the objects in the environment so we have to set up a more accurate model.
  198. ######################################################################################################
  199. [Config Wireless12]
  200. description = Changing to a more realistic radio model
  201. extends = Wireless11
  202. # We switch to a more detailed radio model so we have to replace the global radioMedium module, too
  203. *.mediumType = "APSKScalarRadioMedium"
  204. # Configure the background noise for the medium
  205. *.radioMedium.backgroundNoise.power = -110dBm
  206. ### FIXME: In best case this should not be provided by the user, but the medium should calculate this automatically from the radio frequency.
  207. # In INET 3.0 this must be manually configured.
  208. *.radioMedium.mediumLimitCache.carrierFrequency = 2GHz
  209. # Configure each radio (transmitter/receiver) in the model.
  210. # We need a lot more parameters to set up the radio.
  211. *.host*.wlan[*].radioType = "APSKScalarRadio"
  212. *.host*.wlan[*].radio.carrierFrequency = 2GHz
  213. *.host*.wlan[*].radio.bandwidth = 2MHz
  214. *.host*.wlan[*].radio.transmitter.power = 1.2mW
  215. *.host*.wlan[*].radio.transmitter.preambleDuration = 0s
  216. *.host*.wlan[*].radio.transmitter.headerBitLength = 100b
  217. *.host*.wlan[*].radio.receiver.sensitivity = -85dBm
  218. *.host*.wlan[*].radio.receiver.energyDetection = -85dBm
  219. *.host*.wlan[*].radio.receiver.snirThreshold = 4dB
  220. # Result: The simulation is now able to calculate with the attenutation of the
  221. # different physical objects in the environment. We see that the wall is actually blocking the
  222. # transmission sometimes.
  223. ######################################################################################################
  224. [Config Wireless13]
  225. description = Configuring a more accurate pathloss model
  226. extends = Wireless12
  227. # To make our model even more accurate, let's configure the pathloss model, too.
  228. # By default the medium uses the free space model. We will use the TwoRayGroundReflection
  229. # model here (assuming the we are walking on the ground).
  230. # At this point we could also configure the computation model for the medium (scalar,
  231. # multidimensional) the propagation mode (constant speed, constant time) etc.
  232. # (see the radioMedium's parameters for further detail.)
  233. *.radioMedium.pathLossType = "TwoRayGroundReflection"
  234. *.radioMedium.pathLoss.transmitterAntennaHeight = 1.5m
  235. *.radioMedium.pathLoss.receiverAntennaHeight = 1.5m
  236. # Result: We see that with a better propagation model the communication pattern changes considerably
  237. # as the reception power is much smaller than with the free space model. (Experiment with different
  238. # height values between 1m and 2m. and see the differences!)
  239. ######################################################################################################
  240. [Config Wireless14]
  241. description = Introducing antenna gain
  242. extends = Wireless13
  243. # Let's install a better antenna to extend the range of the nodes and increase the connectivity.
  244. *.host*.wlan[*].radio.antennaType = "ConstantGainAntenna"
  245. *.host*.wlan[*].radio.antenna.gain = 12dB
  246. # Results: We have much better connectivity this time because of the antenna gain. Some transmissions
  247. # even geth through the wall. The connectivity grap is almost a full graph at the end of the simulation.