Data forwarding method and device based on VPP instance, equipment, medium and product

By binding the VPP instance to the configuration slot in the load balancing system and using the Redis database to store the address set, the problem of high availability and horizontal expansion of VPP in tens of millions of data forwarding is solved, and efficient load balancing and cost reduction are achieved.

CN118827673AActive Publication Date: 2024-10-22CHINA MOBILE M2M +2
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202410680947.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-29
Publication Date
2024-10-22
Estimated Expiration
2044-05-29

AI Technical Summary

Technical Problem

Existing VPP cannot provide high availability when forwarding tens of millions of data, and relies on the hardware resources of a single node. It cannot achieve horizontal expansion by adding resources, and there is a risk of single point failure.

Method used

By introducing configuration slots into the load balancing system, VPP instances are bound to configuration slots instead of directly binding network addresses to achieve dynamic expansion and reduction of VPP instances. Redis database is used to store address sets to achieve high availability and horizontal expansion. .

Benefits of technology

While forwarding tens of millions of data, it achieves high availability of message data forwarding, eliminates single points of failure, realizes horizontal scaling of load balancing capabilities, and reduces costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118827673A_ABST
    Figure CN118827673A_ABST
Patent Text Reader

Abstract

The invention discloses a data forwarding method and device based on a VPP instance, equipment, a medium and a product. The method is applied to a target VPP instance in a load balancing system, the load balancing system further comprises a control module, a VPP cluster composed of a plurality of vector data packet processing VPP instances and a target database storing configuration slots having a binding relationship with the VPP instances, and the method comprises the following steps: receiving to-be-forwarded message data sent to the target VPP instance; determining a target configuration slot bound with the target VPP instance; a target address set corresponding to the target configuration slot is read from a target database, and the target address set is a network address capable of being borne by the target VPP instance; and forwarding the message data to be forwarded according to the target address set. By adopting the scheme provided by the invention, the high availability of message data forwarding can be realized while the forwarding of ten millions of magnitudes of message data is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of cloud computing, and in particular to a data forwarding method, device, equipment, medium and product based on a VPP instance. Background Art

[0002] In the field of cloud computing, big data and edge computing, high-concurrency load balancing is usually achieved through the following two methods: the first is through a three-layer gateway, and the second is at the fourth layer and above protocol layer.

[0003] In order to achieve forwarding of tens of millions of messages, VPP (Vector Packet Processing) is usually used in related technologies to achieve forwarding of message data. However, VPP can achieve forwarding of tens of millions of messages, but it cannot provide high availability by itself. Moreover, the network address is usually directly bound to VPP. Once the node is abnormal, the service is unavailable, and there is a single point of failure. At the same time, VPP relies on the hardware resources of a single node. When the business volume increases, it cannot achieve horizontal expansion by increasing resources. Summary of the invention

[0004] The embodiments of the present application provide a data forwarding method, apparatus, device, medium and product based on a VPP instance, which can realize the forwarding of tens of millions of message data while also realizing high availability of message data forwarding.

[0005] In a first aspect, an embodiment of the present application provides a data forwarding method based on a VPP instance, which is applied to a target VPP instance in a load balancing system. The load balancing system also includes a control module, a VPP cluster composed of multiple vector packet processing VPP instances, and a target database storing configuration slots having a binding relationship with the VPP instance. The method includes: receiving message data to be forwarded sent to the target VPP instance; determining a target configuration slot bound to the target VPP instance; reading a target address set corresponding to the target configuration slot from the target database, wherein the target address set is a network address that the target VPP instance can carry; and forwarding the message data to be forwarded according to the target address set.

[0006] In a second aspect, an embodiment of the present application provides a data forwarding device based on a VPP instance, which is applied to a target VPP instance in a load balancing system. The load balancing system also includes a control module, a VPP cluster composed of multiple vector packet processing VPP instances, and a target database storing configuration slots having a binding relationship with the VPP instance. The device includes: a data receiving module, which is used to receive message data to be forwarded and sent to the target VPP instance; a configuration slot determination module, which is used to determine the target configuration slot bound to the target VPP instance; an address reading module, which is used to read a target address set corresponding to the target configuration slot from the target database, wherein the target address set is a network address that the target VPP instance can carry; and a data forwarding module, which is used to forward the message data to be forwarded according to the target address set.

[0007] In a third aspect, an embodiment of the present application provides an electronic device, comprising: a processor and a memory storing computer program instructions; when the processor executes the computer program instructions, the data forwarding method based on the VPP instance as described in the first aspect is implemented.

[0008] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium having computer program instructions stored thereon. When the computer program instructions are executed by a processor, the data forwarding method based on a VPP instance as described in the first aspect is implemented.

[0009] In a fifth aspect, an embodiment of the present application provides a computer program product. When instructions in the computer program product are executed by a processor of an electronic device, the electronic device executes the data forwarding method based on the VPP instance as described in the first aspect.

[0010] As can be seen from the above content, in the embodiment of the present application, the VPP instance is not directly bound to the network address, but is bound to the configuration slot. Therefore, when the number of VPP instances changes, for example, expansion or reduction, or an abnormality occurs in a certain VPP instance, load balancing can be achieved by allocating configuration slots to the remaining VPP instances. Since the configuration slot stores an address set, and the VPP instance is only bound to the configuration slot, when an abnormality occurs in the VPP instance, the address set in the configuration slot bound to the VPP instance will not be reported, and the configuration slot can be bound to other VPP instances to provide services, thereby achieving high availability of data forwarding.

[0011] It can be seen that the solution proposed in the embodiment of the present application can achieve high availability of message data forwarding while achieving forwarding of tens of millions of messages. BRIEF DESCRIPTION OF THE DRAWINGS

[0012] In order to more clearly illustrate the technical solution of the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0013] Figure 1 It is a schematic diagram of the framework of Nginx to achieve load balancing in the related technology;

[0014] Figure 2 This is a schematic diagram of a framework for implementing high-concurrency work with a VPP provided by an embodiment of the present application;

[0015] Figure 3 This is a schematic diagram of a framework for implementing four-layer load balancing provided by an embodiment of the present application;

[0016] Figure 4 This is a schematic diagram of a framework for implementing four-layer load balancing provided by an embodiment of the present application;

[0017] Figure 5 It is a structural diagram of a load balancing system provided by an embodiment of the present application;

[0018] Figure 6 It is a flowchart of a data forwarding method based on a VPP instance provided by an embodiment of the present application;

[0019] Figure 7 This is a schematic diagram of address configuration provided by an embodiment of the present application;

