CN113452756A - Service chain flow migration method and device, terminal equipment and storage medium - Google Patents

Service chain flow migration method and device, terminal equipment and storage medium Download PDF

Info

Publication number
CN113452756A
CN113452756A CN202110615020.XA CN202110615020A CN113452756A CN 113452756 A CN113452756 A CN 113452756A CN 202110615020 A CN202110615020 A CN 202110615020A CN 113452756 A CN113452756 A CN 113452756A
Authority
CN
China
Prior art keywords
migrated
traffic
prefix
instance
matching item
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.)
Granted
Application number
CN202110615020.XA
Other languages
Chinese (zh)
Other versions
CN113452756B (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.)
Southwest University of Science and Technology
Shenzhen International Graduate School of Tsinghua University
Peng Cheng Laboratory
Southern University of Science and Technology
Original Assignee
Southwest University of Science and Technology
Shenzhen International Graduate School of Tsinghua University
Peng Cheng Laboratory
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 Southwest University of Science and Technology, Shenzhen International Graduate School of Tsinghua University, Peng Cheng Laboratory filed Critical Southwest University of Science and Technology
Priority to CN202110615020.XA priority Critical patent/CN113452756B/en
Publication of CN113452756A publication Critical patent/CN113452756A/en
Application granted granted Critical
Publication of CN113452756B publication Critical patent/CN113452756B/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
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1001Protocols in which an application is distributed across nodes in the network for accessing one among a plurality of replicated servers
    • H04L67/1004Server selection for load balancing
    • H04L67/1008Server selection for load balancing based on parameters of servers, e.g. available memory or workload

Landscapes

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

Abstract

The invention discloses a service chain flow migration method, a device, terminal equipment and a storage medium, wherein the method comprises the following steps: acquiring a traffic load difference between the to-be-migrated instance and the target instance; determining a to-be-migrated flow matching item in the to-be-migrated example according to the flow load of each flow matching item corresponding to the to-be-migrated example; determining a prefix to be migrated according to the traffic load difference and the traffic matching item to be migrated; and generating a target flow matching item according to the prefix to be migrated, wherein the prefix of the target flow matching item is the prefix to be migrated, and the matching instance corresponding to the target flow matching item is the target instance. The invention can transfer part of the flow on the high-load example to the low-load example, thereby realizing the load balance.

Description

