[ndnSIM] Change of interest in forwarding class

Alex Afanasyev alexander.afanasyev at ucla.edu
Wed Dec 18 13:11:41 PST 2013


Hi Andriana,

Updating ndn::Interest abstraction is not enough, since it is only abstraction and whenever Interest is send out to another node it gets serialized to the wire format and then deserialized to the abstraction on the other node.

What you need is to amend ndnSIM packet format, in terms of defining how exactly your new fields fits into the packet and in terms of implementing this change.  In particular, assuming you're using the default packet format, you need to update Interest::GetSerializedSize, Interest::Serialize, and Interest::Deserialize methods in https://github.com/NDN-Routing/ndnSIM/blob/master/model/wire/ndnsim.cc#L102.

---
Alex

On Dec 17, 2013, at 11:33 AM, ioannoa at scss.tcd.ie wrote:

> hello everyone,
> 
> I am trying to update my interest along the forwarding path by including
> an additional field on it. The value changes in the TrySendOutInterest
> function using the copy Interest constructor, the value is called dcValue:
> //----------------------------------------------------------
>    Interest::Interest (const Interest &interest)//(+) : m_name           
> (Create<Name> (interest.GetName ()))
>    , m_scope            (interest.m_scope)
>    , m_interestLifetime (interest.m_interestLifetime)
>    , m_nonce            (interest.m_nonce)
>    , m_dcValue          (interest.dcValue)//(+)
>    , m_nackType         (interest.m_nackType)
>    , m_exclude          (interest.m_exclude ? Create<Exclude>
> (*interest.GetExclude ()) : 0)
>    , m_payload          (interest.GetPayload ()->Copy ())
>    , m_wire             (0)
>    {
>        NS_LOG_FUNCTION ("correct copy constructor with dc value");
>    }
> //----------------------------------------------------------
> 
> My TrySendOutInterest is listed below:
> 
> //----------------------------------------------------------
> bool
> ForwardingStrategy::TrySendOutInterest (Ptr<Face> inFace,
>                                        Ptr<Face> outFace,
>                                        Ptr<const Interest> interest,
> Ptr<pit::Entry> pitEntry)
> {
>  if (!CanSendOutInterest (inFace, outFace, interest, pitEntry))
>    {
>      return false;
>    }
> 
>  pitEntry->AddOutgoing (outFace);
>  Ptr<Node> node = m_pit->GetObject <Node> ();
> 
>  bool successSend = false;
>  Ptr<Interest> new_interest;
>  //transmission
>  if (((int)interest->GetDcValue()) < ((int) numberOfNeighbors(node))) {
>      new_interest->SetDcValue(numberOfNeighbors(node));
>      new_interest->SetNonce (1000);//(+) -------
>      successSend = outFace->SendInterest (new_interest);
>  }
>  else
>  {
>      new_interest = Create<Interest> (*interest);
>      successSend = outFace->SendInterest (new_interest);
>  }
>  if (!successSend)
>  {
>      m_dropInterests (interest, outFace);
> }
>    DidSendOutInterest (inFace, outFace, new_interest, pitEntry);
> 
>  return true;
> //----------------------------------------------------------
> 
> The issue is that every time the Interest comes on the next node the
> additional value (of dc) is not updated but is equal to zero as stated in
> the Interest constructor. Why is not the update propagated to the next
> node? What is that i am missing? I checked the interest nonce in order to
> verify that the copy constructor works ok. The nonce value is updated and
> propagated as required - changed - at the next node but not the dcValue
> one.
> 
> In the Interest classes i have only stated the SetDcValue and GetDcValue
> functions as well as including the dcValue in the constructor. I haven't
> though changed any other functions, maybe this is sty required to do?
> 
> Any help?
> 
> Kind regards,
> Andriana.
> 




More information about the ndnSIM mailing list