US7873041B2 - Method and apparatus for searching forwarding table - Google Patents

Method and apparatus for searching forwarding table Download PDF

Info

Publication number
US7873041B2
US7873041B2 US11/947,353 US94735307A US7873041B2 US 7873041 B2 US7873041 B2 US 7873041B2 US 94735307 A US94735307 A US 94735307A US 7873041 B2 US7873041 B2 US 7873041B2
Authority
US
United States
Prior art keywords
mac address
search
forwarding entry
forwarding
index
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.)
Expired - Fee Related, expires
Application number
US11/947,353
Other versions
US20080133494A1 (en
Inventor
Won-Kyoung Lee
Jae-Woo Park
Young-sik Chung
Yoo-Kyoung Lee
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.)
Electronics and Telecommunications Research Institute ETRI
Original Assignee
Electronics and Telecommunications Research Institute ETRI
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
Priority claimed from KR1020070097487A external-priority patent/KR100907827B1/en
Application filed by Electronics and Telecommunications Research Institute ETRI filed Critical Electronics and Telecommunications Research Institute ETRI
Assigned to ELECTRONICS AND TELECOMMUNICATIONS RESEARCH INSTITUTE reassignment ELECTRONICS AND TELECOMMUNICATIONS RESEARCH INSTITUTE ASSIGNMENT OF ASSIGNORS INTEREST (SEE DOCUMENT FOR DETAILS). Assignors: CHUNG, YOUNG SIK, LEE, WON KYOUNG, LEE, YOO KYOUNG, PARK, JAE WOO
Publication of US20080133494A1 publication Critical patent/US20080133494A1/en
Application granted granted Critical
Publication of US7873041B2 publication Critical patent/US7873041B2/en
Expired - Fee Related legal-status Critical Current
Adjusted expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/66Arrangements for connecting between networks having differing types of switching systems, e.g. gateways
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/901Indexing; Data structures therefor; Storage structures
    • G06F16/9014Indexing; Data structures therefor; Storage structures hash tables

