[ndnSIM] Change of interest in forwarding class

ioannoa at scss.tcd.ie ioannoa at scss.tcd.ie
Tue Dec 17 11:33:38 PST 2013


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