摘要 |
Provided are a method and device. An operation field can be added to a lookup table entry, and an expression capability of the lookup table entry is enhanced, so as to improve an aggregation capability of the lookup table entry. The method comprises: receiving a data packet, wherein the data packet carries a destination address of the data packet; determining a matching entry corresponding to the destination address in a routing table, wherein an entry of the routing table contains an address operator and a network identifier, and a logical operation result of the operation performed on a significant bit of the network identifier of the matching entry and a significant bit of the destination address according to the address operator of the matching entry is true; and sending the data packet from an output port determined according to output port information in the matching entry. By means of the technical solution disclosed in the present invention, the scale of a lookup table can be reduced, and the demands of a network device for an on-chip storage space are effectively reduced, so as to reduce the area, costs, table lookup time and power consumption of a chip. |