Network CSMAMac

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

This example shows how to use MiXiMs CSMA protocol implementation.

The network consists of a number of hosts which represent some kind of switches and a number of hosts which represent clients. At first they build up their routing tables by sending, forwarding (only switches), receiving and evaluating "Hello World" messages. After that phase the clients start randomly "jabbering" with other hosts and the switches only forward the "Jabber" messages to their destination.

The phy layer uses only "SimplePathlossModel" as AnalogueModel and "SNRThresholdDecider" as Decider.

The omnetpp.ini contains the following configurations:

BaseWorldUtility 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?

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.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.net.ip double
node.net.isSwitch bool
node.net.maxTtl double
node.net.boredTime double
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.headerLength int 0

defines the length of the phy header (/preamble)

node.nic.phy.usePropagationDelay bool

Should transmission delay be simulated?

node.nic.phy.thermalNoise double

the strength of the thermal noise [dBm]

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.decider xml

Specification of the decider to use and its 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.timeRXToTX double 0

switchTimes [s]:

node.nic.phy.timeRXToSleep double 0
node.nic.phy.timeTXToRX double 0
node.nic.phy.timeTXToSleep double 0
node.nic.phy.timeSleepToRX double 0
node.nic.phy.timeSleepToTX double 0
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.mac.notAffectedByHostState bool false
node.nic.mac.coreDebug bool

debug switch

node.nic.mac.headerLength double

length of the MAC packet header (in bits)

node.nic.mac.debug bool false

enable debugging for this module

node.nic.mac.slotDuration double

how long is a slot? [s]

node.nic.mac.difs double

maximum time between a packet and its ack [s]

node.nic.mac.maxTxAttempts double

maximum number of transmission attempts

node.nic.mac.queueLength int

length of the MAC queue

node.nic.mac.defaultChannel double

default channel

node.nic.mac.bitrate double

bit rate [bps]

node.nic.mac.txPower double

tx power [mW]

node.nic.mac.contentionWindow double

contention window

Source code:

//
//This example shows how to use MiXiMs CSMA protocol implementation.
//
//The network consists of a number of hosts which represent some kind of switches
//and a number of hosts which represent clients. At first they build up their
//routing tables by sending, forwarding (only switches), receiving and
//evaluating "Hello World" messages. After that phase the clients start randomly
//"jabbering" with other hosts and the switches only forward the "Jabber"
//messages to their destination.
//
//The phy layer uses only "SimplePathlossModel" as AnalogueModel and 
//"SNRThresholdDecider" as Decider.
//
//The omnetpp.ini contains the following configurations:
//
//- "General" 			- three clients in range of each other, no switch, no 
//						  propagation	delay
//- "WithoutPropDelay" 	- four clients and two switches whereas the switches are
//						  in range of each other and the clients are in range of at
//						  least one switch, no propagation delay
//- "WithPropDelay"		- same but with propagation delay
//- "CollissionMac"		- same configuration but the parameters for the CSMAMacLayer
//						  lead to more collisions
//- "Perftest"			- used with CmdEnv for performance testing (time limited)
//
network CSMAMac
{
    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: BaseWorldUtility {
            parameters:
                playgroundSizeX = playgroundSizeX;
                playgroundSizeY = playgroundSizeY;
                playgroundSizeZ = playgroundSizeZ;
                @display("p=100,0;i=misc/globe");

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

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

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

}