IP Library Granted Patent US 10,148,571
Granted Patent B2
US 10,148,571 · App. 15/186,562 · Granted Dec 4, 2018

Jump on a match optimization for longest prefix match using a binary search tree

Inventors: Aviv Kfir (Nili, IL); Pedro Reviriego (Madrid, ES); Salvatore Pontarelli (Rome, IT); Gil Levy (Hod Hasharon, IL)
Assignee: MELLANOX TECHNOLOGIES TLV LTD.
H04L45/748H04L45/48
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 10,148,571
App. No.
15/186,562
Granted
Dec 4, 2018
Kind
B2
Abstract

A routing table is represented as a binary search tree ordered by prefix lengths. Markers are placed to guide accessing nodes in designated subtrees to search for a longest prefix match with destination addresses of data packet. Destination descendant nodes in remote hierarchical levels of the tree are associated with the markers. The traversal of the binary search tree is conducted by accessing the respective destination descendant nodes while avoiding accessing nodes in intermediate hierarchical levels. The packet is processed using the longest prefix match.

Claims (53)

1. A method comprising:

representing a routing table for a data network as a binary search tree of address prefixes ordered by prefix lengths, the binary search tree having a root node and two subtrees of nodes including parent nodes and descendant nodes disposed in hierarchical levels of the subtrees, the descendant nodes comprising leaf nodes;

placing respective markers in the parent nodes to guide accessing the descendant nodes in the subtrees to search for a destination address of a data packet;

associating destination descendant nodes with the markers, the destination descendant nodes being separated from the parent nodes by at least one intermediate hierarchical level;

traversing the binary search tree in a direction from the root node to the leaf nodes to determine a longest prefix match between the markers and the destination address, wherein traversing the binary search tree comprises accessing the respective destination descendant nodes while avoiding accessing the descendant nodes of the at least one intermediate hierarchical level; and

processing the data packet in the data network in accordance with an entry in the routing table that corresponds to the longest prefix match, wherein associating destination descendant nodes comprises:

making a first determination that compatible descendant nodes in a selected subtree comprise address prefixes that are compatible with the marker of one of the parent nodes;

making a second determination that one of the compatible descendant nodes is a leaf node or has additional compatible descendant nodes; and

responsively to the second determination assigning the one compatible descendant node as the destination descendant node.

2. The method according to claim 1 , wherein traversing the binary search tree comprises accessing one of the subtrees of the nodes when markers are present and accessing another of the subtrees of the nodes when the markers are absent.

3. The method according to claim 1 , wherein accessing the destination descendant nodes comprises performing hash lookups.

4. The method according to claim 1 , wherein associating destination descendant nodes comprises:

making a first determination that compatible descendant nodes in a selected subtree comprise address prefixes are compatible with the marker of one of the parent nodes; and

making a second determination that one of the compatible descendant nodes is a compatible leaf node; and

responsively to the second determination assigning the compatible leaf node as the destination descendant node.

5. The method according to claim 1 , wherein the markers in the nodes comprise an indication that longer compatible prefixes exist in one of the subtrees thereof.

6. The method according to claim 1 , wherein the markers in the nodes comprise an indication that no longer compatible prefixes exist in one of the subtrees thereof.

7. The method according to claim 1 , wherein at least a portion of the nodes comprise a plurality of markers.

8. An apparatus, comprising:

a network element, operative for receiving via a data network a packet having a destination address;

a processor in the network element;

a main memory storing a routing table of packet forwarding information, wherein the processor is operative for performing the steps of:

representing the routing table as a binary search tree of address prefixes ordered by prefix lengths, the binary search tree having a root node and two subtrees of nodes including parent nodes and descendant nodes disposed in hierarchical levels of the subtrees, the descendant nodes comprising leaf nodes;

placing respective markers in the parent nodes to guide accessing the descendant nodes in the subtrees to search for the destination address of the packet;

associating destination descendant nodes with the markers, the destination descendant nodes being separated from the parent nodes by at least one intermediate hierarchical level;

