Simple Module CSMAMacLayer

Package: org.mixim.modules.mac
File: modules/mac/CSMAMacLayer.ned

C++ definition

CSMA MAC protocol

CSMAMacLayer

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.

Extends:

BaseMacLayer (simple module)

Base module for every mac layer module

Used in compound modules:

If a module type shows up more than once, that means it has been defined in more than one NED file.

BaseNic (compound module)

This NIC implements an CSMA network interface card using the CSMAMacLayer module

PhyMacNic (compound module) (no description)
PhyMacNic (compound module) (no description)

Parameters:

Name Type Default value Description
notAffectedByHostState bool false
coreDebug bool

debug switch

headerLength double

length of the MAC packet header (in bits)

debug bool false

enable debugging for this module

slotDuration double

how long is a slot? [s]

difs double

maximum time between a packet and its ack [s]

maxTxAttempts double

maximum number of transmission attempts

queueLength int

length of the MAC queue

defaultChannel double

default channel

bitrate double

bit rate [bps]

txPower double

tx power [mW]

contentionWindow double

contention window

Properties:

Name Value Description
class CSMAMacLayer

Gates:

Name Direction Size Description
upperGateIn input

from upper layer

upperGateOut output

to uppe layer

upperControlIn input

control from upper layer

upperControlOut output

control to upper layer

lowerGateIn input

from lower layer

lowerGateOut output

to lower layer

lowerControlIn input

control from lower layer

lowerControlOut output

control to lower layer

Source code:

//
// CSMA MAC protocol
//
simple CSMAMacLayer extends BaseMacLayer
{
    parameters:
        @class(CSMAMacLayer);
        // enable debugging for this module
        bool debug = default(false);
        // how long is a slot? [s]
        double slotDuration @unit(s);
        // maximum time between a packet and its ack [s]
        double difs @unit(s);
        // maximum number of transmission attempts
        double maxTxAttempts;
        // length of the MAC queue
        int queueLength;
        // default channel 
        double defaultChannel;
        // bit rate [bps]
        double bitrate @unit(bps);
        //tx power [mW]
        double txPower @unit(mW);
        // contention window
        double contentionWindow;
}