<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Nov 19, 2016, at 6:04 PM, John Baugh <<a href="mailto:jpbaugh@umich.edu" class="">jpbaugh@umich.edu</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">Greetings again ndnSIM friends,<div class=""><br class=""></div><div class="">What is the appropriate way to identify what interface a particular Data packet is received (or sent?) on?</div><div class=""><br class=""></div><div class="">Here's a scenario:</div><div class=""><br class=""></div><div class="">Assume there is a router, R with a Content Store, between a producer, P, and several consumers, C1, C2, C3, ..., C<i class="">n</i>.  </div></div></div></blockquote><div><br class=""></div><div>This depends on your topology.  If you're using PointToPoint links (this is the case in in most of the examples), then you will have a dedicated link between producer and consumers and, consequently, a dedicated face.</div><div><br class=""></div><div>If you're simulating a multi-access link (e.g., WiFi scenarios), then it is not the case.</div><br class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><div class=""><br class=""></div><div class="">Will the router naturally have a single interface exposed for each consumer?  Or can multiple consumers communicate over the same interface (e.g., send Interests across the same interface/Face)?</div><div class=""><br class=""></div><div class="">I'd like to be able to determine how much and which data arrives on a particular interface.  I suppose I somehow need to obtain a FaceId, and somehow determine which Data arrives on that face?  Also, I need to be able to distinguish between Faces among applications and NFD, and between NFD and the "outside world" - i.e., which are ACTUALLY network interfaces.</div></div></div></blockquote><div><br class=""></div><div>The answer depends on where you want to achieve this function.  If you're looking at the logs, the Face associated with the NetDevice identifies itself as <a href="netdev://[<mac-addr>" class="">netdev://[<mac-addr></a>]" (netdev prefix).  If you have a pointer/reference to the face and want to determine whether it is one to the outside world, you can use dynamic_cast:</div><div><br class=""></div><div>Face* face = ...;</div><div>if (dynamic_cast<NetDeviceLinkService*>(face->getLinkService()) != nullptr) {</div><div>  // do stuff</div><div>}</div><div><br class=""></div><div>--</div><div>Alex</div><br class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><div class=""><br class=""></div><div class="">Ideas?</div><div class=""><br class=""></div><div class="">Thanks,</div><div class=""><br class=""></div><div class="">John</div><div class=""><br class=""></div><div class="">P.S. - I am slowly, but surely, understanding this simulator much better, and I appreciate all of your patience.  I am currently working on a very thorough tutorial/reference for myself, and once somewhat refined with very good examples I will release it to the community to help people get up to speed even fast - at least that's the goal.</div></div>
_______________________________________________<br class="">ndnSIM mailing list<br class=""><a href="mailto:ndnSIM@lists.cs.ucla.edu" class="">ndnSIM@lists.cs.ucla.edu</a><br class="">http://www.lists.cs.ucla.edu/mailman/listinfo/ndnsim<br class=""></div></blockquote></div><br class=""></body></html>