[ndnSIM] Re: ndnsim-contentobject
alexander.afanasyev at ucla.edu
Mon May 20 22:24:39 PDT 2013
I'm not sure what is the behavior you're trying to achieve. Even if a node replaces content name (which is OK for the simulator, but would violate data packet signature in a real systems), the node to which you going to forward this packet would simply drop it, since there will be no corresponding PIT entry.
If you really want to do replacement, you can try to create a custom forwarding strategy (here is an example http://ndnsim.net/fw.html#example-of-using-custom-strategy), overriding OnData method something like this:
YourStrategy::OnData (Ptr<Face> inFace,
Ptr<const ContentObject> header,
Ptr<const Packet> origPacket)
if (header->GetName () == Name ("/aaaa"))
Ptr<ContentObject> newheader = Create<ContentObject> (*header);
Ptr<Packet> newPacket = Create<Packet> (*payload);
return your_base_strategy::OnData (inFace, header, payload, newPacket);
On May 20, 2013, at 8:22 PM, 1116 lypp <lypp1116 at gmail.com> wrote:
> Hi Alex,
> There is a topology running in my ndnsim, I want to replace the content name when the node received the data packet.
> For example, when the node received the data with the prefix "/aaaaa", I want to replace the name with "/bbbbb".
> Could you tell me how to do this?
> Best regards,
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the ndnSIM