Compound Module AlohaSnrNic

File: contrib/nic/AlohaSnrNic.ned

This is the easiest nic to implement "real" network behaviour. It uses the CsmaMacLayer and the SnrDecider and SnrEval modules.

The csma mac provides basic medium access and is used here to prevent a host from trying to send a message while it is still in receive mode.

The phy layer modules allow to account for collision and take fading into account so that messages can actually be lost.

IMPORTANT:
In order to work with the ChannelControl module the snrEval module has to be called "snrEval" in the ned file.

See also: BasicMacLayer, SnrDecider, SnrEval

Author: Daniel Willkomm

mac: AlohaMacLayer decider: SnrDecider snrEval: SnrEval radio: SingleChannelRadio

Usage diagram:

The following diagram shows usage relationships between modules, networks and channels. Unresolved module (and channel) types are missing from the diagram. Click here to see the full picture.

Contains the following modules:

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

AlohaMacLayer

Aloha MAC protocol

SingleChannelRadio (no description)
SnrDecider

Decider module to be used with SnrEval

SnrEval (no description)

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.

Host (no description)

Gates:

Name Direction Description
uppergateIn input

from upper layers

uppergateOut output

to upper layers

upperControlOut output

control connection

radioIn input

to receive AirFrames

Unassigned submodule parameters:

Name Type Description
mac.debug bool

debug switch

mac.headerLength numeric const

level at which we consider medium busy

mac.queueLength numeric const

length of the MAC queue

mac.bitrate numeric const

bit rate in bit/s

mac.defaultChannel numeric const

default channel

decider.debug bool

debug switch

decider.snrThresholdLevel numeric
snrEval.debug bool

debug switch

snrEval.publishRSSIAlways bool

if false, the RSSI will not be published during the reception of a frame

snrEval.transmitterPower numeric
snrEval.headerLength numeric const
snrEval.carrierFrequency numeric
snrEval.thermalNoise numeric
snrEval.pathLossAlpha numeric
snrEval.sensitivity numeric
radio.debug bool
radio.swSleep numeric const

time parameters, how long does it take to switch to sleep mode

radio.swSend numeric const

switch to send mode

radio.swRecv numeric const

switch to recv mode

Source code:

module AlohaSnrNic
    gates:
        in: uppergateIn; // from upper layers
        out: uppergateOut; // to upper layers
	out: upperControlOut; // control connection
	in: radioIn; // to receive AirFrames

    submodules:
        mac: AlohaMacLayer;
            display: "p=60,50;b=32,30;i=prot2";
        decider: SnrDecider;
            display: "p=68,100;b=16,16;i=box2_s;o=white";
        snrEval: SnrEval;
            display: "p=60,150;b=32,30;i=prot3";
	radio: SingleChannelRadio;
            display: "p=90,50;b=32,30;o=red";

    connections:
        radioIn --> snrEval.radioIn;
        decider.uppergateOut --> mac.lowergateIn display "m=m,50,50,75,0";
        snrEval.uppergateIn <-- mac.lowergateOut display "m=m,25,0,25,0";
        snrEval.uppergateOut --> decider.lowergateIn display "m=m,73,0,50,50";

	snrEval.upperControlOut --> mac.lowerControlIn;	
        mac.uppergateOut --> uppergateOut;

	mac.upperControlOut --> upperControlOut;
        mac.uppergateIn <-- uppergateIn;

endmodule