Traffic control method, device, medium and electronic device
By using a shared traffic controller, the system performs lookup operations on the traffic controller configuration table and available transmission time memory, thus solving the problem of low traffic control efficiency in high-speed networks and achieving fast and efficient traffic control.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- NANJING JINZHEN MICROELECTRONICS TECH CO LTD
- Filing Date
- 2024-12-10
- Publication Date
- 2026-05-12
AI Technical Summary
Existing flow control methods are inefficient in high-speed networks and cannot effectively handle large-scale flow control needs.
By enabling inbound and outbound traffic to share the same traffic controller, and based on this, performing lookup processing on the traffic controller configuration table memory and the next available transmission time memory, and writing back the new next available transmission time, hardware resource utilization is improved.
It enables rapid completion of flow control requirements, improves the utilization of hardware resources, and enhances flow control efficiency.
Smart Images

Figure CN119652831B_ABST
Abstract
Description
Technical Field
[0001] This disclosure pertains to the field of flow control, and relates to flow control methods, particularly flow control methods, apparatus, media, and electronic equipment. Background Technology
[0002] Currently, in common switch designs, ASICs (Application-Specific Integrated Circuits) specifically designed for network applications are generally used for processing, forwarding, and analyzing switch traffic; while the switch's CPU (Central Processing Unit) is mainly responsible for the overall management of the switch, such as hardware operating status. To control the functions of the ASIC, the switch's CPU also needs to process some messages sent by the ASIC, such as control-related messages for LLDP (Link Layer Discovery Protocol), STP (Spanning Tree Protocol), and ARP (Address Resolution Protocol), or routing protocol-related messages. In high-speed networks, the demand for large-scale traffic control is increasing, and current traffic control methods suffer from low efficiency. Summary of the Invention
[0003] The purpose of this disclosure is to provide flow control methods, apparatus, media, and electronic equipment to solve the problem of low flow control efficiency in current flow control methods.
[0004] In a first aspect, embodiments of this disclosure provide a flow control method, comprising: obtaining a flow controller index associated with a packet, wherein the flow of the packet is inbound flow or outbound flow, and the inbound flow and the outbound flow share the flow controller; performing a lookup process on the flow controller configuration table memory and the next available transmission time memory based on the flow controller index to obtain the flow controller rate configuration status and the next available transmission time; performing flow control on the flow of the packet through the flow controller based on the flow controller rate configuration status and the next available transmission time; obtaining a new next available transmission time based on the current time and the next available transmission time, and writing the new next available transmission time back to the next available transmission time memory.
[0005] In the flow control method, by enabling the inbound and outbound flows to share the flow controller, and on this basis, performing lookup processing on the flow controller configuration table memory and the next available transmission time memory, and writing back the new next available transmission time, the utilization of hardware resources can be improved and the flow control requirements can be quickly fulfilled.
[0006] In one embodiment of this disclosure, the method for obtaining the traffic controller index associated with a packet includes: obtaining the traffic controller port index associated with the packet; and performing a lookup process on a traffic controller selection table based on the traffic controller port index to obtain the traffic controller index.
[0007] In one embodiment of this disclosure, the method for obtaining the flow controller rate configuration status and the next available transmission time by performing a lookup process on the flow controller configuration table memory and the next available transmission time memory based on the flow controller index includes: obtaining the number of flow controller memory units based on the flow controller index; and performing a lookup process on the flow controller configuration table memory and the next available transmission time memory based on the number of flow controller memory units and the flow controller index to obtain the flow controller rate configuration status and the next available transmission time.
[0008] In one embodiment of this disclosure, the method for obtaining a new next available transmission time based on the current time and the next available transmission time includes: when the current time is greater than the next available transmission time, obtaining the new next available transmission time based on the current time and the next available transmission time, wherein the new next available transmission time is the current time; when the current time is not greater than the next available transmission time, obtaining the new next available transmission time based on the current time and the next available transmission time, wherein the new next available transmission time is the next available transmission time.
[0009] In one embodiment of this disclosure, the method for obtaining the flow controller index by performing a lookup process on the flow controller selection table based on the flow controller port index includes: performing a lookup process on the flow controller selection table based on the flow controller port index to obtain the flow controller index during the outbound traffic in a first period; performing a lookup process on the flow controller selection table based on the flow controller port index to obtain the flow controller index during the inbound traffic in a second period; wherein the clock of the first period is an even-numbered clock, and the clock of the second period is an odd-numbered clock.
[0010] In one embodiment of this disclosure, the method for obtaining the flow controller rate configuration status and the next available transmission time by performing a lookup operation on the flow controller configuration table memory and the next available transmission time memory based on the flow controller index includes the following steps: Within a third cycle: First, under the outbound traffic, perform a lookup operation on the flow controller configuration table memory based on the flow controller index to obtain the flow controller rate configuration status; Second, under the outbound traffic, perform a lookup operation on the next available transmission time memory based on the flow controller index to obtain the next available transmission time; Third, under the outbound traffic, read the flow controller status... The fourth step involves reading the QoS table of the traffic controller under the outbound traffic. Within the fourth cycle: First, under the inbound traffic, a lookup of the traffic controller configuration table memory is performed based on the traffic controller index to obtain the traffic controller rate configuration status; Second, under the inbound traffic, a lookup of the next available transmission time memory is performed based on the traffic controller index to obtain the next available transmission time; Third, under the inbound traffic, the traffic controller status is read; Fourth, under the inbound traffic, the traffic controller QoS table is read; The clock for the third cycle is an even-numbered clock, and the clock for the fourth cycle is an odd-numbered clock.
[0011] In one embodiment of this disclosure, the method for obtaining a new next available transmission time based on the current time and the next available transmission time, and writing the new next available transmission time back to the next available transmission time memory, includes the following steps: In the fourth cycle: Step 5, under outbound traffic, obtaining a new next available transmission time based on the current time and the next available transmission time, and writing the new next available transmission time back to the next available transmission time memory; Step 6, under outbound traffic, updating the flow controller state; In the fifth cycle: Step 1, under inbound traffic, obtaining a new next available transmission time based on the current time and the next available transmission time, and writing the new next available transmission time back to the next available transmission time memory; Step 2, under inbound traffic, updating the flow controller state; The clock of the fifth cycle is an even-numbered clock.
[0012] Secondly, embodiments of this disclosure provide a flow control device, comprising: an index acquisition module, configured to acquire a flow controller index associated with a packet, wherein the flow of the packet is inbound flow or outbound flow, and the inbound flow and the outbound flow share the flow controller; a lookup processing module, configured to perform lookup processing on the flow controller configuration table memory and the next available transmission time memory based on the flow controller index, to obtain the flow controller rate configuration status and the next available transmission time; a flow processing module, configured to perform flow control on the flow of the packet through the flow controller based on the flow controller rate configuration status and the next available transmission time; and a memory write-back module, configured to acquire a new next available transmission time based on the current time and the next available transmission time, and write the new next available transmission time back to the next available transmission time memory.
[0013] Thirdly, embodiments of this disclosure provide a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the flow control method described in any one of the first aspects.
[0014] Fourthly, embodiments of this disclosure provide an electronic device, including: a memory; and a processor coupled to the memory and configured to perform the flow control method according to any one of the first aspects.
[0015] As described above, the flow control method, apparatus, medium, and electronic device described in this application have the following beneficial effects:
[0016] In the flow control method, by enabling the inbound and outbound flows to share the flow controller, and on this basis, performing lookup processing on the flow controller configuration table memory and the next available transmission time memory, and writing back the new next available transmission time, the utilization of hardware resources can be improved and the flow control requirements can be quickly fulfilled. Attached Figure Description
[0017] Figure 1 The diagram shown is a schematic representation of the hardware structure of the aggregated flow controller according to an embodiment of this disclosure.
[0018] Figure 2 The flowchart shown is a flow control method according to an embodiment of this disclosure.
[0019] Figure 3 This diagram illustrates the rate configuration status of the flow controller in the flow controller configuration table memory, as shown in an embodiment of this disclosure.
[0020] Figure 4 The diagram shown is a structural schematic of the flow control method according to an embodiment of this disclosure.
[0021] Figure 5 The flowchart shown is a method for obtaining the traffic controller index associated with a message according to an embodiment of this disclosure.
[0022] Figure 6 The flowchart shown is an embodiment of the present disclosure of a method for performing lookup processing on the flow controller configuration table memory and the next available transmission time memory to obtain the flow controller rate configuration status and the next available transmission time.
[0023] Figure 7 The diagram shown is a structural schematic of the number of flow control memory units in an embodiment of this disclosure.
[0024] Figure 8 This diagram illustrates how a transmission availability time is mapped to a traffic controller configuration table entry in an embodiment of this disclosure.
[0025] Figure 9 The flowchart shows the implementation method for obtaining the new next available transmission time, which is based on the current time of the primitive in this embodiment of the present disclosure and the next available transmission time.
[0026] Figure 10 The flowchart shown is an embodiment of the present disclosure of a method for performing a lookup process on a flow controller selection table to obtain the flow controller index.
[0027] Figure 11 The diagram shows the operation of the pipeline in each clock cycle according to an embodiment of this disclosure.
[0028] Figure 12 The diagram shown is a schematic representation of the flow control device according to an embodiment of this disclosure.
[0029] Component designation explanation
[0030] 120 Flow Control Device
[0031] 1210 Index Acquisition Module
[0032] 1220 Search Processing Module
[0033] 1230 Traffic Processing Module
[0034] 1240 Memory Write-Back Module
[0035] Steps S11-S14
[0036] Steps S21-S22
[0037] Steps S31-S32
[0038] Steps S41-S42
[0039] Steps S51-S52 Detailed Implementation
[0040] The following specific examples illustrate the implementation of this disclosure. Those skilled in the art can easily understand other advantages and effects of this disclosure from the content disclosed in this specification. This disclosure can also be implemented or applied through other different specific embodiments, and various details in this specification can also be modified or changed based on different viewpoints and applications without departing from the spirit of this disclosure. It should be noted that, unless otherwise specified, the following embodiments and features in the embodiments can be combined with each other.
[0041] It should be noted that the illustrations provided in the following embodiments are only schematic representations of the basic concept of this disclosure. Therefore, the illustrations only show the components related to this disclosure and are not drawn according to the number, shape and size of the components in actual implementation. In actual implementation, the form, quantity and proportion of each component can be arbitrarily changed, and the layout of the components may also be more complex.
[0042] The principles and implementation methods of the flow control method and flow control device of this disclosure will be described in detail below, so that those skilled in the art can understand the flow control method and flow control device of this disclosure without creative effort.
[0043] Please see Figure 1 , Figure 1The diagram shown is a schematic of the hardware structure of the aggregated flow controller in this embodiment. Wherein, `policerPortIndex` represents the flow controller port index, `localPortNumber` represents the local port number, `PolicerSelectionTable` represents the flow controller selection table, `polIndex` represents the flow controller index, `PolicerRate Config mem` represents the flow controller rate configuration memory, `POL 0` represents flow controller 0, `POL 1` represents flow controller 1, `wrPollIdx1` represents the index to write to flow controller 1, `newNextTat1` represents the next available transmission time for flow controller 1, `wrIdx` represents the write index, `rdIdx` represents the read index, `wrData` represents the write data, `wrPollIdx0` represents the index to write to flow controller 0, `newNextTat0` represents the next available transmission time for flow controller 0, `Egress lookup bus shift register` represents the outbound lookup bus offset register, `Ingresslookup bus shift register` represents the inbound lookup bus offset register, `Lookup Bus` represents the lookup bus, `Egress policing` represents outbound flow control, `Ingress policing` represents inbound flow control, `Egresspolicing results` represents the outbound flow control results, and `Ingress policing` represents the inbound flow control results. "results" represents the inbound flow control results. "Even NextTat banks" can represent the next available transmission time memory unit corresponding to an even-numbered flow controller index, while "Odd NextTat banks" can represent the next available transmission time memory unit corresponding to an odd-numbered flow controller index.
[0044] Please see Figure 2 This embodiment provides a flow control method, including:
[0045] S11, obtain the flow controller index associated with the message, wherein the flow of the message is inbound flow or outbound flow, and the inbound flow and the outbound flow share the flow controller.
[0046] Optionally, there can be two flow controllers. The flow controller index refers to the index pointing to the flow controller. For example, if the index is 1, it can indicate that it points to the first flow controller, and if the index is 2, it can indicate that it points to the second flow controller.
[0047] Optionally, the message can be an Ethernet message.
[0048] S12, based on the flow controller index, perform a lookup process on the flow controller configuration table memory and the next available transmission time memory to obtain the flow controller rate configuration status and the next available transmission time.
[0049] Optionally, the flow controller configuration table memory and the next transmission availability time memory can be located in four flow control memory units, each supporting 512 addresses. The four flow control memory units support a total of 2K (2×1024) aggregated flow control flow tables (implemented by hardware memory). Inbound and outbound flow controllers can access the same flow control memory unit, but must access it separately using odd and even clock cycles (odd clock for inbound flow controller access time, even clock for outbound flow controller access time).
[0050] Optionally, the flow controller configuration table memory can refer to the memory storing the flow controller configuration table, and the next available transmission time memory can refer to the memory storing the next available transmission time. The next available transmission time can refer to the time point at which the packet can be sent next.
[0051] Optionally, the flow controller configuration table memory can be used to store the flow rate parameters of the flow controller. The flow controller rate configuration status refers to the flow rate parameters configured by the flow controller. The flow controller configuration table (PolicerConfigTable) is a storage table readable by Ethernet packets. Incoming and outgoing packets read their stored flow rate parameters in odd and even clock cycles, respectively. Figure 3 As shown, the traffic controller configuration table in memory can contain the rate configuration status of two traffic controllers (Policers). The high 10 bits of the pointer to the traffic controller index (PolicerIndex) are used as the address of the PolicyrConfigTable memory. If PolicyrIndex is i+1, then the corresponding packet will look up policyr i+1, where policyr i+1 represents the policyr corresponding to PolicyrIndex with index i+1.
[0052] S13, based on the flow controller rate configuration state and the next transmission availability time, perform flow control on the flow through the flow controller.
[0053] Optionally, based on the flow controller rate configuration state and the next available transmission time, the flow controller performs flow control on the flow. This can refer to the process of limiting the flow based on the flow controller rate configuration state and the next available transmission time. The process of flow control based on the combination of the flow controller rate configuration state and the next available transmission time can be implemented according to the token bucket algorithm, which will not be elaborated in this embodiment.
[0054] S14. Based on the current time and the next available transmission time, obtain a new next available transmission time and write the new next available transmission time back to the next available transmission time memory.
[0055] Optionally, the Next Transmission Available Time (nextTat) memory can be divided into two groups: one for outbound flow controllers and one for inbound flow controllers. Each group has a refresh address pointer containing the memory address of the next entry to be refreshed in that group. Each flow controller pipeline refreshes the group of entries it uses. The refresh address logic uses a 4-bit nextTatbankConfig (Next Transmission Available Time memory cell configuration) register to determine the next address after reaching the end of the 512-byte memory bank. If they are not divided into two groups, collisions will occur because each nextTat memory bank can be used for either the inbound or outbound flow controller.
[0056] Optionally, the next available transmission time (nextTat) memory can be divided into two groups, which can be the next available transmission time memory unit corresponding to the odd-numbered flow controller index and the next available transmission time memory unit corresponding to the even-numbered flow controller index. The clock corresponding to the outbound flow is an even-numbered clock, and the clock corresponding to the inbound flow is an odd-numbered clock. An even-numbered flow controller index can be generated based on the even-numbered clock, and an odd-numbered flow controller index can be generated based on the odd-numbered clock. This embodiment will not elaborate further on this.
[0057] In one embodiment of this disclosure, please refer to Figure 4 The flow controller rate configuration state can be... Figure 4The `rateburstSize` parameter (the maximum amount of data allowed to be transmitted within a given time window) is defined as follows: `Single RatePolicer` represents a single-rate flow controller; `outProfile` can represent the output profile; `tat` can represent the next available transmission time, which can contain data transmission rules generated based on `tat` and `rateburstSize` to determine how to send message packets; `Policing Result action` represents the flow control result action; `aggPolMode` represents the aggregation control mode; `packetColor` represents the packet color; `NextTatEvenBanks` represents even-numbered memory units of the next available transmission time (i.e., the memory units corresponding to the next available transmission time when `PolicerIndex` is even); `NextTatOddBanks` represents odd-numbered memory units of the next available transmission time (i.e., the memory units corresponding to the next available transmission time when `PolicerIndex` is odd); and `updateNextTat0 / 1` can represent updating the next available transmission time of the first or second flow controller.
[0058] In one embodiment of this disclosure, writing to the nextTatbankConfig register triggers a refresh index reload to the index offset 0 of the storage unit that allocates the minimum index to the flow controller. Each index refresh increments the index independently until it reaches the highest index in the library. For example, when writing to the nextTatbankConfig register triggers an index refresh operation, the index refresh starts from the minimum index. When the minimum index is 0, each index refresh increments the index from 0 until the highest index is reached.
[0059] In the aforementioned flow control method, by enabling the inbound and outbound flows to share the same flow controller, namely the aggregated flow controller, and by performing lookup processing on the flow controller configuration table memory and the next available transmission time memory, as well as writing back the new next available transmission time, the utilization of hardware resources can be improved and the flow control (monitoring) requirements can be quickly fulfilled.
[0060] Please see Figure 5 This embodiment provides a method for obtaining the traffic controller index associated with a packet, including:
[0061] S21, obtain the flow controller port index associated with the message.
[0062] Optionally, the traffic controller port index (PolicerPortIndex) is generated by the packet in the QoS (Quality of Service) classifier (an Ethernet packet passes through the QoS classifier and obtains a PolicyrPortIndex). Specifically, when an Ethernet packet passes through the QoS classifier, the classifier analyzes the packet and assigns a traffic controller port index to the packet based on the analysis results. The packet analysis process of the classifier can be designed according to the actual situation, and will not be described in detail in this embodiment.
[0063] S22, based on the flow controller port index, perform a lookup process on the flow controller selection table to obtain the flow controller index.
[0064] Optionally, the flow controller selection table may have several entries, each corresponding to a flow controller port index and a flow controller index, thereby enabling the lookup process of the flow controller selection table in step S22.
[0065] Please see Figure 6 This embodiment provides a method for obtaining the traffic controller rate configuration status and the next available transmission time by performing a lookup operation on the traffic controller configuration table memory and the next available transmission time memory based on the traffic controller index, including:
[0066] S31, based on the flow controller index, obtain the number of flow control memory units.
[0067] Optionally, the number of flow control memory units can be expressed as:
[0068] bankNum=2*(policerIndex / (2*PolicerBankEntries))+policerIndex[0]
[0069] Wherein, bankNum represents the number of flow control memory units, which can refer to the flow control memory unit to which the flow controller index belongs. For example, if the number of flow controller memory units is 1, it means that it belongs to flow control memory unit 1. policerIndex represents the flow controller index, PolicyrBankEntries represents the number of entries in the flow control memory unit, policerIndex[0] represents the starting value of the flow controller index, and policerIndex / (2*PolicerBankEntries) represents the integer value of the ratio of policerIndex to twice PolicyrBankEntries. For example, please refer to... Figure 7and Figure 8 The flow controller memory unit has 512 entries, and the total number of units in the flow controller memory is 4. When the flow controller index is even, the starting value of the flow controller index is 0; when the flow controller index is odd, the starting value of the flow controller index is 1. When the flow controller index is 508, bankNum is 0; when the flow controller index is 1030, bankNum is 2; when the flow controller index is 507, bankNum is 1; and when the flow controller index is 1227, bankNum is 3.
[0070] S32, based on the number of flow control memory units and the flow controller index, perform a lookup process on the flow controller configuration table memory and the next available transmission time memory to obtain the flow controller rate configuration status and the next available transmission time.
[0071] Please see Figure 9 This embodiment provides a method for obtaining a new next available transmission time based on the current time and the next available transmission time, including:
[0072] S41, when the current time is greater than the next available transmission time, obtain the new next available transmission time based on the current time and the next available transmission time, where the new next available transmission time is the current time.
[0073] S42, when the current time is not greater than the next available transmission time, obtain the new next available transmission time based on the current time and the next available transmission time, and the new next available transmission time is the next available transmission time.
[0074] In one embodiment of this disclosure, the nextTat memory entry needs to be moved to currentTime before currentTime changes too much. For example, it is moved to currentTime when (currentTime) >= 2 * (number of bits (nextTat) - 1), meaning that twice the number of bits corresponding to nextTat minus 1 has been transmitted at the current time. The number of bits refers to the throughput, and the number of bits (nextTat) can be bit / s * (nextTat). Since monitoring only takes effect when nextTat is greater than currentTime, monitoring is ineffective when this situation occurs.
[0075] The next available transmission time can be represented by the following code:
[0076] if (msb(currentTime-nextTat) != 1) / / If the available time for the next transmission is less than the current time.
[0077] newNextTat = currentTime / / This sets the available time for the next transmission to the current time.
[0078] else / / Otherwise
[0079] newNextTat = nextTat / / The next available transfer time is the next available transfer time.
[0080] Here, msb(currentTime-nextTat) refers to the most significant bit of the value calculated by subtracting currentTime from nextTat.
[0081] Please see Figure 10 This embodiment provides a method for performing a lookup process on a flow controller selection table to obtain the flow controller index, including:
[0082] S51, under the outbound traffic in the first cycle, a lookup process is performed on the flow controller selection table based on the flow controller port index to obtain the flow controller index.
[0083] S52, under the incoming traffic in the second cycle, a lookup process is performed on the flow controller selection table based on the flow controller port index to obtain the flow controller index.
[0084] The clock in the first cycle is an even-numbered clock, and the clock in the second cycle is an odd-numbered clock.
[0085] This embodiment provides a method for obtaining the traffic controller rate configuration status and the next available transmission time by performing a lookup operation on the traffic controller configuration table memory and the next available transmission time memory based on the traffic controller index, including the following steps:
[0086] During the third cycle:
[0087] The first step is to perform a lookup operation on the traffic controller configuration table memory based on the traffic controller index under the outbound traffic to obtain the traffic controller rate configuration status.
[0088] The second step is to perform a lookup process on the memory of the next available transmission time based on the traffic controller index under the outbound traffic to obtain the next available transmission time.
[0089] The third step is to read the status of the flow controller under the outbound flow.
[0090] Fourth step, under the outbound traffic, read the QoS (Quality of Service) table of the traffic controller;
[0091] During the fourth cycle:
[0092] The first step is to perform a lookup operation on the traffic controller configuration table memory based on the traffic controller index under the incoming traffic to obtain the traffic controller rate configuration status.
[0093] The second step is to perform a lookup process on the next available transmission time memory based on the traffic controller index under the incoming traffic to obtain the next available transmission time.
[0094] The third step is to read the status of the flow controller under the incoming flow.
[0095] Fourth step: Under the incoming flow, read the QoS table of the flow controller;
[0096] The clock in the third cycle is an even-numbered clock, and the clock in the fourth cycle is an odd-numbered clock.
[0097] Optionally, the traffic controller status can refer to the internal information and parameters maintained by the traffic controller during operation, which reflect the current operating status and configuration of the traffic controller. The traffic controller QoS table can be a table used to record different types of traffic and their corresponding quality of service, and can be used for priority scheduling, resource allocation, and policy enforcement.
[0098] This embodiment provides a method for obtaining a new next available transmission time based on the current time and the next available transmission time, and writing the new next available transmission time back to the memory of the next available transmission time, including the following steps:
[0099] During the fourth cycle:
[0100] Fifth step: Under the outbound traffic, based on the current time and the next available transmission time, obtain a new next available transmission time, and write the new next available transmission time back to the next available transmission time memory;
[0101] Step 6: Under the outbound flow, update the flow controller status;
[0102] During the fifth cycle:
[0103] First, under the incoming traffic, based on the current time and the next available transmission time, obtain a new next available transmission time, and write the new next available transmission time back to the next available transmission time memory;
[0104] The second step is to update the state of the flow controller under the incoming flow.
[0105] Optionally, the state of the flow controller can be flexibly set according to the actual situation, which will not be elaborated in this embodiment.
[0106] The clock in the fifth cycle is an even-numbered clock.
[0107] In one embodiment of this disclosure, please refer to Figure 11 Since the `policerConfigTable` and `nextTat` memory outputs are shared by the inbound and outbound flow controllers, this hardware solution has only one set of flow controllers and a common pipeline shared by the inbound and outbound flow controllers. This requires all pipeline tasks to be single-cycle, with inbound and outbound packet lookups entering the common pipeline at different stages to avoid different packet lookup accesses to the `policerConfigTable` and `nextTat` memory within the same cycle. Figure 10The pipeline operations for message lookup are listed for each clock cycle. T0 represents the first cycle mentioned above. `read Egress policerSelection Table` represents reading the flow controller selection table for outgoing traffic. T1 represents the second cycle mentioned above. `read Ingress policerSelection Table` represents reading the flow controller selection table for incoming traffic. T2 represents the third cycle. `read Egress policerConfig table` represents reading the flow controller configuration table for outgoing traffic. `read Egress policernextTat: partial pktTime and bTime calculation` can be interpreted as reading the next available transmission time for outgoing traffic from the flow controller: partial packet time and bucket time calculation. The bucket can refer to the token bucket. The next available transmission time can be calculated according to the token bucket algorithm, which will not be elaborated in this embodiment. `read Egress policerStats` represents reading the flow controller status for outgoing traffic. `read Egress policer QosTable` represents reading the flow controller QoS table for outgoing traffic. T3 represents the fourth cycle. `read Ingress policerConfig table` represents reading the flow controller configuration table for incoming traffic. `read Ingress policernextTat: partial pktTime and bTime calculation` can be interpreted as reading the next available transmission time for outgoing traffic from the flow controller. bTime calculation: can be represented as reading the next available transmission time of the flow controller under inbound traffic: partial packet time and bucket time calculation. read Ingress policer Stats can represent reading the flow controller status under inbound traffic. read Ingress policer QosTable can represent reading the QoS table of the flow controller under inbound traffic. Egress policer: 1) compute outofProfile 2) compute new nextTat 3) nextTat writeback can be represented as the flow controller under inbound traffic: 1) calculate the output profile 2) calculate the new next available transmission time 3) write back the next available transmission time. update Egress policerstats represents updating the flow controller status under outbound traffic. T4 can represent the fifth cycle. update Ingresspolicer stats represents updating the flow controller status under inbound traffic.
[0108] In one embodiment of this disclosure, from the perspective of improving hardware resource utilization, inbound and outbound traffic share a single aggregated traffic controller. Every two clock cycles are divided into odd and even clock cycles, with inbound and outbound traffic occupying odd and even cycles respectively. When CPU software needs to access hardware resources, it can only access the aggregated traffic controller when there is no inbound or outbound traffic accessing it. Furthermore, the nextTat memory (next transfer availability time memory) is automatically refreshed only when there is no inbound or outbound packet access and no CPU software access. The hardware resources of the aggregated traffic controller mainly consist of memory such as the PolicyrTatStatsTable (traffic controller next transfer availability time status table), PolicyrConfigTable (traffic controller configuration table), and QosTable (quality of service table).
[0109] The scope of protection of the flow control method described in this disclosure is not limited to the execution order of the steps listed in this embodiment. Any solution implemented by adding, subtracting, or replacing steps in the prior art based on the principles of this disclosure is included within the scope of protection of this disclosure.
[0110] Figure 12 This is a schematic diagram illustrating the structure of a flow control device according to an embodiment of the present disclosure. Figure 12 As shown, this embodiment provides a flow control device 120, including:
[0111] The index acquisition module 1210 is used to acquire the flow controller index associated with the message, wherein the flow of the message is inbound flow or outbound flow, and the inbound flow and the outbound flow share the flow controller.
[0112] The lookup processing module 1220 is used to perform lookup processing on the traffic controller configuration table memory and the next available transmission time memory based on the traffic controller index, so as to obtain the traffic controller rate configuration status and the next available transmission time.
[0113] The traffic processing module 1230 is used to perform traffic control on the traffic of the packet through the traffic controller based on the traffic controller rate configuration status and the next transmission available time.
[0114] The memory write-back module 1240 is used to obtain a new next available transmission time based on the current time and the next available transmission time, and write the new next available transmission time back to the next available transmission time memory.
[0115] In the flow control device 120 provided in this embodiment, the index acquisition module 1210 and Figure 2The steps S11 of the flow control method shown correspond one-to-one, and the lookup processing module 1220 is in line with... Figure 2 The steps S12 of the flow control method shown correspond one-to-one, and the flow processing module 1230 is in line with... Figure 2 The steps S13 of the flow control method shown correspond one-to-one, and the memory write-back module 1240 and Figure 2 The steps S14 of the flow control method shown correspond one-to-one.
[0116] In the several embodiments provided in this disclosure, it should be understood that the disclosed apparatus or method can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative. For instance, the division of modules / units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple modules or units may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection of apparatuses or modules or units may be electrical, mechanical, or other forms.
[0117] The modules / units described as separate components may or may not be physically separate. The components shown as modules / units may or may not be physical modules; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules / units can be selected to achieve the objectives of the embodiments of this disclosure, depending on actual needs. For example, the functional modules / units in the various embodiments of this disclosure may be integrated into one processing module, or each module / unit may exist physically separately, or two or more modules / units may be integrated into one module / unit.
[0118] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this disclosure.
[0119] This embodiment provides an electronic device, which includes a memory and a processor coupled to the memory and configured to execute... Figure 2 The flow control method shown.
[0120] This disclosure also provides a computer-readable storage medium. Those skilled in the art will understand that all or part of the steps in the methods of the above embodiments can be implemented by a program instructing a processor. The program can be stored in a computer-readable storage medium, which is a non-transitory medium, such as random access memory, read-only memory, flash memory, hard disk, solid-state drive, magnetic tape, floppy disk, optical disk, and any combination thereof. The storage medium can be any available medium accessible to a computer or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., digital video disc (DVD)), or a semiconductor medium (e.g., solid-state drive (SSD)).
[0121] This disclosure also provides a computer program product comprising one or more computer instructions. When the computer instructions are loaded and executed on a computing device, all or part of the processes or functions described in this disclosure are generated. The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions may be transmitted from one website, computer, or data center to another via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means.
[0122] When the computer program product is executed by a computer, the computer performs the method described in the foregoing method embodiments. The computer program product can be a software installation package; when the foregoing method is required, the computer program product can be downloaded and executed on the computer.
[0123] The descriptions of the processes or structures corresponding to the above figures each have their own emphasis. For parts of a process or structure that are not described in detail, please refer to the relevant descriptions of other processes or structures.
[0124] The above embodiments are merely illustrative of the principles and effects of this disclosure and are not intended to limit this disclosure. Any person skilled in the art can modify or alter the above embodiments without departing from the spirit and scope of this disclosure. Therefore, all equivalent modifications or alterations made by those skilled in the art without departing from the spirit and technical concept disclosed in this disclosure should still be covered by the claims of this disclosure.
Claims
1. A flow control method, characterized in that, include: Obtain the flow controller index associated with the message, wherein the flow of the message is either inbound or outbound, and the inbound and outbound flows share the flow controller; Based on the traffic controller index, a lookup process is performed on the traffic controller configuration table memory and the next available transmission time memory to obtain the traffic controller rate configuration status and the next available transmission time. Based on the flow controller rate configuration status and the next transmission availability time, the flow controller performs flow control on the packet flow. Based on the current time and the next available transmission time, obtain a new next available transmission time and write the new next available transmission time back to the next available transmission time memory; The method for obtaining the traffic controller index associated with a packet includes: obtaining the traffic controller port index associated with the packet; and performing a lookup process on the traffic controller selection table based on the traffic controller port index to obtain the traffic controller index. The method for obtaining the flow controller index by performing a lookup process on the flow controller selection table based on the flow controller port index includes: performing a lookup process on the flow controller selection table based on the flow controller port index to obtain the flow controller index during the outbound traffic in the first period; performing a lookup process on the flow controller selection table based on the flow controller port index to obtain the flow controller index during the inbound traffic in the second period; wherein the clock of the first period is an even clock and the clock of the second period is an odd clock.
2. The flow control method according to claim 1, characterized in that, The method for obtaining the traffic controller rate configuration status and the next available transmission time by performing lookup operations on the traffic controller configuration table memory and the next available transmission time memory based on the traffic controller index includes: Based on the flow controller index, obtain the number of flow control memory units; Based on the number of flow control memory units and the flow controller index, a lookup process is performed on the flow controller configuration table memory and the next available transmission time memory to obtain the flow controller rate configuration status and the next available transmission time.
3. The flow control method according to claim 1, characterized in that, The methods for obtaining the new next available transmission time based on the current time and the next available transmission time include: When the current time is greater than the next available transmission time, the new next available transmission time is obtained based on the current time and the next available transmission time, and the new next available transmission time is the current time. When the current time is not greater than the next available transmission time, the new next available transmission time is obtained based on the current time and the next available transmission time, and the new next available transmission time is the next available transmission time.
4. The flow control method according to claim 1, characterized in that, The method for obtaining the flow controller rate configuration status and the next available transmission time by performing a lookup operation on the flow controller configuration table memory and the next available transmission time memory based on the flow controller index includes the following steps: During the third cycle: The first step is to perform a lookup operation on the traffic controller configuration table memory based on the traffic controller index under the outbound traffic to obtain the traffic controller rate configuration status. The second step is to perform a lookup process on the memory of the next available transmission time based on the traffic controller index under the outbound traffic to obtain the next available transmission time. The third step is to read the status of the flow controller under the outbound flow. Fourth step: Under the outbound traffic, read the QoS table of the traffic controller; During the fourth cycle: The first step is to perform a lookup operation on the traffic controller configuration table memory based on the traffic controller index under the incoming traffic to obtain the traffic controller rate configuration status. The second step is to perform a lookup process on the next available transmission time memory based on the traffic controller index under the incoming traffic to obtain the next available transmission time. The third step is to read the status of the flow controller under the incoming flow. Fourth step: Under the incoming flow, read the QoS table of the flow controller; The clock in the third cycle is an even-numbered clock, and the clock in the fourth cycle is an odd-numbered clock.
5. The flow control method according to claim 4, characterized in that, The method for obtaining a new next available transmission time based on the current time and the next available transmission time, and writing the new next available transmission time back to the memory of the next available transmission time, includes the following steps: During the fourth cycle: Fifth step: Under the outbound traffic, based on the current time and the next available transmission time, obtain a new next available transmission time, and write the new next available transmission time back to the next available transmission time memory; Step 6: Under the outbound flow, update the flow controller status; During the fifth cycle: First, under the incoming traffic, based on the current time and the next available transmission time, obtain a new next available transmission time, and write the new next available transmission time back to the next available transmission time memory; The second step is to update the state of the flow controller under the incoming flow. The clock in the fifth cycle is an even-numbered clock.
6. A flow control device, characterized in that, include: The index acquisition module is used to acquire the flow controller index associated with the message, wherein the flow of the message is either inbound or outbound, and the inbound and outbound flows share the flow controller. The lookup processing module is used to perform lookup processing on the traffic controller configuration table memory and the next available transmission time memory based on the traffic controller index, so as to obtain the traffic controller rate configuration status and the next available transmission time; A traffic processing module is used to perform traffic control on the traffic of the packet through the traffic controller based on the traffic controller rate configuration status and the next transmission available time; The memory write-back module is used to obtain a new next available transmission time based on the current time and the next available transmission time, and write the new next available transmission time back to the next available transmission time memory; The method for obtaining the traffic controller index associated with a packet includes: obtaining the traffic controller port index associated with the packet; and performing a lookup process on the traffic controller selection table based on the traffic controller port index to obtain the traffic controller index. The method for obtaining the flow controller index by performing a lookup process on the flow controller selection table based on the flow controller port index includes: performing a lookup process on the flow controller selection table based on the flow controller port index to obtain the flow controller index during the outbound traffic in the first period; performing a lookup process on the flow controller selection table based on the flow controller port index to obtain the flow controller index during the inbound traffic in the second period; wherein the clock of the first period is an even clock and the clock of the second period is an odd clock.
7. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the flow control method according to any one of claims 1-5.
8. An electronic device, characterized in that, include: Memory; A processor, coupled to the memory, is configured to execute the flow control method according to any one of claims 1-5.