Programmable switch power consumption estimation method and device based on component decomposition, and medium

By decomposing the packet processing flow into parser, matching, and action operation components, building a power consumption estimation model and fitting the power consumption expression, the problem of the inability to accurately estimate the power consumption of programmable switches in existing technologies is solved, and low-cost component-level power consumption prediction and energy consumption optimization are achieved.

CN120669844APending Publication Date: 2025-09-19ZHEJIANG UNIV +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510783563.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-12
Publication Date
2025-09-19

AI Technical Summary

Technical Problem

Existing power consumption measurement methods cannot accurately estimate the power consumption of programmable switches, especially cannot adapt to their flexible packet processing logic and dynamic resource allocation characteristics, and are costly.

Method used

The packet processing flow is decomposed into three major operational components: parser, matching, and action. A power consumption estimation model is constructed, and the control variable method is used to generate test cases to collect power consumption data on the target switch. The power consumption expression of each operational component is fitted and finally substituted into the total power consumption model for estimation.

Benefits of technology

It achieves low-cost component-level power consumption prediction, is applicable to various hardware platforms, and supports energy consumption optimization of programmable switches.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120669844A_ABST
    Figure CN120669844A_ABST
Patent Text Reader

Abstract

The invention discloses a programmable switch power consumption estimation method and device based on component decomposition, and a medium, and the method comprises the steps: firstly, decomposing a data packet processing flow into three operation components, namely a parser, a matching component and an action component; secondly, constructing a power consumption estimation model: total power consumption = operation power consumption + basic power consumption; wherein the basic power consumption = idle power consumption + port configuration power consumption + basic forwarding power consumption; operation power consumption = parser power consumption + matching power consumption + action power consumption (respectively corresponding to three operation components). Then, utilizing a control variable method to respectively generate multiple groups of test cases for the resolver, the matching and the action operation, deploying the test cases on a target programmable switch, and collecting power consumption data; and on the basis, fitting to obtain a mathematical expression of the power consumption of each operation component. And finally, the analytic expressions are substituted into a total power consumption model to obtain a materialized power consumption estimation model for the target switch, and the materialized power consumption estimation model is used for estimating the power consumption of the target switch.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of computer networks and green computing, and in particular relates to a method, device, and medium for estimating power consumption of a programmable switch based on component decomposition. Background Art

[0002] In-network computing, which offloads tasks from servers to programmable switches, has gained widespread application. For example, in-network data aggregation processes data and aggregates intermediate results on the switch, reducing network traffic and the computational burden on end nodes. Similarly, in-network caching leverages the match-action model of programmable switches to achieve efficient storage and reduce query latency. In-network computing is also widely used in areas such as network security.

[0003] With the widespread use of in-network computing, its power consumption has become an important issue. The power consumption of programmable switches is a key component of in-network computing power consumption because in-network computing relies on them to perform computing tasks.

[0004] However, existing power consumption solutions cannot accurately estimate the power consumption of programmable switches. Existing power consumption measurement methods are divided into instrument measurement-based methods and modeling-based methods. These two methods have the following problems: (1) Instrument measurement-based methods rely on external power meters or dedicated circuits, which are expensive and cannot provide component-level power consumption analysis; (2) Existing modeling-based power consumption estimation methods are only designed for fixed-function switches and cannot adapt to the flexible packet processing logic and dynamic resource allocation characteristics of programmable switches (such as multi-level matching tables, complex action execution, etc.). Therefore, there is an urgent need for a method that can accurately estimate the power consumption of programmable switches to achieve energy-saving deployment and management of programmable switch networks in scenarios such as data centers and cloud computing. Summary of the Invention

[0005] The purpose of the present invention is to address the deficiencies of the existing technology and provide a method, device and medium for estimating power consumption of a programmable switch based on component decomposition.

[0006] The object of the present invention is achieved through the following technical solutions:

[0007] In a first aspect, an embodiment of the present invention provides a method for estimating power consumption of a programmable switch based on component decomposition, the method comprising the following steps:

[0008] Decompose the data packet processing flow into parser operation component, matching operation component, and action operation component;

