<div><div dir="auto">Hi Adhy</div><div dir="auto"><br></div><div dir="auto">You have:</div><div dir="auto">* define the LpHeaderField</div><div dir="auto">* define the Tag</div><div dir="auto">* encode Tag into LpHeaderField in NFD LinkService</div><div dir="auto"><br></div><div dir="auto">You are missing:</div><div dir="auto">* encode Tag into LpHeaderField in ndn-cxx client face (look at ndn-cxx face.cpp and face-impl.hpp)</div><div dir="auto">* decode LpHeaderField into Tag in ndn-cxx client face</div><div dir="auto">* decode LpHeaderField into Tag in NFD LinkService</div><div dir="auto">* copy Tag from incoming packet to outgoing packet (probably no code change is needed for now, but keep in mind that NDNLP is a single-hop protocol and the forwarding plane is not onligated to preserve tags)</div><div dir="auto"><br></div><div dir="auto">If the information is end-to-end, you shouldn't be using NDNLP header field. Put it in the Interest name or Data payload instead.</div><div dir="auto"><br></div><div dir="auto">Yours, Junxiao</div><br><div class="gmail_quote"><div dir="auto">On Thu, Jul 27, 2017 at 13:47 Adhy Satya <<a href="mailto:adhysatya820@gmail.com">adhysatya820@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div></div></blockquote><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br></blockquote><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div>I was able to create a new field in the NDNLP packet.<div><br></div><div>I changed the following files:</div><div>"ndn-cxx/src/lp/fields.hpp"</div><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div>    typedef detail::FieldDecl<field_location_tags::Header,</div><div>                                            uint64_t,</div><div>                                            tlv::CustomTag> CustomTagField;</div><div>    BOOST_CONCEPT_ASSERT((Field<CustomTagField>));</div><div>    </div><div><div>    CustomTagField</div></div><div><div>     > FieldSet;</div></div></blockquote><div><br></div><div>"ndn-cxx/src/lp/tags.hpp"<br></div><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div>typedef SimpleTag<uint64_t, 0x60000001> CustomTag;</div></blockquote><div><br></div><div>"ndn-cxx/src/lp/tlv.hpp"<br></div><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div>CustomTag= 901</div><div><br></div></blockquote><div>compiled with ./waf</div><div><br></div>"NFD/daemon/face/generic-link-service.cpp"<br><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div><div>void</div></div><div><div>GenericLinkService::encodeLocalFields(const ndn::TagHost& netPkt, lp::Packet& lpPacket)</div></div><div><div>{</div></div><div><div>  shared_ptr<lp::IncomingFaceIdTag> incomingFaceIdTag = netPkt.getTag<lp::IncomingFaceIdTag>();</div></div><div><div>  if (incomingFaceIdTag != nullptr) {</div></div><div><div>    lpPacket.add<lp::IncomingFaceIdField>(*incomingFaceIdTag);</div></div><div><div>  }</div></div><div><div><br></div></div><div><div>  shared_ptr<lp::CustomTag> customTag = netPkt.getTag<lp::CustomTag>();</div></div><div><div>  if (customTag != nullptr) {</div></div><div><div>    lpPacket.add<lp::CustomTagField>(*customTag);</div></div><div><div>  }</div></div><div><div>}</div></div></blockquote><div><br></div><div>compiled with ./waf<br></div><div><br></div><div>"ndn-cxx/examples/consumer.cpp"</div><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div><div>    // Insert Packet Tag</div></div><div><div>    interest.setTag(std::make_shared<lp::CustomTag>(54321));</div></div><div><div>    std::cout << "Tag value: " << interest.getTag<lp::CustomTag>() << std::endl;</div></div><div><div><br></div></div><div><div>    m_face.expressInterest(interest,</div></div><div><div>                           bind(&Consumer::onData, this,  _1, _2),</div></div><div><div>                           bind(&Consumer::onTimeout, this, _1));</div></div></blockquote><div><br></div><div>and finally, on the producer app</div><div>"ndn-cxx/examples/producer.cpp"<br></div><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div><div>onInterest(const InterestFilter& filter, const Interest& interest)</div></div><div><div>  {</div></div><div><div>    std::cout << "<< I: " << interest << std::endl;</div></div><div><br></div><div><div>    // Read Packet Tag</div></div><div><div>    std::shared_ptr<lp::CustomTag> tag = interest.getTag<lp::CustomTag>();</div></div><div><div>    std::cerr << "Tag from Consumer: " << tag << std::endl;</div></div></blockquote><div><br></div></div><div>compiled with ./waf<br></div><div>and ran the applications, but the tag doesn't arrive at the producer:</div><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div><div><< I: /example/testApp/randomData?ndn.MustBeFresh=1&ndn.InterestLifetime=1000&ndn.Nonce=1547038398</div></div><div><div>Tag from Consumer: 0</div></div></blockquote><div><br></div><div><br></div><div>Is there anything missing?</div><div><br></div><div><br></div><div>Thank you</div><div><div class="m_8163793525316197569h5"><div><br></div><div class="gmail_extra"><br></div></div></div></div></blockquote></div></div></div></blockquote></div></div>