Data forwarding method and device based on VPP instance, equipment, medium and product
By introducing a configuration slot mechanism into VPP instances, the issues of high availability and horizontal scaling in VPP with tens of millions of forwarding operations are resolved, achieving efficient load balancing and highly available data forwarding.
Patent Information
- Application Number
- CN202410680947.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-29
- Publication Date
- 2025-11-18
- Estimated Expiration
- 2044-05-29
AI Technical Summary
In existing technologies, VPP cannot provide high availability when achieving tens of millions of forwarding operations, and it cannot be horizontally scaled due to its reliance on the hardware resources of a single node, posing a single point of failure risk.
By introducing the concept of configuration slots in VPP instances, network addresses are stored in configuration slots instead of being directly bound to the VPP instance. Redis database is used to manage the allocation and migration of configuration slots, thereby achieving load balancing and high availability.
It achieves high availability while handling tens of millions of forwarding requests, and can automatically adjust configuration slots when the number of VPP instances changes, eliminating single points of failure and enabling horizontal scaling.
Smart Images

Figure CN118827673B_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of cloud computing, and in particular relates to a data forwarding method, apparatus, device, medium and product based on VPP instance. Background Technology
[0002] In the fields of cloud computing, big data, and edge computing, high-concurrency load balancing is typically achieved in two ways: the first is through a three-layer gateway, and the second is through a four-layer or higher protocol layer.
[0003] To achieve forwarding volumes in the tens of millions, related technologies typically use VPP (Vector Packet Processing) to forward packet data. However, while VPP can handle forwarding volumes in the tens of millions, it cannot provide high availability. Moreover, since network addresses are usually directly bound to VPP, service becomes unavailable if a node fails, creating a single point of failure. Furthermore, VPP relies on the hardware resources of a single node, making it impossible to horizontally scale by adding resources as traffic increases. Summary of the Invention
[0004] This application provides a data forwarding method, apparatus, device, medium, and product based on VPP instances, which can achieve the forwarding of tens of millions of message data while also achieving high availability of message data forwarding.
[0005] In a first aspect, embodiments of this application provide a data forwarding method based on a VPP instance, applied to a target VPP instance in a load balancing system. The load balancing system further includes a control module, a VPP cluster composed of multiple vector packet processing VPP instances, and a target database storing configuration slots bound to the VPP instances. The method includes: receiving packet data to be forwarded sent to the target VPP instance; determining the target configuration slot bound to the target VPP instance; reading 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; and forwarding the packet data to be forwarded according to the target address set.
[0006] Secondly, embodiments of this application provide a data forwarding device based on a VPP instance, applied to a target VPP instance in a load balancing system. The load balancing system further includes a control module, a VPP cluster composed of multiple vector packet processing VPP instances, and a target database storing configuration slots bound to the VPP instances. The device includes: a data receiving module for receiving packet data to be forwarded sent to the target VPP instance; a configuration slot determination module for determining the target configuration slot bound to the target VPP instance; an address reading module for reading a set of target addresses corresponding to the target configuration slot from the target database, wherein the set of target addresses is the network address that the target VPP instance can carry; and a data forwarding module for forwarding the packet data to be forwarded according to the set of target addresses.
[0007] Thirdly, embodiments of this application provide an electronic device, which includes: a processor and a memory storing computer program instructions; when the processor executes the computer program instructions, it implements the data forwarding method based on VPP instances as described in the first aspect.
[0008] Fourthly, embodiments of this application provide a computer-readable storage medium storing computer program instructions, which, when executed by a processor, implement the data forwarding method based on a VPP instance as described in the first aspect.
[0009] Fifthly, embodiments of this application provide a computer program product in which instructions, when executed by a processor of an electronic device, cause the electronic device to perform the data forwarding method based on a VPP instance as described in the first aspect.
[0010] As described above, in this embodiment, VPP instances are not directly bound to network addresses, but rather to configuration slots. Therefore, when the number of VPP instances changes—for example, during scaling up or down, or if a VPP instance malfunctions—load balancing can be achieved by allocating configuration slots to the remaining VPP instances. Since configuration slots store a set of addresses, and VPP instances are only bound to configuration slots, when a VPP instance malfunctions, the set of addresses in the configuration slot bound to that VPP instance is not lost. This configuration slot can then be bound to other VPP instances to provide services, thus achieving high availability for data forwarding.
[0011] Therefore, it can be seen that the solution proposed in the embodiments of this application can achieve the forwarding of tens of millions of message data while also achieving high availability of message data forwarding. Attached Figure Description
[0012] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments of this application will be briefly introduced below. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0013] Figure 1 This is a schematic diagram of the Nginx framework for load balancing in related technologies;
[0014] Figure 2 This is a schematic diagram of a framework for VPP to achieve high concurrency operation according to an embodiment of this application;
[0015] Figure 3 This is a schematic diagram of a framework for implementing four-layer load balancing provided in one embodiment of this application;
[0016] Figure 4 This is a schematic diagram of a framework for implementing four-layer load balancing provided in one embodiment of this application;
[0017] Figure 5 This is a schematic diagram of the structure of a load balancing system provided in one embodiment of this application;
[0018] Figure 6 This is a flowchart illustrating a data forwarding method based on a VPP instance provided in one embodiment of this application;
[0019] Figure 7 This is a schematic diagram of address configuration provided in one embodiment of this application;
[0020] Figure 8 This is a load balancing diagram of a scenario where the heartbeat between the VPP instance and the control module is disconnected, provided in one embodiment of this application.
[0021] Figure 9 This is an interactive diagram illustrating the distribution of load balancing configurations when the bidirectional heartbeat between the VPP instance and the control module is normal, according to one embodiment of this application.
[0022] Figure 10 This is a schematic diagram of the structure of a data forwarding device based on a VPP instance provided in another embodiment of this application;
[0023] Figure 11 This is a schematic diagram of the structure of an electronic device provided in another embodiment of this application. Detailed Implementation
[0024] The features and exemplary embodiments of various aspects of this application will be described in detail below. To make the objectives, technical solutions, and advantages of this application clearer, the application will be further described in detail below with reference to the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are only intended to explain this application and not to limit it. For those skilled in the art, this application can be implemented without some of these specific details. The following description of the embodiments is merely to provide a better understanding of this application by illustrating examples.
[0025] It should be noted that, in this document, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising..." does not exclude the presence of additional identical elements in the process, method, article, or apparatus that includes said element.
[0026] To facilitate understanding, before explaining the solution provided in this application, the relevant background of the solution provided in this application will be explained first.
[0027] Currently, 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 or higher protocol layers. These are briefly described below:
[0028] In a load balancing solution implemented through a three-layer gateway, an IP address is bound to a gateway. When a client accesses that IP address, the gateway distributes the packet data to different backend instances. A common solution is IPVS (IP Virtual Server).
[0029] In load balancing solutions implemented at layer 4 or higher, specific server software is deployed on a server to listen on a designated address (IP:Port). When a client accesses this address, it accesses this software, which then forwards the client request to different backend instances according to different strategies. Common solutions include Nginx and HAProxy.
[0030] Alternatively, load balancing can be achieved through DNS (Domain Name System). When a client requests DNS services, the domain name server returns the addresses of different application server instances according to a policy, thus achieving load balancing. However, this method is difficult to implement with high concurrency and requires the client to configure a specific DNS server address, which is a significant limitation.
[0031] In related technologies, load balancing can also be achieved through F5, which has advantages such as high performance and more flexible configuration support, but it is a dedicated hardware and has a higher cost.
[0032] As can be seen from the above, whether it's load balancing implemented using a Layer 3 gateway (i.e., the IPVS-like solution) or load balancing implemented using a Layer 4 or higher protocol layer (i.e., the Nginx-like solution), both rely on system interfaces provided by the kernel to implement forwarding logic. For example, IPVS uses tools like iptables to directly configure the routing table in the netfilter kernel module, while Nginx uses the epoll mechanism provided by the kernel to achieve concurrency. Figure 1 This diagram illustrates the framework for implementing load balancing in Nginx. Figure 1 As can be seen, Nginx can forward, intercept, and route packet data. During load balancing, the network card sends data to the CPU via an interrupt. The CPU responds to the kernel's instructions and sends the packet data to the kernel so that the kernel's memory can receive the data packets. At the same time, vfio decrypts the data packets. Then, the kernel copies the decrypted data packets to the user's memory, and the application then retrieves the data packets by calling epoll.
[0033] Depend on Figure 1 It is known that when the kernel communicates over a network, it needs to go through steps such as interrupt driving, user mode and protocol mode conversion. Its performance limit is in the range of hundreds of thousands of pps, usually within 300Kpps, which cannot adapt to cloud computing scenarios with tens of millions of concurrent users.
[0034] While VPP can handle tens of millions of forwards, it cannot provide high availability. Once a node fails, the service becomes unavailable, resulting in a single point of failure. Furthermore, it relies on the hardware resources of a single node, and cannot achieve horizontal scaling by adding resources when the workload increases.
[0035] To address the problems in the prior art, embodiments of this application provide a data forwarding method, apparatus, device, medium, and product based on VPP instances.
[0036] The method proposed in this application can achieve Layer 3 and Layer 4 load balancing with tens of millions of concurrent forwarding requests on general-purpose servers, reducing usage costs; at the same time, the load balancing capability can be horizontally scaled, and configuration migration can be achieved when a small number of instances abnormally exit, eliminating single points of failure and achieving high availability.
[0037] It should be noted that the method proposed in this application embodiment can be applied to building highly available load balancers and NAT gateways with tens of millions of concurrent connections on general-purpose servers, in fields such as private networks (campuses, factories), cloud computing SDN (Software Defined Network).
[0038] Before introducing the methods proposed in the embodiments of this application, the relevant technologies involved in the embodiments of this application will be described.
[0039] VPP and DPDK (Data Plane Development Kit) enable tens of millions of forwarding speeds. Server software construction typically relies on the kernel network module, and thus on the kernel's performance. To make network devices easier to use, the kernel exposes them to users through a virtual file system. This process involves multiple steps, including interrupt requests, interrupt responses, and memory copying, and its performance limit is in the hundreds of thousands of forwarding speeds. In contrast, VPP bypasses kernel interrupts and uses DPDK's polling method to interact with the network card, achieving tens of millions of PPS. Under a 700B packet length and a 10 Gigabit Ethernet optical port model, it can reach over 10 Mpps. Figure 2 This diagram illustrates the framework for VPP to achieve high concurrency, consisting of... Figure 2 As can be seen, VPP can perform packet data forwarding and NAT (Network Address Translation). Figure 2 In the process, VPP interacts with the network card through DPDK and CPUD polling, sends data packets to memory, and then vifo-pci decapsulates the data packets in memory.
[0040] Load balancing is a mechanism that distributes access to the same destination address across different instances. Layer 3 load balancing (i.e., network layer load balancing) distributes access to the same IP address across different IP addresses; Layer 4 load balancing (i.e., transport layer load balancing) distributes access to the same Layer 4 address (IP:Port) across different Layer 4 addresses (IP:Port); Layer 5 and above protocols are typically implemented by the application and require parsing application layer messages. For example, HTTP load balancing can distribute access to the same URI (Uniform Resource Identifier) path across different backend instances.
[0041] It's worth noting that the four layers of the network protocol stack are typically implemented by the operating system, while the encapsulation of the IP protocol (layer three) by TCP (Transmission Control Protocol) / UDP (User Datagram Protocol) is standard and well-defined. Therefore, there are two ways to implement layer four load balancing: the first is by the application, such as... Figure 3 As shown, in this implementation, the client establishes a connection with the FA (Floating Address), and then the application that provides the FA establishes a connection with the backend actual address EP for forwarding; the second method is implemented on the gateway (usually operating at Layer 3, network layer), such as... Figure 4 As shown, the gateway modifies the messages sent by the client to the FA, directly converting the FA's address to the EP's address, i.e., NAT. Under this implementation, the client does not establish a connection with the FA.
[0042] It should be noted that in the embodiments of this application, the four-layer load balancing belongs to the second method. For the sake of simplicity, the following uses four-layer load balancing, i.e. (IP:Port) load balancing, as an example. The four-layer load balancing case includes the three-layer (i.e., pure IP load balancing) case. In the four-layer load balancing, the Port in FA is not mapped, which degenerates into a three-layer load balancing.
[0043] The data forwarding method based on VPP instances proposed in this application can be applied to target VPP instances in a load balancing system. This load balancing system further includes a control module, a VPP cluster composed of multiple vector packet processing VPP instances, and a target database storing configuration slots bound to the VPP instances. The target database can be a Redis database or other middleware with message subscription and storage functions. In this application embodiment, a Redis database is used as an example for explanation.
[0044] The following combination Figure 5 The schematic diagram of the load balancing system shown explains the various modules included in the load balancing system.
[0045] In this embodiment of the application, Redis is used as a middleware and deployed in a cluster with one master and multiple backups. In this embodiment of the application, Redis's message channels, distributed locks, hash tables, set collections and other features are mainly used.
[0046] The data structures and their functions 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 VPP instances will subscribe to it. Once a change occurs, a rebalancing process will be triggered, so that all configurations are redistributed evenly to the existing VPP instances.
[0048] (2)SLOT- <index>Each configuration slot is defined as follows: `Index` is the slot's index number, ranging from [1, MAX_MEMBER_NUMBER], where `MAX_MEMBER_NUMBER` is the maximum number of VPP instances, determined during VPP instance deployment. Each slot contains two address sets: a first address set and a second address set. The first address set includes the floating address FA corresponding to the server providing the service, bound to `ETH_IN` in the VPP instance. The second address set includes the masquerading address MA corresponding to the client sending the data to be forwarded, bound to `ETH_OUT` in the VPP instance.
[0049] It should be noted that the address ranges of the network addresses in the two address sets mentioned above can be designed according to the specific network environment, and are not specifically limited here. In Redis, SLOT- <index>Divided into SLOT- <index>_IN、SLOT- <index>The two SET sets _OUT are used for storage. For example, the address sets corresponding to smember SLOT-1_IN and smember SLOT-1_OUT can be retrieved using 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 code above indicates that on VPP instance 1, the network interface corresponding to ETH_IN is bound to the network addresses 10.10.12.59 and 10.10.12.60, and the network interface corresponding to ETH_OUT is bound to the 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>A hash table, where `field` represents the port number and `value` is a string composed of the load balancer's EP (Electronic Power Supply). For example, `hgetall 10.10.12.59` has the following implementation code:
[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 code above represents two load balancing rules corresponding to address 10.10.12.59. The first load balancing rule will assign a destination address of (...). <ip>The data packets with the destination address :80 are respectively loaded onto the addresses 192.168.11.14:80 and 192.168.11.15:80; the second load balancing rule will assign the destination address to ( <ip>The packets (:443) are payloaded 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's a Layer 3 load balancer, the port number is 0. In this case, there's only one configuration record in the hash table (hgetall will retrieve 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, with a value range of [1, MEMBER_NUMBER]. When the control module sends configuration to the VPP instance, it writes (IP:Port) to the INSTANCE- <index>In the middle, each VPP instance listens to its corresponding INSTANCE- <index>Each of these will read the set of addresses that its respective configuration slot (SLOT) can carry, and then go to the corresponding... <ip>The corresponding configuration is read from the table and sent to the VPP.
[0074] It should be noted that network address and INSTANCE- <index>The relationship between them can be calculated using the configuration slot index corresponding to the address set and the instance count MEMBER_NUMBER. The configuration slot index corresponding to a VPP instance can be calculated using 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, with a value in the range [1, MEMBER_NUMBER]. During the rebalancing process, each VPP instance will attempt to acquire the distributed lock with an index number in the range [1, MEMBER_NUMBER]. After successfully acquiring the lock, the index number of the VPP instance becomes the index number of the distributed lock.
[0077] The control module is primarily used for maintaining the number of VPP instances and distributing configurations. There is a two-way heartbeat between the control module and each VPP instance. If a VPP instance's heartbeat fails, or if a new VPP instance is added, the control module publishes an update on the VPP cluster count via a Redis message channel, triggering rebalancing. After the configuration is distributed to the VPP instances, the control module also notifies the corresponding VPP instances to read the configuration from Redis.
[0078] A VPP instance consists of vpp-agent and VPP. vpp-agent reads configuration data from Redis and sends it to VPP; VPP is used to make the configuration take effect. vpp-agent and VPP together form an instance and cannot exist independently. If either one exits, the entire VPP instance will exit or restart.
[0079] It should be noted that VPP in the VPP instance is an open-source project based on the Apache-2 license. Each VPP instance manages two network interfaces, denoted as ETH_IN and ETH_OUT. ETH_IN is used to bind the floating address FA, and ETH_OUT is bound to the masquerading address MA, which is used to communicate with the load balancer endpoint address EP.
[0080] The key data structures and their functions in the memory of a VPP instance are as follows:
[0081] (1)MEMBER_NUMBER_LOCAL: The MEMBER_NUMBER value read from Redis 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 this application will be introduced.
[0085] Figure 6 FIG. shows a schematic flow chart of a data forwarding method based on a VPP instance provided by an embodiment of this application. As Figure 6 shown, the method includes the following steps:
[0086] Step S601, receive the data of the packet 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 data of the packet to be forwarded can be the packet data sent from the client to the server. For example, the data of the packet to be forwarded can be the packet sent by the client to access the network cloud disk. The data of the packet 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 this application, the example of the client sending the data of the packet to be forwarded to the server is used for illustration.
[0089] It can be seen from step S601 that in the embodiments of this 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, and the address set includes a first address set and a second address set. Among them, the first address set includes floating addresses FA, and the second address set includes disguised addresses MA.
[0092] It's important to note that load balancing requires a Load Balancer (FA), and the FA must contain a network address. Therefore, load balancing configurations are bound to network addresses, and the VPP instance is the entity that carries those network addresses. As long as the VPP instance can obtain the load balancer corresponding to its bound network address, the configuration will take effect. Traditionally, using VPP instances involves directly binding network addresses to them. If the VPP instance exits, the bound network address is lost, and the related configuration becomes ineffective. Furthermore, when adding a new VPP instance, the original configuration remains bound to the original VPP instance, preventing load balancing to the new instance and requiring manual intervention for repair or migration.
[0093] In this embodiment, a configuration slot is introduced to store network address-related configuration information. VPP instances are bound to configuration slots. When the number of VPP instances changes, the configuration slots can be redistributed to the remaining VPP instances.
[0094] Step S603: Read the set of target addresses corresponding to the target configuration slot from the target database.
[0095] In step S603, the target address set is the network addresses that the target VPP instance can carry.
[0096] As an example, if a user wants to access a cloud drive, after the user enters the domain name of the cloud drive in the browser, the DNS resolves the domain name to obtain the network address corresponding to the cloud drive: 10.10.12.59. This network address is the floating address FA. The network address is bound (indirectly within the VPP instance; 10.10.12.59:80 is one of the FAs, providing HTTP (Hypertext Transfer Protocol) service; 10.10.12.59:443 is also an FA, providing HTTPS (Hypertext Transfer Protocol Secure) service. The network routes access traffic (i.e., requests or messages to access the network disk) to a specific VPP instance. When a large number of clients access the service, the VPP instance forwards the traffic to the backend instance address EP that actually provides the service. The relationship between the 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 the EP is no longer the client's original address, but a masqueraded address (MA) after the client's source address has been translated. When the VPP instance fails or a new VPP instance joins, the control module and other VPP instances in the VPP cluster work together to migrate the FA, achieving high availability and horizontal scaling.
[0097] Step S604: Forward the packet data to be forwarded according to the target address set.
[0098] Taking access to online cloud storage as an example, combined with Figure 7 The address configuration diagram shown indicates that 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, and this binding relationship is stored in SLOT-1_IN. This is because VPP instance 1 acquired the distributed lock LOCK-1 at startup, meaning whoever acquires LOCK-1 is VPP instance 1.
[0099] SLOT-1_IN stores the set of addresses that the current VPP instance ETH_IN needs to bind to, one of which is 10.10.12.59; SLOT-1_OUT stores the set of addresses that the current VPP instance ETH_OUT network interface needs to bind to. When VPP instance 1 starts up, it obtains its corresponding EP through 10.10.12.59. Among them, there are two EPs on port 80: 192.168.11.14:80 and 192.168.11.15:80. These two EPs actually provide HTTP services for the network disk; there are also two EPs on port 443: 192.168.11.14:443 and 192.168.11.15:443. These two EPs actually provide HTTPS services for the network disk.
[0100] As described above, in this embodiment, VPP instances are not directly bound to network addresses, but rather to configuration slots. Therefore, when the number of VPP instances changes—for example, during scaling up or down, or when some VPP instances malfunction—load balancing can be achieved by allocating configuration slots to the remaining VPP instances. Since configuration slots store a set of addresses, and VPP instances are only bound to configuration slots, when a VPP instance malfunctions, the set of addresses in the configuration slot bound to that VPP instance is not lost. This configuration slot can then be bound to other VPP instances to provide services, achieving high availability for data forwarding.
[0101] Therefore, it can be seen that the solution proposed in the embodiments of this application can achieve the forwarding of tens of millions of message data while also achieving high availability of message data forwarding.
[0102] The following explains each step of the method proposed in the embodiments of this application.
[0103] After receiving the packet data to be forwarded, if the number of VPP instances in the VPP cluster changes (e.g., scaling up, scaling down, or VPP instance malfunction), the configuration slot bound to the target VPP instance may also change. In this case, it is necessary to determine the target configuration slot bound to the target VPP instance so that the target VPP instance can obtain the set of addresses related to packet data forwarding from the configuration slot.
[0104] Specifically, the target VPP instance reads the number of the first VPP instance from the message channel parameters in the target database; if a difference is detected between the number of the first VPP instance and the number of the second VPP instance, the number of VPP instances stored in the target VPP instance is updated to the number of the first VPP instance, and the target configuration slot index is determined based on the number of the first VPP instance and the instance index of the target VPP instance. Then, the configuration slot corresponding to the target configuration slot index is determined as the target configuration slot.
[0105] In the above embodiments, 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 and second VPP instance numbers includes situations where the first VPP instance number is greater than the second VPP instance number (i.e., scaling up), and situations where the first VPP instance number is less than the second VPP instance number (i.e., scaling down, or VPP instance anomalies). The following explains these two situations respectively.
[0106] If the number of first VPP instances is less than the number of second VPP instances, the multiple distributed locks stored in the target database are acquired in a 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; the weighted sum of the target instance index and the number of first VPP instances is calculated to obtain the target configuration slot index.
[0107] In one example Figure 8 This illustrates the load balancing process in a scenario where the heartbeat between the VPP instance and the control module is disconnected, such as... Figure 8 As shown, the process mainly includes the following steps:
[0108] In step S801, the VPP instance detects that the heartbeat between the VPP instance and the control module has been disconnected, and the VPP instance stops its own load to prevent network storms caused by duplicate network addresses.
[0109] In step S801, the heartbeat disconnection between the VPP instance and the control module is usually due to the abnormal exit or scaling down of the VPP instance. However, in rare cases, it is caused by network partitioning. In this case, both the VPP instance and the control module are 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 then the configuration will be updated and take effect.
[0110] In step S802, the control module waits for N heartbeat cycles. If the heartbeat recovers within the waiting period, it is considered normal, an alarm message is generated, and no other operation is performed. If the heartbeat does not recover within the waiting period, i.e., the waiting timeout occurs, then step S803 is executed.
[0111] In step S802, N is a settable value, which is usually set to the instance restart time to facilitate the restart operation of the instance.
[0112] In step S803, the control module updates MEMBER_NUMBER in Redis by decrementing MEMBER_NUMBER by 1 and updating it in Redis.
[0113] Step S804: The VPP instance subscribes to the change in the number of MEMBER_NUMBER (i.e., the number of the first VPP instance).
[0114] In step S805, the VPP instance compares the number of subscribed MEMBER_NUMBERs with the MEMBER_NUMBER_LOCAL in the VPP instance's memory (i.e., the number of the second VPP instance). If they are the same, no operation is performed; if they are different, step S806 is executed.
[0115] In step S805, it can accommodate situations such as instance restarts that take a long time or instances where new additions and deletions occur simultaneously within a short period of time, without affecting the final state.
[0116] Step S806: Update MEMBER_NUMBER_LOACAL and acquire a new distributed lock. After the VPP instance acquires the new distributed lock, it determines the lock based on the LOCK_LOACAL value. <index>Update your own instance index INSTANCE- <index>.
[0117] In step S806, the VPP instance attempts to SET LOCK- in sequence. <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 according to 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, VPP instances from all SLOT- <index>(Index∈SLOT-SET) retrieves the set of addresses for IN and OUT.
[0120] Step S809, the VPP instance sequentially according to SLOT- <index>The address set in _IN retrieves the address set bound to the VPP instance and updates the load balancing configuration corresponding to that address set in the VPP instance.
[0121] Step S810, the VPP instance is based on SLOT- <index>The address set in _IN is updated to update the address set of ETH_IN in the VPP instance, based on SLOT- <index>The address set in _OUT is updated to 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 hosting the original VPP instance 1 fails and the heartbeat is interrupted, if the original VPP instance 1 still exists on the local machine (e.g., due to a network failure), all VPP configurations are deleted. At this point, clients accessing the network disk via 10.10.12.59:443 will no longer be able to access it. The control module, detecting the disconnection of the original VPP instance 1, informs all remaining VPP instances of the remaining instance count. Each VPP instance then competes for the lock, re-determines its instance number, and retrieves the configuration information from the configuration slot based on its instance number, binding it to the VPP interface. Clients accessing the network disk via 10.10.12.59:443 will then resume access. The entire process varies depending on the heartbeat cycle configuration and takes several seconds.
[0124] For expansion scenarios, the target configuration slot index is obtained by calculating the weighted sum of the instance index of the target VPP instance and the number of the first VPP instances.
[0125] For example, when business volume increases and network cloud storage competes for traffic with other services (such as 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 is only the address set switching time, which can be completed in approximately milliseconds.
[0126] It should be noted that when the control module is expanded, MEMBER_NUMBER is updated directly, and the subsequent process is the same as when the heartbeat is disconnected, so it will not be described in detail here.
[0127] There is another scenario where the number of first VPP instances is the same as the number of second VPP instances, but the target configuration slot bound to the target VPP instance has changed. In this scenario, firstly, the weighted sum of the instance index of the target VPP instance and the number of 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; finally, the target configuration slot bound to the target VPP instance is updated to the first configuration slot.
[0128] It should be noted that the VPP instance and the control module maintain a two-way heartbeat. When the heartbeat is normal, the VPP instance normally carries the network address and load balancing configuration, and periodically maintains the Redis distributed lock LOCK. <index>The control module normally provides interfaces to users and issues relevant configurations.
[0129] As an example, Figure 9 This diagram illustrates the interaction of load balancing configuration distribution when the bidirectional heartbeat between the VPP instance and the control module is normal. Figure 9 It can be seen that the process mainly includes the following steps:
[0130] Step S901: If the heartbeat between the VPP instance and the control module is normal, the control module will send the new IP:Port load balancing configuration 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 SLOT_INDEX:IP:Port between the configuration slot index and port to Redis, and update INSTANCE- <index>.
[0133] Step S904, the VPP instance subscribes to and retrieves INSTANCE- from Redis. <index>Configuration information.
[0134] Step S905, the VPP instance checks the obtained INSTANCE- <index>The configuration information is verified, and if the verification passes, step S906 is executed.
[0135] Step S906, the VPP instance accesses Redis. <ip>Get the IP:Port load balancing configuration information.
[0136] Step S907: Update the IP:Port load balancing configuration in the VPP instance.
[0137] Step S908, the VPP instance continues to subscribe to and obtain INSTANCE- <index>Configuration information.
[0138] It should be noted that after rebalancing occurs, the network address shifts (from the original VPP instance to the new VPP instance), but the 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 this embodiment, a session can be established on the target VPP instance based on static network address translation (NAT), i.e., without configuring the rule `nat44 add address 192.168.12.60tenant-vrf 0`, a new session can be established in real time on the new VPP instance without causing conflicts.
[0139] For (Client:Port), the client's port is hashed to obtain the target port, and then the masquerading address is updated based on the target port. In other words, a hash calculation is performed on (Client:Port) to select the port for the MA (Mask) to reduce collisions.
[0140] After establishing a session on the target VPP instance based on Static Network Address Translation (NAT), a session table can be generated and stored in the target database. The target database caches the session table based on Source Address Translation (SNAT).
[0141] When a service has high requirements for its SLA (Service-Level Agreement), and the network address resources required by static NAT addresses are insufficient, a session table can be cached in Redis based on the SNAT address, with one port corresponding to one IP:Port. In this case, <ip>This is a hash table where `field` represents each port and `value` is the client's source address string. For example, `hgetall 192.168.12.60` corresponds to the following code:
[0142] 1) "27685"
[0143] 2) "172.168.11.14:27685"
[0144] 3) "31442"
[0145] 4) "172.168.11.13:44223"
[0146] This means there are two NAT mappings for this network address: one maps the source address 172.168.11.14:27685 to 192.168.12.60:27685, and the other maps the source address 172.168.11.13:44223 to 192.168.12.60:44223. The EP (Application Programming Provider) sees the mapped address. Therefore, this design is beneficial for the server to implement different strategies based on the client address.
[0147] The above design enables the VPP cluster to scale horizontally within the range of [1, MAX_MEMBER_NUMBER], while ensuring the availability of related configurations after scaling.
[0148] This concludes the explanation of the method proposed in the embodiments of this application.
[0149] As can be seen from the above, the method proposed in this application embodiment achieves load balancing of tens of millions of forwarding (and also supports tens of millions of concurrent connections) at Layer 3 (network layer) and Layer 4 (transport layer) based on VPP's NAT capabilities; at the same time, it introduces the concept of configuration slots to decouple the load balancing configuration information from VPP instances; it uses vpp-agent to build a VPP instance cluster to achieve VPP's horizontal scaling capability, and can achieve configuration migration when a small number of instances abnormally exit, eliminating single points of failure and achieving high availability.
[0150] Compared with IPVS and Nginx solutions, by utilizing VPP and DPDK technologies to leverage CPU and network card performance, it can achieve forwarding speeds of tens of millions, resulting in significantly superior performance. Compared with the F5 solution, the method proposed in this application can be deployed using general-purpose servers and can form clusters to achieve high availability and horizontal scaling, with lower costs and stronger availability.
[0151] This application also provides a data forwarding device based on a VPP instance, applied to a target VPP instance in a load balancing system. The load balancing system further includes a control module, a VPP cluster composed of multiple vector packet processing VPP instances, and a target database storing configuration slots that are bound to the VPP instances. Figure 10 As shown, the device 1000 includes: a data receiving module 1001, a configuration slot determination module 1002, an address reading module 1003, and a data forwarding module 1004.
[0152] Data receiving module 1001 is used to receive message data to be forwarded to the target VPP instance;
[0153] Configuration slot determination module 1002 is used to determine the target configuration slot bound to the 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 packet data to be forwarded according to the target address set.
[0156] In one example, the configuration slot determination module includes: an instance count acquisition module, an instance count update module, and an index determination module. The instance count acquisition module reads the first VPP instance count from message channel parameters in the target database, where the message channel parameters store the number of VPP instances in the load balancing system. The instance count update module, upon detecting a difference between the first and second VPP instance counts, updates the VPP instance count stored in the target VPP instance with the first VPP instance count, and determines the target configuration slot index based on the first VPP instance count and the instance index of the target VPP instance, where the second VPP instance count is the number of VPP instances stored in the target VPP instance. The index determination module determines the configuration slot corresponding to the target configuration slot index as the target configuration slot.
[0157] In one example, the instance count update module is specifically used to acquire multiple distributed locks stored in the target database in a preset order when the number of first VPP instances is less than the number of second VPP instances, thereby obtaining the target distributed lock; update the instance index of the target VPP instance based on the index of the target distributed lock, thereby obtaining the target instance index; and calculate the weighted sum of the target instance index and the number of first VPP instances to obtain the target configuration slot index.
[0158] In one example, the instance count update module is specifically used to calculate the weighted sum of the instance index of the target VPP instance and the number of the first VPP instances when the number of the first VPP instance is greater than the number of the second VPP instance, so as to obtain the target configuration slot index.
[0159] In one example, the data forwarding device based on VPP instances further includes: a configuration slot update module, used to calculate the weighted sum of the instance index of the target VPP instance and the number of the first VPP instances when 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, to obtain the target configuration slot index; 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 also includes a session establishment module for establishing a session on the target VPP instance based on 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 the floating address corresponding to the server providing the service, and the second address set includes the masquerading address corresponding to the client sending the data to be forwarded. The data forwarding device based on the VPP instance further includes: an address update module, used to perform hash calculation on the client's port to obtain the target port; and update the masquerading address based on the target port.
[0162] In one example, the data forwarding device based on the VPP instance also includes a session caching module, which generates a session table and stores the session table in the target database, wherein the target database caches the session table based on source address translation (SNAT).
[0163] The data forwarding device based on VPP instances provided in this application embodiment can implement all the processes implemented in the aforementioned method embodiments. To avoid repetition, these processes will not be described again here.
[0164] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is merely an example. In practical applications, the above functions can be assigned to 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 embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit. Furthermore, the specific names of the functional units and modules are only for easy differentiation and are not intended to limit the scope of protection of this application. The specific working process of the units and modules in the above system can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0165] Figure 11 A schematic diagram of the hardware structure of the electronic device provided in an embodiment of this 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), an application-specific integrated circuit (ASIC), or one or more integrated circuits that can be configured to implement the embodiments of this application.
[0168] Memory 1102 may include mass storage for data or instructions. For example, and not limitingly, memory 1102 may include a hard disk drive (HDD), floppy disk drive, flash memory, optical disk, magneto-optical disk, magnetic tape, or Universal Serial Bus (USB) drive, or a combination of two or more of these. Where appropriate, memory 1102 may include removable or non-removable (or fixed) media. Where appropriate, memory 1102 may be internal or external to the integrated gateway disaster recovery device. In a particular embodiment, memory 1102 is non-volatile solid-state memory.
[0169] Memory may include read-only memory (ROM), random access memory (RAM), disk storage media devices, optical storage media devices, flash memory devices, and electrical, optical, or other physical / tangible memory storage devices. Therefore, typically, 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 methods according to one aspect of this disclosure.
[0170] The processor 1101 reads and executes computer program instructions stored in the memory 1102 to implement any of the data forwarding methods based on VPP instances in the above embodiments.
[0171] In one example, the electronic device may also include a communication interface 1103 and a bus 1110. For example, Figure 11 As shown, the processor 1101, memory 1102, and communication interface 1103 are connected through bus 1110 and complete communication with each other.
[0172] The communication interface 1103 is mainly used to realize communication between various modules, devices, units and / or equipment in the embodiments of this application.
[0173] Bus 1110 includes hardware, software, or both, that couples components of an electronic device together. For example, and not limitingly, the bus may include an Accelerated Graphics Port (AGP) or other graphics bus, an Enhanced Industry Standard Architecture (EISA) bus, a Front Side Bus (FSB), HyperTransport (HT) interconnect, an Industry Standard Architecture (ISA) bus, an Infinite Bandwidth Interconnect, a Low Pin Count (LPC) bus, a memory bus, a Microchannel Architecture (MCA) bus, a Peripheral Component Interconnect (PCI) bus, a PCI-Express (PCI-X) bus, a Serial Advanced Technology Attachment (SATA) bus, a Video Electronics Standards Association Local (VLB) bus, or other suitable buses, or combinations of two or more of these. Where appropriate, bus 1110 may include one or more buses. Although specific buses are described and illustrated in embodiments of this application, any suitable bus or interconnect is contemplated herein.
[0174] Furthermore, in conjunction with the data forwarding method based on VPP instances in the above embodiments, this application embodiment can provide a computer-readable storage medium for implementation. This computer-readable storage medium stores computer program instructions; when executed by a processor, these computer program instructions implement any of the data forwarding methods based on VPP instances in the above embodiments.
[0175] Furthermore, in conjunction with the data forwarding method based on VPP instances in the above embodiments, this application embodiment can provide a computer program product for implementation. When the instructions in this computer program product are executed by the processor of an electronic device, the electronic device performs and implements any of the data forwarding methods based on VPP instances as described in the above embodiments.
[0176] It should be clarified that this application is not limited to the specific configurations and processes described above and shown in the figures. For the sake of brevity, detailed descriptions of known methods are omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of this application is not limited to the specific steps described and shown. Those skilled in the art can make various changes, modifications, and additions, or change the order of steps, after understanding the spirit of this 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, they can be, for example, electronic circuits, application-specific integrated circuits (ASICs), appropriate firmware, plug-ins, function cards, etc. When implemented in software, the elements of this application are programs or code segments used to perform the required tasks. Programs or code segments can be stored on a machine-readable medium or transmitted over a transmission medium or communication link via data signals carried on a carrier wave. "Machine-readable medium" can include any medium capable of storing or transmitting 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, fiber optic 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 methods or systems based on a series of steps or apparatus. 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 embodiments, or in a different order, or several steps can be performed simultaneously.
[0179] The above flowcharts and / or block diagrams describing data forwarding methods, apparatuses, devices, media, and products based on VPP instances according to embodiments of this disclosure have described various aspects of the present disclosure. It should be understood that each block in the flowcharts and / or block diagrams, and combinations of blocks in the flowcharts and / or block diagrams, 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 apparatus to create a machine such that these instructions, executable via the processor of the computer or other programmable data processing apparatus, enable the implementation of the functions / actions specified in one or more blocks of the flowcharts and / or block diagrams. Such a processor can 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 is also understood that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can also be implemented by dedicated hardware performing the specified functions or actions, or can be implemented by a combination of dedicated hardware and computer instructions.
[0180] The above description is merely a specific implementation of this application. Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, modules, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here. It should be understood that the protection scope of this application is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in this application, and these modifications or substitutions should all be covered within 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 VPP instances, characterized in that, The method is applied to a target VPP instance in a load balancing system, the load balancing system further including a control module, a VPP cluster composed of multiple vector packet processing VPP instances, and a target database storing configuration slots bound to the VPP instances. Receive message data to be forwarded to the target VPP instance; Determine the target configuration slot bound to the target VPP instance; 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; The message data to be forwarded is forwarded according to the target address set.
2. The method according to claim 1, characterized in that, Determining the target configuration slot bound to the target VPP instance includes: The first VPP instance count is read from the message channel parameters in the target database, wherein the message channel parameters are used to store the number of VPP instances in the load balancing system; If a difference is detected between the number of the first VPP instances and the number of the second VPP instances, the number of VPP instances stored in the target VPP instance is updated to the number of the first VPP instances, and the target configuration slot index is determined based on the number of the first VPP instances and the instance index of the target VPP instance, wherein the number of the second VPP instances is the number of VPP instances 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, characterized in that, The target configuration slot index is determined based on the number of the first VPP instances and the instance index of the target VPP instance, including: When the number of the first VPP instances is less than the number of the second VPP instances, the multiple distributed locks stored in the target database are acquired in a preset order to obtain the target distributed lock. Update the instance index of the target VPP instance based on the index of the target distributed lock to obtain the target instance index; The target configuration slot index is obtained by calculating the weighted sum of the target instance index and the number of the first VPP instances.
4. The method according to claim 2, characterized in that, The target configuration slot index is determined based on the number of the first VPP instances and the instance index of the target VPP instance, including: If the number of the first VPP instances is greater than the number of the second VPP instances, the target configuration slot index is obtained by calculating the weighted sum of the instance index of the target VPP instance and the number of the first VPP instances.
5. The method according to claim 2, characterized in that, After determining the target configuration slot bound to the target VPP instance, the method further includes: If 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, the weighted sum of the instance index of the target VPP instance and the number of the first VPP instance is calculated to obtain the target configuration slot index. 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; Update the target configuration slot bound to the target VPP instance to the first configuration slot.
6. The method according to any one of claims 2 to 5, characterized in that, After reading the set of target addresses 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, characterized in that, The target address set includes a first address set and a second address set. The first address set includes floating addresses corresponding to the servers providing the service, and the second address set includes masquerading addresses corresponding to the clients sending the data to be forwarded. After establishing a session on the target VPP instance based on Static Network Address Translation (NAT), the method further includes: The target port is obtained by hashing the port of the client. The spoofed address is updated based on the target port.
8. The method according to claim 6, 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 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, characterized in that, In the target VPP instance applied to the load balancing system, the load balancing system further includes a control module, a VPP cluster composed of multiple vector packet processing VPP instances, and a target database storing configuration slots that are bound to the VPP instances. The device includes: The data receiving module is used to receive message data to be forwarded sent to the target VPP instance; The configuration slot determination module is used to determine the target configuration slot bound to the target VPP instance; The address reading module 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; The data forwarding module is used to forward the packet data to be forwarded according to the target address set.
10. An electronic device, characterized in that, The electronic device includes: a processor and a memory storing computer program instructions; When the processor executes the computer program instructions, it implements the data forwarding method based on a VPP instance as described in any one of claims 1-8.
11. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer program instructions, which, when executed by a processor, implement the data forwarding method based on a VPP instance as described in any one of claims 1-8.
12. A computer program product, characterized in that, When the instructions in the computer program product are executed by the processor of the electronic device, the electronic device performs the data forwarding method based on the VPP instance as described in any one of claims 1-8.
Citation Information
Patent Citations
Method, device and equipment for setting transmission load of PCIE hot plugging device
CN108363673A
RISER card, configuration method and device thereof and readable storage medium
CN115934605A