Definitions

  • the present invention relates to a method and apparatus for searching a forwarding table, and more particularly, to a method and apparatus for searching a forwarding table capable of effectively searching for and managing forwarding information for allowing a network switch to transmit a frame to a desirable port among a plurality of ports.
  • a network switch included in a communication network needs a forwarding searching engine and address translation mechanism so as to receive data from another network equipment and transmit the data to a desirable port.
  • the performance of the network switch is largely influenced by a speed of determining a forwarding path, the efficiency and the speed of the forwarding searching engine and the address translation mechanism are main factors for determining the performance of the network switch.
  • the network switch includes a hash unit for transforming a search key having a large number of bits into an index value having a small number of bits. Accordingly, it is possible to acquire an appropriate forwarding entry by searching the forwarding table with the hash index of less length than the original search key.
  • FIG. 1 illustrates a concept of an operation of an apparatus for searching a forwarding table according to a conventional example.
  • the apparatus for searching the forwarding table of FIG. 1 selects a forwarding entry fwd_ent in a forwarding table fwd_table and compares a media access control (MAC) address of the selected entry with an input MAC address.
  • MAC media access control
  • the forwarding entries are not aligned based on a predetermined rule but aligned in the order to storing the forwarding entries.
  • a page to be searched by using the most significant bits (MSB) of 3 bits of a hash key is firstly selected, and forwarding entries in the page are sequentially searched.
  • MSB most significant bits
  • the searching time is largely reduced as compared with the existing sequential searching method.
  • the searching speed decreases in proportion to the number of forwarding entries included in the page.
  • an apparatus for searching a forwarding table comprising: a data storage unit storing a forwarding table including a plurality of forwarding entries aligned in the order of MAC address values and stored in each group after being classified into a plurality of groups and a plurality of forwarding databases having hash keys corresponding to the groups and; a hashing unit transforming an externally input MAC address into a hash key and selecting a search group and a search-forwarding entry by respectively using some bits and the other bits of the hash key; and a port information output unit outputting output port information of the search-forwarding entry, when the input MAC address is the same as a MAC address extracted from the search-forwarding entry and outputting output port information after searching and acquiring a forwarding entry having the input MAC address while dividing a search area in the search group, when the input MAC address is different from the extracted MAC address.
  • the port information output unit may include: an equation comparator outputting the output port information of the search-forwarding entry, when the input MAC address is the extracted MAC address; an inequality comparator acquiring a new forwarding entry by dividing the search area in the search group, when the input MAC address is different from the extracted MAC address; and a searching location movement unit moving to the new search-forwarding entry.
  • the inequality comparator may search for the new search-forwarding entry having an index index_cur that is calculated according to an equation of “index_init+(index_final ⁇ index_init)/2” after setting the extracted MAC address to an initial index value index_init, when the input MAC address is greater than the extracted MAC address and setting the extracted MAC address to a final index value index_final, when the input MAC address is less than the extracted MAC address.
  • each of the plurality of forwarding databases may include a forwarding database ID and information on a hash table indexed by using a hash key that is mapped in correspondence with a group and a forwarding entry.
  • Each of the plurality of forwarding entries may include the MAC address, information on information validity, output port information, a virtual LAN ID, and information on a pointer for representing a location of the next forwarding entry.
  • a method of searching for forwarding information comprising: constructing a plurality of forwarding entries which are aligned in the order of MAC address values and stored in each group after being classified into a plurality of groups and a plurality of forwarding databases having hash keys corresponding to the groups and the forwarding entries; transforming an input MAC address into a hash key, when the MAC address is externally input, and selecting a search group and a search forwarding entry by respectively using some bits and the other bits of the hash key; extracting a MAC address from the search-forwarding entry and extracting and outputting output port information of the search-forwarding entry, when the extracted address is the same as the input MAC address; and outputting the output port information after newly searching for a forwarding entry having the input MAC address while dividing a search area in the search group, when the extracted address is different from the input MAC address.
  • the outputting of the port information may include: setting the extracted MAC address to an initial index value index_init, when the input MAC address is greater than the extracted MAC address and setting the extracted MAC address to a final index value index_final, when the input MAC address is less than the extracted MAC address; moving to the new search-forwarding entry having an index calculated based on an equation of “index_init+(index_final ⁇ index_init)/2”; and outputting output port information of the new search-forwarding entry, when the MAC address of the new search-forwarding entry is the same as the input MAC address and returning to the setting of the extracted MAC address, when the MAC address of the new search-forwarding entry is different from the input MAC address.
  • the aligning of the forwarding entry may include: determining whether to add or delete the forwarding entry having the input MAC address; adding the forwarding entry at a location of a final index after increasing an index value of a forwarding entry which is greater than that of the modified index by one unit, when adding the forwarding entry; and deleting the forwarding entry after setting the final index value to the modified index, when deleting the forwarding entry and decreasing the index value of the forwarding entry which is greater than that of the modified index by one unit.
  • the method and apparatus for searching a forwarding table it is possible to speedily search for a desirable forwarding entry by using the dual hashing technique and the divide-and-conquer technique after classifying forwarding entries into a plurality of groups and aligning forwarding entries in each group in the order of MAC addresses.
  • the dual hashing technique and the divide-and-conquer technique after classifying forwarding entries into a plurality of groups and aligning forwarding entries in each group in the order of MAC addresses.
  • FIG. 1 illustrates a concept of an operation of an apparatus for searching a forwarding table according to a conventional example
  • FIG. 2 illustrates a concept of an operation of an apparatus for searching a forwarding table according to another conventional example
  • FIG. 3 illustrates a structure of an apparatus for searching a forwarding table according to an embodiment of the present invention
  • FIG. 4 illustrates a data structure of a forwarding database of FIG. 3 ;
  • FIG. 5 illustrates a data structure of a forwarding entry of FIG. 3 ;
  • FIG. 6 illustrates a concept of an operation of a hashing unit of FIG. 3 ;
  • FIG. 7 is a flowchart of a method of searching for forwarding information according to an embodiment of the present invention.
  • FIG. 8 illustrates an example of a method of searching for a forwarding entry using a divide-and-conquer technique according to an embodiment of the present invention.
  • FIG. 9 is a flowchart of a method of aligning forwarding entries according to an embodiment of the present invention.
  • FIG. 3 illustrates a structure of an apparatus for searching a forwarding table according to an embodiment of the present invention.
  • the apparatus for searching the forwarding table includes a data storage unit 410 , a hashing unit 420 , a port information output unit 430 , and a forwarding entry alignment unit 440 .
  • the data storage unit 410 stores a forwarding table fwd_table.
  • the forwarding table fwd_table has two data structures that are a forwarding database fwd_db and a forwarding entry fwd_ent.
  • a plurality of forwarding entries fwd_ent are classified into a plurality of groups based on some bits of a hash key and sequentially stored in the order of MAC address values.
  • the forwarding table fwd_table is indexed with a forwarding database ID (hereinafter, FID).
  • FID forwarding database ID
  • the forwarding table fwd_table stores pointers pfwd_db for representing the locations of the forwarding databases fwd_db corresponding to FIDS.
  • Each forwarding database fwd_db has a structure of FIG. 4 .
  • Each forwarding database fwd_db stores an FID and information on a hash table indexed with a hash key mapped so as to indicate a corresponding forwarding entry.
  • Each forwarding entry fwd_ent has a structure of FIG. 5 .
  • Each forwarding entry stores information such as an MAC address, validity information, output port information (pointer to set output L2 port ID), a virtual LAN ID (VLAN ID), and a pointer for representing a location of the next forwarding entry (pointer to the next entry).
  • the hashing unit 420 After transforming a MAC address in an externally input frame into a hash key with small number of bits, the hashing unit 420 selects a searching group from among a plurality of groups and selects a search-forwarding entry from the selected group by using a dual hashing technique.
  • the hashing unit 420 selects a search group by using some bits of the hash key and selects a search-forwarding entry by using the other bits.
  • the plurality of forwarding entries fwd_ent are classified into eight groups.
  • the forwarding table fwd_table is constructed so that each group stores sixty four forwarding entries, as shown in FIG. 6
  • the hashing unit 420 selects a group by using MSB of 3 bits of a hash key and selects a forwarding entry from the selected group by using the remaining six bits.
  • the port information output unit 430 output the output port information of the selected forwarding entry.
  • the MAC address of the forwarding entry selected by the hashing unit 420 is different from the input MAC address, after searching for and obtaining a new forwarding entry having the input MAC address while dividing a searching area in the searching group by two by using a divide-and-conquer technique, the output port information thereof is output.
  • the port information output unit 430 includes equation and inequality comparators 431 and 432 for outputting an output port by determining whether the input MAC address is the same as the MAC address of the search-forwarding entry and determining which one is greater than the other or searching for a new forwarding entry by dividing the search area by two, and a search location movement unit 433 for moving a search location to a new search-forwarding entry based on the operation result of the equation and inequality comparators 431 and 432 .
  • the forwarding entry alignment unit 440 serves to add or delete forwarding entries in the order of MAC addresses. For example, when adding a forwarding entry, the forwarding entry alignment unit 440 sets a final index index_final to a modified index index_modified and increases the index value of the forwarding entry which is greater than that of the modified index index_modified by one unit. On the other hand, when deleting a forwarding entry, the forwarding entry alignment unit 440 sets an index of the forwarding entry to be deleted to a modified index index_modified. Then, the forwarding entry alignment unit 440 deletes the forwarding entry and decreases the index value of the forwarding entry which is greater than that of the modified index index_modified by one unit.
  • a storage position of a forwarding entry with an index greater than that of the added forwarding entry is backwardly shifted by one position.
  • a storage position of a forwarding entry with an index greater than that of the deleted forwarding entry is forwardly shifted by one position.
  • FIG. 7 is a flowchart of a method of searching for forwarding information according to an embodiment of the present invention.
  • a search group and a search-forwarding entry located in a search group are selected by using the hash key based on the dual hashing technique (S 102 ).
  • the MAC address is compared with the MAC address of the input frame (S 104 ).
  • the current process returns to operation S 103 after moving to the previous group having a group ID value less than that of the search group by one unit (S 108 ).
  • the current process returns to S 103 after moving to the next group having a group ID value greater than that of the search group by one unit (S 110 ).
  • the input MAC address is compared with the MAC address extracted in operation S 103 , again (S 111 ).
  • the extracted MAC address is set to an initial index value index_init (S 112 ).
  • the extracted MAC address is set to a final index value index_final (S 113 ).
  • the initial index value index_init is set to a MAC address with the least index value in the search group
  • the final index value index_final is set to a MAC address with the greatest index value in the search group.
  • the initial and final index values are set to the extracted MAC address, again, through operation S 113 .
  • the current index index_cur is calculated according to an equation of “index_init+(index_final ⁇ index_init)/2”.
  • the forwarding entry with the calculated current index index_cur is selected (S 114 ).
  • a new forwarding entry is selected by dividing the search area in the search group by two.
  • a fourth forwarding entry is selected.
  • the tenth forwarding entry is selected (S 3 ). Accordingly, a desirable forwarding entry is selected through less numbers of searching operations.
  • FIG. 9 is a flowchart of a method of aligning forwarding entries according to an embodiment of the present invention.
  • forwarding entries in the forwarding table fwd_table are aligned and stored in the order of MAC address values.
  • a modified index index_modified is set to a final index value index_final (S 202 ).
  • a new forwarding entry is added at a location of the final index value index_final (S 204 ).