[0020] Figure 8 This is a schematic diagram of load balancing in a scenario where the heartbeat between a VPP instance and a control module is disconnected, provided by an embodiment of the present application;

[0021] Fig. 9 It is a schematic diagram of interaction when a load balancing configuration is issued when a bidirectional heartbeat between a VPP instance and a control module is normal according to an embodiment of the present application;

[0022] Fig.10 is a structural diagram of a data forwarding device based on a VPP instance provided in another embodiment of the present application;

[0023] Fig.11 It is a structural diagram of an electronic device provided by yet another embodiment of the present application. DETAILED DESCRIPTION

[0024] The features and exemplary embodiments of various aspects of the present application will be described in detail below. In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are only intended to explain the present application, rather than to limit the present application. For those skilled in the art, the present application can be implemented without the need for some of these specific details. The following description of the embodiments is only to provide a better understanding of the present application by illustrating the examples of the present application.

[0025] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the statement "include..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.

[0026] For ease of understanding, before explaining the solution provided in this application, the relevant background involved in the solution provided in this application is first explained.

[0027] There are two main load balancing solutions for achieving high concurrency: the first is implemented through a layer 3 gateway, and the second is implemented at layer 4 and above protocol layers. The following is a brief description:

[0028] In the solution of implementing load balancing with a three-layer gateway, an IP address is bound to a gateway. When a client accesses the IP, the gateway loads the message data to different backend instances. A common solution is IPVS (IP Virtual Server).

[0029] In the solution of implementing load balancing at layer 4 and above, specific server software is deployed on a server to listen to the specified address (IP: Port). When the client accesses this address, it accesses the software, which then forwards the client request to different backend instances according to different strategies. Common solutions include Nginx, haproxy, etc.

[0030] In addition, in related technologies, load balancing can also be achieved through DNS (Domain Name System), that is, when a client requests a DNS service, the domain name server returns the addresses of different application server instances according to the policy to achieve load balancing. This method is difficult to achieve high concurrency and requires the client to configure a specific DNS server address, which has great limitations.

[0031] In related technologies, load balancing can also be achieved through F5, which has the advantages of high performance and more flexible supported configurations, but it is dedicated hardware and has a high cost.

[0032] From the above content, we can know that whether it is a three-layer gateway to achieve load balancing (i.e. IPVS type solution) or a four-layer or higher protocol layer to achieve load balancing (i.e. Nginx type solution), they are all based on the system interface provided by the kernel to implement forwarding logic. For example, IPVS uses tools such as iptables to directly configure the routing table in the kernel module netfilter, and Nginx is based on the epoll mechanism provided by the kernel to achieve concurrency. Among them, Figure 1 The following diagram shows the framework of Nginx load balancing. Figure 1 It can be seen that Nginx can realize the forwarding, interception and routing of message data. In the process of load balancing, the network card sends it to the CPU through interruption. The CPU responds to the instructions of the kernel and sends the message data to the kernel so that the kernel memory receives the data packet. At the same time, vfio releases the data packet. Then, the kernel copies the unsealed data packet to the user's memory, and the application obtains the data packet by calling epoll.

[0033] Depend on Figure 1 It can be seen that when the kernel communicates on the network, it needs to go through steps such as interrupt driving, user state and protocol state conversion. Its performance upper limit is in the order of hundreds of thousands of pps, usually within 300Kpps, and cannot adapt to cloud computing scenarios with tens of millions of concurrent users.

[0034] VPP can achieve forwarding of tens of millions of messages, but it cannot provide high availability. Once a node fails, the service becomes unavailable, and there is a single point of failure. At the same time, it relies on the hardware resources of a single node. When the business volume increases, it cannot achieve horizontal expansion by adding resources.

[0035] In order to solve the problems of the prior art, the embodiments of the present application provide a data forwarding method, apparatus, device, medium and product based on a VPP instance.

[0036] The method proposed in the embodiment of the present application can achieve three-layer and four-layer load balancing of tens of millions of forwardings (concurrency) on a general server, reducing the cost of use; at the same time, the load balancing capability can be horizontally scalable, and when a small number of instances exit abnormally, configuration migration can be achieved, eliminating single points of failure and achieving high availability.

[0037] It should be noted that the method proposed in the embodiment of the present application can be applied to building highly available, tens of millions of concurrent load balancing and NAT gateways on general servers, in the fields of private networks (campuses, factories), cloud computing SDN (Software Defined Network), etc.

[0038] Before introducing the method proposed in the embodiment of the present application, the related technologies involved in the embodiment of the present application are explained.

[0039] VPP and DPDK (Data Plane Development Kit) achieve forwarding at the level of tens of millions. The construction of server software usually relies on the kernel network module, and thus on the performance of the kernel. In order to make network devices easier to use, the kernel opens them to users through a virtual file system. The process needs to go through multiple processes such as interrupt request, interrupt response, and memory copy, and its performance limit is at the level of hundreds of thousands of forwarding. VPP bypasses kernel interrupts and uses DPDK polling to interact with the network card, which can reach the level of tens of millions of PPS. Under the 700B packet length and 10G optical port model, it can reach more than 10Mpps. Figure 2 The framework diagram of VPP to achieve high concurrency work is shown. Figure 2 It can be seen that VPP can realize the forwarding of message data and NAT (Network Address Translation). Figure 2 In the process, VPP interacts with the network card through DPDK and CPUD polling, and sends the data packets to the memory, and then vifo-pci decapsulates the data packets in the memory.

[0040] Load balancing is a mechanism that distributes the load of access to the same destination address to different instances. Layer 3 load balancing (i.e., network layer load balancing) distributes the load of access to the same IP to different IPs; Layer 4 load balancing (i.e., transport layer load balancing) distributes the load of access to the same Layer 4 address (IP:Port) to different Layer 4 addresses (IP:Port); Layer 5 and above protocols are usually implemented by applications and require parsing of application layer messages. For example, http protocol load balancing can distribute the load of access to the same URI (Uniform Resource Identifier) ​​path to different backend instances.

[0041] It is worth noting that the four layers of the network protocol stack are usually implemented by the operating system, and the encapsulation of the IP protocol (layer 3) by TCP (Transmission Control Protocol) / UDP (User Datagram Protocol) is standard and clear. Therefore, there are two ways to implement four-layer load balancing: the first is to implement it by the application, such as Figure 3 As shown in the figure, in this implementation, the client establishes a link with the FA (Floating Address), and then the application that opens the FA establishes a link with the actual address EP of the backend for forwarding; the second method is implemented on the gateway (usually working at the third layer, the network layer), such as Figure 4 As shown, the gateway modifies the message sent from the client to the FA, and directly converts the address of the FA into the address of the EP, that is, NAT. In this implementation mode, the client does not establish a link with the FA.

