Implementing Link Failure in Ns3

340 views
Skip to first unread message

feroz...@gmail.com

unread,
Apr 16, 2013, 1:20:48 PM4/16/13
to ns-3-...@googlegroups.com
Hello all,

I need to know if NS3 supports link failure or not. I have to implement this scenario of a network architecture where a random link fails and an alternate route is used until it becomes available after a while. As the original architecture doesnt use in-built routing, what could be my options to introduce and recover from fault?

Regards.

Anuja Tayal

unread,
Oct 31, 2017, 2:13:09 AM10/31/17
to ns-3-users

Hi

Did you get the answer for this?

richard

unread,
Nov 8, 2017, 10:55:58 AM11/8/17
to ns-3-users
I am not sure if that is possible (still waiting for response). 

However there is a way to emulate that (not sure if it is the best, but it will work):

For this you have to use an error model and attach it to netdevices as follows:

Ptr<RateErrorModel> em = CreateObject<RateErrorModel> ();
em->SetAttribute ("ErrorRate", DoubleValue (1));
em->SetAttribute ("ErrorUnit", EnumValue(RateErrorModel::ERROR_UNIT_PACKET));

Then to completely fail a link you have to attach this to both NetDevice objects:

PointToPointHelper p2p;
NetDeviceContainer link = p2p.Install (NodeContainer(host1, host2));

link.get(0)->SetAttribute ("ReceiveErrorModel", PointerValue (em));
link.get(1)->SetAttribute ("ReceiveErrorModel", PointerValue (em));

If you want that to happen at a specific time, wrap it in a function, lets say "fail_link()" and then:

Simulator::Schedule (Seconds(TimeToFail), &fail_link);


Hope it helps!
Reply all
Reply to author
Forward
0 new messages