Claims
- 1. A method for constructing a network address forwarding table, the method comprising:
(a) storing a plurality of variable-length network address prefixes in a predetermined order in a network address forwarding table, each prefix corresponding to an entry in the network address forwarding table, the entries in the network address forwarding table corresponding to nodes in a binary tree; (b) storing, in each entry, path information identifying bits of the prefix for the entry corresponding to parent nodes of the entry; and (c) storing, in each entry, packet forwarding information corresponding to each parent node of the entry.
- 2. The method of claim 1 wherein storing a plurality of variable-length network address prefixes in a predetermined order in a network address forwarding table includes storing a plurality of IP addresses in an IP address forwarding table.
- 3. The method of claim 1 wherein storing a plurality of variable-length network address prefixes in a predetermined order includes arranging the network address prefixes in ascending order.
- 4. The method of claim 1 wherein storing a plurality of variable-length network address prefixes in a predetermined order in a network address forwarding table includes arranging the network address prefixes in descending order.
- 5. The method of claim 1 wherein storing a plurality of variable-length prefixes in a network address forwarding table includes storing prefixes corresponding to internal nodes and leaf nodes in the binary tree.
- 6. The method of claim 1 wherein storing a plurality of variable-length network address prefixes in a network address forwarding table includes only storing prefixes corresponding leaf nodes in the binary tree.
- 7. The method of claim 6 comprising storing internal node prefix information in the path information for each leaf node.
- 8. The method of claim 1 wherein storing path information in each entry includes a storing a binary bit string including a plurality of ones and zeros in each entry, the position of each one in the binary bit string indicating bits of the prefix in the entry that corresponds to a parent node prefix.
- 9. The method of claim I wherein storing packet forwarding information in each entry includes storing next hop IP address information in each entry.
- 10. The method of claim 1 wherein storing packet forwarding information in each entry includes storing output port information in each entry.
- 11. The method of claim 1 wherein storing packet forwarding information in each entry includes storing a pointer to a list of next hop addresses in each entry.
- 12. The method of claim 1 further comprising storing, in each entry, a value indicating the number of parent nodes of each entry.
- 13. A memory having a data structure stored therein, the data structure being constructed according to the steps in claim 1.
- 14. A method for locating forwarding information for a received packet, the method comprising performing binary network address lookup in a network address forwarding table including entries having variable-length network address prefixes, the entries corresponding to nodes in a binary tree, wherein performing a binary network address lookup includes:
(a) comparing a destination network address extracted from a received packet to the prefixes in the network address forwarding table; (b) locating first and second prefixes in first and second entries in the network address forwarding table between which the destination network address falls; (c) extracting path information from the second entry in the network address forwarding table, the path information indicating bits of the second prefix corresponding parent nodes of the second prefix in the binary tree; (d) determining a longest prefix that matches the destination network address using the path information; and (e) extracting, from the second entry, packet forwarding information corresponding to the longest matching prefix.
- 15. The method of claim 14 wherein performing a binary network address lookup in a network address table includes performing an IP address lookup and an IP forwarding table.
- 16. The method of claim 14 wherein comparing the destination network address to prefixes in the table includes comparing the value of the destination network address to the value of the prefixes in the table to determine whether the destination network address is less than or greater than the prefixes in the table.
- 17. The method of claim 14 wherein the first entry is the closest entry in the table that is less than the destination network address and the second entry is the entry in the table closest in value to the destination network address that is greater than the destination network address.
- 18. The method of claim 14 wherein extracting path information includes extracting a binary bit string from the second entry, the binary bit string including a plurality of ones and zeros, the position of each one in the binary bit string corresponding to bits of the second prefix that identify the parent nodes of the second prefix.
- 19. The method of claim 14 wherein extracting packet forwarding information includes extracting a packet forwarding address corresponding to the longest matching prefix.
- 20. The method of claim 14 wherein extracting packet forwarding information includes extracting an output port identifier corresponding to the longest matching prefix.
- 21. A memory for storing data for access by a network address forwarding engine, the memory comprising a data structure stored in the memory, the data structure including information resident in a forwarding address table for use by the network address forwarding engine and including:
(a) a plurality of entries arranged in a predetermined order, each entry including a variable-length network address prefix to be compared to destination network addresses in received packets, the entries corresponding to nodes in a binary tree; (b) each entry further including path information indicating parent nodes of each prefix in the binary tree; and (c) each entry further including packet forwarding information for each parent node indexed by the path information.
- 22. The memory of claim 21 wherein the plurality of entries correspond to internal nodes and leaf nodes in the binary tree.
- 23. The memory of claim 21 wherein the plurality of entries correspond only to leaf nodes in the binary tree.
- 24. The memory of claim 23 wherein the path information for each leaf node includes bits indicating internal nodes that are parent nodes of each leaf nodes.
- 25. The memory of claim 21 wherein the variable-length network address prefixes comprise variable-length IP address prefixes.
- 26. The memory of claim 21 wherein the path information in each entry includes a series of ones and zeros, each one in the path information indicating bits in the prefix that correspond to the parent nodes of the prefix.
- 27. The memory of claim 21 wherein the entries are arranged in ascending order.
- 28. The memory of claim 21 wherein the entries are arranged in descending order.
- 29. The memory of claim 21 wherein the packet forwarding information includes next hop address information for each parent node.
- 30. The memory of claim 21 wherein the packet forwarding information includes output port identifier information for each parent node.
- 31. A packet forwarding device comprising:
(a) a packet forwarding table embodied in a computer-readable medium, the packet forwarding table including a plurality of variable-length network address prefixes arranged in a predetermined order, each prefix corresponding to an entry in the packet forwarding table, the entries corresponding to nodes in a binary tree, and each entry storing path information indicating parent nodes of each entry in the binary tree; and (b) a packet forwarding engine for performing a binary search of the packet forwarding table using a destination address in a received packet and locating a longest-matching prefix corresponding to the destination address using the path information in the forwarding table.
- 32. The device of claim 31 wherein the packet forwarding table comprises an IP packet forwarding table.
- 33. The device of claim 31 wherein the packet forwarding table includes entries for leaf nodes and internal nodes in the binary tree.
- 34. The device of claim 31 wherein the packet forwarding table only includes entries for leaf nodes in the binary tree.
- 35. The device of claim 34 wherein the path information for each leaf node entry indicates prefixes of internal nodes that are parent nodes of each leaf node.
- 36. The device of claim 31 wherein the path information in each entry indicates bits of each entry that correspond to parent nodes of each entry.
- 37. The device of claim 31 wherein each entry stores packet forwarding information for each parent node indicated by the path information.
- 38. The device of claim 37 wherein the packet forwarding information includes next hop address information.
- 39. The device of claim 37 wherein the packet forwarding information includes output port identifier information.
- 40. The device of claim 31 wherein the packet forwarding engine is adapted to locate packet forwarding information corresponding to the longest-matching prefix.
GRANT INFORMATION
[0001] This work was supported by grant number 10093.002 from the National Security Agency (NSA). Thus, the United States Government has certain rights in the invention.