Abstract

A method and apparatus for searching a forwarding table are provided. The apparatus includes: a data storage unit storing a forwarding table including a plurality of forwarding entries aligned in the order of MAC address values and stored in each group after being classified into a plurality of groups and a plurality of forwarding databases having hash keys corresponding to the groups and; a hashing unit transforming an externally input MAC address into a hash key and selecting a search group and a search-forwarding entry by respectively using some bits and the other bits of the hash key; and a port information output unit outputting output port information of the search-forwarding entry, when the input MAC address is the same as a MAC address extracted from the search-forwarding entry and outputting output port information after searching and acquiring a forwarding entry having the input MAC address while dividing a search area in the search group, when the input MAC address is different from the extracted MAC address. Accordingly, it is possible to speedily search a forwarding table.

Description

CROSS-REFERENCE TO RELATED APPLICATIONS
This application claims the priority of Korean Patent Application No. 10-2006-0121046 filed on Dec. 1, 2006 in the Korean Intellectual Property Office and Korean Patent Application No. 10-2007-0097487 filed on Sep. 27, 2007 the disclosure of which is incorporated herein by reference.
BACKGROUND OF THE INVENTION
1. Field of the Invention
The present invention relates to a method and apparatus for searching a forwarding table, and more particularly, to a method and apparatus for searching a forwarding table capable of effectively searching for and managing forwarding information for allowing a network switch to transmit a frame to a desirable port among a plurality of ports.
This work Was supported by the IT R&D program of MIC/IITA[2005-S-102-02, Carrier Class Ethernet Technology].
2. Description of the Related Art
A network switch included in a communication network needs a forwarding searching engine and address translation mechanism so as to receive data from another network equipment and transmit the data to a desirable port.
Since the performance of the network switch is largely influenced by a speed of determining a forwarding path, the efficiency and the speed of the forwarding searching engine and the address translation mechanism are main factors for determining the performance of the network switch.
In general, in order to reduce a searching time, the network switch includes a hash unit for transforming a search key having a large number of bits into an index value having a small number of bits. Accordingly, it is possible to acquire an appropriate forwarding entry by searching the forwarding table with the hash index of less length than the original search key.
FIG. 1 illustrates a concept of an operation of an apparatus for searching a forwarding table according to a conventional example. The apparatus for searching the forwarding table of FIG. 1 selects a forwarding entry fwd_ent in a forwarding table fwd_table and compares a media access control (MAC) address of the selected entry with an input MAC address. When the MAC address of the selected entry is the same as the input MAC address, output port information of the selected forwarding entry fwd_ent is read. Otherwise, the MAC address of the next forwarding entry fwd_ent sequentially is compared with the input MAC address to obtain the output port information.
At this time, the forwarding entries are not aligned based on a predetermined rule but aligned in the order to storing the forwarding entries.
Accordingly, in this sequential searching method, since information of all the forwarding entries fwd_ent has to be read and compared, it takes too much time to determine a forwarding path.
In order to complement this disadvantage, in U.S. Pat. No. 6,266,705, as shown in FIG. 2, a method of searching for an appropriate forwarding entry and sorting a plurality of forwarding entries into several pages by using a dual hashing technique is suggested.
In a method of FIG. 2, a page to be searched by using the most significant bits (MSB) of 3 bits of a hash key is firstly selected, and forwarding entries in the page are sequentially searched.
Accordingly, in the method of FIG. 2, the searching time is largely reduced as compared with the existing sequential searching method. However, the searching speed decreases in proportion to the number of forwarding entries included in the page.
SUMMARY OF THE INVENTION
In the searching method in U.S. Pat. No. 6,266,705, a searching time is relatively short. However, it is disadvantageous that a searching speed is reduced in proportion to the number of forwarding entries included in a corresponding page.
According to an aspect of the present invention, there is provided an apparatus for searching a forwarding table, the apparatus comprising: a data storage unit storing a forwarding table including a plurality of forwarding entries aligned in the order of MAC address values and stored in each group after being classified into a plurality of groups and a plurality of forwarding databases having hash keys corresponding to the groups and; a hashing unit transforming an externally input MAC address into a hash key and selecting a search group and a search-forwarding entry by respectively using some bits and the other bits of the hash key; and a port information output unit outputting output port information of the search-forwarding entry, when the input MAC address is the same as a MAC address extracted from the search-forwarding entry and outputting output port information after searching and acquiring a forwarding entry having the input MAC address while dividing a search area in the search group, when the input MAC address is different from the extracted MAC address.
In the above aspect of the present invention, the port information output unit may include: an equation comparator outputting the output port information of the search-forwarding entry, when the input MAC address is the extracted MAC address; an inequality comparator acquiring a new forwarding entry by dividing the search area in the search group, when the input MAC address is different from the extracted MAC address; and a searching location movement unit moving to the new search-forwarding entry.
In addition, the inequality comparator may search for the new search-forwarding entry having an index index_cur that is calculated according to an equation of “index_init+(index_final−index_init)/2” after setting the extracted MAC address to an initial index value index_init, when the input MAC address is greater than the extracted MAC address and setting the extracted MAC address to a final index value index_final, when the input MAC address is less than the extracted MAC address.
In addition, each of the plurality of forwarding databases may include a forwarding database ID and information on a hash table indexed by using a hash key that is mapped in correspondence with a group and a forwarding entry. Each of the plurality of forwarding entries may include the MAC address, information on information validity, output port information, a virtual LAN ID, and information on a pointer for representing a location of the next forwarding entry.
According to another aspect of the present invention, there is provided a method of searching for forwarding information, the method comprising: constructing a plurality of forwarding entries which are aligned in the order of MAC address values and stored in each group after being classified into a plurality of groups and a plurality of forwarding databases having hash keys corresponding to the groups and the forwarding entries; transforming an input MAC address into a hash key, when the MAC address is externally input, and selecting a search group and a search forwarding entry by respectively using some bits and the other bits of the hash key; extracting a MAC address from the search-forwarding entry and extracting and outputting output port information of the search-forwarding entry, when the extracted address is the same as the input MAC address; and outputting the output port information after newly searching for a forwarding entry having the input MAC address while dividing a search area in the search group, when the extracted address is different from the input MAC address.
In the above aspect of the present invention, the outputting of the port information may include: setting the extracted MAC address to an initial index value index_init, when the input MAC address is greater than the extracted MAC address and setting the extracted MAC address to a final index value index_final, when the input MAC address is less than the extracted MAC address; moving to the new search-forwarding entry having an index calculated based on an equation of “index_init+(index_final−index_init)/2”; and outputting output port information of the new search-forwarding entry, when the MAC address of the new search-forwarding entry is the same as the input MAC address and returning to the setting of the extracted MAC address, when the MAC address of the new search-forwarding entry is different from the input MAC address.
In addition, the aligning of the forwarding entry may include: determining whether to add or delete the forwarding entry having the input MAC address; adding the forwarding entry at a location of a final index after increasing an index value of a forwarding entry which is greater than that of the modified index by one unit, when adding the forwarding entry; and deleting the forwarding entry after setting the final index value to the modified index, when deleting the forwarding entry and decreasing the index value of the forwarding entry which is greater than that of the modified index by one unit.
Accordingly, in the method and apparatus for searching a forwarding table, it is possible to speedily search for a desirable forwarding entry by using the dual hashing technique and the divide-and-conquer technique after classifying forwarding entries into a plurality of groups and aligning forwarding entries in each group in the order of MAC addresses. Thus, it is possible to improve the performance of a network switch.
In addition, in the present invention, although a forwarding entry is added or deleted, the alignment order of the forwarding entries is maintained. Thus, it is possible to effectively manage the forwarding table.
BRIEF DESCRIPTION OF THE DRAWINGS
The above and other aspects, features and other advantages of the present invention will be more clearly understood from the following detailed description taken in conjunction with the accompanying drawings, in which:
FIG. 1 illustrates a concept of an operation of an apparatus for searching a forwarding table according to a conventional example;
FIG. 2 illustrates a concept of an operation of an apparatus for searching a forwarding table according to another conventional example;
FIG. 3 illustrates a structure of an apparatus for searching a forwarding table according to an embodiment of the present invention;
FIG. 4 illustrates a data structure of a forwarding database of FIG. 3;
FIG. 5 illustrates a data structure of a forwarding entry of FIG. 3;
FIG. 6 illustrates a concept of an operation of a hashing unit of FIG. 3;
FIG. 7 is a flowchart of a method of searching for forwarding information according to an embodiment of the present invention;
FIG. 8 illustrates an example of a method of searching for a forwarding entry using a divide-and-conquer technique according to an embodiment of the present invention; and
FIG. 9 is a flowchart of a method of aligning forwarding entries according to an embodiment of the present invention.
DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENT
Exemplary embodiments of the present invention will now be described in detail with reference to the accompanying drawings.
FIG. 3 illustrates a structure of an apparatus for searching a forwarding table according to an embodiment of the present invention.
Referring to FIG. 3, the apparatus for searching the forwarding table includes a data storage unit 410, a hashing unit 420, a port information output unit 430, and a forwarding entry alignment unit 440.
The data storage unit 410 stores a forwarding table fwd_table. The forwarding table fwd_table has two data structures that are a forwarding database fwd_db and a forwarding entry fwd_ent. A plurality of forwarding entries fwd_ent are classified into a plurality of groups based on some bits of a hash key and sequentially stored in the order of MAC address values.
At this time, the forwarding table fwd_table is indexed with a forwarding database ID (hereinafter, FID). The forwarding table fwd_table stores pointers pfwd_db for representing the locations of the forwarding databases fwd_db corresponding to FIDS.
Each forwarding database fwd_db has a structure of FIG. 4. Each forwarding database fwd_db stores an FID and information on a hash table indexed with a hash key mapped so as to indicate a corresponding forwarding entry. Each forwarding entry fwd_ent has a structure of FIG. 5. Each forwarding entry stores information such as an MAC address, validity information, output port information (pointer to set output L2 port ID), a virtual LAN ID (VLAN ID), and a pointer for representing a location of the next forwarding entry (pointer to the next entry).
After transforming a MAC address in an externally input frame into a hash key with small number of bits, the hashing unit 420 selects a searching group from among a plurality of groups and selects a search-forwarding entry from the selected group by using a dual hashing technique.
That is, the hashing unit 420 selects a search group by using some bits of the hash key and selects a search-forwarding entry by using the other bits.
For example, the plurality of forwarding entries fwd_ent are classified into eight groups. When the forwarding table fwd_table is constructed so that each group stores sixty four forwarding entries, as shown in FIG. 6, the hashing unit 420 according to the embodiment of the present invention selects a group by using MSB of 3 bits of a hash key and selects a forwarding entry from the selected group by using the remaining six bits.
When the MAC address of the forwarding entry selected by the hashing unit 420 is the same as an input MAC address, the port information output unit 430 output the output port information of the selected forwarding entry. When the MAC address of the forwarding entry selected by the hashing unit 420 is different from the input MAC address, after searching for and obtaining a new forwarding entry having the input MAC address while dividing a searching area in the searching group by two by using a divide-and-conquer technique, the output port information thereof is output.
The port information output unit 430 includes equation and inequality comparators 431 and 432 for outputting an output port by determining whether the input MAC address is the same as the MAC address of the search-forwarding entry and determining which one is greater than the other or searching for a new forwarding entry by dividing the search area by two, and a search location movement unit 433 for moving a search location to a new search-forwarding entry based on the operation result of the equation and inequality comparators 431 and 432.
The forwarding entry alignment unit 440 serves to add or delete forwarding entries in the order of MAC addresses. For example, when adding a forwarding entry, the forwarding entry alignment unit 440 sets a final index index_final to a modified index index_modified and increases the index value of the forwarding entry which is greater than that of the modified index index_modified by one unit. On the other hand, when deleting a forwarding entry, the forwarding entry alignment unit 440 sets an index of the forwarding entry to be deleted to a modified index index_modified. Then, the forwarding entry alignment unit 440 deletes the forwarding entry and decreases the index value of the forwarding entry which is greater than that of the modified index index_modified by one unit.
That is, when adding a forwarding entry, a storage position of a forwarding entry with an index greater than that of the added forwarding entry is backwardly shifted by one position. When deleting the forwarding entry, a storage position of a forwarding entry with an index greater than that of the deleted forwarding entry is forwardly shifted by one position.
FIG. 7 is a flowchart of a method of searching for forwarding information according to an embodiment of the present invention.
After transforming a MAC address in an externally input frame into a hash key (S101), a search group and a search-forwarding entry located in a search group are selected by using the hash key based on the dual hashing technique (S102).
After extracting the MAC address stored in the search-forwarding entry (S103), the MAC address is compared with the MAC address of the input frame (S104).
As a result of the comparison of operation S104, when the MAC address is the same as the MAC address of the input frame, output port information stored in the search-forwarding entry is extracted and reported, and the current process is completed (S105 and S106).
On the other hand, when the MAC address is different from the MAC address of the input frame, it is checked whether the input MAC address is less than the MAC address of a first forwarding entry in the search group (S107). When the MAC address is less than the MAC address of the first forwarding entry, the current process returns to operation S103 after moving to the previous group having a group ID value less than that of the search group by one unit (S108).
On the other hand, when the MAC address is greater than that of the first forwarding entry, it is checked whether the input MAC address is greater than the MAC address of the last forwarding entry in the search group (S109). When the input MAC address is greater than the MAC address of the last forwarding entry, the current process returns to S103 after moving to the next group having a group ID value greater than that of the search group by one unit (S110).
When the input MAC address is greater than that of the first forwarding entry and less than that of the last forwarding entry in the search group, the input MAC address is compared with the MAC address extracted in operation S103, again (S111).
As a result of the comparison, when the input MAC address is greater than the extracted MAC address, the extracted MAC address is set to an initial index value index_init (S112). When the input MAC address is less than the extracted MAC address, the extracted MAC address is set to a final index value index_final (S113).
When initializing the forwarding entry, the initial index value index_init is set to a MAC address with the least index value in the search group, and the final index value index_final is set to a MAC address with the greatest index value in the search group. However, the initial and final index values are set to the extracted MAC address, again, through operation S113.
Then, the current index index_cur is calculated according to an equation of “index_init+(index_final−index_init)/2”. The forwarding entry with the calculated current index index_cur is selected (S114).
That is, a new forwarding entry is selected by dividing the search area in the search group by two.
For example, as shown in FIG. 8, although a tenth forwarding entry has the input MAC address, a fourth forwarding entry is selected. Then, in the present invention, after selecting twelfth and eighth forwarding entries dividing the search area (S1 and S2), the tenth forwarding entry is selected (S3). Accordingly, a desirable forwarding entry is selected through less numbers of searching operations.
Continuously, it is checked whether a valid bit of the forwarding entry selected in operation S114 is “1” (S115). When the valid bit is “1”, it is checked that the currently selected forwarding entry is valid. The current process returns to operation S103.
On the other hand, when the valid bit is “0”, it is checked that the currently selected forwarding entry is invalid. In order to add an forwarding entry having the input MAC address or to delete the currently selected forwarding entry, a process of aligning forwarding entries is performed, and the current process is completed (S116).
FIG. 9 is a flowchart of a method of aligning forwarding entries according to an embodiment of the present invention. In FIG. 9, forwarding entries in the forwarding table fwd_table are aligned and stored in the order of MAC address values.
First, when an operation of aligning the forwarding entries is requested and activated, it is checked whether the requested operation is an operation of adding a forwarding entry or an operation of deleting a forwarding entry (S201).
When the requested operation is the operation of adding a forwarding entry, a modified index index_modified is set to a final index value index_final (S202). After shifting a forwarding entry having an index value greater than that of the modified index index_modified by one position (S203), a new forwarding entry is added at a location of the final index value index_final (S204).
When deleting a forwarding entry located in the forwarding table fwd_table, after storing an index of the forwarding entry to be deleted in the modified index index_modified (S205), the forwarding entry is deleted (S206), and a forwarding entry having an index value greater than that of the modified index index_modified is shifted by one position (S207).
Accordingly, although a forwarding entry to be stored in a forwarding table fwd_table is added or deleted, the alignment order in the forwarding table fwd_table based on the MAC addresses is maintained.
While the present invention has been shown and described in connection with the exemplary embodiments, it will be apparent to those skilled in the art that modifications and variations can be made without departing from the spirit and scope of the invention as defined by the appended claims.

