CN108881032B - P4 pipeline performance improving method based on matching optimization - Google Patents

P4 pipeline performance improving method based on matching optimization Download PDF

Info

Publication number
CN108881032B
CN108881032B CN201810626203.XA CN201810626203A CN108881032B CN 108881032 B CN108881032 B CN 108881032B CN 201810626203 A CN201810626203 A CN 201810626203A CN 108881032 B CN108881032 B CN 108881032B
Authority
CN
China
Prior art keywords
matching
action
action table
rule
merged
Prior art date
Legal status (The legal status 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 status listed.)
Active
Application number
CN201810626203.XA
Other languages
Chinese (zh)
Other versions
CN108881032A (en
Inventor
张栋
陈翔
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Fuzhou University
Original Assignee
Fuzhou University
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 Fuzhou University filed Critical Fuzhou University
Priority to CN201810626203.XA priority Critical patent/CN108881032B/en
Publication of CN108881032A publication Critical patent/CN108881032A/en
Application granted granted Critical
Publication of CN108881032B publication Critical patent/CN108881032B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/74Address processing for routing
    • H04L45/745Address table lookup; Address filtering
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/448Execution paradigms, e.g. implementations of programming paradigms
    • G06F9/4482Procedural
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L49/00Packet switching elements
    • H04L49/25Routing or path finding in a switch fabric

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Devices For Executing Special Programs (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The invention relates to a P4 pipeline performance improving method based on matching optimization, which comprises the following steps: s1: generating a dependency relationship graph of the matching action tables, and acquiring the matching dependency relationship between the P4 matching action tables; s2: determining a P4 matching action table to be merged according to the matching dependency relationship between the P4 matching action tables and the pre-optimized matching times; s3: the method comprises the steps of representing a matching key of a P4 matching action table to be merged on a composite P4 matching action table, and representing an action attribute of a P4 matching action table to be merged on a flow control program of a P4 program; s4: outputting the optimized P4 program, and deploying to a bottom-layer P4 switch; s5: and converting the P4 matching action table rule issued at the runtime into an actual rule. Compared with the prior art, the redundant matching operation between the P4 matching action tables is combined to optimize the P4 production line, so that the performance of the production line is improved, the method is simple, the implementation is flexible, and the practicability is high.

Description

P4 pipeline performance improving method based on matching optimization
Technical Field
The invention relates to the field of software defined networks and programmable data planes, a data plane programmable language P4 and a switch pipeline processing architecture, in particular to a P4 pipeline performance improving method based on matching optimization.
Background
The P4 language is a domain specific language that describes the datagram processing pipeline of a data plane device. It allows the user to define the structure of the datagram header using a programmable parser and declare that P4 matches the action table. A P4 program consists of a header, a parse graph, actions, a P4 match action table and a flow control program. The header defines the format of the header of the datagram, including header fields and size; the parsing diagram specifies the legal order of the datagram headers; actions are processed on the basis of a user-defined set of operations, an action being invoked when a datagram matches an entry in the P4 matching action table, or in the flow control program by passing in an action parameter; a P4 match action table consisting of match keys and action attributes, which matches datagrams based on the match keys and selects an action declared in the action attributes to execute on the matched datagram; the matching key is a list consisting of (e, m), where e denotes a matching field of the match, and m is a matching type; the flow control program indicates that P4 matches the execution order of the action table and the processing operations of the P4 pipeline.
Disclosure of Invention
The present invention is directed to overcoming the above-mentioned drawbacks of the prior art and providing a method for improving the performance of a P4 pipeline based on matching optimization, which improves the performance of a P4 pipeline described by a given P4 program by merging redundant matching operations between different P4 matching action tables in the program.
The purpose of the invention can be realized by the following technical scheme:
a P4 pipeline performance improving method based on matching optimization comprises the following steps:
s1: generating a dependency relationship graph of a matching action table corresponding to an input P4 program, wherein the dependency relationship graph of the matching action table is a directed acyclic graph which takes a P4 matching action table as a node and takes execution sequences among different P4 matching action tables as edges, and modifying the dependency relationship graph of the matching action table to obtain the matching dependency relationship among the P4 matching action tables;
s2: determining a P4 matching action table to be merged according to the matching dependency relationship between the P4 matching action tables and the pre-optimized matching times;
s3: the method comprises the steps of representing a matching key of a P4 matching action table to be merged on a composite P4 matching action table, and representing an action attribute of a P4 matching action table to be merged on a flow control program of a P4 program;
s4: outputting the optimized P4 program, and deploying to a bottom-layer P4 switch;
s5: and converting the P4 matching action table rule issued at the runtime into an actual rule.
In step S1, the modifying the dependency graph of the matching action table specifically includes:
in the dependency graph of the matching action table, attaching the matching keywords to the node corresponding to the P4 matching action table, and attaching the datagram fields modified by the actions referenced in the action attributes of the matching action table to the node corresponding to the P4 matching action table;
the specific method for obtaining the matching dependency relationship between the P4 matching action tables is as follows:
and judging whether the matching keywords attached to the first-order P4 matching action table contain datagram fields attached to the next-order P4 matching action table, if so, determining that a matching dependency relationship exists between the two P4 matching action tables, and if not, determining that a matching dependency relationship does not exist between the two P4 matching action tables.
The step S2 specifically includes:
s2-1: for each branch of the dependency graph of the matching action table, generating a maximum node independent set corresponding to the current branch according to the matching dependency among the P4 matching action tables, wherein the maximum node independent set is a set with the maximum number of nodes, and no matching dependency exists among the P4 matching action tables corresponding to the nodes in the maximum node independent set;
s2-2: for the maximum node independent set generated by the branches of each matching action table dependency relationship graph, carrying out pre-optimization on the nodes in the maximum node independent set by adopting a mode of merging the matching keywords of the nodes, and calculating the matching times used by the nodes in the maximum node independent set after the pre-optimization;
s2-3: and comparing the independent sets of the maximum nodes corresponding to different branches, and selecting all the P4 matching action tables in the independent set of the maximum nodes with the least matching times as P4 matching action tables to be merged.
In the step S3, the matching keywords indicating the P4 matching action table to be merged on the composite P4 matching action table are specifically:
combining the matching keywords of the P4 matching action table to be combined to serve as the matching keywords of the composite P4 matching action table, and introducing composite actions in the action attributes of the composite P4 matching action table, wherein the composite actions receive all action parameters of the actions referenced by the P4 matching action table to be combined, and record the action parameters in local variables in a flow control program of a P4 program.
In the step S3, the action attribute indicating that the P4 matching action table to be merged is specifically, on the flow control program of the P4 program:
1) introducing an action ID and a default action ID, wherein the action ID is used for indicating whether a certain action referenced by the P4 matching action table to be merged is executed or not, the default action ID is used for indicating whether a certain action referenced by the P4 matching action table to be merged is executed in a default action mode or not, and the values of the action ID and the default action ID are introduced by a user rule during the operation;
2) the P4 matching action table reference statements to be merged in the flow control program of the P4 program are modified using the action ID and the default action ID.
The step 2) is specifically as follows:
21) two boolean variables "isDefaultAction" and "tableHit" are declared in the flow control program of the P4 program;
22) replacing the reference statement of the P4 matching action table to be merged with a statement calling the action referenced by the P4 matching action table to be merged;
23) the method for calling the statements of different actions through the if-else statement division specifically comprises the following steps: in the branch judgment logic of the if-else statement, a shift operation is used for the action ID and the default action ID to judge which action is executed in the calling statement, if the action ID and the default action ID indicate the same action, or the action ID indicates the action but the default action ID does not indicate the action, the action ID is set as false, and the tableHit is set as true to represent that the action indicated by the action ID is executed on the current datagram; if the action ID does not indicate the action and the action indicated by the default action ID, setting 'isdefaultAction' as true, and setting 'tableHit' as false, which indicates that the action indicated by the default action ID is executed in a default action mode on the current datagram; if neither the action ID nor the default action ID indicates an action, setting 'isdefaultAction' as false, and setting 'tableHit' as false, which indicates that no action is performed on the current datagram;
24) if the P4 to be merged is used in the flow control program of the P4 program to match the inherent Boolean attribute field in the action table, then "isdefaultAction" and "tableHit" are used instead.
The step S5 specifically includes:
s5-1: converting the P4 matching action table rule into an actual rule according to the type of the issued P4 matching action table rule, wherein the P4 matching action table rule and the actual rule are composed of a target P4 matching action table name, an execution action name, a matching keyword and an execution action parameter;
s5-2: and judging whether the current actual rule conflicts with the existing table entry of the composite P4 matching action table to generate a matching keyword, if so, merging the actual rule with the existing table entry of the composite P4 matching action table, merging and then issuing the actual rule, and if not, directly issuing the actual rule.
The step S5-1 specifically includes:
initializing a rule facing a composite P4 matching action table as an actual rule, wherein a matching keyword and an execution action parameter in the actual rule are respectively corresponding to a matching keyword and an execution action parameter in a delivered P4 matching action table rule, a P4 matching action table name and an execution action name in the actual rule are respectively corresponding to a name of a composite P4 matching action table and a name of a composite action, determining values of an action ID and a default action ID according to the execution action name and the target P4 matching action table name, and adding the action ID and the default action ID to the execution action parameter of the actual rule.
In step S5-2, if the actual rule and the table entry of a compound P4 matching action table can match the same flow according to the matching keyword, it is determined that a matching keyword conflict occurs; if the actual rule and any entry of the composite P4 matching action table cannot match the same traffic according to the matching key, it is determined that no matching key conflict occurs.
In step S5-2, the concrete steps of merging the actual rule with the existing entry of the composite P4 matching action table are as follows: initializing a new rule, combining the matching keywords contained in the actual rule with the matching keywords contained in the compound P4 matching action table item conflicting with the actual rule through a mask, taking the combined matching keywords as the matching keywords of the new rule, taking the rest parts of the new rule as the corresponding parts in the actual rule, and issuing the new rule as the actual rule.
Compared with the prior art, the invention has the following advantages: performance enhancements for the P4 pipeline are achieved by merging redundant matching operations between different P4 matching action tables in a given P4 program. The method is simple and convenient, flexible to realize and high in practicability.
Drawings
FIG. 1 is a schematic diagram of a framework structure of a P4 pipeline performance improvement method based on matching optimization according to the present invention;
FIG. 2 is a flowchart of a method for improving the performance of a P4 pipeline based on matching optimization according to the present invention;
fig. 3 is a flowchart of issuing the actual rule in step S5.
Detailed Description
The invention is described in detail below with reference to the figures and specific embodiments. The present embodiment is implemented on the premise of the technical solution of the present invention, and a detailed implementation manner and a specific operation process are given, but the scope of the present invention is not limited to the following embodiments.
As shown in fig. 1 and 2, a method for improving performance of a P4 pipeline based on matching optimization determines a P4 matching action table to be merged by analyzing matching dependency relationships between P4 matching action tables and matching times after pipeline pre-optimization, optimizes a P4 pipeline by merging the P4 matching action table to be merged, deploys an optimized P4 program to a bottom-layer switch, and converts a P4 matching action table rule issued during user operation into an actual rule to ensure consistency of user policies, which includes the following steps:
s1: and generating a dependency relationship graph of a matching action table corresponding to the input P4 program, and modifying the dependency relationship graph of the matching action table to obtain the matching dependency relationship between the P4 matching action tables.
In step S1, the dependency graph of the matching action table is defined as a directed acyclic graph with the P4 matching action table as a node and the execution order between different P4 matching action tables as an edge.
The match dependency represents a read-after-write dependency between two P4 matching action tables.
The modification of the matching action table dependency graph includes appending the matching key to the P4 matching action table node in the matching action table dependency graph and appending the datagram fields modified by the actions referenced in the matching action table action attributes to the P4 matching action table node in the matching action table dependency graph.
The method for obtaining the matching dependency relationship between the P4 matching action tables is to judge whether the matching keywords attached to the first-order P4 matching action table contain the datagram fields attached to the next-order P4 matching action table, if yes, the matching dependency relationship exists between the two P4 matching action tables, otherwise, the matching dependency relationship does not exist.
S2: and marking the P4 matching action table to be merged according to the matching dependency relationship among the P4 matching action tables and the matching times after the pipeline is pre-optimized. The method specifically comprises the following steps:
s2-1: for each branch of the dependency graph of the matching action table, generating a maximum node independent set corresponding to the current branch according to the matching dependency among the P4 matching action tables;
the independent set of the maximum nodes in the step S2-1 is defined as a set having the maximum number of nodes of the P4 matching action table, wherein the nodes of the P4 matching action table have no matching dependency relationship;
s2-2: for the independent set of the maximum nodes generated by the branches of each dependency graph of the matching action table, pre-merging the nodes of the P4 matching action table in the set, and calculating the matching times used by the nodes of the P4 matching action table in the independent set of the maximum nodes after merging;
the method for pre-merging the P4 matched action table nodes in the maximum node independent set in the step S2-2 is to merge the matching keywords of the P4 matched action table nodes;
s2-3: and comparing the independent sets of the maximum nodes corresponding to different branches, selecting the independent set of the maximum nodes with the least matching times used by the P4 matched action table nodes in the set, and marking all the P4 matched action table nodes in the set.
S3: the matching keywords and the action attributes of the P4 matching action table to be merged are separated and are represented in a composite matching action table and on the flow control program of the P4 program respectively.
In step S3, the matching key of the composite P4 matching action table is a matching key obtained by merging the P4 matching action tables to be merged, the action attribute of the composite P4 matching action table only declares one composite action, and the composite action receives all the action parameters of the actions referenced by the P4 matching action table to be merged, and records the action parameters in the local variables in the flow control program of the P4 program.
The method for representing the matching keywords of the P4 matching action table to be merged in the composite P4 matching action table specifically comprises the steps of merging the matching keywords of the P4 matching action table to be merged, using the merged matching keywords as the matching keywords of the composite P4 matching action table, and introducing composite actions in the action attributes of the composite P4 matching action table.
The method for representing the action attribute of the P4 matching action table to be merged in the flow control program of the P4 program specifically comprises the following steps:
1) introducing an action ID and a default action ID, wherein the action ID is used for indicating whether a certain action is executed or not, the default action ID is used for indicating whether the certain action is executed in a default action mode or not, and each bit of the IDs corresponds to the state of a certain action referenced by a P4 matching action table to be merged; for example, action ID "0101" indicates that P4 to be merged is executed to match the first action and the third action referenced by the action table, and default action ID "0001" indicates that the first action is executed with default parameters. The values of the action ID and default action ID are passed in by the user rules at runtime;
2) and replacing the reference statement of the P4 matching action table to be merged in the flow control program of the original P4 program by the action ID and the default action ID. The method comprises the following steps:
21) declaring two Boolean variables 'isDefaultAction' and 'tableHit' in a flow control program of a P4 program, wherein the 'isDefaultAction' represents that a default action is executed on a current datagram when the 'isDefaultAction' is true, the 'tableHit' represents that the current datagram is matched with a certain table entry in a P4 matching action table to be merged when the 'tableHit' is true, and the 'isDefaultAction' and the 'tableHit' represent that no action is executed when the 'isDefaultAction' and the 'tableHit' are false;
22) replacing the reference statement of the P4 matching action table to be merged with a statement calling the action referenced by the P4 matching action table to be merged;
step 22), calling an action statement, namely transferring an action parameter recorded in a local variable into a corresponding action in a flow control program of the P4 program to realize the calling of the action;
23) statements that call different actions are divided by if-else statements. In the branch decision logic of the if-else statement, a shift operation is used on the action ID and the default action ID to decide which action's call statement to execute. If the action ID and the default action ID indicate the same action, or the action ID indicates the action but the default action ID does not indicate the action, setting the "isdefaultAction" as false and "tableHit" as true; if the action ID does not indicate an action and the default action ID indicates an action, setting "isdefaultAction" to true and "tableHit" to false; if neither the action ID nor the default action ID indicates an action, setting "isdefaultAction" as false, and setting "tableHit" as false;
24) if the P4 to be merged is used in the flow control program of the P4 program to match the inherent Boolean attribute field in the action table, then "isdefaultAction" and "tableHit" are used instead. Wherein, the inherent Boolean attribute field is the "hit" field or the "action _ run" field in the P4 matching action table.
S4: and outputting the optimized P4 program and deploying to the bottom-layer P4 switch. The method specifically comprises the following steps: the P4 program is input into the P4 compiler, the configuration of the target device is generated, and the configuration is deployed to the target device.
S5: in order to ensure the consistency of the user strategy, the P4 matching action table rule issued during the operation of the user is converted into an actual rule.
The consistency of the user policy in step S5 may be defined as the consistency of the user runtime issuance P4 matching the rule semantics of the action table, or the consistency of the user intention.
The P4 matching action table rule and the actual rule issued by the user during the operation are composed of a target P4 matching action table name, an execution action name, a matching keyword and an execution action parameter part.
The P4 matching action table rule issued by the user during the operation is converted into the item of the P4 matching action table after the successful issuing. And the actual rule will translate to an entry in the compound P4 matching action table after successful issuance.
As shown in fig. 3, the method for converting the P4 matching action table rule issued during the running of the user into the actual rule specifically includes the following steps:
s5-1: and converting the P4 matched action table rule into an actual rule according to the type of the P4 matched action table rule issued by the user.
The types of P4 matching action table rules in step S5-1 include, but are not limited to, adding entries, deleting entries, and setting default actions.
A method for converting the rule of the P4 matching action table into an actual rule, specifically, initializing a rule facing the composite P4 matching action table as the actual rule, and filling the matching keywords and the execution action parameters in the rule of the P4 matching action table into the matching keywords and the execution action parameters in the actual rule respectively; the P4 matched action table name and the executed action name of the actual rule are the name of the compound P4 matched action table and the name of the compound action respectively; meanwhile, the values of the action ID and the default action ID are determined from the name of the executed action and the name of the target P4 matching action table, and the action ID and the default action ID are appended to the executed action parameter part of the actual rule.
S5-2: and detecting whether the current actual rule generates a matching keyword conflict with the existing table entry of the composite P4 matching action table, if so, merging the actual rule with the existing table entry of the composite P4 matching action table, merging and then issuing, otherwise, directly issuing the actual rule.
The method for determining whether a matching keyword conflict occurs in step S5-2 is as follows: if the actual rule and the table entry of a certain composite P4 matching action table can match the same flow according to the matching keywords, determining that the matching keywords conflict; if the actual rule and any entry of the composite P4 matching action table cannot match the same traffic according to the matching key, it is determined that no matching key conflict occurs.
The method for merging the actual rule with the existing table entry of the composite P4 matching action table specifically comprises the following steps: initializing a rule facing to a composite P4 matching action table, merging the matching keywords contained in the actual rule and the matching keywords contained in the composite P4 matching action table item conflicting with the actual rule through a mask, taking the merged matching keywords as the matching keywords of the newly-created rule, and enabling the rest parts of the newly-created rule to be equal to the corresponding parts in the actual rule.

