Low-delay SDN (Software Defined Network) flow table updating method
By constructing a directed acyclic graph to represent the dependency relationship of forwarding rules in the SDN network and associated with the TCAM flow table mapping relationship, the problem of large flow table update delay is solved and more efficient network forwarding is achieved.
Patent Information
- Application Number
- CN202510232905.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-28
- Publication Date
- 2025-06-10
AI Technical Summary
In the SDN network, due to the dependence between forwarding rules, the flow table update delay is large, resulting in packets being cached or discarded, affecting the network forwarding efficiency.
By constructing directed acyclic graph G to represent the dependencies between forwarding rules and correlating with the mapping relationship τ(·) of the TCAM flow table, the graph G and the mapping relationship τ(·) are updated to adapt to the new forwarding rules, adjust the rule position in the flow table to satisfy the new dependencies, and build the shortest moving rule chain to reduce the update delay.
It effectively reduces the flow table update delay, reduces the number of rules to move, improves the forwarding efficiency of the SDN network, and avoids packet discarding.
Smart Images

Figure CN120128529A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of network communication, and particularly relates to a low-latency SDN network flow table update. Background Art
[0002] In recent years, due to the flexible, programmable, and configurable characteristics of Software-Defined Networking (SDN), it has been widely used in local area networks and data center networks for traffic scheduling and fine-grained network control. SDN separates the control plane and the data plane. The control plane configures the forwarding rules in the flow table of the data forwarding plane through control protocols (such as OpenFlow, etc.), greatly improving the flexible configuration ability of the network. When a packet arrives at the switch, the switch finds the matching forwarding rule by looking up the flow table and processes the packet according to the corresponding action, thereby forwarding the packet to the corresponding destination. In order to quickly perform flow table matching, switches usually use flow tables based on Ternary Content Addressable Memory (TCAM).
[0003] With the increasing demand for fine-grained traffic control, due to the flexible control ability of SDN, more and more forwarding rules are inserted into the flow table and then deleted from the flow table after expiration, resulting in frequent flow table updates. Usually, the update of the forwarding rules in the flow table is in milliseconds, while the packet lookup rate is in millions of packets per second. Compared with packet lookup, the flow table update delay is relatively large. A slower flow table update will cause packets to be cached in the switch and will cause packet loss in the case of cache overflow. Therefore, it is necessary to reduce the flow table update latency to avoid the packet forwarding bottleneck problem.
[0004] The TCAM-based flow table can be regarded as an ordered array with parallel lookup capabilities. The forwarding rules are stored in the physical addresses of the TCAM from high to low in order. Therefore, the rules located at higher addresses have higher matching priorities than those located at lower addresses. However, since multiple control domains may generate different rules for similar data flows, the matching fields of these rules may overlap. This overlap means that there are dependencies between the rules, which brings various restrictions to the forwarding rules during the flow table update process. For example, a certain update order needs to be followed or the rules need to be stored in a specified location; otherwise, incorrect matching of the forwarding rules will cause packet loss. During the update process, in order to maintain the dependencies between the forwarding rules, it usually leads to an update latency, which hinders a higher network forwarding efficiency. Summary of the Invention
[0005] In view of the above technical problems, the present invention proposes a low-latency SDN network flow table update solution.
[0006] In the first aspect of the present invention, a method for updating flow tables in an SDN network with low latency is proposed. The method includes:
[0007] Step S1: Construct a directed acyclic graph G according to the dependency relationships between forwarding rules;
[0008] Step S2: For an ordered matching TCAM flow table, obtain the mapping relationship τ(·) between graph G and the flow table; where the TCAM flow table refers to a flow table based on a ternary content-addressable memory;
[0009] Step S3: When a new forwarding rule r new arrives, change the dependency relationships between forwarding rules. The new dependency relationships are added to graph G, and graph G is updated to graph G', and the mapping relationship between graph G' and the flow table is updated to τ'(·);
[0010] Step S4: Add the new forwarding rule to the flow table, update the flow table, and adjust the positions of some forwarding rules to satisfy the new dependency relationships;
[0011] Step S5: For the cases of updating one forwarding rule and updating multiple forwarding rules simultaneously, construct flow table update sequences respectively.
[0012] In the said step S1, the directed acyclic graph G = {R, E}, where: R = {r 1 , r 2 , …}, R represents the set of forwarding rules, and r i (i = 1, 2, …) is a forwarding rule; E = {r i → r j} (r i , r j ∈ R), E represents the set of dependency relationships between forwarding rules, and r i → r j means that rule r i depends on r j , and the matching order of r i in the flow table is lower than that of r j .
[0013] In the said step S3, when a new forwarding rule r new arrives, the dependency relationships between forwarding rules are changed, and graph G is also updated to graph G' = {R', E'}, where: R' = R ∪ {r new}, E' = The changed dependency relationships are added to graph G' as the new dependency relationships, and the mapping relationship between graph G' and the flow table is updated to τ'(·).
[0014] In the step S4, to reduce the flow table update cost and packet waiting delay, the adjustment target is to minimize the flow table adjustment actions, and thus the flow table update problem is modeled as:
[0015] min∑ r∈R' c(r)(1)
[0016]
[0017]
[0018]
[0019] where τ(r) is the position of the forwarding rule r in the flow table before the update, and τ'(r) is the position of the rule r in the flow table after the update; the optimization objective of formula (1) is to minimize the number of moving forwarding rules during the update to reduce the flow table update cost; in formula (2), c(r) indicates whether the position of the rule in the flow table changes before and after the update. If the position of r remains unchanged before and after the update, c(r) is 0, otherwise it is 1; in formula (3), for the dependency relationship r i →r j , the dependency relationship still exists in the graph G', and in the flow table, the position of the rule r j takes precedence over the rule r i ; in formula (4), for the new dependency relationship r new →r i in the graph G', the position of the rule r i after the update takes precedence over the rule r new ; in formula (5), for the new dependency relationship r i →r new in the graph G', the position of the rule r new after the update takes precedence over the rule r i ; in formulas (6) and (7), during the flow table adjustment process, the flow table mapping relationship τ”(·) at any time always satisfies the dependency relationships in the graphs G and G'.
[0020] In the step S5, for the update of a forwarding rule r, a shortest flow table update sequence is constructed by searching within a certain range, specifically including:
[0021] Search area initialization:
[0022] represents the lowest position where the rules on which r depends in the flow table are located, represents the highest position where the rules that depend on r in the flow table are located; r is inserted into any position t within the area [pre(r), succ(r)], and the result after insertion does not violate the dependency relationship;
[0023] τ pre (r) represents the unoccupied position closest to pre(r) below the flow table, τ succ (r) represents the unoccupied position closest to succ(r) above the flow table. In [τ pre (r), τ succ (r)], find the movement sequence for inserting r;
[0024] Initial setting: For any position t in [τ pre (r), τ succ (r)], set the parameter t.moves = MAX and t.prev = NULL;
[0025] Initial setting: For any position in [pre(r), succ(r)], set t.prev = r to indicate that r moves to position t without violating the dependency relationship, and t.moves = 1 to indicate that the cost of moving r to position t is 1;
[0026] Initialization of the search starting point:
[0027] Start from the central position in the [pre(r), succ(r)] area Begin, initially set the offset = 0, and move the rule r(t) at the position t = start;
[0028] Update of the movement cost within the search area:
[0029] The movable range of r(t) is Under the condition of satisfying the dependency relationship, when r(t) moves to any position t' within this range, if t'.moves > t.moves + 1, the cost of moving r(t) to position t' is less than the minimum cost of the existing movement method at position t', update t'.moves = t.moves + 1 and t'.prev = t; otherwise, keep t'.moves and t'.prev unchanged.
[0030] Check for movable positions within the search area:
[0031] Update offset = offset + 1. When the position t = start + offset is within [τ pre (r), τ succ (r)], perform the update of the movement cost within the search area; when the position t = start - offset is within [τ pre (r), τ succ (r)], perform the update of the movement cost within the search area; otherwise, perform the check for movable positions within the search area;
[0032] Determine the occupied position:
[0033] For the τ of two unoccupied positions pre (r).moves and τ succ (r).moves, select the position with the smaller moves value, that is, the position with a smaller movement cost, as slot represents the empty position finally occupied;
[0034] Construct the shortest movement rule chain movechain:
[0035] Initialization of the shortest movement rule chain: nextslot = slot, add nextslot to movechain;
[0036] Update of the shortest movement rule chain: nextslot.prev is the rule that can move to the nextslot position, add nextslot.prev to movechain;
[0037] Set nextslot = nextslot.prev, if nextslot ≠ NULL, execute the update of the shortest movement rule chain; otherwise, movechain stops increasing, and movechain is the shortest rule movement order.
[0038] In the step S5, for the case of simultaneous update of multiple forwarding rules R new ={r}, construct a flow table update sequence; specifically including:
[0039] The flow table is divided into multiple independent update regions, initially set the update region set Regions = {}, for each rule r to be updated in R new Execute:
[0040] Calculation of the update region of r: Calculate τ pre (r) and τ succ (r), the update region of r is [τ pre (r), τ succ (r)];
[0041] Setting of the update region set: If there is a region rgn in Regions, and rgn intersects with the update region [τ pre (r), τ succ (r)] of r, then merge the rgn region and the insertion region of r, the rules to be updated in rgn become rgn.rules = rgn.rules ∪ {r}, and the starting position of rgn is rgn.start = min(rgn.start, τ pre(r)), the termination position is rgn.end = max(rgn.end, τ succ (r)); otherwise, create a new region rgn, the rule to be updated in rgn is rgn.rules = {r}, and the start position of rgn is rgn.start = τ pre (r), and the termination position is rgn.end = τ succ (r), add rgn to the updated region set Regions = Regions ∪ {rgn};
[0042] Update region overlap check:
[0043] If there is an overlap between any two regions rgn1 and rgn2 in the updated region set Regions, Merge the two regions into one region rgn, rgn.start = min(rgn1.start, rgn2.start), rgn.end = max(rgn1.end, rgn2.end), rgn.rules = rgn1.rules ∪ rgn2.rules; repeat this process until there is no overlap between any two regions in Regions;
[0044] For each region rgn in Regions, update rgn.rules in parallel:
[0045] For each rule r to be updated in rgn, i.e., r ∈ rgn.rules, calculate the shortest movement rule chain movechain, and sort the rules in rgn.rules in ascending order of the length of the movement rule chain;
[0046] According to the order of rgn.rules and the shortest movement rule chain, for each r ∈ rgn.rules in turn, update according to the shortest movement rule chain movechain, move the rule at the movechain[i + 1] position to the movechain[i] position, and i = 0,..., len(movechain) - 1, repeat this process until all the rules in rgn.rules are updated.
[0047] The second aspect of the present invention proposes a low-latency SDN network flow table update system, characterized in that the system includes a processing unit, and the processing unit is configured to execute in the working state:
[0048] Construct a directed acyclic graph G according to the dependency relationship between forwarding rules;
[0049] For the TCAM flow table for ordered matching, obtain the mapping relationship τ(·) between the graph G and the flow table; where the TCAM flow table refers to the flow table based on the ternary content addressable memory.
[0050] The new forwarding rule r new When it arrives, change the dependency relationship between the forwarding rules. The new dependency relationship is added to the graph G, and the graph G is updated to the graph G', and the mapping relationship between the graph G' and the flow table is updated to τ'(·).
[0051] Add the new forwarding rule to the flow table, update the flow table, and adjust the positions of some forwarding rules to meet the new dependency relationship.
[0052] For the case of updating a single forwarding rule and updating multiple forwarding rules simultaneously, construct the flow table update sequences respectively.
[0053] In summary, the present invention proposes a low-latency SDN network flow table update scheme to reduce the update delay caused by the rule dependency relationship. First, propose the shortest moving rule chain for updating a single forwarding rule; then for multiple concurrent rules arriving at the switch simultaneously, design a dynamic method to update the concurrent rules. This scheme can heuristically update multiple rules within the limited area of the TCAM and improve the flow table update efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0054] In order to more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the following will briefly introduce the drawings required for the description of the specific embodiments or the prior art. Obviously, the following drawings are some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0055] Figure 1 It is a schematic diagram of the rule dependency relationship graph before update according to an embodiment of the present invention.
[0056] Figure 2 It is a schematic diagram of the rules and their corresponding positions in the flow table before update according to an embodiment of the present invention.
[0057] Figure 3 It is the rule dependency relationship graph after inserting the rule r according to an embodiment of the present invention.
[0058] Figure 4 It is a schematic diagram of the flow table after inserting the rule r according to an embodiment of the present invention;
[0059] Figure 5 It is a schematic diagram of the search area for inserting the rule r according to an embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0060] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the accompanying drawings in the embodiments of the present invention. Apparently, the described embodiments are only a part rather than all of the embodiments of the present invention. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.
[0061] The technical solution adopted by the present invention includes two parts. One is the update method for a single forwarding rule, and the other is the parallel update method designed for multiple concurrent rules.
[0062] First step, the dependency relationships between the forwarding rules form a directed acyclic graph G = {R, E}. Among them, R = {r 1 , r 2 , …,} represents the set of forwarding rules, and r i (i = 1, 2, …) is a forwarding rule; E = {r i → r j} (r i , r j ∈ R) represents the set of dependency relationships between the forwarding rules, and r i → r j indicates that rule r i depends on r j , and the matching order of r i in the flow table should be lower than that of r j ; as Figure 1 shows, the dependency relationships of 7 forwarding rules {r 1 , r 2 , r 3 , r 4 , r 5 , r 6 , r 7} are presented.
[0063] Second step, for the TCAM flow table with ordered matching, τ(·) is the mapping relationship between graph G and the flow table. As Figure 2 shows, under the τ(·) mapping relationship, the positions of 7 forwarding rules {r 1 , r 2 , r 3 , r 4 , r 5 , r 6 , r 7} in the flow table are shown.
[0064] Third step, when a new forwarding rule r new arrives, due to the change in the dependency relationships between the forwarding rules, graph G is also updated to G' = {R', E'}, where R' = R ∪ {rnew}, The changing and dependency relationships are added to graph G'. The mapping relationship between the new graph G' and the flow table is τ'(·). For the Figure 1 rule dependency relationships in, when inserting a new forwarding rule r, the dependency graph is as Figure 3 shown. After inserting the new forwarding rule r, the positions of 8 forwarding rules in the flow table under the mapping relationship τ'(r) are as Figure 4 shown.
[0065] Step 4: Add the new forwarding rule r new to the flow table and update the flow table. It is necessary to adjust the positions of some forwarding rules to satisfy the new dependency relationships. To reduce the flow table update cost and packet waiting delay, the adjustment process should minimize the flow table adjustment actions as much as possible. The flow table update problem is modeled as:
[0066] min∑ r∈R' c(r) (1)
[0067]
[0068]
[0069] where τ(r) is the position of the forwarding rule r in the flow table before update, and τ'(r) is the position of the rule r in the flow table after update.
[0070] 1) The optimization objective of formula (1) is to minimize the number of forwarding rules moved during the update process to reduce the flow table update cost;
[0071] 2) In formula (2), c(r) indicates whether the position of the rule in the flow table changes before and after the update. If the position of r remains unchanged before and after the update, then c(r) is 0; otherwise, it is 1;
[0072] 3) In formula (3), for the dependency relationship r i →r j in graph G, the dependency relationship still exists in graph G', and in the flow table, the position of rule r j should be prior to that of rule r i ;
[0073] 4) In formula (4), for the new dependency relationship r new →r i in graph G', after the update, the position of rule r i should be prior to that of rule r new .
[0074] 5) In formula (5), for the new dependency relationship r i →rnew , the updated rule r new should have a higher priority than rule r i .
[0075] 6) In formulas (6) and (7), during the flow table adjustment process, the flow table mapping relationship τ”(·) at any moment always satisfies the dependency relationships in graphs G and G'.
[0076] Step 5, for the update of a forwarding rule r, search within a certain range to construct the shortest update sequence of the flow table:
[0077] 5.1 Initialization of the search area:
[0078] 5.1.1 represents the lowest position where the rules upon which r depends in the flow table are located, and represents the highest position where the rules that depend on r in the flow table are located. r can be inserted at any position t within the area [pre(r), succ(r)], and the resulting insertion will not violate the dependency relationships. The positions of pre(r) and succ(r) in the flow table are as Figure 5 shown.
[0079] 5.1.2 τ pre (r) represents the unoccupied position closest to pre(t) below the flow table, and τ succ (r) represents the unoccupied position closest to succ(r) above the flow table. A movement sequence for inserting r can be found within the area [τ pre (r), τ succ (r)]. The positions of τ pre (r) and τ succ (r) in the flow table are as Figure 5 shown.
[0080] 5.1.3 Initialize the parameters of any position t within the area [τ pre (r), τ succ (r)] to t.moves = MAX and t.prev = NULL.
[0081] 5.1.4 Initialize t.prev = r for any position t within the area [pre(r), succ(r)], indicating that r can be moved to position t without violating the dependency relationships, and t.moves = 1 indicating that the cost of moving r to position t is 1.
[0082] 5.2 Initialize the search starting point: Start from the central position within the area [pre(r), succ(r)] and initially set the offset offset = 0, considering moving the rule r(t) at position t = start.
[0083] 5.3 Update of Movement Cost within Search Region: The movable range of r(t) is That is, under the condition of satisfying the dependency relationship, r(t) can move to any position t' within this range. When t'.moves > t.moves + 1, it indicates that the cost of moving r(t) to the position t' is less than the minimum cost of the existing movement method at the position t', then update t'.mover = t.moves + 1, t'.prev = t; otherwise, keep t'.moves and t'.prev unchanged.
[0084] 5.4 Check of Movable Positions within Search Region: Update offset = offset + 1. When the position t = start + offset is within [τ pre (r), τ succ (r)], execute step 5.3; when the position t = start - offset is within [τ pre (r), τ succ (r)], execute step 5.3; otherwise, execute step 5.4.
[0085] 5.5 Determine the Occupied Position: Consider τ pre (r).moves and τ succ (r).moves of two unoccupied positions, select the position with the smaller moves value, that is, the position with the smaller movement cost, as slot, which is the finally occupied empty position.
[0086] 5.6 Construct the Shortest Movement Rule Chain movechain:
[0087] 5.6.1 Initialization of the Shortest Movement Rule Chain: nextslot = slot, add nextslot to movechain
[0088] 5.6.2 Update of the Shortest Movement Rule Chain: nextslot.prev is the rule that can move to the position nextslot, add nextslot.prev to movechain.
[0089] 5.6.3 Set nextslot = nextslot.prev. If nextslot ≠ NULL, execute step 5.6(2); otherwise, movechain stops increasing, and movechain is the shortest rule movement order.
[0090] Sixth step, for multiple forwarding rules R new = {r}, update simultaneously and construct the flow table update sequence:
[0091] 6.1 The flow table can be divided into multiple independent update regions. Initially, set the update region set Regions = {}, and for each rule r to be updated in R new :
[0092] 6.1.1 Calculation of the update region of r: Execute steps 5.1.1 and 5.1.2 to calculate its τ pre (r) and τ succ (r). Then the update region of r is [τ pre (r), τ succ (r)].
[0093] 6.1.2 Update region set setting: If there exists a region rgn in Regions, and there is an intersection between the rgn region and the update region [τ pre (r), τ succ (r)], that is, [rgn.start, rgn.end] ∩ Then merge the rgn region and the insertion region of r. That is, the rules to be updated in rgn become rgn.rules = rgn.rules ∪ {r}, the start position of rgn is rgn.start = min(rgn.start, τ pre (r)), and the end position is rgn.end = max(rgn.end, τ succ (r)); otherwise, create a new region rgn, the rules to be updated in rgn rgn.rules = {r}, the start position of rgn is rgn.start = τ pre (r), and the end position is rgn.end = τ succ (r). Add rgn to the update region set Regions = Regions ∪ {rgn}.
[0094] 6.2 Overlap check of update regions: If there is an overlap between any two regions rgn1 and rgn2 in the update region set Regions, that is, [rgn1.start, rgn1.end] ∩ Then merge the two regions into one region rgn, rgn.start = min(rgn1.start, rgn2.start), rgn.end = max(rgn1.end, rgn2.end), and rgn.rules = rgn1.rules ∪ rgn2.rules. Repeat step 6.2 until there is no overlap between any two regions in Regions.
[0095] 6.3 For each region rgn in Regions, the rgn.rules in it can be updated in parallel respectively:
[0096] 6.3.1 For each rule r to be updated in rgn, i.e., r ∈ rgn.rules, calculate its shortest movement rule chain movechain using Step 5, and sort the rules in rgn.rules in ascending order of the lengths of their movement rule chains.
[0097] 6.3.2 According to the order of the rules in rgn.rules obtained in 6.3.1 and their shortest movement rule chains, update each r ∈ rgn.rules in sequence. Move the rule at position movechain[i + 1] to position movechain[i] (i = 0, …, len(movechain) - 1) according to the shortest movement rule chain movechain, and repeat Step 6.3.2 until all the rules in rgn.rules are updated.
[0098] 6.3.3 Repeat Steps 6.3.1 and 6.3.2 until all the rgns in Regions are updated.
[0099] The technical effects brought by the present invention include:
[0100] 1. A low-latency SDN network flow table update method proposed by the present invention constructs the shortest movement rule chain while maintaining the dependency relationship between rules for a single rule update, reducing the number of rule movements and lowering the SDN flow table update latency.
[0101] 2. For simultaneous update of multiple rules, a heuristic update method is proposed, which preferentially updates rules with fewer movement times, providing more movement space for subsequent rules with more movement times and minimizing the number of movements as much as possible.
[0102] 3. When updating multiple rules, by calculating the overlapping relationship of the rule update regions, the flow table is divided into multiple regions, and each region can be updated independently, improving the concurrent update efficiency.
[0103] Please note that the technical features of the above embodiments can be combined arbitrarily. For the sake of brevity of description, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, it should be considered as within the scope described in this specification. The above embodiments only represent several implementation manners of the present application, and their descriptions are relatively specific and detailed, but they should not be construed as limiting the scope of the invention patent. It should be pointed out that for those of ordinary skill in the art, without departing from the concept of the present application, several deformations and improvements can still be made, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application should be subject to the appended claims.
Claims
1. A low-latency SDN network flow table update method, characterized in that: The method comprises: Step S1, constructing a directed acyclic graph G according to the dependency relationship between forwarding rules; Step S2: for the ordered matching TCAM flow table, obtain a mapping relationship τ(·) between the graph G and the flow table; wherein the TCAM flow table refers to a flow table based on a ternary content addressable memory; Step S3: New forwarding rule r new When arrives, the dependency between the forwarding rules is changed, the new dependency is added to the graph G, the graph G is updated to the graph G', and the mapping relationship between the graph G' and the flow table is updated to τ'(·); Step S4: Add the new forwarding rule to the flow table, update the flow table, and adjust the positions of some forwarding rules to meet the new dependency; Step S5: Construct a flow table update sequence for the case of updating one forwarding rule and updating multiple forwarding rules simultaneously.
2. According to a low-latency SDN network flow table update method according to claim 1, it is characterized in that: In step S1, the directed acyclic graph G = {R, E}, where: R = {r1, r2, ...,}, R represents a forwarding rule set, r i (i=1,2,…) is the forwarding rule; E={r i →r j }(r i ,r j ∈R), E represents the set of dependencies between forwarding rules, r i →r j Representation rule r i Depends on r j , r i The matching order in the flow table is lower than r j .
3. A low-latency SDN network flow table update method according to claim 2, characterized in that: In step S3, when a new forwarding rule r new When it arrives, the dependencies between the forwarding rules are changed, and the graph G is also updated to the graph G'={R',E'}, where: R'=R∪{r new }, The changed dependency seat is added to the graph G' as a new dependency, and the mapping relationship between the graph G' and the flow table is updated to τ'(·).
4. A low-latency SDN network flow table update method according to claim 3, characterized in that: In step S4, in order to reduce the flow table update cost and the message waiting delay, the adjustment goal is to minimize the flow table adjustment action, and the flow table update problem is modeled as: min∑ r∈R' c(r) (1) Where τ(r) is the position of the forwarding rule r in the flow table before the update, and τ'(r) is the position of the rule r in the flow table after the update. The optimization goal of formula (1) is to minimize the number of mobile forwarding rules during the update process to reduce the cost of flow table update. In formula (2), c(r) indicates whether the position of the rule in the flow table changes before and after the update. If the position of r remains unchanged before and after the update, c(r) is 0, otherwise it is 1. In formula (3), for the dependency relationship r in graph G, i →r j , the dependency still exists in the graph G', and in the flow table, rule r j The position takes precedence over rule r i ; In formula (4), for the new dependency r in graph G' new →r i , updated rule r i The position takes precedence over rule r new ; In formula (5), for the new dependency r in graph G' i →r new , updated rule r new The position takes precedence over rule r i ; In formulas (6) and (7), during the flow table adjustment process, the flow table mapping relationship τ" (·) at any time always satisfies the dependency relationship in graph G and graph G'.
5. A low-latency SDN network flow table update method according to claim 4, characterized in that: In step S5, for the update of a forwarding rule r, the shortest update sequence of the flow table is constructed by searching within a certain range, specifically including: Search area initialization: Indicates the lowest position of the rule that r depends on in the flow table. Indicates the highest position in the flow table where the rule that depends on r is located; r is inserted into any position t in the [pre(r), succ(r)] region, and the result after insertion does not violate the dependency relationship; τ pre (r) represents the unoccupied position below the flow table that is closest to pre(r), τ succ (r) represents the unoccupied position above the flow table closest to succ9r), in [τ pre (r),τ succ (r)] region to find the mobile sequence for inserting r; Initialization settings [τ pre (r),τ succ (r)] For any position t in the region, the parameters t.moves = MAX, t.prev = NULL; Initialize and set any position in the [pre(r), succ(r)] region. t.prev = r means r is moved to position t without violating the dependency relationship. t.moves = 1 means the cost of moving r to position t is 1. Search starting point initialization: From the central position of the [pre(r), succ(r)] region At the beginning, the offset is initially set to 0, and the rule r(t) at position t = start is moved; Update the cost of moving within the search area: The movable range of r(t) is When the dependency is satisfied, r(t) moves to any position t' within the range. When t'.moves>t.moves+1, the cost of moving r(t) to position t' is less than the minimum cost of the existing movement method at position t', and t'.moves=t.moves+1 and t'.prev=t are updated; otherwise, t'.moves and t'.prev remain unchanged. Movable location check within the search area: Update offset = offset + 1, when the position t = start + offset in [τ pre (r),τ succ (r)], perform the mobile cost update in the search area; when the position t = start-offset is within [τ pre (r),τ succ (r)], perform the mobile cost update in the search area; otherwise, perform the movable position check in the search area; Determine the occupied position: For two unoccupied positions τ pre (r).moves and τ succ (r).moves, select the position with the smaller moves value, that is, the position with the smallest moving cost, as slot represents the empty position that is finally occupied; Construct the shortest moving rule chain movechain: Initialize the shortest move rule chain: nextslot = slot, add nextslot to movechain; Update the shortest moving rule chain: nextslot.prev is the rule that can be moved to the nextslot position, and add nextslot.prev to movechain; Set nextslot = nextslot.prev. If nextslot≠NULL, execute the shortest move rule chain update; otherwise, movechain stops increasing, and movechain is the shortest rule move sequence.
6. A low-latency SDN network flow table update method according to claim 5, characterized in that: In step S5, for multiple forwarding rules R new = {r} are updated simultaneously, a flow table update sequence is constructed; specifically including: The flow table is divided into multiple independent update regions. The update region set Regions = {} is initially set. For each rule to be updated r∈R new implement: Update region calculation of r: Calculate τ pre (r) and τ succ (r), the update region of r is [τ pre (r),τ succ (r)]; Update region set setting: If there is a region rgn in Regions, rgn and r’s update region [τ pre (r),τ succ (r)] have an intersection, Then the rgn region is merged with the insertion region of r, and the rules to be updated in rgn become rgn.rules=rgn.rules∪{r}, and the starting position of rgn is rgn.start=min(rgn.start,τ pre (r)), the end position is rgn.end=max(rgn.end,τ succ (r)); otherwise, create a new region rgn, the rules to be updated in rgn are rgn.rules={r}, and the starting position of rgn is rgn.start=τ pre (r), the end position is rgn.end=τ succ (r), add rgn to the update region set Regions = Regions∪{rgn}; Updated region overlap check: If any two regions rgn1 and rgn2 in the update region set Regions overlap, Merge two regions into one region rgn, rgn.start = min(rgn1.start, rgn2.start), rgn.end = max(rgn1.end, rgn2.end), rgn.rules = rgn1.rules∪rgn2.rules; repeat this process until there is no overlap between any two regions in Regions; For each region rgn in Regions, rgn.rules is updated in parallel: For each rule r∈rgn.rules to be updated in rgn, calculate the shortest move rule chain movechain, and arrange the rules in rgn.rules in the order of the move rule chain from short to long; According to the order of rgn.rules and the shortest move rule chain, update each r∈rgn.rules in turn according to the shortest move rule chain movechain, move the rule at movechain[i+1] to movechain[i], and i=0,…,len(movechain)-1, and repeat this process until all rules in rgn.rules are updated.
7. A low-latency SDN network flow table update system, characterized in that: The system comprises a processing unit, which in a working state is configured to perform: A directed acyclic graph G is formed according to the dependency relationship between forwarding rules; For the ordered matching TCAM flow table, obtain the mapping relationship τ(·) between the graph G and the flow table; wherein the TCAM flow table refers to a flow table based on a ternary content addressable memory; New forwarding rules new When arrives, the dependency between the forwarding rules is changed, the new dependency is added to the graph G, the graph G is updated to the graph G', and the mapping relationship between the graph G' and the flow table is updated to τ'(·); Add new forwarding rules to the flow table, update the flow table, and adjust the positions of some forwarding rules to meet the new dependencies; For the update of one forwarding rule and the simultaneous update of multiple forwarding rules, a flow table update sequence is constructed respectively.
Citation Information
Cited By
SDN (Software Defined Network) flow rule batch updating method and device
CN121530905A
A method and device for batch updating of SDN flow rules
CN121530905B