Skip to content

Commit 2b66b60

Browse files
committed
Add tests for LEACH protocol
1 parent 67c97be commit 2b66b60

File tree

2 files changed

+111
-0
lines changed

2 files changed

+111
-0
lines changed

tests/fingerprint/examples.csv

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -332,6 +332,10 @@
332332
/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
333333
/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
334334

335+
/examples/manetrouting/leach/,-f omnetpp.ini -r 0, 100s, 9edc-0060/tplx,PASS,wireless adhoc Ipv4
336+
/examples/manetrouting/leach/,-f omnetpp.ini -c LeachPower -r 0, 100s, 4e95-15b7/tplx, PASS,wireless adhoc Ipv4
337+
/examples/manetrouting/leach/,-f omnetpp.ini -c LeachPathLoss -r 0,100s,ae17-5c6d/tplx, PASS,wireless adhoc Ipv4
338+
335339
# /examples/manetrouting/dymo/, -f omnetpp.ini -c _IPv4 -r 0 # abstract-config
336340
/examples/manetrouting/dymo/, -f omnetpp.ini -c IPv4 -r 0, 10s, 1a85-cb5d/tplx;dfe8-11b9/~tNl;483b-544e/tyf, PASS, wireless adhoc Ipv4
337341
# /examples/manetrouting/dymo/, -f omnetpp.ini -c _IPv6 -r 0 # abstract-config

tests/module/LeachSimpleTest.test

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
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

Comments
 (0)