SYNCHRONIZING FORWARDING DATABASES IN A NETWORK DEVICE
BACKGROUND
Field of the Disclosure
[0001] The present invention relates generally to network systems, and more particularly to a system and method for synchronizing a forwarding database with a controller.
Description of the Related Art
[0002] Communication networks may include various network devices such as computers, servers, routers, switches, bridges, hubs, and other types of network nodes. Data is communicated through the data communication network by passing data packets or frames between the various devices to move the data from a source device to a destination device. In a wide area communication network, such as the Internet, packets may be handled or processed by a plurality of network elements and may cross a multiple communication links as the packets travel from the source device to the destination device.
[0003] Certain devices in a network, such as switches, bridges, and routers, manage and regulate network traffic. For example, these devices may analyze received packets and forward them on to another device in the network. When a network device such as a switch receives a packet, the switch retrieves the destination address from the packet and looks up the output port for the destination in a forwarding database. The forwarding database comprises a plurality of tables that comprise mappings between addresses and corresponding ports. The switch then sends the packet to the identified destination port.
[0004] A network switching system may create the forwarding database by registering the source address and port information of each incoming packet to the forwarding database. IEEE 802.1D, a standard on Media Access Control ("MAC") bridges, provides the operation procedures for creating forwarding databases and transmitting and receiving of network packets.
[0005] In network systems, it is important for the various network devices (e.g., switches) to synchronize their forwarding databases. Currently, forwarding databases are synchronized between switches by using a queue. The queue records all changes to the tables in the forwarding database, including entry additions, updates, and deletions. The controller in the switch retrieves the changes by reading the queue.
[0006] A switch includes a controller which utilizes the information in the forwarding database and a database engine which manages the forwarding database. Because of the mismatch in the processing capabilities of the database engine and the controller, especially in high speed switches, the queue cannot be large enough to record all temporary information waiting to be handled by the controller. To minimize this impact, hardware designers use large First-In-First-Out (FIFO) queues or temporarily halt the database changes when needed, otherwise these changes would be out of synch with the controller .
[0007] Furthermore, when multiple changes occur to a single entry before the controller actually know any of them, a common approach to simplify switch design is to record them with multiple records. This design is vulnerable to Denial-of-Service (DoS) attacks, where an attacker can simply change one entry frequently to exhaust the FIFO queue, thereby halting the database synchronization updates.
[0008] Accordingly, improvements in the field would be desirable.
Summary of the Disclosure
[0009] Various embodiments are presented of a system and method for synchronizing forwarding databases in a network device.
[0010] A first forwarding database or table may be maintained in a database engine portion of the network device. The database engine portion may be largely implemented in hardware. Additionally, a second forwarding database or table may be maintained by a controller portion of the network device. The controller portion may be implemented as software executing on a processor of the network device, although other embodiments are envisioned where it is implemented in hardware.
[0011] Both the first forwarding database and the second forwarding database may include a plurality of entries. In at least the first forwarding database, each of the plurality of entries may include a synchronization field, among other fields. The first and second forwarding databases may include or use a global synchronization value, e.g., for synchronizing changes of the first forwarding database to the second forwarding database, as discussed in more detail below. Additional fields may also be used for synchronization, such as an update field (e.g., to indicate when an existing field has been updated) and a learning or status field (e.g., to indicate the status of the entry, such as "auto learnt", "controlled learnt", "controlled aged", and/or "auto aged", among other possibilities). Other fields may be used to assist in synchronization. Note that one or more of the fields used in synchronization may only be present in the first forwarding database and not in the second forwarding database. For example, this synchronization information may not be necessary in the second forwarding database, e.g., since updates may generally occur in the database engine portion and then synchronized to the controller portion rather than the opposite direction. However, synchronization in the opposite direction is still envisioned, e.g., when updates are provided from other network devices. In one embodiment, such synchronizations may occur in a different manner than discussed herein.
[0012] During the course of operation, changes may occur in the first forwarding database, e.g., entries may be changed or added by the database engine portion of the
database. Accordingly, the first and second databases may become out of synchronization. In one specific embodiment, changes to a first one or more entries in the first forwarding database may be performed. These changes may include the addition of entries or the modification of values of fields in existing entries. Additionally, these entries may have a synchronization value set to the current synchronization value. In response to these changes, or in a periodic fashion, the database engine portion may send a message, such as an interrupt, to the controller to indicate that an update of the second forwarding database should be performed. Accordingly, the controller in the network device may receive a message indicating that changes have occurred.
[0013] In response, the controller may change the global synchronization value from the first synchronization value to a second global synchronization value and may also generate a query to determine the one or more changes to the first entries in the first forwarding database. In one embodiment, the query may include or use various values associated with fields in the first forwarding database, such as the global synchronization value, the update value, the status value, etc. In one embodiment, the query may search for those entries having the first global synchronization value and a status field of "controlled learnt". However, it should be noted that embodiments are envisioned where any combination of the global synchronization value, the update value, or the status value (among other possible fields) may be used.
[0014] Accordingly, the query may be performed to return query results (e.g., from the database engine portion to the controller portion). The query results may include the one or more changes to the first one or more entries, e.g., by using the first global synchronization value to identify the first one or more entries.
[0015] After the query results have been obtained, various ones of the fields may be reset. For example, entries that have been synchronized may change the update field value from, e.g., "1" (enabled) to "0" (disabled). Similarly, entries that have a status value of "controlled learnt" may be changed to "auto learnt", e.g., so that they are not returned in a future query for changes made to the first forwarding database. In some embodiments,
these changes may be performed by an update engine based on commands sent by the controller.
[0016] Additionally, changes to other entries in the forwarding database that occur after the controller changes the global synchronization value to the second global synchronization value are not part of the query results, e.g., since those values may be assigned the second global synchronization value rather than the first. In these cases, when the changes (e.g., modifications or additions) are made, their synchronization fields may be set to the current global synchronization value (which, in this example, is the second global synchronization value), so that these changes may be identified in a subsequent synchronization process. Thus, the global synchronization value may "ping pong" between two different values over the course of several synchronizations to track which entries have or have not been synchronized.
[0017] The query results may be used in a variety of manners. As indicated above, the controller may maintain a second forwarding database and may used the query results to update the second forwarding database (e.g., to synchronize the first and second forwarding databases). As another possibility, the query results may be used to update other network devices or other database engine portions of the network device (e.g., where the network device includes a controller portion and several database engine portions, which may need to have their respective forwarding databases synchronized).
Brief Description of the Drawines
[0018] A better understanding of the present invention can be obtained when the following Detailed Description of the Embodiments is read in conjunction with the following drawings, in which:
[0019] Figure 1 illustrates an exemplary network device, according to one embodiment;
[0020] Figure 2 illustrates an exemplary system including several network devices used to connect two devices in a network, according to one embodiment;
[0021] Figure 3 is a flowchart diagram illustrating embodiments of a method for synchronizing a controller and a database engine of a network device;
[0022] Figures 4A-4E are exemplary tables illustrating an example corresponding to the method of Figure 3, according to one embodiment;
[0023] Figure 5 is a state diagram for an entry in an exemplary forwarding table of a filtering database in an Ethernet switch, according to one embodiment; and
[0024] Figures 6A-6N are exemplary tables and entries corresponding to the state diagram of Figure 5, according to various embodiments.
[0025] While the invention is susceptible to various modifications and alternative forms, specific embodiments thereof are shown by way of example in the drawings and are herein described in detail. It should be understood, however, that the drawings and detailed description thereto are not intended to limit the invention to the particular form disclosed, but on the contrary, the intention is to cover all modifications, equivalents and alternatives falling within the scope of the present invention as defined by the appended claims.
Detailed Description of Embodiments of the Disclosure
Terms
[0026] The following is a glossary of terms used in the present application:
[0027] Memory Medium - Any of various types of memory devices or storage devices. The terms "memory" and "memory medium" are intended to include an installation medium, e.g., a CD-ROM, floppy disks, or tape device; a computer system memory or random access memory such as DRAM, DDR RAM, SRAM, EDO RAM, Rambus RAM, etc.; or a non-volatile memory such as flash memory, hardware registers, a magnetic media (e.g., a hard drive), or optical storage. The memory medium may comprise other types of memory as well, or combinations thereof. The term "memory medium" may include two or more memory mediums.
[0028] Computer System - Any of various types of mobile or stationary computing or processing systems, including a personal computer system (PC), mainframe computer system, workstation, network appliance, Internet appliance, mobile phone, smart phone, laptop, notebook, netbook, or tablet computer system, personal digital assistant (PDA), multimedia device, or other device or combinations of devices. In general, the term
"computer system" can be broadly defined to encompass any device (or combination of devices) having at least one processor that executes instructions from a memory medium.
[0029] Automatically - refers to an action or operation performed by a computer system
(e.g., software executed by the computer system) or device (e.g., circuitry, programmable hardware elements, ASICs, etc.), without user input directly specifying or performing the action or operation. Thus the term "automatically" is in contrast to an operation being manually performed or specified by the user, where the user provides input to directly perform the operation. An automatic procedure may be initiated by input provided by the user, but the subsequent actions that are performed "automatically" are not specified by the user, i.e., are not performed "manually", where the user specifies each action to perform. For example, a user filling out an electronic form by selecting each field and
providing input specifying information (e.g., by typing information, selecting check boxes, radio selections, etc.) is filling out the form manually, even though the computer system must update the form in response to the user actions. The form may be automatically filled out by the computer system where the computer system (e.g., software executing on the computer system) analyzes the fields of the form and fills in the form without any user input specifying the answers to the fields. As indicated above, the user may invoke the automatic filling of the form, but is not involved in the actual filling of the form (e.g., the user is not manually specifying answers to fields but rather they are being automatically completed). The present specification provides various examples of operations being automatically performed in response to actions the user has taken.
Fi ure 1 - Exemplary Network Device
[0030] Figure 1 is a block diagram of an exemplary network device 100, according to one embodiment. The network device 100 may be any of various networking devices, such as switches, routers, gateways, etc.
[0031] As shown in Figure 1, the network device 100 may include a controller 125 and a database engine 150. In some embodiments, the controller 125 may be implemented, at least in part, by program instructions (e.g., one or more software programs) executing on a processor, e.g., a CPU of the network device 100. In some embodiments, the controller 125 may be implemented in hardware as a part of switch portion of the network device 100.
[0032] The database engine 150 may be implemented in hardware and may perform lower level switching functionality of the network device 100. The controller 125 may perform synchronization functions to retrieve changes from the database engine 150 to provide database information to upper layer management application(s) such as OAM functions or to use this information to configure another database engine by commands or messages. In some embodiments, the database engine 150 may be referred to as a switch portion of the network device 100.
[0033] The database engine 150 may include a command handler 152 (e.g., for processing commands, such as those provided by the controller 125), a forwarding database 154 (e.g., for performing routing/switching decisions), and an update engine 156 (e.g., for performing updates). The controller 125 may also include database 127, e.g., which may be synchronized with the forwarding database 154, as discussed herein. The database 127 and the forwarding database 154 may have an identical structure or may be different, as desired. For example, the forwarding database 154 may include fields for performing synchronization (e.g., as discussed herein) that may not be necessary or present in the database 127. Generally, descriptions herein apply to the synchronization of changes made to the forwarding database 154, e.g., during the normal course of operation, which are then propagated to the database 127. However, updates may occur in the opposite direction, from the controller 125 to the database engine 150, although such updates may occur in a different manner than as described herein. Additionally, note that the database 127 may be optional, but updates still may be received by the controller 125 as described below (e.g., and used for updating other databases, providing to upper level management applications, etc.). Thus, in some embodiments, the database 127 may not be required.
[0034] In some embodiments, the network device 100 may include a plurality of database engines 150 and the controller 125 may be coupled (e.g., control) some or all of them. For example, the controller 125 may receive updates from a first database engine and provide those updates to a second database engine, e.g., within the same network device. In some embodiments, the network device 100 may include a plurality of controllers 125 and a plurality of database engines 150, as desired. Additionally, the controller 125 may use its up-to-date database 127 to provide update information to other network devices, e.g., within the same network. Any of a variety of actions may be performed using the updated information in the database 127.
Figure 2 - Exemplary Network Including a Plurality of Network Devices
[0035] Figure 2 illustrates an exemplary network including a plurality of network devices 100A-100D. More specifically, devices 200A and 200B may be in communication using the network, which includes the network devices 100A-100D. The devices 200A and 200B may be any of a variety of devices capable of performing communication over a network, such as desktop computers, laptop computers, cell phones, tablets, netbooks, etc. In one embodiment, the devices 200A and 200B may transmit packets into the network for communication. The network devices 100A-100D may receive those packets and perform routing or switching functionality to deliver the packets to their destination using a plurality of intermediary network devices.
[0036] During this process, various ones of the network devices 100A-100D may transmit updates or changes to their respective switching tables between themselves. For example, a controller of network device 100A may receive updates from its respective database engine and may provide these updates (and/or other information) to one or more of the network devices 100B-100D, e.g., to keep the network devices 100A-100D up to date. Similar behavior may be implemented by the network devices 100B-100D.
[0037] Additionally, the network may be implemented using a ring topology. For example, the network devices 100A-100D may be coupled and may communicate using a ring topology. Note that various ones of the connections of Figure 2 may not be necessary or be used; for example, in one embodiment of a ring topology, the connection between network devices 100B and lOOC may not exist. In some embodiments, the network devices may be stacked using a ring, in such a topology. Further topologies and connections are envisioned.
Figure 3 - Synchronizing a Controller and a Database Engine in a Network Device
[0038] Figure 3 illustrates a method for synchronizing a controller and database engine in a network device, according to one embodiment. The method shown in Figure 3 may be used in conjunction with any of the computer systems or devices shown in the above
Figures, among other devices. In various embodiments, some of the method elements shown may be performed concurrently, in a different order than shown, or may be omitted.
Additional method elements may also be performed as desired. As shown, this method may operate as follows
[0039] In 302, a first forwarding database or table may be maintained in a database engine portion of the network device. The database engine portion may be largely implemented in hardware.
[0040] Additionally, in 304, a second forwarding database or table may be maintained by a controller portion of the network device. The controller portion may be implemented as software executing on a processor of the network device. At a first time, the data between the two databases may be synchronized.
[0041] Both the first forwarding database and the second forwarding database may include a plurality of entries. In at least the first forwarding database, each of the plurality of entries may include a synchronization field, among other fields. The first and second forwarding databases may include or use a global synchronization value, e.g., for synchronizing changes of the first forwarding database to the second forwarding database, as discussed in more detail below. Additional fields may also be used for synchronization, such as an update field (e.g., to indicate when an existing field has been updated) and a learning or status field (e.g., to indicate the status of the entry, such as "auto learnt", "controlled learnt", "controlled aged", and/or "auto aged", among other possibilities). In some embodiments, the learning field may be implemented using a plurality of other fields, such as HIT_AGE and LOOKUP_VALID (e.g., which may be used to ascertain the state of the entry, such as "controlled learnt"). The descriptions regarding Figures 6A-6N may apply to this embodiment. Other fields may be used to assist in synchronization.
[0042] Note that one or more of the fields used in synchronization may only be present in the first forwarding database and not in the second forwarding database. For example, this synchronization information may not be necessary in the second forwarding database, e.g., since updates may generally occur in the database engine portion and then synchronized to the controller portion rather than the opposite direction. However, synchronization in the opposite direction is still envisioned, e.g., when updates are
provided from other network devices. In one embodiment, such synchronizations may occur in a different manner than discussed herein.
[0043] During the course of operation, in 306, changes may occur in the first forwarding database, e.g., entries may be changed or added by the database engine portion of the database. In one specific embodiment, changes to a first one or more entries in the first forwarding database may be performed. These changes may include the addition of entries or the modification of values of fields in existing entries. Additionally, these entries may have a synchronization value set to the current synchronization value. Accordingly, at a second time, the first and second databases may become out of synchronization.
[0044] In response to these changes, or in a periodic fashion, the database engine portion may send a message, such as an interrupt, to the controller to indicate that an update of the second forwarding database should be performed. Accordingly, in 308, the controller in the network device may receive a message indicating that changes have occurred in the first forwarding database.
[0045] In response, in 310, the global synchronization value may be changed (e.g., by the controller) from the first global synchronization value to a second global synchronization value. Additionally, in 312, a query may be generated (e.g., by the controller) to determine the one or more changes to the first entries in the first forwarding database. In one embodiment, the query may include or use various values associated with fields in the first forwarding database, such as the global synchronization value, the update value, the status value, etc. In one embodiment, the query may search for those entries having the first global synchronization value and a status field of "controlled learnt". However, it should be noted that embodiments are envisioned where any combination of the global synchronization value, the update value, or the status value (among other possible fields) may be used. An example of this process is provided in more detail below, regarding Figures 4A-4E.
[0046] Accordingly, in 314, the query may be performed to return query results (e.g., from the database engine portion to the controller portion). The query results may
include the one or more changes to the first one or more entries, e.g., by using the first global synchronization value and/or the other values discussed above to identify the first one or more entries.
[0047] After the query results have been obtained, various follow up actions may be performed in 316. For example, various ones of the fields, e.g., in the first forwarding database, may be reset. For example, entries that have been synchronized may change the update field value from, e.g., "1" (enabled) to "0" (disabled). Similarly, entries that have a status value of "controlled learnt" may be changed to "auto learnt", e.g., so that they are not returned in a future query for changes made to the first forwarding database.
[0048] Additionally, the query results may be used in a variety of manners. As indicated above, the controller may maintain a second forwarding database and may used the query results to update the second forwarding database (e.g., to synchronize the first and second forwarding databases). As another possibility, the query results may be used to update other network devices or other database engine portions of the network device (e.g., where the network device includes a controller portion and several database engine portions, which may need to have their respective forwarding databases synchronized).
[0049] In one embodiment, changes to other entries in the forwarding database that occur after the controller changes the global synchronization value to the second global synchronization value are not part of the query results, e.g., since those values may be assigned the second global synchronization value rather than the first. In these cases, when the changes (e.g., modifications or additions) are made, their synchronization fields may be set to the current global synchronization value (which, in this example, is the second global synchronization value), so that these changes may be identified in a subsequent synchronization process. Thus, the global synchronization value may "ping pong" between two different values over the course of several synchronizations to track which entries have or have not been synchronized.
Figures 4A-4E - Exemplary Tables Corresponding to the Method of Figure 3
[0050] Figures 4A-4E are exemplary tables of a forwarding or filtering database in an Ethernet switch, corresponding to the method of Figure 3. These tables and the following descriptions are provided as exemplary details only and are not intended to limit the scope of the systems and methods described above.
[0051] For Figures 4A-4E, there are two entities: the database engine and the controller. To synchronize the database with the controller, every entry in the forwarding (or filtering) database of the database engine may include a synchronization field. The database engine may update records by changing a global synchronization value and informing the controller of a pending change. The controller may then change the value of the global synchronization field and search the forwarding database based on the previous value of the global synchronization field.
[0052] For the database synchronization, an update field may be used to differentiate between updating and creating an entry. When updated, the "UPDATE" field of the entry may be enabled (e.g., by changing the value from "0" to "1"). After synchronization, the controller may clear this field (e.g., by changing the value from "1" to "0"). In one embodiment, the controller may search the database by the old value of the global synchronization field and the value of the UPDATE field.
[0053] In more detail, the database engine may include a search engine for searching the entries by single property or combination of LOOKUP_VALID, HIT_AGE, and UPDATE fields and/or other needed FDB information. To synchronize entry creations and updates on the database, the engine may inform the controller by CTRL_LRN (controlled learnt) interrupt or message. The controller may then change the global synchronization value from 0 to 1 or vice versa. The engine may then perform controlled learning by creating or updating the entry with the SYNC field equaling to the new value of the global learning synchronization field.
[0054] To synchronize updates to entries, the controller may search the engine by the condition including the UPDATE field equaling to 1 and the SYNC field equaling to the previous value of the global learning synchronization field to get all updated entries. The controller may clear the UPDATE field of all these entries after synchronization. To
synchronize creations of entries, the controller may then use the condition including the UPDATE field equaling to 0 and the SYNC field equaling to the previous value of the global learning synchronization field. Thus, in some embodiments, the query discussed above may be implemented as a plurality of queries or a compound query, as desired.
[0055] To synchronize deletions of entries, the engine may inform the controller by CTRL_AGE (controlled aged) interrupt or message. The controller may then change the global ageing value from 0 to 1 or vice versa. The engine may perform controlled ageing by updating the entry with the SYNC field equaling to the new value of the global ageing synchronization field. The controller may then use the condition including the LOOKUP_VALID field equaling 1 and HIT_AGE field equaling to 0 and the SYNC field equaling to the previous value of the global learning synchronization field to get all aged- out entries. The controller can delete these entries, e.g., by sending a command with the condition including the LOOKUP_VALID field equaling 1 and HIT_AGE field equaling to 0 and the SYNC field equaling to the previous value of the global learning synchronization field after the synchronization.
[0056] Figure 4A illustrates an exemplary forwarding table at a first point in time, e.g., where the tables of the controller and the database engine are synchronized. In this table, two different entries are currently stored, one for MAC address 00-00-00-00-00-01 and another for MAC address 02.
[0057] In Figure 4B, the entry for 01 has been updated to change the field "DP" from "1" to "2", the field "LOOKUP_VALID" from "1" to "0", the field "HIT_AGE" from "1" to "2", the field "UPDATE" from "0" to "1" (indicating a change has occurred), and the status field "Entry Description" from "auto learnt entry" to "controlled learnt entry" (e.g., indicating the entry is in a pending state— using this entry in forwarding process or not may be configurable). Additionally, a new entry, 00-00-00-00-00-05, has been added, which has the status field value of "controlled learnt entry" for the same reasons as for 01 above. Additionally, as shown in Figure 4B, all entries have a synchronization value of "0".
[0058] As described above, in response to these changes to the forwarding table, a message (e.g., an interrupt) may be provided to the controller. In response, the global synchronization field may be changed from "0" to "1", so that changes made after synchronization have begun may be identified for a later synchronization.
[0059] In Figure 4C, during the synchronization, a new entry, "00-00-00-00-00-04" has been added. As shown, because the global synchronization value was changed upon initiation of the synchronization, the new entry is assigned the synchronization value of "1". Without this change, the entry "00-00-00-00-00-04" may be omitted in a later synchronization.
[0060] Figure 4D illustrates the results of the query for the updated entries. As shown, the query returns both 00-00-00-00-00-01, which was modified above, and 00-00-00-00- 00-05, which was added. In one embodiment, the query may be based on the status field value (e.g., having the status "controlled learnt entry" or not "auto learnt entry"), the global synchronization value (e.g., having the value "0"), and/or the update value (e.g., having a value of "1"). In one embodiment, the query may be the union of the global synchronization value and the update value as well as the global synchronization value and the status value.
[0061] After synchronization, the newly synchronized entries may be updated, as shown in Figure 4E. More specifically, the UPDATE field for entry 01 may be reset to "0" and the status field values may be set to "auto learnt entry" from "controlled learnt entry" for entries 00-00-00-00-00-01 and 00-00-00-00-00-05. In the next round of synchronization, the global synchronization value used may be "1" rather than "0". Thus, the global synchronization value may "ping pong" between "1" and "0" in order to keep track of the entries that are synchronized.
[0062] In the above example, there are two states for learning: controlled learnt may be used for hardware learning before synchronization. After that, the state may be changed to auto learnt by a command from the controller. Additionally, the update field may be used to show the destination port of the entry has been changed. This change may be useful
when the controller needs to know changes to some specific ports, e.g., both new created and moved to another port.
Figures 5 and 6A-6N - Exemplary State Diagram and Tables
[0063] Figure 5 illustrates an exemplary state diagram corresponding to entries of a forwarding database (FDB), (e.g., of the database engine in an Ethernet switch). Figures 6A-6N are exemplary tables illustrating concepts of the state diagram of Figure 5. These descriptions provide exemplary details related to those provided above, e.g., regarding ageing of entries as well as other processes.
[0064] As shown in Figure 5, entries may have the states "auto learnt", "controlled learnt", "controlled aged", and "auto aged (invalid)". The entries may transition between these states in the manner shown in Figure 5, e.g., being automatically aged to enter the "auto aged" state, being automatically learned to entry the "auto learnt" state, etc. The following provides further details on the events shown in Figure 5 and included in tables 6A-6N:
[0065] Controlled Learning: Ingress port/virtual port (the destination port in the entry) is configured to controlled learning mode. The FDB entry does not exist and the database engine may add this entry as a new one.
[0066] Controlled Refreshing: Ingress port/virtual port (the destination port in the entry) is configured to controlled learning mode. The FDB entry exists and the destination port is the same one as the current ingress port/virtual port.
[0067] Controlled Moving: Ingress port/virtual port (the destination port in the entry) is configured to controlled learning mode. The FDB entry exists and the destination port is not the same one as the current ingress port/virtual port.
[0068] Automatic Learning: Ingress port/virtual port (the destination port in the entry) is configured to automatic learning mode. The FDB entry does not exist and the database engine may add this entry as a new one.
[0069] Automatic Refreshing: Ingress port/virtual port (the destination port in the entry) is configured to automatic learning mode. The FDB entry exists and the destination port is the same one as the current ingress port/virtual port.
[0070] Automatic Moving: Ingress port/virtual port (the destination port in the entry) is configured to automatic learning mode. The FDB entry exists and the destination port is not the same one as the current ingress port/virtual port.
[0071] Ageing: Decrease the HIT_AGE by 1 to an above 0 value. The ageing is either automatic aged or controlled aged. The state of the entry is kept unchanged.
[0072] Controlled Ageing: Ingress port/virtual port (the destination port in the entry) is configured to Controlled Ageing mode. Decrease the HIT_AGE by 1 to 0.
[0073] Automatic Ageing: Ingress port/virtual port (the destination port in the entry) is configured to Automatic Ageing mode. Decrease the HIT_AGE by 1 to 0.
[0074] In one particular embodiment, there may be two properties associated with each entry: the age value and the valid value. These two properties may represent the four states for each entry shown in Figure 6A. As shown, if the HIT_AGE field is above 0, the state may be "controlled learnt" or "auto learnt". If the HIT_AGE is 0 and the valid value is 0, the entry may be invalid. If the HIT_AGE is 0 and the valid value is still 1, the entry may be in the state "controlled aged". Generally, the HIT_AGE value may be decremented each ageing cycle until it reaches zero.
[0075] To record a change to a port/virtual port, Controlled Learning and Controlled Ageing may be enabled. The FDB (forwarding database) engine may have two global values to record the current synchronization state of learning and ageing. This engine may perform controlled learning by creating or updating the entry for a frame and record the SYNC field based on the value of the global learning synchronization field. The controlled ageing may update the SYNC field based on the value of the global ageing synchronization field when the age value reaches zero. There may also be a UPDATE
field in every entry indicating whether the entry was updated in the previous synchronization.
[0076] Figure 6B illustrates the state transition between "auto learnt" and "auto learnt". This may occur when the ingress port/virtual port of the frame that triggers the learning is set to automatic learning mode. Note that when ageing and refreshing, UPDATE field and SYNC field may remain unchanged or the update may be lost.
[0077] Figure 6C illustrates the state transition between "auto learnt" and "controlled learnt". This may occur when the ingress port/virtual port of the frame that triggers the learning is set to controlled learning mode.
[0078] Figure 6D illustrates the state transition between "auto learnt" and "controlled aged". This may occur when the destination port of the entry is set to controlled ageing mode and the ageing process decreases the age value to zero.
[0079] Figure 6E illustrates the state transition between "auto learnt" and "invalid". This may occur when the destination port of the entry is set to automatic ageing mode and the ageing process decrease the age value to zero.
[0080] Figure 6F illustrates the state transition between "controlled learnt" and "auto learnt". This may occur when the ingress port/virtual port of the frame that triggers the learning is set to automatic learning mode. Note that when ageing and refreshing, UPDATE field and SYNC field may remain unchanged or the update may be lost.
[0081] Figure 6G illustrates the state transition between "controlled learnt" and "controlled learnt". This may occur when the destination port of the entry is set to controlled learning mode. Note that when ageing and refreshing, UPDATE field and SYNC field may remain unchanged or the update may be lost.
[0082] Figure 6H illustrates the transition between "controlled learnt" and "invalid". This may occur when the destination port of the entry is set to automatic ageing mode and the ageing process decreases the age value to zero.
[0083] Figure 61 illustrates the transition between "controlled aged" and "auto learnt". This may occur when the destination port of the entry is set to automatic learning mode.
[0084] Figure 6J illustrates the transition between "controlled aged" and "controlled learnt". This may occur when the destination port of the entry is set to controlled learning mode.
[0085] Figure 6K illustrates the transition between "controlled aged" and "controlled aged". This may occur when the destination port of the entry is set to controlled ageing mode and the ageing process has already decreased the age value to zero.
[0086] Figure 6L illustrates the transition between "controlled aged" and "invalid". This may occur when the destination port of the entry is set to automatic ageing mode and the ageing process decreases the age value to zero.
[0087] Figure 6M illustrates the transition between "invalid" and "auto learnt". This may occur when the ingress port/virtual port of the frame that triggers the learning is set to automatic learning mode.
[0088] Figure 6N illustrates the transition between "invalid" and "controlled learnt". This may occur when the ingress port/virtual port of the frame that triggers the learning is set to controlled learning mode.
Further Descriptions
[0089] The following provides further details of one specific embodiment. However, similar to above, these descriptions are provided as examples only and are not intended to limit the scope of the embodiments discussed above.
[0090] MAC address learning and ageing:
[0091] MAC address learning and ageing may be supported in FDB table.
[0092] Each FDB entry may include a LOOKUP_VALID field. When the LOOKUP_VALID field is set to 1, the entry is available for use; when set to 0, the entry is not involved in any switching and forwarding processing.
[0093] Each FDB entry includes an HIT_AGE value which may define the life time of the MAC address. The ageing process decreases the life value of the MAC address while
the learning process refreshes the life value when an (SA (Source MAC Address), VID) matches the entry during the learning process.
[0094] The key (SA, VID) may be used for FDB lookup. If no match is found, the SA may be recognized as an Unknown SA and may be added as a New Address to the FDB table by hardware, given that the automatic learning mode or controlled learning mode is enabled.
[0095] The learnt MAC address may be stored in FDB according to the hash value of (SA, VID) key.
[0096] MAC address learning:
[0097] When the (SA, VID) is not found in the FDB during the learning lookup, the address may be regarded as Unknown. If the FDB has enough space, the address may be learnt and added to FDB table automatically by hardware. The HIT_AGE may be set to the maximum age value.
[0098] MAC address refreshing:
[0099] When the (SA, VID) is found in the FDB and the destination port is the same one as the current ingress port/virtual port. The HIT_AGE in the found entry may be updated to the maximum age value
[00100] MAC address moving:
[00101] When the (SA, VID) is found in the FDB and the destination port is not the same one as the current ingress port/virtual port. The HIT_AGE in the found entry may be updated to the maximum age value
[00102] Two MAC address learning modes may be used in MAC address learning.
For example, refreshing and moving may be supported and may be configured per port or per VLAN or both, which are automatic learning mode and controlled learning mode. The
learning mode may not only be used for MAC address learning, but also may be used as the mode for MAC address entry refreshing or moving.
[00103] Automatic learning mode:
[00104] The entry may be added or updated with the LOOKUP_VALID set to 1.
[00105] Controlled learning mode:
[00106] The entry may be added or updated with the LOOKUP_VALID set to 0.
The entry may not be used in switching and forward process until controller or software set the LOOKUP_VALID field to 1.
[00107] MAC address ageing:
[00108] MAC address ageing may be used to delete non-active entries. The HIT_AGE value may be decreased by 1 automatically by hardware after a configurable interval before it is aged out, which means that the HIT_AGE value reaches 0.
[00109] The following MAC address ageing modes may be supported: automatic ageing mode and controlled ageing mode.
[00110] Automatic ageing mode:
[00111] The learnt MAC address may be aged out automatically regardless whether the entry was learnt by hardware automatic learning process or by controlled learning process. The aged-out entry may be deleted from the FDB table.
[00112] Controlled ageing mode:
[00113] In controlled ageing mode, valid entry may not be aged out unless it is deleted by the controller or by the automatic ageing process.
Advantages of the Present Embodiments
[00114] Using various embodiments described above, the use of a FIFO queue (or similar queues) may no longer be necessary for performing updates between database or tables in a network device. Additionally, the learning speed may generally be improved without limiting the depth of a FIFO queue.
[00115] Another advantage when using various embodiments, the capability of the controller and the database engine may be decoupled (e.g., completely). Thus, in one embodiment, the controller can perform the synchronization when it is able (e.g., when it is free) without degrading the performance of the database engine.
[00116] Although the embodiments above have been described in considerable detail, numerous variations and modifications will become apparent to those skilled in the art once the above disclosure is fully appreciated. It is intended that the following claims be interpreted to embrace all such variations and modifications.