WO2022127729A1 - 一种报文的处理方法及装置 - Google Patents

一种报文的处理方法及装置 Download PDF

Info

Publication number
WO2022127729A1
WO2022127729A1 PCT/CN2021/137399 CN2021137399W WO2022127729A1 WO 2022127729 A1 WO2022127729 A1 WO 2022127729A1 CN 2021137399 W CN2021137399 W CN 2021137399W WO 2022127729 A1 WO2022127729 A1 WO 2022127729A1
Authority
WO
WIPO (PCT)
Prior art keywords
color
packet
red
tokens
comparison result
Prior art date
Application number
PCT/CN2021/137399
Other languages
English (en)
French (fr)
Inventor
袁俊明
史源
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2022127729A1 publication Critical patent/WO2022127729A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/10Flow control; Congestion control
    • H04L47/215Flow control; Congestion control using token-bucket

Definitions

  • the present application relates to the field of communication technologies, and in particular, to a method and device for processing a message.
  • the committed access rate (CAR) algorithm is usually used to control the packet traffic during packet traffic policing.
  • the CAR algorithm uses the token bucket mechanism to control the rate of packets.
  • the CAR algorithm includes the following two functions: (1) Traffic rate limit: By using the token bucket to measure the packets flowing through the port, only the traffic with the token can pass through within a specific time, so as to limit the flow rate. (2) Flow classification: measure the flow through the token bucket algorithm, and mark the packets with different flow classification internal marks (including service level and drop priority, etc.) according to the measurement results.
  • the implementation of the solution based on the CAR algorithm requires at least 2-level subtractor, 1-level comparator and 1-level adder, and also needs to support the selectors introduced by different modes of the CAR algorithm.
  • the working clock of the current chip continues to increase, it is difficult for the CAR algorithm to complete the operation in one clock cycle. Taking the 16-nanometer (nm) process 1GHz as an example, it takes 4 clock cycles to complete 1 CAR calculation. Therefore, currently, the performance of implementing the packet rate control using the CAR algorithm is low.
  • the present application provides a packet processing method and device, which are used to optimize the packet processing process using the CAR algorithm.
  • the present application provides a packet processing method, the method may include: acquiring a first CAR instruction, where the first CAR instruction includes the size and first color of the first packet; determining the current token bucket and compare the size of the first packet with the number of tokens to obtain a comparison result; then determine the first packet according to the comparison result and the first color of the first packet The second color of the message, and the number of tokens in the token bucket is updated according to the second color and the size of the first message; wherein the number of the token bucket is one or two.
  • the processing process of CAR can be split, which can reduce the complexity of processing packets based on the CAR algorithm, thereby improving processing performance.
  • the specific method of determining the number of tokens in the current token bucket may be: determining the initial value of the number of tokens in the token bucket at the first moment; determining the number of tokens in the token bucket at the second moment The updated value of the number of tokens; the number of tokens in the current token bucket is determined according to the initial value and the updated value. In this way, the quantity in the token bucket can be accurately determined, and the implementation method is relatively simple.
  • the size unit of the first packet may also be converted into a unit of the number of tokens. In this way, after the size unit of the first packet is the same as the token quantity unit, the comparison between the two is simpler, and the comparison efficiency can be improved.
  • the second color of the first packet is determined according to the comparison result and the first color of the first packet
  • a specific method may be: according to the comparison result and a preset color a configuration table, determining a third color corresponding to the comparison result, and determining a second color of the first packet according to the third color and the first color of the first packet; the color configuration table includes The correspondence between the first flag bit corresponding to the comparison result and the packet color.
  • the second color of the first packet is determined according to the third color and the first color of the first packet.
  • the specific method may be: when the first color is green, When the third color is green, the second color is determined to be green; when the first color is green and the third color is yellow, the second color is determined to be yellow; when the first color is green When the color is green and the third color is red, the second color is determined to be red; when the first color is yellow and the third color is green, the second color is determined to be yellow; when the first color is yellow and the third color is green, the second color is determined to be yellow; When the first color is yellow and the third color is yellow, the second color is determined to be yellow; when the first color is yellow and the third color is red, the second color is determined is red; when the first color is red and the third color is green, the second color is determined to be red; when the first color is red and the third color is yellow, it is determined that the second color is red; The second color is red; when the first color is red and the third color
  • the number of tokens in the token bucket is updated according to the second color and the size of the first packet.
  • the specific method may be: according to the second color and a preset update rule a configuration table, determine the update rule corresponding to the second color, and update the token quantity of the token bucket according to the update rule and the size of the first packet; the update rule configuration table includes the packet color Correspondence with update rules.
  • the number of tokens in the token bucket is updated according to the update rule and the size of the first packet.
  • the specific method may be as follows: when the update rule indicates to update the number of token buckets, The size of the first packet is subtracted from the number of token buckets to obtain the updated number of tokens in the token bucket. This can accurately update the number of tokens in the token bucket.
  • a fourth color of the first packet may also be obtained, where the fourth color is a color determined based on a second CAR instruction, and the second CAR instruction is the first CAR instruction
  • the upper-level instruction of the first message further, determine the second color of the first message according to the comparison result and the first color of the first message, and the specific method may be: according to the comparison result, the The first color and the fourth color of the first message determine the second color of the first message.
  • the color of the current-level packet can be determined based on the color result of the upper-level packet, thereby enabling flexible hierarchical CAR processing.
  • the second color of the first packet is determined according to the comparison result, the first color of the first packet, and the fourth color.
  • the specific method may be: according to the comparison result and a preset color configuration table, determine the fifth color corresponding to the comparison result, and determine the second color of the first packet according to the fifth color, the first color, and the fourth color ;
  • the color configuration table includes the correspondence between the first flag bit corresponding to the comparison result and the message color. In this way, the color of the current message can be determined by looking up the preset color configuration table, and then the final message color can be obtained, which can make the process of determining the color of the message more flexible, and the way of looking up the table can avoid a large number of calculation processes. Reduce implementation complexity.
  • the second color of the first packet is determined according to the fifth color, the first color and the fourth color
  • the specific method may be: when the first color, all the When both the fourth color and the five colors are green, the second color is determined to be green; when there is no red in the first color, the fourth color and the five colors, and there is at least one color that is When yellow, the second color is determined to be yellow; when at least one of the first color, the fourth color and the five colors is red, the second color is determined to be red. In this way, the second color of the first message can be determined flexibly and accurately.
  • the present application further provides an apparatus for processing a message, where the apparatus for processing a message is configured to implement the method in the first aspect or each possible design example of the first aspect.
  • the method may be implemented by hardware, or by executing corresponding software by hardware.
  • the hardware or software includes one or more modules corresponding to the above method.
  • the structure of the message processing apparatus may include an acquisition unit and a processing unit, and these units may perform the corresponding functions in the first aspect or each possible design example of the first aspect. For details, see The detailed description in the method example will not be repeated here.
  • the processing unit may include at least two sub-processing units, and any sub-processing unit may include a combinational logic module and a D flip-flop; in any two adjacent sub-processing units, the combinational logic of one sub-processing unit The module is connected to the D flip-flop of another sub-processing unit, and/or the D-flip-flop of one sub-processing unit is connected to the combinational logic module of the other sub-processing unit.
  • the combinational logic module of any one sub-processing unit may include one or more of the following devices: an adder, a subtractor, a multiplier or a divider; the devices included in the combinational logic module of any two sub-processing units may be same or not same.
  • the present application further provides an apparatus for processing a message
  • the structure of the apparatus for processing a message includes a processor and a memory
  • the processor is configured to support the apparatus for processing the message to perform the above Corresponding functionality in the first aspect or each possible design example of the first aspect.
  • the memory is coupled to the processor and stores program instructions and data necessary for the processing means of the message.
  • a computer-readable storage medium stores program instructions, and when the program instructions are executed on a computer, the computer can execute any possible design of the first aspect above.
  • a computer-readable storage medium can be any available medium that can be accessed by a computer.
  • computer readable media may include non-transitory computer readable media, random-access memory (RAM), read-only memory (ROM), electrically erasable Except programmable read only memory (electrically EPROM, EEPROM), CD-ROM or other optical disk storage, magnetic disk storage medium or other magnetic storage device, or capable of carrying or storing desired program code in the form of instructions or data structures and capable of Any other media accessed by a computer.
  • RAM random-access memory
  • ROM read-only memory
  • EEPROM electrically erasable Except programmable read only memory
  • CD-ROM or other optical disk storage magnetic disk storage medium or other magnetic storage device, or capable of carrying or storing desired program code in the form of instructions or data structures and capable of Any other media accessed by a computer.
  • embodiments of the present application provide a computer program product including computer program codes or instructions, which, when run on a computer, enables the computer to implement the first aspect or any of the possible designs of the first aspect. Methods.
  • the present application further provides a chip, including a processor, which is coupled to a memory and configured to read and execute program instructions stored in the memory, so that the chip implements the above-mentioned first aspect or The method described in any of the possible designs of the first aspect.
  • the present application further provides a chip, which may include a device for processing the message in the second aspect or the third aspect, so that the chip can implement any of the possible designs of the first aspect or the first aspect. the method described.
  • FIG. 1 is a schematic diagram of the architecture of a communication system provided by the present application.
  • FIG. 3 is a schematic diagram of a message processing process provided by the present application.
  • FIG. 5 is a schematic diagram of another message processing process provided by the present application.
  • FIG. 6 is a schematic structural diagram of a message processing device provided by the application.
  • FIG. 7 is a structural diagram of a message processing apparatus provided by the present application.
  • Embodiments of the present application provide a packet processing method and device, which are used to optimize the packet processing process using the CAR algorithm.
  • the methods and devices described in this application are based on the same technical concept. Since the methods and devices have similar principles for solving problems, the implementations of the devices and methods can be referred to each other, and repeated descriptions will not be repeated here.
  • the committed access rate (CAR) algorithm is mainly used to control the packet traffic during packet traffic policing.
  • the CAR algorithm uses the token bucket mechanism to control the rate of packets.
  • the CAR algorithm mainly includes the following two functions: (1) Traffic rate limit: By using the token bucket to measure the packets flowing through the port, only the traffic with the token can pass through within a certain period of time, thus realizing the rate limiting function; ( 2) Flow classification: measure the flow through the token bucket algorithm, and mark the packets with different flow classification internal marks (which may include service level and discard priority, etc.) according to the measurement results.
  • the CAR algorithm based on the token bucket algorithm can include three modes: single-speed single-bucket, single-speed double-bucket, and double-speed double-bucket.
  • the CAR algorithm also includes color blind mode and color sensitivity mode.
  • the color-blind mode is that the color of the packets is not affected by the color of the historical packets
  • the color-sensitive mode is that the color of the packets is based on the color of the historical packets.
  • each mode of the above CAR algorithm is explained in detail below:
  • the packet In color-sensitive mode, if the packet is marked green and B ⁇ Tc, the packet is marked green and forwarded, and the number of tokens in the token bucket decreases by B; if the packet is marked green and B >Tc, the packet is marked red, and the number of tokens in the token bucket remains unchanged; if the packet has been marked yellow or red, the packet is directly marked red, and the number of tokens in the token bucket remains unchanged.
  • C bucket and E bucket there are two token buckets, which can be called C bucket and E bucket respectively. Tokens are first put into C bucket at the rate of CIR. If C bucket is full, then tokens are put into E bucket at the rate of CIR. Until the number of E-bucket tokens reaches the extended burst size (EBS). The capacity of bucket C is recorded as CBS, and the capacity of bucket E is recorded as EBS. The number of tokens in bucket C is recorded as Tc, and the number of tokens in bucket E is recorded as Te.
  • EBS extended burst size
  • the two token buckets can be called C bucket and P bucket respectively.
  • the rate of adding tokens to the bucket is CIR and peak information rate (PIR)
  • the token capacity of bucket C is CBS
  • the token capacity of bucket P is peak burst size (peak burst size, PBS).
  • Bucket tokens are added independently of each other.
  • the number of tokens in bucket C is recorded as Tc
  • the number of tokens in bucket P is recorded as Tp.
  • the packet has been marked as yellow, only the P bucket is compared. For example, B ⁇ Tp, the packet is marked as yellow, and Tp is reduced by B, and Tc is unchanged. For example, B>Tp, the packet is marked as red, and Tp and Tc remain unchanged;
  • the result of the first CAR will affect the result of subsequent CARs (this mode only works in the color-sensitive mode ).
  • the result of the first CAR is that the color of the packet is yellow, then the result of the second CAR can only be yellow or red.
  • the above process can be called Hierarchy CAR (Hierarchy CAR, Hier-CAR).
  • the existing network generally needs to support the above-mentioned multiple CAR protocols when processing packets, and also needs to support the color-blind module and color-sensitive mode; support single-speed single-bucket, single-speed double-bucket, single-speed double-bucket mode; support Hier-CAR.
  • FIG. 1 shows a schematic diagram of the architecture of a possible communication system to which a packet processing method provided by an embodiment of the present application is applicable.
  • the communication system may include a message sending end 101 , at least one message forwarding end 102 and a message receiving end 103 .
  • the packet sending end 101 and the packet forwarding end 102 may use the CAR algorithm to control the packet traffic.
  • the message sending end 101 can be any device that sends messages; the message forwarding end 102 can be any device that forwards messages, such as switches, routers, etc.; the message receiving end 103 can be any device that forwards messages.
  • the device that receives the message This application does not limit the above-mentioned devices.
  • the message processing method may be implemented by a message processing device, and the message processing device may be the message sending end or the message forwarding end in FIG. 1 , or the message processing device It is a processor in the message sending end or the message forwarding end, or the message processing apparatus may also be other devices for processing messages.
  • a message processing apparatus is used as an example for implementing a message processing method for description.
  • FIG. 2 shows a flowchart of a packet processing method provided by an embodiment of the present application, which is applicable to the communication system shown in FIG. 1 .
  • the specific process of the method may include:
  • Step 201 The packet processing apparatus acquires a first CAR instruction, where the first CAR instruction includes the size and the first color of the first packet.
  • Step 202 The packet processing apparatus determines the number of tokens in the current token bucket, wherein the number of token buckets is one or two.
  • the specific method may be: the packet processing device determines the token at the first moment the initial value of the number of tokens in the bucket; then the packet processing device determines the updated value of the number of tokens in the token bucket at the second moment; then the packet processing device determines the updated value of the number of tokens in the token bucket at the second moment; The updated value determines the current number of tokens in the token bucket. Specifically, the packet processing apparatus subtracts the initial value from the updated value to obtain the number of tokens in the current token bucket.
  • the token bucket may be a C bucket, or the token bucket may include a C bucket and an E bucket, or the token bucket may include a C bucket and a P bucket.
  • the packet processing device determines the number of tokens in the current token bucket, it refers to determining the current number of tokens in the two buckets respectively.
  • the packet processing device determines the initial value of the number of tokens in the C bucket at the first moment and the difference between the number of tokens in the E bucket initial value; then the message processing device determines the updated value of the number of tokens in the C bucket and the updated value of the number of tokens in the E bucket at the second moment; then the message processing device according to the The initial value in the C bucket and the updated value in the C bucket determine the number of tokens in the current C bucket, and determine the current number of tokens in the C bucket according to the initial value in the E bucket and the updated value in the E bucket number of tokens.
  • the token bucket includes a C bucket and a P bucket
  • the principle of respectively determining the number of tokens in the two current buckets is the same as when the token bucket includes a C bucket and an E bucket , can refer to each other, and will not be described in detail here.
  • Step 203 The packet processing apparatus compares the size of the first packet and the number of tokens to obtain a comparison result.
  • the device for processing the packet may first convert the size unit of the first packet into a command number of cards. In this way, after the size unit of the first packet is the same as the token quantity unit, the comparison between the two can be simplified and the comparison efficiency can be improved.
  • the optional above-mentioned unit conversion process may be referred to as a pre-process.
  • the packet processing apparatus compares the size of the first packet and each token bucket respectively when performing step 203 The number of tokens in , get the corresponding comparison result.
  • the token bucket includes a C bucket and an E bucket
  • the packet processing device needs to compare the size of the first packet with the number of tokens in the C bucket to obtain a corresponding first comparison result, and also A corresponding second comparison result is obtained by comparing the size of the first packet and the number of tokens in the E bucket.
  • the token bucket includes the C bucket and the P bucket, it is the same as when the token bucket includes the C bucket and the E bucket, which can be referred to each other, and will not be described in detail here.
  • Step 204 The packet processing apparatus determines the second color of the first packet according to the comparison result and the first color of the first packet.
  • the message processing apparatus may determine a third color corresponding to the comparison result according to the comparison result and a preset color configuration table, and determine the third color corresponding to the comparison result according to the third color and the preset color configuration table.
  • the first color of the first message determines the second color of the first message.
  • the color configuration table may include the correspondence between the first flag bit corresponding to the comparison result and the message color.
  • the first flag bit may be 0 or 1.
  • the comparison result corresponding to each token bucket corresponds to a first flag bit. Due to different CAR protocols, the colors of the packets corresponding to the comparison results may be different. Therefore, you can configure the packet colors for different protocols.
  • the color configuration table may be as shown in Table 1 below:
  • the third color corresponding to the comparison result can be found through the second and fourth columns in Table 1,
  • the third color is determined by the first bit in the flag bits in the second column and the fourth column in Table 1. For example, when the comparison result is that the size of the first packet is greater than the number of tokens, and the first flag bit corresponding to the comparison result corresponding to the C bucket is 0, it is determined that the third color is red; when When the comparison result is that the size of the first packet is less than or equal to the number of tokens, and the first flag bit corresponding to the comparison result corresponding to the C bucket is 1, it is determined that the third color is green.
  • the two bits in the first flag bits in Table 1 are respectively the first flag bits corresponding to the comparison results corresponding to the two token buckets.
  • the two token buckets are bucket C and bucket E, assuming that under the SrTCM protocol, when the first comparison result corresponding to bucket C is that the size of the first packet is greater than the number of tokens in bucket C, the The first flag bit corresponding to the first comparison result corresponding to the C bucket is 0, otherwise it is 1; when the second comparison result corresponding to the E bucket is that the size of the first packet is greater than the number of tokens in the E bucket, the E bucket The first flag bit corresponding to the second comparison result corresponding to the bucket is 0, otherwise it is 1.
  • the first flag bits corresponding to the comparison results corresponding to the two token buckets can be obtained to jointly determine the third color. For example, when the first flag corresponding to the first comparison result corresponding to the C bucket When the bit is 0, and the first flag bit corresponding to the second comparison result corresponding to the E bucket is 1, the third color is yellow.
  • the method of looking up the table to obtain the packet color is the same as the principle of looking up the table to obtain the packet color when the two token buckets are the C bucket and the E bucket. Describe in detail.
  • the first flag bit corresponding to the C bucket is the first first flag bit.
  • the colors corresponding to different protocols in the color configuration table shown in Table 1 can be pre-configured.
  • the protocols in the table can be existing protocols, user-defined protocols, or future protocols can be added in the future. Agreement, this application is not limited here. In this way, the flexible configuration of the color configuration table can be realized, and the programmability of the CAR protocol can be realized.
  • the packet processing apparatus determines the first color according to the third color and the first color of the first packet
  • the second color of the packet may specifically include the following situations: when the first color is green and the third color is green, the processing device of the packet determines that the second color is green; when the second color is green; When the first color is green and the third color is yellow, the packet processing device determines that the second color is yellow; when the first color is green and the third color is red, the The message processing device determines that the second color is red; when the first color is yellow and the third color is green, the message processing device determines that the second color is yellow; when When the first color is yellow and the third color is yellow, the message processing device determines that the second color is yellow; when the first color is yellow and the third color is red , the message processing device determines that the second color is red; when the first color is red and the third color is green, the message processing device determines that the second color is red; when the first color is red and the third color is green, the message processing device determines that the second color
  • the packet processing device determines the first packet based on the first CAR instruction.
  • the color after CAR processing at the current level can be obtained based on the color determined after the previous CAR processing.
  • the message processing device may also acquire a fourth color of the first message, where the fourth color is a color determined based on a second CAR instruction, and the second CAR instruction is the first color An upper-level instruction of a CAR instruction; at this time, the processing device of the message may determine the second color.
  • the message processing apparatus determines a fifth color corresponding to the comparison result according to the comparison result and the color configuration table, and determines the fifth color corresponding to the comparison result according to the fifth color, the first color and the first color. Four colors determine the second color of the first message.
  • the method for determining the fifth color corresponding to the comparison result according to the comparison result and the color configuration table by the message processing apparatus is the same as the above-mentioned method for processing the message according to the comparison result.
  • the color configuration table, the method for determining the third color corresponding to the comparison result is the same, which can be referred to each other for details, and will not be described in detail here.
  • the message processing device may determine that the second color is green; when none of the first color, the fourth color, and the fifth color is green When red and there is at least one color that is yellow, the packet processing device may determine that the second color is yellow; when there is at least one color among the first color, the fourth color, and the five colors that is When the color is red, the device for processing the message may determine that the second color is red.
  • the packet processing device determines the first packet based on the first CAR instruction. After the second color, the packet processing apparatus may transmit the determined second color to the processing process of the next-level CAR instruction (for example, the third CAR instruction), so that the packet processing apparatus is based on
  • the color of the first packet is determined on the basis that the first packet is of the second color.
  • the process principle of the packet processing device processing the packet based on the third CAR instruction is similar to the process principle of the packet processing device processing the packet based on the first CAR instruction. Describe in detail.
  • the packet processing apparatus can implement processing that supports flexible Hierarchy-CAR when processing the packet.
  • the color determination process of the message in the process of each level of CAR algorithm may be performed in the same clock, or the following One stage is performed at the next clock of the previous stage, which can improve the working performance.
  • the above process of determining the second color of the first packet may be referred to as a process of discarding judgment and color generation (check), and when it is determined that the second color is yellow or red, the first packet may not be forwarded. message, it can be understood that the first message is discarded.
  • Step 205 The packet processing apparatus updates the number of tokens in the token bucket according to the second color and the size of the first packet.
  • the packet processing apparatus may determine the update rule corresponding to the second color according to the second color and a preset update rule configuration table, and determine the update rule corresponding to the second color according to the update rule and the size of the first packet to update the number of tokens in the token bucket; the update rule configuration table may include a correspondence between packet colors and update rules. Specifically, when the update rule indicates the number of updated token buckets, the packet processing device subtracts the size of the first packet from the number of token buckets to obtain the updated token bucket number of tokens.
  • the update rules corresponding to the packet colors may be different, so the update rules can be configured for different protocols.
  • the update rule can be indicated by the update indication bit.
  • the update indication bit "1" can be used to indicate that the update rule instructs the number of token buckets to be updated, that is, the number of token buckets is indicated to be reduced by the number of token buckets.
  • the size of the packet; the update instruction bit "0" indicates that the update rule indicates not to update the number of token buckets, that is, it indicates that the number of tokens in the token bucket remains unchanged.
  • the update rule configuration table may be as shown in Table 2 below:
  • the update rule corresponding to the second color is searched through Table 2, wherein the update rule is each column in Table 2
  • the update rule corresponding to the first bit of the update flag in For example, when the second color is green, the update flag corresponding to the update rule of the C bucket corresponding to green is "1", which indicates that the number of tokens in the C bucket is reduced by the size of the first packet ; When the second color is yellow or red, the update flag bit corresponding to the update rule of the C bucket corresponding to yellow or red is "0", indicating that the number of tokens in the C bucket remains unchanged.
  • the two update flag bits corresponding to each color in Table 2 are respectively update flag bits corresponding to the update rules corresponding to the two token buckets.
  • the two token buckets are bucket C and bucket E, assuming that under the SrTCM protocol, when the second color is green, the determined update flag corresponding to the update rule is "10", indicating that The number of tokens in bucket C is reduced by the size of the first packet, and the number of tokens in bucket E remains unchanged; when the second color is yellow, and the update flag corresponding to the determined update rule is "01”, then Indicate that the number of tokens in bucket C remains unchanged, and the number of tokens in bucket E decreases by the size of the first packet; when the second color is red, the update flag corresponding to the determined update rule is "00", It indicates that the number of tokens in bucket C remains unchanged, and the number of tokens in bucket E also remains unchanged.
  • the method of looking up the table to obtain the update rules is the same as the principle of looking up the table to obtain the update rules when the two token buckets are C buckets and E buckets, and will not be detailed here. describe.
  • the update flags corresponding to the update rules corresponding to different protocols in the finer rule configuration table shown in Table 2 can be pre-configured.
  • the protocols in the table can be existing protocols or user-defined protocols. , or a future protocol can be added in the future, which is not limited in this application. In this way, the flexible configuration of the update rule configuration table can be realized, and the programmability of the CAR protocol can be realized.
  • the above process of updating the number of tokens in the token bucket may be referred to as a process of generating a new token tick (update).
  • the message processing device when the message processing device processes the message based on the CAR, it can realize the processing of the CAR instruction based on a plurality of divided steps, and it can also be understood as splitting the CAR algorithm used when processing the message, This reduces the complexity of processing packets based on the CAR algorithm and improves processing performance.
  • the process of processing the message based on the CAR instruction by the apparatus for processing the message may be divided into multiple pipeline steps, and the multiple steps may be completed in different multiple clocks.
  • the packet processing apparatus may implement the processing of the packet through the processing procedure shown in FIG. 3 .
  • the processing procedure shown in FIG. 3 may be to process the message through steps 0 to 5 after the device for processing the message obtains the CAR instruction.
  • step 0 may be a preprocessing process, and specifically may be a process in which the message processing apparatus mentioned in the above step 203 converts the size unit of the first message into a token quantity unit;
  • step 1 can be a token value (tick) calculation (tick calc) process, and specifically can be the process of determining the initial value of the number of tokens in the token bucket at the first moment by the processing device of the message mentioned in the above step 202.
  • process may be a refresh process (refresh), that is, refreshing the number of tokens in the token bucket, and specifically may be that the packet processing device mentioned in the above step 202 determines the token bucket at the second moment.
  • the process of updating the value of the number of cards; Step 3 may be color generation (check), which may specifically include that the processing device of the message involved in the above method embodiment determines the current token bucket according to the initial value and the updated value the number of tokens in the first packet, compare the size of the first packet with the number of tokens, obtain a comparison result, and determine the first packet according to the comparison result and the first color of the first packet
  • Step 4 may be the process of generating a new tick value (uptake), which may specifically be the process mentioned in Step 205 above.
  • a preset color configuration table needs to be searched
  • a preset update rule configuration table needs to be searched.
  • the process in each step can be realized by a combinational logic module, and a D flip-flop can be used to perform clock translation between each two steps to make the two
  • Each step can be completed in different clocks, which can reduce the complexity of processing packets based on the CAR algorithm and improve the processing performance.
  • the combinational logic module in each step can be any one or more devices of an adder, a subtractor, a multiplier or a divider, and the device composition of the combinational logic module in any two steps can be the same as required or different.
  • the packet processing device can flexibly process the packets through simple logic modules and clock translation, reduce the complexity of processing packets based on the CAR algorithm, and improve processing performance.
  • the packet processing process may include fewer or more steps than those in FIG. 3 , which is not limited in this application.
  • the packet processing apparatus may support Hierarchy-CAR processing when processing packets.
  • the Hierarchy-CAR function is implemented by concatenating the results of the packet color obtained in step 3 (check).
  • the first-level CAR instruction in step 3 (check) (CAR instruction 0 in FIG. 4 ) mainly completes the color configuration table based on lookup (not shown in FIG. 4 ).
  • the color is sent to step 3 of the next level CAR instruction (CRA instruction 1 in Figure 4), the next level obtains the message color of this level on this basis, and then Then pass to the next level (CAR instruction 2 in Figure 4).
  • CRA instruction 1 in Figure 4 the next level CAR instruction
  • CAR instruction 2 in Figure 4 the next level
  • each CAR instruction is the same as the processing process shown in Figure 3, except that the instruction result of the previous level needs to be referred to from the second-level CAR instruction in step 3 is different.
  • the same steps of multiple CAR instructions can be completed in the same clock.
  • step 0 of CAR instruction 0, CAR instruction 1 and CAR instruction 2 are all completed in the same clock, and the same is true for other steps. That is, within the same clock, the message processing device can process the same operations of different instructions, so that after the processing of multiple CAR instructions is finally completed, the average processing time of each CAR instruction is shorter, that is, in a few days.
  • the processing of multiple CAR instructions can be completed together within one clock, which can meet the line-speed operation under the high-frequency operating clock.
  • the packet processing device may obtain the value of each two-stage step3(check) through D flip-flops based on the processing process shown in FIG. 4 .
  • the clock is shifted, as shown in Figure 5.
  • the message processing process is shown in FIG. In this way, the purpose of supporting a higher operating frequency can be achieved, and at the same time, the logic depth of each stage of the pipeline can be reduced by splitting the pipeline without affecting the performance.
  • FIG. 4 and FIG. 5 only take the three-level CAR instruction as an example for description.
  • it may also be a two-level CAR instruction or a CAR instruction with more than three levels, which is not limited in this application.
  • the basic structure of the message processing apparatus may be composed of the structures and connection relationships shown in the schematic diagrams of the message processing process shown in FIG. 3 , FIG. 4 , or FIG. 5 .
  • the embodiments of the present application further provide a packet processing apparatus, which is used to implement the packet processing methods provided by the embodiments of the present application.
  • the packet processing apparatus 600 may include an obtaining unit 601 and a processing unit 602 . in:
  • the obtaining unit 601 may be configured to obtain the first committed access rate CAR instruction, where the first CAR instruction includes the size and the first color of the first packet; the processing unit 602 may be configured to determine the number of tokens, wherein the number of token buckets is one or two; compare the size of the first packet and the number of tokens to obtain a comparison result; according to the comparison result and the first packet of the first packet A color determines the second color of the first packet; the number of tokens in the token bucket is updated according to the second color and the size of the first packet.
  • the processing unit 602 when determining the number of tokens in the current token bucket, is specifically configured to: determine the initial value of the number of tokens in the token bucket at the first moment; determine The updated value of the number of tokens in the token bucket at the second moment; the number of tokens in the current token bucket is determined according to the initial value and the updated value.
  • the processing unit 602 may be further configured to: convert the size unit of the first packet into a token quantity unit before comparing the size of the first packet and the token quantity.
  • the processing unit 602 when determining the second color of the first packet according to the comparison result and the first color of the first packet, is specifically configured to: according to the comparison result and a preset the color configuration table, determine the third color corresponding to the comparison result; the color configuration table includes the correspondence between the first flag bit corresponding to the comparison result and the message color; according to the third color and the third color The first color of a message determines the second color of the first message.
  • the processing unit 602 when determining the second color of the first packet according to the third color and the first color of the first packet, is specifically configured to: when the first color is is green, when the third color is green, the second color is determined to be green; when the first color is green, and the third color is yellow, the second color is determined to be yellow; when all When the first color is green and the third color is red, the second color is determined to be red; when the first color is yellow and the third color is green, the second color is determined to be yellow; when the first color is yellow and the third color is yellow, determine that the second color is yellow; when the first color is yellow and the third color is red, determine the The second color is red; when the first color is red and the third color is green, the second color is determined to be red; when the first color is red and the third color is yellow , determine that the second color is red; when the first color is red and the third color is red, determine that the second color is red.
  • the processing unit 602 when updating the number of tokens in the token bucket according to the second color and the size of the first packet, is specifically configured to: according to the second color and a preset Update the rule configuration table, and determine the update rule corresponding to the comparison result; the update rule configuration table includes the correspondence between the message color and the update rule; update the command according to the update rule and the size of the first message The number of tokens in the bucket.
  • the processing unit 602 when the processing unit 602 updates the number of tokens in the token bucket according to the update rule and the size of the first packet, the processing unit 602 is specifically configured to: when the update rule instructs to update the token bucket. When the number of tokens is equal, the size of the first packet is subtracted from the number of token buckets to obtain the updated number of tokens in the token bucket.
  • the processing unit 602 is further configured to: acquire a fourth color of the first packet, where the fourth color is a color determined based on the second CAR instruction, and the fourth color is a color determined based on the second CAR instruction.
  • the second CAR instruction is an upper-level instruction of the first CAR instruction; further, the processing unit 602 determines the first packet of the first packet according to the comparison result and the first color of the first packet When there are two colors, it is specifically used for: determining the second color of the first packet according to the comparison result, the first color and the fourth color of the first packet.
  • the processing unit 602 determines the second color of the first packet according to the comparison result, the first color of the first packet, and the fourth color
  • the processing unit 602 is specifically configured to:
  • the comparison result and the preset color configuration table determine the fifth color corresponding to the comparison result;
  • the color configuration table includes the corresponding relationship between the first flag bit and the message color corresponding to the comparison result; according to the fifth color
  • the color, the first color and the fourth color determine a second color of the first message.
  • the processing unit 602 when determining the second color of the first packet according to the fifth color, the first color and the fourth color, the processing unit 602 is specifically configured to: when the first color , when the fourth color and the five colors are all green, the second color is determined to be green; when there is no red in the first color, the fourth color and the five colors and there is at least one color When it is yellow, the second color is determined to be yellow; when at least one of the first color, the fourth color and the five colors is red, the second color is determined to be red.
  • the processing unit 602 may include at least two sub-processing units, and any sub-processing unit includes a combinational logic module and a D flip-flop; wherein, among any two adjacent sub-processing units, one sub-processing unit The combinational logic module is connected to the D flip-flop of another sub-processing unit, and/or the D flip-flop of one sub-processing unit is connected to the combinational logic module of another sub-processing unit.
  • the combinational logic module of any sub-processing unit may include one or more of the following devices: an adder, a subtractor, a multiplier or a divider; the components included in the combinational logic module of any two sub-processing units may be the same or different. .
  • the processing unit 602 may include the structure shown in FIG. 3 , FIG. 4 or FIG. 5 .
  • Any sub-processing unit may correspond to any one of the steps in FIG. 3 , FIG. 4 or FIG. 5 , and respectively implement the method in the corresponding step.
  • each functional unit in the embodiments of the present application may be integrated into one processing unit, or each unit may exist physically alone, or two or more units may be integrated into one unit.
  • the above-mentioned integrated units may be implemented in the form of hardware, or may be implemented in the form of software functional units.
  • the integrated unit if implemented in the form of a software functional unit and sold or used as an independent product, may be stored in a computer-readable storage medium.
  • the technical solutions of the present application can be embodied in the form of software products in essence, or the parts that contribute to the prior art, or all or part of the technical solutions, and the computer software products are stored in a storage medium , including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) or a processor (processor) to execute all or part of the steps of the methods described in the various embodiments of the present application.
  • the aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), magnetic disk or optical disk and other media that can store program codes .
  • the embodiments of the present application further provide a packet processing apparatus, which is used to implement the packet processing methods provided by the embodiments of the present application.
  • the apparatus 700 for processing the message may include one or more processors 701 and a memory 702 .
  • the memory 702 can be used to store computer program codes, and the computer program codes include computer instructions, and the processor 701 can be used to invoke the computer instructions in the memory 702 to execute various operations in the above message processing method.
  • the execution process of the processor 701 reference may be made to the relevant description in the foregoing packet processing method, which will not be described in detail here.
  • the message processing apparatus 700 may further include a bus 703 .
  • the processor 701 and the memory 702 may communicate through the bus 703, and may also communicate through other means such as wireless transmission.
  • the bus 703 may be a peripheral component interconnect standard (Peripheral Component Interconnect, PCI) bus or an Extended Industry Standard Architecture (Extended Industry Standard Architecture, EISA) bus or the like.
  • PCI peripheral component interconnect standard
  • EISA Extended Industry Standard Architecture
  • the bus can be divided into an address bus, a data bus, a control bus, and the like. For ease of presentation, only one thick line is used in FIG. 7, but it does not mean that there is only one bus or one type of bus.
  • the processor 701 may include the structure shown in FIG. 3 , FIG. 4 or FIG. 5 .
  • the embodiments of the present application further provide a computer-readable storage medium, where the computer-readable storage medium is used to store a computer program, and when the computer program is executed by a computer, the computer can implement the methods provided by the above-mentioned embodiments.
  • the processing method of any kind of message is not limited to, but not limited to, but not limited to, but not limited to, but not limited to, but not limited to, but not limited to, but not limited to store a computer program, and when the computer program is executed by a computer, the computer can implement the methods provided by the above-mentioned embodiments.
  • the processing method of any kind of message is any kind of message.
  • An embodiment of the present application further provides a computer program product, where the computer program product is used to store a computer program, and when the computer program is executed by a computer, the computer can implement any one of the packet processing methods provided in the foregoing method embodiments. .
  • An embodiment of the present application further provides a chip, including a processor, which is coupled to a memory and configured to call a program in the memory so that the chip implements any message processing method provided by the foregoing method embodiments .
  • An embodiment of the present application further provides a chip, including the apparatus for the foregoing message, for implementing any message processing method provided in the foregoing method embodiment.
  • the embodiments of the present application may be provided as a method, a system, or a computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) having computer-usable program code embodied therein.
  • computer-usable storage media including, but not limited to, disk storage, CD-ROM, optical storage, etc.
  • These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory result in an article of manufacture comprising instruction means, the instructions
  • the apparatus implements the functions specified in the flow or flow of the flowcharts and/or the block or blocks of the block diagrams.

