|
| 1 | +%description: |
| 2 | +This example tests a simple run of the LEACH routing protocol |
| 3 | +on IEEE 802.15.4 standard with 100 nodes |
| 4 | +%#-------------------------------------------------------------------------------------------------------------- |
| 5 | +%file: test.ned |
| 6 | + |
| 7 | +import inet.networklayer.configurator.ipv4.Ipv4NetworkConfigurator; |
| 8 | +import inet.node.contract.INetworkNode; |
| 9 | +import inet.node.inet.SensorNode; |
| 10 | +import inet.physicallayer.wireless.common.contract.packetlevel.IRadioMedium; |
| 11 | +import inet.visualizer.contract.IIntegratedVisualizer; |
| 12 | +import inet.environment.common.PhysicalEnvironment; |
| 13 | + |
| 14 | +network SimpleNet |
| 15 | +{ |
| 16 | + parameters: |
| 17 | + int numNodes; |
| 18 | + @display("bgb=200.8119,200.0099;bgg=100,1,grey95"); |
| 19 | + @figure[title](type=label; pos=0,-1; anchor=sw; color=darkblue); |
| 20 | + |
| 21 | + submodules: |
| 22 | + configurator: Ipv4NetworkConfigurator { |
| 23 | + @display("p=512.39996,181.17"); |
| 24 | + } |
| 25 | + radioMedium: <default("UnitDiskRadioMedium")> like IRadioMedium { |
| 26 | + @display("p=512.39996,289.13998"); |
| 27 | + } |
| 28 | + physicalEnvironment: PhysicalEnvironment { |
| 29 | + @display("p=512.39996,441.02997"); |
| 30 | + } |
| 31 | + host[numNodes]: <default("WirelessHost")> like INetworkNode { |
| 32 | + @display("i=misc/sensor2"); |
| 33 | + } |
| 34 | + baseStation: <default("WirelessHost")> like INetworkNode { |
| 35 | + @display("p=50,50;i=misc/sensorgateway"); |
| 36 | + } |
| 37 | +} |
| 38 | + |
| 39 | +%#-------------------------------------------------------------------------------------------------------------- |
| 40 | +%inifile: omnetpp.ini |
| 41 | + |
| 42 | +[General] |
| 43 | +network = Leach |
| 44 | + |
| 45 | +num-rngs = 2 |
| 46 | +rng-class = omnetpp::cMersenneTwister |
| 47 | +seed-0-mt= 4900 # used for node layout generation |
| 48 | +seed-1-mt = 7 # used for threshold comparison |
| 49 | + |
| 50 | +**.arp.typename = "GlobalArp" |
| 51 | + |
| 52 | +*.radioMedium.typename = "Ieee802154NarrowbandScalarRadioMedium" |
| 53 | +*.radioMedium.backgroundNoise.power = -100dBm |
| 54 | +*.radioMedium.mediumLimitCache.centerFrequency = 2GHz |
| 55 | + |
| 56 | +*.host*.hasStatus = true |
| 57 | +*.visualizer.energyStorageVisualizer.displayEnergyStorages = true |
| 58 | + |
| 59 | +*.configurator.config = xmldoc ("address.xml") |
| 60 | + |
| 61 | +*.baseStation.typename = "LeachBS" |
| 62 | +*.host*.typename = "LeachNode" |
| 63 | +*.host*.LEACHnode.clusterHeadPercentage = 0.05 |
| 64 | +*.host*.LEACHnode.numNodes = 100 # set number of nodes to be injected into LEACH module |
| 65 | + |
| 66 | +*.numNodes = 100 #100 |
| 67 | +*.host*.mobility.typename = "StationaryMobility" |
| 68 | +*.host*.mobility.rng-0 = 0 # random number generator mapping |
| 69 | + |
| 70 | +*.host[*].mobility.initFromDisplayString = false |
| 71 | + |
| 72 | +**.constraintAreaMinX = 1m |
| 73 | +**.constraintAreaMaxX = 100m |
| 74 | +**.constraintAreaMinY = 1m |
| 75 | +**.constraintAreaMaxY = 100m |
| 76 | + |
| 77 | +*.host*.wlan[0].typename = "Ieee802154NarrowbandInterface" |
| 78 | +*.host*.wlan[0].radio.typename = "ApskScalarRadio" |
| 79 | +*.host*.wlan[0].radio.centerFrequency = 2.5GHz # based on TI CC2520 |
| 80 | +*.host*.wlan[0].radio.bandwidth = 2MHz |
| 81 | +*.host*.wlan[0].radio.transmitter.power = 60.5mW # determines communication range - based on CC2520 |
| 82 | +*.host*.wlan[0].radio.transmitter.preambleDuration = 192us # based on TI CC2520 |
| 83 | +*.host*.wlan[0].radio.transmitter.headerLength = 6B # based on TI CC2520 |
| 84 | +*.host*.wlan[0].radio.receiver.sensitivity = -98dBm # based on TI CC2520 |
| 85 | +*.host*.wlan[0].radio.receiver.energyDetection = -85dBm |
| 86 | +*.host*.wlan[0].radio.receiver.snirThreshold = 4dB |
| 87 | +*.host*.wlan[0].radio.displayCommunicationRange = true |
| 88 | + |
| 89 | + |
| 90 | +*.baseStation.wlan[0].typename = "Ieee802154NarrowbandInterface" |
| 91 | +*.baseStation.wlan[0].radio.typename = "ApskScalarRadio" |
| 92 | +*.baseStation.wlan[0].radio.centerFrequency = 2.5GHz |
| 93 | +*.baseStation.wlan[0].radio.bandwidth = 2MHz |
| 94 | +*.baseStation.wlan[0].radio.transmitter.power = 60.5mW |
| 95 | +*.baseStation.wlan[0].radio.transmitter.preambleDuration = 192us |
| 96 | +*.baseStation.wlan[0].radio.transmitter.headerLength = 6B |
| 97 | +*.baseStation.wlan[0].radio.receiver.sensitivity = -98dBm |
| 98 | +*.baseStation.wlan[0].radio.receiver.energyDetection = -85dBm |
| 99 | +*.baseStation.wlan[0].radio.receiver.snirThreshold = 4dB |
| 100 | +*.baseStation.wlan[0].radio.displayCommunicationRange = true |
| 101 | + |
| 102 | +*.host*.**.bitrate = 250kbps # based on TI CC2520 |
| 103 | +*.baseStation.**.bitrate = 250kbps |
| 104 | + |
| 105 | +%#-------------------------------------------------------------------------------------------------------------- |
| 106 | +%file-exists: results/General-#0.sca |
| 107 | + |
0 commit comments