[ndnSIM] Help Needed: Getting Node Name in Forwarder.cpp for Output Logging

Sirapop Theeranantachai sirapop741 at gmail.com
Mon Mar 3 17:54:24 PST 2025


I just realized there's a simple way.
When installing NDN stack in ndnSIM, you could adjust the ndn-stack-helper
to specify localURI so that the face you get is unique across all nodes.
https://github.com/named-data-ndnSIM/ndnSIM/blob/90d50396654dabad54b6979f2dc8fa929ade544c/helper/ndn-stack-helper.cpp#L248

On Mon, Mar 3, 2025 at 5:33 PM Sirapop Theeranantachai <sirapop741 at gmail.com>
wrote:

> Hi Mohammad,
>
> I do not have an easy solution right now. Since the forwarder is in NFD,
> it's a bit tricky to access the node name from ns-3::Node.
>
> One way to pass NodeID information is to make ndnSIM (which still has
> access to the node name) modify the part where it converts ns-3 packets
> to NFD packets
> <https://github.com/named-data-ndnSIM/ndnSIM/blob/90d50396654dabad54b6979f2dc8fa929ade544c/model/ndn-net-device-transport.cpp#L127>.
> You could add an NDNLPv2
> <https://redmine.named-data.net/projects/nfd/wiki/NDNLPv2>tag to the
> packet to pass along the node name. You may need to adjust the NFD's face
> transport to make it easier to modify the LP.
> I have never tried this, but it should work in theory.
>
> I hope someone else has a better solution.
>
>
> On Mon, Mar 3, 2025, 7:49 AM Mohammad R. Shakournia via ndnSIM <
> ndnsim at lists.cs.ucla.edu> wrote:
>
>> Dear ndnSIM community,
>>
>> I am currently working on measuring CS and PIT lookup times in
>> *Forwarder.cpp* by using a clock in the *onIncomingInterest* function. I
>> log these measurements to separate output files for each node. However, I
>> am facing an issue:
>>
>>    1. The node names are *not appearing* in my output files.
>>    2. When using tracers like *L3Tracer*, multiple faces are assigned to
>>    each node, making it difficult to map *faceId* to the corresponding *node
>>    name*, even with explicit mapping.
>>
>> I tried retrieving node names using ns3::Names::FindName(node), but it
>> does not always return the expected results. Could you please guide me on
>> how to correctly obtain the *node name* in *Forwarder.cpp* and include
>> it in my output logs?
>>
>> Any insights or suggestions would be greatly appreciated.
>>
>> Best regards,
>> Mohammad Reza Shakournia
>>
>> _______________________________________________
>> ndnSIM mailing list
>> ndnSIM at lists.cs.ucla.edu
>> https://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/20250303/ca17942f/attachment-0001.htm>


More information about the ndnSIM mailing list