METHOD AND APPARATUS FOR FORWARDING PACKETS
First Claim
1. A method for forwarding packets, comprising:
- extracting a first group of bits from a destination address of a received packet;
searching for a Ternary Content Addressable Memory (TCAM) entry according to the first group of bits, and obtaining an index value from the TCAM entry; and
searching for a preset Forwarding Information Base (FIB) entry according to the index value and a second group of bits in the destination address of the received packet, and obtaining a forwarding address of the packet.
1 Assignment
0 Petitions
Accused Products
Abstract
The present invention relates to the field of communication technologies, and discloses a method and an apparatus for forwarding packets to solve the problems in the prior art, namely, if a long Internet Protocol (IP) address needs to be searched for at the time of forwarding a packet, the number of Ternary Content Addressable Memories (TCAMs) need to be increased, or an external Random Access Memory (RAM) needs to be accessed for more times, which leads to a high cost and low performance. The method includes: extracting a first bit sequence from a destination address of a received packet, and using the first bit sequence as a key value; searching for a preset TCAM entry by using the key value, and obtaining an index value returned by the TCAM entry; and using the index value and a second group of bits in the destination address of the packet as conditions for searching, according to a predetermined algorithm, for a preset Forwarding Information Base (FIB) entry, and obtaining a forwarding address of the packet. The technical solution under the present invention is applicable to searching a table for an Internet Protocol version 6 (IPv6) address in a router.
23 Citations
15 Claims
-
1. A method for forwarding packets, comprising:
-
extracting a first group of bits from a destination address of a received packet; searching for a Ternary Content Addressable Memory (TCAM) entry according to the first group of bits, and obtaining an index value from the TCAM entry; and searching for a preset Forwarding Information Base (FIB) entry according to the index value and a second group of bits in the destination address of the received packet, and obtaining a forwarding address of the packet. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9, 10, 11)
-
-
12. An apparatus for forwarding packets, comprising:
-
an extracting unit, configured to extract a first bit sequence from a destination address of a received packet; a first search unit, configured to search for a Ternary Content Addressable Memory (TCAM) entry according to the first bit sequence extracted by the extracting unit, and obtain an index value from the TCAM entry; and a second search unit, configured to search for a preset Forwarding Information Base (FIB) entry according to the index value and a second group of bits in the destination address of the received packet, and obtain a forwarding address of the received packet from the FIB entry. - View Dependent Claims (13, 14, 15)
-
Specification