<html><head><meta http-equiv="Content-Type" content="text/html charset=iso-8859-1"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>Hi Alice,</div><div><br></div><div>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.</div><div><br></div><div>If you really want to do replacement, you can try to create a custom forwarding strategy (here is an example <a href="http://ndnsim.net/fw.html#example-of-using-custom-strategy">http://ndnsim.net/fw.html#example-of-using-custom-strategy</a>), overriding OnData method something like this:</div><div><br></div><div>void</div><div>YourStrategy::OnData (Ptr<Face> inFace,</div>                      Ptr<const ContentObject> header,<br>                      Ptr<Packet> payload,<br>                      Ptr<const Packet> origPacket)<div>{</div><div>   if (header->GetName () == Name ("/aaaa"))</div><div>   {</div><div>       Ptr<ContentObject> newheader = Create<ContentObject> (*header);</div><div>       header->SetName ("/bbbb");</div><div>       Ptr<Packet> newPacket = Create<Packet> (*payload);</div><div>       newPacket->AddHeader (*newheader);</div><div><br></div><div>       return your_base_strategy::OnData (inFace, header, payload, newPacket);</div><div>   }</div><div>}</div><div><br></div><div>---</div><div>Alex</div><div><br><div><div>On May 20, 2013, at 8:22 PM, 1116 lypp <<a href="mailto:lypp1116@gmail.com">lypp1116@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div dir="ltr"><div>Hi Alex,</div><div> </div><div>There is a topology running in my ndnsim, I want to replace the content name when the node received the data packet.</div><div> </div><div>For example, when the node received the data with the prefix "/aaaaa", I want to replace the name with "/bbbbb".</div>
<div> </div><div>Could you tell me how to do this?</div><div> </div><div>Thanks</div><div> </div><div>Best regards,</div><div>Alice</div></div>
</blockquote></div><br></div></body></html>