Claims (8)

1. A P4 pipeline performance improving method based on matching optimization is characterized by comprising the following steps:
s1: generating a dependency relationship graph of a matching action table corresponding to an input P4 program, wherein the dependency relationship graph of the matching action table is a directed acyclic graph which takes a P4 matching action table as a node and takes execution sequences among different P4 matching action tables as edges, and modifying the dependency relationship graph of the matching action table to obtain the matching dependency relationship among the P4 matching action tables;
s2: determining a P4 matching action table to be merged according to the matching dependency relationship between the P4 matching action tables and the pre-optimized matching times;
s3: the method comprises the steps of representing a matching key of a P4 matching action table to be merged on a composite P4 matching action table, and representing an action attribute of a P4 matching action table to be merged on a flow control program of a P4 program;
s4: outputting the optimized P4 program, and deploying to a bottom-layer P4 switch;
s5: converting the P4 matching action table rule issued in operation into an actual rule;
in step S1, the modifying the dependency graph of the matching action table specifically includes:
in the dependency graph of the matching action table, attaching the matching keywords to the node corresponding to the P4 matching action table, and attaching the datagram fields modified by the actions referenced in the action attributes of the matching action table to the node corresponding to the P4 matching action table;
the specific method for obtaining the matching dependency relationship between the P4 matching action tables is as follows:
judging whether the matching keywords attached to the first-order P4 matching action table contain datagram fields attached to the next-order P4 matching action table, if so, determining that a matching dependency relationship exists between the two P4 matching action tables, and if not, determining that a matching dependency relationship does not exist between the two P4 matching action tables;
the step S2 specifically includes:
s2-1: for each branch of the dependency graph of the matching action table, generating a maximum node independent set corresponding to the current branch according to the matching dependency among the P4 matching action tables, wherein the maximum node independent set is a set with the maximum number of nodes, and no matching dependency exists among the P4 matching action tables corresponding to the nodes in the maximum node independent set;
s2-2: for the maximum node independent set generated by the branches of each matching action table dependency relationship graph, carrying out pre-optimization on the nodes in the maximum node independent set by adopting a mode of merging the matching keywords of the nodes, and calculating the matching times used by the nodes in the maximum node independent set after the pre-optimization;
s2-3: and comparing the independent sets of the maximum nodes corresponding to different branches, and selecting all the P4 matching action tables in the independent set of the maximum nodes with the least matching times as P4 matching action tables to be merged.
2. The method for improving performance of a P4 pipeline based on matching optimization as claimed in claim 1, wherein in step S3, the matching key words that represent the P4 matching action table to be merged on the composite P4 matching action table specifically include:
combining the matching keywords of the P4 matching action table to be combined to serve as the matching keywords of the composite P4 matching action table, and introducing composite actions in the action attributes of the composite P4 matching action table, wherein the composite actions receive all action parameters of the actions referenced by the P4 matching action table to be combined, and record the action parameters in local variables in a flow control program of a P4 program.
3. The method as claimed in claim 1, wherein in step S3, the action attributes indicating the P4 matching action table to be merged on the flow control program of the P4 program are specifically:
1) introducing an action ID and a default action ID, wherein the action ID is used for indicating whether a certain action referenced by the P4 matching action table to be merged is executed or not, the default action ID is used for indicating whether a certain action referenced by the P4 matching action table to be merged is executed in a default action mode or not, and the values of the action ID and the default action ID are introduced by a user rule during the operation;
2) the P4 matching action table reference statements to be merged in the flow control program of the P4 program are modified using the action ID and the default action ID.
4. The method for improving the performance of the P4 pipeline based on the matching optimization as claimed in claim 3, wherein the step 2) is specifically as follows:
21) two boolean variables "isDefaultAction" and "tableHit" are declared in the flow control program of the P4 program;
22) replacing the reference statement of the P4 matching action table to be merged with a statement calling the action referenced by the P4 matching action table to be merged;
23) the method for calling the statements of different actions through the if-else statement division specifically comprises the following steps: in the branch judgment logic of the if-else statement, a shift operation is used for the action ID and the default action ID to judge which action is executed in the calling statement, if the action ID and the default action ID indicate the same action, or the action ID indicates the action but the default action ID does not indicate the action, the action ID is set as false, and the tableHit is set as true to represent that the action indicated by the action ID is executed on the current datagram; if the action ID does not indicate the action and the action indicated by the default action ID, setting 'isdefaultAction' as true, and setting 'tableHit' as false, which indicates that the action indicated by the default action ID is executed in a default action mode on the current datagram; if neither the action ID nor the default action ID indicates an action, setting 'isdefaultAction' as false, and setting 'tableHit' as false, which indicates that no action is performed on the current datagram;
24) if the P4 to be merged is used in the flow control program of the P4 program to match the inherent Boolean attribute field in the action table, then "isdefaultAction" and "tableHit" are used instead.
5. The method for improving the performance of a P4 pipeline based on matching optimization as claimed in claim 1, wherein the step S5 specifically comprises:
s5-1: converting the P4 matching action table rule into an actual rule according to the type of the issued P4 matching action table rule, wherein the P4 matching action table rule and the actual rule are composed of a target P4 matching action table name, an execution action name, a matching keyword and an execution action parameter;
s5-2: and judging whether the current actual rule conflicts with the existing table entry of the composite P4 matching action table to generate a matching keyword, if so, merging the actual rule with the existing table entry of the composite P4 matching action table, merging and then issuing the actual rule, and if not, directly issuing the actual rule.
6. The method for improving the performance of the P4 pipeline based on the matching optimization as claimed in claim 5, wherein the step S5-1 specifically comprises:
initializing a rule facing a composite P4 matching action table as an actual rule, wherein a matching keyword and an execution action parameter in the actual rule are respectively corresponding to a matching keyword and an execution action parameter in a delivered P4 matching action table rule, a P4 matching action table name and an execution action name in the actual rule are respectively corresponding to a name of a composite P4 matching action table and a name of a composite action, determining values of an action ID and a default action ID according to the execution action name and the target P4 matching action table name, and adding the action ID and the default action ID to the execution action parameter of the actual rule.
7. The method for improving P4 pipeline performance based on matching optimization as claimed in claim 5, wherein in step S5-2, if the actual rule and the entry of a composite P4 matching action table can match the same flow according to the matching keyword, it is determined that the matching keyword conflicts; if the actual rule and any entry of the composite P4 matching action table cannot match the same traffic according to the matching key, it is determined that no matching key conflict occurs.
8. The method for improving performance of a P4 pipeline based on matching optimization as claimed in claim 5, wherein in the step S5-2, the merging of the actual rule and the existing entry of the composite P4 matching action table specifically comprises: initializing a new rule, combining the matching keywords contained in the actual rule with the matching keywords contained in the compound P4 matching action table item conflicting with the actual rule through a mask, taking the combined matching keywords as the matching keywords of the new rule, taking the rest parts of the new rule as the corresponding parts in the actual rule, and issuing the new rule as the actual rule.
CN201810626203.XA 2018-06-19 2018-06-19 P4 pipeline performance improving method based on matching optimization Active CN108881032B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810626203.XA CN108881032B (en) 2018-06-19 2018-06-19 P4 pipeline performance improving method based on matching optimization

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810626203.XA CN108881032B (en) 2018-06-19 2018-06-19 P4 pipeline performance improving method based on matching optimization

