<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Hi Sabet,<div class=""><br class=""></div><div class="">the cost has to do with the overall routing/forwarding administration and policies. I do not think that we have a standardized way to calculated the cost for the next hop of a FIB entry. If you think about it, the adaptive forwarding plane and the forwarding strategy can override the routing plane, set/reset the cost for each next hop and change the face ranking on each node.</div><div class=""><br class=""></div><div class="">To access the cost, you will have to access the FIB of a node and then use the FIB look up API:</div><div class=""><br class=""></div><div class=""><a href="https://github.com/named-data-ndnSIM/NFD/blob/NFD-0.3.4-ndnSIM/daemon/table/fib.hpp#L57-L69" class="">https://github.com/named-data-ndnSIM/NFD/blob/NFD-0.3.4-ndnSIM/daemon/table/fib.hpp#L57-L69</a></div><div class=""><br class=""></div><div class="">The highlighted methods will return a shared_ptr to a fib entry. Then you can use the fib entry API to get the next-hops for this fib entry:</div><div class=""><br class=""></div><div class=""><a href="https://github.com/named-data-ndnSIM/NFD/blob/NFD-0.3.4-ndnSIM/daemon/table/fib-entry.hpp#L62-L63" class="">https://github.com/named-data-ndnSIM/NFD/blob/NFD-0.3.4-ndnSIM/daemon/table/fib-entry.hpp#L62-L63</a></div><div class=""><br class=""></div><div class="">Finally, you will use the next-hop API to get the cost of each next hop:</div><div class=""><br class=""></div><div class=""><a href="https://github.com/named-data-ndnSIM/NFD/blob/NFD-0.3.4-ndnSIM/daemon/table/fib-nexthop.hpp#L50-L51" class="">https://github.com/named-data-ndnSIM/NFD/blob/NFD-0.3.4-ndnSIM/daemon/table/fib-nexthop.hpp#L50-L51</a> </div><div class=""><br class=""></div><div class="">Hope that this helps,</div><div class=""><br class=""><div class="">
<div class=""><div class=""><div class=""><span class="" style="float: none; display: inline !important;">Spyridon (Spyros) Mastorakis</span><br class=""><span class="" style="float: none; display: inline !important;">Personal Website: </span><a href="http://cs.ucla.edu/~mastorakis/" class="">http://cs.ucla.edu/~mastorakis/</a><br class=""><span class="" style="float: none; display: inline !important;">Internet Research Laboratory</span><br class=""><span class="" style="float: none; display: inline !important;">Computer Science Department</span><br class=""><span class="" style="float: none; display: inline !important;">UCLA</span></div><div class=""><br class=""></div></div></div></div><div><blockquote type="cite" class=""><div class="">On May 22, 2016, at 6:17 AM, Muhammad Hosain Abdollahi Sabet <<a href="mailto:mhasabet@gmail.com" class="">mhasabet@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><div class="gmail_default" style="font-family:tahoma,sans-serif"><font face="tahoma, sans-serif" class="">Hi everyone,</font></div><div class="gmail_default" style="font-family:tahoma,sans-serif"><br class=""></div><div class="gmail_default" style="font-family:tahoma,sans-serif">In my custom application, based on the received interest I want to create a FIB entry for a prefix - which is retrieved by processing the interest's name. For using FIBHelper::AddRoute in need to have the metric for prefix. How can I calculate it? Is there any method some where which you(in a node) can give it prefix and it gives you back the metric for that prefix?</div><div class="gmail_default" style="font-family:tahoma,sans-serif"><br class=""></div><div class="gmail_default" style="font-family:tahoma,sans-serif">Thanks,</div><div class="gmail_default" style="font-family:tahoma,sans-serif">Sabet</div>
</div></div></blockquote></div><br class=""></div></body></html>