An improved
system and method is provided for
packet routing in dynamic
router tables. Specifically, the invention provides a method, computer
system, and computer readable media for using Priority Search Trees (PSTs) to match, insert, and delete rules in dynamic routing tables in O(log n) time. In a first embodiment, for a dynamic
router table consisting of n pairs of tuples, each tuple comprising an address prefix and next-hop information, the invention provides a
system and method, using a PST, for inserting a new tuple, deleting an existing tuple, and searching for the tuple with the longest matching prefix for destination address, wherein each operation is performed in O(log n) time. In a second embodiment, for a dynamic
router table consisting of n pairs of tuples, each tuple comprising a range of destination addresses and next-hop information, the invention provides a system and method, using a PST and a set of red-black priority search tree (RBPST), for inserting a new tuple, deleting an existing tuple, and searching for the tuple with the most specific matching range, wherein each operation is performed in O(log n) time. The invention can be implemented in numerous ways to improve dynamic router table performance, including as a system, a device, a method, or a computer readable medium.