<div dir="ltr"><div>Dear Alex,</div><div>Sorry,it is my typing error.</div><div>The correct code is:</div><div>MyTag tag; <br>    bool isTag = data->GetPayload()->PeekPacketTag(tag);<br>    if (isTag)<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>
           if (tag.GetTag () != 0)<br>                std::cout << "Cannot Remove the tag in data > "<< data->GetName()<<std::endl;<br>          }</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><div class="gmail_extra">TUN<br></div><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 class="h5"><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>