[ndnSIM] Replacement for NetDeviceFace / Accessing physical bitrate of Face

Philipp Moll philipp.moll at itec.aau.at
Fri Mar 17 02:21:32 PDT 2017


Dear all,

I'm trying to port software originated for ndnSIM 2.0 to the current 
version of ndnSIM. The software used the NetDeviceFace class, which was 
removed in Version 2.2, for accessing the physical bit-rate of the 
underlying link with the following code:

// shared_ptr< Face > face

if(ns3::ndn::NetDeviceFace *netf = 
dynamic_cast<ns3::ndn::NetDeviceFace*>(&(*face)))
   {
     ns3::Ptr<ns3::PointToPointNetDevice> nd1 = 
netf->GetNetDevice()->GetNode ()->GetDevice(netf->getId () - 
256)->GetObject<ns3::PointToPointNetDevice>();
     ns3::DataRateValue dv;
     nd1->GetAttribute("DataRate", dv);
     ns3::DataRate d = dv.Get();
     return d.GetBitRate();
}

Unfortunately, I could not find a method for accessing the bitrate 
without casting Face to NetDeviceFace. Maybe someone was already faced 
with the same problem and solved it already.

Thanks!
Philipp Moll



More information about the ndnSIM mailing list