[0042] It should be noted that in the embodiment of the present application, the four-layer load balancing belongs to the second mode. To simplify the description, the following takes the four-layer balancing, i.e. (IP:Port) load balancing, as an example. The four-layer load balancing situation includes the three-layer (i.e. pure IP load balancing) situation. In the four-layer load balancing, the Port in the FA is not mapped, i.e. it degenerates into the three-layer load balancing.

[0043] The data forwarding method based on VPP instance proposed in the embodiment of the present application can be applied to the target VPP instance in the load balancing system, and the load balancing system also includes a control module, a VPP cluster composed of multiple vector packet processing VPP instances, and a target database storing configuration slots with binding relationships with the VPP instances. Among them, the target database can be a Redis database, or other middleware with message subscription and storage functions. In the embodiment of the present application, the Redis database is taken as an example for explanation.

[0044] The following combination Figure 5 The structural diagram of the load balancing system shown explains each module included in the load balancing system.

[0045] For Redis, in the embodiment of the present application, Redis is used as a middleware and deployed in a cluster with one master and multiple backups. In the embodiment of the present application, the message channel, distributed lock, hash table, set collection and other features of Redis are mainly used.

[0046] The data structure and function in Redis are as follows:

[0047] (1)MEMBER_NUMBER: Message channel used to broadcast changes in the number of VPP clusters. It is maintained by the control module and subscribed to by VPP instances. Once a change occurs, a rebalancing process is triggered, so that all configurations are evenly redistributed to the existing VPP instances.

[0048] (2) SLOT- <index>: Each configuration slot Slot, where Index is the index number of the configuration slot, and the value range is [1, MAX_MEMBER_NUMBER], where MAX_MEMBER_NUMBER is the maximum number of VPP instances, which is determined when the VPP instance is deployed. The configuration slot contains two address sets, namely the first address set and the second address set. The first address set includes the floating address FA corresponding to the server providing the service, which is bound to ETH_IN in the VPP instance; the second address set includes the camouflage address MA corresponding to the client sending the message data to be forwarded, which is bound to ETH_OUT in the VPP instance.

[0049] It should be noted that the address range of the network addresses in the above two address sets can be designed according to the specific network environment and is not specifically limited here. <index>Divided into SLOT- <index>_IN、SLOT- <index>For example, smember SLOT-1_IN and smember SLOT-1_OUT, the corresponding address set retrieval results can be implemented by the following code:

[0050] :6379>smember SLOT-1_IN

[0051] 1) "10.10.12.59"

[0052] 2) "10.10.12.60"

[0053] :6379>smember SLOT-1_OUT

[0054] 3) "192.168.12.59"

[0055] 4) "192.168.12.60"

[0056] The above code indicates that the network card corresponding to ETH_IN on VPP instance 1 is bound to the two network addresses 10.10.12.59 and 10.10.12.60, and the network card corresponding to ETH_OUT is bound to the two network addresses 192.168.12.59 and 192.168.12.60. The corresponding VPP rules are implemented by the following code:

[0057] set interface ip address ETH_IN 10.10.12.59 / 24

[0058] set interface ip address ETH_IN 10.10.12.59 / 24

[0059] set interface ip address ETH_OUT 192.168.12.59 / 24

[0060] set interface ip address ETH_OUT 192.168.12.60 / 24

[0061] nat44 add address 192.168.12.60tenant-vrf 0

[0062] (3) <ip>: Hash table, where filed in the Hash table is each port Port, and value is a string composed of load balancing EPs, for example, hgetall 10.10.12.59, and its corresponding implementation code is as follows:

[0063] 1) "80"

[0064] 2)"192.168.11.14:80,192.168.11.15:80"

[0065] 3)"443"

[0066] 4)"192.168.11.13:443,192.168.11.14:443,192.168.11.5:443"

[0067] The above code represents two load balancing rules corresponding to the address 10.10.12.59. The first load balancing rule sets the destination address to ( <ip>:80) are loaded to the two addresses 192.168.11.14:80 and 192.168.11.15:80 respectively; the second load balancing rule loads the data packets with the destination address ( <ip>:443) are loaded to the three addresses 192.168.11.13:443, 192.168.11.14:443, and 192.168.11.5:443 respectively. The corresponding VPP rules are represented by the following code:

[0068] nat44 add load-balancing static mapping protocol tcpexternal10.10.12.59:80 192.168.11.14:80probability 50local 192.168.11.15:80probability 50

[0069] nat44 add load-balancing static mapping protocol tcpexternal10.10.12.59:443local 192.168.11.13:443probability 50local192.168.11.14:443probability 50local 192.168.11.15:443probability 50

[0070] If it is a layer 3 load, the port number is 0. At this time, there is only one configuration in the hash table (hgetall will find 2 records):

[0071] 1)"0"

[0072] 2)"192.168.11.14probability 50local 192.168.11.15probability 50"

[0073] (4)INSTANCE- <index>: Message channel, where Index is the VPP instance index number, and its value range is [1,MEMBER_NUMBER]. When the control module sends the configuration to the VPP instance, it writes (IP:Port) to INSTANCE- <index>Each VPP instance monitors the corresponding INSTANCE- <index>, and read the address set it can carry from its respective configuration slot SLOT, and then go to the corresponding <ip>The corresponding configuration is read from the table and sent to VPP.

[0074] It should be noted that the network address and INSTANCE- <index>The relationship between can be calculated by the configuration slot index corresponding to the address set and the instance number MEMBER_NUMBER. The configuration slot index corresponding to the VPP instance can be calculated by the following formula:

[0075] SLOT_INDEX=n*MEMBER_NUMBER+Index, n∈[1,MAX_MEMBER_NUMBER / MEMBER_NUMBER].

[0076] (5)LOCK- <index>: Distributed lock, where Index is the index number of the distributed lock, and its value range is [1,MEMBER_NUMBER]. During the rebalancing process, each VPP instance will try to obtain the distributed lock with the index number [1,MEMBER_NUMBER]. After successfully obtaining it, the index number of the VPP instance is the index number of the distributed lock.

[0077] The control module is mainly used to maintain the number of VPP instances and issue configurations. There is a two-way heartbeat between the control module and each VPP instance. Once a VPP instance has an abnormal heartbeat or a new VPP instance is added, the control module will publish an update to the number of VPP clusters through the Redis message channel to trigger rebalancing; after the configuration is issued to the VPP instance, the corresponding VPP instance will also be notified to read the configuration from Redis.