Service chain flow migration method and device, terminal equipment and storage medium
Technical Field
The present invention relates to the field of internet technologies, and in particular, to a method and an apparatus for migrating service chain traffic, a terminal device, and a storage medium.
Background
Network Function Virtualization (NFV) dynamically allocates resources according to changes in network requirements, including directly adding or removing Virtual Network Function (VNF) instances, and often several NF instances are ordered to form a service chain (SFC) as an entity for traffic processing according to traffic requirements. With the change of business requirements, certain NF instances are loaded with heavy load, certain NF instances are loaded with light load, and the conditions of end-to-end performance imbalance and system effective load imbalance of a service chain occur.
Thus, there is a need for improvements and enhancements in the art.
Disclosure of Invention
Aiming at the defects in the prior art, the invention provides a service chain traffic migration method, a service chain traffic migration device, a terminal device and a storage medium, and aims to solve the problem of load imbalance of NF (network root) instances in a service chain in the prior art.
In order to solve the technical problems, the technical scheme adopted by the invention is as follows:
in a first aspect of the present invention, a method for migrating service chaining traffic is provided, where the method includes:
acquiring a traffic load difference between the to-be-migrated instance and the target instance;
determining a to-be-migrated flow matching item in the to-be-migrated example according to the flow load of each flow matching item corresponding to the to-be-migrated example;
determining a prefix to be migrated according to the traffic load difference and the traffic matching item to be migrated;
and generating a target flow matching item according to the prefix to be migrated, wherein the prefix of the target flow matching item is the prefix to be migrated, and the matching instance corresponding to the target flow matching item is the target instance.
The method for migrating the service chain traffic, wherein the determining of the traffic load difference between the to-be-migrated instance and the target instance, includes:
determining the total traffic load on the to-be-migrated example according to the data packet arrival rate and the data packet processing time of each traffic on the to-be-migrated example;
determining the total traffic load on the target instance according to the data packet arrival rate and the data packet processing time of each traffic on the target instance;
and acquiring a difference value between the total traffic load on the to-be-migrated instance and the total traffic load on the target instance as the traffic load difference.
The method for migrating the traffic of the service chain, wherein the determining the matching items of the traffic to be migrated in the instances to be migrated according to the traffic load of each matching item of the traffic to be migrated includes:
and taking the flow matching item with the maximum flow load in the to-be-migrated instance as the to-be-migrated flow matching item.
The method for migrating the service chain traffic, wherein the determining a prefix to be migrated according to the traffic load difference and the traffic matching item to be migrated includes:
when the traffic load difference is greater than a first preset threshold value or the target instance is a newly added instance and the traffic matching item to be migrated is not the only traffic matching item on the instance to be migrated, taking a prefix corresponding to the traffic matching item to be migrated as the prefix to be migrated;
when the traffic load difference is greater than the first preset threshold value or the target instance is a newly-added instance and the traffic matching item to be migrated is the only traffic matching item on the instance to be migrated, dividing the prefix of the traffic matching item to be migrated according to a first dividing mode to obtain the prefix to be migrated;
and when the traffic load difference is greater than a second preset threshold and not greater than the first preset threshold, dividing the prefix of the matching item to be migrated according to a second division mode to obtain the prefix to be migrated.
The service chain traffic migration method, wherein the step of dividing the prefix of the traffic matching item to be migrated according to the first division manner to obtain the prefix to be migrated includes:
dividing prefixes of the traffic matching items to be migrated to obtain prefixes to be migrated and reserved prefixes;
and the IP address coverage range of the prefix to be migrated and the IP address coverage range of the prefix to be reserved are respectively half of the IP address coverage range of the prefix of the traffic matching item to be migrated.
The service chain traffic migration method, wherein the dividing the prefix of the matching item to be migrated according to the second division manner to obtain the prefix to be migrated, includes:
constructing a binary tree, wherein a root node in the binary tree corresponds to a prefix of the matching item to be migrated, each leaf node in the binary tree corresponds to one IP address in a prefix coverage range corresponding to the matching item to be migrated, and a prefix corresponding to a target node in the binary tree is obtained by performing IP address aggregation on prefixes corresponding to child nodes of the target node;
acquiring a data packet arrival rate of network traffic corresponding to each leaf node of the binary tree, and determining the data packet arrival rate corresponding to each node on the binary tree, wherein the data packet arrival rate corresponding to a target node on the binary tree is the sum of the data packet arrival rates corresponding to child nodes of the target node;
and determining the prefix to be migrated according to the data packet arrival rate corresponding to each node on the binary tree.
The method for migrating the service chain traffic, wherein the determining the prefix to be migrated according to the arrival rate of the data packet corresponding to each node in the binary tree, comprises:
determining a target arrival rate according to the data packet arrival rate corresponding to the root node on the binary tree;
and taking the prefix corresponding to the node with the data packet arrival rate closest to the target arrival rate on the binary tree as the prefix to be migrated.
In a second aspect of the present invention, a device for migrating service chaining traffic is provided, which includes:
the load difference determining module is used for obtaining the traffic load difference between the to-be-migrated instance and the target instance;
a matching item determining module, configured to determine a to-be-migrated traffic matching item in the to-be-migrated instance according to traffic loads of the traffic matching items in the to-be-migrated instance;
a prefix to be migrated determining module, configured to determine a prefix to be migrated according to the traffic load difference and the traffic matching item to be migrated;
a matching item generating module, configured to generate a target traffic matching item according to the prefix to be migrated, where a prefix of the target traffic matching item is the prefix to be migrated, and a matching instance corresponding to the target traffic matching item is the target instance.
In a third aspect of the present invention, a terminal device is provided, where the terminal device includes a processor, and a computer-readable storage medium communicatively connected to the processor, where the computer-readable storage medium is adapted to store a plurality of instructions, and the processor is adapted to call the instructions in the computer-readable storage medium to execute steps implementing the service chaining traffic migration method according to any one of the foregoing embodiments.
In a fourth aspect of the present invention, a computer readable storage medium is provided, which stores one or more programs, which are executable by one or more processors to implement the steps of the service chaining traffic migration method as described in any one of the above.
Compared with the prior art, the invention provides a service chain traffic migration method, a device, terminal equipment and a storage medium, the invention determines a traffic matching item to be migrated in a traffic matching item of an instance to be migrated, determines a prefix to be migrated according to a traffic load difference between the instance to be migrated and a target instance and the traffic matching item to be migrated, and generates a new traffic matching item according to the prefix to be migrated, wherein a matching instance corresponding to the new traffic matching item is the target instance.
Drawings
FIG. 1 is a flow chart of an embodiment of a service chaining flow migration method provided by the present invention;
FIG. 2 is a flow chart of the NFV platform for processing a packet;
fig. 3 is a schematic diagram illustrating a process of processing a data packet by an NF example in an embodiment of a service chain traffic migration method provided in the present invention;
fig. 4 is a schematic diagram of a first partition manner in an embodiment of a service chain traffic migration method provided in the present invention;
fig. 5 is a schematic diagram of a binary tree in an embodiment of a service chain traffic migration method provided in the present invention;
fig. 6 is a schematic diagram of a traffic matching item in an embodiment of a service chain traffic migration method provided in the present invention;
fig. 7 is a schematic structural diagram of an embodiment of a service chaining traffic migration apparatus provided in the present invention;
fig. 8 is a schematic diagram of a principle of an embodiment of a terminal device provided by the present invention.
Detailed Description
In order to make the objects, technical solutions and effects of the present invention clearer and clearer, the present invention is further described in detail below with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
The service chaining traffic migration method provided by the invention can be executed by a terminal device, and the terminal device can be but is not limited to a personal computer, a server and the like.
Example one
As shown in fig. 1, in an embodiment of the service chaining traffic migration method, the method includes the steps of:
s100, acquiring the traffic load difference between the to-be-migrated instance and the target instance.
As shown in fig. 2, the flow of processing the data packet in the NFV platform architecture is as follows: the NFV platform architecture is provided with an NF manager, when a data packet enters the platform through the network card drive, the NFV platform transmits the data packet to a shared memory area by using a polling mode driver of DPDK, so that all NF instances managed by the NF manager can access the data packet of the shared memory, meanwhile, the NF manager has different threads to execute processing, when the shared memory area has a data packet, the Rx thread directing packet processing will look up in the NF manager's rule table, to transmit the packet to a designated NF instance, once the packet matches the first NF instance in the service chain, the packet descriptor is copied into the receive ring buffer of that NF instance, another wake thread brings the NF instance into a runnable state to perform packet processing, after being processed by the first instance, the Tx thread of NF manager moves the packet to the rest of the service chain until completion.
In the process of guiding a data packet to different instances for processing from an Rx thread, a lookup operation of a rule table exists, specifically, a first instance, a second instance, and a last instance of a service chain through which the data packet should pass are specified in the rule table, and for each traffic processed by the instances, matching is performed in the rule table, so as to avoid rule explosion in the rule table, a prefix wildcard adopted in the rule table is passed, that is, the rule table includes a plurality of traffic matching items, each traffic matching item includes a prefix and a matching instance corresponding to the prefix, and for each incoming data packet, according to the coverage range of the prefix corresponding to which traffic matching item the IP address of the traffic corresponding to the data packet is in, the data packet is sent to the matching instance corresponding to the prefix for processing. For example, the rule table includes three traffic matching entries, and the corresponding prefixes are: 192.168.3.0/24, 192.168.2.0/24, 192.168.4.0/24, 192.168.3.0/24 for NF1, 192.168.2.0/24 and 192.168.4.0/24 for NF2, all traffic contained in the prefix 192.168.3.0/24 will be forwarded to NF1 for processing.
In this embodiment, when the load between the instances is unbalanced, according to the traffic load difference between the to-be-migrated instance and the target instance, splitting a part of the traffic matching item corresponding to the to-be-migrated instance, so that the part of the traffic processed on the to-be-migrated instance is migrated to the target instance for processing, specifically, the obtaining the traffic load difference between the to-be-migrated instance and the target instance includes:
determining the total traffic load on the to-be-migrated example according to the data packet arrival rate and the data packet processing time of each traffic on the to-be-migrated example;
determining the total traffic load on the target instance according to the data packet arrival rate and the data packet processing time of each traffic on the target instance;
and acquiring a difference value between the total traffic load on the to-be-migrated instance and the total traffic load on the target instance as the traffic load difference.
In this embodiment, first, load information of each traffic on the to-be-migrated instance and the target instance is obtained, and a load of each traffic on an instance may be obtained by a packet arrival rate of the traffic and a packet processing time of the traffic on the instance. Specifically, after the data packet arrives at the shared memory area, the Rx thread needs to drain the data packet, so that the data packet sequentially passes through a series of instances to complete the processing of the service chain, and then in the process of matching the data packet to the instance by the thread, the information of the data packet, such as an IP address, a port and the like, can be obtained, and further, as shown in fig. 3, in the instance, the processing of each data packet, such as packet matching, load checking and the like, is performed by a specific function, which performs the operations of packet matching, load checking and the likeThe operations are called by a specific function and forwarded to the next function for processing, and based on the operations, the load of each flow can be obtained. Specifically, when the data packet is transmitted to the memory shared area, the NF manager may count the arrival rate of the data packet of each flow, obtain the arrival rate of the data packet of each flow through a Get-rate () function, and record the arrival rate as λiIn the example, a specific function is called in the process of processing the data packet and is forwarded to the next function for processing after being called by a specific function, a callback function is added in the example to count the time of the example for obtaining the data packet Get-packet () from the beginning and the time of the forwarding-packet () function for moving the data packet out of the example, and the time difference is calculated to obtain the processing time of the data packet, which is recorded as siThe relative load per flow per instance may then be given by λi*siThus obtaining the product. For the example to be migrated, obtaining the relative load of each flow processed on the example to be migrated at present, summing to obtain the total load of the flows on the example to be migrated, for the target example, obtaining the relative load of each flow processed on the target example at present, summing to obtain the total load of the flows on the example to be migrated, and subtracting the total load of the flows on the example to be migrated and the total load of the flows on the target example to obtain the difference of the flows.
Referring to fig. 1 again, the method for migrating service chain traffic provided in this embodiment further includes the following steps:
s200, determining the traffic matching items to be migrated in the instances to be migrated according to the traffic loads of the traffic matching items corresponding to the instances to be migrated.
The traffic matching item corresponding to the to-be-migrated instance is a traffic matching item of the to-be-migrated instance in a rule table, and when it is necessary to migrate part of traffic in the to-be-migrated instance to the target instance, splitting of the traffic matching item is involved.
In a possible implementation manner, each of the traffic matching items corresponding to the to-be-migrated instance may be used as the to-be-migrated traffic matching item or any one of the traffic matching items corresponding to the to-be-migrated instance may be used as the to-be-migrated traffic matching item, in this embodiment, in order to reduce the calculation amount and reduce the number of the traffic that needs to be tracked, the traffic matching item with the largest traffic load in the traffic matching items corresponding to the to-be-migrated instance is used as the to-be-migrated traffic matching item, specifically, and for each flow matching item corresponding to the example to be migrated, calculating the relative load of each flow covered in the prefix corresponding to the flow matching item, summing the relative loads to obtain the flow load of the flow matching item, and selecting the flow matching item with the largest flow load as the flow matching item to be migrated.
After determining the traffic load difference between the to-be-migrated instance and the target instance and the to-be-migrated traffic matching item, the service chain traffic migration method provided by this embodiment further includes the steps of:
s300, determining a prefix to be migrated according to the traffic load difference and the traffic matching item to be migrated.
Specifically, the determining a prefix to be migrated according to the traffic load difference and the traffic matching item to be migrated includes:
when the traffic load difference is greater than a first preset threshold value or the target instance is a newly added instance and the traffic matching item to be migrated is not the only traffic matching item on the instance to be migrated, taking a prefix corresponding to the traffic matching item to be migrated as the prefix to be migrated;
when the traffic load difference is greater than the first preset threshold value or the target instance is a newly-added instance and the traffic matching item to be migrated is the only traffic matching item on the instance to be migrated, dividing the prefix of the traffic matching item to be migrated according to a first dividing mode to obtain the prefix to be migrated;
and when the traffic load difference is greater than a second preset threshold and not greater than the first preset threshold, dividing the prefix of the matching item to be migrated according to a second division mode to obtain the prefix to be migrated.
In this embodiment, a first preset threshold and a second preset threshold are set, where the first preset threshold is greater than the second preset threshold, and when a traffic load difference between the to-be-migrated instance and the target instance is greater than the first preset threshold, to improve efficiency of load balancing, a prefix to be migrated is determined in a coarse-grained manner, specifically, when the to-be-migrated traffic matching item is not the only traffic matching item on the to-be-migrated instance, a prefix of the to-be-migrated traffic matching item is directly used as the prefix to be migrated, that is, a whole network traffic corresponding to the to-be-migrated traffic matching item is migrated to the target instance for processing, and when the to-be-migrated traffic matching item is the only traffic matching item on the to-be-migrated instance, the prefix of the to-be-migrated traffic matching item is coarsely divided in a first division manner, and quickly determining the traffic needing to be migrated to the target instance, so that the traffic load of the instance to be migrated and the target instance can be quickly close to balance. And when the traffic load difference between the example to be migrated and the target example is greater than the second preset threshold and not greater than the first preset threshold, determining the prefix to be migrated in a fine-grained manner, specifically, dividing the prefix of the matching item to be migrated in a finer manner in a second dividing manner to obtain the prefix to be migrated. And when the traffic load difference between the to-be-migrated instance and the target instance is smaller than the second preset threshold, considering that the traffic load between the to-be-migrated instance and the target instance is balanced, and not performing traffic migration any more. The first preset threshold and the second preset threshold may be set according to actual needs, for example, the first preset threshold may be 20% or 30% of the current traffic load of the to-be-migrated instance, and the second preset threshold may be 10% or 5% of the current traffic load of the to-be-migrated instance.
The dividing the prefix of the traffic matching item to be migrated according to the first division mode to obtain the prefix to be migrated includes:
dividing prefixes of the traffic matching items to be migrated to obtain prefixes to be migrated;
and the IP address coverage range of the prefix to be migrated is half of the IP address coverage range of the prefix of the traffic matching item to be migrated.
In the first division mode, the IP address coverage of the prefix of the traffic matching item to be migrated is directly divided into two parts, and the prefix of the traffic matching item to be migrated is divided to obtain two prefixes whose IP address coverage is half of the IP address coverage of the prefix of the traffic matching item to be migrated, and then any one of the prefixes is taken as the prefix to be migrated, or one with a larger traffic load is taken as the prefix to be migrated. As shown in fig. 4, VNF1 in fig. 4 is the to-be-migrated instance, NVF3 is the target instance, half of the range of 192.168.3.0/24 on VNF1 is divided into VNF 3, 192.168.3.0/25 and 192.168.3.128/25 are made to be independent traffic matching items, the total traffic is distributed to two VNFs for sharing, and thus, fast load reduction of VNF1 is achieved.
The dividing the prefix of the matching item to be migrated according to the second division mode to obtain the prefix to be migrated includes:
constructing a binary tree, wherein a root node in the binary tree corresponds to a prefix of the matching item to be migrated, each leaf node in the binary tree corresponds to one IP address in a prefix coverage range corresponding to the matching item to be migrated, and a prefix corresponding to a target node in the binary tree is obtained by performing IP address aggregation on prefixes corresponding to child nodes of the target node;
acquiring a data packet arrival rate of network traffic corresponding to each leaf node of the binary tree, and determining the data packet arrival rate corresponding to each node on the binary tree, wherein the data packet arrival rate corresponding to a target node on the binary tree is the sum of the data packet arrival rates corresponding to child nodes of the target node;
and determining the prefix to be migrated according to the data packet arrival rate corresponding to each node on the binary tree.
In this embodiment, when the prefix of the matching item to be migrated is partitioned by using the second partitioning manner, a binary tree is constructed, each node in the binary tree corresponds to one prefix, a node without a parent node in the binary tree is a root node, and a node without a child node in the binary tree is a leaf node. As shown in fig. 5, a prefix corresponding to a root node of a binary tree is set as a prefix of the matching item to be migrated, each leaf node of the binary tree is each IP address under the prefix coverage of the matching item to be migrated, a binary tree is constructed by using 01 bits as a key, and for each node in the binary tree, the prefix corresponding to the node is obtained by performing IP address aggregation on prefixes corresponding to child nodes of the node. If P is a certain node of the binary tree, the prefix corresponding to P covers the IP addresses corresponding to the leaf nodes contained in all subtrees under P, and the total number of the IP addresses covered by P is 2(32 -dp)Where dp is the prefix mask length of the node P, for example, the prefix corresponding to the node 2 in fig. 5 is 192.168.1.16/30, which covers the IP addresses of all leaf nodes, i.e., 5, 6, and 7, of the branch, the prefix length of the node 2 is 30, and the number of leaf nodes that can be covered is 4.
After the binary tree is constructed, determining packet arrival rates of network traffic corresponding to all nodes on the binary tree, specifically, each leaf node of the binary tree corresponds to one IP address, that is, corresponds to one traffic, and respectively setting the packet arrival rate corresponding to each leaf node of the binary tree as the packet arrival rate of the traffic corresponding to the leaf node, as shown in fig. 5, the packet arrival rate corresponding to each node of the binary tree is the sum of the packet arrival rates corresponding to the child nodes of the node, so that the packet arrival rates corresponding to the leaf nodes of the binary tree can be recurred in sequence until the packet arrival rates are merged into the root node.
The determining the prefix to be migrated according to the arrival rate of the data packet corresponding to each node in the binary tree includes:
determining a target arrival rate according to the data packet arrival rate corresponding to the root node on the binary tree;
and taking the prefix corresponding to the node with the data packet arrival rate closest to the target arrival rate on the binary tree as the prefix to be migrated.
Specifically, the data packet arrival rate corresponding to the root node on the binary tree is the sum of the data packet arrival rates of the network traffic corresponding to the traffic matching item to be migrated, determining the target arrival rate according to the data packet arrival rate corresponding to the root node on the binary tree may be setting a preset coefficient, multiplying the data packet arrival rate corresponding to the root node on the binary tree by the preset coefficient to obtain the target arrival rate, where the preset coefficient is smaller than 1, for example, may be 0.5, 0.4, and the like, traversing the data packet arrival rates of all nodes on the binary tree, and taking a prefix corresponding to a node whose data packet arrival rate is closest to the target arrival rate as the prefix to be migrated. In order to improve efficiency, after determining the target arrival rate, a traversal range may be set according to the target arrival rate, taking the preset coefficient as 0.5 as an example, the packet arrival rate corresponding to the root node on the binary tree is denoted as TotalPktrate, that is, the target arrival rate is 0.5 TotalPktrate, then the traversal range may be set as a node between the packet arrival rate of 0.4 TotalPktrate and 0.6 TotalPktrate, so as to achieve the purpose of quickly determining the prefix to be migrated.
Constructing a binary tree and determining the pseudo code of the prefix to be migrated according to the binary tree may be as follows:
and inputting the IP of all the flows in the original prefix and the packet rate of the flows in the original prefix, namely IP1, IP2 and IP3.
And finally, the IP prefix is summarized into the IP prefix of the balanced scheduling.
1 first traverse all IPs
2 initialize Dlist
3 initializing Slist
4:for all ip in IPs do
5 initializing node IP
6 the initial root node Treeip only
Height of node: height ═ 0
8, prefix of node: prefix is IP
Data packet rate of the node: treeip. Pktrate ═ 0pps >
Add each node dlist.add (node. pktrate)
11:end for
12 for each node do in the Dlist
Height of each node: height 32-mask values for this node and the next node
14:end for
15 # sets the maximum height at 33
16 setting the height of the last node in the Dlist to 33
Construction of 0-1 binary Tree of 17: #
18, initially selecting a first node of the Dlist as a flag node
19 while the next node of the bit zone node is not the last node do of the Dlist
The height of the flag node of the if flag bit is less than that of the next flag bit
Height of point flag node
21, combining two nodes and adding the Pktrate of the nodes
22 if the Pktrate of a node is added and then the n is between 0.4 □ TotalPktrate and 0.6 □ TotalPktrate
23. Slist add node Slist
24:end if
Next, deleting flag bit next node flag node from Dlist
26 flag node is moved forward to flag node
27:else
28 flag bit node FlagNode is moved backward to FlagNode
29:end if
30:end while
31 all IPs are finally reduced to an IP prefix containing the packet rate
32, selecting a prefix formed by a median Pktrate node from the Slist as a required prefix
Referring to fig. 1 again, after the prefix to be migrated is obtained, the method for migrating service chain traffic provided in this embodiment further includes the steps of:
s400, generating a target flow matching item according to the prefix to be migrated, wherein the prefix of the target flow matching item is the prefix to be migrated, and the matching instance corresponding to the target flow matching item is the target instance.
After the prefix to be migrated is determined, migrating the network traffic covered by the prefix to be migrated to the target instance, that is, when a data packet arrives, the data packet whose IP address is within the coverage range of the prefix to be migrated needs to be allocated to the target instance for processing, at this time, a new traffic matching item (target traffic matching item) is generated, the prefix of the target traffic matching item is the prefix to be migrated, and the matching instance corresponding to the target traffic matching item is set as the target instance. As shown in fig. 6, after generating a new traffic match, the new rule table is put down to a device like an SDN software switch to perform traffic operations.
Pseudo code of a possible implementation manner of the service chain traffic migration method provided in this embodiment may be as follows:
inputting VNF instances to be migrated and target VNF instances
Selecting a balanced migration scheduling mechanism for migration
Step 1, the platform triggers balanced flow scheduling due to unbalanced scenes of adding and deleting instances and the like
2, determining an example to be migrated and a target example
Step 2, the flow management part collects the flow information of the two instances
4, collecting load information and IP address of each flow according to part of specific functions, and aggregating flow prefix by using library function of Network
Step 3, comparing the load difference conditions of the two examples (if the load difference conditions are less than 10 percent, the balanced scheduling is not triggered)
6: if the load difference between the instances exceeds 20% or an instance is newly added
the then control management part executes coarse-grained prefix migration, and reports the prefix to be migrated as a whole or the prefix after the prefix to be migrated is divided as a whole to the NF manager according to the rule of generating a matching table
7 else the load difference between examples is less than 20%
the then control management part executes fine-grained construction of dictionary tree balanced migration, divides prefix generation matching table rules and reports the rules to NF manager
8 end if-else
9 end step 3
9, step 4, waiting for the next trigger of the balanced flow scheduling, and circulating to the step 1
10 end algorithm
In summary, the present embodiment provides a service chain traffic migration method, where a traffic matching item to be migrated is determined in a traffic matching item of an instance to be migrated, a prefix to be migrated is determined according to a traffic load difference between the instance to be migrated and a target instance and the traffic matching item to be migrated, a new traffic matching item is generated according to the prefix to be migrated, and a matching instance corresponding to the new traffic matching item is a target instance, so that traffic corresponding to the prefix to be migrated, which is originally processed on the instance to be migrated, is matched to the target instance for processing, and part of traffic on an instance with a high load can be migrated to an instance with a low load, thereby implementing load balancing.
It should be understood that, although the steps in the flowcharts shown in the figures of the present specification are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least a portion of the steps in the flow charts may include multiple sub-steps or multiple stages that are not necessarily performed at the same time, but may be performed at different times, and the order of performance of the sub-steps or stages is not necessarily sequential, but may be rotated or alternated with other steps or at least a portion of the sub-steps or stages of other steps.
It will be understood by those skilled in the art that all or part of the flow range in the method of the above embodiments may be implemented by the relevant hardware instructed by a computer program, which may be stored in a non-volatile computer readable storage medium, and when executed, may include the flow range of the above embodiments of the method. Any reference to memory, storage, databases, or other media used in embodiments provided herein may include non-volatile and/or volatile memory. Non-volatile memory can include read-only memory (ROM), Programmable ROM (PROM), Electrically Programmable ROM (EPROM), Electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDRSDRAM), Enhanced SDRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), Rambus Direct RAM (RDRAM), direct bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
Example two
Based on the foregoing embodiment, the present invention further provides a service chain traffic migration apparatus, as shown in fig. 7, where the service chain traffic migration apparatus includes:
a load difference obtaining module, configured to obtain a traffic load difference between the to-be-migrated instance and the target instance, as described in embodiment one;
a matching item determining module, configured to determine, according to traffic loads of the traffic matching items in the to-be-migrated instance, a to-be-migrated traffic matching item in the to-be-migrated instance, as described in embodiment one;
a prefix to be migrated determining module, configured to determine a prefix to be migrated according to the traffic load difference and the traffic matching item to be migrated, as described in embodiment one;
a matching item generating module, configured to generate a target traffic matching item according to the prefix to be migrated, where a prefix of the target traffic matching item is the prefix to be migrated, and a matching instance corresponding to the target traffic matching item is the target instance, which is specifically described in embodiment one.
EXAMPLE III
Based on the above embodiments, the present invention further provides a terminal device, as shown in fig. 8, where the terminal device includes a processor 10 and a memory 20. Fig. 8 shows only some of the components of the terminal device, but it is to be understood that not all of the shown components are required to be implemented, and that more or fewer components may be implemented instead.
The memory 20 may in some embodiments be an internal storage unit of the terminal device, such as a hard disk or a memory of the terminal device. In other embodiments, the memory 20 may also be an external storage device of the terminal device, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like provided on the terminal device. Further, the memory 20 may also include both an internal storage unit and an external storage device of the terminal device. The memory 20 is used for storing application software installed in the terminal device and various data. The memory 20 may also be used to temporarily store data that has been output or is to be output. In an embodiment, the memory 20 stores a service chain traffic migration program 30, and the service chain traffic migration program 30 is executable by the processor 10, so as to implement the service chain traffic migration method in the present application.
The processor 10 may be a Central Processing Unit (CPU), microprocessor or other chip in some embodiments, and is used for running program codes stored in the memory 20 or Processing data, such as executing the service chain traffic migration method.
In one embodiment, when the processor 10 executes the service chain traffic migration program 30 in the memory 20, the following steps are implemented:
acquiring a traffic load difference between the to-be-migrated instance and the target instance;
determining a to-be-migrated flow matching item in the to-be-migrated example according to the flow load of each flow matching item corresponding to the to-be-migrated example;
determining a prefix to be migrated according to the traffic load difference and the traffic matching item to be migrated;
and generating a target flow matching item according to the prefix to be migrated, wherein the prefix of the target flow matching item is the prefix to be migrated, and the matching instance corresponding to the target flow matching item is the target instance.
Wherein the determining the traffic load difference between the to-be-migrated instance and the target instance comprises:
determining the total traffic load on the to-be-migrated example according to the data packet arrival rate and the data packet processing time of each traffic on the to-be-migrated example;
determining the total traffic load on the target instance according to the data packet arrival rate and the data packet processing time of each traffic on the target instance;
and acquiring a difference value between the total traffic load on the to-be-migrated instance and the total traffic load on the target instance as the traffic load difference.
Determining the traffic matching items to be migrated in the instances to be migrated according to the traffic loads of the traffic matching items corresponding to the instances to be migrated, including:
and taking the flow matching item with the maximum flow load in the to-be-migrated instance as the to-be-migrated flow matching item.
Determining a prefix to be migrated according to the traffic load difference and the traffic matching item to be migrated, including:
when the traffic load difference is greater than a first preset threshold value or the target instance is a newly added instance and the traffic matching item to be migrated is not the only traffic matching item on the instance to be migrated, taking a prefix corresponding to the traffic matching item to be migrated as the prefix to be migrated;
when the traffic load difference is greater than the first preset threshold value or the target instance is a newly-added instance and the traffic matching item to be migrated is the only traffic matching item on the instance to be migrated, dividing the prefix of the traffic matching item to be migrated according to a first dividing mode to obtain the prefix to be migrated;
and when the traffic load difference is greater than a second preset threshold and not greater than the first preset threshold, dividing the prefix of the matching item to be migrated according to a second division mode to obtain the prefix to be migrated.
The dividing the prefix of the traffic matching item to be migrated according to the first division manner to obtain the prefix to be migrated includes:
dividing prefixes of the traffic matching items to be migrated to obtain prefixes to be migrated and reserved prefixes;
and the IP address coverage range of the prefix to be migrated and the IP address coverage range of the prefix to be reserved are respectively half of the IP address coverage range of the prefix of the traffic matching item to be migrated.
The dividing the prefix of the matching item to be migrated according to the second dividing manner to obtain the prefix to be migrated includes:
constructing a binary tree, wherein a root node in the binary tree corresponds to a prefix of the matching item to be migrated, each leaf node in the binary tree corresponds to one IP address in a prefix coverage range corresponding to the matching item to be migrated, and a prefix corresponding to a target node in the binary tree is obtained by performing IP address aggregation on prefixes corresponding to child nodes of the target node;
acquiring a data packet arrival rate of network traffic corresponding to each leaf node of the binary tree, and determining the data packet arrival rate corresponding to each node on the binary tree, wherein the data packet arrival rate corresponding to a target node on the binary tree is the sum of the data packet arrival rates corresponding to child nodes of the target node;
and determining the prefix to be migrated according to the data packet arrival rate corresponding to each node on the binary tree.
Wherein the determining the prefix to be migrated according to the arrival rate of the data packet corresponding to each node in the binary tree includes:
determining a target arrival rate according to the data packet arrival rate corresponding to the root node on the binary tree;
and taking the prefix corresponding to the node with the data packet arrival rate closest to the target arrival rate on the binary tree as the prefix to be migrated.
Example four
The present invention also provides a computer readable storage medium, in which one or more programs are stored, the one or more programs being executable by one or more processors to implement the steps of the service chaining traffic migration method as described above.
Finally, it should be noted that: the above examples are only intended to illustrate the technical solution of the present invention, but not to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.

