[ndnSIM] a question
alexander.afanasyev at ucla.edu
Thu Sep 12 11:01:31 PDT 2013
You can't just create a new L3Protocol object and expect it do anything useful. This object is the core of NDN stack for the node and maintains NDN-related info throughout the lifetime of the simulated node.
What you actually need is to get hold of the L3Protocol object that is part of the specific node. Something like this:
Ptr<L3Protocol> protocol = node->GetObject<L3Protocol> ();
On Sep 11, 2013, at 6:46 AM, ndnSIM_beginner <ndnsim_beginner at 163.com> wrote:
> Hi Alex
> As your advice,i use the function in the way below
> Ptr<Node> node=inFace->GetNode();
> for(uint32_t deviceId = 0; deviceId < node->GetNDevices(); deviceId++)
> Ptr<NetDevice> device = node ->GetDevice(deviceId);
> L3Protocol *protocol=new L3Protocol();
> Ptr<Face> neighborFace=protocol->GetFaceByNetDevice(device);
> but the content in neighborFace is null!?
> i could not for sure that whether i use the function in the correct way
> any suggestion?
> At 2013-09-11 01:25:37,"Alex Afanasyev" <alexander.afanasyev at ucla.edu> wrote:
> Hi Wang,
> From the channel you can get pointer to NetDevice (channel->GetDevice(x)). Using netdevice pointer you can get pointer to the face, using GetFaceByNetDevice method from ndn::L3Protocol (http://ndnsim.net/doxygen/classns3_1_1ndn_1_1_l3_protocol.html#ad85486f42dff1d171f59af519079615f)
> On Sep 9, 2013, at 7:01 PM, ndnSIM_beginner <ndnsim_beginner at 163.com> wrote:
>> Hi Alex
>> Thank you very much!
>> I have read the advice you gave me .It gives me a lot of inspiration.
>> I have known how to get devices through nodes ,and how to get channels through devices.
>> By the way,how can I get Faces through channel.
>> Thank you in advance.
>> At 2013-09-06 11:53:57,"Alex Afanasyev" <alexander.afanasyev at ucla.edu> wrote:
>> You can try to check the old thread http://www.lists.cs.ucla.edu/pipermail/ndnsim/2013-March/000238.html, which may be helpful for you to get an idea how to proceed.
>> On Sep 5, 2013, at 12:01 AM, ndnSIM_beginner <ndnsim_beginner at 163.com> wrote:
>>> Hello Alex,
>>> Hello,I am a beginner and my English is not good,
>>> I want to achieve a set of node cooperative store.It means that if a node want to store a content,it will send packets to its neighbor nodes.if the content in the neighbor nodes,the node can't store the content.
>>> But I don't know how to get around the node interface now.Please give some advic! e.
>>> Thanks in advance
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the ndnSIM