[0078] For a VPP instance, it consists of vpp-agent and VPP. vpp-agent is used to read configuration data from Redis and send it to VPP; VPP is used to make the configuration effective. vpp-agent and VPP together form an instance and cannot exist independently. The exit of either will cause the entire VPP instance to exit or restart.

[0079] It should be noted that the VPP in the VPP instance is an open source project based on the Apache-2 protocol. Each VPP instance manages two network cards, which are recorded as ETH_IN and ETH_OUT. ETH_IN is used to bind the floating address FA, and ETH_OUT is bound to the masquerade address MA, which is used to communicate with the endpoint address EP of the load balancing.

[0080] The key data structures and functions in the VPP instance memory are as follows:

[0081] (1)MEMBER_NUMBER_LOCAL: The MEMBER_NUMBER value in Redis read during the rebalancing process.

[0082] (2)MEMBER_NUMBER subscription: Subscribe to VPP cluster quantity change information, corresponding to MEMBER_NUMBER in Redis.

[0083] (3)INSTANCE- <index>Subscription: Subscribe to the configuration information related to oneself, corresponding to INSTANCE-<Index in Redis, where Index is the instance index and the value range is [1, MEMBER_NUMBER].

[0084] Next, the data forwarding method based on the VPP instance provided by the embodiments of the present application will be introduced.

[0085] Figure 6 FIG. shows a schematic flowchart of a data forwarding method based on a VPP instance provided by an embodiment of the present application. As Figure 6 shown, the method includes the following steps:

[0086] Step S601, receive the packet data to be forwarded sent to the target VPP instance.

[0087] In step S601, the target VPP instance is any instance in the VPP cluster. The packet data to be forwarded can be the packet data sent by the client to the server. For example, the packet data to be forwarded can be the packet sent by the client to access the network cloud disk. The packet data to be forwarded can also be the data returned by the server according to the request sent by the client. For example, when the client requests to access the photos in the network cloud disk and the server needs to return the photos in the network cloud disk to the client, at this time, the server needs to forward the photos to the client through the VPP instance.

[0088] It should be noted that in the embodiments of the present application, the case where the client sends the packet data to be forwarded to the server is taken as an example for description.

[0089] It can be seen from step S601 that in the embodiments of the present application, the VPP instance is used to implement data forwarding.

[0090] Step S602, determine the target configuration slot bound to the target VPP instance.

[0091] In step S602, each VPP instance is bound to at least one configuration slot, and each configuration slot includes an address set. The address set includes a first address set and a second address set, where the first address set includes a floating address FA, and the second address set includes a masquerade address MA.

[0092] It should be noted that load balancing must have FA, and FA must contain a network address. Therefore, the configuration of load balancing is bound to the network address, and the VPP instance is the entity that carries the network address. As long as the VPP instance can obtain the load balancing corresponding to its own bound network address, the configuration will take effect. The traditional method of using VPP instances is to directly bind the network address to the VPP instance. If the VPP instance exits, the network address bound to it will be lost, and the relevant configuration will not take effect; at the same time, when a new VPP instance is added, the original configuration is still bound to the original VPP instance, and the load cannot be shared to the new instance, requiring manual intervention to repair or migrate.

[0093] In the embodiment of the present application, a configuration slot is introduced to store the relevant configuration information of the network address, and the VPP instance is bound to the configuration slot. When the number of VPP instances changes, the configuration slot only needs to be reallocated to the remaining VPP instances.

[0094] Step S603, reading a target address set corresponding to the target configuration slot from the target database.

[0095] In step S603, the target address set is a network address that can be carried by the target VPP instance.