Publications (2)

Publication Number Publication Date
CN108881032A CN108881032A (en) 2018-11-23
CN108881032B true CN108881032B (en) 2021-01-29

Family

ID=64339444

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810626203.XA Active CN108881032B (en) 2018-06-19 2018-06-19 P4 pipeline performance improving method based on matching optimization

Country Status (1)

Country Link
CN (1) CN108881032B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111147326A (en) * 2019-12-19 2020-05-12 芯创智(北京)微电子有限公司 Network packet processor and data packet processing method
CN113037634B (en) * 2021-03-31 2022-12-06 深圳市芯源网络科技有限公司 Processing method, logic circuit and equipment for matching action table based on FPGA
CN113986560B (en) * 2021-12-27 2022-03-25 浙江锐文科技有限公司 Method for realizing P4 and OvS logic multiplexing in intelligent network card/DPU
CN115309406B (en) * 2022-09-30 2022-12-20 北京大禹智芯科技有限公司 Performance optimization method and device of P4 control branch statement

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101674290A (en) * 2008-11-26 2010-03-17 天津大学 Semantics-based automatic service combination system for web service relation network
CN102354308A (en) * 2011-06-30 2012-02-15 中国科学技术大学 Fast package classification rule set compression method
JP2014174957A (en) * 2013-03-13 2014-09-22 Seiko Epson Corp Device server and information processing system
CN106227573A (en) * 2016-07-11 2016-12-14 北京信息科技大学 Function call path extraction method based on controlling stream graph
CN107688488A (en) * 2016-08-03 2018-02-13 中国移动通信集团湖北有限公司 A kind of optimization method and device of the task scheduling based on metadata
CN109049648A (en) * 2018-09-20 2018-12-21 福州大学 A kind of initial unbalance loading means for correcting of the walking beam of composite material press and bearing calibration

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101674290A (en) * 2008-11-26 2010-03-17 天津大学 Semantics-based automatic service combination system for web service relation network
CN102354308A (en) * 2011-06-30 2012-02-15 中国科学技术大学 Fast package classification rule set compression method
CN102354308B (en) * 2011-06-30 2012-11-21 中国科学技术大学 Fast package classification rule set compression method
JP2014174957A (en) * 2013-03-13 2014-09-22 Seiko Epson Corp Device server and information processing system
CN106227573A (en) * 2016-07-11 2016-12-14 北京信息科技大学 Function call path extraction method based on controlling stream graph
CN107688488A (en) * 2016-08-03 2018-02-13 中国移动通信集团湖北有限公司 A kind of optimization method and device of the task scheduling based on metadata
CN109049648A (en) * 2018-09-20 2018-12-21 福州大学 A kind of initial unbalance loading means for correcting of the walking beam of composite material press and bearing calibration

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
P4语言编程详解;WO非你杯茶;《URL:http://www.sdnlab.com/17882.html》;20160928;全文 *

