[ndnSIM] Changing the BW on Link during sim
Ahmed Sadek
don1559 at gmail.com
Tue Apr 5 04:04:05 PDT 2016
Dear All,
I wanted to change the BW on link during sim, I found this method in a
previous email Here
<http://www.lists.cs.ucla.edu/pipermail/ndnsim/2013-March/000297.html>
so now I have this method:
// Set the Data Rate of a given Device.
void setDataRate(Ptr<NetDevice > nd, std::string DR)
{
Ptr < Channel > channel = nd->GetChannel();
Ptr<NetDevice> toDev = channel->GetDevice (1);
Ptr<NetDevice> fromDev = channel->GetDevice (0);
toDev->SetAttribute ("DataRate", StringValue (DR));
fromDev->SetAttribute ("DataRate", StringValue (DR));
}
And was wondering, is there a simpler method to take advantage of point to
point device method Here
<https://www.nsnam.org/doxygen/classns3_1_1_point_to_point_net_device.html#adc4e5973337c576a2352e261cd844686>
(
pointToPoint.SetDeviceAttribute ("DataRate", StringValue ("5Mbps"));
), can't we cast *netDevice *to *PointToPointNetDevice *or something
similar ?
Thanks!
Ahmed
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.lists.cs.ucla.edu/pipermail/ndnsim/attachments/20160405/37b148b7/attachment.html>
More information about the ndnSIM
mailing list