[ndnSIM] Changing topology parameter in real-time

Alex Afanasyev alexander.afanasyev at ucla.edu
Tue Mar 26 11:57:08 PDT 2013

Hi Mohammad,

Topology (.txt) is designed to work only once before the simulation begins.  At any particular point of simulation, you have a full control of what kind of parameters links have, but you need to manually get hold of the specific transmission queues and channels and manually updated their attributes.

You can try to do something like the following:

Ptr<Node> node = ?;
Ptr<Channel> channel = node->GetDevice (?)->netDevice->GetChannel ();

// set channel delay
channel->SetAttribute ("Delay", TimeValue (Seconds (0.01));

Ptr<NetDevice> toDev = channel->GetDevice (1);
Ptr<NetDevice> fromDev = channel->GetDevice (0);

// set data rates
toDev->SetAttribute ("DataRate", StringValue ("10Mbps"));
fromDev->SetAttribute ("DataRate", StringValue ("10Mbps"));

// set queue sizes
PointerValue txQueue;

toDev->GetAttribute ("TxQueue", txQueue);
txQueue.Get<DropTailQueue> ()->SetAttribute ("MaxPackets", StringValue ("1000"));

fromDev->GetAttribute ("TxQueue", txQueue);
txQueue.Get<DropTailQueue> ()->SetAttribute ("MaxPackets", StringValue ("1000"));


On Mar 26, 2013, at 5:11 AM, Hovaidi Ardestani Mohammad <mohammad.hovaidi.ardestani at aalto.fi> wrote:

> Hello,
> I am wondering how I can change the topology parameters, such as Delay, Capacity and Queue length in real time. It seems to me that we can have those parameters fixed as input in *.txt file.
> Can anybody guide me?
> I really appreciate your help in advance.
> -Mohammad
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.lists.cs.ucla.edu/pipermail/ndnsim/attachments/20130326/4f65b362/attachment.html>

More information about the ndnSIM mailing list