EP1025678A2 - A lookup device and a method for classification and forwarding of packets - Google Patents

A lookup device and a method for classification and forwarding of packets

Info

Publication number
EP1025678A2
EP1025678A2 EP98943155A EP98943155A EP1025678A2 EP 1025678 A2 EP1025678 A2 EP 1025678A2 EP 98943155 A EP98943155 A EP 98943155A EP 98943155 A EP98943155 A EP 98943155A EP 1025678 A2 EP1025678 A2 EP 1025678A2
Authority
EP
European Patent Office
Prior art keywords
output
stage
memory means
pointer
entry
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Withdrawn
Application number
EP98943155A
Other languages
German (de)
French (fr)
Inventor
Peter SJÖDIN
Andreas Moestedt
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Sics Swedish Institute Of Computer Science AB
Original Assignee
SICS SWEDISH INST OF COMPUTER
SICS Swedish Institute of Computer Science
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by SICS SWEDISH INST OF COMPUTER, SICS Swedish Institute of Computer Science filed Critical SICS SWEDISH INST OF COMPUTER
Publication of EP1025678A2 publication Critical patent/EP1025678A2/en
Withdrawn legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/74Address processing for routing
    • H04L45/742Route cache; Operation thereof

Definitions

  • the present invention relates to a lookup device and a method for classification and forwarding of packets.
  • IP router One of the main limiting factors for performance in an IP router, compared to a switch is often claimed to be the processing of incoming packets.
  • the packet classification operation consists of analysing information in the packet header (at least the destination address needs to be examined) , and performing a lookup operation to obtain the information required to forward the packet to its next hop.
  • the same kind of classification needs to be performed by a switch, but the operation is generally thought to be more complicated for an IP packet than for an ATM cell or an Ethernet frame.
  • the lookup operation consists of searching a database for an entry matching the packet.
  • the efficiency of a lookup operation depends on tne data structure used for the database. Data structures such as simple tables and linked lists are easy to implement, but have the drawback that they are difficult to search efficiently.
  • An interesting compromise between a simple table and a linked list is a trie.
  • the address is partitioned into a number of sections, and each section is used to address a different level of a search tree. At 5 each level, a number of small tables are used to store pointers to the appropriate tables on the next level. There is still wasted space within each of the tables, but only a partial tree need be created, covering the portions of the address space that are in use at any one time.
  • the 10 trie is most efficient when the utilized addresses are clustered in the address space.
  • Binary tries have also been used for variable length addresses, for example the commonly used Patricia trie, which is a refinement of a binary trie. But since IP 0 addresses are 32 bits long, a fast hardware implementation of Patricia tries is expensive and complex.
  • CAM Content Addressable Memory
  • the object of the present invention is to solve the above mentioned problems and to provide a lookup device
  • the input to the lookup device is a destination address of an incoming packet and the destination address comprises n bits, wherein n is an integer.
  • the lookup device comprises 1 stages, wherein each stage represents a predetermined prefix length and a prefix represents a group of addresses, wherein the first stage represents the shortest prefix length and the 1 : th stage represents the longest prefix length with n bits.
  • the lookup device also comprises a routing memory means connected to said ⁇ :th stage, wherein each stage comprises a memory means for storing a table of entries, wherein each entry comprises a pointer field which either comprises a pointer to the memory means in the next stage, or a pointer to the routing memory means storing the forwarding information, wherein a first number of bits corresponding to the shortest prefix length of the destination address are searched for in the first memory means, and if the entry in the first memory means wherein a match is found comprises a pointer to the second memory means, then a second number of bits corresponding to the next shortest prefix length of the destination address are searched for in the second memory means, and so on until a longest matching prefix has been found, wherein the pointer to the routing memory means gives the forwarding information for forwarding of said incoming packet.
  • this design is that it is capable of performing one lookup per memory cycle. Furthermore the design is simple and fast, and it is therefore suitable for a high-end IP router. This solution also works
  • the first stage comprises only saio first memory means, and all the other stages comprise eacn a logic means, wherein the (q-1) : th logic means is connected to both the (q+1) :th memory means and the q:th memory means, wherein q is an integer and l ⁇ q ⁇ -l.
  • each entry in the first (l-l) memory means also comprises a part bit and a valid bit
  • each entry in the ⁇ :th memory means also comprises a valid bit
  • a set valid bit in an entry represents a valid prefix and the pointer field for that entry comprises a pointer to the routing memory means
  • a set part bit in an entry in the q:th memory means means that the prefix matches an entry in the routing memory means, but is shorter than that entry, and the pointer field for that entry m the q:th memory means comprises a pointer to the (q+1) : th memory means.
  • each of the first (l-l) memory means has a pointer output, a valid bit output and a part bit output
  • the 1 : th memory means has a pointer output and a valid bit output
  • the pointer output of the q:th memory means is connected to the (q+1) : th memory means, and to the logic means of the (q+1) : th stage, and wherein the valid bit output and the part bit output of the q:th memory means are connected to the logic means of the (q+1 ) : th stage .
  • the logic means in the i : th stage comprises a multiplexer, an OR-gate, and an AND-gate, and each logic means in all the other stages but the first stage comprises a multiplexer, an OR-gate, a first AND- gate, and a second AND-gate, wherein the inputs of the multiplexer in the second stage are connected to the pointer outputs of the first and second memory means, and the inputs of the first AND-gate in the second stage are connected to the valid bit output of the second memory means and to the part bit output of the first memory means, and the inputs of the second AND-gate in the second stage are connected to the part bit outputs of the fist and second memory means, and the inputs of the OR-gate m the second stage are connected to an output from the first AND-gate in the second stage and to the valid bit output of the first memory means, wherein the inputs to the multiplexer in the p:th stage, wherein p is an integer and 3 ⁇ p ⁇ -l, are connected to the pointer output
  • each stage also comprises a decompression logic means, wherein the ⁇ :th decompression logic means is connected to the multiplexer in the ⁇ :th stage, and the q:th decompression logic means is connected to both the q:th memory means and to the (q+l):th memory means.
  • ⁇ :th decompression logic means is connected to the multiplexer in the ⁇ :th stage
  • q:th decompression logic means is connected to both the q:th memory means and to the (q+l):th memory means.
  • each entry in each memory means also comprises a mask field, an address tag field, and a compress flag bit, wherein a set compress flag bit indicates that compression is used, and in that each of the memory means also has a mask field output, an address tag field output, and a compress flag bit output, wherein the mask field output, the address tag field output, the compress flag bit output, and the pointer output of the r:th memory means is connected to the r:th decompression logic means, wherein r is an integer and l ⁇ r ⁇ i, and wherein each decompression logic means outputs a new pointer, wherein the new pointer output from the q:th decompression logic means is connected to the (q+l):th memory means and the new pointer output from the 1 : th decompression logic means is connected to the multiplexer of the l : th stage.
  • each decompression logic means comprises an AND-gate, a comparator, a first multiplexer, and a second multiplexer, wherein the inputs of the AND-gate in the r:th decompression logic means is connected to the mask field output of the r:th memory means and to the r:th prefix length of the destination address, and the inputs of the comparator in the r:th decompression logic means is connected to the address tag field output of the r:th memory means and to an output from the AND-gate in the r:th decompression logic means, and the inputs of the first multiplexer m the r:th decompression logic means is connected to the pointer output of the r:th memory means and to a logically 0-s ⁇ gnal, and the inputs of the second multiplexer in the r:th decompression logic means is connected to the output from the AND-gate in the r:th decompression logic means, and to an output from the comparator in the r:th decompression logic
  • Another object of the invention is to provide a method for classification and forwarding of packets, wherein a destination address of an incoming packet comprises bits, wherein n is an integer. This object is achieved by providing the method defined m the introductory part of Claim 10 with the advantageous features of the characterizing part of said Claim.
  • the method accordirg to the present invention comprises I stages, wherein each stage represents a predetermined prefix length and a prefix represents a group of addresses, wherein the first stage represents the shortest prefix length and the ⁇ :th stage represents the longest prefix length with n bits, wherein each stage comprises a table of entries, wherein each entry comprises a pointer field which either comprises a pointer to the table in the next stage, or a pointer to a routing table storing the forwarding information, wherein the method comprises the steps: to search for a first number of bits corrrespondmg to the shortest prefix length of the destination address in the first table; if the entry in the first table wherein a match is found comprises a pointer to the second table, to search for a second number of bits corresponding to the next shortest prefix length of the destination address in the second table; and so on until a longest matching prefix has been found, wherein the pointer to the routing table gives the forwarding information for forwarding of said incoming packet.
  • each entry in the first (i-l) tables also comprises a part bit and a valid bit
  • each entry in the l : th table also comprises a valid bit
  • a set valid bit in an entry represents a valid prefix
  • the pointer field for that entry comprises a pointer to the routing table
  • a set part bit in an entry in the q:th table means that the prefix matches an entry in the routing table, but is shorter than that entry
  • the pointer field for the entry in the q:th table comprises a pointer to the (q+1) :th table, wherein 1 is an integer and l ⁇ q ⁇ -l.
  • an entry in the first (i-l) tables is not allowed to both have a set valid bit and a set part bit.
  • a match is found when an entry in one stage comprises a set valid bit and all the matching entries of shorter prefix lengths are set part bits.
  • each entry in each table also comprises a mask field, an address tag field, and a compress flag bit, wherein a set compress flag bit indicates that compression is used
  • the method for the r:th table wherein r is an integer and l ⁇ r ⁇ i, also comprises the following steps : - to AND-process the mask field and the destination address bits corresponding to the r:th prefix length, giving masked destination address bits as output; if the compress flag bit is not set, to output a new pointer which is input to the q:th table, and which is input to the routing table for the l : th table, wherein the new pointer is formed by using the pointer from the (q- l):th table unchanged, with the destination address bits corresponding to the r:th prefix length as low order bits; or - if the compress flag bit is set, to output a new pointer which is input to the q:th table, and which is input to the routing table for the ⁇ :th table, wherein the new
  • Figure 1 shows a schematic diagram of the fields in an IP packet header
  • Figure 2 shows a schematic diagram of a prefix tree with 6-bit addresses using three prefix lengths according to the principle of the present invention
  • Figure 3 shows a block diagram of a lookup device according to the present invention
  • Figure 4 shows a block diagram of a decompression logic means forming part of the lookup device according to the present invention.
  • Figure 5 is a flow chart of the method according to the present invention. Detailed Description of Embodiments
  • FIG 1 there is disclosed a schematic diagram of the fields in an IP packet header.
  • the IP packet header comprises 12 different fields. As is disclosed in figure 1 these fields are: Version, IP Header Length, Type of Service, Total Length, Identification, Flags, Fragment Offset, Time to Live, Protocol, Header Checksum, Source Address, and Destination Address. It can also contain an Options field.
  • IP address lookup which is used for forwarding of unicast packets based on their destination address
  • identifier lookup which is intended to be used for, for example, forwarding of multicast packets and flows of packets.
  • the present invention is based on the IP address lookup .
  • a routing table entry for IP addresses has two fields; a prefix and a next hop address.
  • a prefix represents a group of addresses, and is given as an IP address prefix and a prefix length.
  • the IP prefix 193.10.66/234 represents all IP addresses whose 24 first bits are equal to 193.10.66. So a routing table entry for a given prefix applies to all addresses which are in the group covered by the prefix.
  • the principle for an address lookup is based on the longest matching prefix; with the destination address of an incoming IP packet as key, the routing table is searched for entries with matching prefixes. If there are more than one matching entry, the one with the longest prefix is chosen. By using this principle, it is always the most specific routing table entry that is picked. For example, consider a routing table with the following three entries : Prefix Next hop
  • FIG. 2 there is disclosed a schematic diagram of a prefix tree with 6-bit addresses using three prefix lengths according to the principle of the present invention.
  • the address space can be thought of as a tree, where the nodes represent prefixes. Each level in the tree represents a specific prefix length. Prefixes with other lengths than the ones used in the tree, have to be extended to several longer prefixes.
  • each node has one of two attributes, the first indicates if the node represents a valid prefix, corresponding to an entry in the routing table, the second indicates if it is part of a valid prefix, being a part means that the prefix matches an entry in the routing table, but is shorter than that entry (a prefix of a prefix), a node is not allowed to be both valid and part. If it is, the valid route has to be extended to the next length, marking all nodes of this length as valid. If none of the attributes are set, the node is said to be invalid. To find a matching route, the tree is searched from the shortest prefix until the first valid or invalid note is encountered. In this way the longest match is guaranteed to be found.
  • the three prefix lengths are 2, 4, and 6.
  • the matching entry is a part, resulting in a second lookup, "0101". This entry is also a part.
  • a last lookup "010110” is then performed, resulting in a valid entry.
  • This entry points into the routing table where the forwarding information is stored .
  • fewer prefix levels are used in the data structure, more memory is needed to store it. This is due to the bit extension up to a valid prefix length, and the need for all entries in a prefix group to be present.
  • every node that is the part attribute set will have 256 child nodes in its prefix group. But with fewer levels, a prefix is found with fewer memory accesses, making the lookup faster. The ideal choice of levels and the distance between, depends on what performance is needed, and how much memory can be used.
  • FIG 3 there is disclosed a block diagram of a lookup device according to the present invention.
  • the lookup device 30 is based on IP address lookup, which is used for forwarding of unicast packet based on their destination address.
  • the lookup device 30 comprises I stages 32 ⁇ , 322, ...32i. In this figure I is 4.
  • the first stage 32 ⁇ represents the shortest prefix length and the 4 : th stage 32 4 represents the longest prefix length with n bits.
  • the lookup device 30 also comprises a routing memory means connected to said 4 : th stage 32 4 .
  • Each stage 32 ⁇ , 32 2 , 32 3 , 32 4 comprises a memory means 36 ⁇ , 36 2 , 36 3 , 36 4 for storing a table of entries, wherein each entry comprises a pointer field which either comprises a pointer to the memory means in the next stage, or a pointer to the routing memory means 34 which stores the forwarding information.
  • the destination address is input to the lookup device 30 via a line 38.
  • a first number of bits corresponding to the shortest prefix length of the destination address are searched for in the first memory means 36 ⁇ , and if the entry in the first memory means 36 ⁇ wherein a match is foun ⁇ comprises a pointer to the second memory means 36 2 , then a second number of bits corresponding to the next shortest prefix length of the destination address are searched for in the second memory means 36 2 , and so on until a longest matching prefix has been found, wherein the pointer to the routing memory means 34 gives the forwarding information for forwarding of said incoming packet.
  • the first 32 2 , 32 , 32 4 each comprises a logic means 40 2 , 40 3 , 40 4 , wherein the ⁇ :th logic means is connected to both the 1 : th memory means and the (i-l) : th memory means.
  • Each entry in the 4 : th memory means 36 4 also comprises a valid bit
  • each entry in the 3 first memory means 36 x , 36 2 , 36 3 also comprises a part bit and a valid bit.
  • a set valid bit in an entry represents a valid prefix, and the pointer field for that entry comprises a pointer to the routing memory means 34.
  • Each of the three first memory means 36 ⁇ , 36 2 , 36 3 has a pointer output, a valid bit output and a part bit output.
  • the 4 : th memory means 36 4 has only a pointer output and a valid bit output.
  • the 4 : th logic means 40 4 comprises a multiplexer 42 4 , an OR-gate 44 4 and an AND-gate 46 4 .
  • Each logic means in all the other stages but the first stage (40 2 , 40 3 ) comprises a multiplexer 42 2 ; 42 3 , and an OR-gate 44 2 ; 44 3 , a first AND- gate 46 2 ; 46 3 and a second AND-gate 48 2 ; 48 3 .
  • the inputs of the multiplexer 42 2 are connected to the pointer outputs of the first and second memory means 36 x , 36 2 .
  • the inputs of the first AND-gate 46 2 are connected to the valid bit output of the second memory means 36 2 and to the part bit output of the first memory means 36 ⁇ .
  • the inputs of the second AND-gate 48 2 are connected to the part bit output of the first and second memory means 36 ⁇ , 36 2 .
  • the inputs of the OR-gate 44 2 are connected to an output of the first AND-gate 46 2 and to the valid bit output of the first memory means 36 ⁇ .
  • the inputs to the multiplexer in the p:th stage, wherein p is an integer and 3 ⁇ p ⁇ -l, are connected to the pointer output of the p:th memory means and to an output of the multiplexer of the (p-l):th stage.
  • the inputs of the first AND-gate in the p:th stage are connected to the valid bit output of the p:th memory means and to an output of the second AND-gate in the (p-1) : th stage.
  • the inputs of the second AND-gate in the p:th stage are connected to the partbit output of the p:th memory means and to the output of the second AND-gate in the (p- 1) : th stage.
  • the inputs of the OR-gate in the p:th stage are connected to the output of the first AND-gate in the (p-1) : th stage and to an output of the OR-gate in the (p- l):th stage.
  • the inputs of the multiplexer 42 4 are connected to the pointer output of the memory means 36 4 and to an output of the multiplexer 42 3 .
  • the inputs of the AND-gate 46 4 are connected to the valid bit output of the memory means 36 4 and to the output of the second AND-gate 48 3 .
  • the inputs of the OR-gate 44 4 are connected to the output of the AND-gate 46 4 and to the output of the OR- gate 44 3 .
  • the routing memory means 34 are connected to the outputs from the multiplexer 42 4 and the OR-gate 44 4
  • the part bit and the valid bit are used to determine when the longest match is found. In short, a match is found if an entry in one stage is valid and all the matching entries of shorter lengths are parts.
  • the pointer and the part and valid bits are sent from one stage to the next until all lengths have been examined.
  • the resulting router table pointer flows through the following stages, without being changed.
  • the multiplexer selects the pointer of its stage if the valid bit of that stage is set, and the part bit of all previous stages are set. If this is not true the multiplexer selects the output from the previous stage, i.e. sends the results on from an earlier hit.
  • FIG 4 there is disclosed a block diagram of a decompression logic means included in the lookup device according to the present invention.
  • decompression logic means 50 ⁇ each stage in the lookup device 30 (see figure 3) comprises a decompression logic means.
  • each decompression logic means 50 . ⁇ comprises an AND-gate 52 ⁇ , a comparator 54 ⁇ , a first multiplexer 56 ⁇ and a second multiplexer 58 ⁇ .
  • Each entry in each memory means 36 ⁇ , 36 2 , 36 3 , 36 4 also comprises a mask field, and address tag field, and a compress flag bit, wherein a set compress flag bit indicates that compression is used.
  • Each of the memory means 36 ⁇ , 36 2 , 36 3 , 36 4 also has a mask field output, an address tag field output, and a compress flag bit output.
  • the decompression logic means 50 ⁇ for the first stage.
  • the decompression logic means for the other stages are constructed in the same way and are not disclosed.
  • the inputs to the AND-gate 52 ⁇ are the mask field output and the first prefix length of the destination address.
  • the inputs to the comparator 54 ⁇ are the address tag field output and an output from the AND- gate 52 ⁇ .
  • the inputs to the first multiplexer 56 are the pointer output and a logically 0-s ⁇ gnal.
  • the inputs to the second multiplexer are the output from the AND-gate 52 ⁇ and an output from the comparator 54 ⁇ .
  • the decompression logic means 50 ⁇ outputs a new pointer, which is input to the second memory means 36 2 (see figure 3) .
  • the background to the design according to figure 4 is that a common case in sparse routing tables is that a prefix group only contains two different kinds of entries.
  • the first kind is one or several consecutive valid entries, all identical.
  • the second kind consists of all other entries in the group and are either invalid or valid. If they are valid, it is due to the extension of a shorter matching route, that the first kind of entries overlap.
  • Also needed is one bit to flag that the compression is to be done. Bits in the entries are saved by placing all the compressed tables in the low address range of the memory. By doing this, the high order address bits can instead be used as low order bits when addressing among the compressed tables.
  • the method begins at block 60.
  • the method comprises I stages, wherein each stage represents a predetermined prefix length and a prefix represents a group of addresses, wherein the first stage represents the shortest prefix length and the ⁇ :th stage represents the longest prefix length with n bits, wherein each stage comprises a table of entries, wherein each entry comprises a pointer field which either comprises a pointer to the table in the next stage, or a pointer to a routing table storing the forwarding information.
  • the method continues to search for a first number of bits corresponding to the shortest prefix length of the destination address in the first table.
  • the question is asked whether the entry in the first table wherein a match is found comprises a pointer to the second table. If the answer is affirmative the method continues with block 66, wherein a search is performed for a second number of bits corresponding to the next shortest prefix length of the destination address in the second table. Thereafter, at block 68, the question is asked whether the entry in the second table wherein a match is found comprises a pointer to the third table. If the answer is affirmative the method continues until a longest matching prefix has been found, wherein the pointer to the routing table, at block 70, gives the forwarding information for forwarding of said incoming packet. Then the method is completed at block 72. If the answer at block 64 or 68 is negative the method continues with block 70.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The present invention relates to a lookup device (30) and a method for classification and forwarding of packets. The lookup device (30) comprises i stages (321, 322, 323, 324) wherein each stage (321, 322, 323, 324) represents a predetermined prefix length, and a prefix represents a group of addresses. The lookup device (30) also comprises a routing memory means (34) connected to said i:th stage (324), wherein each stage (321, 322, 323, 324) comprises a memory means (361, 362, 363, 364) for storing a table of entries, wherein each entry comprises a pointer field which either comprises a pointer to the memory means in the next stage, or a pointer to the routing memory means (34) storing the forwarding information.

