Patent ID: 7843927

Claim:
A method for routing packets at a multi-mode layer 3 packet forwarding device containing at least two modules, the method comprising: (a) determining, for each of the at least two modules, whether to operate in one of a host mode, an LPM mode, or a hybrid mode based on an expected utilization of each module in order to maximize the speed with which packets are routed; (b) in response to determining to operate a first module of the at least two modules in the host mode, operating the first module of the at least two modules in the host mode, wherein operating in the host mode includes populating a host table and a longest prefix matching (LPM) table of the first module with entries corresponding to hosts and routing layer 3 packets received by the first module using the host and LPM tables of the first module, wherein the entries corresponding to the hosts include full IP addresses for the hosts; (c) in response to determining to operate a second module of the at least two modules in the LPM mode, operating the second module of the at least two modules in the LPM mode, wherein operating in the LPM mode includes populating a host table of the second module with entries corresponding to hosts, populating an LPM table of the second module with entries corresponding to variable length Internet protocol (IP) addresses and next hop addresses, and routing layer 3 packets received by the second module using the host and LPM tables of the second module, wherein the operation of the at least two modules in the layer 3 packet forwarding device is tuned to efficiently forward packets for both large and small numbers of communicating hosts by provisioning the first module to operate in the host mode and the second module to operate in the LPM mode, wherein the entries corresponding to the hosts include full IP addresses for the hosts and (d) in response to determining to operate a third module of the at least two modules in a hybrid mode, operating the third module of the at least two modules in the hybrid mode, wherein operating in the hybrid mode includes populating a host table of the third module with entries corresponding to remote hosts, populating an LPM table of the third module with entries corresponding to remote hosts, remote host prefixes and next hop addresses, and routing layer 3 packets using the host and LPM tables of the third module, wherein the entries corresponding to the hosts include full IP addresses for the hosts.