<div style="line-height:1.7;color:#000000;font-size:14px;font-family:arial">Hi <span style="white-space: pre-wrap; line-height: 1.7;">Alex,</span><div><span style="white-space: pre-wrap;"><br></span></div><div><span style="white-space: pre-wrap;">Thank you very much! <br></span>You let me understand much better to the problem.<br>By the way, how can I get the request node.</div><div>In cache replacement policy, such as: lru_policy_traits, freshness_policy_traits, I don't know how to get which node request the *item data. Can you help me? And my thoughts is wrong or not?</div><div><br></div><div>Thank you!</div><div><br></div><div>Pan <br><br><br><div></div><div id="divNeteaseMailCard"></div><br><pre><br>At 2013-03-11 02:33:22,"Alex Afanasyev" <alexander.afanasyev@ucla.edu> wrote:
>Hi Pan,
>
>In general, as in real system, you would need to implement some kind of a resource discovery protocol to discover all node's neighbors.  At the same time, in NS-3, since it is a simulation, it is technically possible to "discover" neighbors directly:
>
>In NS-3 in general, you would enumerate all NetDevice's on a particular Node object (http://www.nsnam.org/doxygen/classns3_1_1_node.html):
>
>for (uint32_t deviceId = 0; deviceId < node->GetNDevices (); deviceId ++)
>{
>    Ptr<NetDevice> device = node->GetDevice (deviceId);
>
>    # get channel, to which device is connected (a "wire")
>    Ptr<Channel> channel = device->GetChannel ();
>
>    for (uint32_t channelDeviceId = 0; channelDeviceId < channel->GetNDevices (); channelDeviceId ++)
>    {
>        Ptr<NetDevice> channelDevice = channel->GetDevice (channelDeviceId);
>        if (channelDevice == device)
>            continue;
>
>        # channelDevice is a "neighbor"
>    }
>}
>
>---
>Alex
>
>On Mar 10, 2013, at 5:53 AM, panhgshine@163.com wrote:
>
>> Hi All,
>> 
>> I'm a beginner of NS3 and ndnSIM. Recently, I have read the cache replacement policy code.
>> Now, I want to get a node's all neighbour. 
>> Is there anyone can give me some advice or hint?
>> 
>> Thank you in advance.
>> 
>> Pan
>
>
>_______________________________________________
>ndnSIM mailing list
>ndnSIM@lists.cs.ucla.edu
>http://www.lists.cs.ucla.edu/mailman/listinfo/ndnsim
</pre></div></div><br><br><span title="neteasefooter"><span id="netease_mail_footer"></span></span>