[ndnSIM] Problems about Longest Prefix Match

Alex Afanasyev alexander.afanasyev at ucla.edu
Wed May 8 16:20:22 PDT 2013

Hi Haochen,

The example that you gave is not exactly a longest prefix match.  Normally, the longest prefix match means that you provide a specific name (in IP terms, an IP address), and the algorithm finds you a longest prefix of that name (again, in IP terms it would be IP subnet) that is registered in FIB.

The data structure that is used by FIB implementation has the lookup process that you described (I call it "deepest prefix match"), and it is actually used in ContentStore lookup.  You may try to modify how FIB entries are looked up:
after line 77 in https://github.com/NDN-Routing/ndnSIM/blob/master/model/fib/ndn-fib-impl.cc#L77

add something like

if (item == super::end ())
    item = super::deepest_prefix_match (interest.GetName ());

This way you will capture normal longest prefix match, and if it failed, you'll do a deepest prefix match.


On May 8, 2013, at 5:36 AM, Haochen Wang <haochenallen at gmail.com> wrote:

> Hi all,
> I want to inquire about the Longest Prefix Match. 
> I let Customer send packet with prefix like "/a/b/c/d", and write in prefix like "/a/b/c/d/e/f" into FIB. But the simulation turned out failure, I wonder if the Longest Prefix Match algorithm wasn't implemented. 
> If there were LPM implemented, how can I manipulate it?
> thank you,
> Allen
> -- 
> *********************************************
> Beijing University of Posts and Telecommunications,
> No.10 Xi Tu Cheng Rd., Hai Dian Dis.,
> Beijing, CHINA, 100876
> School of Information and Communications,
> Cell Phone: 86-13581958046
> *********************************************

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.lists.cs.ucla.edu/pipermail/ndnsim/attachments/20130508/5eace240/attachment.html>

More information about the ndnSIM mailing list