[ndnSIM] Energy Model ns3

Alex Afanasyev alexander.afanasyev at ucla.edu
Tue Apr 23 10:53:47 PDT 2013


Hi Xee,

Thanks for the code, but it still doesn't give me the full picture of what can go wrong. What is the error you're getting?

My best guess is that you're using ns-3/example/energy/energy-model-example.cc as a base for your experiments.  I modified this example to use NDN stack instead of IPv4, and ConsumerCbr and Producer apps to generate traffic.  You can get the code here: http://pastebin.com/4XrmTaXC.

I run the modified example code and it didn't produce any errors and showed me some energy numbers in console.

---
Alex  


On Apr 22, 2013, at 10:13 PM, Xee <1839750381 at qq.com> wrote:

> Hi Alex
> 
> I am using the code below:
> 
>  Ptr<BasicEnergySource> basicSourcePtr = DynamicCast<BasicEnergySource> (sources.Get (1));  
>   basicSourcePtr->TraceConnectWithoutContext ("RemainingEnergy", MakeCallback (&RemainingEnergy));
>   // device energy model
>   Ptr<DeviceEnergyModel> basicRadioModelPtr =
>     basicSourcePtr->FindDeviceEnergyModels ("ns3::WifiRadioEnergyModel").Get (0);
>   NS_ASSERT (basicRadioModelPtr != NULL);
>   basicRadioModelPtr->TraceConnectWithoutContext ("TotalEnergyConsumption", MakeCallback (&TotalEnergy));
> 
> The node number 0 and 1 both are consumer nodes in simulation, but for producers it give error when I run simulation.
> 
> rgd
> -Xee
> ------------------ Original ------------------
> From:  "Alex Afanasyev"<alexander.afanasyev at ucla.edu>;
> Date:  Apr 23, 2013
> To:  "Xee"<1839750381 at qq.com>;
> Cc:  "ndnsim"<ndnsim at lists.cs.ucla.edu>;
> Subject:  Re: [ndnSIM] Energy Model ns3
> 
> Hi Xee,
> 
> You should give me more input to understand the problem.  Can you give me a simple scenario to debug?
> 
> ---
> Alex
> 
> On Apr 22, 2013, at 8:51 PM, "Xee" <1839750381 at qq.com> wrote:
> 
> > Hi Alex
> > 
> > I am able to use the energy consumption model for ndn nodes, but it working only with the consumer nodes. When I try with producer nodes it terminates with error while compiling. Please advise to how I remove the error and get the energy consumption of all nodes in the topology. 
> > 
> > rgd
> > -Xee
> > _______________________________________________
> > ndnSIM mailing list
> > ndnSIM at lists.cs.ucla.edu
> > http://www.lists.cs.ucla.edu/mailman/listinfo/ndnsim
> 
> _______________________________________________
> ndnSIM mailing list
> ndnSIM at lists.cs.ucla.edu
> http://www.lists.cs.ucla.edu/mailman/listinfo/ndnsim

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.lists.cs.ucla.edu/pipermail/ndnsim/attachments/20130423/2659b863/attachment.html>


More information about the ndnSIM mailing list