CPC H04L 45/748 (2013.01) | 20 Claims |
1. A method performed by a packet processor in a communications network, the method comprising:
retrieving, by the packet processor, a first prefix length associated with a first lookup stage and a second prefix length associated with a second lookup stage, wherein the second prefix length is shorter than the first prefix length;
receiving, from a control plane of the communications network, an instruction to program an action entry for a destination subnet, the action entry having an action entry prefix;
in response to receiving the instruction:
comparing a length of the action entry prefix to the first prefix length associated with the first lookup stage and the second prefix length associated with the second lookup stage;
in response to determining that the length of the action entry prefix is shorter than the second prefix length, selecting the second prefix length as an expanded prefix length;
in response to determining that the length of the action entry prefix is longer than the second prefix length and shorter than the first prefix length, selecting the first prefix length as the expanded prefix length;
based on the expanded prefix length, determining a number of new action entries that are needed to provide a same range of addresses as the action entry prefix;
based on the determined number of new action entries, generating a plurality of expanded action entries having the expanded prefix length; and
storing the plurality of expanded action entries in:
a match-action table of the first lookup stage when the expanded prefix length is the first prefix length; or
a match-action table of the second lookup stage when the expanded prefix length is the second prefix length.
|