[0096] As an example, if a user wants to access a network cloud disk, after the user enters the domain name of the network cloud disk in the browser, the DNS resolves the domain name to obtain the network address corresponding to the network cloud disk: 10.10.12.59, which is the floating address FA. The network address is bound (indirectly bound in the VPP instance, 10.10.12.59:80 is one of the FAs, which provides HTTP (Hypertext Transfer Protocol) service; 10.10.12.59:443 is also a FA, which provides HTTPS (Hypertext Transfer Protocol Secure) service. The network routes the access traffic (i.e., the request or message to access the network cloud disk) to a VPP instance. When a large number of clients access the service, the VPP instance forwards the traffic to the instance address EP that actually provides the service at the back end. Among them, the relationship between FA and EP can be issued by the control module and stored in Redis. At this time, the request source address received by the server corresponding to EP is no longer the original address of the client, but the disguised address MA after converting the client source address. When the VPP instance is abnormal or a new VPP instance is added, the control module and other VPP instances in the VPP cluster jointly complete the migration of FA to achieve high availability and horizontal expansion.

[0097] Step S604: forward the message data to be forwarded according to the target address set.

[0098] Still taking the access to the network cloud disk as an example, combined with Figure 7 In the address configuration diagram shown, the client accesses the network cloud disk through the FA address 10.10.12.59:443. The FA address is currently on VPP instance 1. The binding relationship is stored in SLOT-1_IN. Because VPP instance 1 grabs the distributed lock LOCK-1 when it starts, whoever grabs LOCK-1 is VPP instance 1.

[0099] SLOT-1_IN stores the address set to be bound to the current VPP instance ETH_IN, one of which is 10.10.12.59; SLOT-1_OUT stores the address set to be bound to the network card of the current VPP instance ETH_OUT. When VPP instance 1 is started, it obtains its corresponding EP through 10.10.12.59. Among them, there are two EPs for port 80: 192.168.11.14:80 and 192.168.11.15:80. These two EPs actually provide HTTP services for network cloud disks; there are also two EPs for port 443: 192.168.11.14:443 and 192.168.11.15:443. These two EPs actually provide HTTPS services for network cloud disks.

[0100] As can be seen from the above content, in the embodiment of the present application, the VPP instance is not directly bound to the network address, but is bound to the configuration slot. Therefore, when the number of VPP instances changes, for example, expansion or reduction, or some VPP instances have abnormalities, load balancing can be achieved by allocating configuration slots to the remaining VPP instances. Since the configuration slot stores an address set, and the VPP instance is only bound to the configuration slot, when the VPP instance has an abnormality, the address set in the configuration slot bound to the VPP instance will not be reported, and the configuration slot can be bound to other VPP instances to provide services, thereby achieving high availability of data forwarding.

[0101] It can be seen that the solution proposed in the embodiment of the present application can achieve high availability of message data forwarding while achieving forwarding of tens of millions of messages.

[0102] The following is an explanation of each step of the method proposed in the embodiment of the present application.

[0103] After receiving the message data to be forwarded, when the number of VPP instances in the VPP cluster changes (for example, expansion, reduction, or VPP instance abnormality), the configuration slot bound to the target VPP instance may also change. At this time, it is necessary to determine the target configuration slot bound to the target VPP instance, and then the target VPP instance can obtain the address set related to message data forwarding from the configuration slot.

[0104] Specifically, the target VPP instance reads the first VPP instance quantity from the message channel parameter in the target database; when a difference is detected between the first VPP instance quantity and the second VPP instance quantity, the VPP instance quantity stored in the target VPP instance is updated to the first VPP instance quantity, and the target configuration slot index is determined according to the first VPP instance quantity and the instance index of the target VPP instance, and then the configuration slot corresponding to the target configuration slot index is determined as the target configuration slot.

[0105] In the above embodiment, the message channel parameter is used to store the number of VPP instances in the load balancing system, and the second VPP instance number is the number of VPP instances stored in the target VPP instance. The difference between the first VPP instance number and the second VPP instance number includes that the first VPP instance number is greater than the second VPP instance number (i.e., expansion), and the first VPP instance number is less than the second VPP instance number (i.e., reduction, or VPP instance abnormality). The following is an explanation of the above two situations.

[0106] When the number of the first VPP instances is less than the number of the second VPP instances, the acquisition operation is performed on the multiple distributed locks stored in the target database in sequence according to the preset order to obtain the target distributed lock; the instance index of the target VPP instance is updated based on the index of the target distributed lock to obtain the target instance index; and the weighted sum of the target instance index and the number of the first VPP instances is calculated to obtain the target configuration slot index.

[0107] In one example, Figure 8 The load balancing process in the scenario where the heartbeat between the VPP instance and the control module is disconnected is shown. Figure 8 As shown, the process mainly includes the following steps:

[0108] Step S801: The VPP instance detects that the heartbeat between the VPP instance and the control module is disconnected, and the VPP instance stops its own load to prevent a network storm caused by duplicate network addresses.

[0109] In step S801, the heartbeat disconnection between the VPP instance and the control module is usually due to abnormal exit or scaling of the VPP instance, but in rare cases it is caused by network partitioning. At this time, the VPP instance and the control module are both normal, but the heartbeat is unknown. The VPP instance will set ETH_IN and ETH_OUT to down after waiting for N heartbeat cycles, that is, all configurations will not take effect until the heartbeat is normal and the configuration is updated and takes effect.

[0110] Step S802, the control module waits for N heartbeat cycles. If the heartbeat is restored within the waiting period, it is considered normal, an alarm message is generated, and no other operations are performed; if it is not restored within the waiting period, that is, the waiting time is exceeded, then step S803 is executed.

[0111] In step S802, N is a configurable value, which is usually set to the instance restart time to facilitate the restart operation of the compatible instance.

[0112] Step S803, the control module updates the MEMBER_NUMBER in Redis, that is, decrements the MEMBER_NUMBER by 1 and updates it to Redis.

[0113] Step S804: The VPP instance subscription to MEMBER_NUMBER quantity (ie, the first VPP instance quantity) changes.

[0114] Step S805, the VPP instance compares the subscribed MEMBER_NUMBER quantity with the MEMBER_NUMBER_LOCAL in the memory of the VPP instance (ie, the second VPP instance quantity). If they are the same, no operation is performed; if they are different, step S806 is executed.

[0115] In step S805, it is possible to adapt to the situation where a long instance restart or addition and deletion exist simultaneously in a short period of time, without affecting the final state.

[0116] Step S806: Update MEMBER_NUMBER_LOACAL and obtain a new distributed lock. After the VPP instance obtains the new distributed lock, it uses LOCK- <index>Update your own instance index INSTANCE- <index>.

[0117] In step S806, the VPP instance attempts to SET LOCK- <index> <version>NX AND <second>To determine the instance index, where Index∈[1,MEMBER_NUMBER], stop trying if successful.

[0118] Step S807: The VPP instance is based on INSTANCE- <index>, MAX_MEMBER_NUMBER and MEMBER_NUMBER_LOCAL calculate the index of the SLOT carried by this instance: SLOT-SET = {SLOT_INDEX = n*MEMBER_NUMBER + Index, n∈[1,MAX_MEMBER_NUMBER / MEMBER_NUMBER]}.

[0119] Step S808: The VPP instance is from all SLOT- <index>Get the address set of IN and OUT in (Index∈SLOT-SET).

[0120] Step S809, the VPP instance is sequentially divided into SLOT- <index>The address set in _IN obtains the address set bound to the VPP instance and updates the load balancing configuration corresponding to the address set in the VPP instance.

[0121] Step S810: The VPP instance is configured according to SLOT- <index>_IN address set updates the address set of ETH_IN in the VPP instance, according to SLOT- <index>The address set in ETH_OUT updates the address set of ETH_OUT in the VPP instance.

[0122] Step S811: The VPP instance continues to subscribe to MEMBER_NUMBER and INSTANCE- <index>.

[0123] When the server where the original VPP instance 1 is located fails and the heartbeat is disconnected, if the original VPP instance 1 still exists in the local process, for example, the network fails, then all VPP configurations will be deleted. At this time, the client accessing the network cloud disk through 10.10.12.59:443 can no longer access the network cloud disk. When the control module finds that the original VPP instance 1 is disconnected, it tells all the remaining VPP instances the number of remaining VPP instances. Each VPP instance re-determines its instance number by grabbing the lock, and then obtains the configuration information in the configuration slot based on its own instance number and binds it to the VPP interface. At this time, the client accessing the network cloud disk through 10.10.12.59:443 resumes access. The whole process varies depending on the heartbeat cycle configuration and takes several seconds.

[0124] For the capacity expansion scenario, the weighted sum of the instance index of the target VPP instance and the number of the first VPP instances is calculated to obtain the target configuration slot index.

[0125] For example, when the business volume increases and there is traffic competition between the network cloud disk and other businesses (for example, mobile office), the control module can add a new VPP instance to the VPP cluster. At this time, the control module actively initiates rebalancing, so that the VPP instance obtains the load balancing configuration from Redis and then updates the address set. The actual configuration update time of this process is only the switching time of the address set, which can be completed in about milliseconds.

[0126] It should be noted that when the control module is expanded, MEMBER_NUMBER is directly updated, and the subsequent process is the same as the heartbeat disconnection, which will not be repeated here.

[0127] There is also a scenario where the number of the first VPP instances is the same as the number of the second VPP instances, but the target configuration slot bound to the target VPP instance has changed. In this scenario, first, the weighted sum of the instance index of the target VPP instance and the number of the first VPP instances is calculated to obtain the target configuration slot index; then, the configuration slot corresponding to the target configuration slot index is determined from the multiple configuration slots stored in the target database to obtain the first configuration slot; and then, the target configuration slot bound to the target VPP instance is updated to the first configuration slot.

[0128] It should be noted that a bidirectional heartbeat is maintained between the VPP instance and the control module. When the heartbeat is normal, the VPP instance normally hosts the network address and load balancing configuration, and regularly maintains the Redis distributed lock LOCK- <index>; The control module provides interfaces to users normally and sends relevant configurations normally.

[0129] As an example, Fig. 9 The diagram shows the interaction between the VPP instance and the control module when the two-way heartbeat is normal and the load balancing configuration is sent. Fig. 9 It can be seen that the process mainly includes the following steps:

[0130] Step S901: When the heartbeat between the VPP instance and the control module is normal, the control module sends the load balancing configuration of the newly added IP:Port to Redis.

[0131] Step S902: The control module obtains the VPP instance index corresponding to the newly added load balancing configuration.

[0132] Step S903, send the configuration information between the slot index and the port SLOT_INDEX:IP:Port to Redis, and update INSTANCE- <index>.

[0133] Step S904: The VPP instance subscribes to and obtains INSTANCE- <index>Configuration information.

[0134] Step S905: The VPP instance obtains the INSTANCE- <index>The configuration information is verified, and if the verification passes, step S906 is executed.

[0135] Step S906: The VPP instance accesses the Redis <ip>, obtain IP:Port load balancing configuration information.

[0136] Step S907: The VPP instance updates the IP:Port load balancing configuration in the VPP instance.

[0137] Step S908: The VPP instance continues to subscribe and obtains INSTANCE- <index>Configuration information.

[0138] It should be noted that after rebalancing occurs, the network address drifts (from the original VPP instance to the new VPP instance), but the NAT-Session (i.e., NAT session) corresponding to the network address is stored in the memory of the VPP instance and is not synchronized to the new VPP instance. Therefore, in the embodiment of the present application, a session can be established on the target VPP instance based on static network address translation NAT, that is, the rule of nat44 add address 192.168.12.60tenant-vrf 0 is not configured, and a new session is established in real time on the new VPP instance without causing conflicts.

[0139] For (Client:Port), the client port is hashed to obtain the target port, and then the masquerade address is updated based on the target port. That is, the MA port is selected by performing hash calculation for (Client:Port) to reduce conflicts.

[0140] After a session is established on the target VPP instance based on the static network address translation NAT, a session table may be generated and stored in a target database, wherein the target database caches the session table based on the source address translation SNAT.

[0141] When the service has high requirements for SLA (Service-Level Agreement) and the network address resources required for static NAT addresses are insufficient, the session table can be cached in Redis according to the SNAT address, with one port corresponding to one IP:Port. <ip>: Hash table, filed is each Port, value is the client source address string, for example, hgetall192.168.12.60, the corresponding code is as follows:

[0142] 1)"27685"