[0009] Constructing a power consumption estimation model; wherein the total power consumption in the power consumption estimation model is the sum of the operating power consumption and the basic power consumption; the basic power consumption is the sum of the idle power consumption, the port configuration power consumption, and the basic forwarding power consumption; the operating power consumption is the sum of the parser power consumption corresponding to the parser operation component, the matching power consumption corresponding to the matching operation component, and the action power consumption corresponding to the action operation component;

[0010] Based on the control variable method, several test cases are generated for the parser operation component, matching operation component, and action operation component respectively. The test cases are deployed on the target programmable switch to obtain the actual power consumption data, and the parser power consumption parsing formula, matching power consumption parsing formula, and action power consumption parsing formula are fitted based on this data. The parser power consumption parsing formula, matching power consumption parsing formula, and action power consumption parsing formula are substituted into the power consumption estimation model to obtain the power consumption estimation model for the target programmable switch, thereby estimating the power consumption of the target programmable switch.

[0011] In a second aspect, an embodiment of the present invention provides an electronic device, comprising a memory and a processor, wherein the memory is coupled to the processor; wherein the memory is used to store program data, and the processor is used to execute the program data to implement the above-mentioned programmable switch power consumption estimation method.

[0012] In a third aspect, an embodiment of the present invention provides a computer-readable storage medium having a computer program stored thereon, wherein the program, when executed by a processor, implements the above-mentioned method for estimating power consumption of a programmable switch.

[0013] In a fourth aspect, an embodiment of the present invention provides a computer program product, including a computer program / instruction, which implements the above-mentioned method for estimating power consumption of a programmable switch when executed by a processor.

[0014] Compared with the prior art, the present invention has the following beneficial effects:

[0015] This invention provides a method for estimating programmable switch power consumption based on component decomposition. The method includes: first, decomposing the packet processing flow into three operational components: parser, matching, and action. Second, constructing a power consumption estimation model: total power consumption = operational power consumption + basic power consumption. Basic power consumption = idle power consumption + port configuration power consumption + basic forwarding power consumption; and operational power consumption = parser power consumption + matching power consumption + action power consumption. Then, using the control variable method, multiple test cases are generated for the parser, matching, and action operations, respectively. These are deployed on a target programmable switch and power consumption data is collected. Based on this, mathematical expressions for the power consumption of each operational component are fitted. Finally, these analytical expressions are substituted into the total power consumption model to obtain a specific power consumption estimation model for the target switch, which is used to estimate its power consumption. This method does not require dedicated instrumentation and only requires a small number of test cases to generate an instantiated model, resulting in a low cost. Furthermore, the method supports dynamic prediction of programmable switch component-level power consumption and adapts power consumption parameters to the target hardware. Furthermore, the method is compatible with various hardware platforms (ASICs, FPGAs), enabling energy consumption optimization for computing applications within the network. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0017] Figure 1 This is a diagram of a power consumption model construction framework provided by an embodiment of the present invention;

[0018] Figure 2 is a diagram of a parameter adaptation architecture provided by an embodiment of the present invention;

[0019] Figure 3 is a schematic diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0020] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.

[0021] It should be noted that, unless there is any conflict, the features in the following embodiments and implementations may be combined with each other.

[0022] like Figure 1As shown, the present invention provides a method for estimating power consumption of a programmable switch based on component decomposition, the method comprising the following steps:

[0023] Step S1: Decompose the data packet processing flow into a parser operation component (Parser), a matching operation component (Match), and an action operation component (Action).

[0024] Furthermore, the parser operation component (Parser) is responsible for extracting and parsing the packet header information and generating the packet header vector (PHV);

[0025] Match operation component (Match): performs packet matching operations based on the rule table (such as exact match, longest prefix match);

[0026] Action component (Action): includes stateful operations (such as register reading and writing, counter updating) and stateless operations (such as field assignment, packet header modification).

[0027] Step S2: Construct a power consumption estimation model; wherein the total power consumption in the power consumption estimation model is the sum of the operating power consumption and the basic power consumption; the basic power consumption is the sum of the idle power consumption, the port configuration power consumption, and the basic forwarding power consumption; the operating power consumption is the sum of the parser power consumption corresponding to the parser operation component, the matching power consumption corresponding to the matching operation component, and the action power consumption corresponding to the action operation component.

[0028] Furthermore, the power consumption estimation model is shown in Table 1 below:

[0029] Table 1: Schematic diagram of total power consumption

