Patent ID: 8189585

Claim:
An apparatus, comprising: a first memory portion comprising a plurality of first data structures, wherein each of the plurality of first data structures includes an Internal Gateway Protocol (IGP) label and an adjacency identifier that identifies one of a plurality of outgoing interfaces associated with the apparatus, wherein each IGP label indicates a Label Switched Path (LSP) through a network, wherein the first memory portion is a Table-Look-Up (TLU) memory and the plurality of first data structures is a plurality of TLU entries, wherein each of the plurality of first data structures does not include any Virtual Private Network (VPN) label that identifies any VPN that is reachable over the network; a second memory portion comprising a plurality of IGP load-balancing entries, wherein each of the plurality of IGP load-balancing entries includes two or more reference values that point to two or more of the plurality of first data structures in the first memory portion; a third memory portion comprising a plurality of second data structures, wherein each of the plurality of second data structures includes a network address identifier, a VPN label associated with the network address identifier, and a pointer that indicates one of the plurality of first data structures in the first memory portion, wherein each VPN label identifies a VPN that is reachable over the network, wherein the network address identifier includes a Multi-Protocol Label Switching (MPLS) label, wherein the third memory portion is a Pointer-Look-Up (PLU) memory and the plurality of second data structures is a plurality of PLU entries, wherein a hash value is computed based on the network address identifier to select one of multiple VPN labels associated with the network address identifier and the selected VPN label is stored in a PLU entry among the plurality of PLU entries; first logic for programming the first memory portion, the second memory portion, and the third memory portion, wherein the first logic is configured to store a plurality of IGP labels in the plurality of TLU entries and to store a plurality of VPN labels in the plurality PLU entries; second logic for forwarding packets based the first memory portion, the second memory portion, and the third memory portion, wherein the second logic is configured at least to: retrieve VPN labels from PLU entries, of the plurality of PLU entries, that are respectively associated with the packets to determine IGP load-balancing entries from the plurality of IGP load-balancing entries; compute a hash value based on a source address and a destination address in the each of the packets to hash into the IGP load-balancing entries to determine TLU entries from the plurality of TLU entries and retrieve IGP labels from the TLU entries; and generate, for the packets, respective label stacks that respectively include the retrieved VPN labels and the retrieved IGP labels.