[0143] 2)"172.168.11.14:27685"

[0144] 3)"31442"

[0145] 4)"172.168.11.13:44223"

[0146] This means that there are two NAT mappings under this network address, one is to map the source address 172.168.11.14:27685 to 192.168.12.60:27685, and the other is to map the source address 172.168.11.13:44223 to 192.168.12.60:44223. The EP sees the mapped address. Therefore, adding this design is friendly to the server to make different policies based on the client address.

[0147] Through the above design, the VPP cluster can be horizontally scaled within the range of [1, MAX_MEMBER_NUMBER], and after scaling, the availability of related configurations can still be guaranteed.

[0148] This completes the explanation of the method proposed in the embodiment of the present application.

[0149] From the above content, it can be seen that the method proposed in the embodiment of the present application realizes load balancing of tens of millions of forwardings (also supports tens of millions of concurrency) at the third layer (network layer) and the fourth layer (transport layer) based on the NAT capability of VPP; at the same time, the concept of configuration slots is introduced to decouple the configuration information of load balancing from the VPP instance; the VPP instance cluster is built using vpp-agent to realize the horizontal scalability of VPP, and when a small number of instances exit abnormally, configuration migration can be realized to eliminate single points of failure and achieve high availability.

[0150] Compared with IPVS and Nginx solutions, the use of VPP and DPDK technology to tap into the CPU and network card performance can achieve forwarding of tens of millions, with significantly higher performance; compared with the F5 solution, the method proposed in the embodiment of the present application can be deployed using a general-purpose server, and can form a cluster to achieve high availability and horizontal scalability, with lower costs and greater availability.

[0151] The present application also provides a data forwarding device based on a VPP instance, which is applied to a target VPP instance in a load balancing system. The load balancing system also includes a control module, a VPP cluster composed of multiple vector packet processing VPP instances, and a target database storing configuration slots that have a binding relationship with the VPP instance. Fig.10 As shown, the device 1000 includes: a data receiving module 1001 , a configuration slot determining module 1002 , an address reading module 1003 and a data forwarding module 1004 .

[0152] The data receiving module 1001 is used to receive the message data to be forwarded and sent to the target VPP instance;

[0153] A configuration slot determination module 1002 is used to determine a target configuration slot bound to a target VPP instance;

[0154] The address reading module 1003 is used to read the target address set corresponding to the target configuration slot from the target database, wherein the target address set is the network address that the target VPP instance can carry;

[0155] The data forwarding module 1004 is used to forward the message data to be forwarded according to the target address set.

[0156] In one example, the configuration slot determination module includes: an instance quantity acquisition module, an instance quantity update module, and an index determination module. The instance quantity acquisition module is used to read the first VPP instance quantity from the message channel parameter of the target database, wherein the message channel parameter is used to store the number of VPP instances in the load balancing system; the instance quantity update module is used to update the number of VPP instances stored in the target VPP instance to the first VPP instance quantity when a difference is detected between the first VPP instance quantity and the second VPP instance quantity, and determine the target configuration slot index according to the first VPP instance quantity and the instance index of the target VPP instance, wherein the second VPP instance quantity is the number of VPP instances stored in the target VPP instance; the index determination module is used to determine the configuration slot corresponding to the target configuration slot index as the target configuration slot.

