[ndnSIM] Fwd: Convert Name of Interest

bouchrit leila bouchritleila at gmail.com
Thu Jul 18 13:16:20 PDT 2019


Thank you Xinyu Ma for reply ,
I used this instruction and i use a hash function to return an integer but
it displays the following error:

+0.000000000s 0 ndn.Consumer:Consumer()
+0.000000000s 3 ndn.Producer:Producer()
+0.000000000s 0 ndn.Consumer:StartApplication()
+0.000000000s 4 ndn.Producer:Producer()
+0.000000000s 0 ndn.Consumer:SendPacket()
+0.000000000s 0 ndn.Consumer:SendPacket(): [INFO ] > Interest for 0
+0.000000000s 0 ndn.Consumer:WillSendOutInterest(): [DEBUG] Trying to add 0
with +0.0ns. already 0 items
+0.000000000s 3 ndn.Producer:StartApplication()
+0.000000000s 3 ndn.Producer:StartApplication(): [INFO ] node(3)
+0.000000000s 0 ndn.Consumer:OnNack(): [INFO ] NACK received for:
/CSU/hello/%FE%00, reason: NoRoute
+0.000000000s 4 ndn.Producer:StartApplication()
+0.000000000s 4 ndn.Producer:StartApplication(): [INFO ] node(4)
+0.010000000s 0 ndn.Consumer:SendPacket()
+0.010000000s 0 ndn.Consumer:SendPacket(): [INFO ] > Interest for 1
+0.010000000s 0 ndn.Consumer:WillSendOutInterest(): [DEBUG] Trying to add 1
with +10000000.0ns. already 1 items
+0.020000000s 0 ndn.Consumer:SendPacket()
+0.020000000s 0 ndn.Consumer:SendPacket(): [INFO ] > Interest for 2
+0.020000000s 0 ndn.Consumer:WillSendOutInterest(): [DEBUG] Trying to add 2
with +20000000.0ns. already 2 items
interest conversion = /CSU/hello/%FE%01
Command
['/home/leila/ndnSIM/ns-3/build/src/ndnSIM/examples/ns3-dev-HashStrategy1-debug']
terminated with signal SIGFPE. Run it under a debugger to get more
information (./waf --run <program> --command-template="gdb --args %s
<args>").

*here is my hash function:*
size_t hashing(std::string str,int n)
{
    std::hash<std::string> hash_fn;
    size_t str_hash = ((hash_fn(str)% n));
    return str_hash;
}

thank you for help.



Le jeu. 18 juil. 2019 à 20:37, Xinyu Ma <bitmxy at gmail.com> a écrit :

> Hello,
>
> You can use the toUri() function: interest.getName().toUri()
>
> Best,
> Xinyu Ma.
>
> > On Jul 18, 2019, at 11:00 AM, bouchrit leila via ndnSIM <
> ndnsim at lists.cs.ucla.edu> wrote:
> >
> > Hi all,
> > I want to retrieve the name of Interest to convert to an integer
> >  using a hash function.
> > ndn::Name (interest.getName ()).
> > My question is how i can convert the name of Interest and Data into
> string.
> >
> > tips can help me and thank you all for help.
> > _______________________________________________
> > ndnSIM mailing list
> > ndnSIM at lists.cs.ucla.edu
> > http://www.lists.cs.ucla.edu/mailman/listinfo/ndnsim
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.lists.cs.ucla.edu/pipermail/ndnsim/attachments/20190718/01c4f625/attachment.html>


More information about the ndnSIM mailing list