Difference between revisions of "GSOC2015LrWpanMac"

From Nsnam
Jump to: navigation, search
(Weekly Progress)
Line 52: Line 52:
 
  * Define scope for future work. Optimizations. Buffer period.
 
  * Define scope for future work. Optimizations. Buffer period.
  
== Weekly Progress ==
+
== Energy Model ==
===Week 1===
+
[[File:LrWpan_Energy_Model.jpg]]
+
 
+
= Energy Model =
+
 
The energy model consists of 2 major components:
 
The energy model consists of 2 major components:
 
* Energy source.
 
* Energy source.
 
* Device energy model.
 
* Device energy model.
 
The Device energy model is used to represent the energy consumed by a specific device on a node (eg. a LrWpan radio device).
 
The Device energy model is used to represent the energy consumed by a specific device on a node (eg. a LrWpan radio device).
The LrWpanRadioEnergyModel (derived from DeviceEnergyModel class) will model the energy consumption due to the LrWpan radio device.
+
The LrWpanRadioEnergyModel class (derived from DeviceEnergyModel class) will model the energy consumption due to the LrWpan radio device.
  
== LrWpan Radio Energy Model ==
 
This class represents energy model for LrWpan radio devices with states:
 
* Idle
 
* TX
 
* RX
 
* Sleep
 
  
These states correspond to the PHY Emumerations defined in the LrWpanPhy class of ns-3 as follows:
+
[[File:LrWpanMac.jpg]]
* PHY_BUSY_RX : RX
+
 
* PHY_BUSY_TX : TX
+
 
* PHY_IDLE / PHY_RX_ON / PHY_TX_ON : Idle
+
== LrWpanRadioEnergyModel ==
* PHY_TRX_OFF : Sleep
+
The LrWpan radio transceiver exists in one of the following four states: Rx, Tx, Idle, Sleep
 +
 
 +
The amount of energy consumed by the radio depends on the current draw of the state and the amount of time the radio exists in that state. The current draw for various states can be found in the datasheets of radio transceivers. For example, for CC2420:
 +
* Power Down mode (Sleep): 20 uA
 +
* Idle mode: 426 uA
 +
* Receive mode: 18.8 mA
 +
* Transmit mode: 17.4 mA @ 0 dBm
 +
 
 +
The EnergySource is updated periodically or after each transition, using the formula ''stateDuration'' * ''stateCurrent'' * ''supplyVoltage''
 +
 
 +
'''Note:''' The transient energy when switching from one mode to another also impacts the total power consumption. To characterize the transition energy and time between the transceiver states, the "Transition" state needs to be included. Also, the energy consumption during CCA needs to be accounted for separately.
 +
 
 +
== Weekly Progress ==
 +
 
 +
===Week 1===
  
The following are the main functions to be implemented:
+
* Implemented and tested LrWpanRadioEnergyModel with the four basic states.
* '''SetEnergySource''' (This will be called by the LrWpanRadioEnergyModel helper class)
+
* Linked the LrWpanPhy with the LrWpanRadioEnergyModel and tested energy source update after each PHY transition.
* '''GetCurrent/SetCurrent''' functions to set current draw for different states (Sleep, Tx, Rx, etc.) and to represent the energy consumption behavior of a specific device. '''GetCurrent''' will be called by the EnergySource object.
+
Classes added/modified:
* '''ChangeState''' function to change current state - Sleep, Tx, Rx, Idle - and update remaining energy stored in the EnergySource object installed on the node (based on last state update time) - this function will be called by the LrWpanRadioEnergyModelPhyListener.
+
# LrWpanRadioEnergyModel
 +
# LrWpanPhyListener
 +
# LrWpanPhy
  
After each transition, the LrWpanRadioEnergyModel notifies the EnergySource object. The EnergySource object will query this model for the total current. Then the EnergySource object uses the total current to calculate energy.
+
Plan for Week 2
The energy source will be updated using the formula ''duration'' * ''prevStateCurrent'' * ''supplyVoltage'', where ''duration'' is the amount of time the radio was in the previous state and ''supplyVoltage'' is the EnergySource's supply voltage. (EnergySource's UpdateEnergySource function will be called by LrWpanRadioEnergyModel)
+
* Finalize the state machine and make necessary changes to the Phy and EnergyModel
 +
* Test and document
  
When energy is depleted, the LrWpanRadioEnergyModel object installed on the node will be informed by the EnergySource, using EnergyDepletionCallback (defined in LrWpanRadioEnergyModel).
 
  
 
= References =
 
= References =
Line 90: Line 96:
 
