Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(1002)

Issue 57210044: Add support for Wifi SLEEP mode (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
10 years, 2 months ago by Stefano Avallone
Modified:
8 years ago
CC:
ns-3-reviews_googlegroups.com
Visibility:
Public.

Description

Add support for Wifi SLEEP mode

Patch Set 1 : Add support for Wifi SLEEP mode #

Patch Set 2 : Use txVector instead of txMode and txPower separately #

Patch Set 3 : Add the wifi tx current model #

Patch Set 4 : Add a low battery threshold for energy sources #

Patch Set 5 : Add an EnergyRecharged callback #

Unified diffs Side-by-side diffs Delta from patch set Stats (+149 lines, -2 lines) Patch
M src/energy/helper/wifi-radio-energy-model-helper.h View 1 2 3 4 2 chunks +9 lines, -0 lines 0 comments Download
M src/energy/helper/wifi-radio-energy-model-helper.cc View 1 2 3 4 3 chunks +18 lines, -0 lines 0 comments Download
M src/energy/model/basic-energy-source.h View 1 2 3 4 2 chunks +11 lines, -0 lines 0 comments Download
M src/energy/model/basic-energy-source.cc View 1 2 3 4 4 chunks +23 lines, -2 lines 0 comments Download
M src/energy/model/device-energy-model.h View 1 2 3 4 1 chunk +6 lines, -0 lines 0 comments Download
M src/energy/model/energy-source.h View 1 2 3 4 1 chunk +6 lines, -0 lines 0 comments Download
M src/energy/model/energy-source.cc View 1 2 3 4 1 chunk +12 lines, -0 lines 0 comments Download
M src/energy/model/simple-device-energy-model.h View 1 2 3 4 1 chunk +9 lines, -0 lines 0 comments Download
M src/energy/model/wifi-radio-energy-model.h View 1 2 3 4 4 chunks +22 lines, -0 lines 0 comments Download
M src/energy/model/wifi-radio-energy-model.cc View 1 2 3 4 2 chunks +24 lines, -0 lines 0 comments Download
M src/uan/model/acoustic-modem-energy-model.h View 1 2 3 4 1 chunk +9 lines, -0 lines 0 comments Download

Messages

Total messages: 16
Stefano Avallone
Hello, I have published my attempt at adding support for a Wifi sleep mode at: ...
10 years, 2 months ago (2014-01-28 09:22:02 UTC) #1
Stefano Avallone
Hello, I have published my attempt at adding support for a Wifi sleep mode at: ...
10 years, 2 months ago (2014-01-28 11:26:27 UTC) #2
Stefano Avallone
Hello, published a new patchset. Diffs from previous one: - added support for Wifi SLEEP ...
10 years, 2 months ago (2014-01-29 18:00:35 UTC) #3
LeoLee0718
On 2014/01/29 18:00:35, stavallo wrote: > Hello, > > published a new patchset. Diffs from ...
10 years, 1 month ago (2014-02-24 11:01:37 UTC) #4
Tom Henderson
This looks fine to me (I commented on one copy/paste bug) but is there a ...
9 years, 12 months ago (2014-04-05 15:57:53 UTC) #5
Tommaso Pecorella
Hi, I'm ok with this patch, but I have one doubt. Perhaps a test could ...
9 years, 11 months ago (2014-04-06 05:39:03 UTC) #6
Stefano Avallone
Hello, thanks for your review (I fixed the cut&paste typo you spotted locally, it will ...
9 years, 11 months ago (2014-04-08 17:57:49 UTC) #7
Stefano Avallone
Hello, thanks for your review. On Sun, Apr 6, 2014 at 7:39 AM, <tommypec@gmail.com> wrote: ...
9 years, 11 months ago (2014-04-08 18:01:05 UTC) #8
Stefano Avallone
Hello, anyone had a chance to look at the example script (and the logs) I ...
9 years, 11 months ago (2014-04-14 16:46:50 UTC) #9
Stefano Avallone
Updated patch (fixed typo and rebased on latest hg tip)
9 years, 11 months ago (2014-04-18 12:30:22 UTC) #10
Stefano Avallone
Hello, I prepared a new patch to address bug 1851 (https://www.nsnam.org/bugzilla/show_bug.cgi?id=1851). This patch updates the ...
9 years, 11 months ago (2014-04-19 18:07:19 UTC) #11
Tommaso Pecorella
Last couple of comments in the code (minor things). As a general note, please do ...
9 years, 11 months ago (2014-04-20 21:04:19 UTC) #12
Stefano Avallone
Thanks for the review. Published a new patch set, with the example added to the ...
9 years, 11 months ago (2014-04-21 11:06:23 UTC) #13
Tommaso Pecorella
On 2014/04/21 11:06:23, stavallo wrote: > Thanks for the review. > > Published a new ...
9 years, 11 months ago (2014-04-21 13:12:33 UTC) #14
Stefano Avallone
[apologies for the very long email] Hello, published an updated version of my work, which ...
9 years, 11 months ago (2014-04-24 14:54:06 UTC) #15
Stefano Avallone
9 years, 8 months ago (2014-07-24 16:53:01 UTC) #16
Hello,

patch set 5 adds the support for resuming a device from the sleep state when the
remaining energy exceeds a given ("high") threshold. Clearly, this makes sense
once the energy harvester framework (https://codereview.appspot.com/103750047/)
is merged (though does not depend on it). Currently, only the basic energy
source and the wifi radio device support this feature.

I tested the whole patch set (along with the energy harvester framework) with a
multi-radio wireless mesh network. The following excerpt shows that the two wifi
net devices on node 24 are first put to sleep and then resumed:

6.45429s 24 WifiRadioEnergyModel:SwitchToIdle(0x267ca10)
6.45429s 24 WifiRadioEnergyModel:ChangeState(0x26c24c0, 0)
6.45429s 24 BasicEnergySource:GetSupplyVoltage(0x26c2230)
6.45429s 24 BasicEnergySource:UpdateEnergySource(0x26c2230)
6.45429s 24 BasicEnergySource:Updating remaining energy.
6.45429s 24 BasicEnergySource:CalculateRemainingEnergy(0x26c2230)
6.45429s 24 WifiRadioEnergyModel:DoGetCurrentA(0x26c24c0)
6.45429s 24 WifiRadioEnergyModel:DoGetCurrentA(0x26c2750)
6.45429s 24 BasicEnergySource:GetSupplyVoltage(0x26c2230)
6.45429s 24 BasicEnergySource:Remaining energy = 1.19982
6.45429s 24 BasicEnergySource:HandleEnergyDrainedEvent(0x26c2230)
6.45429s 24 BasicEnergySource:Energy depleted!
6.45429s 24 WifiRadioEnergyModel:HandleEnergyDepletion(0x26c24c0)
6.45429s 24 WifiRadioEnergyModel:Energy is depleted!
6.45429s 24 YansWifiPhy:SetSleepMode(0x2627220)
6.45429s 24 setting sleep mode
6.45429s 24 WifiRadioEnergyModel:NotifySleep(0x267ca10)
6.45429s 24 WifiRadioEnergyModel:ChangeState(0x26c24c0, 5)
6.45429s 24 BasicEnergySource:GetSupplyVoltage(0x26c2230)
6.45429s 24 BasicEnergySource:UpdateEnergySource(0x26c2230)
6.45429s 24 BasicEnergySource:Updating remaining energy.
6.45429s 24 BasicEnergySource:CalculateRemainingEnergy(0x26c2230)
6.45429s 24 WifiRadioEnergyModel:DoGetCurrentA(0x26c24c0)
6.45429s 24 WifiRadioEnergyModel:DoGetCurrentA(0x26c2750)
6.45429s 24 BasicEnergySource:GetSupplyVoltage(0x26c2230)
6.45429s 24 BasicEnergySource:Remaining energy = 1.19982
6.45429s 24 WifiRadioEnergyModel:SetWifiRadioState(0x26c24c0, SLEEP)
6.45429s 24 WifiRadioEnergyModel:Switching to state: SLEEP at time =
+6454291338.0ns
6.45429s 24 WifiRadioEnergyModel:Total energy consumption is 9.86862J 0x26c24c0
6.45429s 24 WifiRadioEnergyModel:HandleEnergyDepletion(0x26c2750)
6.45429s 24 WifiRadioEnergyModel:Energy is depleted!
6.45429s 24 YansWifiPhy:SetSleepMode(0x262a600)
6.45429s 24 setting sleep mode postponed until end of current reception
6.45434s 24 YansWifiPhy:StartReceivePacket(0x2627220, 0x302c440, -87.0397,
OfdmRate6Mbps, 0)
6.45434s 24 drop packet because in sleep mode
6.45462s 24 YansWifiPhy:StartReceivePacket(0x2627220, 0x44955e0, -95.8326,
OfdmRate6Mbps, 0)
6.45462s 24 drop packet because in sleep mode
6.45482s 24 YansWifiPhy:EndReceive(0x262a600, 0x2b37510, 0x3201c10)
6.45482s 24 mode=18000000, snr=0.64122, per=1, size=1476
6.45482s 24 WifiRadioEnergyModel:NotifyRxEndError(0x26c2680)
6.45482s 24 WifiRadioEnergyModel:ChangeState(0x26c2750, 0)
6.45482s 24 BasicEnergySource:GetSupplyVoltage(0x26c2230)
6.45482s 24 BasicEnergySource:UpdateEnergySource(0x26c2230)
6.45482s 24 BasicEnergySource:Updating remaining energy.
6.45482s 24 BasicEnergySource:CalculateRemainingEnergy(0x26c2230)
6.45482s 24 WifiRadioEnergyModel:DoGetCurrentA(0x26c24c0)
6.45482s 24 WifiRadioEnergyModel:DoGetCurrentA(0x26c2750)
6.45482s 24 BasicEnergySource:GetSupplyVoltage(0x26c2230)
6.45482s 24 BasicEnergySource:Remaining energy = 1.1997
6.45482s 24 WifiRadioEnergyModel:SetWifiRadioState(0x26c2750, IDLE)
6.45482s 24 WifiRadioEnergyModel:Switching to state: IDLE at time =
+6454820166.0ns
6.45482s 24 WifiRadioEnergyModel:Total energy consumption is 10.5934J 0x26c2750
6.45482s 24 YansWifiPhy:SetSleepMode(0x262a600)
6.45482s 24 setting sleep mode
6.45482s 24 WifiRadioEnergyModel:NotifySleep(0x26c2680)
6.45482s 24 WifiRadioEnergyModel:ChangeState(0x26c2750, 5)
6.45482s 24 BasicEnergySource:GetSupplyVoltage(0x26c2230)
6.45482s 24 BasicEnergySource:UpdateEnergySource(0x26c2230)
6.45482s 24 BasicEnergySource:Updating remaining energy.
6.45482s 24 BasicEnergySource:CalculateRemainingEnergy(0x26c2230)
6.45482s 24 WifiRadioEnergyModel:DoGetCurrentA(0x26c24c0)
6.45482s 24 WifiRadioEnergyModel:DoGetCurrentA(0x26c2750)
6.45482s 24 BasicEnergySource:GetSupplyVoltage(0x26c2230)
6.45482s 24 BasicEnergySource:Remaining energy = 1.1997
6.45482s 24 WifiRadioEnergyModel:SetWifiRadioState(0x26c2750, SLEEP)
6.45482s 24 WifiRadioEnergyModel:Switching to state: SLEEP at time =
+6454820166.0ns
6.45482s 24 WifiRadioEnergyModel:Total energy consumption is 10.5934J 0x26c2750
6.45663s 24 YansWifiPhy:StartReceivePacket(0x2627220, 0x3ee35f0, -99.4836,
OfdmRate6Mbps, 0)
6.45663s 24 drop packet because in sleep mode
6.45679s 24 YansWifiPhy:StartReceivePacket(0x2627220, 0x2d8d8f0, -87.0397,
OfdmRate6Mbps, 0)
6.45679s 24 drop packet because in sleep mode
6.45704s 24 YansWifiPhy:StartReceivePacket(0x2627220, 0x2d8d8f0, -95.8326,
OfdmRate6Mbps, 0)
6.45704s 24 drop packet because in sleep mode
6.45723s 24 YansWifiPhy:StartReceivePacket(0x2627220, 0x3ebb4e0, -87.0397,
OfdmRate6Mbps, 0)
6.45723s 24 drop packet because in sleep mode
6.45748s 24 YansWifiPhy:StartReceivePacket(0x2627220, 0x3907000, -95.8326,
OfdmRate6Mbps, 0)
6.45748s 24 drop packet because in sleep mode
6.45784s 24 YansWifiPhy:StartReceivePacket(0x262a600, 0x29c78b0, -96.8959,
OfdmRate18Mbps, 0)
6.45784s 24 drop packet because in sleep mode
[...]
6.98021s 24 YansWifiPhy:StartReceivePacket(0x262a600, 0x28e6f70, -90.4213,
OfdmRate6Mbps, 0)
6.98021s 24 drop packet because in sleep mode
7s 24 BasicEnergySource:UpdateEnergySource(0x26c2230)
7s 24 BasicEnergySource:Updating remaining energy.
7s 24 BasicEnergySource:CalculateRemainingEnergy(0x26c2230)
7s 24 WifiRadioEnergyModel:DoGetCurrentA(0x26c24c0)
7s 24 WifiRadioEnergyModel:DoGetCurrentA(0x26c2750)
7s 24 BasicEnergySource:GetSupplyVoltage(0x26c2230)
7s 24 BasicEnergySource:Remaining energy = 1.92782
7s 24 BasicEnergySource:HandleEnergyRechargedEvent(0x26c2230)
7s 24 BasicEnergySource:Energy recharged!
7s 24 WifiRadioEnergyModel:HandleEnergyRecharged(0x26c24c0)
7s 24 WifiRadioEnergyModel:Energy is recharged!
7s 24 YansWifiPhy:ResumeFromSleep(0x2627220)
7s 24 resuming from sleep mode
7s 24 WifiRadioEnergyModel:NotifyWakeup(0x267ca10)
7s 24 WifiRadioEnergyModel:ChangeState(0x26c24c0, 0)
7s 24 BasicEnergySource:GetSupplyVoltage(0x26c2230)
7s 24 BasicEnergySource:UpdateEnergySource(0x26c2230)
7s 24 BasicEnergySource:Updating remaining energy.
7s 24 BasicEnergySource:CalculateRemainingEnergy(0x26c2230)
7s 24 WifiRadioEnergyModel:DoGetCurrentA(0x26c24c0)
7s 24 WifiRadioEnergyModel:DoGetCurrentA(0x26c2750)
7s 24 BasicEnergySource:GetSupplyVoltage(0x26c2230)
7s 24 BasicEnergySource:Remaining energy = 1.92782
7s 24 WifiRadioEnergyModel:SetWifiRadioState(0x26c24c0, IDLE)
7s 24 WifiRadioEnergyModel:Switching to state: IDLE at time = +7000000000.0ns
7s 24 WifiRadioEnergyModel:Total energy consumption is 9.92319J 0x26c24c0
7s 24 WifiRadioEnergyModel:HandleEnergyRecharged(0x26c2750)
7s 24 WifiRadioEnergyModel:Energy is recharged!
7s 24 YansWifiPhy:ResumeFromSleep(0x262a600)
7s 24 resuming from sleep mode
7s 24 WifiRadioEnergyModel:NotifyWakeup(0x26c2680)
7s 24 WifiRadioEnergyModel:ChangeState(0x26c2750, 0)
7s 24 BasicEnergySource:GetSupplyVoltage(0x26c2230)
7s 24 BasicEnergySource:UpdateEnergySource(0x26c2230)
7s 24 BasicEnergySource:Updating remaining energy.
7s 24 BasicEnergySource:CalculateRemainingEnergy(0x26c2230)
7s 24 WifiRadioEnergyModel:DoGetCurrentA(0x26c24c0)
7s 24 WifiRadioEnergyModel:DoGetCurrentA(0x26c2750)
7s 24 BasicEnergySource:GetSupplyVoltage(0x26c2230)
7s 24 BasicEnergySource:Remaining energy = 1.92782
7s 24 WifiRadioEnergyModel:SetWifiRadioState(0x26c2750, IDLE)
7s 24 WifiRadioEnergyModel:Switching to state: IDLE at time = +7000000000.0ns
7s 24 WifiRadioEnergyModel:Total energy consumption is 10.6479J 0x26c2750
7.0073s 24 YansWifiPhy:StartReceivePacket(0x262a600, 0x28f8ee0, -84.3849,
OfdmRate6Mbps, 0)
7.0073s 24 sync to signal (power=4.58676e-12W)
7.0073s 24 WifiRadioEnergyModel:NotifyRxStart(0x26c2680, +144000.0ns)


Thanks,
Stefano
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b