[ndnSIM] how to set the broadcasting prefix

Alex Afanasyev alexander.afanasyev at ucla.edu
Thu Sep 12 10:35:38 PDT 2013


Hi Xuan

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.

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.

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.

---
Alex


On Sep 10, 2013, at 12:10 PM, "Liu, Xuan (UMKC-Student)" <xuan.liu at mail.umkc.edu> wrote:

> Hi Alex,
> 
> Thank you for the reply. 
> 
> 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. 
> 
> I will check the way you suggested. 
> 
> void
> p2pChatApp::StartApplication ()
> {
>     NS_LOG_FUNCTION_NOARGS();
>     NS_ASSERT(GetNode()->GetObject<ndn::Fib>()!=0);
>     // initialize ndn::App
>     ndn::App::StartApplication ();
> 
>     // create new face
>     // step 1. Create a face
>     m_bcface = CreateObject<ndn::AppFace>(this);
>     // step 2. add face to ndn stack
>     GetNode()->GetObject<ndn::L3Protocol>()->AddFace(m_bcface);
>     // step 3. enable face
>     m_bcface->SetUp(true);
> 
> 
>     // Get Node Name
>     Ptr<Node> node = GetNode();
>     m_nodeName = Names::FindName(node);
>     NS_LOG_DEBUG("This node's name is "<<m_nodeName);
>     InitDigestTree(); // Initialize the digest tree
>     InitialDigestLog();    // Initialize the digest log
>     Ptr<ndn::Fib> fib = GetNode ()->GetObject<ndn::Fib> ();
>     // Add application prefix to the fib
>     Ptr<ndn::fib::Entry> fibEntry = fib->Add (m_nodePrefix, m_face, 0);
>     // Add broadcasting prefix to the fib
>     Ptr<ndn::fib::Entry> fibEntry2 = fib->Add (m_broadcastPrefix, m_bcface, 0);
> 
>     fibEntry->UpdateStatus (m_face, ndn::fib::FaceMetric::NDN_FIB_GREEN);
>     fibEntry2->UpdateStatus (m_bcface, ndn::fib::FaceMetric::NDN_FIB_GREEN);
> 
>     ScheduleNextContent();
>     ScheduleNextSyncInterest();
> 
> }
> 
> 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...
> 
> Please note that I'm using the old version of ndnSIM.. 
> 
> // Create packet and add header and trailer
>    Ptr<Packet> packet = Create<Packet> (1024);
>    packet->AddHeader (contentData);
>    packet->AddTrailer (trailer);
> 
>    NS_LOG_INFO (m_nodeName<<": Sending ContentObject packet for " << contentData.GetName ());
> 
>    // Forward packet to lower (network) layer
>    m_protocolHandler (packet);
> 
>    // Call trace (for logging purposes)
>   m_transmittedContentObjects (&contentData, packet, this, m_face);
> 
> 
> Thanks,
> 
> -- Xuan
> 
> Xuan Liu
>  
> PhD Student
> Graduate Research Assistant
> Department of Computer Science & Electrical Engineering
> University of Missouri - Kansas city
> xuan.liu at mail.umkc.edu
> 
> 
> From: Alexander Afanasyev [cawka1 at gmail.com] on behalf of Alex Afanasyev [alexander.afanasyev at ucla.edu]
> Sent: Tuesday, September 10, 2013 12:30 PM
> To: Liu, Xuan (UMKC-Student)
> Cc: ndnsim at lists.cs.ucla.edu
> Subject: Re: [ndnSIM] how to set the broadcasting prefix
> 
> Hi Xuan,
> 
> 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.
> 
> 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).
> 
> ---
> Alex
> 
> 
> On Sep 9, 2013, at 11:04 AM, "Liu, Xuan (UMKC-Student)" <xuan.liu at mail.umkc.edu> wrote:
> 
>> Hi Alex,
>> 
>> Thank you. What do you mean by "hack BestRoute strategy"?  
>> 
>> 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. 
>> 
>> Thanks,
>> 
>> -- Xuan
>> 
>> 
>> From: Alexander Afanasyev [cawka1 at gmail.com] on behalf of Alex Afanasyev [alexander.afanasyev at ucla.edu]
>> Sent: Monday, September 09, 2013 12:25 PM
>> To: Liu, Xuan (UMKC-Student)
>> Cc: ndnsim at lists.cs.ucla.edu
>> Subject: Re: [ndnSIM] how to set the broadcasting prefix
>> 
>> Hi Xuan,
>> 
>> 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.
>> 
>> 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.
>> 
>> ---
>> Alex
>> 
>> On Sep 7, 2013, at 6:10 PM, "Liu, Xuan (UMKC-Student)" <xuan.liu at mail.umkc.edu> wrote:
>> 
>>> Hi Alex,
>>> 
>>> 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? 
>>> 
>>> In your chronoschat simulation, did you use /ndn/broadcasting/ as the prefix for broadcasting? Or did you use same prefix for all participant nodes?
>>> 
>>> 
>>> Thanks,
>>> 
>>> -- Xuan
> 
> _______________________________________________
> ndnSIM mailing list
> ndnSIM at lists.cs.ucla.edu
> http://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/20130912/2540d1f1/attachment.html>


More information about the ndnSIM mailing list