Claims (10)

1. A method for service chaining traffic migration, the method comprising:
acquiring a traffic load difference between the to-be-migrated instance and the target instance;
determining a to-be-migrated flow matching item in the to-be-migrated example according to the flow load of each flow matching item corresponding to the to-be-migrated example;
determining a prefix to be migrated according to the traffic load difference and the traffic matching item to be migrated;
and generating a target flow matching item according to the prefix to be migrated, wherein the prefix of the target flow matching item is the prefix to be migrated, and the matching instance corresponding to the target flow matching item is the target instance.
2. The method for service chaining traffic migration according to claim 1, wherein the determining the traffic load difference between the to-be-migrated instance and the target instance comprises:
determining the total traffic load on the to-be-migrated example according to the data packet arrival rate and the data packet processing time of each traffic on the to-be-migrated example;
determining the total traffic load on the target instance according to the data packet arrival rate and the data packet processing time of each traffic on the target instance;
and acquiring a difference value between the total traffic load on the to-be-migrated instance and the total traffic load on the target instance as the traffic load difference.
3. The method for service chain traffic migration according to claim 1, wherein the determining, according to the traffic load of each traffic matching item corresponding to the to-be-migrated instance, a to-be-migrated traffic matching item in the to-be-migrated instance includes:
and taking the flow matching item with the maximum flow load in the to-be-migrated instance as the to-be-migrated flow matching item.
4. The method according to claim 1, wherein the determining the prefix to be migrated according to the traffic load difference and the traffic matching item to be migrated comprises:
when the traffic load difference is greater than a first preset threshold value or the target instance is a newly added instance and the traffic matching item to be migrated is not the only traffic matching item on the instance to be migrated, taking a prefix corresponding to the traffic matching item to be migrated as the prefix to be migrated;
when the traffic load difference is greater than the first preset threshold value or the target instance is a newly-added instance and the traffic matching item to be migrated is the only traffic matching item on the instance to be migrated, dividing the prefix of the traffic matching item to be migrated according to a first dividing mode to obtain the prefix to be migrated;
and when the traffic load difference is greater than a second preset threshold and not greater than the first preset threshold, dividing the prefix of the matching item to be migrated according to a second division mode to obtain the prefix to be migrated.
5. The method for service chain traffic migration according to claim 4, wherein the step of dividing the prefix of the traffic matching item to be migrated according to the first division manner to obtain the prefix to be migrated includes:
dividing prefixes of the traffic matching items to be migrated to obtain prefixes to be migrated and reserved prefixes;
and the IP address coverage range of the prefix to be migrated and the IP address coverage range of the prefix to be reserved are respectively half of the IP address coverage range of the prefix of the traffic matching item to be migrated.
6. The method for service chain traffic migration according to claim 4, wherein the step of dividing the prefix of the matching item to be migrated according to the second division manner to obtain the prefix to be migrated comprises:
constructing a binary tree, wherein a root node in the binary tree corresponds to a prefix of the matching item to be migrated, each leaf node in the binary tree corresponds to one IP address in a prefix coverage range corresponding to the matching item to be migrated, and a prefix corresponding to a target node in the binary tree is obtained by performing IP address aggregation on prefixes corresponding to child nodes of the target node;
acquiring a data packet arrival rate of network traffic corresponding to each leaf node of the binary tree, and determining the data packet arrival rate corresponding to each node on the binary tree, wherein the data packet arrival rate corresponding to a target node on the binary tree is the sum of the data packet arrival rates corresponding to child nodes of the target node;
and determining the prefix to be migrated according to the data packet arrival rate corresponding to each node on the binary tree.
7. The method for service chain traffic migration according to claim 6, wherein the determining the prefix to be migrated according to the packet arrival rate corresponding to each node in the binary tree includes:
determining a target arrival rate according to the data packet arrival rate corresponding to the root node on the binary tree;
and taking the prefix corresponding to the node with the data packet arrival rate closest to the target arrival rate on the binary tree as the prefix to be migrated.
8. A service chaining traffic migration apparatus, comprising:
the load difference determining module is used for obtaining the traffic load difference between the to-be-migrated instance and the target instance;
a matching item determining module, configured to determine a to-be-migrated traffic matching item in the to-be-migrated instance according to traffic loads of the traffic matching items in the to-be-migrated instance;
a prefix to be migrated determining module, configured to determine a prefix to be migrated according to the traffic load difference and the traffic matching item to be migrated;
a matching item generating module, configured to generate a target traffic matching item according to the prefix to be migrated, where a prefix of the target traffic matching item is the prefix to be migrated, and a matching instance corresponding to the target traffic matching item is the target instance.
9. A terminal device, characterized in that the terminal device comprises: a processor, a computer readable storage medium communicatively connected to the processor, the computer readable storage medium adapted to store a plurality of instructions, the processor adapted to invoke the instructions in the computer readable storage medium to perform the steps of implementing the service chaining traffic migration method of any one of the preceding claims 1-7.
10. A computer readable storage medium, storing one or more programs, the one or more programs being executable by one or more processors for performing the steps of the service chaining traffic migration method as claimed in any one of claims 1 to 7.
CN202110615020.XA 2021-06-02 2021-06-02 Service chain flow migration method and device, terminal equipment and storage medium Active CN113452756B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110615020.XA CN113452756B (en) 2021-06-02 2021-06-02 Service chain flow migration method and device, terminal equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110615020.XA CN113452756B (en) 2021-06-02 2021-06-02 Service chain flow migration method and device, terminal equipment and storage medium