Landscapes

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

Abstract

一种报文的处理方法及装置,用以优化采用CAR算法对报文的处理过程。该方法为:获取第一承诺访问速率CAR指令,所述第一CAR指令包括第一报文的大小和第一颜色;确定当前令牌桶中的令牌数量,其中所述令牌桶为一个或者两个;比较所述第一报文的大小和所述令牌数量,得到比较结果;根据所述比较结果和所述第一报文的第一颜色确定所述第一报文的第二颜色;根据所述第二颜色和所述第一报文的大小更新所述令牌桶的令牌数量。

Description

一种报文的处理方法及装置
相关申请的交叉引用
本申请要求在2020年12月15日提交中国专利局、申请号为202011478983.1、申请名称为“一种报文的处理方法及装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及通信技术领域,尤其涉及一种报文的处理方法及装置。
背景技术
目前,通常在进行报文流量监管时主要采用承诺访问速率(committed access rate,CAR)算法来对报文流量进行控制。所述CAR算法是利用令牌桶机制来控制报文的速率。具体的,所述CAR算法包括以下两个功能:(1)流量速率限制:通过使用令牌桶对流经端口的报文进行度量,使得在特定时间内只有得到令牌的流量通过,从而实现限速功能;(2)流分类:通过令牌桶算法对流量进行测量,根据测量结果给报文打上不同的流分类内部标记(包括服务等级与丢弃优先级等)。
目前基于CAR算法的方案实现至少需要2级减法器,1级比较器和1级加法器,还需要支持CAR算法的不同模式引入的选择器。随着当前芯片工作时钟不断提升,CAR算法难以在1个时钟周期完成运算。以16纳米(nm)工艺1GHz为例,需要4个时钟周期才能完成1次CAR计算。因此,当前采用CAR算法实现报文速率的控制的性能较低。
发明内容
本申请提供一种报文的处理方法及装置,用以优化采用CAR算法对报文的处理过程。
第一方面,本申请提供了一种报文的处理方法,该方法可以包括:获取第一CAR指令,所述第一CAR指令包括第一报文的大小和第一颜色;确定当前令牌桶中的令牌数量,并比较所述第一报文的大小和所述令牌数量,得到比较结果;然后根据所述比较结果和所述第一报文的第一颜色确定所述第一报文的第二颜色,以及根据所述第二颜色和所述第一报文的大小更新所述令牌桶的令牌数量;其中所述令牌桶为一个或者两个。
通过上述方法,在基于CAR对报文进行处理时,可以将CAR的处理过程进行拆分,从而可以降低基于CAR算法处理报文的复杂度,进而可以提升处理性能。
在一个可能的设计中,确定当前令牌桶中的令牌数量,具体方法可以为:确定第一时刻所述令牌桶中令牌数量的初始值;确定第二时刻所述令牌桶中令牌数量的更新值;根据所述初始值和所述更新值确定当前令牌桶中的令牌数量。这样可以准确地确定所述令牌桶中的数量,并且实现方法较简单。
在一个可能的设计中,在比较所述第一报文的大小和所述令牌数量之前,还可以将所述第一报文的大小单位转换成令牌数量单位。这样在所述第一报文的大小单位与所述令牌数量单位相同后,在两者比较时较简单,可以提高比较效率。
在一个可能的设计中,根据所述比较结果和所述第一报文的第一颜色确定所述第一报文的第二颜色,具体方法可以为:根据所述比较结果以及预设的颜色配置表,确定所述比较结果对应的第三颜色,并根据所述第三颜色和所述第一报文的第一颜色确定所述第一报文的第二颜色;所述颜色配置表包括所述比较结果对应的第一标志位与报文颜色的对应关系。这样可以通过查找预设的颜色配置表确定当前报文的颜色后,再得到最终的报文颜色,可以使报文的颜色确定比较灵活,并且查找表的方式可以避免大量的计算过程,可以降低实现复杂度。
在一个可能的设计中,根据所述第三颜色和所述第一报文的第一颜色确定所述第一报文的第二颜色,具体方法可以为:当所述第一颜色为绿色,所述第三颜色为绿色时,确定所述第二颜色为绿色;当所述第一颜色为绿色,所述第三颜色为黄色时,确定所述第二颜色为黄色;当所述第一颜色为绿色,所述第三颜色为红色时,确定所述第二颜色为红色;当所述第一颜色为黄色,所述第三颜色为绿色时,确定所述第二颜色为黄色;当所述第一颜色为黄色,所述第三颜色为黄色时,确定所述第二颜色为黄色;当所述第一颜色为黄色,所述第三颜色为红色时,确定所述第二颜色为红色;当所述第一颜色为红色,所述第三颜色为绿色时,确定所述第二颜色为红色;当所述第一颜色为红色,所述第三颜色为黄色时,确定所述第二颜色为红色;当所述第一颜色为红色,所述第三颜色为红色时,确定所述第二颜色为红色。这样可以准确地确定所述第一报文的第二颜色。
在一个可能的设计中,根据所述第二颜色和所述第一报文的大小更新所述令牌桶的令牌数量,具体方法可以为:根据所述第二颜色以及预设的更新规则配置表,确定所述第二颜色对应的更新规则,并根据所述更新规则和所述第一报文的大小更新所述令牌桶的令牌数量;所述更新规则配置表包括报文颜色与更新规则的对应关系。这样可以通过查找表的方式实现对令牌桶的令牌数量的更新,实现比较灵活,并且查找表的方式可以避免大量的计算过程,可以降低实现复杂度。
在一个可能的设计中,根据所述更新规则和所述第一报文的大小更新所述令牌桶的令牌数量,具体方法可以为:当所述更新规则指示更新令牌桶数量时,用所述令牌桶数量减去所述第一报文的大小,得到更新后的所述令牌桶的令牌数量。这样可以准确地更新所述令牌桶中的令牌数量。
在一个可能的设计中,还可以获取到所述第一报文的第四颜色,所述第四颜色为基于第二CAR指令确定的颜色,所述第二CAR指令为所述第一CAR指令的上一级指令;进一步地,根据所述比较结果和所述第一报文的第一颜色确定所述第一报文的第二颜色,具体方法可以为:根据所述比较结果、所述第一报文的第一颜色和所述第四颜色确定所述第一报文的第二颜色。这样可以基于上一级报文的颜色结果来确定本级报文的颜色,从而可以实现支持灵活地层级化的CAR处理。
在一个可能的设计中,根据所述比较结果、所述第一报文的第一颜色和所述第四颜色确定所述第一报文的第二颜色,具体方法可以为:根据所述比较结果以及预设的颜色配置表,确定所述比较结果对应的第五颜色,并根据所述第五颜色、所述第一颜色和所述第四颜色确定所述第一报文的第二颜色;所述颜色配置表包括比较结果对应的第一标志位与报文颜色的对应关系。这样可以通过查找预设的颜色配置表确定当前报文的颜色后,再得到最终的报文颜色,可以使报文的颜色确定过程比较灵活,并且查找表的方式可以避免大量的计算过程,可以降低实现复杂度。
在一个可能的设计中,根据所述第五颜色、所述第一颜色和所述第四颜色确定所述第一报文的第二颜色,具体方法可以为:当所述第一颜色、所述第四颜色和所述五颜色均为绿色时,确定所述第二颜色为绿色;当所述第一颜色、所述第四颜色和所述五颜色中没有红色、且存在至少一个颜色为黄色时,确定所述第二颜色为黄色;当所述第一颜色、所述第四颜色和所述五颜色中存在至少一个颜色为红色时,确定所述第二颜色为红色。这样可以灵活且准确地确定所述第一报文的第二颜色。
第二方面,本申请还提供了一种报文的处理装置,该报文的处理装置用于实现上述第一方面或第一方面的各个可能的设计示例中的方法。所述方法可以通过硬件实现,也可以通过硬件执行相应的软件实现。所述硬件或软件包括一个或多个与上述方法相对应的模块。
在一个可能的设计中,所述报文的处理装置的结构中可以包括获取单元和处理单元,这些单元可以执行上述第一方面或第一方面的各个可能的设计示例中的相应功能,具体参见方法示例中的详细描述,此处不做赘述。
在一个可能的设计中,所述处理单元可以包括至少两个子处理单元,任一个子处理单元可以包括组合逻辑模块和D触发器;任意相邻两个子处理单元中,一个子处理单元的组合逻辑模块连接另一子处理单元的D触发器,和/或一个子处理单元的D触发器连接另一子处理单元的组合逻辑模块。
在一个可能的设计中,任一个子处理单元的组合逻辑模块可以包括以下一个或多个器件:加法器、减法器、乘法器或除法器;任意两个子处理单元的组合逻辑模块包括的器件可以相同或者不相同。
第三方面,本申请还提供了一种报文的处理装置,所述报文的处理装置的结构中包括处理器和存储器,所述处理器被配置为支持所述报文的处理装置执行上述第一方面或第一方面的各个可能的设计示例中的相应的功能。所述存储器与所述处理器耦合,其保存所述报文的处理装置必要的程序指令和数据。
第四方面,本申请实施例提供的一种计算机可读存储介质,该计算机可读存储介质存储有程序指令,当程序指令在计算机上运行时,使得计算机执行上述第一方面任一可能的设计。示例性的,计算机可读存储介质可以是计算机能够存取的任何可用介质。以此为例但不限于:计算机可读介质可以包括非瞬态计算机可读介质、随机存取存储器(random-access memory,RAM)、只读存储器(read-only memory,ROM)、电可擦除可编程只读存储器(electrically EPROM,EEPROM)、CD-ROM或其他光盘存储、磁盘存储介质或者其他磁存储设备、或者能够用于携带或存储具有指令或数据结构形式的期望的程序代码并能够由计算机存取的任何其他介质。
第五方面,本申请实施例提供一种包括计算机程序代码或指令的计算机程序产品,当其在计算机上运行时,使得计算机实现上述第一方面或第一方面任一种可能的设计中所述的方法。
第六方面,本申请还提供一种芯片,包括处理器,所述处理器与存储器耦合,用于读取并执行所述存储器中存储的程序指令,以使所述芯片实现上述第一方面或第一方面任一种可能的设计中所述的方法。
第七方面,本申请还提供一种芯片,可以包括第二方面或第三方面中的报文的处理装置,以使所述芯片实现上述第一方面或第一方面任一种可能的设计中所述的方法。
上述第二方面至第七方面中的各个方面以及各个方面的可能设计可能达到的技术效 果请参照上述针对第一方面中的各种可能方案可以达到的技术效果说明,这里不再重复赘述。
附图说明
图1为本申请提供的一种通信系统的架构示意图;
图2为本申请提供的一种报文的处理方法的流程图;
图3为本申请提供的一种报文的处理过程的示意图;
图4为本申请提供的另一种报文的处理过程的示意图;
图5为本申请提供的另一种报文的处理过程的示意图;
图6为本申请提供的一种报文的处理装置的结构示意图;
图7为本申请提供的一种报文的处理装置的结构图。
具体实施方式
下面将结合附图对本申请作进一步地详细描述。
本申请实施例提供一种报文的处理方法及装置,用以优化采用CAR算法对报文的处理过程。其中,本申请所述方法和装置基于同一技术构思,由于方法及装置解决问题的原理相似,因此装置与方法的实施可以相互参见,重复之处不再赘述。
在本申请中,“示例性的”、“在一种可选的实施方式中”、“在另一种可选的实施方式中”等用于表示作例子、例证或说明。本申请中被描述为“示例”的任何实施例或设计方案不应被解释为比其它实施例或设计方案更优选或更具优势。确切而言,使用示例的一词旨在以具体方式呈现概念。
本申请实施例中的“至少一个”只一个或多个,“多个”是指两个或两个以上。
本申请实施例中“和/或”,描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。字符“/”一般表示前后关联对象是一种“或”的关系。
另外,本申请中涉及的“第一”、“第二”等词汇,仅用于区分描述的目的,而不能理解为指示或暗示相对重要性或者隐含指明所指示的技术特征的数量,也不能理解为指示或暗示顺序。
下面,为便于理解,先对本申请涉及的CAR算法进行解释说明:
通常在进行报文流量监管时主要采用承诺访问速率(committed access rate,CAR)算法来对报文流量进行控制。所述CAR算法是利用令牌桶机制来控制报文的速率。
CAR算法主要包括以下两个功能:(1)流量速率限制:通过使用令牌桶对流经端口的报文进行度量,使得在特定时间内只有得到令牌的流量通过,从而实现限速功能;(2)流分类:通过令牌桶算法对流量进行测量,根据测量结果给报文打上不同的流分类内部标记(可以包括服务等级与丢弃优先级等)。
CAR算法基于令牌桶算法可以包括三种模式:单速单桶,单速双桶,双速双桶。同时CAR算法还包括色盲模式和色敏模式。其中,色盲模式是报文染色不受历史报文颜色影响,色敏模式是报文染色是基于历史报文颜色进行。具体的,以下对上述CAR算法的各个模式进行详细解释:
A1、单速单桶模式。
单速单桶模式下只有一个令牌桶,令牌桶中的令牌以承诺信息速率(committed information rate,CIR)的速率增加,当令牌桶中的令牌数量达到承诺突发尺寸(committed burst size,CBS)时,令牌桶中的令牌数量不再增加,令牌桶中的可用令牌数量记为Tc。
当到达一个大小为B的报文后:
在色盲模式下,如B≤Tc,则报文被标记为绿色并转发,令牌桶中的令牌数量减少B;如B>Tc,则报文被标记为红色,令牌桶中令牌数量不变。
在色敏模式下,如报文已被标记为绿色且B≤Tc,则报文被标记为绿色并转发,令牌桶中的令牌数量减少B;如报文已被标记为绿色且B>Tc,报文被标记为红色,令牌桶中令牌数量不变;如报文已经被标记为黄色或者红色,则直接把报文标记红色,令牌桶中令牌数量不变。
A2、单速双桶模式。
单速双桶模式下有两个令牌桶,可以分别称为C桶和E桶,令牌先以CIR的速率向C桶投放,如C桶满了,再以CIR的速率向E桶投放直至E桶令牌数量达到超额突发尺寸(extended burst size,EBS)。C桶容量记为CBS,E桶容量记为EBS。C桶中令牌数量记为Tc,E桶中令牌数量记为Te。
当到达一个大小为B的报文后:
在色盲模式下:
如果B≤Tc,则报文被标记为绿色,且Tc减少B;
如果Tc<B≤Te,则报文被标记为黄色,且Te减少B,Tc不减少;
如果B>Te,则报文被标记为红色,且Tc和Te都不减少。
在色敏模式下:
如报文已经被标记为绿色且B≤Tc,则报文被标记为绿色,且Tc减少B;
如报文已经被标记为绿色且Tc<B≤Te,则报文被标记为黄色,且Te减少B,Tc不减少;
如果报文已被标记为黄色且B<Te,则报文被标记为黄色,且Te减少B;
如果报文已被标记为黄色且B>Te,则报文被标记为红色,且Te保持不变;
如果报文已被标记为红色,直接将报文标记为红色,Tc和Te不变。
A3、双速双桶模式。
双速双桶模式下也有两个令牌桶,但这两个令牌桶令牌的令牌增加速率不相同,两个令牌桶可以分别称为C桶和P桶,往C桶和P桶添加令牌的速率分别为CIR和峰值信息速率(peak information rate,PIR),C桶令牌容量为CBS,P桶令牌容量为峰值突发尺寸(peak burst size,PBS),这两个桶令牌的添加相互独立。C桶中令牌数量记为Tc,P桶中令牌数量记为Tp。
当到达一个大小为B的报文后:
在色盲模式下:
如果Tp<B,则报文被标记为红色,且Tc和Tp都不减少;
如果Tc<B≤Tp,则报文被标记为黄色,且Tp减少B,Tc不减少;
如果B≤Tc,则报文被标记为绿色,且Tp和Tc都减少B。
在色敏模式下:
如报文已经被标记为绿色且B≤Tc,则报文被标记为绿色,且Tc和Tp都减少B;
如报文已经被标记为绿色且Tc<B≤Tp,则报文被标记为黄色,且Tp减少B,Tc不减少;
如报文已经被标记为绿色且B>Tp,则报文被标记为红色,且Tp保持不变;
如果报文已被标记为黄色则只比较P桶,如B<Tp,则报文被标记为黄色,且Tp减少B,Tc不变,如B>Tp,则报文被标记为红色,且Tp和Tc不变;
如果报文已被标记为黄色且B>Tp,则报文被标记为红色,且Tp保持不变;
如果报文已被标记为红色,直接将报文标记为红色,Tc和Tp不变。
在一种实施方式中,当针对某个报文需要完成多次CAR时,几次CAR之间存在顺序关联:第1次CAR的结果会影响后面CAR的结果(该模式仅工作在色敏模式)。例如第1次CAR的结果是报文颜色为黄色,那么第2次CAR的结果只能是黄色或者是红色。上述过程可以称为层次化CAR(Hierarchy CAR,Hier-CAR)。
目前,现有CAR协议有单速率三色标记算法(Single Rate Three Color Marker,SrT CM)、双速率三色标记算法(TwoRateThreeColorMarker,TrTCM)、DSTrTCM/城域以太论坛协议(metro ethernet forum,MEF)(CF=0)/MEF(CF=1)/英国电信自定义协议(British Telecom,BT)/太平洋通信网络(Pacific communications network,PCN)等。现有网络一般要求处理报文时能够支持上述多种CAR协议,同时需要支持色盲模块和色敏模式;支持单速单桶,单速双桶,单速双桶模式;支持Hier-CAR。
为了更加清晰地描述本申请实施例的技术方案,下面结合附图,对本申请实施例提供的报文的处理方法及装置进行详细说明。
图1示出了本申请实施例提供的一种报文的处理方法适用的一种可能的通信系统的架构示意图。所述通信系统可以包括报文发送端101、至少一个报文转发端102以及报文接收端103。具体的,当在报文的传输过程中,在进行报文流量监管时,所述报文发送端101、所述报文转发端102可以采用CAR算法来对报文流量进行控制。
其中,所述报文发送端101可以为任何发送报文的设备;所述报文转发端102可以为任何转发报文的设备,例如交换机、路由器等;所述报文接收端103可以为任何接收报文的设备。本申请对上述设备不作限定。
在本申请中,报文的处理方法可以由报文的处理装置实现,所述报文的处理装置可以为图1中的报文发送端或者报文转发端,或者所述报文的处理装置为所述报文发送端或者所述报文转发端中的处理器,或者所述报文的处理装置还可以为其他处理报文的设备等。在本申请以下的描述中,均以报文的处理装置作为实现报文的处理方法为例进行说明。
图2示出了本申请实施例提供的报文的处理方法的流程图,适用于图1所示的通信系统。具体的,该方法具体流程可以包括:
步骤201:报文的处理装置获取第一CAR指令,所述第一CAR指令包括第一报文的大小和第一颜色。
步骤202:所述报文的处理装置确定当前令牌桶中的令牌数量,其中所述令牌桶为一个或者两个。
在一种可选的实施方式中,所述报文的处理装置在确定当前令牌桶中的令牌数量时,具体方法可以为:所述报文的处理装置确定第一时刻所述令牌桶中令牌数量的初始值;然后所述报文的处理装置确定第二时刻所述令牌桶中令牌数量的更新值;之后所述报文的处 理装置根据所述初始值和所述更新值确定当前令牌桶中的令牌数量。具体的,所述报文处理装置将所述更新值减去所述初始值得到当前令牌桶中的令牌数量。
其中,所述令牌桶可以为一个C桶,或者所述令牌桶可以包括一个C桶和一个E桶,或者所述令牌桶可以包括一个C桶和一个P桶。
具体的,当所述令牌桶包括两个桶的情况下,在所述报文的处理装置确定当前令牌桶中的令牌数量时,是指分别确定当前两个桶中的令牌数量。例如,当所述令牌桶包括一个C桶和一个E桶时,所述报文的处理装置确定第一时刻所述C桶中令牌数量的初始值以及所述E桶中令牌数量的初始值;然后所述报文的处理装置确定第二时刻所述C桶中令牌数量的更新值以及所述E桶中令牌数量的更新值;之后所述报文的处理装置根据所述C桶中的初始值和所述C桶中的更新值确定当前C桶中的令牌数量,以及根据所述E桶中的初始值和所述E桶中的更新值确定当前C桶中的令牌数量。应理解,当所述令牌桶包括一个C桶和一个P桶时,分别确定当前两个桶中的令牌数量的原理与所述令牌桶包括一个C桶和一个E桶时确定原理相同,可以相互参见,此处不再详细描述。
步骤203:所述报文的处理装置比较所述第一报文的大小和所述令牌数量,得到比较结果。
在一种可选的实施方式中,所述报文的处理装置在比较所述第一报文的大小和所述令牌数量之前,可以先将所述第一报文的大小单位转换成令牌数量单位。这样在所述第一报文的大小单位与所述令牌数量单位相同后,在两者比较时可以比较简单,提高比较效率。可选的上述单位变换的过程可以称为预处理(pre process)过程。
在一种可选的实施方式中,当所述令牌桶包括两个时,所述报文的处理装置在执行步骤203时,分别比较所述第一报文的大小和每个令牌桶中的令牌数量,得到对应的比较结果。例如,当所述令牌桶包括C桶和E桶时,所述报文的处理装置要比较第一报文的大小与所述C桶的令牌数量得到对应的第一比较结果,以及也要比较第一报文的大小与所述E桶的令牌数量得到对应的第二比较结果。当所述令牌桶包括C桶和P桶时与所述令牌桶包括C桶和E桶时同理,可以相互参见,此处不再详细描述。
步骤204:所述报文的处理装置根据所述比较结果和所述第一报文的第一颜色确定所述第一报文的第二颜色。
在一种具体的实施方式中,所述报文的处理装置可以根据所述比较结果以及预设的颜色配置表,确定所述比较结果对应的第三颜色,并根据所述第三颜色和所述第一报文的第一颜色确定所述第一报文的第二颜色。
其中,所述颜色配置表可以包括所述比较结果对应的第一标志位与报文颜色的对应关系。在一种可选的实施方式中,所述第一标志位可以为0或者1。具体的,当所述令牌桶为两个时,每个令牌桶对应的比较结果均分别对应一个第一标志位。由于CAR协议不同,可能比较结果对应的报文颜色不同,因此可以针对不同的协议配置报文颜色。示例性的,所述颜色配置表可以如下表1所示:
表1 颜色配置表
Figure PCTCN2021137399-appb-000001
Figure PCTCN2021137399-appb-000002
在一个实施例中,假设在SrTCM协议下,当所述令牌桶为一个桶,即只有C桶时,可以通过表1中的第二列和第四列查找比较结果对应的第三颜色,其中第三颜色决定于表1中第二列和第四列标志位中的第一位。例如,当所述比较结果为第一报文的大小大于所述令牌数量时,所述C桶对应的比较结果对应的第一标志位为0,则确定所述第三颜色为红色;当所述比较结果为第一报文的大小小于或等于所述令牌数量时,所述C桶对应的比较结果对应的第一标志位为1,则确定所述第三颜色为绿色。
在另一个实施例中,当所述令牌通过为两个时,表1中第一标志位中的两位分别为两个令牌桶对应的比较结果对应的第一标志位。例如,当两个令牌桶为C桶和E桶时,假设在SrTCM协议下,当C桶对应的第一比较结果为第一报文的大小大于所述C桶令牌数量时,所述C桶对应的第一比较结果对应的第一标志位为0,否则为1;当E桶对应的第二比较结果为第一报文的大小大于所述E桶令牌数量时,所述E桶对应的第二比较结果对应的第一标志位为0,否则为1。进而,结合表1既可以得到两个令牌桶对应的比较结果分别对应的第一标志位共同确定所述第三颜色,例如,当所述C桶对应的第一比较结果对应的第一标志位为0,所述E桶对应的第二比较结果对应的第一标志位为1时,所述第三颜色为黄色。
应理解,当所述令牌桶为C桶和P桶时查表得到报文颜色的方式与两个令牌桶为C桶和E桶时查表得到报文颜色的原理相同,此处不再详细描述。
需要说明的是,在表1中两位第一标志位中,C桶对应的第一标志位为第一个第一标志位。在表1所示的颜色配置表中的不同协议分别对应的颜色可以预先被配置,表中的协议可以是目前已有的协议,也可以是用户自定义的协议,或者将来还可以添加未来的协议,本申请此处不作限定。这样可以实现所述颜色配置表的灵活配置,可以实现CAR协议的可编程。
在一个实施例中,通过上述查表的方式确定了所述第三颜色后,所述报文的处理装置根据所述第三颜色和所述第一报文的第一颜色确定所述第一报文的第二颜色,具体可以包括以下情况:当所述第一颜色为绿色,所述第三颜色为绿色时,所述报文的处理装置确定所述第二颜色为绿色;当所述第一颜色为绿色,所述第三颜色为黄色时,所述报文的处理装置确定所述第二颜色为黄色;当所述第一颜色为绿色,所述第三颜色为红色时,所述报文的处理装置确定所述第二颜色为红色;当所述第一颜色为黄色,所述第三颜色为绿色时,所述报文的处理装置确定所述第二颜色为黄色;当所述第一颜色为黄色,所述第三颜色为黄色时,所述报文的处理装置确定所述第二颜色为黄色;当所述第一颜色为黄色,所述第三颜色为红色时,所述报文的处理装置确定所述第二颜色为红色;当所述第一颜色为红色,所述第三颜色为绿色时,所述报文的处理装置确定所述第二颜色为红色;当所述第一颜色为红色,所述第三颜色为黄色时,所述报文的处理装置确定所述第二颜色为红色;当所述第一颜色为红色,所述第三颜色为红色时,所述报文的处理装置确定所述第二颜色为红色。
在另一个实施例中,当所述报文的处理装置通过多级CAR算法对报文进行处理时, 所述报文的处理装置在基于所述第一CAR指令确定所述第一报文的颜色时,可以基于上一级CAR处理后确定的颜色得到本级CAR处理后的颜色。具体的,所述报文的处理装置还可以获取到所述第一报文的第四颜色,所述第四颜色为基于第二CAR指令确定的颜色,所述第二CAR指令为所述第一CAR指令的上一级指令;此时,所述报文的处理装置可以根据所述比较结果、所述第一报文的第一颜色和所述第四颜色确定所述第一报文的第二颜色。
具体的,所述报文的处理装置根据所述比较结果以及所述颜色配置表,确定所述比较结果对应的第五颜色,并根据所述第五颜色、所述第一颜色和所述第四颜色确定所述第一报文的第二颜色。
其中,所述报文的处理装置根据所述比较结果以及所述颜色配置表,确定所述比较结果对应的第五颜色的方法,与上述涉及的所述报文的处理装置根据所述比较结果以及所述颜色配置表,确定所述比较结果对应的第三颜色的方法相同,具体可以相互参见,此处不再详细描述。
示例性的,所述报文的处理装置根据所述第五颜色、所述第一颜色和所述第四颜色确定所述第一报文的第二颜色时,当所述第一颜色、所述第四颜色和所述五颜色均为绿色时,所述报文的处理装置可以确定所述第二颜色为绿色;当所述第一颜色、所述第四颜色和所述五颜色中没有红色且存在至少一个颜色为黄色时,所述报文的处理装置可以确定所述第二颜色为黄色;当所述第一颜色、所述第四颜色和所述五颜色中存在至少一个颜色为红色时,所述报文的处理装置可以确定所述第二颜色为红色。
在又一个实施例中,当所述报文的处理装置通过多级CAR算法对报文进行处理时,所述报文的处理装置在基于所述第一CAR指令确定所述第一报文的第二颜色后,所述报文处理装置可以将确定的所述第二颜色传输到下一级CAR指令(例如第三CAR指令)的处理过程中,以使所述报文的处理装置在基于所述第三CAR指令处理报文时,在所述第一报文为所述第二颜色的基础上确定所述第一报文的颜色。具体的,所述报文的处理装置在基于所述第三CAR指令处理报文的过程原理与所述报文的处理装置基于所述第一CAR指令处理报文的过程原理类似,此处不再详细描述。
通过上述方法,所述报文的处理装置在处理报文时可以实现支持灵活的Hierarchy-CAR的处理。
在具体的实施中,当所述报文的处理装置通过多级CAR算法对报文进行处理时,每一级CAR算法过程中报文的颜色确定过程可以在同一个时钟内进行,也可以下一级在上一级的下一个时钟进行,这样可以提高工作性能。
上述确定所述第一报文的第二颜色的过程可以称为丢弃判断和颜色生成(check)的过程,当确定出所述第二颜色为黄色或红色时,则可以不转发所述第一报文,可以理解为将所述第一报文丢弃。
步骤205:所述报文的处理装置根据所述第二颜色和所述第一报文的大小更新所述令牌桶的令牌数量。
在一种可选的实施方式中,所述报文的处理装置可以根据所述第二颜色以及预设的更新规则配置表,确定所述第二颜色对应的更新规则,并根据所述更新规则和所述第一报文的大小更新所述令牌桶的令牌数量;所述更新规则配置表可以包括报文颜色与更新规则的对应关系。具体的,当所述更新规则指示更新令牌桶数量时,所述报文的处理装置用所述 令牌桶数量减去所述第一报文的大小,得到更新后的所述令牌桶的令牌数量。
在一种可选的实施方式中,由于CAR协议不同,可能报文颜色对应的更新规则不同,因此可以针对不同的协议配置更新规则。其中,在某种协议下,可以通过更新指示位来表示更新规则,具体的,可以通过更新指示位“1”表示更新规则指示更新令牌桶数量,也即指示用所述令牌桶数量减去报文的大小;通过更新指示位“0”表示更新规则指示不更新令牌桶数量,也即指示保持令牌桶中令牌数量不变。示例性的,所述更新规则配置表可以如下表2所示:
表2 更新规则配置表
Figure PCTCN2021137399-appb-000003
在一个实施例中,假设在SrTCM协议下,当所述令牌桶为一个桶,即只有C桶时,通过表2查找第二颜色对应的更新规则时,其中更新规则为表2中每一列中更新标志位的第一位对应的更新规则。例如,当所述第二颜色绿色时,绿色对应的所述C桶的所述更新规则对应的更新标志位为“1”,即指示C桶的令牌数量减少所述第一报文的大小;当所述第二颜色为黄色或红色时,黄色或红色对应的所述C桶的所述更新规则对应的更新标志位为“0”,则指示C桶的令牌数量保持不变。
在另一个实施例中,当所述令牌通过为两个时,表2中每个颜色对应的两位更新标志位分别为两个令牌桶对应的更新规则对应的更新标志位。例如,当两个令牌桶为C桶和E桶时,假设在SrTCM协议下,当所述第二颜色为绿色时,确定的所述更新规则对应的更新标志位为“10”,则指示C桶中令牌数量减少第一报文的大小,E桶中令牌数量不变;当所述第二颜色为黄色时,确定的所述更新规则对应的更新标志位为“01”,则指示C桶中令牌数量不变,E桶中令牌数量减少第一报文的大小;当所述第二颜色为红色时,确定的所述更新规则对应的更新标志位为“00”,则指示C桶中令牌数量不变,E桶中令牌数量也不变。
应理解,当所述令牌桶为C桶和P桶时查表得到更新规则的方式与两个令牌桶为C桶和E桶时查表得到更新规则的原理相同,此处不再详细描述。
在表2所示的更细规则配置表中的不同协议分别对应的更新规则对应的更新标志位可以预先被配置,表中的协议可以是目前已有的协议,也可以是用户自定义的协议,或者将来还可以添加未来的协议,本申请此处不作限定。这样可以实现所述更新规则配置表的灵活配置,可以实现CAR协议的可编程。
上述更新所述令牌桶的令牌数量的过程可以称为生成新令牌值(tick)(更新(update))的过程。
通过上述方法,所述报文的处理装置在基于CAR处理报文时,可以基于划分的多个步骤来实现CAR指令处理,也可以理解为对处理报文时对采用的CAR算法进行拆分,从 而降低基于CAR算法处理报文的复杂度,提升处理性能。
在本申请中,上述报文的处理装置基于CAR指令处理报文的过程,具体可以被拆分成多个流水划分(pipeline)的步骤实现,多个步骤可以在不同的多个时钟内完成。示例性的,所述报文的处理装置可以通过如图3所示的处理过程实现对报文的处理。图3所示的处理过程可以为在所述报文的处理装置获取到CAR指令后,通过步骤(step)0到步骤5实现报文的处理。其中,步骤0可以为预处理过程(pre process),具体可以为上述步骤203中提及的所述报文处理装置将所述第一报文的大小单位转换成令牌数量单位的过程;步骤1可以为令牌值(tick)计算(tick calc)过程,具体可以为上述步骤202中提及的所述报文的处理装置确定第一时刻所述令牌桶中令牌数量的初始值的过程;步骤2可以为刷新过程(refresh),即刷新令牌桶中令牌数量,具体可以为上述步骤202中提及的所述报文的处理装置确定第二时刻所述令牌桶中令牌数量的更新值的过程;步骤3可以为颜色生成(check),具体可以包括上述方法实施例中涉及的所述报文的处理装置根据所述初始值和所述更新值确定当前令牌桶中的令牌数量,比较所述第一报文的大小和所述令牌数量,得到比较结果,并根据所述比较结果和所述第一报文的第一颜色确定所述第一报文的第二颜色;步骤4可以为生成新的tick值(uptake)过程,具体可以为上述步骤205中提及的过程。在图3中可以看出,在步骤3的过程中需要查找预设的颜色配置表,以及在步骤4的过程中需要查找预设的更新规则配置表。具体的,上述5个步骤的具体实现过程可以参见图2所示的实施例中涉及的相关方法,此处不再详细描述。
在图3所示的报文的处理过程的示意图中可以看出,每个步骤中的过程均可以通过组合逻辑模块实现,每两个步骤之间均可以通过D触发器进行时钟平移以使两个步骤可以在不同的时钟内完成,这样可以降低基于CAR算法处理报文的复杂度,提升处理性能。其中,每个步骤中的组合逻辑模块可以为加法器、减法器、乘法器或除法器中的任一种或多种器件,并且任意两个步骤中的组合逻辑模块的器件组成可以根据需要相同或者不同。这样,所述报文的处理装置可以通过简单的逻辑模块以及时钟平移灵活实现对报文的处理,降低基于CAR算法处理报文的复杂度,提升处理性能。
需要说明的是,图3中的几个步骤仅仅是一种示例,可选的,报文的处理过程可以包括比图3更少或者更多的步骤,本申请对比不作限定。
在一种实施例中,所述报文的处理装置在处理报文时可以支持Hierarchy-CAR的处理。具体的,在基于图3中pipeline的划分的基础上,通过对step3(check)得到的报文颜色的结果进行串联,实现Hierarchy-CAR功能。示例性的,如图4所示的报文的处理过程示意图中,step3(check)中第一级CAR指令(如图4中CAR指令0)主要完成基于查找颜色配置表(图4中未示出),得到当前报文的颜色后,将该颜色传送到下一级CAR指令(如图4中CRA指令1)的step3中,下一级在此基础上得到本级的报文颜色,然后再传到下一级(如图4中CAR指令2)。通过上述流水划分方法,Hierarchy-CAR功能仅需要在step3进行逻辑串联,这样可以满足高频工作时钟下能够线速工作。
图4所示的示意图中,每个CAR指令的处理过程除了step3中从第二级CAR指令开始需要参考上一级的指令结果有所不同外,其他均与图3所示的处理过程相同。并且图4中可以多个CAR指令的相同步骤可以在相同的时钟内完成,例如CAR指令0、CAR指令1和CAR指令2的步骤0均在同一个时钟内完成,其他步骤同理。也即,在同一个时钟内,所述报文的处理装置可以处理不同指令的相同操作,这样最后完成多个CAR指令的处理 后,平均每个CAR指令的处理时间较短,也即在几个时钟内可以一起完成对多个CAR指令的处理,这样可以满足高频工作时钟下能够线速工作。
在另一种实施例中,所述报文的处理装置在处理报文支持Hierarchy-CAR的处理时,可以基于图4所示的处理过程,通过D触发器对每两级step3(check)得到的报文颜色的结果进行串联时进行时钟平移,如图5所示的报文的处理过程。这样可以实现支持更高工作频率的目的,同时也可以通过分拆流水的方式降低每级流水的逻辑深度,而不影响性能。
需要说明的是,图4和图5中仅以三级CAR指令为例进行说明,可选的,还可以为两级CAR指令或者多于三级的CAR指令,本申请对此不做限定。
在一种可选的实施方式中,所述报文的处理装置的基本结构可以有图3、图4或图5所示的报文的处理过程的示意图中的结构以及连接关系组成。
基于以上实施例,本申请实施例还提供了一种报文的处理装置,用于实现本申请实施例提供的报文的处理方法。示例性的,参阅图6所示,报文的处理装置600可以包括获取单元601和处理单元602。其中:
所述获取单元601可以用于获取第一承诺访问速率CAR指令,所述第一CAR指令包括第一报文的大小和第一颜色;所述处理单元602可以用于确定当前令牌桶中的令牌数量,其中所述令牌桶为一个或者两个;比较所述第一报文的大小和所述令牌数量,得到比较结果;根据所述比较结果和所述第一报文的第一颜色确定所述第一报文的第二颜色;根据所述第二颜色和所述第一报文的大小更新所述令牌桶的令牌数量。
在一种可选的实施方式中,所述处理单元602在确定当前令牌桶中的令牌数量时,具体用于:确定第一时刻所述令牌桶中令牌数量的初始值;确定第二时刻所述令牌桶中令牌数量的更新值;根据所述初始值和所述更新值确定当前令牌桶中的令牌数量。
具体的,所述处理单元602还可以用于:在比较所述第一报文的大小和所述令牌数量之前,将所述第一报文的大小单位转换成令牌数量单位。
具体的,所述处理单元602在根据所述比较结果和所述第一报文的第一颜色确定所述第一报文的第二颜色时,具体用于:根据所述比较结果以及预设的颜色配置表,确定所述比较结果对应的第三颜色;所述颜色配置表包括所述比较结果对应的第一标志位与报文颜色的对应关系;根据所述第三颜色和所述第一报文的第一颜色确定所述第一报文的第二颜色。
示例性的,所述处理单元602在根据所述第三颜色和所述第一报文的第一颜色确定所述第一报文的第二颜色时,具体用于:当所述第一颜色为绿色,所述第三颜色为绿色时,确定所述第二颜色为绿色;当所述第一颜色为绿色,所述第三颜色为黄色时,确定所述第二颜色为黄色;当所述第一颜色为绿色,所述第三颜色为红色时,确定所述第二颜色为红色;当所述第一颜色为黄色,所述第三颜色为绿色时,确定所述第二颜色为黄色;当所述第一颜色为黄色,所述第三颜色为黄色时,确定所述第二颜色为黄色;当所述第一颜色为黄色,所述第三颜色为红色时,确定所述第二颜色为红色;当所述第一颜色为红色,所述第三颜色为绿色时,确定所述第二颜色为红色;当所述第一颜色为红色,所述第三颜色为黄色时,确定所述第二颜色为红色;当所述第一颜色为红色,所述第三颜色为红色时,确定所述第二颜色为红色。
具体的,所述处理单元602在根据所述第二颜色和所述第一报文的大小更新所述令牌 桶的令牌数量时,具体用于:根据所述第二颜色以及预设的更新规则配置表,确定所述比较结果对应的更新规则;所述更新规则配置表包括报文颜色与更新规则的对应关系;根据所述更新规则和所述第一报文的大小更新所述令牌桶的令牌数量。
示例性的,所述处理单元602在根据所述更新规则和所述第一报文的大小更新所述令牌桶的令牌数量时,具体用于:当所述更新规则指示更新令牌桶数量时,用所述令牌桶数量减去所述第一报文的大小,得到更新后的所述令牌桶的令牌数量。
在一种可选的实施方式中,所述处理单元602还用于:获取到所述第一报文的第四颜色,所述第四颜色为基于第二CAR指令确定的颜色,所述第二CAR指令为所述第一CAR指令的上一级指令;进一步地,所述处理单元602在根据所述比较结果和所述第一报文的第一颜色确定所述第一报文的第二颜色时,具体用于:根据所述比较结果、所述第一报文的第一颜色和所述第四颜色确定所述第一报文的第二颜色。
示例性的,所述处理单元602在根据所述比较结果、所述第一报文的第一颜色和所述第四颜色确定所述第一报文的第二颜色时,具体用于:根据所述比较结果以及预设的颜色配置表,确定所述比较结果对应的第五颜色;所述颜色配置表包括比较结果对应的第一标志位与报文颜色的对应关系;根据所述第五颜色、所述第一颜色和所述第四颜色确定所述第一报文的第二颜色。
具体的,所述处理单元602在根据所述第五颜色、所述第一颜色和所述第四颜色确定所述第一报文的第二颜色时,具体用于:当所述第一颜色、所述第四颜色和所述五颜色均为绿色时,确定所述第二颜色为绿色;当所述第一颜色、所述第四颜色和所述五颜色中没有红色且存在至少一个颜色为黄色时,确定所述第二颜色为黄色;当所述第一颜色、所述第四颜色和所述五颜色中存在至少一个颜色为红色时,确定所述第二颜色为红色。
在一种具体实施例中,所述处理单元602可以包括至少两个子处理单元,任一个子处理单元包括组合逻辑模块和D触发器;其中,任意相邻两个子处理单元中,一个子处理单元的组合逻辑模块连接另一个子处理单元的D触发器,和/或一个子处理单元的D触发器连接另一个子处理单元的组合逻辑模块。
具体的,任一个子处理单元的组合逻辑模块可以包括以下一个或多个器件:加法器、减法器、乘法器或除法器;任意两个子处理单元的组合逻辑模块包括的器件可以相同或者不相同。
例如,所述处理单元602可以包括如图3、图4或者图5所示的结构。任一个子处理单元可以对应图3、图4或图5中任一个步骤,分别实现对应的步骤中的方法。
需要说明的是,本申请实施例中对单元的划分是示意性的,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式。在本申请的实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。
所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)或处理器(processor)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储 器(read-only memory,ROM)、随机存取存储器(random access memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。
基于以上实施例,本申请实施例还提供了一种报文的处理装置,用于实现本申请实施例提供的报文的处理方法。示例性的,参阅图7所示,该报文的处理装置700可以包括一个或多个处理器701以及存储器702。具体的,存储器702可以用于存储计算机程序代码,计算机程序代码包括计算机指令,处理器701可以用于调用存储器702中的计算机指令执行上述报文的处理方法中的各个操作。具体的,处理器701的执行过程可以参见上述报文的处理方法中的相关描述,此处不再详细描述。
可选的,报文的处理装置700还可以包括总线703。其中,所述处理器701和所述存储器702可以通过所述总线703进行通信,也可以通过无线传输等其他手段实现通信。可选的,所述总线703可以是外设部件互连标准(Peripheral Component Interconnect,PCI)总线或扩展工业标准结构(Extended Industry Standard Architecture,EISA)总线等。所述总线可以分为地址总线、数据总线、控制总线等。为便于表示,图7中仅用一条粗线表示,但并不表示仅有一根总线或一种类型的总线。
在一种可选的实施方式中,所述处理器701可以包括如图3、图4或者图5所示的结构。
基于以上实施例,本申请实施例还提供一种计算机可读存储介质,所述计算机可读存储介质用于存储计算机程序,该计算机程序被计算机执行时,所述计算机可以实现上述方法实施例提供的任一种报文的处理方法。
本申请实施例还提供一种计算机程序产品,所述计算机程序产品用于存储计算机程序,该计算机程序被计算机执行时,所述计算机可以实现上述方法实施例提供的任一种报文的处理方法。
本申请实施例还提供一种芯片,包括处理器,所述处理器与存储器耦合,用于调用所述存储器中的程序使得所述芯片实现上述方法实施例提供的任一种报文的处理方法。
本申请实施例还提供一种芯片,包括上述报文的装置,用于实现上述方法实施例提供的任一种报文的处理方法。
本领域内的技术人员应明白,本申请的实施例可提供为方法、系统、或计算机程序产品。因此,本申请可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本申请可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。
本申请是参照根据本申请的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个 方框中指定的功能。
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。
显然,本领域的技术人员可以对本申请进行各种改动和变型而不脱离本申请的范围。这样,倘若本申请的这些修改和变型属于本申请权利要求及其等同技术的范围之内,则本申请也意图包含这些改动和变型在内。

Claims (26)

  1. 一种报文的处理方法,其特征在于,包括:
    获取第一承诺访问速率CAR指令,所述第一CAR指令包括第一报文的大小和第一颜色;
    确定当前令牌桶中的令牌数量,其中所述令牌桶为一个或者两个;
    比较所述第一报文的大小和所述令牌数量,得到比较结果;
    根据所述比较结果和所述第一报文的第一颜色确定所述第一报文的第二颜色;
    根据所述第二颜色和所述第一报文的大小更新所述令牌桶的令牌数量。
  2. 如权利要求1所述的方法,其特征在于,确定当前令牌桶中的令牌数量,包括:
    确定第一时刻所述令牌桶中令牌数量的初始值;
    确定第二时刻所述令牌桶中令牌数量的更新值;
    根据所述初始值和所述更新值确定当前令牌桶中的令牌数量。
  3. 如权利要求1或2所述的方法,其特征在于,在比较所述第一报文的大小和所述令牌数量之前,所述方法还包括:
    将所述第一报文的大小单位转换成令牌数量单位。
  4. 如权利要求1-3任一项所述的方法,其特征在于,根据所述比较结果和所述第一报文的第一颜色确定所述第一报文的第二颜色,包括:
    根据所述比较结果以及预设的颜色配置表,确定所述比较结果对应的第三颜色;所述颜色配置表包括比较结果对应的第一标志位与报文颜色的对应关系;
    根据所述第三颜色和所述第一报文的第一颜色确定所述第一报文的第二颜色。
  5. 如权利要求4所述的方法,其特征在于,根据所述第三颜色和所述第一报文的第一颜色确定所述第一报文的第二颜色,包括:
    当所述第一颜色为绿色,所述第三颜色为绿色时,确定所述第二颜色为绿色;
    当所述第一颜色为绿色,所述第三颜色为黄色时,确定所述第二颜色为黄色;
    当所述第一颜色为绿色,所述第三颜色为红色时,确定所述第二颜色为红色;
    当所述第一颜色为黄色,所述第三颜色为绿色时,确定所述第二颜色为黄色;
    当所述第一颜色为黄色,所述第三颜色为黄色时,确定所述第二颜色为黄色;
    当所述第一颜色为黄色,所述第三颜色为红色时,确定所述第二颜色为红色;
    当所述第一颜色为红色,所述第三颜色为绿色时,确定所述第二颜色为红色;
    当所述第一颜色为红色,所述第三颜色为黄色时,确定所述第二颜色为红色;
    当所述第一颜色为红色,所述第三颜色为红色时,确定所述第二颜色为红色。
  6. 如权利要求1-5任一项所述的方法,其特征在于,根据所述第二颜色和所述第一报文的大小更新所述令牌桶的令牌数量,包括:
    根据所述第二颜色以及预设的更新规则配置表,确定所述第二颜色对应的更新规则;所述更新规则配置表包括报文颜色与更新规则的对应关系;
    根据所述更新规则和所述第一报文的大小更新所述令牌桶的令牌数量。
  7. 如权利要求6所述的方法,其特征在于,根据所述更新规则和所述第一报文的大小更新所述令牌桶的令牌数量,包括:
    当所述更新规则指示更新令牌桶数量时,用所述令牌桶数量减去所述第一报文的大小, 得到更新后的所述令牌桶的令牌数量。
  8. 如权利要求1-3任一项所述的方法,其特征在于,所述方法还包括:
    获取到所述第一报文的第四颜色,所述第四颜色为基于第二CAR指令确定的颜色,所述第二CAR指令为所述第一CAR指令的上一级指令;
    根据所述比较结果和所述第一报文的第一颜色确定所述第一报文的第二颜色,包括:
    根据所述比较结果、所述第一报文的第一颜色和所述第四颜色确定所述第一报文的第二颜色。
  9. 如权利要求8所述的方法,其特征在于,根据所述比较结果、所述第一报文的第一颜色和所述第四颜色确定所述第一报文的第二颜色,包括:
    根据所述比较结果以及预设的颜色配置表,确定所述比较结果对应的第五颜色;所述颜色配置表包括比较结果对应的第一标志位与报文颜色的对应关系;
    根据所述第五颜色、所述第一颜色和所述第四颜色确定所述第一报文的第二颜色。
  10. 如权利要求9所述的方法,其特征在于,根据所述第五颜色、所述第一颜色和所述第四颜色确定所述第一报文的第二颜色,包括:
    当所述第一颜色、所述第四颜色和所述五颜色均为绿色时,确定所述第二颜色为绿色;
    当所述第一颜色、所述第四颜色和所述五颜色中没有红色、且存在至少一个颜色为黄色时,确定所述第二颜色为黄色;
    当所述第一颜色、所述第四颜色和所述五颜色中存在至少一个颜色为红色时,确定所述第二颜色为红色。
  11. 一种报文的处理装置,其特征在于,包括:
    获取单元,用于获取第一承诺访问速率CAR指令,所述第一CAR指令包括第一报文的大小和第一颜色;
    处理单元,用于确定当前令牌桶中的令牌数量,其中所述令牌桶为一个或者两个;以及比较所述第一报文的大小和所述令牌数量,得到比较结果;根据所述比较结果和所述第一报文的第一颜色确定所述第一报文的第二颜色;根据所述第二颜色和所述第一报文的大小更新所述令牌桶的令牌数量。
  12. 如权利要求11所述的装置,其特征在于,所述处理单元,在确定当前令牌桶中的令牌数量时,具体用于:
    确定第一时刻所述令牌桶中令牌数量的初始值;
    确定第二时刻所述令牌桶中令牌数量的更新值;
    根据所述初始值和所述更新值确定当前令牌桶中的令牌数量。
  13. 如权利要求11或12所述的装置,其特征在于,所述处理单元,还用于:
    在比较所述第一报文的大小和所述令牌数量之前,将所述第一报文的大小单位转换成令牌数量单位。
  14. 如权利要求11-13任一项所述的装置,其特征在于,所述处理单元,在根据所述比较结果和所述第一报文的第一颜色确定所述第一报文的第二颜色时,具体用于:
    根据所述比较结果以及预设的颜色配置表,确定所述比较结果对应的第三颜色;所述颜色配置表包括所述比较结果对应的第一标志位与报文颜色的对应关系;
    根据所述第三颜色和所述第一报文的第一颜色确定所述第一报文的第二颜色。
  15. 如权利要求14所述的装置,其特征在于,所述处理单元,在根据所述第三颜色和 所述第一报文的第一颜色确定所述第一报文的第二颜色时,具体用于:
    当所述第一颜色为绿色,所述第三颜色为绿色时,确定所述第二颜色为绿色;
    当所述第一颜色为绿色,所述第三颜色为黄色时,确定所述第二颜色为黄色;
    当所述第一颜色为绿色,所述第三颜色为红色时,确定所述第二颜色为红色;
    当所述第一颜色为黄色,所述第三颜色为绿色时,确定所述第二颜色为黄色;
    当所述第一颜色为黄色,所述第三颜色为黄色时,确定所述第二颜色为黄色;
    当所述第一颜色为黄色,所述第三颜色为红色时,确定所述第二颜色为红色;
    当所述第一颜色为红色,所述第三颜色为绿色时,确定所述第二颜色为红色;
    当所述第一颜色为红色,所述第三颜色为黄色时,确定所述第二颜色为红色;
    当所述第一颜色为红色,所述第三颜色为红色时,确定所述第二颜色为红色。
  16. 如权利要求11-15任一项所述的装置,其特征在于,所述处理单元,在根据所述第二颜色和所述第一报文的大小更新所述令牌桶的令牌数量时,具体用于:
    根据所述第二颜色以及预设的更新规则配置表,确定所述第二颜色对应的更新规则;所述更新规则配置表包括报文颜色与更新规则的对应关系;
    根据所述更新规则和所述第一报文的大小更新所述令牌桶的令牌数量。
  17. 如权利要求16所述的装置,其特征在于,所述处理单元,在根据所述更新规则和所述第一报文的大小更新所述令牌桶的令牌数量时,具体用于:
    当所述更新规则指示更新令牌桶数量时,用所述令牌桶数量减去所述第一报文的大小,得到更新后的所述令牌桶的令牌数量。
  18. 如权利要求11-13任一项所述的装置,其特征在于,所述处理单元,还用于:
    获取到所述第一报文的第四颜色,所述第四颜色为基于第二CAR指令确定的颜色,所述第二CAR指令为所述第一CAR指令的上一级指令;
    所述处理单元,在根据所述比较结果和所述第一报文的第一颜色确定所述第一报文的第二颜色时,具体用于:
    根据所述比较结果、所述第一报文的第一颜色和所述第四颜色确定所述第一报文的第二颜色。
  19. 如权利要求18所述的装置,其特征在于,所述处理单元,在根据所述比较结果、所述第一报文的第一颜色和所述第四颜色确定所述第一报文的第二颜色时,具体用于:
    根据所述比较结果以及预设的颜色配置表,确定所述比较结果对应的第五颜色;所述颜色配置表包括比较结果对应的第一标志位与报文颜色的对应关系;
    根据所述第五颜色、所述第一颜色和所述第四颜色确定所述第一报文的第二颜色。
  20. 如权利要求19所述的装置,其特征在于,所述处理单元,在根据所述第五颜色、所述第一颜色和所述第四颜色确定所述第一报文的第二颜色时,具体用于:
    当所述第一颜色、所述第四颜色和所述五颜色均为绿色时,确定所述第二颜色为绿色;
    当所述第一颜色、所述第四颜色和所述五颜色中没有红色、且存在至少一个颜色为黄色时,确定所述第二颜色为黄色;
    当所述第一颜色、所述第四颜色和所述五颜色中存在至少一个颜色为红色时,确定所述第二颜色为红色。
  21. 如权利要求11-20任一项所述的装置,其特征在于,所述处理单元包括至少两个子处理单元,任一个子处理单元包括组合逻辑模块和D触发器;
    任意相邻两个子处理单元中,一个子处理单元的组合逻辑模块连接另一子处理单元的D触发器,和/或一个子处理单元的D触发器连接另一子处理单元的组合逻辑模块。
  22. 如权利要求21所述的装置,其特征在于,任一个子处理单元的组合逻辑模块包括以下一个或多个器件:加法器、减法器、乘法器或除法器;任意两个子处理单元的组合逻辑模块包括的器件相同或者不相同。
  23. 一种报文的处理装置,其特征在于,包括处理器和存储器,其中:
    所述存储器,存储程序;
    所述处理器,与所述存储器耦合,用于调用所述存储器中的程序使得所述报文的处理装置执行如权利要求1-10任一项所述的方法。
  24. 一种计算机可读存储介质,其特征在于,包括指令,当所述指令在计算机上运行时,使得所述计算机执行权利要求1-10中任一项所述的方法。
  25. 一种芯片,其特征在于,包括处理器,所述处理器与存储器耦合,用于读取并执行所述存储器中存储的程序指令,以实现如权利要求1-10任一项所述的方法。
  26. 一种芯片,其特征在于,包括如权利要求11-22任一项所述的报文的处理装置。
PCT/CN2021/137399 2020-12-15 2021-12-13 一种报文的处理方法及装置 WO2022127729A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202011478983.1A CN114650258A (zh) 2020-12-15 2020-12-15 一种报文的处理方法及装置
CN202011478983.1 2020-12-15

Publications (1)

Publication Number Publication Date
WO2022127729A1 true WO2022127729A1 (zh) 2022-06-23

Family

ID=81990890

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/137399 WO2022127729A1 (zh) 2020-12-15 2021-12-13 一种报文的处理方法及装置

Country Status (2)

Country Link
CN (1) CN114650258A (zh)
WO (1) WO2022127729A1 (zh)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115622945A (zh) * 2022-09-15 2023-01-17 新华三信息安全技术有限公司 一种报文处理方法及装置
CN115766591A (zh) * 2022-10-28 2023-03-07 中科驭数(北京)科技有限公司 分片报文流量限速方法、dpu分片报文转发方法和装置

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116095014A (zh) * 2023-01-07 2023-05-09 国腾(广州)量子计算科技有限公司 一种基于量子计算的存储区域QoS分配方法、存储装置及智能终端

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101478494A (zh) * 2009-02-16 2009-07-08 中兴通讯股份有限公司 一种基于令牌桶算法的数据包处理方法及装置
US20100195504A1 (en) * 2008-12-30 2010-08-05 Alcatel-Lucent Usa Inc. Single and dual rate three color marker systems
CN101820385A (zh) * 2010-02-10 2010-09-01 中国电子科技集团公司第三十研究所 一种ip数据流流量的监管方法
CN102710514A (zh) * 2012-05-25 2012-10-03 华为技术有限公司 一种报文流量控制方法及系统

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101841461B (zh) * 2010-02-11 2012-05-30 北京星网锐捷网络技术有限公司 一种控制令牌桶更新的方法和装置
CN111064676B (zh) * 2018-10-16 2023-02-28 中兴通讯股份有限公司 一种流量监管方法、设备、装置和计算机存储介质

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100195504A1 (en) * 2008-12-30 2010-08-05 Alcatel-Lucent Usa Inc. Single and dual rate three color marker systems
CN101478494A (zh) * 2009-02-16 2009-07-08 中兴通讯股份有限公司 一种基于令牌桶算法的数据包处理方法及装置
CN101820385A (zh) * 2010-02-10 2010-09-01 中国电子科技集团公司第三十研究所 一种ip数据流流量的监管方法
CN102710514A (zh) * 2012-05-25 2012-10-03 华为技术有限公司 一种报文流量控制方法及系统

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115622945A (zh) * 2022-09-15 2023-01-17 新华三信息安全技术有限公司 一种报文处理方法及装置
CN115766591A (zh) * 2022-10-28 2023-03-07 中科驭数(北京)科技有限公司 分片报文流量限速方法、dpu分片报文转发方法和装置
CN115766591B (zh) * 2022-10-28 2023-12-12 中科驭数(北京)科技有限公司 分片报文流量限速方法、dpu分片报文转发方法和装置

Also Published As

Publication number Publication date
CN114650258A (zh) 2022-06-21

Similar Documents

Publication Publication Date Title
WO2022127729A1 (zh) 一种报文的处理方法及装置
US10764181B2 (en) Pipelined evaluations for algorithmic forwarding route lookup
EP3624416B1 (en) Technologies for filtering network traffic on ingress
US11296807B2 (en) Techniques to operate a time division multiplexing(TDM) media access control (MAC)
US7573896B2 (en) Method and apparatus for generic interface, packet cut-through, overbooking, queue concatenation, and logical identification priority for a system packet interface device
WO2011012023A1 (zh) 一种网络处理器输出端口队列的管理方法及系统
WO2019062656A1 (zh) 数据传输
US11082358B2 (en) Network path measurement method, apparatus, and system
CN105359472B (zh) 一种用于OpenFlow网络的数据处理方法和装置
EP3832960B1 (en) Establishment of fast forwarding table
WO2021244065A1 (zh) 一种均衡训练方法、装置及系统
JP2014042237A (ja) ハードウェア回路、クレジットに基づくトラフィックシェイパー、装置、およびハードウェアによる実現方法
CN116545921A (zh) 基于ecmp的报文转发方法、装置、设备及存储介质
CN106656809B (zh) 流表聚合方法、控制器、网元和系统
KR100763533B1 (ko) 버스 인버팅 코드 생성 장치 및 이를 이용한 버스 인버팅코드 생성 방법
CN107294856A (zh) 确定拓扑变化的方法、设备及系统
WO2022134671A1 (zh) 数据传输方法、电子设备和存储介质
CN108614792B (zh) 1394事务层数据包存储管理方法及电路
EP4203395A1 (en) Packet forwarding method and apparatus, and computer-readable storage medium
CN114124848A (zh) 一种基于vlid监控的交换机多监控端口方法
US20160150056A1 (en) Multi-protocol frame filter
WO2017198052A1 (zh) 一种报文的处理方法和装置
WO2020108392A1 (zh) 一种业务比特流处理方法及装置
WO2023011047A1 (zh) 一种处理方法及装置
CN106789706B (zh) 一种基于tcam的网络分流系统

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21905658

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 21905658

Country of ref document: EP

Kind code of ref document: A1