Also Published As

Publication number Publication date
CN108881032A (en) 2018-11-23

Similar Documents

Publication Publication Date Title
CN108881032B (en) P4 pipeline performance improving method based on matching optimization
US7363312B2 (en) Combining data descriptions
Ramalingam et al. On the computational complexity of dynamic graph problems
US7899861B2 (en) Method for declarative semantic expression of user intent to enable goal-driven stream processing
US8042091B2 (en) Automatic composition of model transformations
US10223650B2 (en) Enforcing context model based policies with forward chaining
US8307372B2 (en) Method for declarative semantic expression of user intent to enable goal-driven information processing
JP2006085740A (en) Application software configuration method
US8051408B1 (en) Method of providing interactive usage descriptions based on source code analysis
US9286570B2 (en) Property reactive modifications in a rete network
Boubeta-Puig et al. Analogies and differences between mutation operators for WS-BPEL 2.0 and other languages
Grønmo et al. From sequence diagrams to state machines by graph transformation
JP2006201988A (en) Apparatus, method and program for processing signal, and recording medium
Filou et al. Towards proved distributed algorithms through refinement, composition and local computations
CN112799673B (en) Network protocol data checking method and device
Nouh et al. Aspect weaver: a model transformation approach for UML models
JP2010049439A (en) System construction method using software model and modeling device
Aucher BMS revisited
Santhanam et al. On utilizing qualitative preferences in web service composition: a cp-net based approach
Scagnetto et al. Reasoning about names in higher-order abstract syntax
US20230214506A1 (en) Auto generating build time policies from run time policies for shift left security
Fei et al. Symbolic computation and representation of deadlock avoidance policies for complex resource allocation systems with application to multithreaded software
Najm et al. ALTO: an interactive transformation tool for LOTOS and LOTOMATON
CN107943569B (en) Time analysis method for early decision in real-time system based on feature model
KR100947121B1 (en) Processing system and method for resource description framework ontology data

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant