<html><head><meta http-equiv="Content-Type" content="text/html charset=iso-8859-1"><base href="x-msg://2267/"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>Hi Xuan</div><div><br></div>Hmmm.  Not sure why it was crashing.  The whole ndn::App wasn't designed to support more than one face, so there could be something weird happening.<div><br></div><div>In any case, I would hate to suggest that, but in the new release of ndnSIM (>=0.5), it is much easier to write full featured NDN applications.  In addition to the existing AppFace, there is a new ApiFace, which allows expressing individual interest and provide callback that will fire when data comes or time out happens, as well as a simple call to "register" prefix.  Basically, the same operations as in the real NDN API.</div><div><br></div><div>However, there would be a lot of changes...  For the shortcut I would suggest eliminate the second face, since it doesn't make much sense. Broadcast or not broadcast is not face "decision", but NDN's forwarding strategy.  That is, as I suggested before, in the DoPropagateInterest you need to treat p2p and broadcast prefixes differently.</div><div><br></div><div>---</div><div>Alex</div><div><div><div><br></div><div><br><div><div>On Sep 10, 2013, at 12:10 PM, "Liu, Xuan (UMKC-Student)" <<a href="mailto:xuan.liu@mail.umkc.edu">xuan.liu@mail.umkc.edu</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div ocsi="0" fpstyle="1" style="font-family: Menlo; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; word-wrap: break-word; "><div style="direction: ltr; font-family: Tahoma; font-size: 10pt; ">Hi Alex,<br><br>Thank you for the reply.<span class="Apple-converted-space"> </span><br><br>You are correct. What I did was create a secondary face into the application, and maybe it's not the correct way to do so.. I checked the original ndn::app and added the secondary face exactly the same way.<span class="Apple-converted-space"> </span><br><br>I will check the way you suggested.<span class="Apple-converted-space"> </span><br><br>void<br>p2pChatApp::StartApplication ()<br>{<br>    NS_LOG_FUNCTION_NOARGS();<br>    NS_ASSERT(GetNode()->GetObject<ndn::Fib>()!=0);<br>    // initialize ndn::App<br>    ndn::App::StartApplication ();<br><br>    // create new face<br>    // step 1. Create a face<br>    m_bcface = CreateObject<ndn::AppFace>(this);<br>    // step 2. add face to ndn stack<br>    GetNode()->GetObject<ndn::L3Protocol>()->AddFace(m_bcface);<br>    // step 3. enable face<br>    m_bcface->SetUp(true);<br><br><br>    // Get Node Name<br>    Ptr<Node> node = GetNode();<br>    m_nodeName = Names::FindName(node);<br>    NS_LOG_DEBUG("This node's name is "<<m_nodeName);<br>    InitDigestTree(); // Initialize the digest tree<br>    InitialDigestLog();    // Initialize the digest log<br>    Ptr<ndn::Fib> fib = GetNode ()->GetObject<ndn::Fib> ();<br>    // Add application prefix to the fib<br>    Ptr<ndn::fib::Entry> fibEntry = fib->Add (m_nodePrefix, m_face, 0);<br>    // Add broadcasting prefix to the fib<br>    Ptr<ndn::fib::Entry> fibEntry2 = fib->Add (m_broadcastPrefix, m_bcface, 0);<br><br>    fibEntry->UpdateStatus (m_face, ndn::fib::FaceMetric::NDN_FIB_GREEN);<br>    fibEntry2->UpdateStatus (m_bcface, ndn::fib::FaceMetric::NDN_FIB_GREEN);<br><br>    ScheduleNextContent();<br>    ScheduleNextSyncInterest();<br><br>}<br><div><br><div style="font-family: Tahoma; font-size: 13px; "><div class="BodyFragment"><font size="2"><span style="font-size: 10pt; "><div class="PlainText">The node can get broadcast interests, and send point to point interest as well. However, when the nodes tried to send out the content respect to some incoming interest (not the broadcast one), it got stuck...<br><br>Please note that I'm using the old version of ndnSIM..<span class="Apple-converted-space"> </span><br><br>// Create packet and add header and trailer<br>   Ptr<Packet> packet = Create<Packet> (1024);<br>   packet->AddHeader (contentData);<br>   packet->AddTrailer (trailer);<br><br>   NS_LOG_INFO (m_nodeName<<": Sending ContentObject packet for " << contentData.GetName ());<br><br>   // Forward packet to lower (network) layer<br>   m_protocolHandler (packet);<br><br>   // Call trace (for logging purposes)<br>  m_transmittedContentObjects (&contentData, packet, this, m_face);<br><br><br></div><div class="PlainText">Thanks,</div><div class="PlainText"><br></div><div class="PlainText"><span class="Apple-tab-span" style="white-space: pre; "></span>-- Xuan</div><div class="PlainText"><br><hr></div><div class="PlainText"><span style="font-size: 10pt; ">Xuan Liu</span></div><div class="PlainText"> <br>PhD Student<br>Graduate Research Assistant<br>Department of Computer Science & Electrical Engineering<br>University of Missouri - Kansas city<br><a href="mailto:xuan.liu@mail.umkc.edu">xuan.liu@mail.umkc.edu</a><br><br><br></div></span></font></div></div></div><div style="font-family: 'Times New Roman'; font-size: 16px; "><hr tabindex="-1"><div id="divRpF941864" style="direction: ltr; "><font size="2" face="Tahoma"><b>From:</b><span class="Apple-converted-space"> </span>Alexander Afanasyev [<a href="mailto:cawka1@gmail.com">cawka1@gmail.com</a>] on behalf of Alex Afanasyev [<a href="mailto:alexander.afanasyev@ucla.edu">alexander.afanasyev@ucla.edu</a>]<br><b>Sent:</b><span class="Apple-converted-space"> </span>Tuesday, September 10, 2013 12:30 PM<br><b>To:</b><span class="Apple-converted-space"> </span>Liu, Xuan (UMKC-Student)<br><b>Cc:</b><span class="Apple-converted-space"> </span><a href="mailto:ndnsim@lists.cs.ucla.edu">ndnsim@lists.cs.ucla.edu</a><br><b>Subject:</b><span class="Apple-converted-space"> </span>Re: [ndnSIM] how to set the broadcasting prefix<br></font><br></div><div></div><div><div>Hi Xuan,</div><div><br></div>What I meant is to modify implementation of DoPropagateInterest method in model/fw/best-route.cc.  Instead of always following the same logic for all prefixes, you can check if pitEntry->GetFibEntry ()->GetPrefix () == ndn::Name("/ndn/broadcast"), and if so forward interest to all faces for the fib entry, instead of just "the best" one.<div><br></div><div>I'm not quite sure what exactly you did, it could help if you could show an example.  But I tend to think that the behavior you want should be part of the strategy layer, not the application (I'm guessing that you add the secondary face into the application..., could be wrong).</div><div><br></div><div>---</div><div>Alex</div><div><div><br></div><div><br><div><div>On Sep 9, 2013, at 11:04 AM, "Liu, Xuan (UMKC-Student)" <<a href="mailto:xuan.liu@mail.umkc.edu" target="_blank">xuan.liu@mail.umkc.edu</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="font-family: Menlo; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; word-wrap: break-word; "><div style="direction: ltr; font-family: Tahoma; font-size: 10pt; ">Hi Alex,<div><br></div><div>Thank you. What do you mean by "hack BestRoute strategy"?  </div><div><br></div><div>In my code, I tried to create a secondary face for broadcasting, which is assigned a common prefix, for example "ndn/broadcasting", the the default face "m_face" is assigned specific prefix for the content. The node is able to receive the broadcasting interest, and content interest, but when the node tried to send out content, it crashed. I'm not sure where was wrong. </div><div><div><div style="font-family: Tahoma; font-size: 13px; "><div class="BodyFragment"><font size="2"><span style="font-size: 10pt; "><div class="PlainText"><br></div><div class="PlainText">Thanks,</div><div class="PlainText"><br></div><div class="PlainText"><span class="Apple-tab-span" style="white-space: pre; "></span>-- Xuan</div><div class="PlainText"><br></div><div class="PlainText"><br></div></span></font></div></div></div><div style="font-family: 'Times New Roman'; font-size: 16px; "><hr tabindex="-1"><div id="divRpF464520" style="direction: ltr; "><font size="2" face="Tahoma"><b>From:</b><span class="Apple-converted-space"> </span>Alexander Afanasyev [<a href="mailto:cawka1@gmail.com" target="_blank">cawka1@gmail.com</a>] on behalf of Alex Afanasyev [<a href="mailto:alexander.afanasyev@ucla.edu" target="_blank">alexander.afanasyev@ucla.edu</a>]<br><b>Sent:</b><span class="Apple-converted-space"> </span>Monday, September 09, 2013 12:25 PM<br><b>To:</b><span class="Apple-converted-space"> </span>Liu, Xuan (UMKC-Student)<br><b>Cc:</b><span class="Apple-converted-space"> </span><a href="mailto:ndnsim@lists.cs.ucla.edu" target="_blank">ndnsim@lists.cs.ucla.edu</a><br><b>Subject:</b><span class="Apple-converted-space"> </span>Re: [ndnSIM] how to set the broadcasting prefix<br></font><br></div><div></div><div>Hi Xuan,<div><br></div><div>As of right now, the type of Interest processing does not depend on specific prefix and is fully defined by the forwarding strategy.  If you select Flooding, then for all prefixes that have multiple faces in FIB, you going to have broadcast behavior.  In our simulation we actually used this strategy, assuming that chat data is piggybacked along the SyncData.</div><div><br></div><div>It is relatively simple to enable different processing for different prefixes, but this would involve creating a new strategy, which combines Flooding and BestRoute behaviors, depending on FIB prefix.  As a shortcut, you can simply hack the BestRoute strategy for that.</div><div><br></div><div>---</div><div>Alex</div><div><br><div><div>On Sep 7, 2013, at 6:10 PM, "Liu, Xuan (UMKC-Student)" <<a href="mailto:xuan.liu@mail.umkc.edu" target="_blank">xuan.liu@mail.umkc.edu</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="font-family: Menlo; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; "><div style="direction: ltr; font-family: Tahoma; font-size: 10pt; ">Hi Alex,<div><br></div><div>I have a question on how to set the prefix for broadcasting in ndnSIM. For example, my application is generating two types of interest, one type is sent out in broadcasting way, and the other type has a specific prefix. Do I need to create two fib entry at the application level? Or shall I create another face at the application level, and assign the broadcasting prefix to this second face? </div><div><br></div><div>In your chronoschat simulation, did you use /ndn/broadcasting/ as the prefix for broadcasting? Or did you use same prefix for all participant nodes?<br><div><br><div style="font-family: Tahoma; font-size: 13px; "><div class="BodyFragment"><font size="2"><span style="font-size: 10pt; "><div class="PlainText"><br></div><div class="PlainText">Thanks,</div><div class="PlainText"><br></div><div class="PlainText"><span class="Apple-tab-span" style="white-space: pre; "></span>-- Xuan</div></span></font></div></div></div></div></div></div></blockquote></div></div></div></div></div></div></div></blockquote></div><br></div></div></div></div></div>_______________________________________________<br>ndnSIM mailing list<br><a href="mailto:ndnSIM@lists.cs.ucla.edu">ndnSIM@lists.cs.ucla.edu</a><br><a href="http://www.lists.cs.ucla.edu/mailman/listinfo/ndnsim">http://www.lists.cs.ucla.edu/mailman/listinfo/ndnsim</a></div></blockquote></div><br></div></div></div></body></html>