Skip to content

Commit

Permalink
Add tests for LEACH protocol
Browse files Browse the repository at this point in the history
  • Loading branch information
n-jay committed Dec 6, 2023
1 parent 67c97be commit 2b66b60
Show file tree
Hide file tree
Showing 2 changed files with 111 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tests/fingerprint/examples.csv
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,10 @@
/examples/manetrouting/dsdv/, -f omnetpp.ini -c MultiIPv4 -r 0, 10s, 94c8-51dd/tplx;e9e8-7d0b/~tNl;e9f0-b256/~tND;e86f-d3fa/tyf, PASS, wireless adhoc Ipv4
/examples/manetrouting/dsdv/, -f omnetpp.ini -c DynamicIPv4 -r 0, 22s, 6699-04d7/tplx;3e2c-1eee/~tNl;eecc-7593/~tND;90d2-3ffa/tyf, PASS, wireless adhoc Ipv4

/examples/manetrouting/leach/,-f omnetpp.ini -r 0, 100s, 9edc-0060/tplx,PASS,wireless adhoc Ipv4
/examples/manetrouting/leach/,-f omnetpp.ini -c LeachPower -r 0, 100s, 4e95-15b7/tplx, PASS,wireless adhoc Ipv4
/examples/manetrouting/leach/,-f omnetpp.ini -c LeachPathLoss -r 0,100s,ae17-5c6d/tplx, PASS,wireless adhoc Ipv4

# /examples/manetrouting/dymo/, -f omnetpp.ini -c _IPv4 -r 0 # abstract-config
/examples/manetrouting/dymo/, -f omnetpp.ini -c IPv4 -r 0, 10s, 1a85-cb5d/tplx;dfe8-11b9/~tNl;483b-544e/tyf, PASS, wireless adhoc Ipv4
# /examples/manetrouting/dymo/, -f omnetpp.ini -c _IPv6 -r 0 # abstract-config
Expand Down
107 changes: 107 additions & 0 deletions tests/module/LeachSimpleTest.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
%description:
This example tests a simple run of the LEACH routing protocol
on IEEE 802.15.4 standard with 100 nodes
%#--------------------------------------------------------------------------------------------------------------
%file: test.ned

import inet.networklayer.configurator.ipv4.Ipv4NetworkConfigurator;
import inet.node.contract.INetworkNode;
import inet.node.inet.SensorNode;
import inet.physicallayer.wireless.common.contract.packetlevel.IRadioMedium;
import inet.visualizer.contract.IIntegratedVisualizer;
import inet.environment.common.PhysicalEnvironment;

network SimpleNet
{
parameters:
int numNodes;
@display("bgb=200.8119,200.0099;bgg=100,1,grey95");
@figure[title](type=label; pos=0,-1; anchor=sw; color=darkblue);

submodules:
configurator: Ipv4NetworkConfigurator {
@display("p=512.39996,181.17");
}
radioMedium: <default("UnitDiskRadioMedium")> like IRadioMedium {
@display("p=512.39996,289.13998");
}
physicalEnvironment: PhysicalEnvironment {
@display("p=512.39996,441.02997");
}
host[numNodes]: <default("WirelessHost")> like INetworkNode {
@display("i=misc/sensor2");
}
baseStation: <default("WirelessHost")> like INetworkNode {
@display("p=50,50;i=misc/sensorgateway");
}
}

%#--------------------------------------------------------------------------------------------------------------
%inifile: omnetpp.ini

[General]
network = Leach

num-rngs = 2
rng-class = omnetpp::cMersenneTwister
seed-0-mt= 4900 # used for node layout generation
seed-1-mt = 7 # used for threshold comparison

**.arp.typename = "GlobalArp"

*.radioMedium.typename = "Ieee802154NarrowbandScalarRadioMedium"
*.radioMedium.backgroundNoise.power = -100dBm
*.radioMedium.mediumLimitCache.centerFrequency = 2GHz

*.host*.hasStatus = true
*.visualizer.energyStorageVisualizer.displayEnergyStorages = true

*.configurator.config = xmldoc ("address.xml")

*.baseStation.typename = "LeachBS"
*.host*.typename = "LeachNode"
*.host*.LEACHnode.clusterHeadPercentage = 0.05
*.host*.LEACHnode.numNodes = 100 # set number of nodes to be injected into LEACH module

*.numNodes = 100 #100
*.host*.mobility.typename = "StationaryMobility"
*.host*.mobility.rng-0 = 0 # random number generator mapping

*.host[*].mobility.initFromDisplayString = false

**.constraintAreaMinX = 1m
**.constraintAreaMaxX = 100m
**.constraintAreaMinY = 1m
**.constraintAreaMaxY = 100m

*.host*.wlan[0].typename = "Ieee802154NarrowbandInterface"
*.host*.wlan[0].radio.typename = "ApskScalarRadio"
*.host*.wlan[0].radio.centerFrequency = 2.5GHz # based on TI CC2520
*.host*.wlan[0].radio.bandwidth = 2MHz
*.host*.wlan[0].radio.transmitter.power = 60.5mW # determines communication range - based on CC2520
*.host*.wlan[0].radio.transmitter.preambleDuration = 192us # based on TI CC2520
*.host*.wlan[0].radio.transmitter.headerLength = 6B # based on TI CC2520
*.host*.wlan[0].radio.receiver.sensitivity = -98dBm # based on TI CC2520
*.host*.wlan[0].radio.receiver.energyDetection = -85dBm
*.host*.wlan[0].radio.receiver.snirThreshold = 4dB
*.host*.wlan[0].radio.displayCommunicationRange = true


*.baseStation.wlan[0].typename = "Ieee802154NarrowbandInterface"
*.baseStation.wlan[0].radio.typename = "ApskScalarRadio"
*.baseStation.wlan[0].radio.centerFrequency = 2.5GHz
*.baseStation.wlan[0].radio.bandwidth = 2MHz
*.baseStation.wlan[0].radio.transmitter.power = 60.5mW
*.baseStation.wlan[0].radio.transmitter.preambleDuration = 192us
*.baseStation.wlan[0].radio.transmitter.headerLength = 6B
*.baseStation.wlan[0].radio.receiver.sensitivity = -98dBm
*.baseStation.wlan[0].radio.receiver.energyDetection = -85dBm
*.baseStation.wlan[0].radio.receiver.snirThreshold = 4dB
*.baseStation.wlan[0].radio.displayCommunicationRange = true

*.host*.**.bitrate = 250kbps # based on TI CC2520
*.baseStation.**.bitrate = 250kbps

%#--------------------------------------------------------------------------------------------------------------
%file-exists: results/General-#0.sca

0 comments on commit 2b66b60

Please sign in to comment.