Claims (7)

1. An apparatus for searching a forwarding table, the apparatus comprising:
a data storage unit storing a forwarding table including:
a plurality of search groups arranged according to MAC address values;
a plurality of search-forwarding entries arranged according to MAC address values and stored in each search group, and
a plurality of forwarding databases having hash keys corresponding to the search groups,
a hashing unit configured to transform an externally input MAC address into a hash key including a first key component and a second key component, and
a port information output unit including:
a first comparator configured to compare the first key component of the input MAC address with a MAC address extracted from a forwarding entry in a search group to select a search group; and
a second comparator configured to compare the second key component of the input MAC address with the MAC address extracted from a search-forwarding entry in the selected search group to select a matched search-forwarding entry,
wherein the port information output unit outputs the output port information of the matched search-forwarding entry if the input MAC address matches the MAC address of the search-forwarding entry in the selected search group, and outputs output port information after searching and acquiring a forwarding entry having the input MAC address while dividing a search area in the search group, when the input MAC address is different from the extracted MAC address.
2. The apparatus of claim 1, wherein the second comparator includes:
an equation comparator configured to output the output port information of the matched search-forwarding entry if the input MAC address is the same as the extracted MAC address;
an inequality comparator configured to determine whether the input MAC address is greater or less than the MAC address of a search forwarding entry in the selected group or in the selected subgroup if the input MAC address is different from the extracted MAC address; and
a searching location movement unit re-selecting new search-forwarding entry to be compared with the input MAC address,
wherein when the input MAC address does not match the MAC address of the search forwarding entry in the selected search group, the second comparator divides the selected search group into a plurality of subgroups and selects a subgroup depending on whether the input MAC address is greater or less than the MAC address of the search forwarding entry, and re-compares the input MAC address with the MAC address of a search forwarding entry in the selected subgroup, and
wherein additional sub-division of the selected subgroup is repeated until match or mismatch is declared, and when match is declared, the port information output unit outputs the output port information of the matched search-forwarding entry.
3. The apparatus of claim 2, wherein the inequality comparator searches for the new search-forwarding entry having an index index_cur that is calculated according to an equation of “index_init+(index_final−index_init)/2”,
wherein when the input MAC address is greater than the extracted MAC address, the “index_init” is set to the extracted MAC address and the “index_final” is set to the MAC address of the last search-forwarding entry included in the selected search group or the selected search subgroup, and
wherein when the input MAC address is less than the extracted MAC address, the “index_final” is set to the extracted MAC address and the “index init” is set to the MAC address of the first search-forwarding entry included in the selected search group or the selected search subgroup.
4. The apparatus of claim 1, further comprising a forwarding entry alignment unit increasing an index value of a forwarding entry which is greater than that of an added forwarding entry by one unit, when adding the forwarding entry and decreasing the index value of the forwarding entry which is greater than that of a deleted forwarding entry by one unit, when deleting the forwarding entry.
5. The apparatus of claim 1, wherein each of the plurality of forwarding databases includes a forwarding database ID and information on a hash table indexed by using a hash key that is mapped in correspondence with a group and a forwarding entry.
6. The apparatus of claim 1, wherein each of the plurality of forwarding entries includes the MAC address, information on information validity, output port information, a virtual LAN ID, and information on a pointer for representing a location of the next forwarding entry.
7. A method of searching for forwarding information, the method comprising:
constructing a plurality of forwarding entries which are aligned in the order of MAC address values and stored in each group after being classified into a plurality of groups and a plurality of forwarding databases having hash keys corresponding to the groups and the forwarding entries;
transforming an input MAC address into a hash key, when the MAC address is externally input, and selecting a search group and a search forwarding entry by respectively using some bits and the other bits of the hash key;
extracting a MAC address from the search-forwarding entry and extracting and outputting output port information of the search-forwarding entry, when the extracted address is the same as the input MAC address;
outputting the output port information after newly searching for a forwarding entry having the input MAC address while dividing a search area in the search group, when the extracted address is different from the input MAC address; and
aligning the forwarding entry having the input MAC address when the new search-forwarding entry is not valid,
wherein the aligning of the forwarding entry includes:
determining whether to add or delete the forwarding entry having the input MAC address;
adding the forwarding entry at a location of a final index after increasing an index value of a forwarding entry which is greater than that of a modified index by one unit, when adding the forwarding entry; and
deleting the forwarding entry after setting the final index value to the modified index when deleting the forwarding entry, and decreasing the index value of the forwarding entry which is greater than that of the modified index by one unit.
US11/947,353 2006-12-01 2007-11-29 Method and apparatus for searching forwarding table Expired - Fee Related US7873041B2 (en)

