[ndnSIM] how to disable a link

Alex Afanasyev alexander.afanasyev at ucla.edu
Thu Jul 11 01:01:51 PDT 2013


Hi Xiaoke,

The first one, as I mentioned, will definitely not work.  The second check should work... At least it worked when I did something similar in my simulations...

---
Alex

On Jul 10, 2013, at 11:41 PM, Xiaoke Jiang <shock.jiang at gmail.com> wrote:

> In fact, I watched the simulation from several point:
> 
> 1. drop packet:
> oss << "/NodeList/*/DeviceList/*/$ns3::PointToPointNetDevice/TxQueue/Drop";
>     //Config::Connect (oss.str (), MakeBoundCallback (&AsciiTraceHelper::DefaultDequeueSinkWithContext, stream));
>     Config::ConnectWithoutContext(oss.str(), MakeCallback(&P2PDropPacket));
> 
> 2.unsatisfied requests: timeout request entries of end consumers.
> 
> 
> 
> thanks
> 
> My Regards,
> Xiaoke (Shock) Jiang (蒋小可)
> 
> Ph.D. Candidate,
> Department of Computer Science and Technology,
> Tsinghua University, Beijing, P.R.China. 100084
> On Thursday, July 11, 2013 at 2:38 PM, Alex Afanasyev wrote:
> 
>> If you're trying to see packet drop on link layer (see red line in visualizer), then you would not see anything, since packet be dropped before coming to there (inside ndn::Face).
>> 
>> ---
>> Alex
>> 
>> On Jul 10, 2013, at 11:36 PM, Xiaoke Jiang <shock.jiang at gmail.com> wrote:
>> 
>>> Hi Alex,
>>> 	The code can compile without error, but the result may be not right.
>>> 
>>> 	I disabled the one link at Seconds(5.0), some packets should be dropped, while I can't find any. I am trying to detect whether SetUp works.
>>> 
>>> thanks
>>> 
>>> My Regards,
>>> Xiaoke (Shock) Jiang (蒋小可)
>>> 
>>> Ph.D. Candidate,
>>> Department of Computer Science and Technology,
>>> Tsinghua University, Beijing, P.R.China. 100084
>>> On Thursday, July 11, 2013 at 1:22 AM, Alex Afanasyev wrote:
>>> 
>>>> Hi Xiaoke,
>>>> 
>>>> The approaches are not wrong, you just need to add a little bit of C++ syntax craziness to it :)
>>>> 
>>>> Simulator::Schedule(Seconds(hd), &ns3::ndn::Face::SetUp, face1, false);
>>>> Simulator::Schedule(Seconds(hd), &ns3::ndn::Face::SetUp, face2, false);
>>>> 
>>>> Or, if you define the FailLink function (as a global function or static in some class), you can do a little bit simpler things
>>>> void
>>>> FailLinks (Ptr<Node> node1, Ptr<Node> node2)
>>>> 
>>>> Simulator::Schedule (Seconds (10.0), FailLinks, Names::Find<Node> ("node1"), Names::Find<Node> ("node2"));
>>>> 
>>>> 
>>>> I haven't checked, but I hope this code should compile. Let me know if it doesn't, so I'll double check.
>>>> 
>>>> ---
>>>> Alex
>>>> 
>>>> 
>>>> On Jul 9, 2013, at 11:44 PM, Xiaoke Jiang <shock.jiang at gmail.com> wrote:
>>>> 
>>>>> thank you, Alex. But I have to fail the link at a specified time:
>>>>> 
>>>>> 	          Simulator::Schedule(Seconds(hd), &&ns3::ndn::Face::SetUp, face1, false);
>>>>> 	          Simulator::Schedule(Seconds(hd), &face2->SetUp, false);
>>>>> The above two approaches are wrong. What is your suggestion?
>>>>> 
>>>>> 
>>>>> thanks
>>>>> 
>>>>> My Regards,
>>>>> Xiaoke (Shock) Jiang (蒋小可)
>>>>> 
>>>>> Ph.D. Candidate,
>>>>> Department of Computer Science and Technology,
>>>>> Tsinghua University, Beijing, P.R.China. 100084
>>>>> On Wednesday, July 10, 2013 at 2:09 PM, Alex Afanasyev wrote:
>>>>> 
>>>>>> With point to point links you cannot remove any of them, but you can "fail" them.  You can try to make something base on this example: http://ndnsim.net/faq.html#code-questions
>>>>>> 
>>>>>> To get Ptr<Node> from string (defined in the topology file), just use something like this: Names::Find<Node> ("node1")---
>>>>>> Alex
>>>>>> 
>>>>>> On Jul 9, 2013, at 10:40 PM, Xiaoke Jiang <shock.jiang at gmail.com> wrote:
>>>>>> 
>>>>>>> Dear all,
>>>>>>> 	I read a topology with AnnotatedTopologyReader, now I am trying to disable a link, say link between node1 and node2, anyone can give me any hint?
>>>>>>> 
>>>>>>> thanks
>>>>>>> 
>>>>>>> My Regards,
>>>>>>> Xiaoke (Shock) Jiang (蒋小可)
>>>>>>> 
>>>>>>> Ph.D. Candidate,
>>>>>>> Department of Computer Science and Technology,
>>>>>>> Tsinghua University, Beijing, P.R.China. 100084
>>>>>>> _______________________________________________
>>>>>>> ndnSIM mailing list
>>>>>>> ndnSIM at lists.cs.ucla.edu
>>>>>>> http://www.lists.cs.ucla.edu/mailman/listinfo/ndnsim
>>>>> 
>>>> 
>>> 
>>> _______________________________________________
>>> ndnSIM mailing list
>>> ndnSIM at lists.cs.ucla.edu
>>> http://www.lists.cs.ucla.edu/mailman/listinfo/ndnsim
>> 
> 
> _______________________________________________
> ndnSIM mailing list
> ndnSIM at lists.cs.ucla.edu
> http://www.lists.cs.ucla.edu/mailman/listinfo/ndnsim

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.lists.cs.ucla.edu/pipermail/ndnsim/attachments/20130711/1b2ce314/attachment.html>


More information about the ndnSIM mailing list