Description

A LOOKUP DEVICE AND A METHOD FOR CLASSIFICATION AND FORWARDING OF PACKETS
Technical field of the invention
The present invention relates to a lookup device and a method for classification and forwarding of packets.
Description of related art The growth of the Internet has led to a situation where bandwidth is becoming a scarce resource. One reason for this is that the IP routers - the packet switches in the Internet - are not powerful enough to handle the traffic that aggregates at the switching points. The current trend for dealing with this problem is to relieve routers from some of the burden of switching traffic, and instead use switches of different kinds, such as FDDI switches, ATM switches, and Ethernet switches. This turns out to be a more cost effective solution, since the price for switching capacity is much lower than the price for routing capacity.
One of the main limiting factors for performance in an IP router, compared to a switch is often claimed to be the processing of incoming packets. When an IP packet arrives at an input port of a router, the packet needs to be examined and classified, and based on the classification the packet is forwarded to an output port. The packet classification operation consists of analysing information in the packet header (at least the destination address needs to be examined) , and performing a lookup operation to obtain the information required to forward the packet to its next hop. In principle, the same kind of classification needs to be performed by a switch, but the operation is generally thought to be more complicated for an IP packet than for an ATM cell or an Ethernet frame.
The lookup operation consists of searching a database for an entry matching the packet. The efficiency of a lookup operation depends on tne data structure used for the database. Data structures such as simple tables and linked lists are easy to implement, but have the drawback that they are difficult to search efficiently. An interesting compromise between a simple table and a linked list is a trie. In this approach, the address is partitioned into a number of sections, and each section is used to address a different level of a search tree. At 5 each level, a number of small tables are used to store pointers to the appropriate tables on the next level. There is still wasted space within each of the tables, but only a partial tree need be created, covering the portions of the address space that are in use at any one time. The 10 trie is most efficient when the utilized addresses are clustered in the address space.
The article "VLSI Implementation of Routing Tables: Tries and CAMs", Dy T. Pei, C. Zukowski, Proceedings of INFOCOM λ91, 991, pp. 0515-0524, discloses the use of 15 tries in routing tables, for address lookup with fixed lengths .
Binary tries have also been used for variable length addresses, for example the commonly used Patricia trie, which is a refinement of a binary trie. But since IP 0 addresses are 32 bits long, a fast hardware implementation of Patricia tries is expensive and complex.
There have been several suggestions to implement routing table lookups by using Content Addressable Memory (CAM) to store the routing table. However, CAM technology 5 does not currently provide large memory at a sufficiently low cost to make this a practical solution.
Summary of the invention
The object of the present invention is to solve the above mentioned problems and to provide a lookup device
30 for classification and forwarding of packets, wherein the input to the lookup device is a destination address of an incoming packet and the destination address comprises n bits, wherein n is an integer. This object is achieved by providing the lookup device defined in the introductory
3.3 part of Claim 1 with the advantageous features of the characterizing part of said Claim. The lookup device according to the present invention comprises 1 stages, wherein each stage represents a predetermined prefix length and a prefix represents a group of addresses, wherein the first stage represents the shortest prefix length and the 1 : th stage represents the longest prefix length with n bits. The lookup device also comprises a routing memory means connected to said ι:th stage, wherein each stage comprises a memory means for storing a table of entries, wherein each entry comprises a pointer field which either comprises a pointer to the memory means in the next stage, or a pointer to the routing memory means storing the forwarding information, wherein a first number of bits corresponding to the shortest prefix length of the destination address are searched for in the first memory means, and if the entry in the first memory means wherein a match is found comprises a pointer to the second memory means, then a second number of bits corresponding to the next shortest prefix length of the destination address are searched for in the second memory means, and so on until a longest matching prefix has been found, wherein the pointer to the routing memory means gives the forwarding information for forwarding of said incoming packet. The main advantage witn this design is that it is capable of performing one lookup per memory cycle. Furthermore the design is simple and fast, and it is therefore suitable for a high-end IP router. This solution also works with identifiers with different lengths.
Advantageously, the first stage comprises only saio first memory means, and all the other stages comprise eacn a logic means, wherein the (q-1) : th logic means is connected to both the (q+1) :th memory means and the q:th memory means, wherein q is an integer and l≤q<ι-l.
Preferably, each entry in the first (l-l) memory means also comprises a part bit and a valid bit, and each entry in the ι:th memory means also comprises a valid bit, wherein a set valid bit in an entry represents a valid prefix and the pointer field for that entry comprises a pointer to the routing memory means, and a set part bit in an entry in the q:th memory means means that the prefix matches an entry in the routing memory means, but is shorter than that entry, and the pointer field for that entry m the q:th memory means comprises a pointer to the (q+1) : th memory means.
Advantageously, each of the first (l-l) memory means has a pointer output, a valid bit output and a part bit output, and the 1 : th memory means has a pointer output and a valid bit output, wherein the pointer output of the q:th memory means is connected to the (q+1) : th memory means, and to the logic means of the (q+1) : th stage, and wherein the valid bit output and the part bit output of the q:th memory means are connected to the logic means of the (q+1 ) : th stage .
Preferably, the logic means in the i : th stage comprises a multiplexer, an OR-gate, and an AND-gate, and each logic means in all the other stages but the first stage comprises a multiplexer, an OR-gate, a first AND- gate, and a second AND-gate, wherein the inputs of the multiplexer in the second stage are connected to the pointer outputs of the first and second memory means, and the inputs of the first AND-gate in the second stage are connected to the valid bit output of the second memory means and to the part bit output of the first memory means, and the inputs of the second AND-gate in the second stage are connected to the part bit outputs of the fist and second memory means, and the inputs of the OR-gate m the second stage are connected to an output from the first AND-gate in the second stage and to the valid bit output of the first memory means, wherein the inputs to the multiplexer in the p:th stage, wherein p is an integer and 3<p≤ι-l, are connected to the pointer output of the p:th memory means and to an output of the multiplexer of the (p-1) :th stage, and the inputs of the first AND-gate in the p:th stage are connected to the valid bit output of the p:th memory means and to an output of the second AND- gave in the (p-1) : th stage, and the inputs of the second AND-gate in the p:th stage are connected to the part bit output of the p:th memory means and to the output of the second AND-gate in the (p-1) : th stage, and the inputs of the OR-gate in the p:th stage are connected to the output of the first AND-gate in the (p-1) :th stage and to an output of the OR-gate in the (p-1) :th stage, and wherein the inputs of the multiplexer in the ι:th stage are connected to the pointer output of the 1 : th memory means and to an output of the multiplexer of the (ι-l):th stage, and the inputs of the AND-gate in the ι:th stage are connected to the valid bit output of the ι:th memory means and to the output of the second AND-gate in the (i-l) :th stage, and the inputs of the OR-gate m the ι:th stage are connected to the output of the AND-gate in the l : th stage and to the output of the OR-gate in the (i-l) :th stage. Advantageously, a match is found when an entry in one stage comprises a set valid bit output and all the matching entries of shorter prefix lengths are set part bit outputs. Preferably, each stage also comprises a decompression logic means, wherein the ι:th decompression logic means is connected to the multiplexer in the ι:th stage, and the q:th decompression logic means is connected to both the q:th memory means and to the (q+l):th memory means. Hereby is achieved a memory saving optimization.
Advantageously, each entry in each memory means also comprises a mask field, an address tag field, and a compress flag bit, wherein a set compress flag bit indicates that compression is used, and in that each of the memory means also has a mask field output, an address tag field output, and a compress flag bit output, wherein the mask field output, the address tag field output, the compress flag bit output, and the pointer output of the r:th memory means is connected to the r:th decompression logic means, wherein r is an integer and l≤r≤i, and wherein each decompression logic means outputs a new pointer, wherein the new pointer output from the q:th decompression logic means is connected to the (q+l):th memory means and the new pointer output from the 1 : th decompression logic means is connected to the multiplexer of the l : th stage.
Preferably, each decompression logic means comprises an AND-gate, a comparator, a first multiplexer, and a second multiplexer, wherein the inputs of the AND-gate in the r:th decompression logic means is connected to the mask field output of the r:th memory means and to the r:th prefix length of the destination address, and the inputs of the comparator in the r:th decompression logic means is connected to the address tag field output of the r:th memory means and to an output from the AND-gate in the r:th decompression logic means, and the inputs of the first multiplexer m the r:th decompression logic means is connected to the pointer output of the r:th memory means and to a logically 0-sιgnal, and the inputs of the second multiplexer in the r:th decompression logic means is connected to the output from the AND-gate in the r:th decompression logic means, and to an output from the comparator in the r:th decompression logic means, and m that the new pointer output from the r:th decompression logic means either is the output from the first multiplexer or the output from the second multiplexer in the r:th decompression logic means depending on if the compress flag bit is sets or not.
Another object of the invention is to provide a method for classification and forwarding of packets, wherein a destination address of an incoming packet comprises bits, wherein n is an integer. This object is achieved by providing the method defined m the introductory part of Claim 10 with the advantageous features of the characterizing part of said Claim.
The method accordirg to the present invention comprises I stages, wherein each stage represents a predetermined prefix length and a prefix represents a group of addresses, wherein the first stage represents the shortest prefix length and the ι:th stage represents the longest prefix length with n bits, wherein each stage comprises a table of entries, wherein each entry comprises a pointer field which either comprises a pointer to the table in the next stage, or a pointer to a routing table storing the forwarding information, wherein the method comprises the steps: to search for a first number of bits corrrespondmg to the shortest prefix length of the destination address in the first table; if the entry in the first table wherein a match is found comprises a pointer to the second table, to search for a second number of bits corresponding to the next shortest prefix length of the destination address in the second table; and so on until a longest matching prefix has been found, wherein the pointer to the routing table gives the forwarding information for forwarding of said incoming packet. The main advantage with this method is that it is capable of performing one lookup per table cycle. Furthermore, the method is simple and fast, and it is therefore suitable for a high-end IP router.
Advantageously, each entry in the first (i-l) tables also comprises a part bit and a valid bit, and each entry in the l : th table also comprises a valid bit, wherein a set valid bit in an entry represents a valid prefix, and the pointer field for that entry comprises a pointer to the routing table, and a set part bit in an entry in the q:th table means that the prefix matches an entry in the routing table, but is shorter than that entry, and the pointer field for the entry in the q:th table comprises a pointer to the (q+1) :th table, wherein 1 is an integer and l<q≤ι-l.
Preferably, an entry in the first (i-l) tables is not allowed to both have a set valid bit and a set part bit. Advantageously , a match is found when an entry in one stage comprises a set valid bit and all the matching entries of shorter prefix lengths are set part bits.
Preferably, each entry in each table also comprises a mask field, an address tag field, and a compress flag bit, wherein a set compress flag bit indicates that compression is used, wherein the method for the r:th table, wherein r is an integer and l≤r≤i, also comprises the following steps : - to AND-process the mask field and the destination address bits corresponding to the r:th prefix length, giving masked destination address bits as output; if the compress flag bit is not set, to output a new pointer which is input to the q:th table, and which is input to the routing table for the l : th table, wherein the new pointer is formed by using the pointer from the (q- l):th table unchanged, with the destination address bits corresponding to the r:th prefix length as low order bits; or - if the compress flag bit is set, to output a new pointer which is input to the q:th table, and which is input to the routing table for the ι:th table, wherein the new pointer is formed with the high order bits set to 0, and the low order bits are formed using the bits of the igh order part of the pointer from the (q-l):th table, and the least significant bit of the new pointer comes from the comparing step.
Embodiments of the invention will now be described with a reference to the accompanying drawings, in which:
Brief Description of the Drawings
Figure 1 shows a schematic diagram of the fields in an IP packet header;
Figure 2 shows a schematic diagram of a prefix tree with 6-bit addresses using three prefix lengths according to the principle of the present invention;
Figure 3 shows a block diagram of a lookup device according to the present invention;
Figure 4 shows a block diagram of a decompression logic means forming part of the lookup device according to the present invention; and
Figure 5 is a flow chart of the method according to the present invention. Detailed Description of Embodiments
In figure 1 there is disclosed a schematic diagram of the fields in an IP packet header. The IP packet header comprises 12 different fields. As is disclosed in figure 1 these fields are: Version, IP Header Length, Type of Service, Total Length, Identification, Flags, Fragment Offset, Time to Live, Protocol, Header Checksum, Source Address, and Destination Address. It can also contain an Options field. There are in principle two different types of IP packet classification: IP address lookup, which is used for forwarding of unicast packets based on their destination address, and identifier lookup, which is intended to be used for, for example, forwarding of multicast packets and flows of packets.
The present invention is based on the IP address lookup .
A routing table entry for IP addresses has two fields; a prefix and a next hop address. A prefix represents a group of addresses, and is given as an IP address prefix and a prefix length. For example, the IP prefix 193.10.66/234 represents all IP addresses whose 24 first bits are equal to 193.10.66. So a routing table entry for a given prefix applies to all addresses which are in the group covered by the prefix.
The principle for an address lookup is based on the longest matching prefix; with the destination address of an incoming IP packet as key, the routing table is searched for entries with matching prefixes. If there are more than one matching entry, the one with the longest prefix is chosen. By using this principle, it is always the most specific routing table entry that is picked. For example, consider a routing table with the following three entries : Prefix Next hop
0/0 193.10.66.1
193.10.64/26 193.10.66.27 193.10.66/28 193.10.66.138 The address 193.10.66.50 would match all three entries, but it is the last entry (193.10.66/28) that is picked, since it has the longest prefix (i.e., it is the most specific entry) . In figure 2 there is disclosed a schematic diagram of a prefix tree with 6-bit addresses using three prefix lengths according to the principle of the present invention. The address space can be thought of as a tree, where the nodes represent prefixes. Each level in the tree represents a specific prefix length. Prefixes with other lengths than the ones used in the tree, have to be extended to several longer prefixes. For example, for the tree in figure 2 the prefix "010" of length 3 would have to be expanded into "0100" and "0101" of length 4. In the tree, each node has one of two attributes, the first indicates if the node represents a valid prefix, corresponding to an entry in the routing table, the second indicates if it is part of a valid prefix, being a part means that the prefix matches an entry in the routing table, but is shorter than that entry (a prefix of a prefix), a node is not allowed to be both valid and part. If it is, the valid route has to be extended to the next length, marking all nodes of this length as valid. If none of the attributes are set, the node is said to be invalid. To find a matching route, the tree is searched from the shortest prefix until the first valid or invalid note is encountered. In this way the longest match is guaranteed to be found.
The following is tne procedure to find the address "010110" in a routing table represented by the tree in figure 2. The three prefix lengths are 2, 4, and 6. First the shortest prefix length "01" is looked up. The matching entry is a part, resulting in a second lookup, "0101". This entry is also a part. A last lookup "010110" is then performed, resulting in a valid entry. This entry points into the routing table where the forwarding information is stored . When fewer prefix levels are used in the data structure, more memory is needed to store it. This is due to the bit extension up to a valid prefix length, and the need for all entries in a prefix group to be present. If, for example, the step between two lengths is 8 bits, every node that is the part attribute set will have 256 child nodes in its prefix group. But with fewer levels, a prefix is found with fewer memory accesses, making the lookup faster. The ideal choice of levels and the distance between, depends on what performance is needed, and how much memory can be used.
In figure 3 there is disclosed a block diagram of a lookup device according to the present invention. The lookup device 30 is based on IP address lookup, which is used for forwarding of unicast packet based on their destination address. The lookup device 30 comprises I stages 32ι, 322, ...32i. In this figure I is 4. The first stage 32χ represents the shortest prefix length and the 4 : th stage 324 represents the longest prefix length with n bits. The lookup device 30 also comprises a routing memory means connected to said 4 : th stage 324. Each stage 32χ, 322, 323, 324 comprises a memory means 36ι, 362, 363, 364 for storing a table of entries, wherein each entry comprises a pointer field which either comprises a pointer to the memory means in the next stage, or a pointer to the routing memory means 34 which stores the forwarding information. The destination address is input to the lookup device 30 via a line 38. A first number of bits corresponding to the shortest prefix length of the destination address are searched for in the first memory means 36ι, and if the entry in the first memory means 36± wherein a match is founα comprises a pointer to the second memory means 362, then a second number of bits corresponding to the next shortest prefix length of the destination address are searched for in the second memory means 362, and so on until a longest matching prefix has been found, wherein the pointer to the routing memory means 34 gives the forwarding information for forwarding of said incoming packet. All stages but the first 322, 32 , 324 each comprises a logic means 402, 403, 404, wherein the ι:th logic means is connected to both the 1 : th memory means and the (i-l) : th memory means. Each entry in the 4 : th memory means 364 also comprises a valid bit, and each entry in the 3 first memory means 36x, 362, 363 also comprises a part bit and a valid bit. A set valid bit in an entry represents a valid prefix, and the pointer field for that entry comprises a pointer to the routing memory means 34. A set part bit in an entry in the q:th memory means 36±, 362, 363 means that the prefix matches an entry in the routing memory means 34, but is shorter than that entry, and the pointer field for the entry in the q:th memory means 36ι, 362, 363 comprises a pointer to the (q+l):th memory means 362, 363, 364 wherein q is an integer and l<q≤ι-l=3. Each of the three first memory means 36χ, 362, 363 has a pointer output, a valid bit output and a part bit output. The 4 : th memory means 364 has only a pointer output and a valid bit output. The 4 : th logic means 404 comprises a multiplexer 424, an OR-gate 444 and an AND-gate 464. Each logic means in all the other stages but the first stage (402, 403) comprises a multiplexer 422; 423, and an OR-gate 442; 443, a first AND- gate 462; 463 and a second AND-gate 482; 483. The inputs of the multiplexer 422 are connected to the pointer outputs of the first and second memory means 36x, 362. The inputs of the first AND-gate 462 are connected to the valid bit output of the second memory means 362 and to the part bit output of the first memory means 36ι. The inputs of the second AND-gate 482 are connected to the part bit output of the first and second memory means 36ι, 362. The inputs of the OR-gate 442 are connected to an output of the first AND-gate 462 and to the valid bit output of the first memory means 36χ. The inputs to the multiplexer in the p:th stage, wherein p is an integer and 3<p<ι-l, are connected to the pointer output of the p:th memory means and to an output of the multiplexer of the (p-l):th stage. The inputs of the first AND-gate in the p:th stage are connected to the valid bit output of the p:th memory means and to an output of the second AND-gate in the (p-1) : th stage. The inputs of the second AND-gate in the p:th stage are connected to the partbit output of the p:th memory means and to the output of the second AND-gate in the (p- 1) : th stage. The inputs of the OR-gate in the p:th stage are connected to the output of the first AND-gate in the (p-1) : th stage and to an output of the OR-gate in the (p- l):th stage. The inputs of the multiplexer 424 are connected to the pointer output of the memory means 364 and to an output of the multiplexer 423. The inputs of the AND-gate 464 are connected to the valid bit output of the memory means 364 and to the output of the second AND-gate 483. The inputs of the OR-gate 444 are connected to the output of the AND-gate 464 and to the output of the OR- gate 443. The routing memory means 34 are connected to the outputs from the multiplexer 424 and the OR-gate 444.
The part bit and the valid bit are used to determine when the longest match is found. In short, a match is found if an entry in one stage is valid and all the matching entries of shorter lengths are parts. The pointer and the part and valid bits are sent from one stage to the next until all lengths have been examined. When a match is found, the resulting router table pointer flows through the following stages, without being changed. The multiplexer selects the pointer of its stage if the valid bit of that stage is set, and the part bit of all previous stages are set. If this is not true the multiplexer selects the output from the previous stage, i.e. sends the results on from an earlier hit.
In figure 4 there is disclosed a block diagram of a decompression logic means included in the lookup device according to the present invention. There is only disclosed one decompression logic means 50ι, but each stage in the lookup device 30 (see figure 3) comprises a decompression logic means. In the lookup device 30 according to figure 3, there should be 4 decompression logic means 50ι, 502, 503, 504. Each decompression logic means 50.^ comprises an AND-gate 52ι, a comparator 54ι, a first multiplexer 56χ and a second multiplexer 58χ. Each entry in each memory means 36χ, 362, 363, 364 (see figure 3) also comprises a mask field, and address tag field, and a compress flag bit, wherein a set compress flag bit indicates that compression is used. Each of the memory means 36ι, 362, 363, 364 also has a mask field output, an address tag field output, and a compress flag bit output. In figure 4 there is disclosed the decompression logic means 50ι for the first stage. The decompression logic means for the other stages are constructed in the same way and are not disclosed. The inputs to the AND-gate 52χ are the mask field output and the first prefix length of the destination address. The inputs to the comparator 54ι are the address tag field output and an output from the AND- gate 52χ. The inputs to the first multiplexer 56 are the pointer output and a logically 0-sιgnal. The inputs to the second multiplexer are the output from the AND-gate 52ι and an output from the comparator 54ι. The decompression logic means 50ι outputs a new pointer, which is input to the second memory means 362 (see figure 3) .
The background to the design according to figure 4 is that a common case in sparse routing tables is that a prefix group only contains two different kinds of entries. The first kind is one or several consecutive valid entries, all identical. The second kind consists of all other entries in the group and are either invalid or valid. If they are valid, it is due to the extension of a shorter matching route, that the first kind of entries overlap. To optimize the memory requirements for these groups, we introduce a special way of representing them. To each part entry a tag is added which identifies the valid entry of the following length, and also a length indicator or a mask to allow groups of valid. In this way the table can be reduced to only two entries. One entry for addresses that match the tag, and one entry for the other addresses. Also needed is one bit to flag that the compression is to be done. Bits in the entries are saved by placing all the compressed tables in the low address range of the memory. By doing this, the high order address bits can instead be used as low order bits when addressing among the compressed tables.
In figure 5 there is disclosed a flow chart of the method according to the present invention. The method begins at block 60. The method comprises I stages, wherein each stage represents a predetermined prefix length and a prefix represents a group of addresses, wherein the first stage represents the shortest prefix length and the ι:th stage represents the longest prefix length with n bits, wherein each stage comprises a table of entries, wherein each entry comprises a pointer field which either comprises a pointer to the table in the next stage, or a pointer to a routing table storing the forwarding information. Thereafter, at block 62, the method continues to search for a first number of bits corresponding to the shortest prefix length of the destination address in the first table. Thereafter, at block 64, the question is asked whether the entry in the first table wherein a match is found comprises a pointer to the second table. If the answer is affirmative the method continues with block 66, wherein a search is performed for a second number of bits corresponding to the next shortest prefix length of the destination address in the second table. Thereafter, at block 68, the question is asked whether the entry in the second table wherein a match is found comprises a pointer to the third table. If the answer is affirmative the method continues until a longest matching prefix has been found, wherein the pointer to the routing table, at block 70, gives the forwarding information for forwarding of said incoming packet. Then the method is completed at block 72. If the answer at block 64 or 68 is negative the method continues with block 70.
The invention is not limited to the embodiment described in the foregoing. It will be obvious that many different modifications are possible within the scope of the following Claims.

