Network ieee802154Narrow

Package: org.mixim.examples.ieee802154Narrow
File: examples/ieee802154Narrow/ieee802154Narrow.ned

This example shows how to use MiXiMs implementation of the ieee802154 narrow band protocol. It also provides an example on using the global blackboard provided by BaseWorldUtility.

The network consist of the "WorldUtilityStats" which extends from BaseWorldUtility to collect some global statistics as well as the usual ConnectionManager and a number of host. The hosts contain a special Traffic generation layer (also shows how to publish global statistics to the global blackboard) which lies directly above the NIC which moreover consist of the "csma"-mac layer module and the PhyLayer. The PhyLayer uses "Decider802154Narrow" as a decider.

There are three "Test"s which try to show the characteristics of the used csma mac layer. For each of these tests exists a "runTestX.sh" script as well as a "TestX.anf" file which execute the configurations necessary to produce the result-files for the according "*.anf" file. So you can take a look at the result of these tests by calling the "runTestX.sh" script and then opening the according "TestX.anf" file.


Test 1

This configuration produces the usage statistics of the channel for different parameters. Usage statistics means how much of the channels possible maximum capacity is used at which amount of generated traffic.

The results of this tests are visualized by "Test1.anf" and show plots of the generated traffic against the received traffic where both values are normalized against bitrate and simulation time. If everything was fine this should plot 5 lines which converge with different speeds to a channel usage of about 0.8 (depending on the used parameters). You also might see strange outliers in a few of these lines. These seem to be caused by wrong reading of the output scalars. The outliers are not present in the actual output scalars. You can read and plot the output scalars using matlab to verify this.


Test 2

These test configurations are meant to show the effect of MAC-ACKS on the usage of the channel with increasing distance between the hosts. Test2-C further shows the effect of the hidden station problem on CSMA.

The results can be visualized by "Test2.anf" and show plots of channel usage at different distances. The graph shows three lines plotting the channel usage against the distance between the nodes. You should see that channel usage begins to decrease rapidly around a distance of 170 metres. Whereas the run with MAC-Acks enabled should begin decreasing later than the run without. The third line shows the performance in the hidden station scenario. It should show a huge performance decrease at a distance around 120 metres. This is the point where the two senders are not in range of each other anymore and begin to interfere each others transmissions to the receiver.


Test 3

This tests is meant to show that CSMA uses exponential backoffs. This is done by increasing the number of hosts in the network exponentially. While the average backoff duration of each hosts should increase exponentially, the average number of backoffs should increase linearly.

The results of this tests are visualized by "Test3.anf". It should show four bar charts displaying the following parameters for each run.

WorldUtilityStats ConnectionManager PhyMacHost

Usage diagram:

The following diagram shows usage relationships between types. Unresolved types are missing from the diagram. Click here to see the full picture.

Inheritance diagram:

The following diagram shows inheritance relationships for this type. Unresolved types are missing from the diagram. Click here to see the full picture.

Parameters:

Name Type Default value Description
playgroundSizeX double

x size of the area the nodes are in (in meters)

playgroundSizeY double

y size of the area the nodes are in (in meters)

playgroundSizeZ double

z size of the area the nodes are in (in meters)

numHosts double

total number of hosts in the network

Properties:

Name Value Description
isNetwork
display bgb=$playgroundSizeX,$playgroundSizeY,white,,;bgp=10,50

Unassigned submodule parameters:

Name Type Default value Description
world.coreDebug bool

debug switch for the base framework

world.useTorus bool

use the playground as torus?

world.use2D bool

use a 2-dimensional world?

world.recordVectors bool false
world.bitrate double
world.bcTraffic bool true
connectionManager.coreDebug bool

debug switch for core framework

connectionManager.sendDirect bool

send directly to the node or create separate gates for every connection

connectionManager.pMax double

maximum sending power used for this network [mW]

connectionManager.sat double

minimum signal attenuation threshold [dBm]

connectionManager.alpha double

minimum path loss coefficient

connectionManager.carrierFrequency double

minimum carrier frequency of the channel [Hz]

