[ndnSIM] Reading and Removing Tag in Data Packet

Alex Afanasyev alexander.afanasyev at ucla.edu
Wed Apr 30 21:09:14 PDT 2014


Hi Tun,

You didn't mention what exactly is the problem / error message?

From the code you gave, I see that you assigned result of PeekPacketTag check to `isTag` variable, but used `isQueueTag` variable in the condition.

---
Alex

On Apr 30, 2014, at 1:14 AM, Tun Tun Oo <htunhtunu at gmail.com> wrote:

> Dear Alex,
>  
> In my customize forwarding, I want to send local information of every hop by tagging data packet.
> When router received data, it read tag and then remove it and add it again router information.
> But I found a problem when I remove the tag. Actually I think I cannot remove the tag.
> 
> 
>  MyTag tag; 
>     bool isTag = data->GetPayload()->PeekPacketTag(tag);
>     if (isQueueTag)
>         {
>             read = tag.GetTag();
>             NS_LOG_INFO ("Infomation "<< read << " : received from data > "<< data->GetName());
> 
>             //to remove tag
>             ConstCast<Packet>(data->GetPayload())->RemovePacketTag (tag);
> 
>            if (tag.GetTag != 0)
>                 std::cout << "Cannot Remove the tag in data > "<< data->GetName()<<std::endl;
>          }
> 
> Could you give me an advice how should I do it?
> 
> regards
> TUN
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.lists.cs.ucla.edu/pipermail/ndnsim/attachments/20140430/00d0247e/attachment.html>


More information about the ndnSIM mailing list