Claims

Cl a ims
1. A lookup device (30) for classification and forwarding of packets, wherein the input to the lookup device (30) is a destination address of an incoming packet and the destination address comprises n bits, wherein n is an integer characterized in that the lookup device comprises I stages (32χ, 322, 323, 324), wherein each stage (32ι, 322, 323, 324) represents a predetermined prefix length and a prefix represents a group of addresses, wherein the first stage (32ι) represents the shortest prefix length and the I : th stage (324) represents the longest prefix length with n bits, and in that the lookup device (30) also comprises a routing memory means (34) connected to said ι:th stage (324), wherein each stage (32ι, 322, 323, 324) comprises a memory means (36ι, 362, 363, 364) for storing a table of entries, wherein each entry comprises a pointer field which either comprises a pointer to the memory means in the next stage, or a pointer to the routing memory means (34) storing the forwarding information, wherein a first number of bits corresponding to the shortest prefix length of the destination address are searched for in the first memory means (36ι) , and if the entry in the first memory means (36ι) wherein a match is found comprises a pointer to the second memory means (362), then a second number of bits corresponding to the next shortest prefix length of the destination address are searched for in the second memory means (362) and so on until a longest matching prefix has been found, wherein the pointer to the routing memory means (34) gives the forwarding information for forwarding of said incoming packet.
2. A lookup device (30) according to Claim 1, characterized in that the first stage (32ι) only comprises said first memory means (36χ), and in that all the other stages (322, 323, 324) each comprises a logic means (402, 403, 404), wherein the (q+l):th logic means (402, 403, 404) is connected to both the (q+l):th memory means (362, 363, 364) and the l:th memory means (36x, 362, 363) , wherein q is an integer and l≤q≤ι-1.
3. A lookup device (30) according to Claim 2, characterized in that each entry in the first (i-l) memory means (36χ, 362, 363) also comprises a part bit and a valid bit, and each entry in the I : th memory means (364) also comprises a valid bit, wherein a set valid bit in an entry represents a valid prefix, and the pointer field for that entry comprises a pointer to the routing memory means
(34), and a set part bit in an entry in the q:th memory means means that the prefix matches an entry in the routing memory means (34), but is shorter than that entry, and the pointer field for the entry in q:th memory means 5 (36╬╣, 362, 363) comprises a pointer to the (q+1) :th memory means (362; 363; 36 ) .
4. A lookup device (30) according to Claim 3, characterized in that each of the first (i-l) memory means
(36χ, 362, 363) has a pointer output, a valid bit output 0 and a part bit output, and in that the ι:th memory means
(364) has a pointer output and a valid bit output, wherein the pointer output of the q:th memory means (36╬╣; 362 363 is connected to the (q+1) :th memory means (362; 363; 364) , and to the logic means of the (q+l):th stage (322, 323, 5 324), and wherein the valid bit output and the part bit output of the q:th memory means (36╬╣, 362, 363) are connected to the logic means of the (q+1) : th stage (32 , 32,, 324) .
5. A lookup device (30) according to Claim 4, C characterized in that the logic means (404) in the 1 : th stage (324) comprises a multiplexer (424) , an OR-gate (444), and an AND-gate (464), and in that each logic means (402; 40 ) in all the other stages but the first stage comprises a multiplexer (422; 423) , an OR-gate (442; 443), 5 a first AND-gate (462; 463), and a second AND-gate (482, 48j), wherein the inputs of the multiplexer (422) ιr the second stage are connected to the pointer outputs of the first and second memory means (36ι, 362) , and the inputs of the first AND-gate (462) m the second stage are connected to the valid bit output of the second memory means (362) and to the part bit output of the first memory means (36ι), and the inputs of the second AND-gate (482) in the second stage are connected to the part bit outputs of the first and second memory means (36χ, 362) , and the inputs of the OR-gate (442) in the second stage are connected to an output from the first AND-gate (462) in the second stage and to the valid bit output of the first memory means (36χ), wherein the inputs to the multiplexer (423) in the p:th stage, wherein p is an integer and 3<p≤ι-l, are connected to the pointer output of the p:th memory means (363) and to an output of the multiplexer
(422) of the (p-1) : th stage, and the inputs of the first AND-gate (463) in the p:th stage are connected to the valid bit output of the p:th memory means (363) and to an output of the second AND-gate (482) in the (p-1) : th stage, and the inputs of the second AND-gate (483) in the p:th stage are connected to the part bit output of the p:th memory means (363) and to the output of the second AND- gate (482) in the (p-1) :th stage, and the inputs of the OR-gate (443) in the p:th stage are connected to the output of the first AND-gate (463) m the p:th stage and to an output of the OR-gate (442) in the (p-1) :th stage, and wherein the inputs of the multiplexer (424) in the l : th stage are connected to the pointer output of the l : th memory means (36 ) and to an output of the multiplexer (423) of the (i-l) : th stage, and the inputs of the AND- gate (464) m the l : th stage are connected to the valid bit output of the I : th memory means (364) and to the output of the second AND-gate (483) in the (╬╣-l):th stage, and the inputs of the OR-gate (444) m the ╬╣:th stage are connected to the output of the AND-gate (464) in the ╬╣:th stage and to the output of the OR-gate (443) in the (I- 1 ) : th stage .
6. A lookup device (30) according to Claim 5, characterized in that a match is found when an entry in one stage comprises a set valid bit output and all the matching entries of shorter prefix lengths are set part bit outputs.
7. A lookup device (30) according to any one of Claims 1-6, characterized in that each stage (32χ, 322, 323, 324) also comprises a decompression logic means (50χ, 502, 503, 504), wherein the l : th decompression logic means (504) is connected to the multiplexer (424) in the ι:th stage and the q:th decompression logic means (50χ; 502; 503) is connected to both the q:th memory means (36χ; 362; 363) and to the (q+1) : th memory means (362; 363; 364) .
8. A lookup device (30) according to Claim 7, characterized in that each entry in each memory means (36 , 362, 363, 364) also comprises a mask field, an address tag field, and a compress flag bit, wherein a set compress flag bit indicates that compression is used, and in the each of the memory means (36χ, 362, 363, 364) also has a mask field output, an address tag field output, ana a compress flag bit output, wherein the mask field output, the address tag field output, the compress flag bit output, and the pointer output of the r:th memory means (36 ; 362; 363; 364) is connected to the r:th decompression logic means (50χ; 502; 503; 504) wherein r is an integer and l≤r≤i, and wherein each decompression logic means (50χ, 502, 503, 504) outputs a new pointer, wherein the new pointer output from the q:th decompression logic means (50χ; 50 ; 503) is connected to the (q+l):th memory means (36 ; 36 ; 364) and the new pointer output from the 1 : th decompression logic means (504) is connected to the multiplexer (424) m the ι:th stage.
9. A lookup device (30) according to Claim 8, characterized in that each decompression logic means (50 ; 50 ; 503; 504) comprises an AND-gate (52 ; 522; 523; 524), a comparator (54χ; 542; 54 ; 544), a first multiplexer (56χ; 562; 563; 564) and a second multiplexer (58χ; 582; 583; 584), wherein the inputs of the AND-gate (52χ; 522; 523; 524) in the r:th decompression logic means (50χ; 5O2; 5O3; 504), is connected to the mask field output of the r:th memory means (36 ; 362; 363; 364) and to the r:th prefix length of the destination address, and the inputs of the comparator (54 ; 542; 543; 544) in the r:th decompression logic means (50χ; 5O2; 5O3; 504) is connected to the address tag field out put of the r:th memory means (36χ; 362; 363; 364) and to an output from the AND-gate (52χ;
522; 523; 524) in the r:th decompression logic means (50χ; 502; 50 ; 504), and the inputs of the first multiplexer (56χ; 562; 563; 564) in the r:th decompression logic means (50χ; 50^; 503; 504) is connected to the pointer output of the r:th memory means (36χ; 362; 363; 364) and to a logically 0-sιgnal, and the inputs of the second multiplexer (58χ; 582; 583; 584) m the r:th decompression logic means (50χ; 502; 503; 504 is connected to the output from the AND-gate (52χ; 522; 523; 524) in the r:th decompression logic means (50χ; 5O2; 5O3; 504), and to an output from the comparator (54χ; 542; 54 ; 544) in the r:th decompression logic means (50χ; 502; 503; 504) , and in that the new pointer output from the r:th decompression logic means (50χ; 502; 50 ; 504) either is the output from the first multiplexer (56χ; 562; 563; 564) or the output from the second multiplexer (58χ; 582; 583; 584) in the r:th decompression logic means (50χ; 502; 503; 504) depending on if the compress flag bit is set or not.
10. A method for classification and forwarding of packets, wherein a destination address of an incoming packet comprises n bits, wherein n is an integer, characterized in that the method comprises 1 stages, wherein each stage represents a predetermined prefix length and a prefix represents a group of addresses, wherein the first stage represents the shortest prefix length and the ╬╣:th stage represents the longest prefix length with n bits, wherein each stage comprises a table of entries, wherein each entry comprises a pointer field which either comprises a pointer to the table in the next stage, or a pointer to a routing table storing the forwarding information, wherein the method comprises the steps; to search for a first number of bits corresponding to the shortest prefix length of the destination address in the first table; if the entry in the first table wherein a match is found comprises a pointer to the second table, to search for a second number of bits corresponding to the next shortest prefix length of the destination address in the second table; and so on until a longest matching prefix has been found, wherein the pointer to the routing table gives the forwarding information for forwarding of said incoming packet .
11. A method according to Claim 10, characterized in that each entry in the first (i-l) tables also comprises a part bit and a valid bit, and each entry in the ι:th table also comprises a valid bit, wherein a set valid bit m an entry represents a valid prefix, and the pointer field for that entry comprises a pointer to the routing table, and a set part in an entry in the q:th table means that the prefix matches an entry in the routing table, but is shorter than that entry, and the pointer field for the entry in the q:th table comprises a pointer to the (q+1) : th table, wherein q is an integer and l≤q≤ι-1.
12. A method according to Claim 11, characterized in that an entry in the first (i-l) tables is not allowed to both have a set valid b___t and a set part bit.
13. A method according to Claim 12, characterized in that a match is found when an entry m one stage comprises a set valid bit and all the matching entries of shorter prefix lengths are set part bits.
14. A method according to Claim 13, characterized in that each entry m each table also comprises a mask field, an address tag field, and a compress flag bit, wherein a set compress flag bit indicates that compression is used, wherein the method for the r:th table, wherein r is an integer and lΓëñrΓëñi, also comprises the following steps: to AND-process the mask field and the destination address bits corresponding to the r:th prefix length, giving masked destination address bits as output; to compare the masked destination address bits to the address tag field; if the compress flag bit is not set, to output a new pointer which is input to the q:th table, and which is input to the routing table for the l : th table, wherein the new pointer is formed by using the pointer from the (q- 1) :th table unchanged, with the destination address bits corresponding to the r:th prefix length as low order bits; or if the compress flag bit is set, to output a new pointer which is input to the q:th table, and which is input to the routing table for the I : th table, wherein the new pointer is formed with the high order bits set to 0, and the low order bits are formed using the bits of the high order part of the pointer from the (q-1) : th table, and the least significant bit of the new pointer comes from the comparing step.
EP98943155A 1997-09-09 1998-09-07 A lookup device and a method for classification and forwarding of packets Withdrawn EP1025678A2 (en)

Applications Claiming Priority (3)

Application Number Priority Date Filing Date Title
SE9703292A SE511972C2 (en) 1997-09-09 1997-09-09 Lookup device and method for classifying and forwarding data packets
SE9703292 1997-09-09
PCT/SE1998/001584 WO1999013619A2 (en) 1997-09-09 1998-09-07 A lookup device and a method for classification and forwarding of packets

Publications (1)

Publication Number Publication Date
EP1025678A2 true EP1025678A2 (en) 2000-08-09

Family

ID=20408224

Family Applications (1)

Application Number Title Priority Date Filing Date
EP98943155A Withdrawn EP1025678A2 (en) 1997-09-09 1998-09-07 A lookup device and a method for classification and forwarding of packets

Country Status (5)

Country Link
EP (1) EP1025678A2 (en)
AU (1) AU9100898A (en)
CA (1) CA2302744A1 (en)
SE (1) SE511972C2 (en)
WO (1) WO1999013619A2 (en)

Families Citing this family (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6975631B1 (en) 1998-06-19 2005-12-13 Juniper Networks, Inc. Network packet forwarding lookup with a reduced number of memory accesses
GB9912129D0 (en) * 1999-05-26 1999-07-28 3Com Corp Communication device with forwarding database having having a trie search facility
SE9903460L (en) * 1999-09-22 2001-03-23 Effnet Group Ab Method and system for fast routing lookups
US6799202B1 (en) * 1999-12-16 2004-09-28 Hachiro Kawaii Federated operating system for a server
GB2359693B (en) * 2000-02-26 2003-07-16 3Com Corp Network switch with truncated trie look-up facility
WO2001086433A1 (en) * 2000-05-11 2001-11-15 Solidum Systems Corp. Packet classification state machine
JP2001326679A (en) 2000-05-15 2001-11-22 Fujitsu Ltd Information unit, table retrieval device, table retrieval method, and recording medium
US6880064B1 (en) 2000-06-21 2005-04-12 Mosaid Technologies, Inc. Method and apparatus for physical width expansion of a longest prefix match lookup table
US6917954B2 (en) 2001-05-30 2005-07-12 Mosaid Technologies, Inc. Load balancing in IP address lookup
GB2378622A (en) * 2001-08-11 2003-02-12 Zarlink Semiconductor Ltd Updating a lookup table used in mapping between TDM channels and packets
SE521907C2 (en) * 2002-01-21 2003-12-16 Rockstorm Technologies Ab Method and system for fast IP route search to determine where an IP datagram with a given destination address should be forwarded

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5206856A (en) * 1989-12-27 1993-04-27 Bell Communications Research, Inc. Routing of network traffic
US5365520A (en) * 1992-03-27 1994-11-15 Motorola, Inc. Dynamic signal routing

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
See references of WO9913619A3 *

Also Published As

Publication number Publication date
SE511972C2 (en) 2000-01-10
CA2302744A1 (en) 1999-03-18
SE9703292L (en) 1999-03-10
SE9703292D0 (en) 1997-09-09
WO1999013619A2 (en) 1999-03-18
WO1999013619A3 (en) 1999-06-03
AU9100898A (en) 1999-03-29

Similar Documents

Publication Publication Date Title
US7443841B2 (en) Longest prefix matching (LPM) using a fixed comparison hash table
US7315547B2 (en) Packet forwarding device
US7039018B2 (en) Technique to improve network routing using best-match and exact-match techniques
US7031320B2 (en) Apparatus and method for performing high-speed IP route lookup and managing routing/forwarding tables
US7418505B2 (en) IP address lookup using either a hashing table or multiple hash functions
US7325071B2 (en) Forwarding traffic in a network using a single forwarding table that includes forwarding information related to a plurality of logical networks
US7613189B1 (en) Apparatus and method for efficient longest prefix match lookup
US6985483B2 (en) Methods and systems for fast packet forwarding
US6275861B1 (en) Method and apparatus to identify flows in data systems
US20020129086A1 (en) Cluster-based aggregated switching technique (CAST) for routing data packets and information objects in computer networks
Pao et al. Efficient hardware architecture for fast IP address lookup
WO1999013619A2 (en) A lookup device and a method for classification and forwarding of packets
US7564841B2 (en) Apparatus and method for performing forwarding table searches using consecutive symbols tables
EP1020053A2 (en) A lookup device and a method for classification and forwarding of packets in packet-switched networks
US20050114393A1 (en) Dynamic forwarding method using binary search
Lim et al. Binary searches on multiple small trees for IP address lookup
JP3663355B2 (en) Longest matching prefix lookup
Tahir et al. Tree-combined trie: A compressed data structure for fast ip address lookup
KR100493099B1 (en) Route lookup and routing/forwarding table management for high-speed internet protocol router
KR100459542B1 (en) Internet protocol address look-up device
KR100460188B1 (en) Internet protocol address look-up method
Liu et al. Fast IP table lookup and memory reduction
Wang et al. High-performance IP routing table lookup
Wang et al. Routing interval: a new concept for IP lookups
KR20050043035A (en) Method and hardware architecture for searching ip address by using multiple hashing function

Legal Events

Date Code Title Description
PUAI Public reference made under article 153(3) epc to a published international application that has entered the european phase

Free format text: ORIGINAL CODE: 0009012

17P Request for examination filed

Effective date: 20000410

AK Designated contracting states

Kind code of ref document: A2

Designated state(s): AT BE CH CY DE DK ES FI FR GB GR IE IT LI LU MC NL PT SE

RAP1 Party data changed (applicant data changed or rights of an application transferred)

Owner name: SICS, SWEDISH INSTITUTE OF COMPUTER SCIENCE AB

STAA Information on the status of an ep patent application or granted ep patent

Free format text: STATUS: THE APPLICATION HAS BEEN WITHDRAWN

18W Application withdrawn

Effective date: 20030417