Data forwarding method and device, equipment, storage medium and program product
By determining the IP addresses of the target network element cluster and virtual network element in the cloud computing platform and forwarding the routing strategy, the problem of low data forwarding reliability in the existing technology is solved, and high reliability and high capacity data forwarding is achieved Effect.
Patent Information
- Application Number
- CN202411762781.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-03
- Publication Date
- 2025-02-18
- Estimated Expiration
- 2044-12-03
AI Technical Summary
With the expansion of the cloud computing platform, the configuration of existing virtual network elements has led to low reliability of data forwarding.
By obtaining the data to be forwarded, determining the IP address of the target network element cluster based on the destination address of the data, obtaining equivalent routing data, determining the IP address of the target virtual network element, and sending the data to the target virtual network element to realize the routing strategy forwarding.
It improves the reliability of data forwarding, avoids interrupt time caused by master-sec handover, and meets the requirements of high-capacity of the network.
Smart Images

Figure CN119484399A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer network technology, and in particular to a data forwarding method, device, equipment, storage medium and program product. Background Art
[0002] With the rapid development of cloud computing technology, more and more enterprises choose to use open source cloud computing platforms to build and manage their cloud infrastructure. As a leading open source cloud computing platform, OpenStack's modular design and flexible architecture make it an ideal choice for building public cloud, private cloud and hybrid cloud environments.
[0003] Openstack uses virtual network elements to implement different subnets in the virtual private cloud and network communications outside the virtual private cloud. However, as the scale of cloud computing platforms continues to expand, the existing configuration of virtual network elements makes data forwarding less reliable. Summary of the invention
[0004] Based on this, it is necessary to provide a data forwarding method, device, equipment, storage medium and program product that can improve the reliability of data forwarding in response to the above technical problems.
[0005] In a first aspect, the present application provides a data forwarding method, which is used in a target data forwarding device in a cloud computing platform, the cloud computing platform includes multiple data forwarding devices, the target data forwarding device is any one of the multiple data forwarding devices, all or part of the multiple data forwarding devices are deployed with virtual network elements, and the multiple virtual network elements deployed in the cloud computing platform form multiple network element clusters, each network element cluster includes multiple virtual network elements, including:
[0006] Get the data to be forwarded;
[0007] Determine the IP address of the target network element cluster from multiple network element clusters according to the destination address of the data;
[0008] Obtaining equivalent routing data corresponding to the target network element cluster, the equivalent routing data including a mapping relationship between the cluster IP address of the target network element cluster and the IP addresses of each virtual network element included;
[0009] According to the equivalent routing data, the IP address of the target virtual network element is determined from the multiple virtual network elements included in the target network element cluster, and the data is sent to the target virtual network element according to the IP address of the target virtual network element, so that the target virtual network element forwards the data according to the routing policy.
[0010] In one of the embodiments, determining the IP address of the target network element cluster from multiple network element clusters according to the destination address of the data includes:
[0011] If the data is sent from the cloud computing platform to the external network, the internal network cluster IP address corresponding to the target network element cluster is determined from multiple network element clusters according to the destination address of the data; if the data is sent from the external network to the cloud computing platform, the external network cluster IP address corresponding to the target network element cluster is determined from multiple network element clusters according to the destination address of the data.
[0012] In one of the embodiments, the equivalent routing data corresponding to the target network element cluster is obtained, including: if the data is sent from the cloud computing platform to the external network, the intranet equivalent routing data corresponding to the target network element cluster is obtained, and the intranet equivalent routing data includes the mapping relationship between the intranet cluster IP address of the target network element cluster and the intranet IP address of each virtual network element included; if the data is sent from the external network to the cloud computing platform, the external network equivalent routing data corresponding to the target network element cluster is obtained, and the external network equivalent routing data includes the mapping relationship between the external network cluster IP address of the target network element cluster and the external network IP address of each virtual network element included.
[0013] In one embodiment, the configuration process of equal-cost routing data includes:
[0014] A host is configured for each virtual network element, wherein the virtual network elements of the same host are configured to belong to the same network element cluster; an intranet cluster IP address and an extranet cluster IP address are configured for each network element cluster, and an intranet IP address and an extranet IP address are configured for each virtual network element; for each network element cluster, an OSPF protocol neighbor relationship is established between the network element cluster and each virtual network element based on the intranet cluster IP address and the intranet IP address of each virtual network element included in the network element cluster, and intranet equivalent routing data is generated; for each network element cluster, an OSPF protocol neighbor relationship is established between the network element cluster and each virtual network element based on the extranet cluster IP address and the extranet IP address of each virtual network element included in the network element cluster, and extranet equivalent routing data is generated.
[0015] In one of the embodiments, determining the IP address of the target virtual network element from the multiple virtual network elements included in the target network element cluster includes:
[0016] Obtain a preset traffic control strategy; and determine an IP address of a target virtual network element from multiple virtual network elements according to the traffic control strategy.
[0017] In one embodiment, after obtaining the data to be forwarded, the method further includes:
[0018] The address translation for data is statelessly tracked, and the address translation includes source address translation and destination address translation.
[0019] In a second aspect, the present application further provides a data forwarding device, which is used in a target data forwarding device in a cloud computing platform, the cloud computing platform includes multiple data forwarding devices, the target data forwarding device is any one of the multiple data forwarding devices, all or part of the multiple data forwarding devices are deployed with virtual network elements, and the multiple virtual network elements deployed in the cloud computing platform form multiple network element clusters, each network element cluster includes multiple virtual network elements, including:
[0020] A first acquisition module, used to acquire data to be forwarded;
[0021] A first determination module, configured to determine an IP address of a target network element cluster from a plurality of network element clusters according to a destination address of the data;
[0022] A second acquisition module is used to acquire equivalent routing data corresponding to the target network element cluster, where the equivalent routing data includes a mapping relationship between a cluster IP address of the target network element cluster and an IP address of each virtual network element included therein;
[0023] The second determination module is used to determine the IP address of the target virtual network element from multiple virtual network elements included in the target network element cluster according to the equivalent routing data, and send data to the target virtual network element according to the IP address of the target virtual network element so that the target virtual network element forwards the data according to the routing policy.
[0024] In one of the embodiments, the first determination module is specifically used to determine the intranet cluster IP address corresponding to the target network element cluster from multiple network element clusters according to the destination address of the data if the data is sent from the cloud computing platform to the external network; if the data is sent from the external network to the cloud computing platform, then determine the external network cluster IP address corresponding to the target network element cluster from multiple network element clusters according to the destination address of the data.
[0025] In one of the embodiments, the second acquisition module is specifically used to obtain the intranet equivalent routing data corresponding to the target network element cluster if the data is sent from the cloud computing platform to the external network, and the intranet equivalent routing data includes the mapping relationship between the intranet cluster IP address of the target network element cluster and the intranet IP address of each virtual network element included therein; if the data is sent from the external network to the cloud computing platform, the external network equivalent routing data corresponding to the target network element cluster is obtained, and the external network equivalent routing data includes the mapping relationship between the external network cluster IP address of the target network element cluster and the external network IP address of each virtual network element included therein.
[0026] In one of the embodiments, the data forwarding device also includes a configuration module, which is used to configure a host for each virtual network element, wherein the virtual network elements of the same host are configured to belong to the same network element cluster; configure an intranet cluster IP address and an extranet cluster IP address for each network element cluster, and configure an intranet IP address and an extranet IP address for each virtual network element; for each network element cluster, establish an OSPF protocol neighbor relationship between the network element cluster and each virtual network element based on the intranet cluster IP address and the intranet IP address of each virtual network element included in the network element cluster, and generate intranet equivalent routing data; for each network element cluster, establish an OSPF protocol neighbor relationship between the network element cluster and each virtual network element based on the extranet cluster IP address and the extranet IP address of each virtual network element included in the network element cluster, and generate extranet equivalent routing data.
[0027] In one of the embodiments, the second determination module is specifically used to obtain a preset traffic control strategy; and determine the IP address of the target virtual network element from multiple virtual network elements according to the traffic control strategy.
[0028] In one of the embodiments, the first acquisition module is further used to perform stateless tracking address conversion on the data, and the address conversion includes source address conversion and target address conversion.
[0029] In a third aspect, the present application further provides a data forwarding device, including a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps described in any of the above method embodiments when executing the computer program.
[0030] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the steps described in any of the above method embodiments.
[0031] In a fifth aspect, the present application also provides a computer program product, including a computer program, which implements the steps described in any of the above method embodiments when executed by a processor.
[0032] The above-mentioned data forwarding method, device, equipment, storage medium and program product obtain the data to be forwarded, determine the IP address of the target network element cluster from multiple network element clusters according to the destination address of the data, obtain the equivalent routing data corresponding to the target network element cluster, the equivalent routing data includes the mapping relationship between the cluster IP address of the target network element cluster and the IP addresses of each virtual network element included, determine the IP address of the target virtual network element from the multiple virtual network elements included in the target network element cluster according to the equivalent routing data, and send the data to the target virtual network element according to the IP address of the target virtual network element, so that the target virtual network element forwards the data according to the routing policy. In this way, by establishing multiple network element clusters, and one network element cluster includes multiple virtual network elements, the master-master working state of the virtual network element can be realized, and multiple virtual network elements are in working state at the same time, and jointly bear the network traffic and service responsibilities. In this way, compared with the master-slave working state of the virtual network element, multiple network elements process services at the same time, avoiding the problem of low data forwarding reliability caused by the interruption time of the master-slave switching, which can effectively improve the reliability of data forwarding and meet the requirements of high network capacity. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the drawings required for use in the embodiments of the present application or related technical descriptions will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0034] FIG1 is an application environment diagram of a data forwarding method in one embodiment;
[0035] FIG2 is a schematic diagram of a flow chart of a data forwarding method in one embodiment;
[0036] FIG3 is a schematic diagram of a process flow of configuring equal-cost routing data in one embodiment;
[0037] FIG4 is a schematic diagram of a flow chart of a step of determining an IP address of a target virtual network element in one embodiment;
[0038] FIG5 is a schematic diagram of a flow chart of a data forwarding method in another embodiment;
[0039] FIG6 is a schematic diagram of a flow chart of a data forwarding method in another embodiment;
[0040] FIG7 is a structural block diagram of a data forwarding device in one embodiment;
[0041] FIG. 8 is a diagram showing the internal structure of a data forwarding device in one embodiment. DETAILED DESCRIPTION
[0042] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0043] With the rapid development of cloud computing technology, more and more enterprises choose to use open source cloud computing platforms to build and manage their cloud infrastructure. As a leading open source cloud computing platform, OpenStack's modular design and flexible architecture make it an ideal choice for building public cloud, private cloud and hybrid cloud environments.
[0044] Openstack uses virtual network elements to implement different subnets in the virtual private cloud and network communications outside the virtual private cloud. However, as the scale of cloud computing platforms continues to expand, the existing configuration of virtual network elements makes data forwarding less reliable.
[0045] In view of this, the present application provides a data forwarding method capable of improving the reliability of data forwarding. The data forwarding method provided in the embodiment of the present application may be executed by a data forwarding device. The data forwarding method device may be implemented by software, hardware, or a combination of software and hardware. It may be embedded in or independent of a processor in a data forwarding device in the form of hardware, or may be stored in a memory in a data forwarding device in the form of software. In the following method embodiments, the execution subject is taken as an example of a data forwarding device.
[0046] The following is an introduction to the system architecture in which the data forwarding method provided in the present application is located: the system architecture includes a cloud computing platform and an off-cloud computing device, as shown in the application environment diagram in Figure 1, the cloud computing platform includes multiple data forwarding devices 10, the target data forwarding device is any one of the multiple data forwarding devices, all or part of the multiple data forwarding devices 10 are deployed with virtual network elements 110, the multiple virtual network elements 110 deployed in the cloud computing platform form multiple network element clusters, each network element cluster includes multiple virtual network elements 110, the data forwarding device 10 can be a server or an external network switch, wherein the external network switch includes an ospf routing publishing module 1101, the server includes multiple deployed virtual network elements 110 and a registration module 120, and each virtual network element 110 also includes an opsf routing It consists of a publishing module 1101, a registration module 120, a control address conversion module 1102 and a routing control module 1103, wherein the virtual network element 110 sends registration information to the registration module 120 of the server through its own registration module 120, and the registration module 120 of the server configures a host for the virtual network element 110 after receiving the registration information; the ospf routing publishing 1101 module is used to configure the intranet cluster IP address and the extranet cluster IP address of the network element cluster, and configure the intranet IP address and the extranet IP address of the virtual network element to generate intranet equivalent routes and extranet equivalent routes; the control address conversion module 1102 is used to perform address conversion and set the traffic control policy according to the configuration file; the routing control module 1103 is used to configure the static routing policy according to the configuration file.
[0047] Optionally, the cloud computing platform can be OpenNebula, CloudStack or Openstack, etc. The embodiment of the present application takes Openstcak as an example. Openstack is an open source cloud computing platform that provides Infrastructure as a Service (IaaS) solutions for building and managing public clouds, private clouds and hybrid cloud environments. It consists of multiple components, each of which is responsible for different cloud computing resource management functions.
[0048] In an exemplary embodiment, as shown in FIG2 , a data forwarding method is provided, which is used in the target data forwarding device 10 in the cloud computing platform as shown in FIG1 , and includes the following steps 201 to 204 . Among them:
[0049] S201, obtaining data to be forwarded.
[0050] Optionally, the target data forwarding device may be a server or an external network switch, and the data to be forwarded may also include data sent from the cloud computing platform to the external network and data sent from the external network to the cloud computing platform.
[0051] It is understandable that the network segment where the cloud computing platform is located does not belong to the same network as the network segment where the external network is located.
[0052] Optionally, there are multiple servers in the cloud computing platform, and a virtual switch is deployed on each server. Data exchange between the servers is achieved through the virtual switches deployed on each server.
[0053] S202: Determine an IP address of a target network element cluster from multiple network element clusters according to a destination address of the data.
[0054] Optionally, when a server in the cloud computing platform exchanges data with an external network, the virtual switch of the server determines the IP address of a target network element cluster from multiple network element clusters according to a preset static route and a destination address of the data.
[0055] Exemplarily, the routing control module 1103 in the virtual network element may configure static routing for the virtual switch, taking the configuration of "ip rout add 10.101.64.0 / 24 via 10.101.16.1" as an example, where 10.101.64.0 / 24 is the target address and 10.101.16.1 is the next hop address.
[0056] Optionally, multiple virtual network elements are registered as the same network cluster. In this way, when the next hop address is bound to a certain network element cluster, all virtual network elements in the network element cluster can be configured with the same next hop address according to the network element cluster information, thus ensuring consistent forwarding performance of multiple virtual network elements.
[0057] Optionally, the network element cluster may include at least two virtual Ethernet interfaces, each virtual Ethernet interface is connected to a different network, and each virtual Ethernet interface has an independent IP address. For example, a virtual Ethernet interface of the network element cluster is connected to the internal LAN of the cloud computing platform (such as the 10.191.16.0 / 24 network segment), and the virtual Ethernet interface may be configured as 10.191.16.100; the other interface is connected to an external WAN (such as the Internet), and its IP address may be a public IP address assigned by the network service provider (such as 10.101.32.100).
[0058] Optionally, the virtual network element may also include at least two virtual Ethernet interfaces, each virtual Ethernet interface is connected to a different network, and each virtual Ethernet interface has an independent IP address.
[0059] In a possible implementation, if the data to be forwarded is sent from the cloud computing platform to the external network, the intranet cluster IP address corresponding to the target network element cluster is determined from multiple network element clusters according to the destination address of the data.
[0060] Optionally, the intranet cluster IP address corresponding to the network element cluster can be the Vtep network segment of the virtual network element, and multiple virtual network elements in the same cluster uniformly use the same vtep ip.
[0061] In another possible implementation, if the data to be forwarded is sent from an external network to the cloud computing platform, the external network cluster IP address corresponding to the target network element cluster is determined from multiple network element clusters according to the destination address of the data.
[0062] Optionally, the external cluster IP address corresponding to the NE cluster can be the external unified gateway network segment of each virtual NE's elastic public network (ElasticIP Address, eip), and multiple virtual NEs in the same cluster are planned with the same address.
[0063] Optionally, an Elastic IP address is a public IP address that can be assigned to a virtual machine, instance, or network device through configuration, which allows resources to be reallocated without changing the IP address, providing greater flexibility and availability.
[0064] S203: Obtain equivalent routing data corresponding to the target network element cluster.
[0065] The equal-cost routing data includes a mapping relationship between the cluster IP address of the target network element cluster and the IP addresses of the included virtual network elements.
[0066] Optionally, the target data forwarding device can use the routing protocol to discover all paths to the destination network, and determine the mapping relationship between the IP addresses at both ends of the path. In this process, each path will be measured, and the measurement factors may include the bandwidth, delay, reliability, etc. of the link. When the metric values of multiple paths are found to be equal, these paths are determined to be equal-cost paths. For example, there are two links connected to the same network element cluster, and the bandwidth and delay of these two links are the same. The target data forwarding device calculates the cost of these two links to be the same through the routing protocol, and will regard them as equal-cost paths.
[0067] Optionally, the routing protocol may be Open Shortest Path First (OSPF).
[0068] Optionally, the link costs of each virtual network element in the network element cluster connecting to the network element cluster are the same, and the equivalent routing data corresponding to the network element cluster can be determined according to the mapping relationship between the cluster IP address and the IP addresses of each virtual network element included.
[0069] Optionally, after the target network element cluster is determined, corresponding equal-cost routing data may be obtained according to the IP address of the target network element cluster.
[0070] Optionally, if the data is sent from the cloud computing platform to the external network, the intranet equivalent routing data corresponding to the target network element cluster is obtained, and the intranet equivalent routing data includes the mapping relationship between the intranet cluster IP address of the target network element cluster and the intranet IP addresses of each virtual network element included.
[0071] Optionally, if the data is sent from the external network to the cloud computing platform, the external network equivalent routing data corresponding to the target network element cluster is obtained, and the external network equivalent routing data includes the mapping relationship between the external network cluster IP address of the target network element cluster and the external network IP address of each virtual network element included.
[0072] Exemplarily, taking the case where a network element cluster includes two virtual network elements, the equivalent routing data can be as shown in Table 1, wherein the intranet cluster IP of the network element cluster belongs to the 10.101.64.0 / 24 network segment, and the intranet IP addresses of the two virtual network elements included in the network element cluster are 10.101.16.101 and 10.101.16.102 respectively; the external network IP address of the network element cluster belongs to the 10.101.32.0 / 24 network segment, and the external network IP addresses of the two virtual network elements included in the network element cluster are 10.101.128.101 and 10.101.128.102 respectively.
[0073]
[0074] S204, determining the IP address of the target virtual network element from the multiple virtual network elements included in the target network element cluster according to the equivalent routing data, and sending data to the target virtual network element according to the IP address of the target virtual network element, so that the target virtual network element forwards the data according to the routing policy.
[0075] Optionally, if the data is sent from the cloud computing platform to the external network, the target virtual network element and the internal network IP address of the target virtual network element are determined from the multiple virtual network elements included in the target network element cluster according to the internal network equivalent routing data corresponding to the target network element cluster; if the data is sent from the external network to the cloud computing platform, the target virtual network element and the external network IP address of the target virtual network element are determined from the multiple virtual network elements included in the target network element cluster according to the external network equivalent routing data corresponding to the target network element cluster.
[0076] If there is only one set of mapping relationships in the target network element cluster in the intranet equivalent routing data or the extranet equivalent routing data, the target virtual network element and the IP address of the target virtual network element are determined according to the mapping relationship. If there are multiple sets of mapping relationships, the target virtual network element and the IP address of the target virtual network element are determined according to the preset traffic control strategy.
[0077] Optionally, after sending the data to the target virtual network element, the target virtual network element can forward the data according to the routing policy. If the data is sent from the cloud computing platform to the external network, the next hop address is determined according to the source address of the data and the preset routing policy. The next hop address can be the IP address of the external network switch. If the data is sent from the external network to the cloud computing platform, the next hop address is determined according to the source address of the data and the corresponding routing policy. The next hop address can be the IP address of the virtual switch in the cloud computing platform.
[0078] Exemplarily, the routing control module 1103 in the virtual network element may configure a routing policy for the virtual network element, taking the following configuration as an example:
[0079] ip rule add from 10.101.32.1 / 24 table external priority 32000
[0080] ip route add default via 10.101.128.1 dev eth2 table external
[0081] Among them, 10.101.32.1 is the elastic public network segment gateway of the virtual network element, and 10.101.128.1 is the IP address of the external network switch. That is, when the source IP address of the data belongs to the 10.101.32.1 / 24 network segment, consider using the external routing table for routing, in which a default route is added to the external routing table. When the destination address of the data packet does not find a clear matching entry in the external routing table, the default route will be used to forward the data to the external network switch corresponding to the IP 10.101.128.1.
[0082] The above data forwarding method obtains the data to be forwarded, determines the IP address of the target network element cluster from multiple network element clusters according to the destination address of the data, obtains the equivalent routing data corresponding to the target network element cluster, the equivalent routing data includes the mapping relationship between the cluster IP address of the target network element cluster and the IP addresses of each virtual network element included, determines the IP address of the target virtual network element from the multiple virtual network elements included in the target network element cluster according to the equivalent routing data, and sends the data to the target virtual network element according to the IP address of the target virtual network element, so that the target virtual network element forwards the data according to the routing policy. In this way, by establishing multiple network element clusters, and one network element cluster includes multiple virtual network elements, the master-master working state of the virtual network element can be realized, and multiple virtual network elements are in working state at the same time, and jointly bear the network traffic and service responsibilities. In this way, compared with the master-slave working state of the virtual network element, multiple network elements process services at the same time, avoiding the problem of low network reliability caused by the interruption time of the master-slave switching, which can effectively improve the reliability of data forwarding and meet the high capacity requirements of the network.
[0083] In an exemplary embodiment, as shown in FIG3 , optionally, the configuration process of equal-cost routing data includes the following steps 301 to 304 . Among them:
[0084] S301, configuring a host for each virtual network element.
[0085] The virtual network elements of the same host are configured to belong to the same network element cluster.
[0086] Optionally, the registration module in the data forwarding device may receive registration information sent by the registration module in the virtual network element, and configure a host for each virtual network element according to the registration information.
[0087] Exemplarily, when the cloud computing platform is Openstack, the virtual network element agent will register the agent information to the data forwarding device through the report_state rpc message, wherein the key field host is used to uniquely identify the node, and the agents belonging to the same network cloud cluster are configured with the same host, such as vrouter01. In this way, when determining the next hop information, the next hop information is bound to vrouter01. When the network element agents in the same cluster obtain the rpc message, they will uniformly obtain the next hop information related to vrouter01 for configuring the network element network information.
[0088] S302, configure an intranet cluster IP address and an extranet cluster IP address for each network element cluster, and configure an intranet IP address and an extranet IP address for each virtual network element.
[0089] Optionally, an internal network cluster IP address and an external network cluster IP address are configured for each network element cluster through an ospf route publishing module of the virtual network element, and an internal network IP address and an external network IP address are configured for each virtual network element.
[0090] S303, for each network element cluster, according to the intranet cluster IP address and the intranet IP address of each virtual network element included in the network element cluster, establish an OSPF protocol neighbor relationship between the network element cluster and each virtual network element, and generate intranet equivalent routing data.
[0091] S304, for each network element cluster, according to the external network cluster IP address and the external network IP address of each virtual network element included in the network element cluster, establish an OSPF protocol neighbor relationship between the network element cluster and each virtual network element, and generate external network equivalent routing data.
[0092] Optionally, the ospf routing publishing module is used to exchange routing information between the virtual network element and the external network switch. When the virtual network element is in a healthy state, the network traffic can be received normally through the routing. When the virtual network element is in an abnormal state, the routing is deleted so that the switch cannot send network traffic to the virtual network element.
[0093] Optionally, if the Openstack native operating system does not contain a module with routing and forwarding capabilities, you can introduce the ospfd process and install it on the node where the virtual network element is located. Set the ospfd process to start at boot time and use the following configuration to update the ospfd process configuration file / etc / quagga / ospfd.conf:
[0094] interface eth1
[0095] ip ospf hello-interval 1
[0096] ip ospf dead-interval 2
[0097] ip ospf area 0.0.0.0
[0098] The above configuration defines a virtual Ethernet interface eth1, which is used to communicate with the server in the cloud computing platform through vxlan. The heartbeat interval of ospf is planned to be 1s, the overtime exception interval is 2s, and the eht1 interface is configured to belong to area 0 in the ospf network.
[0099] interface eth2
[0100] ip ospf hello-interval 1
[0101] ip ospf dead-interval 2
[0102] ip ospf area 0.0.0.1
[0103] The above configuration defines a virtual Ethernet interface eth2, which is used for VLAN communication with the outside of the cloud. The heartbeat interval of ospf is planned to be 1s, the overtime exception interval is 2s, and the eht2 interface is configured to belong to area1 in the ospf network.
[0104] router ospf
[0105] ospf router-id 10.101.8.101
[0106] network 10.101.16.0 / 24 area 0
[0107] network 10.101.64.0 / 24 area 0
[0108] network 10.101.32.0 / 24 area 1
[0109] network 10.101.128.0 / 24 area 1
[0110] Among them, the subnets in area 0 and area 1 are configured respectively through the above configuration, 10.101.64.0 / 24 is the vtep network segment of the virtual network element, and multiple virtual network elements in the same network element cluster use the same vtep 10.101.16.0 is the external IP address actually used by the virtual NE. All virtual NEs are planned differently. For example, virtual NE 1 is planned to be 10.101.16.101, and virtual NE 2 is planned to be 10.101.16.102. 10.101.32.0 is the network segment of the unified gateway for external forwarding of virtual NE EIP. All virtual NEs are planned to have the same address, such as 10.101.32.100. 10.101.128.0 is the external IP address actually used by the virtual NE. All virtual NEs are planned differently. For example, virtual NE 1 is planned to be 10.101.128.101, and virtual NE 2 is planned to be 10.101.128.102.
[0111] At the same time, the OSPF module in the external network switch is also configured accordingly. Multiple OSPF modules exchange information and form equal-cost routes to ensure that multiple virtual network elements in the same network element cluster form a master-master mode. At the same time, the OSPF route publishing module can be used to dynamically publish and delete virtual network elements to achieve dynamic access and removal, thereby achieving seamless horizontal expansion.
[0112] In an exemplary embodiment, as shown in FIG4 , optionally, determining the IP address of the target virtual network element from the multiple virtual network elements included in the target network element cluster includes the following steps 401 to 402. Among them:
[0113] S401, obtaining a preset flow control strategy.
[0114] S402: Determine the IP address of a target virtual network element from multiple virtual network elements according to a traffic control policy.
[0115] Optionally, the IP address of the target virtual network element may be determined according to the load of each virtual network element according to the above traffic control strategy.
[0116] Optionally, the flow control policy can be configured by the control address translation module, which can be configured by the following configuration. At the same time, the target address translation method is also configured according to the following configuration:
[0117] ip netns exec snat-xxx tc qdisc add dev qg-xxx root handle 1: htb
[0118] ip netns exec snat-xxx tc filter add dev qg-xxx parent 1: protocol ipprio 1 u32 match ip src vmip / 32 action nat egress vmip / 32 eip
[0119] ip netns exec snat-xxx tc qdisc add dev qg-xxx ingress handle ffff
[0120] ip netns exec snat-xxx tc filter add dev qg-xxx parent ffff: protocolip prio 1 u32 match ip dst eip / 32 action nat ingress eip / 32 vmip
[0121] The above configuration is for the flow control settings of the interface in a specific network namespace (snat-xxx), involving the Hierarchical Token Bucket (HTB) queue rules and the related filtering and action configuration of the network address translation, which can perform fine management and address translation operations on the data of the virtual network element.
[0122] Optionally, the above configuration adds an HTB queue management policy on the interface qg-xxx to control the network address translation of data sent from the interface. When sending data from the cloud computing platform to the cloud outside, the source IP address of the data packet is converted to an elastic public IP address. When sending data from the cloud outside to the cloud computing platform, the destination address is converted to a private IP address that can be identified within the cloud computing platform.
[0123] Optionally, the control address conversion module can also perform stateless tracking address conversion on the data, and the address conversion includes source address conversion and target address conversion.
[0124] Optionally, the address translation may be Network Address Translation (NAT), a technology used in a network to map one IP address space to another IP address space. By translating the addresses, non-public IP addresses can be used in a private network without being directly exposed to the public network.
[0125] Optionally, Source Address Translation may refer to the process of replacing the source IP address in the data with a public IP address when the data is sent from the cloud computing platform to the external network. The public IP address may be statically assigned to the internal network or dynamically obtained from a public IP address pool.
[0126] Optionally, target address translation may refer to a process of converting a destination IP address in data into a private IP address in the cloud computing platform when the data is sent from an external network to the cloud computing platform.
[0127] Optionally, the control address translation module can be a traffic control (Traffic Control, tc) tool in the Linux system for managing and controlling network traffic. The tc module can be used to perform stateless tracking address translation, that is, the state information of the data is not recorded (for example, the session state table, the connection tracking distance, etc.). In a session, data entering a virtual network element can be replied by another virtual network element.
[0128] In the openstack operating system, when iptables is used to implement the NAT of the virtual network element for the realization of the EIP capability, iptables performs NAT conversion based on the connection tracking capability. When the network element performs SNAT on the incoming traffic, the network element of the traffic replied by the other end will perform DNAT based on the connection tracking. This requires that the same traffic uses the same network element for service establishment, which does not meet the requirements of the master-master deployment of multiple network elements. Through the tc module, the status information of the data is not recorded. In this way, when multiple virtual network elements are in the master-master working state, the data entering a virtual network element can be replied by another virtual network element, further improving the reliability of data forwarding.
[0129] As an optional implementation, as shown in FIG5 , taking the data to be forwarded as data sent from an external network to a cloud computing platform as an example, the data forwarding method provided in the embodiment of the present application may include the following specific steps:
[0130] S501: Obtain data to be forwarded.
[0131] S502, performing stateless tracking address conversion on the data, where the address conversion includes source address conversion and target address conversion.
[0132] S503: Determine the external network cluster IP address corresponding to the target network element cluster from multiple network element clusters according to the destination address of the data.
[0133] S504: Obtain external network equivalent-cost routing data corresponding to the target network element cluster.
[0134] The external network equal-cost routing data includes a mapping relationship between the external network cluster IP address of the target network element cluster and the external network IP addresses of each virtual network element included.
[0135] S505 , determining the external network IP address of the target virtual network element from the multiple virtual network elements included in the target network element cluster according to the equal-cost routing data and the preset traffic control policy.
[0136] S506: Send the data to the target virtual network element according to the external network IP address of the target virtual network element, so that the target virtual network element forwards the data according to the routing policy.
[0137] As an optional implementation, as shown in FIG6 , taking the case where the data to be forwarded is sent from the cloud computing platform to the external network as an example, the data forwarding method provided in the embodiment of the present application may include the following specific steps:
[0138] S601: Obtain data to be forwarded.
[0139] S602, performing stateless tracking address conversion on the data, where the address conversion includes source address conversion and target address conversion.
[0140] S603: Determine an intranet cluster IP address corresponding to the target network element cluster from multiple network element clusters according to the destination address of the data.
[0141] S604: Obtain the intranet equivalent-cost routing data corresponding to the target network element cluster.
[0142] The intranet equal-cost routing data includes a mapping relationship between the intranet cluster IP address of the target network element cluster and the intranet IP addresses of each virtual network element included.
[0143] S605 , determining the intranet IP address of the target virtual network element from the multiple virtual network elements included in the target network element cluster according to the equal-cost routing data and the preset traffic control policy.
[0144] S606: Send the data to the target virtual network element according to the intranet IP address of the target virtual network element, so that the target virtual network element forwards the data according to the routing policy.
[0145] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0146] Based on the same inventive concept, the embodiment of the present application also provides a data forwarding device for implementing the data forwarding method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more data forwarding device embodiments provided below can refer to the limitations on the data forwarding method above, and will not be repeated here.
[0147] In an exemplary embodiment, as shown in FIG7 , a data forwarding device 700 is provided, which is used in a target data forwarding device in a cloud computing platform, the cloud computing platform includes multiple data forwarding devices, the target data forwarding device is any one of the multiple data forwarding devices, all or part of the multiple data forwarding devices are deployed with virtual network elements, the multiple virtual network elements deployed in the cloud computing platform form multiple network element clusters, each network element cluster includes multiple virtual network elements, including a first acquisition module 701, a first determination module 702, a second acquisition module 703, and a second determination module 704. Wherein:
[0148] The first acquisition module 701 is used to acquire data to be forwarded.
[0149] The first determining module 702 is configured to determine an IP address of a target network element cluster from multiple network element clusters according to a destination address of the data.
[0150] The second acquisition module 703 is used to acquire equivalent routing data corresponding to the target network element cluster, where the equivalent routing data includes a mapping relationship between the cluster IP address of the target network element cluster and the IP addresses of the virtual network elements included therein.
[0151] The second determination module 704 is used to determine the IP address of the target virtual network element from multiple virtual network elements included in the target network element cluster according to the equivalent routing data, and send data to the target virtual network element according to the IP address of the target virtual network element so that the target virtual network element forwards the data according to the routing policy.
[0152] In one of the embodiments, the first determination module 702 is specifically used to determine the intranet cluster IP address corresponding to the target network element cluster from multiple network element clusters according to the destination address of the data if the data is sent from the cloud computing platform to the external network; if the data is sent from the external network to the cloud computing platform, then determine the external network cluster IP address corresponding to the target network element cluster from multiple network element clusters according to the destination address of the data.
[0153] In one of the embodiments, the second acquisition module 703 is specifically used to obtain the intranet equivalent routing data corresponding to the target network element cluster if the data is sent from the cloud computing platform to the external network, and the intranet equivalent routing data includes the mapping relationship between the intranet cluster IP address of the target network element cluster and the intranet IP addresses of each virtual network element included therein; if the data is sent from the external network to the cloud computing platform, the external network equivalent routing data corresponding to the target network element cluster is obtained, and the external network equivalent routing data includes the mapping relationship between the external network cluster IP address of the target network element cluster and the external network IP addresses of each virtual network element included therein.
[0154] In one of the embodiments, the data forwarding device also includes a configuration module, which is used to configure a host for each virtual network element, wherein the virtual network elements of the same host are configured to belong to the same network element cluster; configure an intranet cluster IP address and an extranet cluster IP address for each network element cluster, and configure an intranet IP address and an extranet IP address for each virtual network element; for each network element cluster, establish an OSPF protocol neighbor relationship between the network element cluster and each virtual network element based on the intranet cluster IP address and the intranet IP address of each virtual network element included in the network element cluster, and generate intranet equivalent routing data; for each network element cluster, establish an OSPF protocol neighbor relationship between the network element cluster and each virtual network element based on the extranet cluster IP address and the extranet IP address of each virtual network element included in the network element cluster, and generate extranet equivalent routing data.
[0155] In one of the embodiments, the second determination module 704 is specifically configured to obtain a preset traffic control policy; and determine an IP address of a target virtual network element from a plurality of virtual network elements according to the traffic control policy.
[0156] In one embodiment, the first acquisition module 701 is further used to perform stateless tracking address conversion on data, and the address conversion includes source address conversion and target address conversion.
[0157] Each module in the above data forwarding device can be implemented in whole or in part by software, hardware or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute the operations corresponding to each module.
[0158] In an exemplary embodiment, a data forwarding device is provided, which can be a switch or a server with an internal structure diagram as shown in FIG8. As shown in FIG8, the data forwarding device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. Among them, the processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. Among them, the processor of the data forwarding device is used to provide computing and control capabilities. The memory of the data forwarding device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the data forwarding device is used to store data. The input / output interface of the data forwarding device is used to exchange information between the processor and an external device. The communication interface of the data forwarding device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a data forwarding method is implemented.
[0159] Those skilled in the art will understand that the structure shown in FIG. 8 is merely a block diagram of a partial structure related to the scheme of the present application, and does not constitute a limitation on the data forwarding device to which the scheme of the present application is applied. The specific data forwarding device may include more or fewer components than shown in the figure, or combine certain components, or have a different arrangement of components.
[0160] In an exemplary embodiment, a data forwarding device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps described in any of the above method embodiments when executing the computer program.
[0161] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps described in any of the above method embodiments are implemented.
[0162] In one embodiment, a computer program product is provided, including a computer program, which implements the steps described in any of the above method embodiments when executed by a processor.
[0163] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., but are not limited to this.
[0164] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.
[0165] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A data forwarding method, characterized in that: In a target data forwarding device used in a cloud computing platform, the cloud computing platform includes multiple data forwarding devices, the target data forwarding device is any one of the multiple data forwarding devices, all or part of the multiple data forwarding devices are deployed with virtual network elements, the multiple virtual network elements deployed in the cloud computing platform form multiple network element clusters, each of the network element clusters includes multiple virtual network elements, including: Get the data to be forwarded; Determine an IP address of a target network element cluster from multiple network element clusters according to a destination address of the data; Acquire equivalent routing data corresponding to the target network element cluster, wherein the equivalent routing data includes a mapping relationship between a cluster IP address of the target network element cluster and an IP address of each virtual network element included therein; According to the equivalent routing data, the IP address of the target virtual network element is determined from the multiple virtual network elements included in the target network element cluster, and the data is sent to the target virtual network element according to the IP address of the target virtual network element, so that the target virtual network element forwards the data according to the routing policy.
2. The method according to claim 1, characterized in that The determining the IP address of the target network element cluster from the plurality of network element clusters according to the destination address of the data includes: If the data is sent by the cloud computing platform to the external network, determining the intranet cluster IP address corresponding to the target network element cluster from the multiple network element clusters according to the destination address of the data; If the data is sent from an external network to the cloud computing platform, the external network cluster IP address corresponding to the target network element cluster is determined from the multiple network element clusters according to the destination address of the data.
3. The method according to claim 2, characterized in that The obtaining of equivalent routing data corresponding to the target network element cluster includes: If the data is sent by the cloud computing platform to the external network, then the intranet equivalent routing data corresponding to the target network element cluster is obtained, and the intranet equivalent routing data includes a mapping relationship between the intranet cluster IP address of the target network element cluster and the intranet IP addresses of each virtual network element included; If the data is sent from the external network to the cloud computing platform, the external network equivalent routing data corresponding to the target network element cluster is obtained, and the external network equivalent routing data includes the mapping relationship between the external network cluster IP address of the target network element cluster and the external network IP addresses of each virtual network element included.
4. The method according to claim 3, characterized in that The configuration process of the equal-cost routing data includes: Configuring a host for each of the virtual network elements, wherein the virtual network elements of the same host are configured to belong to the same network element cluster; Configure an intranet cluster IP address and an extranet cluster IP address for each of the network element clusters, and configure an intranet IP address and an extranet IP address for each of the virtual network elements; For each of the network element clusters, according to the intranet cluster IP address and the intranet IP address of each virtual network element included in the network element cluster, establish an OSPF protocol neighbor relationship between the network element cluster and each of the virtual network elements, and generate intranet equivalent routing data; For each of the network element clusters, an OSPF protocol neighbor relationship between the network element cluster and each of the virtual network elements included in the network element cluster is established according to the external network cluster IP address and the external network IP address of each of the virtual network elements included in the network element cluster, and external network equivalent routing data is generated.
5. The method according to claim 1, characterized in that The step of determining the IP address of the target virtual network element from the multiple virtual network elements included in the target network element cluster includes: Get the preset flow control strategy; The IP address of the target virtual network element is determined from the multiple virtual network elements according to the traffic control strategy.
6. The method according to claim 1, characterized in that After the data to be forwarded is obtained, the method further includes: The data is subjected to stateless tracking address conversion, wherein the address conversion includes source address conversion and target address conversion.
7. A data forwarding transposition, characterized in that: In a target data forwarding device used in a cloud computing platform, the cloud computing platform includes multiple data forwarding devices, the target data forwarding device is any one of the multiple data forwarding devices, all or part of the multiple data forwarding devices are deployed with virtual network elements, the multiple virtual network elements deployed in the cloud computing platform form multiple network element clusters, each of the network element clusters includes multiple virtual network elements, including: A first acquisition module, used to acquire data to be forwarded; A first determination module, configured to determine an IP address of a target network element cluster from a plurality of network element clusters according to a destination address of the data; A second acquisition module is used to acquire equivalent routing data corresponding to the target network element cluster, wherein the equivalent routing data includes a mapping relationship between a cluster IP address of the target network element cluster and an IP address of each virtual network element included therein; The second determination module is used to determine the IP address of the target virtual network element from the multiple virtual network elements included in the target network element cluster according to the equivalent routing data, and send the data to the target virtual network element according to the IP address of the target virtual network element, so that the target virtual network element forwards the data according to the routing policy.
8. A data forwarding device, comprising a memory and a processor, wherein the memory stores a computer program, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Multi-tenant-oriented cloud network architecture
CN105391771A
Data transmission method and device, and network system
CN107846358A
Data processing method, network element equipment and readable storage medium
CN113596191A
Data forwarding method and virtualized cloud network architecture
CN114827015A
Container cluster network system, data processing method, device and computer program product
CN115686729A