<html><head><meta http-equiv="Content-Type" content="text/html charset=iso-8859-1"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>Hi huyao,</div><div><br></div><div>You can always schedule an event (a function) at 10 seconds, where you can "fail" the link.</div><div>I'm not sure about DataRate, since technically it is a "static" parameter.  However, you can either set the link down on the nodes associated with the same channel, or change parameters of the error model.  Something along these lines:</div><div><br></div><div>void</div><div>FailLink (Ptr<NetDevice> nd)</div><div>{</div><div>    Ptr<RateErrorModel> error = CreateObject<RateErrorModel> ();</div><div>    error->SetAttribute ("ErrorRate", DoubleValue (1.0));</div><div><br></div><div>    nd->SetAttribute ("ReceiveErrorModel", PointerValue (error));</div><div>}</div><div><br></div><div>...</div><div><br></div><div><br></div>Simulator::Schedule (Seconds (10.0), FailLink, device1);<div>Simulator::Schedule (Seconds (10.0), FailLink, device2);</div><div><br></div><div>---</div><div>Alex</div><br><div><div>On Apr 22, 2013, at 7:49 AM, yao hu <<a href="mailto:huyao0107@gmail.com">huyao0107@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div dir="ltr"><span style="font-family:arial,sans-serif;font-size:14px">Hi Alex,</span><div style="font-family:arial,sans-serif;font-size:14px"><br></div><div style="font-family:arial,sans-serif;font-size:14px">(Sorry for my previous incomplete message..)</div>
<div style="font-family:arial,sans-serif;font-size:14px"><br></div><div style="font-family:arial,sans-serif;font-size:14px">Is it possible to simulate link failure at a specific run time? </div><div style="font-family:arial,sans-serif;font-size:14px">
<br></div><div style="font-family:arial,sans-serif;font-size:14px">If It can be the following format</div><div style="font-family:arial,sans-serif;font-size:14px">if(Expression including Seconds(double))</div><div style="font-family:arial,sans-serif;font-size:14px">
{</div><div style="font-family:arial,sans-serif;font-size:14px">    link failure;</div><div style="font-family:arial,sans-serif;font-size:14px">}</div><div style="font-family:arial,sans-serif;font-size:14px"><br></div><div style="font-family:arial,sans-serif;font-size:14px">
Then, </div><div style="font-family:arial,sans-serif;font-size:14px">(1)How to write the expression meaning the specific run time (like at 10 seconds)?</div><div style="font-family:arial,sans-serif;font-size:14px">(2)To simulate link failure, can I set the attribute <span style="white-space: pre-wrap; font-family: arial; font-size: small; ">DataRate as 0?</span></div>
<div style="font-family:arial,sans-serif;font-size:14px"><span style="white-space: pre-wrap; font-family: arial; font-size: small; "><br></span></div><div style="font-family:arial,sans-serif;font-size:14px"><span style="white-space: pre-wrap; font-family: arial; font-size: small; ">Thank you very much!</span></div>
<div style="font-family:arial,sans-serif;font-size:14px"><span style="white-space: pre-wrap; font-family: arial; font-size: small; "><br></span></div><div style="font-family:arial,sans-serif;font-size:14px"><span style="white-space: pre-wrap; font-family: arial; font-size: small; ">Regards,</span></div>
<div style="font-family:arial,sans-serif;font-size:14px"><span style="white-space: pre-wrap; font-family: arial; font-size: small; ">huyao</span></div><div style="font-family:arial,sans-serif;font-size:14px"><span style="white-space: pre-wrap; font-family: arial; font-size: small; "><br>
</span></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">2013/4/22 yao hu <span dir="ltr"><<a href="mailto:huyao0107@gmail.com" target="_blank">huyao0107@gmail.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">Hi Alex,<div><br></div><div>Is it possible to simulate link failure at a specific run time? </div><div><br></div><div>If It can be the following format</div><div>if(Expression including Seconds(double))</div>

<div>{</div><div><br></div><div>}</div></div>
</blockquote></div><br></div>
_______________________________________________<br>ndnSIM mailing list<br><a href="mailto:ndnSIM@lists.cs.ucla.edu">ndnSIM@lists.cs.ucla.edu</a><br>http://www.lists.cs.ucla.edu/mailman/listinfo/ndnsim<br></blockquote></div><br></body></html>