Forwarding table item configuration method and related equipment
By dynamically adjusting the table configuration of high-performance storage modules in network devices, the problem of limited number of high-performance storage modules is solved, the forwarding rate and bandwidth are improved, and more efficient business flow forwarding is achieved.
Patent Information
- Application Number
- CN202410378073.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-03-28
- Publication Date
- 2025-09-30
AI Technical Summary
The number of high-performance storage modules in network devices is limited. As a result, some performance path entries are configured on low-performance storage modules, affecting the forwarding rate of service flows.
By obtaining the access load status of multiple high-performance storage modules on the storage unit, determining the storage module with the largest access load margin, and configuring a storage resource pool for the first business, allocating some table entries to high-performance storage modules and low-performance storage modules, and dynamically adjusting the table entry configuration to adapt to traffic changes.
It improves the utilization rate of high-performance storage modules, reduces the load pressure of high-performance storage modules, and improves the forwarding rate and bandwidth of business flows.
Smart Images

Figure CN120729784A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of communications, and in particular to a method for configuring a forwarding table entry and related devices. Background Art
[0002] Network devices forward service flow packets. Their storage units store forwarding entries for different service flows. After receiving a service flow packet from a port, the device queries and processes the corresponding forwarding table entry and sends the packet to the destination port.
[0003] The storage units of network devices include high-performance storage modules and low-performance storage modules. High-performance storage modules provide low-latency, high-speed access to table entries, while low-performance storage modules provide high-latency, low-speed access to table entries. Forwarding table entries are divided into performance path entries and non-performance path entries. Performance path entries have higher latency and speed requirements and are generally configured in high-performance storage modules. Non-performance path entries have lower latency and speed requirements and are generally configured in low-performance storage modules.
[0004] Network devices typically have a limited number of high-performance storage modules. If a network device's service flows contain a large number of performance path entries, the high-performance storage modules may not be able to accommodate them. Consequently, performance path entries for some service flows must be configured on low-performance storage modules, impacting the service forwarding rate. Summary of the Invention
[0005] The embodiments of the present application provide a forwarding table configuration method and related devices for improving the forwarding efficiency of business flows.
[0006] In a first aspect, an embodiment of the present application provides a method for configuring a forwarding table entry. The method comprises: obtaining the access load status of multiple high-performance storage modules on a storage unit. The high-performance storage module is used to store performance path table entries. The access load status of the high-performance storage module is used to indicate the ratio between the current access load of the high-performance storage module and the access load upper limit of the high-performance storage module. Then, a first storage module with the largest access load margin is determined from the multiple high-performance storage modules. A storage resource pool is then configured for the performance path table entry of the first business. The storage resource pool comprises a first storage block located in the first storage module and a second storage block located outside the first storage module.
[0007] In the current table item configuration scheme, the corresponding number of table items is usually configured according to the maximum flow of the business flow. However, the flow of the business flow fluctuates and does not necessarily continue at the maximum flow, so so many table items are not necessarily needed. The embodiment of the present application divides the performance path table items of the business flow into two parts: one part is on the first storage module, which is used to achieve high-speed forwarding of the flow when the flow of the business flow is small; the other part is not on the first storage module, which is used to forward the part of the flow with increased load when the flow of the business flow increases. Through the method provided in the embodiment of the present application, the resources reserved for each business flow on the high-performance storage module are reduced, so that more performance path table items of the business flow can be configured on the high-performance storage module.
[0008] Moreover, since the first storage module is a high-performance storage module with the largest current access load margin, configuring the first storage block of the first business on the first storage module can provide a greater throughput for the first business through the first storage block, thereby achieving faster and larger bandwidth forwarding.
[0009] In an optional implementation, the second storage block is located in a low-performance storage module of the storage unit, and the low-performance storage module is used to store non-performance path table entries.
[0010] In the embodiment of the present application, the second storage block is configured in the low-performance storage unit, which can minimize the use of the high-performance storage module. This allows more resources to be reserved in the high-performance storage module for different service flows, allowing more service flows to configure performance path table entries in the high-performance storage module, thereby improving the forwarding rate of more service flows.
[0011] In an optional implementation, the act of obtaining access load status of multiple high-performance storage modules may specifically include: obtaining access load status and space status of the multiple high-performance storage modules. If there are multiple storage modules with the largest access load margins among the multiple high-performance storage modules, the act of determining a first storage module with the largest access load margin from among the multiple high-performance storage modules may specifically include: determining a first storage module with the largest remaining space from among the multiple high-performance storage modules with the largest load margins.
[0012] In an embodiment of the present application, the first storage module is selected based on the following principle: among the high-performance storage modules with the largest access load margins, the storage module with the most remaining space is selected. The greater the access load margin of a storage module, the greater the traffic it can handle, and thus, a forwarding service with greater traffic can be provided for the first service. The more remaining space a storage module has, the more forwarding table entries it can store, and thus, more forwarding paths can be provided for the first service.
[0013] In an optional implementation, if the access loads of multiple high-performance storage modules exceed the target threshold, the action of configuring a storage resource pool for the performance path table item of the first business may specifically include: identifying a second storage module with the largest access load margin from multiple low-performance storage modules, and configuring a storage resource pool in the second storage module.
[0014] In this embodiment of the present application, if the access load of the high-performance storage module exceeds the preset target threshold, it indicates that the service flow table entry is configured in the high-performance storage module, and the storage module is likely to be overloaded, which may affect the normal forwarding of the service flow data packets. In this case, this embodiment of the present application configures the storage resource pool in the low-performance storage module to ensure that the high-performance storage module is not overloaded, thereby ensuring the normal operation of the service flow corresponding to the stored table entry in the high-performance storage module.
[0015] In an optional implementation, the action of obtaining the access load status of multiple high-performance storage modules may specifically include: periodically obtaining the access load status of multiple high-performance storage modules; or, receiving an online request for the first business, and obtaining the access load status of multiple high-performance storage modules according to the online request.
[0016] In an embodiment of the present application, if the access load of the high-performance storage module is obtained periodically, the overloaded high-performance storage module can be detected when the traffic of the business flow changes and causes some high-performance storage modules to be overloaded. In order to make timely adjustments to the overloaded high-performance storage module to ensure the normal operation of the business flow corresponding to the table entry on the module. If the access load of the high-performance storage module is obtained when the business goes online (that is, when the online request is received), reasonable resources can be allocated to the first business that goes online based on the resource status of the storage module at the time of going online (access load status, space status, etc.). While ensuring that the first business has sufficient resources (throughput resources, space resources, etc. of the storage module), it can also be ensured that other businesses corresponding to the table entries stored on the storage unit also have sufficient resources.
[0017] In an optional implementation, after obtaining the access load status of multiple high-performance storage modules on a storage unit, a third storage module (the third storage module is a different storage module from the first storage module) whose access load exceeds a first threshold can be determined from the multiple high-performance storage modules, and a first business with the largest traffic can be determined from multiple businesses corresponding to multiple entries stored on the third storage module. After configuring a storage resource pool for the performance path table entry of the first business, the table entry of the first business on the third storage module can be migrated to the storage resource pool.
[0018] In this embodiment of the present application, a first service with the largest traffic is selected from an overloaded third storage module (one whose access load exceeds a predetermined threshold), and its table entries are migrated to a storage resource pool. This can alleviate the access load pressure on the third storage module, allowing the service flows of the remaining items in the third storage module to operate normally.
[0019] In an optional implementation, access load status of multiple low-performance storage modules on the storage unit may be obtained, and a fourth storage module having an access load exceeding a second threshold and a fifth storage module having the largest access load margin may be determined from the multiple low-performance storage modules (the fifth storage module is a different storage module from the fourth storage module). Then, a second service with the largest traffic volume may be determined from multiple services corresponding to multiple table entries stored on the fourth storage module, and the table entry for the second service on the fourth storage module may be migrated to the fifth storage module.
[0020] In this embodiment of the present application, an overloaded fourth storage module is identified among the low-performance storage modules, and the second service with the largest traffic on the fourth storage module is migrated to the fifth storage module (another low-performance storage module). This can alleviate the access load pressure on the fourth storage module, allowing the service flows of the remaining entries on the fourth storage module (the low-performance storage module) to operate normally.
[0021] In a second aspect, an embodiment of the present application provides a processing unit, which includes an acquisition subunit, a determination subunit, and a configuration subunit.
[0022] An acquisition subunit is configured to acquire access load status of multiple high-performance storage modules on a storage unit. The high-performance storage modules are configured to store performance path table entries. The access load status of the high-performance storage modules indicates a ratio between the current access load of the high-performance storage modules and an upper limit of the access load of the high-performance storage modules.
[0023] The determining subunit is configured to determine a first storage module having the largest access load margin from among a plurality of high-performance storage modules.
[0024] The configuration subunit is configured to configure a storage resource pool for the performance path table entry of the first service, wherein the storage resource pool includes a first storage block located in the first storage module and a second storage block located outside the first storage module.
[0025] The processing unit is used to implement the forwarding table configuration method described in the first aspect.
[0026] In a third aspect, embodiments of the present application provide a storage unit. The storage unit includes multiple high-performance storage modules, a load detection module, and a load notification module. The multiple high-performance storage modules are configured to store performance path table entries. The load monitoring module is configured to detect the access load status of the multiple high-performance storage modules. A load channel module is configured to report the access load status of the multiple high-performance storage modules.
[0027] In the embodiment of the present application, the access load status of the high-performance storage modules is detected and reported through the load detection module and the load notification module. This allows the CPU to obtain the access load of each high-performance storage module on the storage unit and, based on the access load of each high-performance storage module, configure or adjust the forwarding table entries stored in each high-performance storage module, thereby achieving reasonable allocation of resources of the high-performance storage modules.
[0028] In an optional implementation, the storage unit further includes multiple low-performance storage modules, each configured to store non-performance path entries. The load monitoring module is further configured to detect access load status of the multiple low-performance storage modules. The load channel module is further configured to report the access load status of the multiple low-performance storage modules.
[0029] In the embodiment of the present application, the access load status of the low-performance storage modules is detected and reported through the load detection module and the load notification module. This allows the CPU to obtain the access load of each low-performance storage module on the storage unit and, based on the access load of each low-performance storage module, configure or adjust the forwarding table entries stored in each low-performance storage module, thereby achieving reasonable allocation of resources for the low-performance storage modules.
[0030] In a fourth aspect, an embodiment of the present application provides a network processor (NP). The NP includes a storage unit and a processing unit. The storage unit is the storage unit described in the third aspect. The processing unit is configured to process data packets according to table entries stored in the storage unit.
[0031] In a fifth aspect, an embodiment of the present application provides a network device. The network device includes the network processor NP described in claim 4 and a general-purpose processor CPU. The CPU is configured to execute the method described in claim 1 or any possible implementation of claim 1.
[0032] In a sixth aspect, embodiments of the present application provide a computer-readable storage medium having a program stored therein, which, when executed by a computer, executes the method described in the first aspect or any possible implementation of the first aspect.
[0033] In a seventh aspect, embodiments of the present application provide a computer program product. When the computer program product is executed on a computer, the computer executes the method described in the first aspect or any possible implementation of the first aspect.
[0034] The beneficial effects of the fourth to seventh aspects refer to the first aspect and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] Figure 1 A schematic diagram of the network device structure provided for this application;
[0036] Figure 2 A schematic diagram of the structure of a network device provided in an embodiment of the present application;
[0037] Figure 3 A flowchart of a method for configuring a forwarding table entry provided in an embodiment of the present application;
[0038] Figure 4 A load state diagram of the forwarding table configuration method provided in an embodiment of the present application;
[0039] Figure 5 Another flowchart of the forwarding table configuration method provided in an embodiment of the present application;
[0040] Figure 6 Another structural diagram of the network device provided in an embodiment of the present application;
[0041] Figure 7 Another flowchart of the forwarding table configuration method provided in an embodiment of the present application;
[0042] Figure 8 Another structural diagram of the network device provided in an embodiment of the present application;
[0043] Figure 9 Another flowchart of the forwarding table configuration method provided in an embodiment of the present application;
[0044] Figure 10 A schematic diagram of the structure of the processing unit provided in an embodiment of the present application. DETAILED DESCRIPTION
[0045] The embodiments of the present application are described below in conjunction with the accompanying drawings. Those skilled in the art will appreciate that, with the development of technology and the emergence of new scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.
[0046] The terms "first", "second", etc. in the specification and claims of this application and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequential order. It should be understood that the terms used in this way are interchangeable when appropriate, and this is merely a way of distinguishing objects of the same attributes when describing the embodiments of the present application. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, so that the process, method, system, product or device comprising a series of units need not be limited to those units, but may include other units that are not clearly listed or inherent to these processes, methods, products or devices. In addition, "at least one" refers to one or more, and "a plurality" refers to two or more. "and / or" describes the association relationship of associated objects and indicates that three relationships can exist. For example, A and / or B can represent: the situation where A exists alone, A and B exist simultaneously, and B exists alone, where A and B can be singular or plural. The character " / " generally indicates that the associated objects before and after are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b, or c can mean: a, b, c, ab, ac, bc, or abc, where a, b, and c can be single or plural.
[0047] Network devices such as routers and switches can forward data packets. Figure 1 As shown, during the process of a service flow going online, a central processing unit (CPU) configures a forwarding table entry for the service flow and stores the forwarding table entry in a storage unit.
[0048] For the convenience of description, the embodiment of the present application uses table item YX to represent the forwarding table item of service Y. For example Figure 1 In the table, entries 3-1, 3-2, and 3-3 are collectively referred to as entry 3-X, and entry 3-X is the forwarding entry for service 3.
[0049] After receiving a data packet of a service flow from a certain port, the network device calls the forwarding table entry of the service flow from the storage unit ( Figure 1 The table entry 3-X of service 3 is used as an example for explanation).
[0050] Then, the processing unit queries and processes the data packet of service 3 in the forwarding table (for example, port processing (virtual local area network (VLAN) processing), logical port processing, media access control address (MAC) lookup (or routing lookup), next hop processing, encapsulation processing, etc.), thereby sending the data packet of service 3 to the target port to realize data packet forwarding.
[0051] The storage unit of a network device includes multiple storage modules for storing forwarding table entries. Based on their performance, these modules can be categorized as high-performance or low-performance. High-performance modules provide low-latency, high-speed access to table entries, while low-performance modules provide high-latency, low-speed access to table entries.
[0052] Forwarding table entries are divided into performance path entries and non-performance path entries. Performance path entries have high latency and rate requirements and are typically configured in high-performance storage modules. Non-performance path entries have low latency and rate requirements and are typically configured in low-performance storage modules.
[0053] Due to the high cost of high-performance storage modules, the number of high-performance storage modules in a storage unit is limited. If a network device's service flow contains many performance path entries, the high-performance storage modules may not be able to accommodate them. As a result, the performance path entries for some service flows must be configured only on low-performance storage modules, affecting the forwarding efficiency of these service flows.
[0054] For example Figure 1 In the example, the high-performance storage modules are static random-access memory (SRAM) 0 to SRAM 2, and the low-performance storage modules are dynamic random-access memory (DRAM) 0 to DRAM 1. The table entries corresponding to services 1 to 10 are 1-X to 10-X, respectively.
[0055] If services 1 through 7 are performance path entries, they need to be stored in the high-performance storage module (SRAM0 through SRAM2). Since SRAM0 through SRAM2 are already full with entries for services 1 through 6, performance path entry 7-X can only be stored in the low-performance storage module DRAM0. When service 7 calls entry 7-X from DRAM0, DRAM0 can only provide high-latency, low-rate access. This results in high latency and low efficiency when calling entry 7-X, affecting the forwarding efficiency of service 7.
[0056] In order to improve the forwarding efficiency of business flows on network devices, the present application embodiment provides a forwarding table configuration method and related devices. The forwarding table configuration method provided by the present application embodiment is applied in Figure 2 In the network device shown.
[0057] like Figure 2 As shown, the network device provided in the embodiment of the present application includes a network processor (NP) and a general-purpose processor CPU. The NP includes a storage unit and a processing unit. The storage unit includes multiple high-performance storage modules (e.g. Figure 2 SRAM 0 to SRAM 2 in the MCU), a load detection module and a load notification module.
[0058] In the storage unit, multiple high-performance storage modules are used to store performance path table entries, the load detection module is used to detect the access load status of multiple high-performance storage modules, and the load notification module is used to report the access load status of multiple high-performance storage modules to the CPU.
[0059] Optionally, the storage unit may also include a low-performance storage module, such as Figure 2 DRAM 0 and DRAM 1 in the memory. The load detection module can detect the access load status of the low-performance storage module, and the load notification module can report the access load status of multiple low-performance storage modules to the CPU.
[0060] It is worth noting that the high-performance storage module can be SRAM and the low-performance storage module can be DRAM. In cases where the latency and rate requirements of the service are low, both the high-performance storage module and the low-performance storage module can be DRAM, which is not limited in this application. Alternatively, the high-performance storage module and the low-performance storage module can also be other types of storage modules.
[0061] The processing unit is used to process data packets of corresponding services according to the table entries stored in the storage unit to realize forwarding of data packets.
[0062] Optionally, the processing unit may include a large flow identification module, which is used to identify large bandwidth traffic.
[0063] The CPU includes a table entry address allocation unit. The table entry address allocation unit is used to implement address allocation of forwarding table entries in the storage unit. This process is referred to as forwarding table entry configuration in the embodiment of the present application.
[0064] Optionally, the entry address allocation unit may further include a state maintenance module, a high-volume maintenance module, and the like. The state maintenance module is configured to refresh and maintain the resource pool state in the entry address allocation unit based on the load state obtained from the storage module. The high-volume maintenance module is configured to reallocate entries based on the load state.
[0065] based on Figure 2 The network device architecture shown in the figure, the embodiment of the present application provides a method for configuring a forwarding table entry. The method is applied to the CPU in the network device. Figure 3 As shown, the method includes:
[0066] 301. Obtain access load status of multiple high-performance storage modules on a storage unit.
[0067] The load detection module can detect multiple high-performance storage modules on the storage unit (for example Figure 2 The access load status is used to indicate the ratio between the current access load of the storage module and the upper limit of the access load of the storage module.
[0068] After the load notification module obtains the access load status of the multiple high-performance storage modules from the load detection module, the load notification module reports the access load status to the CPU, which then obtains the access load status.
[0069] 302. Determine a first storage module having the largest access load margin from a plurality of high-performance storage modules.
[0070] The table address allocation unit in the CPU can display the access load of each storage module on Figure 4 In the interface shown. Figure 4 As shown in the figure, the gray boxes represent the access load status of each storage module. Figure 4 The interface shown can determine the first storage module with the largest access load margin from multiple high-performance storage modules.
[0071] For example Figure 4 As shown, among SRAM 0 to SRAM 2, SRAM 2 has the smallest access load and the largest access load margin. Therefore, SRAM 2 is determined to be the first storage module.
[0072] 303. Configure a storage resource pool for the performance path entry of the first service, where the storage resource pool includes a first storage block located in the first storage module and a second storage block located outside the first storage module.
[0073] The first service includes a performance path table entry, and the table entry address allocation unit can configure a storage resource pool for the performance path table entry of the first service. The storage resource pool includes a first storage block located in the first storage module and a second storage block located outside the first storage module.
[0074] In the embodiment of the present application, the storage resource pool is used to store performance path entries of the service. The storage resource pool is divided into two parts, one part (the first storage block) is in the first storage module, and the other part (the second storage block) is outside the first storage module.
[0075] Since the first storage module is a high-performance storage module, the processing unit can call the table entries stored in the first storage block with low latency and high speed, thereby achieving high-speed forwarding of data packets.
[0076] The first storage module is used to store performance path table entries that are frequently used by the first service, such as basic table entries required for forwarding and forwarding table entries in low-traffic conditions. The second storage block is used to store performance path table entries that are less frequently used by the first service, such as forwarding table entries for newly added traffic when traffic increases.
[0077] Current table configuration schemes typically configure the number of entries based on the maximum traffic flow. However, traffic flows fluctuate and may not always remain at the maximum flow rate, so a large number of entries may not be necessary.
[0078] The embodiment of the present application divides the performance path table items of the business flow into two parts: one part is on the first storage module, which is used to achieve high-speed forwarding of traffic when the traffic of the business flow is small; the other part is not on the first storage module, which is used to forward the part of the traffic with increased load when the traffic of the business flow increases.
[0079] The forwarding table configuration method provided in the embodiment of the present application reduces the storage resources occupied by each business flow in the high-performance storage module, so that more business flow table entries can be configured in the high-performance storage module, thereby improving the forwarding efficiency of more business flows.
[0080] Moreover, since the first storage module is a high-performance storage module with the largest current access load margin, configuring the first storage block of the first business on the first storage module can provide a greater throughput for the first business through the first storage block, thereby achieving faster and larger bandwidth forwarding.
[0081] Optionally, the second storage block can be on other high-performance storage modules or low-performance storage modules. Figure 2As shown, a performance entry buffer pool can be set in the low-performance storage module. The buffer pool is used to store the forwarding entries of the newly added traffic when the traffic of each service increases, thereby achieving traffic buffering for each service.
[0082] If the second storage block is on a low-performance storage module, the high-performance storage module can be occupied as little as possible. This allows more resources to be reserved in the high-performance storage module for different service flows, allowing more services to configure performance path table entries in the high-performance storage module, thereby improving the forwarding rate of more services.
[0083] Optionally, in step 301, the CPU obtains the access load status of the high-performance storage module, which may be actively obtained by searching for the storage unit when the service is online, or reported periodically by the storage unit. This application does not limit this.
[0084] If the access load status is actively obtained by the CPU when the service is online, the corresponding process is as follows: Figure 5 As shown, including:
[0085] 501. The CPU receives a first service online request.
[0086] 502. The status maintenance unit obtains access load status of multiple high-performance storage modules and low-performance storage modules on the storage unit through the storage unit.
[0087] When a first service goes online, a storage block needs to be allocated for the first service in the storage unit for storing forwarding entries. The CPU sends an instruction to the storage unit to obtain the access load of the high-performance storage module and the low-performance storage module, so as to allocate storage locations for the forwarding entries of the first service based on the access load status.
[0088] 503. The state maintenance unit determines a first storage module having the largest access load margin from a plurality of high-performance storage modules.
[0089] like Figure 6 As shown, the state maintenance module determines that the access load of the storage module SRAM 0 exceeds the access load threshold and is in an overload state. According to the default allocation principle, the performance path table entry table0.entry4 of the first service will be allocated to SRAM 0.
[0090] In an embodiment of the present application, the state maintenance module determines SRAM 2 with the largest access load margin as the first storage module from multiple high-performance storage modules, so that the performance path table entry of the first service is allocated to SRAM 2 with a larger access load margin.
[0091] 504. The CPU configures a storage resource pool for the performance path table entry of the first service. The storage resource pool includes a first storage block located in the first storage module and a second storage block located outside the first storage module.
[0092] Table 0.entry 4 to table 3.entry 4 are performance path table entries for the first service. The table entry address allocation unit allocates addresses in the first storage block first to ensure the service quality of the new service.
[0093] Table5.entry2 associated with the first service activation belongs to a non-performance path table entry. The table entry address allocation unit first searches for a storage module with light load and storage space in the performance storage module to apply for storage space. Figure 6 In the example, table5.entry2 is allocated in DRAM 1 to achieve the optimal access performance of the system.
[0094] In an embodiment of the present application, when a service goes online (i.e., when a request to go online is received), the access load of the high-performance storage module is obtained, and then reasonable resources can be allocated to the first service that goes online based on the resource status of the storage module at the time of going online (access load status, space status, etc.). While ensuring that the first service has sufficient resources (throughput resources of the storage module, space resources, etc.), it can also be ensured that other services corresponding to the table entries stored on the storage unit also have sufficient resources.
[0095] Optionally, in the process of determining the first storage module in step 503 , in addition to the access load status, the first storage module may also be determined based on the space status of the storage module.
[0096] While obtaining the access load status in step 502 , the status maintenance unit may also obtain the space status of each storage module through the storage unit.
[0097] If there are multiple storage modules with the largest access load margins among the multiple high-performance storage modules, then in step 503, the entry address allocation unit may determine the first storage module with the largest remaining space from the multiple high-performance storage modules with the largest load margins.
[0098] In an embodiment of the present application, the first storage module is selected based on the following principle: among the high-performance storage modules with the largest access load margins, the storage module with the most remaining space is selected. The greater the access load margin of a storage module, the greater the traffic it can handle, and thus, a forwarding service with greater traffic can be provided for the first service. The more remaining space a storage module has, the more forwarding table entries it can store, and thus, more forwarding paths can be provided for the first service.
[0099] In different scenarios, the access load status, space status, etc. of each storage module in the storage unit are different. The first storage modules configured in different scenarios may be the same, for example:
[0100] 1) The first storage module is a low-performance storage module.
[0101] During the first service delivery process, multiple high-performance storage modules are in an overload state (access loads exceed the target threshold), then the second storage module with the largest access load margin is identified from multiple low-performance storage modules, and a storage resource pool is configured in the second storage module.
[0102] Optionally, the performance table buffer pool in the low performance storage module (such as Figure 6 As shown), a storage module with the lightest load and storage resources is found as the second storage module to perform address allocation.
[0103] In this embodiment of the present application, if the access load of the high-performance storage module exceeds the preset target threshold, it indicates that the service flow table entry is configured in the high-performance storage module, and the storage module is likely to be overloaded, which may affect the normal forwarding of the service flow data packets. In this case, this embodiment of the present application configures the storage resource pool in the low-performance storage module to ensure that the high-performance storage module is not overloaded, thereby ensuring the normal operation of the service flow corresponding to the stored table entry in the high-performance storage module.
[0104] 2) The first storage module is a high-performance storage module with the largest space margin.
[0105] When the access loads of the high-performance storage modules are substantially the same and do not exceed a threshold, a storage module with a larger space margin is preferentially selected as the first storage module for address allocation.
[0106] 3) The first storage module is a preset high-performance storage module.
[0107] When the access load of the high-performance storage module does not exceed the threshold and the space margin is sufficient (the space margin is greater than the preset threshold), address allocation is performed according to the pre-planned table allocation principle, such as Figure 6 As shown in , table0 to table2 are allocated in SRAM0 to SRAM2 respectively, and table3 is allocated discretely in SRAM0 to SRAM2.
[0108] If the access load status is reported periodically by the storage unit, the corresponding processing flow is as follows:
[0109] Step 1: The load detection module regularly collects and records the access load status of each storage module.
[0110] For example, at every 10 milliseconds, the load detection module collects and records the access load status of the high-performance storage module and the low-performance storage module.
[0111] Step 2: The load notification module reports the access load status of the storage unit to the status maintenance unit at a regular interval (eg, 1 second).
[0112] Optionally, the load notification module may perform operations such as averaging and removing mutation values on the access load status obtained by the load detection module to ensure that the reported access load status is not affected by instantaneous mutations.
[0113] Step 3: The status maintenance unit updates the status of each storage block in the resource pool according to the access load status of each storage unit.
[0114] For example Figure 4 As shown, in step 1, the load detection module detects that the storage module SRAM 0 accesses an overload (ie, the access load exceeds the access load threshold), and detects that SRAM 1 accesses an adjacent load (ie, the access load is adjacent to the access load threshold).
[0115] In step 3, the state maintenance module adjusts the allocation of entries in SRAM 0 and SRAM 1, moving some entries from SRAM 0 and SRAM 1 to SRAM 2 (or the performance entry buffer pool). This reduces the access load on SRAM 0 and SRAM 1, speeds up the call of entries in SRAM 0 and SRAM 1, and improves the forwarding efficiency of the corresponding service flow.
[0116] Optionally, the state maintenance module can also dynamically reallocate forwarding entries when the storage module is overloaded based on the periodically reported access load status, thereby ensuring that each storage module is not overloaded and that the service flow is quickly forwarded.
[0117] like Figure 7 As shown, the processing flow is as follows:
[0118] 701. Obtain access load status of multiple high-performance storage modules on a storage unit.
[0119] The processing unit may further include a large flow identification module, which detects the load of different service flows (eg, the number of packets processed per second (PPS)) and sorts them based on the flow size.
[0120] like Figure 8 As shown, flow4 has the largest access traffic, followed by flow0. The large flow identification unit reports the detected traffic information to the timing maintenance module in the table allocation unit and maintains the large flow table.
[0121] 702. The scheduled maintenance module determines, from a plurality of high-performance storage modules, a third storage module whose access load exceeds a first threshold.
[0122] The scheduled maintenance module queries the status information of the status maintenance module. If the access load of all storage modules does not exceed the threshold, the scheduled maintenance module does not perform any operation.
[0123] If the access load of a high-performance storage module exceeds a first threshold, the timing maintenance unit determines that the high-performance storage module is a third storage module.
[0124] 703. The scheduled maintenance module determines a first service with the largest traffic from among the multiple services corresponding to the multiple entries stored in the third storage module.
[0125] The scheduled maintenance module determines from the large flow table a plurality of flows whose entries are deployed on the third storage module, and selects a flow with the largest traffic as the first service.
[0126] 704. The state maintenance module configures a storage resource pool for the performance path entry of the first service.
[0127] If the first service is the service corresponding to flow4. Figure 8 As shown, table0.entry4 and table1.entry4 corresponding to flow4 are located in SRAM0 and SRAM1 respectively. The state maintenance module can determine that SRAM0 and SRAM1 are in an overload state (ie, the access load exceeds a predetermined threshold).
[0128] The state maintenance module can determine the first storage module (SRAM 2) with the largest access load margin among the high-performance storage modules other than SRAM0 and SRAM1, thereby determining the storage resource pool of the first business. For the specific process, see Figure 3 Steps 302-303 of the embodiment shown or Figure 5 Steps 503 - 504 of the illustrated embodiment will not be described in detail here.
[0129] 705. Migrate the table entry of the first service on the third storage module to the storage resource pool.
[0130] After determining the storage resource pool of the first service outside of SRAM0 and SRAM1, the state maintenance module can move the performance path table entry of the first service on the third storage module to the storage resource pool.
[0131] Specifically in Figure 8 In the example, the state maintenance unit migrates table0.entry4 and table1.entry4 corresponding to flow4 to SRAM2 (the first storage module) with a lighter load.
[0132] After executing steps 901-905, the detection and adjustment process is continued until access balance of each storage module is achieved.
[0133] In the embodiment of the present application, the storage unit periodically reports the access load status of the storage module, so that when the traffic volume of the service flow changes and causes some high-performance storage modules to be overloaded, the CPU can promptly detect the overloaded high-performance storage module. This allows for timely adjustment of the overloaded high-performance storage module to ensure the normal operation of the service flow corresponding to the entry on the module.
[0134] It is worth noting that for the table entries of non-performance paths, they can also be dynamically reallocated in the low-performance storage module. The specific process is as follows Figure 9 As shown, including:
[0135] 901. Obtain access load status of multiple low-performance storage modules on a storage unit.
[0136] 902. The scheduled maintenance module determines, from a plurality of low-performance storage modules, a fourth storage module whose access load exceeds a second threshold.
[0137] The scheduled maintenance module queries the status information of the status maintenance module. If the access load of all storage modules does not exceed the threshold, the scheduled maintenance module does not perform any operation.
[0138] If the access load of a low-performance storage module exceeds the second threshold, the timing maintenance unit determines that the low-performance storage module is the fourth storage module.
[0139] 903. The scheduled maintenance module determines a second service with the largest traffic from among the multiple services corresponding to the multiple entries stored in the fourth storage module.
[0140] The scheduled maintenance module determines from the large flow table a plurality of flows whose entries are deployed on the fourth storage module, and selects a flow with the largest traffic as the second service.
[0141] 904. The state maintenance module configures a storage resource pool for the non-performance path entry of the second service.
[0142] If the second service is the service corresponding to flow2. Figure 8 As shown, table5.entry2 is originally deployed in DRAM0. When it is detected that the access load of DRAM0 exceeds the threshold, the state maintenance module can determine that DRAM0 is in an overload state.
[0143] The state maintenance module can determine the storage module (DRAM 1) with the largest access load margin among the low-performance storage modules other than DRAM0, thereby determining the storage resource pool for the second business. For the specific process, see Figure 3 Steps 302-303 of the embodiment shown or Figure 5 Steps 503 - 504 of the illustrated embodiment will not be described in detail here.
[0144] 905. Migrate the table entry of the second service on the fourth storage module to the storage resource pool.
[0145] After determining the storage resource pool for the second service, the state maintenance module may migrate the non-performance path entry of the second service on the fourth storage module to the storage resource pool.
[0146] Specifically in Figure 8 In the example, the state maintenance unit migrates table5.entry2 corresponding to flow2 to DRAM 1 with a lighter load.
[0147] After executing steps 901 to 905 , the detection and adjustment process is continued until access balance is achieved for each low-performance storage module.
[0148] The above describes the forwarding table configuration method provided by the embodiment of the present application. The following describes the device used to implement the method:
[0149] The embodiment of the present application provides a processing unit, such as Figure 10 As shown, the processing unit 1000 includes:
[0150] Acquisition subunit 1001 is configured to acquire access load status of multiple high-performance storage modules on a storage unit. The high-performance storage modules are configured to store performance path table entries. The access load status of the high-performance storage modules indicates the ratio of the current access load of the high-performance storage modules to the upper limit of the access load of the high-performance storage modules.
[0151] The determining subunit 1002 is configured to determine a first storage module having the largest access load margin from among a plurality of high-performance storage modules.
[0152] The configuration subunit 1003 is configured to configure a storage resource pool for the performance path table entry of the first service, wherein the storage resource pool includes a first storage block located in the first storage module and a second storage block located outside the first storage module.
[0153] The processing unit 1000 is used to implement Figures 3 to 9 In an optional implementation, the second storage block is located in a low-performance storage module of the storage unit, and the low-performance storage module is used to store non-performance path table entries.
[0154] In an optional implementation, the acquisition subunit 1001 is specifically configured to obtain access load status and space status of multiple high-performance storage modules. If there are multiple storage modules with the largest access load margins among the multiple high-performance storage modules, the determination subunit 1002 is specifically configured to determine the first storage module with the largest remaining space from among the multiple high-performance storage modules with the largest load margins.
[0155] In an optional implementation, if the access loads of multiple high-performance storage modules exceed the target threshold, the configuration sub-unit 1003 is specifically used to: identify the second storage module with the largest access load margin from multiple low-performance storage modules, and configure a storage resource pool in the second storage module.
[0156] In an optional implementation, the acquisition subunit 1001 is specifically configured to periodically acquire access load status of multiple high-performance storage modules.
[0157] In an optional implementation, the acquiring subunit 1001 is specifically configured to: receive an online request of a first service, and acquire access load status of multiple high-performance storage modules according to the online request.
[0158] In an optional implementation, the determination subunit 1002 is further configured to: determine, from the plurality of high-performance storage modules, a third storage module whose access load exceeds a first threshold, the third storage module being a different storage module from the first storage module; and determine, from the plurality of services corresponding to the plurality of entries stored on the third storage module, the first service having the largest traffic. The processing unit 1000 further includes a migration subunit configured to migrate the table entries of the first service on the third storage module to a storage resource pool.
[0159] In an optional implementation, the acquisition subunit 1001 is further configured to: obtain the access load status of multiple low-performance storage modules on the storage unit. The determination subunit 1002 is further configured to: determine, from the multiple low-performance storage modules, a fourth storage module whose access load exceeds a second threshold, and a fifth storage module with the largest access load margin, wherein the fifth storage module is a different storage module from the fourth storage module; and determine, from the multiple services corresponding to the multiple table entries stored on the fourth storage module, the second service with the largest traffic. The processing unit 1000 further includes a migration subunit configured to migrate the table entries of the second service on the fourth storage module to the fifth storage module.
[0160] An embodiment of the present application also provides a storage unit. The storage unit includes multiple high-performance storage modules, a load detection module, and a load notification module. The multiple high-performance storage modules are configured to store performance path table entries. The load monitoring module is configured to detect the access load status of the multiple high-performance storage modules. A load channel module is configured to report the access load status of the multiple high-performance storage modules.
[0161] In an optional implementation, the storage unit further includes multiple low-performance storage modules, each configured to store non-performance path entries. The load monitoring module is further configured to detect access load status of the multiple low-performance storage modules. The load channel module is further configured to report the access load status of the multiple low-performance storage modules.
[0162] The structure of the storage unit provided in the embodiment of the present application is specifically referred to Figure 2 、 Figure 6 as well as Figure 8 Example of .
[0163] An embodiment of the present application further provides a network processor (NP). The NP includes a storage unit and a processing unit. The storage unit is the aforementioned storage unit. The processing unit is configured to process data packets according to table entries stored in the storage unit.
[0164] The structure of NP provided in the examples of this application is specifically referred to Figure 2 、 Figure 6 as well as Figure 8 Example of .
[0165] The embodiment of the present application also provides a network device. The network device includes the aforementioned network processor NP and a general-purpose processor CPU. The CPU is used to execute Figures 3 to 9 The method shown.
[0166] The structure of the network device provided in the embodiment of the present application is specifically referred to in Figure 2 、 Figure 6 as well as Figure 8 Example of .
[0167] The embodiment of the present application also provides a computer readable storage medium. The computer readable storage medium stores a program, and when the computer executes the program, the execution Figures 3 to 9 The method shown in any one of the embodiments.
[0168] The computer-readable storage medium may be a USB flash drive or other types of storage media such as a mobile hard disk, a floppy disk, an optical disk, a memory card, etc., and this application does not limit this.
[0169] The present application also provides a computer program product. When the computer program product is executed on a computer, the computer executes Figures 3 to 9 The method shown in any one of the embodiments.
[0170] Those skilled in the art will clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0171] In the several embodiments provided in this application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of the units is merely a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.
[0172] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.
[0173] In addition, the functional units in the various embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.
[0174] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
Claims
1. A method for configuring a forwarding table entry, characterized in that: include: Acquiring access load status of multiple high-performance storage modules on a storage unit, wherein the high-performance storage modules are used to store performance path table entries; Determining a first storage module having the largest access load margin from the plurality of high-performance storage modules; A storage resource pool is configured for a performance path table entry of a first service, where the storage resource pool includes a first storage block located in the first storage module and a second storage block located outside the first storage module.
2. The method according to claim 1, characterized in that The second storage block is located in a low-performance storage module of the storage unit, and the low-performance storage module is used to store non-performance path table entries.
3. The method according to claim 1 or 2, characterized in that The obtaining of access load status of the plurality of high-performance storage modules includes: Acquiring access load status and space status of the multiple high-performance storage modules; If there are multiple storage modules with the largest access load margin among the multiple high-performance storage modules, determining the first storage module with the largest access load margin from the multiple high-performance storage modules includes: The first storage module with the largest remaining space is determined from a plurality of high-performance storage modules with the largest load margins.
4. The method according to any one of claims 1 to 3, characterized in that If the access loads of the plurality of high-performance storage modules all exceed the target threshold, configuring a storage resource pool for the performance path entry of the first service includes: A second storage module with the largest access load margin is identified from a plurality of low-performance storage modules, and the storage resource pool is configured in the second storage module.
5. The method according to any one of claims 1 to 4, characterized in that The obtaining of access load status of the plurality of high-performance storage modules includes: Periodically acquiring access load status of the plurality of high-performance storage modules; or, An online request of the first service is received, and access load status of multiple high-performance storage modules is obtained according to the online request.
6. The method according to any one of claims 1 to 5, characterized in that After obtaining access load status of multiple high-performance storage modules on the storage unit, the method includes: Determine a third storage module from the plurality of high-performance storage modules, the access load of which exceeds a first threshold, wherein the third storage module is a different storage module from the first storage module; Determine the first service with the largest traffic from the multiple services corresponding to the multiple entries stored in the third storage module; After configuring the storage resource pool for the performance path table entry of the first service, the method further includes: Migrate the table entry of the first service on the third storage module to the storage resource pool.
7. The method according to any one of claims 1 to 6, characterized in that The method further comprises: Acquiring access load status of multiple low-performance storage modules on the storage unit; Determining, from the plurality of low-performance storage modules, a fourth storage module whose access load exceeds a second threshold, and a fifth storage module whose access load margin is the largest, the fifth storage module being a different storage module from the fourth storage module; Determine a second service with the largest traffic from the multiple services corresponding to the multiple entries stored in the fourth storage module; Migrate the table entry of the second service on the fourth storage module to the fifth storage module.
8. A storage unit, characterized in that: Includes multiple high-performance storage modules, load detection modules, and load notification modules; The multiple high-performance storage modules are used to store performance path table entries; The load monitoring module is configured to detect access load status of the plurality of high-performance storage modules; The load channel module is used to report the access load status of the multiple high-performance storage modules.
9. The storage unit according to claim 8, wherein: Also included are a plurality of low-performance storage modules, wherein the plurality of low-performance storage modules are used to store non-performance path table entries; The load monitoring module is further configured to detect access load states of the plurality of low-performance storage modules; The load channel module is further configured to report access load status of the plurality of low-performance storage modules.
10. A network processor NP, characterized in that: including a storage unit and a processing unit; The storage unit is the storage unit according to claim 8 or 9; The processing unit is used to process data packets according to the table entries stored in the storage unit.
11. A network device, characterized in that: The method comprises the network processor NP according to claim 10 and a general-purpose processor CPU, wherein the CPU is configured to execute the method according to any one of claims 1 to 7.
12. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a program, and when the computer executes the program, the method according to any one of claims 1 to 7 is performed.
13. A computer program product, characterized in that When the computer program product is executed on a computer, the computer performs the method according to any one of claims 1 to 7.