<div dir="ltr"><div>Dear Alex,</div><div><br></div><div class="gmail_extra">Let me explain about my problem with packet tagging.</div><div class="gmail_extra">In my simple scenario, R3 has q=30 and R3 tagged to Data packet.</div>
<div class="gmail_extra">When tagged-Data is received by R2,it read tag and have to remove before adding its (q=20) to Data packet. If I correctly understand, it supposed to be received q=30 at R2 and q=20 at R1. </div><div class="gmail_extra">
Now I can receive q=30 at R2 but unfortunately I also receive q=30 at R1. As my understanding I think, I cannot remove that tag after reading.</div><div class="gmail_extra">Could you help me to solve and please advice me what I am misunderstanding.<br>
       +---------+                      +--------+                     +---------+<br>       |R1(q=10) | <---Data----- |R2(q=20)| <----Data  ---|R3(q=30)|<br>      +---------+                       +--------+                     +----------+<br>
</div><div class="gmail_extra"><br></div><div class="gmail_extra">For reading and removing tag at OnData  </div><div class="gmail_extra">*********************************</div><div class="gmail_extra"> bool isTag = data->GetPayload()->PeekPacketTag(tag);<br>
    if (isTag)<div class="im">        {<br>             read = tag.GetTag();<br>            NS_LOG_INFO ("Infomation "<< read << " : received from data > "<< data->GetName());<br>
            //to remove tag<br>            ConstCast<Packet>(data->GetPayload())->RemovePacketTag (tag);<br></div>           if (tag.GetTag () != 0)<div class="im">                std::cout << "Cannot Remove the tag in data > "<< data->GetName()<<std::endl;<br>
          }</div></div><div class="gmail_extra"><br></div><div class="gmail_extra">For adding tag to Data (SatisfyPendingInterest)</div><div class="gmail_extra">********************************************</div><div class="gmail_extra">
if (data!=0)</div><div class="gmail_extra">{</div><div class="gmail_extra">MyTag tag;</div><div class="gmail_extra">NS_LOG_INFO ("Infomation "<< q << " : send to data > "<< data->GetName());</div>
<div class="gmail_extra">tag.SetTag (q);</div><div class="gmail_extra">data->GetPayload()->AddPacketTag (tag);</div><div class="gmail_extra">}</div><div class="gmail_extra"><br></div><div class="gmail_extra">Thanks for your help.</div>
<div class="gmail_extra">Regards</div><div class="gmail_extra">TUN</div><div class="gmail_extra"><br></div><div class="gmail_extra"><br></div><div class="gmail_extra"><br></div><div class="gmail_quote">On Thu, May 1, 2014 at 3:47 PM, Tun Tun Oo <span dir="ltr"><<a href="mailto:htunhtunu@gmail.com" target="_blank">htunhtunu@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;padding-left:1ex;border-left-color:rgb(204,204,204);border-left-width:1px;border-left-style:solid"><div dir="ltr"><div>Dear Alex,</div><div>Sorry,it is my typing error.</div>
<div>The correct code is:</div><div><div>MyTag tag; <br>    bool isTag = data->GetPayload()->PeekPacketTag(tag);<br></div>    if (isTag)<div><br>        {<br>
            read = tag.GetTag();<br>            NS_LOG_INFO ("Infomation "<< read << " : received from data > "<< data->GetName());<br>            //to remove tag<br>            ConstCast<Packet>(data->GetPayload())->RemovePacketTag (tag);<br>
</div>
           if (tag.GetTag () != 0)<div><br>                std::cout << "Cannot Remove the tag in data > "<< data->GetName()<<std::endl;<br>          }</div></div><div>When I received the data, firstly I read it using PeekPacketTag(tag).</div>

<div>After reading it, I want to remove the tag using RemovePacketTag (tag).</div><div>In the last line, I check it remove or not, but I received "Cannot Remove the tag in the data".</div><div>If I am correctly understand, whenever I get this line of "Cannot Remove Tag...", I cannot remove the tag. </div>

<div>My problem is I always received this message (except actual tagged data zero) and therefore I cannot add new data to tag.</div><div>Why I cannot remove this tag?</div><div>Thanks a lot for your help.</div><div class="gmail_extra">

<br>Regards</div><span><font color="#888888"><div class="gmail_extra">TUN<br></div></font></span><div><div class="h5"><div class="gmail_quote">On Thu, May 1, 2014 at 1:09 PM, Alex Afanasyev <span dir="ltr"><<a href="mailto:alexander.afanasyev@ucla.edu" target="_blank">alexander.afanasyev@ucla.edu</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;padding-left:1ex;border-left-color:rgb(204,204,204);border-left-width:1px;border-left-style:solid"><div><div>Hi Tun,</div><div><br></div><div>You didn't mention what exactly is the problem / error message?</div>

<div><br></div><div>From the code you gave, I see that you assigned result of PeekPacketTag check to `isTag` variable, but used `isQueueTag` variable in the condition.</div><div><br></div><div>---</div><div>Alex</div><br>

<div><div><div>On Apr 30, 2014, at 1:14 AM, Tun Tun Oo <<a href="mailto:htunhtunu@gmail.com" target="_blank">htunhtunu@gmail.com</a>> wrote:</div><br></div><div><div><blockquote type="cite"><div dir="ltr">
<div><div><div><div>Dear Alex,<br> <br></div>In my customize forwarding, I want to send local information of every hop by tagging data packet.<br></div>When router received data, it read tag and then remove it and add it again router information.<br>



</div>But I found a problem when I remove the tag. Actually I think I cannot remove the tag.<br><table cellpadding="0"><tbody><tr><td colspan="2"><span></span><br></td><td colspan="2">
<span><span></span></span><br> MyTag tag; <br>    bool isTag = data->GetPayload()->PeekPacketTag(tag);<br>    if (isQueueTag)<br>        {<br>            read = tag.GetTag();<br>            NS_LOG_INFO ("Infomation "<< read << " : received from data > "<< data->GetName());<br>



<br>            //to remove tag<br>            ConstCast<Packet>(data->GetPayload())->RemovePacketTag (tag);<br><br>           if (tag.GetTag != 0)<br>                std::cout << "Cannot Remove the tag in data > "<< data->GetName()<<std::endl;<br>



         }<br></td></tr></tbody></table><br></div>Could you give me an advice how should I do it?<br><div><div><br></div><div>regards<br></div><div>TUN</div></div></div></blockquote></div></div></div></div></blockquote></div>

<div class="gmail_extra"><br></div></div></div></div>
</blockquote></div><div class="gmail_extra"><br></div></div>