Based on Nic80211
Extends Nic80211 to use the Energy Framework to record battery consumption. The relevant changes for communicating with the Battery module are in PhyLayerBattery; core 80211 functionality is not changed.
parameters: note that the NIC module owns the hardware parameters to allow external access/alternate implementations.
The following diagram shows usage relationships between types. Unresolved types are missing from the diagram. Click here to see the full picture.
The following diagram shows inheritance relationships for this type. Unresolved types are missing from the diagram. Click here to see the full picture.
| Name | Type | Default value | Description |
|---|---|---|---|
| connectionManagerName | string | "" |
name of the ConnectionManager module |
| sleepCurrent | double | ||
| rxCurrent | double | ||
| decodingCurrentDelta | double | ||
| txCurrent | double | ||
| setupRxCurrent | double | ||
| setupTxCurrent | double | ||
| rxTxCurrent | double | ||
| txRxCurrent | double |
| Name | Value | Description |
|---|---|---|
| display | i=block/ifcard |
| Name | Direction | Size | Description |
|---|---|---|---|
| upperGateIn | input |
to upper layers |
|
| upperGateOut | output |
from upper layers |
|
| upperControlOut | output |
control information |
|
| upperControlIn | input |
control information |
|
| radioIn | input |
radioIn gate for sendDirect |
| Name | Type | Default value | Description |
|---|---|---|---|
| mac.notAffectedByHostState | bool | false | |
| mac.coreDebug | bool |
debug switch |
|
| mac.headerLength | double | 272bit |
length of the MAC packet header (in bits) |
| mac.debug | bool | false |
enable debugging for this module |
| mac.queueLength | int | 20 | |
| mac.rtsCtsThreshold | int | -1 |
Number of bits in a packet before RTS/CTS is used. Is currently not used. |
| mac.bitrate | double | 2E+6bps | |
| mac.autoBitrate | bool | false |
auto bit rate selection support: specify borders at which to change modulation. |
| mac.snr2Mbit | double | 1.46dB |
threshold to use 2Mbit (in dB) |
| mac.snr5Mbit | double | 2.6dB |
threshold to use 5.5Mbit (in dB) |
| mac.snr11Mbit | double | 5.68dB |
threshold to use 11Mbit (in dB) |
| mac.neighborhoodCacheSize | int | 30 |
keep information on neighborhood |
| mac.neighborhoodCacheMaxAge | double | 100s |
consider information in cache outdate if older than (in seconds) |
| mac.txPower | double | 110.11mW |
the power to transmit packets with [mW] |
| phy.coreDebug | bool |
debug switch for core framework |
|
| phy.recordStats | bool | false |
enable/disable tracking of statistics (eg. cOutvectors) |
| phy.usePropagationDelay | bool |
Should transmission delay be simulated? |
|
| phy.thermalNoise | double |
the strength of the thermal noise [dBm] |
|
| phy.useThermalNoise | bool |
should thermal noise be considered? |
|
| phy.analogueModels | xml |
Specification of the analogue models to use and their parameters |
|
| phy.decider | xml | xmldoc("Nic80211_Decider.xml") |
Specification of the decider to use and its parameters |
| phy.sensitivity | double | -119.5dBm |
The sensitivity of the physical layer [dBm] |
| phy.maxTXPower | double |
The maximum transimission power of the physical layer [mW] |
|
| phy.initialRadioState | int | 0 |
state the radio is initially in |
| phy.radioMinAtt | double | 1.0 |
radios gain factor (attenuation) while receiving |
| phy.radioMaxAtt | double | 0.0 |
radios gain factor (attenuation) while not receiving |
| phy.nbRadioChannels | int | 15 |
Number of available radio channels. Defaults to single channel radio. |
| phy.initialRadioChannel | int | 1 |
Initial radio channel. |
| 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) |
// // Based on Nic80211 // // Extends Nic80211 to use the Energy Framework to record battery // consumption. The relevant changes for communicating with the // Battery module are in PhyLayerBattery; core 80211 functionality // is not changed. // // parameters: note that the NIC module owns the hardware parameters // to allow external access/alternate implementations. // module Nic80211Battery like INic { parameters: string connectionManagerName = default(""); //name of the ConnectionManager module double sleepCurrent @unit(mA); double rxCurrent @unit(mA); double decodingCurrentDelta @unit(mA); double txCurrent @unit(mA); double setupRxCurrent @unit(mA); double setupTxCurrent @unit(mA); double rxTxCurrent @unit(mA); double txRxCurrent @unit(mA); @display("i=block/ifcard"); gates: input upperGateIn; // to upper layers output upperGateOut; // from upper layers output upperControlOut; // control information input upperControlIn; // control information input radioIn; // radioIn gate for sendDirect submodules: mac: Mac80211 { parameters: queueLength = default(20); bitrate = default(2E+6bps); autoBitrate = default(false); // values if no fading is modelled, gives at most 1% packet error rate snr2Mbit = default(1.46dB); snr5Mbit = default(2.6dB); snr11Mbit = default(5.68dB); neighborhoodCacheSize = default(30); neighborhoodCacheMaxAge = default(100s); txPower = default(110.11mW); @display("p=96,87;i=block/layer"); } phy: PhyLayerBattery { parameters: headerLength = 192bit; sensitivity = default(-119.5dBm); decider = default(xmldoc("Nic80211_Decider.xml")); initialRadioChannel = default(1); nbRadioChannels = default(15); //1 to 14, 0 is invalid //Mac80211 does not support switching times timeRXToTX = 0s; timeRXToSleep = 0s; timeTXToRX = 0s; timeTXToSleep = 0s; timeSleepToRX = 0s; timeSleepToTX = 0s; @display("p=106,157;i=block/process_s"); } connections: radioIn --> phy.radioIn; phy.upperGateIn <-- { @display("m=m,25,0,25,0"); } <-- mac.lowerGateOut; phy.upperGateOut --> { @display("m=m,73,0,50,50"); } --> mac.lowerGateIn; phy.upperControlOut --> mac.lowerControlIn; phy.upperControlIn <-- mac.lowerControlOut; mac.upperGateOut --> upperGateOut; mac.upperControlOut --> upperControlOut; mac.upperGateIn <-- upperGateIn; mac.upperControlIn <-- upperControlIn; }