[0157] In one example, the instance quantity update module is specifically used to, when the number of first VPP instances is less than the number of second VPP instances, sequentially acquire multiple distributed locks stored in the target database in a preset order to obtain a target distributed lock; update the instance index of the target VPP instance based on the index of the target distributed lock to obtain a target instance index; calculate the weighted sum of the target instance index and the number of first VPP instances to obtain a target configuration slot index.

[0158] In one example, the instance quantity updating module is specifically configured to calculate a weighted sum of the instance index of the target VPP instance and the first VPP instance quantity to obtain the target configuration slot index when the first VPP instance quantity is greater than the second VPP instance quantity.

[0159] In one example, the data forwarding device based on the VPP instance also includes: a configuration slot updating module, which is used to calculate the weighted sum of the instance index of the target VPP instance and the number of the first VPP instance to obtain the target configuration slot index when it is detected that the number of the first VPP instance is the same as the number of the second VPP instance and the target configuration slot bound to the target VPP instance changes; determine the configuration slot corresponding to the target configuration slot index from multiple configuration slots stored in the target database to obtain the first configuration slot; and update the target configuration slot bound to the target VPP instance to the first configuration slot.

[0160] In one example, the data forwarding device based on the VPP instance further includes: a session establishing module, configured to establish a session on the target VPP instance based on a static network address translation NAT.

[0161] In one example, the target address set includes a first address set and a second address set, the first address set includes a floating address corresponding to a server providing a service, and the second address set includes a camouflaged address corresponding to a client sending a message data to be forwarded; wherein the data forwarding device based on the VPP instance also includes: an address update module, which is used to perform hash calculation on the port of the client to obtain a target port; and update the camouflaged address based on the target port.

[0162] In one example, the data forwarding device based on the VPP instance further includes: a session cache module, which is used to generate a session table and store the session table in a target database, wherein the target database caches the session table based on source address translation SNAT.

[0163] The data forwarding device based on the VPP instance provided in the embodiment of the present application can implement each process implemented in the aforementioned method embodiment, and will not be described again here to avoid repetition.

[0164] The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.

[0165] Fig.11 A schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application is shown.

[0166] The electronic device may include a processor 1101 and a memory 1102 storing computer program instructions.

[0167] Specifically, the processor 1101 may include a central processing unit (CPU), or an application specific integrated circuit (ASIC), or may be configured to implement one or more integrated circuits of the embodiments of the present application.

[0168] The memory 1102 may include a large capacity memory for data or instructions. By way of example and not limitation, the memory 1102 may include a hard disk drive (HDD), a floppy disk drive, a flash memory, an optical disk, a magneto-optical disk, a magnetic tape, or a universal serial bus (USB) drive or a combination of two or more of these. In appropriate cases, the memory 1102 may include a removable or non-removable (or fixed) medium. In appropriate cases, the memory 1102 may be inside or outside the integrated gateway disaster recovery device. In a specific embodiment, the memory 1102 is a non-volatile solid-state memory.

[0169] The memory may include read-only memory (ROM), random access memory (RAM), magnetic disk storage media devices, optical storage media devices, flash memory devices, electrical, optical or other physical / tangible memory storage devices. Thus, typically, the memory includes one or more tangible (non-transitory) computer-readable storage media (e.g., memory devices) encoded with software including computer-executable instructions, and when the software is executed (e.g., by one or more processors), it is operable to perform the operations described with reference to the method according to an aspect of the present disclosure.

[0170] The processor 1101 reads and executes computer program instructions stored in the memory 1102 to implement any one of the data forwarding methods based on the VPP instance in the above embodiments.

[0171] In one example, the electronic device may further include a communication interface 1103 and a bus 1110. Fig.11 As shown, the processor 1101, the memory 1102, and the communication interface 1103 are connected via a bus 1110 and communicate with each other.

[0172] The communication interface 1103 is mainly used to implement communication between various modules, devices, units and / or equipment in the embodiments of the present application.

[0173] Bus 1110 includes hardware, software or both, and the parts of electronic equipment are coupled to each other.For example, but not limitation, bus may include accelerated graphics port (AGP) or other graphics bus, enhanced industrial standard architecture (EISA) bus, front side bus (FSB), hypertransport (HT) interconnection, industrial standard architecture (ISA) bus, infinite bandwidth interconnection, low pin count (LPC) bus, memory bus, micro channel architecture (MCA) bus, peripheral component interconnection (PCI) bus, PCI-Express (PCI-X) bus, serial advanced technology attachment (SATA) bus, video electronics standard association local (VLB) bus or other suitable bus or two or more of these combinations. In appropriate cases, bus 1110 may include one or more buses. Although the present application embodiment describes and shows a specific bus, the application considers any suitable bus or interconnection.

[0174] In addition, in combination with the data forwarding method based on the VPP instance in the above embodiment, the embodiment of the present application can provide a computer-readable storage medium for implementation. The computer-readable storage medium stores computer program instructions; when the computer program instructions are executed by the processor, any one of the data forwarding methods based on the VPP instance in the above embodiment is implemented.

[0175] In addition, in combination with the data forwarding method based on the VPP instance in the above embodiment, the embodiment of the present application can provide a computer program product for implementation. When the instructions in the computer program product are executed by the processor of the electronic device, the electronic device executes and implements any one of the data forwarding methods based on the VPP instance in the above embodiment.

[0176] It should be clear that the present application is not limited to the specific configuration and processing described above and shown in the figures. For the sake of simplicity, a detailed description of the known method is omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of the present application is not limited to the specific steps described and shown, and those skilled in the art can make various changes, modifications and additions, or change the order between the steps after understanding the spirit of the present application.

[0177] The functional modules shown in the above-described block diagram can be implemented as hardware, software, firmware or a combination thereof. When implemented in hardware, it can be, for example, an electronic circuit, an application specific integrated circuit (ASIC), appropriate firmware, a plug-in, a function card, etc. When implemented in software, the elements of the present application are programs or code segments that are used to perform the required tasks. Programs or code segments can be stored in machine-readable media, or transmitted on a transmission medium or a communication link by a data signal carried in a carrier wave. "Machine-readable media" can include any medium that can store or transmit information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, ROM, flash memory, erasable ROM (EROM), floppy disks, CD-ROMs, optical disks, hard disks, optical fiber media, radio frequency (RF) links, etc. Code segments can be downloaded via computer networks such as the Internet, intranets, etc.

[0178] It should also be noted that the exemplary embodiments mentioned in this application describe some methods or systems based on a series of steps or devices. However, this application is not limited to the order of the above steps, that is, the steps can be performed in the order mentioned in the embodiment, or in a different order from the embodiment, or several steps can be performed simultaneously.

