"seossenk" <(E-Mail Removed)> writes:
> I need to implement a software lookup table for a specialized router
> and I am wondering what the best approach is? Should I utilize a hash
> table, or a binary search tree, or are there other solutions that would
> be better? One thing to note is that the routes are static and can not
> change therefore updates to the routing table will not happen
> dynamically.
If you Google for something like "IP address lookup algorithm" you'll
get lots of good hits. But most of them will probably mention
algorithms used for tables that are also easy to update.
What the optimal solution is depends on a lot of things, including how
much memory you have available. Also remember to use longest prefix
matching, which might complicate things a little bit.
--
Jacob
|