<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; ">Hi Haochen,<div><br></div><div>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.</div><div><br></div><div>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:</div><div>after line 77 in <a href="https://github.com/NDN-Routing/ndnSIM/blob/master/model/fib/ndn-fib-impl.cc#L77">https://github.com/NDN-Routing/ndnSIM/blob/master/model/fib/ndn-fib-impl.cc#L77</a></div><div><br></div><div>add something like</div><div><br></div><div><pre style="margin-top: 0px; margin-bottom: 0px; padding: 0px; border: 0px; font-size: 12px; font-family: Consolas, 'Liberation Mono', Courier, monospace; color: rgb(51, 51, 51); line-height: 17.99715805053711px; "><div class="line" id="LC80" style="margin: 0px; padding: 0px 0px 0px 10px; border: 0px;"><span class="k" style="margin: 0px; padding: 0px; border: 0px; font-weight: bold;">if</span> <span class="p" style="margin: 0px; padding: 0px; border: 0px;">(</span><span class="n" style="margin: 0px; padding: 0px; border: 0px; ">item</span> <span class="o" style="margin: 0px; padding: 0px; border: 0px; font-weight: bold;">==</span> <span class="n" style="margin: 0px; padding: 0px; border: 0px; ">super</span><span class="o" style="margin: 0px; padding: 0px; border: 0px; font-weight: bold;">::</span><span class="n" style="margin: 0px; padding: 0px; border: 0px; ">end</span> <span class="p" style="margin: 0px; padding: 0px; border: 0px;">())</span></div><div class="line" id="LC80" style="margin: 0px; padding: 0px 0px 0px 10px; border: 0px;"><span class="p" style="margin: 0px; padding: 0px; border: 0px;">    </span><span class="n" style="font-size: 11.818181991577148px; line-height: 17.99715805053711px; margin: 0px; padding: 0px; border: 0px; ">item</span><span style="font-size: 11.818181991577148px; line-height: 17.99715805053711px; background-color: rgb(255, 255, 204); "> </span><span class="o" style="font-size: 11.818181991577148px; line-height: 17.99715805053711px; margin: 0px; padding: 0px; border: 0px; font-weight: bold; ">=</span><span style="font-size: 11.818181991577148px; line-height: 17.99715805053711px; background-color: rgb(255, 255, 204); "> </span><span class="n" style="font-size: 11.818181991577148px; line-height: 17.99715805053711px; margin: 0px; padding: 0px; border: 0px; ">super</span><span class="o" style="font-size: 11.818181991577148px; line-height: 17.99715805053711px; margin: 0px; padding: 0px; border: 0px; font-weight: bold; ">::deepest</span><span class="n" style="font-size: 11.818181991577148px; line-height: 17.99715805053711px; margin: 0px; padding: 0px; border: 0px; ">_prefix_match</span><span style="font-size: 11.818181991577148px; line-height: 17.99715805053711px; background-color: rgb(255, 255, 204); "> </span><span class="p" style="font-size: 11.818181991577148px; line-height: 17.99715805053711px; margin: 0px; padding: 0px; border: 0px; ">(</span><span class="n" style="font-size: 11.818181991577148px; line-height: 17.99715805053711px; margin: 0px; padding: 0px; border: 0px; ">interest</span><span class="p" style="font-size: 11.818181991577148px; line-height: 17.99715805053711px; margin: 0px; padding: 0px; border: 0px; ">.</span><span class="n" style="font-size: 11.818181991577148px; line-height: 17.99715805053711px; margin: 0px; padding: 0px; border: 0px; ">GetName</span><span style="font-size: 11.818181991577148px; line-height: 17.99715805053711px; background-color: rgb(255, 255, 204); "> </span><span class="p" style="font-size: 11.818181991577148px; line-height: 17.99715805053711px; margin: 0px; padding: 0px; border: 0px; ">());</span></div></pre></div><div><br></div><div>This way you will capture normal longest prefix match, and if it failed, you'll do a deepest prefix match.</div><div><br></div><div>---</div><div>Alex</div><div><br><div><div>On May 8, 2013, at 5:36 AM, Haochen Wang <<a href="mailto:haochenallen@gmail.com">haochenallen@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div dir="ltr">Hi all,<div>I want to inquire about the Longest Prefix Match. </div><div>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. </div>
<div>If there were LPM implemented, how can I manipulate it?</div><div>thank you,</div><div>Allen<br clear="all"><div><br></div>-- <br><div>*********************************************</div><div>Beijing University of Posts and Telecommunications,</div>
<div>No.10 Xi Tu Cheng Rd., Hai Dian Dis.,</div><div>Beijing, CHINA, 100876</div><div>School of Information and Communications,</div><div>Cell Phone: 86-13581958046</div><div>*********************************************</div>

</div></div></blockquote></div><br></div></body></html>