[0030]

[0031]

[0032] Specifically, the total power consumption is determined by the basic power consumption P basic And operating power consumption P op The composition is expressed as follows:

[0033] P=P basic +P op

[0034] Among them, the basic power consumption P basic Including idle power consumption P idle , port configuration power consumption P port And basic forwarding power consumption P fwd ;Operation power consumption P op Including resolver / inverse resolver power consumption P Parser , Matching table power consumption P Match And action execution power consumption P Action ; The expression is as follows:

[0035] P basic =P idle +P port +P fwd

[0036] P op =P Parser +P Match +P Action

[0037] Among them, the port configuration power consumption P port Power consumption P connected by the port conn and port enable power consumption P enb The composition is expressed as follows:

[0038] P port =P conn +P enb

[0039] Port connection power consumption P conn and port enable power consumption P enb The expression is as follows:

[0040]

[0041] Where N c and N e are the number of connected ports and the number of enabled ports, respectively. c and p e This is the power consumption when a single port is connected and enabled.

[0042] The basic forwarding power consumption P fwd is the runtime power consumption of the programmable switch program with only basic fixed forwarding function, and the basic forwarding power consumption P fwd The power consumption is modeled as:

[0043] P fwd =p fwd (r)

[0044] Where p fwd (r) is the basic forwarding power consumption under traffic r.

[0045] Furthermore, the parser power consumption is the sum of the power consumption of parsing / encapsulating each data packet header. The calculation process of the parser power consumption includes:

[0046]

[0047] Where N h is the number of packet headers, The flow rate r is parsed and the package width is The power consumption of the head.

[0048] Furthermore, the calculation process of the matching power consumption includes:

[0049]

[0050] Where N t is the number of match-action tables, p k (.) represents the power consumed by matching a match-action table, a represents the matching algorithm, N r Indicates the number of matching rules, N k Indicates the number of matching keys, W k Indicates the matching key width, r indicates the current traffic rate. Will match N t The power consumed by each matching-action table is accumulated to obtain the matching power.

[0051] Furthermore, the action component power consumption is calculated by summing the action power consumption of each match-action table. Each match-action table can allow the execution of multiple independent operations, and the maximum power consumption of these operations is taken as the action power consumption of this match-action table. The action power consumption calculation process includes:

[0052]

[0053] Where N t is the number of match-action tables, N action Indicates the number of operations in the table, Represents the action power consumption of the jth operation in a table;

[0054] Among them, the action power consumption P of a matching-action table action Power consumption of stateful operation P sf and stateless operation power consumption P sl The stateful operation is abstracted as the read / write operation in a one-dimensional array; the stateless operation mainly focuses on the read / write operation of data, which can be classified as the assignment operation; the action power consumption of a single table P action Power consumption of stateful operation P sf and stateless operation power consumption P sl The composition is expressed as follows:

[0055] P action =P sf +P sl

[0056] Among them, the stateful operation power consumption P sf and stateless operation power consumption P sl The expression is as follows:

[0057]

[0058] Where N sf Represents the number of stateful operations, N sl Represents the number of stateless operations, Indicates the read width of the u-th operation, represents the write width of the u-th operation, and r represents the flow rate; since the u-th atomic operation is only a read operation or a write operation, and Either the value is 0 or the full length. ; Indicates the width of the u-th stateless operation, p r (.) represents the power consumption of the read width of the u-th stateful operation under the flow r, p w (.) represents the power consumption of the write width of the u-th stateful operation under the flow rate r, p sl (.) represents the power consumption of the width of the u-th stateless operation under traffic r.

[0059] Step S3: Based on the control variable method, several test cases are generated for the parser operation component, the matching operation component, and the action operation component respectively, and the test cases are deployed on the target programmable switch to obtain the actual power consumption data, and the parser power consumption parsing formula, the matching power consumption parsing formula, and the action power consumption parsing formula are fitted based on this data; the parser power consumption parsing formula, the matching power consumption parsing formula, and the action power consumption parsing formula are substituted into the power consumption estimation model to obtain the power consumption estimation model for the target programmable switch, thereby estimating the power consumption of the target programmable switch.

[0060] Specifically, if Figure 2 As shown, step S3 includes the following sub-steps:

[0061] Step S301: Generate a plurality of first test cases, a plurality of second test cases, and a plurality of third test cases for the parser operation component, the matching operation component, and the action operation component respectively based on the control variable method.

[0062] Specifically, based on the control variable method, a plurality of first test cases are generated by adjusting the number of parsed packet headers, the width of the packet headers, and the flow rate for the parser operation component;

[0063] Based on the control variable method for the matching operation component, several second test cases are generated by adjusting the number of matching rules, the number of matching fields, the matching algorithm type, the length of the matching field, and the traffic rate;

[0064] Based on the control variable method for action operation components, several third test cases are generated by adjusting stateful operations and stateless operations. The stateful operations include register read and write frequencies, and the stateless operations include the number of assignment operations and operation width.

[0065] Step S302: deploy a first test case on the target programmable switch, obtain first actual power consumption data, and obtain a parser power consumption equation based on the first actual power consumption data, i.e., p h (.) analytical expression; deploy a second test case on the target programmable switch, obtain the second actual power consumption data, and fit the matching power consumption analytical expression according to the second actual power consumption data, that is, p k (.) analytical expression; deploy the third test case on the target programmable switch, obtain the third power consumption actual data, and fit the action power consumption analytical expression according to the third power consumption actual data, that is, p r (.), p w (.), p sl The analytical expression of (.).

[0066] Step S303: Substitute the parser power consumption equation, the matching power consumption equation, and the action power consumption equation into the power consumption estimation model to obtain a power consumption estimation model for the target programmable switch, thereby estimating the power consumption of the target programmable switch.

[0067] Accordingly, the present application also provides an electronic device, comprising: one or more processors; a memory for storing one or more programs; when the one or more programs are executed by the one or more processors, the one or more processors implement the above-mentioned method for estimating power consumption of a programmable switch based on component decomposition. Figure 3 As shown in FIG, a hardware structure diagram of any device with data processing capability in which the method for estimating power consumption of a programmable switch based on component decomposition provided by an embodiment of the present invention is provided, except Figure 3 In addition to the processor, memory, and network interface shown, any device with data processing capabilities in which the apparatus in the embodiment is located may also include other hardware, generally based on the actual functions of the device with data processing capabilities, which will not be described in detail.

[0068] Accordingly, the present application also provides a computer-readable storage medium having computer instructions stored thereon, which, when executed by a processor, implement the above-mentioned method for estimating power consumption of a programmable switch based on component decomposition. The computer-readable storage medium may be an internal storage unit of any device with data processing capabilities described in any of the aforementioned embodiments, such as a hard disk or memory. The computer-readable storage medium may also be an external storage device, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), an SD card, a flash card (Flash Card), etc. equipped on the device. Furthermore, the computer-readable storage medium may also include both an internal storage unit and an external storage device of any device with data processing capabilities. The computer-readable storage medium is used to store the computer program and other programs and data required by any device with data processing capabilities, and may also be used to temporarily store data that has been output or is to be output.

[0069] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the contents disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present application that follow the general principles of this application and include common knowledge or customary techniques in the art not disclosed herein. The description and examples are to be considered as exemplary only.

[0070] It will be understood that the present application is not limited to the exact construction that has been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof.

Claims

1. A method for estimating power consumption of a programmable switch based on component decomposition, characterized in that: The method comprises the following steps: Decompose the data packet processing flow into parser operation component, matching operation component, and action operation component; Constructing a power consumption estimation model; wherein the total power consumption in the power consumption estimation model is the sum of the operating power consumption and the basic power consumption; the basic power consumption is the sum of the idle power consumption, the port configuration power consumption, and the basic forwarding power consumption; the operating power consumption is the sum of the parser power consumption corresponding to the parser operation component, the matching power consumption corresponding to the matching operation component, and the action power consumption corresponding to the action operation component; Based on the control variable method, several test cases are generated for the parser operation component, matching operation component, and action operation component respectively. The test cases are deployed on the target programmable switch to obtain the actual power consumption data, and the parser power consumption parsing formula, matching power consumption parsing formula, and action power consumption parsing formula are fitted based on this data. The parser power consumption parsing formula, matching power consumption parsing formula, and action power consumption parsing formula are substituted into the power consumption estimation model to obtain the power consumption estimation model for the target programmable switch, thereby estimating the power consumption of the target programmable switch.

