[ndnSIM] Question on sending packets via netdeviceface
Spyridon (Spyros) Mastorakis
spiros.mastorakis at gmail.com
Thu Jan 15 18:25:19 PST 2015
Hello Yali,
please use the “answer-all” option when your answer, so that the email exchange is visible to all the subscribers of the mailing list.
An easy way to create a special Interest packet is to include a special name prefix to your Interests. To that end, you need to specify the following to your simulation scenario (assuming a Cbr Consumer application):
// Consumer
ndn::AppHelper consumerHelper ("ns3::ndn::ConsumerCbr");
consumerHelper.SetPrefix (“/hello");
Then, you will need to modify the OnInterest method of the apps/ndn-producer.cc <http://ndn-producer.cc/>, in order to handle this special Interest in the way that you want when it reaches a producer.
--
Spyridon (Spyros) Mastorakis
Personal Website: http://cs.ucla.edu/~mastorakis/
Internet Research Laboratory
PhD Computer Science
UCLA
> On Jan 15, 2015, at 5:39 PM, Yali Wang <ylwang at soe.ucsc.edu> wrote:
>
> Thanks.
> I know what you meant, but how to reset a new interest in my hello message case? That's what I asked.
> Can you please write an example?
> There are too many new parameters,
> difficult for me to follow without example.
> Yali
>
> On Jan 15, 2015 5:32 PM, "Spyridon (Spyros) Mastorakis" <spiros.mastorakis at gmail.com <mailto:spiros.mastorakis at gmail.com>> wrote:
> Hello Yali,
>
> I forward your email to the ndnSIM maliing list in order to be visible to all the ndnSIM users.
>
> Regarding your question:
>
> This error means that the packet, which is received, has a header that cannot be recognized by ndnSIM. ndnSIM implements the communication model of NDN where two types of packets are defined: The Interest and the data packet. Hello packets are not defined.
>
> Therefore, if a packet is neither an Interest nor a Data packet, the communication paradigm is violated.
> If you really want to exchange Hello packets though, you will need either to specify a special Interest packet for this purpose (i.e., change the Interest class) and handle this Interest packet in a special way or to hack somehow the wire encoding/decoding methods and the face class in order to encode, decode and accept, respectively, packets other than Interest and Data.
>
> Hope this helps.
>
> --
> Spyridon (Spyros) Mastorakis
> Personal Website: http://cs.ucla.edu/~mastorakis/ <http://cs.ucla.edu/~mastorakis/>
> Internet Research Laboratory
> PhD Computer Science
> UCLA
>
>
>
>
>> On Jan 15, 2015, at 4:54 PM, Yali Wang <ylwang at soe.ucsc.edu <mailto:ylwang at soe.ucsc.edu>> wrote:
>>
>> Hello,
>>
>> I want to send to all neighbors the periodic Hello message(regular packet) via ndn-netdevice-face class, and it works fine. but it gets stuck on header part.
>> I don't know what to put in header part. Here is my definition of packet:
>>
>> m_packet = Create<Packet> (reinterpret_cast<const uint8_t*> (str), size);
>>
>> Ndnsim needs the wire encoding(0x01,0xD2 as interest-ccnb) to decide if receives the interest or data. How to solve my issue? I only want to send hello messages.
>> As below, it is error message from ndn-face.cc <http://ndn-face.cc/>
>>
>> msg="Unknown NDN header. Should not happen", file=../src/ndnSIM/model/ndn-face.cc <http://ndn-face.cc/>, line=196
>> libc++abi.dylib: terminating with uncaught exception of type ns3::ndn::UnknownHeaderException
>> Command ['/Users/yawang/ndnSIM/ns-3/build/src/ndnSIM/examples/ns3-dev-ndn-grid-topo-plugin-debug'] terminated with signal SIGIOT. Run it under a debugger to get more information (./waf --run <program> --command-template="gdb --args %s <args>").
>>
>>
>> Thank you!
>> Yali
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.lists.cs.ucla.edu/pipermail/ndnsim/attachments/20150115/5657be66/attachment.html>
More information about the ndnSIM
mailing list