connectionManager.drawMaxIntfDist bool false

should the maximum interference distance be displayed for each node?

node.batteryStats.debug bool

write per-activity and per-device statistics to omnetpp.sca (if false, only total energy and lifetime are written)

node.batteryStats.detail bool

subscribe to battery status and record time series data in omnetpp.vec (resolution depends on battery's publishDelta)

node.batteryStats.timeSeries bool
node.battery.debug bool
node.battery.nominal double

nominal battery capacity

node.battery.capacity double

battery capacity

node.battery.voltage double

nominal voltage

node.battery.resolution double

capacity is updated at least every resolution time

node.battery.publishDelta double

if > 0, capacity is published to the BB each publishTime interval

node.battery.publishTime double

number of modules that will draw energy from the battery

node.battery.numDevices int
node.utility.coreDebug bool

debug switch for the base framework

node.mobility.coreDebug bool

debug switch for the core framework

node.mobility.x double

x coordinate of the nodes' position (-1 = random)

node.mobility.y double

y coordinate of the nodes' position (-1 = random)

node.mobility.z double

z coordinate of the nodes' position (-1 = random)

node.arp.coreDebug bool

debug switch for the core framework

node.appl.packetTime double
node.appl.packetsPerPacketTime double
node.appl.debug bool

debug switch

node.appl.burstSize int 1
node.appl.packetLength int

length of the generated packet (in bits)

node.appl.destination int -1
node.nic.phy.coreDebug bool

debug switch for core framework

node.nic.phy.recordStats bool false

enable/disable tracking of statistics (eg. cOutvectors)

node.nic.phy.usePropagationDelay bool

Should transmission delay be simulated?

node.nic.phy.useThermalNoise bool

should thermal noise be considered?

node.nic.phy.analogueModels xml

Specification of the analogue models to use and their parameters

node.nic.phy.sensitivity double

The sensitivity of the physical layer [dBm]

node.nic.phy.maxTXPower double

The maximum transimission power of the physical layer [mW]

node.nic.phy.initialRadioState int 0

state the radio is initially in

node.nic.phy.radioMinAtt double 1.0

radios gain factor (attenuation) while receiving

node.nic.phy.radioMaxAtt double 0.0

radios gain factor (attenuation) while not receiving

node.nic.phy.nbRadioChannels int 1

Number of available radio channels. Defaults to single channel radio.

node.nic.phy.initialRadioChannel int 0

Initial radio channel.

node.nic.phy.numActivities int 5

the number of different power consuming activities the phy layer has change this parameter if your decider or physical layer uses more than the default 5 activities (sleep, rx, tx, switching, decoding)

node.nic.mac.notAffectedByHostState bool false
node.nic.mac.coreDebug bool

debug switch

node.nic.mac.debug bool false

debug switch

node.nic.mac.stats bool true
node.nic.mac.trace bool false
node.nic.mac.queueLength double 100

size of the MAC queue (maximum number of packets in Tx buffer)

node.nic.mac.txPower double 1 mW

tx power [mW]

node.nic.mac.useMACAcks bool true

Send/Expect MAC acks for unicast traffic?

node.nic.mac.macMaxFrameRetries double 3

maximum number of frame retransmission only used when usage of MAC acks is enabled

node.nic.mac.macMaxCSMABackoffs double 4

maximum backoffs

node.nic.mac.contentionWindow int 2

# of backoff periods of the initial contention window (for linear and constant backoff method only)

node.nic.mac.macMinBE double 3

minimum backoff exponent (for exponential backoff method only)

node.nic.mac.macMaxBE double 5

maximum backoff exponent (for exponential backoff method only)

Source code:

//
//This example shows how to use MiXiMs implementation of the ieee802154
//narrow band protocol. It also provides an example on using the global 
//blackboard provided by BaseWorldUtility.
//
//The network consist of the "WorldUtilityStats" which extends from 
//BaseWorldUtility to collect some global statistics as well as the 
//usual ConnectionManager and a number of host.
//The hosts contain a special Traffic generation layer (also shows how 
//to publish global statistics to the global blackboard) which lies 
//directly above the NIC which moreover consist of the "csma"-mac 
//layer module and the PhyLayer. The PhyLayer uses "Decider802154Narrow"
//as a decider.
//
//There are three "Test"s which try to show the characteristics of the
//used csma mac layer. For each of these tests exists a "runTestX.sh" 
//script as well as a "TestX.anf" file which execute the configurations 
//necessary to produce the result-files for the according "*.anf" file.
//So you can take a look at the result of these tests by calling the 
//"runTestX.sh" script and then opening the according "TestX.anf" file.
//
//------------------------------
//Test 1
//
//This configuration produces the usage statistics of the channel for 
//different parameters. Usage statistics means how much of the 
//channels possible maximum capacity is used at which amount of generated
//traffic.
//
//The results of this tests are visualized by "Test1.anf" and show plots 
//of the generated traffic against the received traffic where both values
//are normalized against bitrate and simulation time.
//If everything was fine this should plot 5 lines which converge with
//different speeds to a channel usage of about 0.8 (depending on the used 
//parameters).
//You also might see strange outliers in a few of these lines. These seem
//to be caused by wrong reading of the output scalars. The outliers are not
//present in the actual output scalars. You can read and plot the output 
//scalars using matlab to verify this.
//
//------------------------------
//Test 2
//
//These test configurations are meant to show the effect of MAC-ACKS on the
//usage of the channel with increasing distance between the hosts.
//Test2-C further shows the effect of the hidden station problem on CSMA.
//
//The results can be visualized by "Test2.anf" and show plots of channel 
//usage at different distances.
//The graph shows three lines plotting the channel usage against the distance
//between the nodes. You should see that channel usage begins to decrease
//rapidly around a distance of 170 metres. Whereas the run with MAC-Acks 
//enabled should begin decreasing later than the run without.
//The third line shows the performance in the hidden station scenario. It
//should show a huge performance decrease at a distance around 120 metres.
//This is the point where the two senders are not in range of each other
//anymore and begin to interfere each others transmissions to the receiver.
//
//-----------------------------
//Test 3
//
//This tests is meant to show that CSMA uses exponential backoffs. This is 
//done by increasing the number of hosts in the network exponentially.
//While the average backoff duration of each hosts should increase
//exponentially, the average number of backoffs should increase linearly.
//
//The results of this tests are visualized by "Test3.anf".
//It should show four bar charts displaying the following parameters for 
//each run.
//- Chart 1 - average number of transmitted frames per node.
//			  These bars should be between 5 and 10 frames per node.
//- Chart 2 - average number of backoffs per node.
//			  These bars should increase almost linear with each run. This results
//			  from the exponential backoffs.
//- Chart 3 - average time spent in backoff per node.
//			  These bars should increase exponential with each run.
//- Chart 4 - amount of nodes present.
//			  These bars should increase exponential 2, 4, 8, 16, 32, ...
//
network ieee802154Narrow
{
    parameters:
        double playgroundSizeX @unit(m); // x size of the area the nodes are in (in meters)
        double playgroundSizeY @unit(m); // y size of the area the nodes are in (in meters)
        double playgroundSizeZ @unit(m); // z size of the area the nodes are in (in meters)
        double numHosts; // total number of hosts in the network

        @display("bgb=$playgroundSizeX,$playgroundSizeY,white,,;bgp=10,50");
    submodules:
        world: WorldUtilityStats {
            parameters:
                playgroundSizeX = playgroundSizeX;
                playgroundSizeY = playgroundSizeY;
                playgroundSizeZ = playgroundSizeZ;
                @display("p=129,40;i=misc/globe");

        }
        connectionManager: ConnectionManager {
            parameters:
                @display("p=225,40;b=42,42,rect,yellow;i=abstract/multicast");

        }
        node[numHosts]: PhyMacHost {
            parameters:
                numHosts = numHosts;
                @display("p=75,130;b=42,42,rect,yellow;i=device/wifilaptop");

        }
    connections allowunconnected:
                         // all connections and gates are to be generated dynamically

}