[ndnSIM] Multiple prefixes in one ndnSIM scenario, printing PIT and FIB
Hussein AlOmaisi
alomaisi2004 at yahoo.com
Mon Dec 7 18:31:18 PST 2020
Hi Shuai,
Regarding your questions, I would like to answere based on my little experice wiht ndnSIM
Question (1), you need to make sure that consumer, producer and forwarding strategy are using same namespace (prefix) otherwise you will get such output "NACK message with reason No Route". Producer and forwarding strategy work for only the prefix they support (by default). You can have multiple consumers, producers and forwarding strategies in one scenario, please see the example in the following link.
https://github.com/named-data/IPoC/blob/master/ndnSIM/examples/ndn-different-strategy-per-prefix.cpp
I will assume that you are working in a wireless scenario. Regarding creating an entry in FIB for the new used prefix, I think you do not need to do it (did you do it for "prefix0"? I don't think so.)?. NDN-Stack-helper (ndn::StackHelper) will create a default route in FIB the represent the last resort route for forwarding Interest packet if no matching with other routes in FIB. This default route is "/" via a face that is linked with the NetDevice. Make sure that face is in AD-HOC mode.
Question (2), printing PIT and FIB tables. please see the below code. It is a simple code that can help in how the process of printing PIT and FIB is done. you can modified to meet your scenario aims. Also, I highly recommend you to go through "NFD Developer’s Guide" for understanding the structures and semantics of PIT and FIB tables.
void printPitFib(NodeContainer &nodes){ //numNode variable is the number of nodesstd::cout << endl << "---- PIT ----"<< endl;
for (uint32_t i = 0; i < numNodes; i++) { std::cout << endl << "node(" << i << "):" << endl; auto node = nodes.Get(i); auto& nodePit = node->GetObject<ndn::L3Protocol>()->getForwarder()->getPit(); nfd::Pit::const_iterator iter; for (iter = nodePit.begin(); iter != nodePit.end(); iter++) { cout << iter->getName() << endl << " Period : " << iter->dataFreshnessPeriod << endl; } }
std::cout << endl << "---- FIB ----"<< endl;
for (uint32_t i = 0; i < numNodes; i++) { std::cout << endl << "node(" << i << "):" << endl; auto node = nodes.Get(i); auto& nodePit = node->GetObject<ndn::L3Protocol>()->getForwarder()->getFib(); nfd::Fib::const_iterator iter; for (iter = nodePit.begin(); iter != nodePit.end(); iter++) { { cout << iter->getPrefix(); if(iter->hasNextHops()) { auto& nextHops= iter->getNextHops(); nfd::fib::NextHopList::const_iterator ii; for(ii = nextHops.begin(); ii != nextHops.end(); ii++) cout << " : " << (unsigned) ii->getFace().getId() << endl; } } } }
}
I hope it helps.
Best regards,Hussein
On Tuesday, December 8, 2020, 4:00:06 AM GMT+8, ndnsim-request at lists.cs.ucla.edu <ndnsim-request at lists.cs.ucla.edu> wrote:
Send ndnSIM mailing list submissions to
ndnsim at lists.cs.ucla.edu
To subscribe or unsubscribe via the World Wide Web, visit
http://www.lists.cs.ucla.edu/mailman/listinfo/ndnsim
or, via email, send a message with subject or body 'help' to
ndnsim-request at lists.cs.ucla.edu
You can reach the person managing the list at
ndnsim-owner at lists.cs.ucla.edu
When replying, please edit your Subject line so it is more specific
than "Re: Contents of ndnSIM digest..."
Today's Topics:
1. Re: ndnSIM Digest, Vol 97, Issue 3 (Shuai Dong)
----------------------------------------------------------------------
Message: 1
Date: Mon, 7 Dec 2020 11:34:21 -0600
From: Shuai Dong <sdong7 at crimson.ua.edu>
To: ndnsim at lists.cs.ucla.edu
Subject: Re: [ndnSIM] ndnSIM Digest, Vol 97, Issue 3
Message-ID:
<CAENDnDB1WhW=ENQqpXLm2qjWQPgavj+ZObMZdCXEq3cwnt+Rnw at mail.gmail.com>
Content-Type: text/plain; charset="utf-8"
Hi DJAMA,
Thanks for your information!
In this scenario, when the consumer sends interest with "prefix0", it works
very well and the consumer can receive the data packet.
However, if the consumer sends interest with "prefix1", the log shows that:
"[INFO ] NACK received for: >>>> /prefix1/%FE%01, reason: NoRoute"
"[INFO ] NACK received for: >>>> /prefix1/%FE%02, reason: NoRoute"
"[INFO ] NACK received for: >>>> /prefix1/%FE%03, reason: NoRoute"
"[INFO ] NACK received for: >>>> /prefix1/%FE%04, reason: NoRoute"
"[INFO ] NACK received for: >>>> /prefix1/%FE%05, reason: NoRoute"
........
There are two questions that I cannot understand very well:
1. By default (in wireless environment), ndn can only handle one namespace
on one node? If I want to install a different namespace on the other node,
e.g., "prefix1" on producer2. I need to create a FIB entry for "prefix1" by
myself?
2. How to print the FIB and PTI table for each node?
Thank you very much!
Sincerely
Shuai
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.lists.cs.ucla.edu/pipermail/ndnsim/attachments/20201207/5cffe17c/attachment-0001.html>
------------------------------
Subject: Digest Footer
_______________________________________________
ndnSIM mailing list
ndnSIM at lists.cs.ucla.edu
http://www.lists.cs.ucla.edu/mailman/listinfo/ndnsim
------------------------------
End of ndnSIM Digest, Vol 97, Issue 4
*************************************
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.lists.cs.ucla.edu/pipermail/ndnsim/attachments/20201208/6254d00d/attachment-0001.html>
More information about the ndnSIM
mailing list