[ndnSIM] ndnSIM: Modifying Interest Packet

Alex Afanasyev aa at CS.UCLA.EDU
Fri Aug 12 09:45:46 PDT 2016


Hi Pratyush,

You're correct.  I would only restate is a little bit more general and say that NS3's Packet data structure cannot be modified by the routers.  What you can do is to make a copy of the packet and modify the copy.

I think the same applies to the tags with some exceptions that I cannot remember right now.

--
Alex

> On Aug 12, 2016, at 8:32 AM, Pratyush Agnihotri <pratyushagnihotri03 at gmail.com> wrote:
> 
> Hi Alex,
> 
> I am trying to modify Interest packet for my custom forwarding strategy in ndnSIM 1.0. I observed that once the Interest packet (header + payload) is serialized to the network, it cannot be modified by intermediate nodes (e.g., in the forwarding strategy). The packet is only deserialized by relay (or intermediate) nodes and cannot be written (or modified) by them. I checked the source file ndnSIM/model/wire/ndnsim.cc, Serialize() and Deserialize() functions for the same.
> 
> Is my understanding correct? Or, is there some way to write to buffer while the packet is in network?
> 
> For e.g., FwHopCountTag is the by given as example how to add information in payload. If one want to increment the hop count and re-write to payload as follows:-
> 
> FwHopCountTag hopCount;
> 	bool tagExists = packet->RemovePacketTag (hopCount);
> 
> 	if (tagExists)
> 	{
> 	    hopCount.Increment ();
> 		packet->AddPacketTag (hopCount);
>         }
> 
> This tries to increment the hopCount, but it doesn't actually increment if I print the value. This means even though I re-write to the payload, it doesn't update the packet.
> 
> Please let me know.
> 
> --
> Kind Regards,
> Pratyush Agnihotri
> _______________________________________________
> ndnSIM mailing list
> ndnSIM at lists.cs.ucla.edu
> http://www.lists.cs.ucla.edu/mailman/listinfo/ndnsim

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 841 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://www.lists.cs.ucla.edu/pipermail/ndnsim/attachments/20160812/8e4b7ab1/attachment.bin>


More information about the ndnSIM mailing list