Publications (2)

Publication Number Publication Date
CN113452756A true CN113452756A (en) 2021-09-28
CN113452756B CN113452756B (en) 2022-02-25

Family

ID=77810701

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110615020.XA Active CN113452756B (en) 2021-06-02 2021-06-02 Service chain flow migration method and device, terminal equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113452756B (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103905312A (en) * 2012-12-26 2014-07-02 中国电信股份有限公司 IPv6/IPv4 protocol translation gateway and data message processing method
US9832118B1 (en) * 2014-11-14 2017-11-28 Amazon Technologies, Inc. Linking resource instances to virtual networks in provider network environments
US20190236150A1 (en) * 2018-01-29 2019-08-01 Salesforce.Com, Inc. Migration flow control
CN111800285A (en) * 2019-04-08 2020-10-20 阿里巴巴集团控股有限公司 Instance migration method and device and electronic equipment
CN112506648A (en) * 2020-11-20 2021-03-16 鹏城实验室 Traffic stateless migration method of virtual network function instance and electronic equipment

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103905312A (en) * 2012-12-26 2014-07-02 中国电信股份有限公司 IPv6/IPv4 protocol translation gateway and data message processing method
US9832118B1 (en) * 2014-11-14 2017-11-28 Amazon Technologies, Inc. Linking resource instances to virtual networks in provider network environments
US20190236150A1 (en) * 2018-01-29 2019-08-01 Salesforce.Com, Inc. Migration flow control
CN111800285A (en) * 2019-04-08 2020-10-20 阿里巴巴集团控股有限公司 Instance migration method and device and electronic equipment
CN112506648A (en) * 2020-11-20 2021-03-16 鹏城实验室 Traffic stateless migration method of virtual network function instance and electronic equipment

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
孙开争等: "迁移工作流管理***中迁移实例组通信机制的研究", 《计算机应用》 *
赵丹等: "TMP-TIE:基于流量迁移预测的域间出口选择算法", 《计算机工程与科学》 *

Also Published As

Publication number Publication date
CN113452756B (en) 2022-02-25

Similar Documents

Publication Publication Date Title
US8402469B2 (en) Allocating resources for parallel execution of query plans
CN108595268B (en) Data distribution method and device based on MapReduce and computer-readable storage medium
US20210109920A1 (en) Method for Validating Transaction in Blockchain Network and Node for Configuring Same Network
US10678482B2 (en) Multi-tier data synchronizer based on concurrent linked list
US10931749B2 (en) Efficient configuration combination selection in migration
CN107832446A (en) A kind of searching method and computing device of configuration item information
US7027446B2 (en) Method and apparatus for set intersection rule matching
CN113452756B (en) Service chain flow migration method and device, terminal equipment and storage medium
CN110162395B (en) Memory allocation method and device
US10956125B2 (en) Data shuffling with hierarchical tuple spaces
Sereno et al. Computational algorithms for product form solution stochastic Petri nets
US7647592B2 (en) Methods and systems for assigning objects to processing units
EP0547992A2 (en) Method and system for enhanced efficiency of data recovery in balanced tree memory structures
US20190057132A1 (en) System and method for searching data
CN113568877A (en) File merging method and device, electronic equipment and storage medium
EP3113038B1 (en) A data handling method
CN114791985A (en) Domain name matching method and device and prefix tree updating method and device
CN114281339A (en) Program compiling method, compiler, device, and storage medium
CN113986846A (en) Data processing method, system, device and storage medium
US20170052712A1 (en) System and method for dynamic cache distribution for in-memory data grids
US10891274B2 (en) Data shuffling with hierarchical tuple spaces
CN112506651A (en) Method and equipment for data operation in large-data-volume environment
US20160098411A1 (en) Querying input data
CN110851178A (en) Inter-process program static analysis method based on distributed graph reachable computation
KR20210101454A (en) Apparatus and method for performing spatial join

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