Applications Claiming Priority (4)

Application Number Priority Date Filing Date Title
KR20060121046 2006-12-01
KR10-2006-0121046 2006-12-01
KR10-2007-0097487 2007-09-27
KR1020070097487A KR100907827B1 (en) 2006-12-01 2007-09-27 Forwarding Table Search Device and Method

Publications (2)

Publication Number Publication Date
US20080133494A1 US20080133494A1 (en) 2008-06-05
US7873041B2 true US7873041B2 (en) 2011-01-18

Family

ID=39477035

Family Applications (1)

Application Number Title Priority Date Filing Date
US11/947,353 Expired - Fee Related US7873041B2 (en) 2006-12-01 2007-11-29 Method and apparatus for searching forwarding table

Country Status (1)

Country Link
US (1) US7873041B2 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100208740A1 (en) * 2009-02-18 2010-08-19 Funai Electric Co., Ltd. Communication Apparatus and Communication System
US20140294008A1 (en) * 2013-03-28 2014-10-02 Hitachi Metals, Ltd. Network Relay Device

Families Citing this family (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7286528B1 (en) * 2001-12-12 2007-10-23 Marvell International Ltd. Multiple address databases in a switch without the need for extra memory
US8335780B2 (en) * 2008-03-11 2012-12-18 James Madison Kelley Scalable high speed relational processor for databases and networks
KR100994127B1 (en) * 2008-08-28 2010-11-15 한국전자통신연구원 Packet processing method for improving Ethernet switch performance
CN102736986A (en) * 2011-03-31 2012-10-17 国际商业机器公司 Content-addressable memory and data retrieving method thereof
US9197552B1 (en) * 2012-10-15 2015-11-24 Cisco Technology, Inc. Indexed access to a forwarding table in a network device
US9712324B2 (en) 2013-03-19 2017-07-18 Forcepoint Federal Llc Methods and apparatuses for reducing or eliminating unauthorized access to tethered data
US9697372B2 (en) * 2013-03-19 2017-07-04 Raytheon Company Methods and apparatuses for securing tethered data
US9270592B1 (en) * 2014-01-24 2016-02-23 Google Inc. Hash collision avoidance in network routing
US10028121B2 (en) * 2016-04-07 2018-07-17 T-Mobile Usa, Inc. Determining device locations for emergency service calls

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5748905A (en) * 1996-08-30 1998-05-05 Fujitsu Network Communications, Inc. Frame classification using classification keys
KR20000013760A (en) 1998-08-13 2000-03-06 윤종용 Multiple access computer address hashing method of lan switch using cyclic redundancy check and system therefor
JP2000156708A (en) 1998-10-05 2000-06-06 Paketto Engines Inc Network-switching system
US6266705B1 (en) 1998-09-29 2001-07-24 Cisco Systems, Inc. Look up mechanism and associated hash table for a network switch
US20020085554A1 (en) 2000-12-28 2002-07-04 Lg Electronics, Inc. Method of routing a packet in a routing device
US20040001492A1 (en) * 2002-07-01 2004-01-01 Johnson Erik J. Method and system for maintaining a MAC address filtering table
US20040148487A1 (en) * 2003-01-27 2004-07-29 International Business Machines Corporation Information Processing Device and Method, Program, Data Structure, and Computer-Readable Recording Medium
KR20040067187A (en) 2003-01-22 2004-07-30 삼성전자주식회사 packet switching method and switching apparatus
JP2005236997A (en) 2004-02-20 2005-09-02 Fujitsu Ltd High-speed routing table learning and lookup
US20080056278A1 (en) * 1999-03-17 2008-03-06 Broadcom Corporation Network switch memory interface configuration

Patent Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5748905A (en) * 1996-08-30 1998-05-05 Fujitsu Network Communications, Inc. Frame classification using classification keys
KR20000013760A (en) 1998-08-13 2000-03-06 윤종용 Multiple access computer address hashing method of lan switch using cyclic redundancy check and system therefor
US6266705B1 (en) 1998-09-29 2001-07-24 Cisco Systems, Inc. Look up mechanism and associated hash table for a network switch
US6457058B1 (en) * 1998-09-29 2002-09-24 Cisco Technology, Inc. Network switch with hash table look up
JP2000156708A (en) 1998-10-05 2000-06-06 Paketto Engines Inc Network-switching system
US20080056278A1 (en) * 1999-03-17 2008-03-06 Broadcom Corporation Network switch memory interface configuration
US20020085554A1 (en) 2000-12-28 2002-07-04 Lg Electronics, Inc. Method of routing a packet in a routing device
US20040001492A1 (en) * 2002-07-01 2004-01-01 Johnson Erik J. Method and system for maintaining a MAC address filtering table
KR20040067187A (en) 2003-01-22 2004-07-30 삼성전자주식회사 packet switching method and switching apparatus
US20040148487A1 (en) * 2003-01-27 2004-07-29 International Business Machines Corporation Information Processing Device and Method, Program, Data Structure, and Computer-Readable Recording Medium
JP2005236997A (en) 2004-02-20 2005-09-02 Fujitsu Ltd High-speed routing table learning and lookup

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
Lim, Hyesook et al., "A Parallel Multiple Hashing Architecture for IP Address Lookup", IEEE, pp. 91-95 (2004).

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100208740A1 (en) * 2009-02-18 2010-08-19 Funai Electric Co., Ltd. Communication Apparatus and Communication System
US8345572B2 (en) * 2009-02-18 2013-01-01 Funai Electric Co., Ltd. Communication apparatus and communication system
US20140294008A1 (en) * 2013-03-28 2014-10-02 Hitachi Metals, Ltd. Network Relay Device
US9413661B2 (en) * 2013-03-28 2016-08-09 Hitachi Metals, Ltd. Network relay device

Also Published As

Publication number Publication date
US20080133494A1 (en) 2008-06-05

Similar Documents

Publication Publication Date Title
US7873041B2 (en) Method and apparatus for searching forwarding table
US6633953B2 (en) Range content-addressable memory
US6665297B1 (en) Network routing table
EP1623347B1 (en) Comparison tree data structures and lookup operations
US10110492B2 (en) Exact match lookup with variable key sizes
US6842791B2 (en) Method and apparatus for memory efficient fast VLAN lookups and inserts in hardware-based packet switches
US9269411B2 (en) Organizing data in a hybrid memory for search operations
US7986696B1 (en) Method and apparatus for longest prefix matching
US5946679A (en) System and method for locating a route in a route table using hashing and compressed radix tree searching
US6553002B1 (en) Apparatus and method for routing data packets through a communications network
EP1808987B1 (en) Longest prefix matching using tree bitmap data structures
EP1551141B1 (en) Apparatus and method using hashing for efficiently implementing an IP lookup solution in hardware
EP2159708B1 (en) Method for selecting hash function, method for storing and searching routing table and devices thereof
US20020138648A1 (en) Hash compensation architecture and method for network address lookup
AU2016230539B2 (en) Retrieval device, retrieval method, program, and recording medium
US6691171B1 (en) Method and system for address lookup in data communication
US20060265370A1 (en) Method and apparatus for reducing overflow of hash table entries
US7478109B1 (en) Identification of a longest matching prefix based on a search of intervals corresponding to the prefixes
US20140358886A1 (en) Internal search engines architecture
WO2014201902A1 (en) Tcam-based table query processing method and apparatus
US6925503B2 (en) Method and system for performing a longest prefix match search
JP3691018B2 (en) Longest match search circuit and method, program, and recording medium
KR100999408B1 (en) Method for searching an ??? using hash tree
KR100907827B1 (en) Forwarding Table Search Device and Method
KR20180019437A (en) Table lookup method for determining set membership and table lookup apparatus using the method

Legal Events

Date Code Title Description
AS Assignment

Owner name: ELECTRONICS AND TELECOMMUNICATIONS RESEARCH INSTIT

Free format text: ASSIGNMENT OF ASSIGNORS INTEREST;ASSIGNORS:LEE, WON KYOUNG;PARK, JAE WOO;CHUNG, YOUNG SIK;AND OTHERS;REEL/FRAME:020322/0161;SIGNING DATES FROM 20071022 TO 20071023

Owner name: ELECTRONICS AND TELECOMMUNICATIONS RESEARCH INSTIT

Free format text: ASSIGNMENT OF ASSIGNORS INTEREST;ASSIGNORS:LEE, WON KYOUNG;PARK, JAE WOO;CHUNG, YOUNG SIK;AND OTHERS;SIGNING DATES FROM 20071022 TO 20071023;REEL/FRAME:020322/0161

FEPP Fee payment procedure

Free format text: PAYOR NUMBER ASSIGNED (ORIGINAL EVENT CODE: ASPN); ENTITY STATUS OF PATENT OWNER: SMALL ENTITY

REMI Maintenance fee reminder mailed
LAPS Lapse for failure to pay maintenance fees
STCH Information on status: patent discontinuation

Free format text: PATENT EXPIRED DUE TO NONPAYMENT OF MAINTENANCE FEES UNDER 37 CFR 1.362

FP Lapsed due to failure to pay maintenance fee

Effective date: 20150118