2. The method for estimating power consumption of a programmable switch based on component decomposition according to claim 1, characterized in that: The calculation process of the port configuration power consumption includes: The port configuration power consumption P port is the port connection power consumption P conn and port enable power consumption P enb The sum of the port connection power consumption P conn and port enable power consumption P enb The expression is as follows: Where N c and N e are the number of connected ports and the number of enabled ports, respectively. c and p e This is the power consumption when a single port is connected and enabled.

3. The method for estimating power consumption of a programmable switch based on component decomposition according to claim 1, characterized in that: The calculation process of the resolver power consumption includes: Where N h is the number of packet headers, The flow rate r is parsed and the package width is The power consumption of the head.

4. The method for estimating power consumption of a programmable switch based on component decomposition according to claim 1, wherein: The calculation process of the matching power consumption includes: Where N t is the number of match-action tables, p k (.) represents the power consumed by matching a match-action table, a represents the matching algorithm, N r Indicates the number of matching rules, N k Indicates the number of matching keys, W k represents the matching key width, and r represents the current traffic rate.

5. The method for estimating power consumption of a programmable switch based on component decomposition according to claim 1, wherein: The calculation process of the action power consumption includes: Where N t is the number of match-action tables, N action Indicates the number of operations in the table, Represents the action power consumption of the jth operation in a table; Among them, the action power consumption P of a matching-action table action Power consumption of stateful operation P sf and stateless operation power consumption P sl Composition; Among them, the state operation power consumption P sf and stateless operation power consumption P sl The expression is as follows: Where N sf Represents the number of stateful operations, N sl Represents the number of stateless operations, Indicates the read width of the u-th operation, represents the write width of the u-th operation, r represents the flow rate, Indicates the width of the u-th stateless operation, p r (.) represents the power consumption of the read width of the u-th stateful operation under the flow r, p w (.) represents the power consumption of the write width of the u-th stateful operation under the flow rate r, p sl (.) represents the power consumption of the width of the u-th stateless operation under traffic r.

6. The method for estimating power consumption of a programmable switch based on component decomposition according to claim 1, characterized in that: The process of estimating the power consumption of a target programmable switch includes: Generate a plurality of first test cases, a plurality of second test cases, and a plurality of third test cases for the parser operation component, the matching operation component, and the action operation component respectively based on the control variable method; A first test case is deployed on the target programmable switch to obtain first actual power consumption data, and a parser power consumption equation is obtained by fitting based on the first actual power consumption data. A second test case is deployed on the target programmable switch to obtain second actual power consumption data, and a matching power consumption equation is obtained by fitting based on the second actual power consumption data. A third test case is deployed on the target programmable switch to obtain third actual power consumption data, and an action power consumption equation is obtained by fitting based on the third actual power consumption data. The parser power consumption parsing formula, the matching power consumption parsing formula, and the action power consumption parsing formula are substituted into the power consumption estimation model to obtain the power consumption estimation model for the target programmable switch, thereby estimating the power consumption of the target programmable switch.

7. The method for estimating power consumption of a programmable switch based on component decomposition according to claim 6, characterized in that: The process of generating a plurality of first test cases, a plurality of second test cases, and a plurality of third test cases for the parser operation component, the matching operation component, and the action operation component based on the control variable method includes: Based on the control variable method for the parser operation component, a plurality of first test cases are generated by adjusting the number of parsed packet headers, the width of the packet headers, and the flow rate; Based on the control variable method for the matching operation component, several second test cases are generated by adjusting the number of matching rules, the number of matching fields, the matching algorithm type, the length of the matching field, and the traffic rate; Based on the control variable method for action operation components, several third test cases are generated by adjusting stateful operations and stateless operations. The stateful operations include register read and write frequencies, and the stateless operations include the number of assignment operations and operation width.

8. An electronic device comprising a memory and a processor, characterized in that: The memory is coupled to the processor; wherein the memory is used to store program data, and the processor is used to execute the program data to implement the programmable switch power consumption estimation method according to any one of claims 1 to 7.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method for estimating power consumption of a programmable switch according to any one of claims 1 to 7 is implemented.

10. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instruction is executed by a processor, the method for estimating power consumption of a programmable switch according to any one of claims 1 to 7 is implemented.