[0179] The above describes various aspects of the present disclosure with reference to the flowcharts and / or block diagrams of the data forwarding methods, devices, equipment, media and products based on VPP instances according to the embodiments of the present disclosure. It should be understood that each box in the flowchart and / or block diagram and the combination of boxes in the flowchart and / or block diagram can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device to produce a machine so that these instructions executed by the processor of the computer or other programmable data processing device enable the implementation of the functions / actions specified in one or more boxes of the flowchart and / or block diagram. Such a processor may be, but is not limited to, a general-purpose processor, a special-purpose processor, a special application processor, or a field programmable logic circuit. It can also be understood that each box in the block diagram and / or flowchart and the combination of boxes in the block diagram and / or flowchart can also be implemented by dedicated hardware that performs the specified function or action, or can be implemented by a combination of dedicated hardware and computer instructions.

[0180] The above is only a specific implementation of the present application. Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working processes of the systems, modules and units described above can refer to the corresponding processes in the aforementioned method embodiments, and will not be repeated here. It should be understood that the protection scope of the present application is not limited to this. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed in this application, and these modifications or replacements should be included in the protection scope of this application.< / ip> < / index> < / ip> < / index> < / index> < / index> < / index> < / index> < / index> < / index> < / index> < / index> < / index> < / second> < / version> < / index> < / index> < / index> < / index> < / index> < / index> < / ip> < / index> < / index> < / index> < / ip> < / ip> < / ip> < / index> < / index> < / index> < / index>

Claims

1. A data forwarding method based on a VPP instance, It is characterized in that In a target VPP instance applied to a load balancing system, the load balancing system further includes a control module, a VPP cluster consisting of a plurality of vector packet processing VPP instances, and a target database storing configuration slots having a binding relationship with the VPP instances, the method includes: Receive the message data to be forwarded sent to the target VPP instance; Determine a target configuration slot bound to the target VPP instance; Reading a target address set corresponding to the target configuration slot from the target database, wherein the target address set is a network address that can be carried by the target VPP instance; The to-be-forwarded message data is forwarded according to the target address set.

2. The method according to claim 1, It is characterized in that Determining a target configuration slot bound to the target VPP instance includes: Reading the first VPP instance quantity from the message channel parameter in the target database, wherein the message channel parameter is used to store the quantity of the VPP instances in the load balancing system; In the case of detecting a difference between the first VPP instance number and the second VPP instance number, updating the VPP instance number stored in the target VPP instance to the first VPP instance number, and determining a target configuration slot index according to the first VPP instance number and the instance index of the target VPP instance, wherein the second VPP instance number is the VPP instance number stored in the target VPP instance; The configuration slot corresponding to the target configuration slot index is determined as the target configuration slot.

3. The method according to claim 2, It is characterized in that Determining a target configuration slot index according to the number of the first VPP instances and the instance index of the target VPP instance includes: When the number of the first VPP instances is less than the number of the second VPP instances, performing acquisition operations on the multiple distributed locks stored in the target database in sequence according to a preset order to obtain a target distributed lock; Based on the index of the target distributed lock, the instance index of the target VPP instance is updated to obtain the target instance index; A weighted sum of the target instance index and the number of the first VPP instances is calculated to obtain the target configuration slot index.

4. The method according to claim 2, It is characterized in that Determining a target configuration slot index according to the number of the first VPP instances and the instance index of the target VPP instance includes: When the number of the first VPP instances is greater than the number of the second VPP instances, a weighted sum of the instance index of the target VPP instance and the number of the first VPP instances is calculated to obtain the target configuration slot index.

5. The method according to claim 2, It is characterized in that After determining the target configuration slot bound to the target VPP instance, the method further includes: When it is detected that the number of the first VPP instances is the same as the number of the second VPP instances and the target configuration slot bound to the target VPP instance changes, a weighted sum of the instance index of the target VPP instance and the number of the first VPP instances is calculated to obtain the target configuration slot index; Determine a configuration slot corresponding to the target configuration slot index from a plurality of configuration slots stored in the target database to obtain a first configuration slot; The target configuration slot bound to the target VPP instance is updated to the first configuration slot.

6. The method according to any one of claims 2 to 5, It is characterized in that After reading the target address set corresponding to the target configuration slot from the target database, the method further includes: A session is established on the target VPP instance based on static network address translation NAT.

7. The method according to claim 6, It is characterized in that The target address set includes a first address set and a second address set, the first address set includes a floating address corresponding to a server providing a service, and the second address set includes a camouflaged address corresponding to a client sending the message data to be forwarded; wherein, after establishing a session on the target VPP instance based on static network address translation NAT, the method further includes: Performing hash calculation on the port of the client to obtain a target port; The spoofed address is updated based on the target port.

8. The method according to claim 6, It is characterized in that After establishing a session on the target VPP instance based on static network address translation NAT, the method further includes: A session table is generated, and the session table is stored in the target database, wherein the target database caches the session table based on source address translation (SNAT).

9. A data forwarding device based on a VPP instance, It is characterized in that In a target VPP instance applied to a load balancing system, the load balancing system further includes a control module, a VPP cluster consisting of a plurality of vector packet processing VPP instances, and a target database storing configuration slots having a binding relationship with the VPP instances, the device includes: A data receiving module, used to receive the message data to be forwarded sent to the target VPP instance; A configuration slot determination module, used to determine a target configuration slot bound to the target VPP instance; An address reading module, configured to read a target address set corresponding to the target configuration slot from the target database, wherein the target address set is a network address that can be carried by the target VPP instance; A data forwarding module is used to forward the message data to be forwarded according to the target address set.

10. An electronic device, It is characterized in that The electronic device comprises: a processor and a memory storing computer program instructions; When the processor executes the computer program instructions, the method for data forwarding based on a VPP instance according to any one of claims 1 to 8 is implemented.

11. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores computer program instructions, and when the computer program instructions are executed by the processor, the method for forwarding data based on a VPP instance according to any one of claims 1 to 8 is implemented.

12. A computer program product, It is characterized in that When the instructions in the computer program product are executed by a processor of an electronic device, the electronic device executes the data forwarding method based on a VPP instance as described in any one of claims 1 to 8.

Citation Information

Patent Citations

  • Method, device and equipment for setting transmission load of PCIE hot plugging device

    CN108363673A

  • Method for managing hard disks, and electronic equipment

    CN108776598A

  • Method and device for automatically allocating VPP addresses to signal conditioning equipment

    CN111966419A

  • RISER card, configuration method and device thereof and readable storage medium

    CN115934605A

  • Memory Reconfiguration During System Run-Time

    US20120079306A1