traversing the binary search tree in a direction from the root node to the leaf nodes to determine a longest prefix match between the markers and the destination address, wherein traversing the binary search tree comprises accessing the respective destination descendant nodes while avoiding accessing the descendant nodes of the at least one intermediate hierarchical level; and

processing the packet in the data network in accordance with an entry in the routing table that corresponds to the longest prefix match, wherein associating destination descendant nodes comprises:

making a first determination that compatible descendant nodes in a selected subtree comprise address prefixes that are compatible with the marker of one of the parent nodes;

making a second determination that one of the compatible descendant nodes is a leaf node or has additional compatible descendant nodes; and

responsively to the second determination assigning the one compatible descendant node as the destination descendant node.

9. The apparatus according to claim 8 , wherein traversing the binary search tree comprises accessing one of the subtrees of the nodes when markers are present and accessing another of the subtrees of the nodes when the markers are absent.

10. The apparatus according to claim 8 , wherein accessing the destination descendant nodes comprises performing hash lookups.

11. The apparatus according to claim 8 , wherein associating destination descendant nodes comprises:

making a first determination that compatible descendant nodes in a selected subtree comprise address prefixes are compatible with the marker of one of the parent nodes; and

making a second determination that one of the compatible descendant nodes is a compatible leaf node; and

responsively to the second determination assigning the compatible leaf node as the destination descendant node.

12. The apparatus according to claim 8 , wherein the markers in the nodes comprise an indication that longer compatible prefixes exist in one of the subtrees thereof.

13. The apparatus according to claim 8 , wherein the markers in the nodes comprise an indication that no longer compatible prefixes exist in one of the subtrees thereof.

14. The apparatus according to claim 8 , wherein at least a portion of the nodes comprise a plurality of markers.

15. A non-transitory computer-readable storage medium in which computer program instructions are stored, which instructions, when executed by a computer, cause the computer to perform the steps of:

representing a routing table for a data network as a binary search tree of address prefixes ordered by prefix lengths, the binary search tree having a root node and two subtrees of nodes including parent nodes and descendant nodes disposed in hierarchical levels of the subtrees, the descendant nodes comprising leaf nodes;

placing respective markers in the parent nodes to guide accessing the descendant nodes in the subtrees to search for a destination address of a data packet;

associating destination descendant nodes with the markers, the destination descendant nodes being separated from the parent nodes by at least one intermediate hierarchical level;

traversing the binary search tree in a direction from the root node to the leaf nodes to determine a longest prefix match between the markers and the destination address, wherein traversing the binary search tree comprises accessing the respective destination descendant nodes while avoiding accessing the descendant nodes of the at least one intermediate hierarchical level; and

processing the data packet in the data network in accordance with an entry in the routing table that corresponds to the longest prefix match, wherein associating destination descendant nodes comprises:

making a first determination that compatible descendant nodes in a selected subtree comprise address prefixes that are compatible with the marker of one of the parent nodes;

making a second determination that one of the compatible descendant nodes is a leaf node or has additional compatible descendant nodes; and

responsively to the second determination assigning the one compatible descendant node as the destination descendant node.

16. The computer software product according to claim 15 , wherein traversing the binary search tree comprises accessing one of the subtrees of the nodes when markers are present and accessing another of the subtrees of the nodes when the markers are absent.

17. The computer software product according to claim 15 , wherein associating destination descendant nodes comprises:

making a first determination that compatible descendant nodes in a selected subtree comprise address prefixes are compatible with the marker of one of the parent nodes; and

making a second determination that one of the compatible descendant nodes is a compatible leaf node; and

responsively to the second determination assigning the compatible leaf node as the destination descendant node.

Assignments (2)
MERGER Recorded Dec 15, 2021
From: MELLANOX TECHNOLOGIES TLV LTD.
To: MELLANOX TECHNOLOGIES, LTD.
Reel/Frame 058517/0564 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Jun 20, 2016
From: KFIR, AVIV; REVIRIEGO, PEDRO; PONTARELLI, SALVATORE; LEVY, GIL
To: MELLANOX TECHNOLOGIES TLV LTD.
Reel/Frame 038949/0928 →
Continuity (1)
Related Publication 20170366459A1 · Dec 21, 2017