[ndnSIM] Getting "Face" in PIT of node in simulator version 1.1 & Sending extra interest message
Kanin Assantachai
kanin at inl.ics.keio.ac.jp
Sun May 24 22:44:27 PDT 2015
Dear everyone,
As in my another email, I have figured out the solutions to my own
questions, so I would like to share how I implemented these features as
well. Here they are!
1. Get the "Face" connected to neighbor nodes (implemented in
ndn-forwarding-strategy.cc)
Reference:
http://www.lists.cs.ucla.edu/pipermail/ndnsim/2013-March/000238.html
Ptr<Node> tempNode = inFace->GetNode ();
for (uint32_t deviceId = 0; deviceId < tempNode->GetNDevices ();
deviceId ++)
{
Ptr<NetDevice> device = tempNode->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){
tempNode->GetObject<ndn::L3Protocol>()->GetFaceByNetDevice(channelDevice);
// modify this part on your own to keep this "Face"
continue;
// channelDevice is a "neighbor"
}
}
}
2. Send extra interest message to another destination (implemented in
ndn-forwarding-strategy.cc)
// Clear the list of outgoing face in the pitEntry first, add the
outgoing face you want, then send the interest again
pitEntry->ClearOutgoing ();
pitEntry->AddOutgoing (<desired_outgoing_face>);
PropagateInterest (inFace, interest, pitEntry);
Again, hope this is helpful to the community.
Kanin Assantachai
On 19-May-15 12:21 AM, Kanin Assantachai wrote:
> Dear Spyridon / Alex,
>
> These are the follow-up questions to the email I sent a few days ago.
> But since they are not quite related to the previous questions, I
> would like to create another email for a separate series of archived
> email.
>
> 1. I would like to print out the list of "Face" stored in the PIT of a
> node. Even though it was asked before in this archived email:
> http://www.lists.cs.ucla.edu/pipermail/ndnsim/2015-February/001693.html ,
> the suggested method only applies to the simulator version 2.0 since
> it uses nfd library in the code. However as I am still working with
> version 1.1 (I tried to upgrade to version 2.0 earlier, but the BRITE
> integration component somehow does not compile with the new version),
> may I ask for possible solutions to do this task in version 1.1?
>
> 2. I would like to make a node along the content retrieving path sends
> another copy of the same interest message to its neighbor node instead
> of the original intended destination. Please suggest some approaches
> for this feature. For example, let's say there is Node "A" which is
> connected to Node "B". Node B also connects to both Node C and Node D.
> If I install a consumer app on node A, and producer apps on both node
> C and D, how can I make node B sends extra copy of interest message to
> node D when its original destination of the original interest is node
> C? I have tried reading through the code of the functions SendPacket()
> and ScheduleNextPacket() of ndn-consumer.cc, but I am not quite sure
> if they are the correct place to modify the code.
>
> Thank you for your kind suggestions in advance.
>
> Sincerely,
>
> Kanin Assantachai
>
More information about the ndnSIM
mailing list