How can I get some energy information with ns3?

239 views
Skip to first unread message

TN User

unread,
Sep 22, 2017, 4:58:22 AM9/22/17
to ns-3-users
Hello,
 please does anyone know how to deal with energy consumption with ns3?
i.e: remaining energy, total energy consumption, how to set a node in "sleep mode"... ? 
I need help, please, i didn't find enough information about this issue

Konstantinos

unread,
Sep 22, 2017, 5:19:29 AM9/22/17
to ns-3-users
Hi,

Isn't this enough information?

Regards
K
Message has been deleted

TN User

unread,
Sep 22, 2017, 2:17:39 PM9/22/17
to ns-3-users
Hello back Konstantinos, Thanks for the quick response :)

but sorry it's not enough for me.
theoretically, it seems good, but when I saw the examples, I haven't understood some lines...

For example, here:
  // configure radio energy model
  radioEnergyHelper
.Set ("TxCurrentA", DoubleValue (0.0174));

I don't understand why almost all the examples uses this initial value, Should it be always like that or it's related to the transmission range..?
Moreover, why if i'm dealing with sent and received messages, should I add RxCurrentA in order to take into consideration consumed energy

while listening to messages?

Also, here:
  basicSourcePtr->TraceConnectWithoutContext ("RemainingEnergy", MakeCallback (&RemainingEnergy))

  basicRadioModelPtr
->TraceConnectWithoutContext ("TotalEnergyConsumption", MakeCallback (&TotalEnergy))
Usually, when we callback a function, we should insert its variables with it, Here we callback the remaining energy function without any initial value, so what will return this function exactly ?

I'm sorry if I'm misunderstanding things, But I'm a little confused about it...

Konstantinos

unread,
Sep 23, 2017, 4:24:40 PM9/23/17
to ns-3-users
Hi,

Comments inline.


On Friday, September 22, 2017 at 7:17:39 PM UTC+1, TN User wrote:
Hello back Konstantinos, Thanks for the quick response :)

but sorry it's not enough for me.
theoretically, it seems good, but when I saw the examples, I haven't understood some lines...

For example, here:
  // configure radio energy model
  radioEnergyHelper
.Set ("TxCurrentA", DoubleValue (0.0174));

I don't understand why almost all the examples uses this initial value, Should it be always like that or it's related to the transmission range..?
Moreover, why if i'm dealing with sent and received messages, should I add RxCurrentA in order to take into consideration consumed energy

while listening to messages?

Default values for power consumption are based on measurements reported in:

Daniel Halperin, Ben Greenstein, Anmol Sheth, David Wetherall, "Demystifying 802.11n power consumption", Proceedings of HotPower'10

 
However, if you want to simulate a different system, then you may need to change the values. I am not an energy expert, but it is related to the system parameters you want to simulate, eg. TxPower, which does have an impact on the Tx range.

The fact that you do not change the value of RxCurrentA, does not mean it is not considered. It simply uses the default values. Again the values to use should match the system you want to simulate. See some of the references mentioned in the documentation (https://www.nsnam.org/docs/models/html/energy.html#references) might give you poitners of values to use.


Also, here:
  basicSourcePtr->TraceConnectWithoutContext ("RemainingEnergy", MakeCallback (&RemainingEnergy))

  basicRadioModelPtr
->TraceConnectWithoutContext ("TotalEnergyConsumption", MakeCallback (&TotalEnergy))
Usually, when we callback a function, we should insert its variables with it, Here we callback the remaining energy function without any initial value, so what will return this function exactly ?

This is a traced callback. See more here https://www.nsnam.org/docs/manual/html/tracing.html
That means when there is a change in the trace source "RemainingEnergy" or "TotalEnergyConsumption" the callback functions will be called and the variables will be automatically populated by the traced source.

TN User

unread,
Oct 5, 2017, 10:30:10 AM10/5/17
to ns-3-users
Hello back konstantinos,
Thanks alot for your quick interaction!

So, it took me quiet a week to understand the energy model, the energy consumption process in general and particularily in ns3. I tried to have a look in all the previous discussions on energy in ns-3 but I didn't found an exact answer to my questions..

I'll resume the study I did with two questions and i'll be so grateful if you have the answers :)

1./ Did the energy default values depend on the transmission range, i.e: for example if the nodes in the WSN communicate under a range of 50m, should I change these defaults values (such as TxCurrentA, RxCurrentA...)? And if the answer is "YES" so how can I find the relationship between these parameters?

2./Supposing that I need to add an extra energy consumption "state", I have N mobile nodes so when traveling from a position to another, Of cours, they will consume extra energy added to the energy consumed in Idle, sleep, transmission and reception states....And I suppose in those states you needed the power transmission value for each state so how can I get the power consumption for a mobile node when it needs to move from its position?

Thank you for your comprehension ! :)

Konstantinos

unread,
Oct 5, 2017, 11:56:51 AM10/5/17
to ns-3-users


On Thursday, 5 October 2017 15:30:10 UTC+1, TN User wrote:
Hello back konstantinos,
Thanks alot for your quick interaction!

So, it took me quiet a week to understand the energy model, the energy consumption process in general and particularily in ns3. I tried to have a look in all the previous discussions on energy in ns-3 but I didn't found an exact answer to my questions..

I'll resume the study I did with two questions and i'll be so grateful if you have the answers :)

1./ Did the energy default values depend on the transmission range, i.e: for example if the nodes in the WSN communicate under a range of 50m, should I change these defaults values (such as TxCurrentA, RxCurrentA...)? And if the answer is "YES" so how can I find the relationship between these parameters?

Yes, the values depend on the model of device you simulate. Details for the default values are described in the API

Default values for power consumption are based on measurements reported in:

Daniel Halperin, Ben Greenstein, Anmol Sheth, David Wetherall, "Demystifying 802.11n power consumption", Proceedings of HotPower'10

 
I would assume similar studies exist for other IEEE 802.11-family devices. I am not an expert in the field. Just search for something in IEEEXplore or similar databases.


2./Supposing that I need to add an extra energy consumption "state", I have N mobile nodes so when traveling from a position to another, Of cours, they will consume extra energy added to the energy consumed in Idle, sleep, transmission and reception states....And I suppose in those states you needed the power transmission value for each state so how can I get the power consumption for a mobile node when it needs to move from its position?


Again, you will need first to find a model for that consumption, e.g. the motors that would be used to move the node. Then you would need to create an energy model that would use the same energy source as the one for the wifi. 

TN User

unread,
Oct 18, 2017, 5:42:22 PM10/18/17
to ns-3-users
Thank you very much konstantinos for your collaboration.
I think I understood well the ns-3 energy model :)
Reply all
Reply to author
Forward
0 new messages