* The ContikiMAC Radio Duty Cycling Protocol [http://dunkels.com/adam/dunkels11contikimac.pdf]
 
* The ContikiMAC Radio Duty Cycling Protocol [http://dunkels.com/adam/dunkels11contikimac.pdf]
 
* An Energy Framework for the Network Simulator 3 (ns-3) [http://www.ee.washington.edu/research/nsl/papers/SIMUTools-11.pdf]
 
* An Energy Framework for the Network Simulator 3 (ns-3) [http://www.ee.washington.edu/research/nsl/papers/SIMUTools-11.pdf]
 +
* Energy efficiency of the IEEE 802.15.4 standard in dense wireless microsensor networks: modeling and improvement perspectives [http://ieeexplore.ieee.org/xpl/login.jsp?tp=&arnumber=1395555]

Revision as of 17:25, 30 May 2015

802.15.4 realistic MAC and Energy Model

  • Abstract: The IEEE 802.15.4 standard defines the physical and media access control layers for LR-WPANs (Low-Rate Wireless Personal Area Networks), and is one of the enabling technologies for Wireless Sensor Networks as well as the emerging Internet of Things applications. The ns-3 network simulator currently offers support for simulating LR-WPANs as specified by the IEEE standard 802.15.4 (2006). The current MAC implementation however, lacks sleep features. The radio is assumed to be always active, which is not true for nodes deployed in the field which usually employ some sort of sleep/wake mechanism in order to conserve energy. The goal of this project is therefore to develop a realistic MAC model and link it with the energy model in order to simulate realistic scenarios where a node’s energy can get depleted resulting in changes in the network topology. Most of WSN research is focused on developing energy efficient protocols at each level of the protocol stack and hence this project, along with allowing for more realistic simulations would also help researchers to test the energy efficiency of their protocols running on top of 802.15.4 nodes.
  • About me: I’m currently in the final year of B.E. (Electrical and Electronics) at BITS Pilani, India. My main research interest is in networked embedded systems, specifically WSNs and IoT.

Approach

Deliverables

  • 802.15.4 Energy Model:

Development of LrWpan Radio Energy model that models the energy consumption of 802.15.4 nodes.

  • 802.15.4 Phy layer support for duty cycling MAC protocols:

Modifications to the LrWpanPhy model in order to support linking with the LrWpan Radio Energy model.

  • RDC layer for the 802.15.4 MAC:

RDC layer for testing the newly developed Energy model - development of the ContikiMAC Radio Duty Cycling Protocol is planned.

  • Linking the RDC layer with the 802.15.4 Energy Model

Integration of the 802.15.4 Energy Model and the new 802.15.4 MAC Model.

Researchers can test their own protocols by developing their own models and linking with the developed 802.15.4 Energy Model.

Schedule

  • Week1
* Define the various classes. Implement the energy model.
  • Week2-3
* Modify the Phy model. Define and implement the PhyListener for the energy model. 
* Define the energy model test class for testing the energy model. Test and document.
  • Week4-5
* New Mac layer implementation.
  • Week6-7
* Thoroughly test the working of the newly developed MAC model and check the flow of outgoing and incoming packets. 
* Debug any issues that may arise. Document.
  • Week8-9
* Start development of the ContikiMAC model. 
* Test the working of ContikiMAC. Document.
  • Week10-11
* Integration of the energy module and the Mac module. Thoroughly test the basic implementation of ContikiMAC, along with the energy model. 
* Simulate, analyze, debug, document.
  • Week12
* Define scope for future work. Optimizations. Buffer period.

Energy Model

The energy model consists of 2 major components:

  • Energy source.
  • Device energy model.

The Device energy model is used to represent the energy consumed by a specific device on a node (eg. a LrWpan radio device). The LrWpanRadioEnergyModel class (derived from DeviceEnergyModel class) will model the energy consumption due to the LrWpan radio device.


LrWpanMac.jpg


LrWpanRadioEnergyModel

The LrWpan radio transceiver exists in one of the following four states: Rx, Tx, Idle, Sleep

The amount of energy consumed by the radio depends on the current draw of the state and the amount of time the radio exists in that state. The current draw for various states can be found in the datasheets of radio transceivers. For example, for CC2420:

  • Power Down mode (Sleep): 20 uA
  • Idle mode: 426 uA
  • Receive mode: 18.8 mA
  • Transmit mode: 17.4 mA @ 0 dBm

The EnergySource is updated periodically or after each transition, using the formula stateDuration * stateCurrent * supplyVoltage

Note: The transient energy when switching from one mode to another also impacts the total power consumption. To characterize the transition energy and time between the transceiver states, the "Transition" state needs to be included. Also, the energy consumption during CCA needs to be accounted for separately.

Weekly Progress

Week 1

  • Implemented and tested LrWpanRadioEnergyModel with the four basic states.
  • Linked the LrWpanPhy with the LrWpanRadioEnergyModel and tested energy source update after each PHY transition.

Classes added/modified:

  1. LrWpanRadioEnergyModel
  2. LrWpanPhyListener
  3. LrWpanPhy

Plan for Week 2

  • Finalize the state machine and make necessary changes to the Phy and EnergyModel
  • Test and document


References

  • Part 15.4: Wireless Medium Access Control (MAC) and Physical Layer (PHY) Specifications for Low-Rate Wireless Personal Area Networks (WPANs) [1]
  • The ContikiMAC Radio Duty Cycling Protocol [2]
  • An Energy Framework for the Network Simulator 3 (ns-3) [3]
  • Energy efficiency of the IEEE 802.15.4 standard in dense wireless microsensor networks: modeling and improvement perspectives [4]