Method and device for realizing shared bandwidth of cloud computing platform and cloud computing platform
By obtaining shared bandwidth information of virtual routers in the OpenStack cloud computing platform and creating filters and queues, the problem of difficulty in sharing bandwidth for multiple floating IPs is solved, achieving efficient bandwidth usage and cost reduction.
Patent Information
- Application Number
- CN202211185350.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-27
- Publication Date
- 2025-04-04
- Estimated Expiration
- 2042-09-27
AI Technical Summary
In the prior art, it is difficult to realize the shared bandwidth of multiple floating IPs in the OpenStack cloud computing platform, resulting in a decrease in bandwidth usage and an increase in the cost of using public bandwidth.
By obtaining shared bandwidth information of the target virtual router, filters and queues are created to implement shared bandwidth for multiple floating IPs in the virtual router's namespace. The specific steps include creating filters corresponding to floating IPs on the gateway port and creating virtual ports and queues in the namespace of the virtual router to limit the inbound and outbound traffic of floating IPs.
The shared bandwidth of multiple floating IPs is realized, which improves bandwidth usage rate, reduces the cost of public network bandwidth, and distributes bandwidth fairly in high-load scenarios.
Smart Images

Figure CN115622956B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a method and device for implementing bandwidth sharing on a cloud computing platform, and a cloud computing platform. Background Art
[0002] OpenStack cloud computing platform is an open source cloud computing management platform project that can support almost all types of cloud environments and provide cloud computing that is simple to implement, scalable, rich, and standardized. As cloud technology solutions mature, the modularity of OpenStack cloud computing platform has greatly improved the flexibility of cloud technology, and OpenStack cloud computing platform is increasingly widely used in various fields.
[0003] In the prior art, virtual machines in the OpenStack cloud computing platform can achieve mutual access with external networks based on floating IPs. For multiple floating IPs in the OpenStack cloud computing platform that are respectively bound to ports of multiple virtual machines, since it is difficult to achieve shared bandwidth (i.e., share the same bandwidth speed limit value) for the above multiple floating IPs in the prior art, the prior art usually limits the speed of each of the above floating IPs based on the QoS (Quality of Service) speed limit function. However, limiting the speed of each of the above floating IPs based on the QoS speed limit function will result in a decrease in bandwidth utilization and an increase in the cost of using public network bandwidth. Therefore, how to achieve shared bandwidth for multiple floating IPs in the OpenStack cloud computing platform is a technical problem that needs to be solved urgently in this field. Summary of the invention
[0004] The present invention provides a method and device for realizing bandwidth sharing of a cloud computing platform and a cloud computing platform, so as to solve the defect that it is difficult to realize bandwidth sharing of multiple floating IPs in an OpenStack cloud computing platform in the prior art, and realize bandwidth sharing of multiple floating IPs in an OpenStack cloud computing platform.
[0005] The present invention provides a method for implementing bandwidth sharing on a cloud computing platform, comprising:
[0006] Obtain target shared bandwidth information corresponding to the target virtual router; the target shared bandwidth information includes each first target floating Internet Protocol address IP and a first speed limit value; each first target floating IP has been bound to each first target virtual machine; each first target virtual machine has been connected to the target virtual router;
[0007] Based on the target shared bandwidth information and the first root queue configured on the gateway port of the target virtual router, a first filter corresponding to each first target floating IP is created on the gateway port, and based on the target shared bandwidth information, a target virtual port is created in the namespace of the target virtual router; the target virtual port is configured with a second root queue, a first classifier corresponding to the second root queue, and a second filter corresponding to each first target floating IP; each of the first filters corresponds to the first root queue; each of the second filters corresponds to the second root queue;
[0008] Based on the first root queue and each first filter, the inbound traffic received by each first target floating IP is imported into the target virtual port, so that the target virtual port limits the sum of the inbound traffic received by each first target floating IP to be less than the first rate limit value based on the second root queue, the first classifier and each second filter.
[0009] According to a method for implementing shared bandwidth of a cloud computing platform provided by the present invention, when the target shared bandwidth information also includes each second target floating IP and a second speed limit value, after obtaining the target shared bandwidth information corresponding to the target virtual router, the method further includes:
[0010] Based on the target shared bandwidth information and the first root queue, create, at the gateway port, a third filter corresponding to each second target floating IP and a second classifier corresponding to the first root queue;
[0011] Based on the first root queue and each third filter, import the outbound traffic sent by each second target floating IP to the second classifier, so that the second classifier limits the sum of the outbound traffic sent by each second target floating IP to be less than the second rate limit value;
[0012] Wherein, each of the second target floating IPs has been bound to the target virtual router; and each of the third filters corresponds to the first root queue.
[0013] According to a method for implementing bandwidth sharing on a cloud computing platform provided by the present invention, the method of creating a target virtual port in the namespace of the target virtual router based on the target shared bandwidth information includes:
[0014] Based on the target shared bandwidth information and the random fair queue algorithm, a target virtual port is created in the namespace of the target virtual router, wherein the target virtual port includes a second root queue, a first classifier corresponding to the second root queue, a second filter corresponding to each first target floating IP, and a first random fair queue corresponding to each first classifier.
[0015] According to a method for implementing shared bandwidth on a cloud computing platform provided by the present invention, after creating, on the gateway port, a third filter corresponding to each second target floating IP and a second classifier corresponding to the first root queue based on the target shared bandwidth information and the first root queue, the method further includes:
[0016] Based on a random fair queue algorithm, creating a second random fair queue corresponding to each second classifier at the gateway port;
[0017] Correspondingly, after the outgoing traffic sent by each second target floating IP is directed to the second classifier based on the first root queue and each third filter so that the second classifier limits the sum of the outgoing traffic sent by each second target floating IP to be less than the second rate limit value, the method further includes:
[0018] The traffic output by each second classifier is input into a second random fair queue corresponding to each second classifier, so that each second random fair queue limits the outgoing traffic sent by any two second target floating IPs to be equal.
[0019] According to a method for implementing bandwidth sharing on a cloud computing platform provided by the present invention, the step of obtaining target shared bandwidth information corresponding to a target virtual router includes:
[0020] When the shared bandwidth information corresponding to the target virtual router cached locally changes, the changed shared bandwidth information is determined as the target shared bandwidth information.
[0021] According to a method for implementing bandwidth sharing on a cloud computing platform provided by the present invention, when the shared bandwidth information corresponding to the target virtual router cached locally changes, determining the changed shared bandwidth information as the target shared bandwidth information includes:
[0022] Creating original shared bandwidth information corresponding to the target virtual router;
[0023] comparing the original shared bandwidth information with the shared bandwidth information;
[0024] When the original shared bandwidth information is different from the shared bandwidth information, the locally cached shared bandwidth information corresponding to the target virtual router is updated based on the original shared bandwidth information, and the updated shared bandwidth information corresponding to the target virtual router is determined as the target shared bandwidth information.
[0025] According to a method for implementing bandwidth sharing on a cloud computing platform provided by the present invention, the step of creating original shared bandwidth information corresponding to the target virtual router includes:
[0026] In the case that any first target floating IP is bound to a quality of service QoS rule, removing the QoS rule bound to any first target floating IP;
[0027] The original shared bandwidth information is created based on all first target floating IPs to which no QoS rules are bound.
[0028] The present invention also provides a device for implementing bandwidth sharing on a cloud computing platform, comprising:
[0029] A data acquisition module is used to acquire target shared bandwidth information corresponding to a target virtual router; the target shared bandwidth information includes each first target floating Internet Protocol address IP and a first speed limit value; each first target floating IP has been bound to each first target virtual machine; each first target virtual machine has been connected to the target virtual router;
[0030] The bandwidth comparison module is used to create a first filter corresponding to each first target floating IP on the gateway port based on the target shared bandwidth information and the first root queue configured on the gateway port of the target virtual router, and create a target virtual port in the namespace of the target virtual router based on the target shared bandwidth information; the target virtual port is configured with a second root queue, a first classifier corresponding to the second root queue, and a second filter corresponding to each first target floating IP; each of the first filters corresponds to the first root queue; each of the second filters corresponds to the second root queue;
[0031] A bandwidth limiting module is used to import the inbound traffic received by each first target floating IP to the target virtual port based on the first root queue and each first filter, so that the target virtual port limits the sum of the inbound traffic received by each first target floating IP to be less than the first speed limit value based on the second root queue, the first classifier and each second filter.
[0032] The present invention also provides a cloud computing platform, including: the device for implementing bandwidth sharing of the cloud computing platform as described above.
[0033] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the method for implementing bandwidth sharing on a cloud computing platform as described in any one of the above is implemented.
[0034] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements a method for implementing bandwidth sharing on a cloud computing platform as described in any one of the above.
[0035] The present invention also provides a computer program product, including a computer program, which, when executed by a processor, implements any of the above-mentioned methods for implementing bandwidth sharing on a cloud computing platform.
[0036] The method, device and cloud computing platform for realizing bandwidth sharing of a cloud computing platform provided by the present invention create a first filter corresponding to each first target floating IP at the gateway port of a target virtual router based on target shared bandwidth information and a first root queue, create a target virtual port in the namespace of the target virtual router based on the target shared bandwidth information, and create a second root queue, a first classifier corresponding to the second root queue and a second filter corresponding to each first target floating IP at the target virtual port. Then, based on the first root queue and each first filter, the inbound traffic received by each first target floating IP can be imported into the target virtual port, thereby realizing speed limiting of the inbound traffic received by each first target floating IP at the target virtual port, ensuring that the sum of the inbound traffic received by each first target floating IP is less than the first speed limit value, realizing bandwidth sharing of multiple floating IPs based on Linux TC and ifb virtual port in the namespace of the virtual router, solving the problem that the inbound TC class cannot be set in TC, realizing bandwidth reuse, improving the bandwidth utilization rate and reducing the use cost of public network bandwidth. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0038] Figure 1 This is one of the flow charts of the method for implementing bandwidth sharing on a cloud computing platform provided by the present invention;
[0039] Figure 2 This is one of the principle schematic diagrams of the method for implementing bandwidth sharing on a cloud computing platform provided by the present invention;
[0040] Figure 3 This is the second principle schematic diagram of the method for implementing bandwidth sharing on a cloud computing platform provided by the present invention;
[0041] Figure 4 This is one of the structural schematic diagrams of the device for implementing the shared bandwidth of the cloud computing platform provided by the present invention;
[0042] Figure 5 This is the second structural diagram of the device for implementing the shared bandwidth of the cloud computing platform provided by the present invention;
[0043] Figure 6 This is the second flow chart of the method for implementing bandwidth sharing on a cloud computing platform provided by the present invention;
[0044] Figure 7 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION
[0045] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0046] In the description of the invention, it should be noted that, unless otherwise clearly specified and limited, the terms "installed", "connected", and "connected" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be indirectly connected through an intermediate medium, or it can be the internal communication of two components. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0047] It should be noted that a virtual machine refers to a complete computer system that is simulated by software and has complete hardware system functions and runs in a completely isolated environment. Any work that can be done in a physical computer can also be done in a virtual machine.
[0048] In the case where multiple floating IPs are bound to the ports of multiple virtual machines in the OpenStack cloud computing platform, the essence of the mutual access between the virtual machines and the external network based on the floating IPs is to establish a Network Address Translation (NAT) rule in the namespace of the virtual router connected to the virtual machines, thereby realizing the conversion between the port IP of the virtual machines and the floating IPs.
[0049] In order to solve the technical problem that multiple floating IPs bound to ports of multiple virtual machines in an OpenStack cloud computing platform are difficult to share bandwidth, the present invention provides a method for implementing bandwidth sharing on a cloud computing platform. The method for implementing bandwidth sharing on a cloud computing platform provided by the present invention can limit the speed of outbound traffic on the multiple floating IPs based on a Linux traffic controller (TC) in the namespace of a virtual router connected to the virtual machine, and can also limit the speed of inbound traffic on the multiple floating IPs based on a Linux TC and an intermediate functional block (ifb) virtual port in the namespace of the virtual router connected to the virtual machine, so that the multiple floating IPs can share bandwidth, ensure that the bandwidth occupied by each floating IP is lower than the speed limit value, realize bandwidth reuse, and fairly allocate bandwidth to each floating IP in a high-load scenario, so as to improve the bandwidth utilization rate, reduce the cost of using public network bandwidth, and the speed limit of the shared bandwidth is isolated from the original gateway and the QoS speed limit of the floating IP, and will not affect the QoS speed limit of other floating IPs or gateways.
[0050] Among them, QoS (Quality of Service) refers to the ability of a network to use various basic technologies to provide better service capabilities for designated network communications. It is a network security mechanism and a technology used to solve problems such as network delays and congestion.
[0051] Figure 1 1 is a flow chart of a method for implementing a shared bandwidth on a cloud computing platform provided by the present invention. Figure 1 The following describes the implementation method of the cloud computing platform sharing bandwidth of the present invention. Figure 1 As shown, the method includes: step 101, obtaining target shared bandwidth information corresponding to the target virtual router; the target shared bandwidth information includes each first target floating Internet Protocol address IP and a first speed limit value; each first target floating IP is bound to each first target virtual machine; each first target virtual machine has been connected to the target virtual router.
[0052] It should be noted that the executor of the embodiment of the present invention is a device for implementing bandwidth sharing on a cloud computing platform. The device for implementing bandwidth sharing on a cloud computing platform can be configured in an OpenStack cloud computing platform.
[0053] Optionally, the above-mentioned cloud computing platform shared bandwidth implementation device may include an extension and a plugin configured in a Neutron-Server component in an OpenStack cloud computing platform, and an extension configured in a Neutron L3Agent component in an OpenStack cloud computing platform.
[0054] It should be noted that the Neutron module in the OpenStack cloud computing platform can provide network support for the entire OpenStack cloud computing platform.
[0055] The Neutron-Server component in the Neutron module is one of the core components of Neutron. It is responsible for directly receiving external requests and then calling the corresponding backend plugin for processing.
[0056] As an API extension, the Neutron L3Agent component is usually used to implement routing and forwarding in the OpenStack cloud computing platform based on the services provided by the Neutron L3Agent component.
[0057] It should be noted that before executing the implementation method of the cloud computing platform sharing bandwidth provided by the present invention, each first target virtual machine has been created in the OpenStack cloud computing platform, each first target virtual machine has been connected to the target virtual router, and each first target virtual machine can transmit data with the target virtual router in the internal network provided by the target virtual router; and each first target virtual machine has a floating IP bound to its port for mutual access with the external network. The floating IP bound to the port of the first target virtual machine can be called the first target floating IP.
[0058] It should be noted that the first target floating IP is the destination floating IP, where the destination floating IP is the floating IP to which the message is to be sent.
[0059] Based on the method for implementing bandwidth sharing on a cloud computing platform provided by the present invention, bandwidth sharing of multiple first target floating IPs can be achieved.
[0060] It should be noted that the target virtual router may be determined based on actual conditions, and the target virtual router is not specifically limited in the embodiment of the present invention.
[0061] Specifically, in the embodiment of the present invention, the target shared bandwidth information corresponding to the target virtual router can be obtained in a variety of ways, for example: the target shared bandwidth information can be obtained based on the user's input; or the target shared bandwidth information sent by other electronic devices can be received; or, when it is determined that the shared bandwidth information corresponding to the locally cached target virtual router has changed, the changed shared bandwidth information can be determined as the target shared bandwidth information. In the embodiment of the present invention, the specific method for obtaining the target shared bandwidth information is not determined.
[0062] It should be noted that the above-mentioned first target floating IPs in the above-mentioned target shared bandwidth information can be determined based on actual conditions. The above-mentioned first target floating IPs in the embodiment of the present invention are not specifically limited. For example: based on actual conditions, all virtual machines connected to the target virtual router can be determined as first target virtual machines, and the destination floating IP bound to the port of each first target virtual machine can be determined as each first target floating IP; or, based on actual conditions, a part of the virtual machines connected to the target virtual router can be determined as first target virtual machines, and the destination floating IP bound to the port of each target virtual machine can be determined as each first target floating IP.
[0063] It should be noted that the first speed limit value in the target shared bandwidth information may be determined based on prior knowledge and / or actual conditions. In the embodiment of the present invention, the specific value of the first speed limit value is not limited.
[0064] Step 102: Based on the target shared bandwidth information and the first root queue configured on the gateway port of the target virtual router, a first filter corresponding to each first target floating IP is created on the gateway port; based on the target shared bandwidth information, a target virtual port is created in the namespace of the target virtual router; the target virtual port is configured with a second root queue, a first classifier corresponding to the second root queue, and a second filter corresponding to each first target floating IP; each of the first filters corresponds to the first root queue; and each of the second filters corresponds to the second root queue.
[0065] It should be noted that, since a distributed virtual router has multiple namespaces, the target virtual router in the embodiment of the present invention is a centralized virtual router.
[0066] Specifically, after obtaining the target shared bandwidth information corresponding to the target virtual router, a TC qdisc root queue can be created at the external gateway qg port in the namespace of the target virtual router based on the target shared bandwidth information, and the TC qdisc root queue can be determined as the first root queue. Wherein, qg is an elastic ip address group.
[0067] It should be noted that, when the first root queue has been created on the gateway qg port, the first root queue can be directly reused.
[0068] Based on the first root queue and the target shared bandwidth information, a TC filter filter corresponding to each first target floating IP can be created on the gateway qg port, and each TC filer filter can be determined as a first filter corresponding to each first target floating IP. Each first filter corresponds to the first root queue.
[0069] It should be noted that, since TC can support fewer operations on inbound traffic and does not support classification by TC class, in the embodiment of the present invention, an intermediate layer virtual port is established to achieve shared bandwidth for inbound traffic.
[0070] Specifically, after obtaining the target shared bandwidth information, a virtual port of ifb type may be created in the namespace of the target virtual router based on the target shared bandwidth information, and the virtual port may be determined as the target virtual port, wherein the target virtual port may be represented as ifb0 port.
[0071] After creating the target virtual port in the namespace of the target virtual router, a TC qdisc root queue may be created at the target virtual port based on the target shared bandwidth information, and the TC qdisc root queue may be determined as the second root queue.
[0072] Based on the second root queue and the target shared bandwidth information, a TC class classifier corresponding to the second root queue may be created on the target virtual port, and the TC class classifier may be determined as the first classifier corresponding to the second root queue.
[0073] It should be noted that the number of the first classifiers may be one or more.
[0074] Based on the second root queue and the target shared bandwidth information, a TC filter filter corresponding to each first target floating IP may be created in the target virtual port, and each TC filer filter may be determined as a second filter corresponding to each first target floating IP, wherein each second filter corresponds to the second root queue.
[0075] Step 103: Based on the first root queue and each first filter, the inbound traffic received by each first target floating IP is imported into the target virtual port, so that the target virtual port limits the sum of the inbound traffic received by each first target floating IP to be less than the first rate limit value based on the second root queue, the first classifier and each second filter.
[0076] Figure 2 This is one of the principle schematic diagrams of the method for implementing the shared bandwidth of the cloud computing platform provided by the present invention. Figure 2 As shown, traffic received via the external gateway qg port in the namespace of the target virtual router may first enter the first root queue.
[0077] Traffic outputted by the first queue may be inputted into each first filter. Each first filter may filter the traffic outputted by the first queue and output the inbound traffic received by each first target floating IP.
[0078] Each first filter may output the inbound traffic received by each first target floating IP address to the target virtual port.
[0079] After the inbound traffic received by each first target floating IP is input into the target virtual port, it is first input into the second queue.
[0080] Traffic outputted by the second root queue may be inputted into each second filter. Each second filter may filter the traffic outputted by the second root queue and output the inbound traffic received by each first target floating IP.
[0081] Each first filter can output the inbound traffic received by each first target floating IP to the corresponding first classifier, and then based on the first classifier, it can implement speed limit on the inbound traffic received by each first target floating IP, ensuring that the sum of the inbound traffic received by each first target floating IP is less than the first speed limit value.
[0082] It should be noted that the speed limit value configured by the first classifier is the first speed limit value. And because the first root queue is unique, the target virtual port needs to share the first root queue with other floating IPs and gateway QoS speed limits in the OpenStack cloud computing platform.
[0083] The embodiment of the present invention creates a first filter corresponding to each first target floating IP at the gateway port of the target virtual router based on the target shared bandwidth information and the first root queue, creates a target virtual port in the namespace of the target virtual router based on the target shared bandwidth information, and creates a second root queue, a first classifier corresponding to the second root queue, and a second filter corresponding to each first target floating IP at the target virtual port. Then, based on the first root queue and each first filter, the inbound traffic received by each first target floating IP can be imported into the target virtual port, thereby achieving speed limit of the inbound traffic received by each first target floating IP at the target virtual port, ensuring that the sum of the inbound traffic received by each first target floating IP is less than the first speed limit value, achieving shared bandwidth of multiple floating IPs based on Linux TC and ifb virtual port in the namespace of the virtual router, solving the problem that the inbound TC class cannot be set in TC, achieving bandwidth multiplexing, improving bandwidth utilization, and reducing the cost of using public network bandwidth.
[0084] Based on the contents of the above embodiments, when the target shared bandwidth information also includes each second target floating IP and the second speed limit value, after obtaining the target shared bandwidth information corresponding to the target virtual router, it also includes: based on the target shared bandwidth information and the first root queue, creating a third filter corresponding to each second target floating IP and a second classifier corresponding to the first root queue at the gateway port.
[0085] Among them, each second target floating IP has been bound to each second target virtual machine; each second target virtual machine has been connected to the target virtual router for binding; and each third filter corresponds to the first root queue.
[0086] It should be noted that before executing the implementation method of the cloud computing platform sharing bandwidth provided by the present invention, each second target virtual machine has been created in the OpenStack cloud computing platform, each second target virtual machine has been connected to the target virtual router, and each second target virtual machine can transmit data with the target virtual router in the internal network provided by the target virtual router; and each second target virtual machine has a floating IP bound to its port for mutual access with the external network. The floating IP bound to the port of the second target virtual machine can be called the second target floating IP.
[0087] It should be noted that the second target floating IP is the source floating IP, wherein the source floating IP is the floating IP for sending data.
[0088] Based on the method for implementing bandwidth sharing on a cloud computing platform provided by the present invention, bandwidth sharing of multiple second target floating IPs can be achieved.
[0089] It should be noted that the above-mentioned second target floating IPs in the above-mentioned target shared bandwidth information can be determined based on actual conditions. The above-mentioned second target floating IPs in the embodiment of the present invention are not specifically limited. For example: based on actual conditions, all virtual machines connected to the target virtual router can be determined as second target virtual machines, and the source floating IP bound to the port of each second target virtual machine can be determined as each second target floating IP; or, based on actual conditions, a part of the virtual machines connected to the target virtual router can be determined as second target virtual machines, and the source floating IP bound to the port of each second target virtual machine can be determined as each second target floating IP.
[0090] It should be noted that the second speed limit value in the target shared bandwidth information may be determined based on prior knowledge and / or actual conditions. The specific value of the second speed limit value is not limited in the embodiment of the present invention.
[0091] Specifically, after obtaining the target shared bandwidth information corresponding to the target virtual router, a TC filter filter corresponding to each second target floating IP can be created in the external gateway qg port in the namespace of the target virtual router based on the first root queue and the target shared bandwidth information, and each TC filer filter is determined as a third filter corresponding to each second target floating IP. Wherein, each third filter corresponds to the first root queue.
[0092] After obtaining the target shared bandwidth information corresponding to the target virtual router, a TC class classifier corresponding to the first root queue can be created on the gateway qg port based on the first root queue and the target shared bandwidth information, and the TC class classifier can be determined as the second classifier corresponding to the first root queue.
[0093] It should be noted that the number of the second classifiers may be one or more.
[0094] It should be noted that the speed limit value configured for the second classifier is the second speed limit value. And because the first root queue is unique, the second classifier needs to share the first root queue with other floating IPs and gateway QoS speed limits in the OpenStack cloud computing platform.
[0095] Based on the first root queue and each third filter, the outbound traffic sent by each second target floating IP is introduced into the second classifier, so that the second classifier limits the sum of the outbound traffic sent by each second target floating IP to be less than the second rate limit value.
[0096] Figure 3 This is the second principle schematic diagram of the method for implementing the shared bandwidth of the cloud computing platform provided by the present invention. Figure 3As shown, traffic sent via the external gateway qg port in the namespace of the target virtual router may first enter the first root queue.
[0097] Traffic output from the first queue can be input to each third filter. Each third filter can filter the traffic output from the first queue and output outgoing traffic sent from each second target floating IP.
[0098] Each third filter can output the outgoing traffic sent by each second target floating IP to the second classifier, and then based on the second classifier, the speed limit of the outgoing traffic sent by each second target floating IP can be implemented to ensure that the outgoing traffic sent by each second target floating IP is less than the second speed limit value.
[0099] The embodiment of the present invention creates a third filter corresponding to each second target floating IP and a second classifier corresponding to the first root queue at the gateway port based on the target shared bandwidth information and the first root queue. Then, based on the first root queue and each third filter, the outbound traffic emitted by each second target floating IP can be imported into the second classifier, so that the outbound traffic emitted by each second target floating IP can be speed-limited based on the second classifier, and the sum of the outbound traffic emitted by each second target floating IP can be ensured to be less than the second speed limit value, bandwidth multiplexing can be achieved, bandwidth can be fairly allocated to each floating IP in a high-load scenario, the bandwidth utilization rate can be improved, and the cost of using public network bandwidth can be reduced.
[0100] Based on the contents of the above embodiments, based on the target shared bandwidth information, a target virtual port is created in the namespace of the target virtual router, including: based on the target shared bandwidth information and the random fair queue algorithm, a target virtual port is created in the namespace of the target virtual router, the target virtual port includes a second root queue, a first classifier corresponding to the second root queue, a second filter corresponding to each first target floating IP, and a first random fair queue corresponding to each first classifier.
[0101] It should be noted that, in the embodiment of the present invention, based on the target shared bandwidth information corresponding to the target virtual router and the stochastic fair queueing (SFQ) algorithm, when creating a target virtual port in the namespace of the target virtual router, a first stochastic fair queue (qdisc SFQ queue) corresponding to each first classifier is created in the target virtual port, so that each first stochastic fair queue can be used.
[0102] Accordingly, if Figure 2As shown, the traffic output by each first filter can be input into the corresponding first random fair queue. Each first random fair queue can limit the inbound traffic received by any two first target floating IPs to be equal, thereby ensuring fair bandwidth occupancy of each first target floating IP under high load conditions.
[0103] The embodiment of the present invention creates a target virtual port in the namespace of the target virtual router based on the target shared bandwidth information and the random fair queue corresponding to the target virtual router, thereby achieving fair bandwidth occupation of each first target floating IP under high load conditions.
[0104] Based on the contents of the above embodiments, based on the target shared bandwidth information and the first root queue, after creating a third filter corresponding to each second target floating IP and a second classifier corresponding to the first root queue at the gateway port, it also includes: based on a random fair queue algorithm, creating a second random fair queue corresponding to each second classifier at the gateway port.
[0105] Correspondingly, based on the first root queue and each third filter, the outbound traffic emitted by each second target floating IP is imported into the second classifier so that the second classifier limits the sum of the outbound traffic emitted by each second target floating IP to be less than the second speed limit value, and also includes: the traffic output by each second classifier is imported into the second random fair queue corresponding to each second classifier, so that each second random fair queue limits the outbound traffic emitted by any two second target floating IPs to be equal.
[0106] It should be noted that, in the embodiment of the present invention, based on the target shared bandwidth information corresponding to the target virtual router and the random fair queue algorithm, after the second classifier corresponding to the first root queue is created at the external gateway qg port in the namespace of the target virtual router, a second random fair queue (qdisc SFQ queue) corresponding to each second classifier can be created at the target virtual port.
[0107] Accordingly, if Figure 3 As shown, the traffic output by each second filter can be input into the corresponding second random fair queue. Each second random fair queue can limit the outgoing traffic sent by any two second target floating IPs to be equal, thereby ensuring fair bandwidth occupancy of each second target floating IP under high load conditions.
[0108] The embodiment of the present invention creates a second random fair queue corresponding to each second classifier at the target virtual port based on the target shared bandwidth information and the random fair queue corresponding to the target virtual router, and can achieve fair bandwidth occupancy of each second target floating IP under high load conditions based on the above-mentioned second random fair queues.
[0109] Based on the contents of the above embodiments, obtaining the target shared bandwidth information corresponding to the target virtual router includes: when the shared bandwidth information corresponding to the target virtual router cached locally changes, determining the changed shared bandwidth information as the target shared bandwidth information.
[0110] Specifically, the shared bandwidth information corresponding to the target virtual router can be pre-cached in a local cache database, and the identification information of the target virtual router and the above-mentioned shared bandwidth information, the above-mentioned shared bandwidth information and the first target floating IP, the above-mentioned shared bandwidth information and the second target floating IP, the above-mentioned shared bandwidth information and the label of the first classifier, the above-mentioned shared bandwidth information and the label of the second classifier, and different floating IPs can be cached locally separately, which can effectively ensure the security of data caching; it can also avoid cache clearing due to restart in special scenarios such as service restart and node migration, and the actual environment configuration will be verified during reconfiguration to avoid repeated configuration issuance or conflicts between the issued configuration and the original configuration.
[0111] It should be noted that the database used to locally cache the shared bandwidth information corresponding to the target virtual router may be a MySQL database. The locally cached shared bandwidth information corresponding to the target virtual router may also be cached in the process.
[0112] In the embodiment of the present invention, when the shared bandwidth information corresponding to the target virtual router cached locally changes, the changed shared bandwidth information may be determined as the target shared bandwidth information.
[0113] Optionally, when the shared bandwidth information corresponding to the target virtual router cached locally changes, determining the changed shared bandwidth information as the target shared bandwidth information includes: creating original shared bandwidth information corresponding to the target virtual router.
[0114] Specifically, in the embodiment of the present invention, based on the user input, by calling the API of the Neutron-Server component, the original shared bandwidth information corresponding to the target virtual router can be created in the Neutron-Server component, and the above original shared bandwidth information can be associated with the target virtual router, and each first target floating IP and the first speed limit value can be added to the above original shared bandwidth information, thereby completing the creation of the original shared bandwidth information corresponding to the target virtual router.
[0115] Optionally, when creating the original shared bandwidth information, each second target floating IP and the second speed limit value may also be added to the original shared bandwidth information.
[0116] The original shared bandwidth information is compared with the shared bandwidth information corresponding to the target virtual router in the local cache.
[0117] Specifically, after the original shared bandwidth information corresponding to the target virtual router is created, the original shared bandwidth information may be compared with the locally cached shared bandwidth information corresponding to the target virtual router.
[0118] Optionally, after the creation of the original shared bandwidth information corresponding to the target virtual router is completed in the Neutron-Server component, the extension and plugin configured in the Neutron-Server component may send a target virtual router update notification to the extension configured in the NeutronL3Agent component.
[0119] When receiving the target virtual router update notification, the extension configured in the Neutron L3Agent component may compare the original shared bandwidth information with the shared bandwidth information corresponding to the target virtual router cached locally.
[0120] It should be noted that, when the Neutron L3Agent component is migrated to other nodes, the shared bandwidth can be automatically configured based on the received target virtual router update notification, which can ensure the stability of the implementation method of the shared bandwidth of the cloud computing platform provided by the present invention; when the Neutron L3Agent component is restarted, in the process of creating the above-mentioned original shared bandwidth information, a local configuration check can be added to avoid repeated configuration or conflicting configuration, and it can be compatible with the configuration of the gateway QoS and the QoS of the floating IP in the OpenStack cloud computing platform, which can ensure that the implementation method of the shared bandwidth of the cloud computing platform provided by the present invention and the QoS speed limit configuration do not affect each other.
[0121] When the original shared bandwidth information is different from the shared bandwidth information, the locally cached shared bandwidth information corresponding to the target virtual router is updated based on the original shared bandwidth information, and the updated shared bandwidth information corresponding to the target virtual router is determined as the target shared bandwidth information.
[0122] Specifically, if the original shared bandwidth information is different from the shared bandwidth information corresponding to the locally cached target virtual router, it can be determined that the shared bandwidth information corresponding to the locally cached target virtual router has changed, and the shared bandwidth information corresponding to the locally cached target virtual router can be updated based on the original shared bandwidth information, and the updated shared bandwidth information corresponding to the locally cached target virtual router can be determined as the target shared bandwidth information.
[0123] It should be noted that when the shared bandwidth information corresponding to the locally cached target virtual router is updated based on the above original shared bandwidth information, it is only necessary to modify the shared bandwidth information corresponding to the locally cached target virtual router based on the above original shared bandwidth information, without modifying all of it. When modifying the above shared bandwidth information, the actual local configuration can also be read first to prevent duplicate configuration or conflicting configuration.
[0124] In the embodiment of the present invention, when the shared bandwidth information corresponding to the locally cached target virtual router is different from the original shared bandwidth information corresponding to the created target virtual router, the shared bandwidth information corresponding to the locally stored target virtual router is modified accordingly based on the original shared bandwidth information, and the original shared bandwidth information is determined as the target shared bandwidth information corresponding to the target virtual router. This can more accurately and efficiently obtain the target shared bandwidth information, can timely update the shared bandwidth information of the locally cached target virtual machine, and can avoid repeated configuration or conflicting configuration.
[0125] Based on the contents of the above embodiments, the original shared bandwidth information corresponding to the target virtual router is created, including: when any first target floating IP is bound to a quality of service QoS rule, removing the QoS rule bound to any first target floating IP;
[0126] The original shared bandwidth information is created based on all first target floating IPs to which no QoS rules are bound.
[0127] Specifically, in order to ensure the compatibility between the implementation method of the cloud computing platform shared bandwidth provided by the present invention and the QoS of the floating IP, when creating the original shared bandwidth information corresponding to the target virtual router, if any first target floating IP is bound to a QoS rule, it is necessary to remove the QoS configuration of the above-mentioned first target floating IP by default.
[0128] It should be noted that if QoS is configured for any first target floating IP, an error will be reported, thereby reminding the user that the above-mentioned first target floating IP already belongs to a shared bandwidth; if any first target floating IP is deleted or the first target floating IP is unbound from the port of the target virtual machine, the first filter and the second filter corresponding to the first target floating IP, as well as other related speed limit configurations, can be automatically removed, thereby ensuring the consistency and predictability of the implementation method of shared bandwidth of the cloud computing platform provided by the present invention, and ensuring that related operations of shared bandwidth will not affect other unrelated floating IPs.
[0129] It should be noted that when creating the original shared bandwidth information corresponding to the target virtual router, if any second target floating IP is bound with a QoS rule, the QoS configuration of the second target floating IP needs to be removed by default.
[0130] Figure 4 This is one of the structural diagrams of the device for implementing the shared bandwidth of the cloud computing platform provided by the present invention. Figure 4 The implementation device for sharing bandwidth on a cloud computing platform provided by the present invention is described. The implementation device for sharing bandwidth on a cloud computing platform described below and the implementation method for sharing bandwidth on a cloud computing platform provided by the present invention described above can be referred to each other. Figure 4 As shown, there are a data acquisition module 401, a bandwidth comparison module 402 and a bandwidth limitation module 403.
[0131] The data acquisition module 401 is used to obtain the target shared bandwidth information corresponding to the target virtual router; the target shared bandwidth information includes each first target floating Internet Protocol address IP and a first speed limit value; each first target floating IP is bound to each first target virtual machine; each first target virtual machine is connected to the target virtual router.
[0132] The bandwidth comparison module 402 is used to create a first filter corresponding to each first target floating IP on the gateway port based on the target shared bandwidth information and the first root queue configured on the gateway port of the target virtual router, and create a target virtual port in the namespace of the target virtual router based on the target shared bandwidth information; the target virtual port is configured with a second root queue, a first classifier corresponding to the second root queue, and a second filter corresponding to each first target floating IP; each of the first filters corresponds to the first root queue; and each of the second filters corresponds to the second root queue.
[0133] The bandwidth limiting module 403 is used to import the incoming traffic received by each first target floating IP to the target virtual port based on the first root queue and each first filter, so that the target virtual port can limit the sum of the incoming traffic received by each first target floating IP to be less than the first speed limit value based on the second root queue, the first classifier and each second filter.
[0134] Specifically, the data acquisition module 401, the bandwidth comparison module 402 and the bandwidth limitation module 403 are electrically connected.
[0135] The device for realizing shared bandwidth of a cloud computing platform in an embodiment of the present invention creates a first filter corresponding to each first target floating IP at the gateway port of a target virtual router based on target shared bandwidth information and a first root queue, creates a target virtual port in the namespace of the target virtual router based on the target shared bandwidth information, and creates a second root queue, a first classifier corresponding to the second root queue, and a second filter corresponding to each first target floating IP at the target virtual port. Then, based on the first root queue and each first filter, the inbound traffic received by each first target floating IP can be imported into the target virtual port, thereby realizing speed limit of the inbound traffic received by each first target floating IP at the target virtual port, ensuring that the sum of the inbound traffic received by each first target floating IP is less than the first speed limit value, realizing shared bandwidth of multiple floating IPs based on Linux TC and ifb virtual port in the namespace of the virtual router, solving the problem that the inbound TC class cannot be set in TC, realizing bandwidth reuse, improving the bandwidth utilization rate, and reducing the use cost of public network bandwidth.
[0136] Based on the contents of the above embodiments, the present invention further provides a cloud computing platform, including a device for implementing bandwidth sharing of the above cloud computing platform.
[0137] It should be noted that the cloud computing platform in the embodiment of the present invention is an OpenStack cloud computing platform.
[0138] It should be noted that Figure 5 This is the second structural diagram of the device for implementing the shared bandwidth of the cloud computing platform provided by the present invention. Figure 5 As shown, the implementation device for sharing bandwidth on the above cloud computing platform may include an extension and plugin configured in the Neutron-Server component in the OpenStack cloud computing platform, and may cache data to mysql. The implementation device for sharing bandwidth on the above cloud computing platform may also include an extension configured in the NeutronL3Agent component in the OpenStack cloud computing platform, which may call Linux TC and create a target virtual interface to implement shared speed limit.
[0139] In order to facilitate the understanding of the method for implementing shared bandwidth of a cloud computing platform, the device for implementing shared bandwidth of a cloud computing platform, and the cloud computing platform provided by the present invention, the method for implementing shared bandwidth of a cloud computing platform, the device for implementing shared bandwidth of a cloud computing platform, and the cloud computing platform provided by the present invention are explained below through an example.
[0140] Figure 6 This is the second flow chart of the method for implementing the shared bandwidth of the cloud computing platform provided by the present invention. Figure 6As shown, when the first target virtual machine and the second target virtual machine have been created in the OpenStack cloud computing platform, each first target virtual machine and each second target virtual machine have been connected to the target virtual router, and the port of each first target virtual machine and each second target virtual machine has been bound to a floating IP, the method for implementing shared bandwidth of the cloud computing platform provided by the present invention can be started.
[0141] By calling the API of the Neutron-Server component, the original shared bandwidth information corresponding to the target virtual router can be created in the Neutron-Server component, and the original shared bandwidth information can be associated with the target virtual router, and each first target floating IP and the first speed limit value can be added to the original shared bandwidth information, thereby completing the creation of the original shared bandwidth information corresponding to the target virtual router. When creating the original shared bandwidth information, each second target floating IP and the second speed limit value can also be added to the original shared bandwidth information.
[0142] After the original shared bandwidth information corresponding to the target virtual router is created in the Neutron-Server component, the extension and plugin configured in the Neutron-Server component can send a target virtual router update notification to the extension configured in the Neutron L3Agent component.
[0143] When receiving the target virtual router update notification, the extension configured in the Neutron L3Agent component may compare the original shared bandwidth information with the shared bandwidth information corresponding to the target virtual router cached locally.
[0144] If the original shared bandwidth information is different from the locally cached shared bandwidth information corresponding to the target virtual router, the locally cached shared bandwidth information corresponding to the target virtual router may be updated based on the original shared bandwidth information, and the updated locally cached shared bandwidth information corresponding to the target virtual router may be determined as the target shared bandwidth information.
[0145] Based on the target shared bandwidth information and the first root queue configured on the gateway port of the target virtual router, a first filter corresponding to each first target floating Internet Protocol address IP is created on the gateway port; based on the target shared bandwidth information, a target virtual port is created in the namespace of the target virtual router, and the target virtual port is configured with a second root queue, a first classifier corresponding to the second root queue, and a second filter corresponding to each first target floating IP.
[0146] Based on the target shared bandwidth information and the first root queue, a third filter corresponding to each second target floating IP and a second classifier corresponding to the first root queue are created at the gateway port of the target virtual router.
[0147] Based on the first root queue and each first filter, the inbound traffic received by each first target floating IP is directed to the target virtual port, so that the target virtual port limits the sum of the inbound traffic received by each first target floating IP to be less than the first rate limit value based on the second root queue, the first classifier and each second filter.
[0148] Based on the first root queue and each third filter, the outbound traffic sent by each second target floating IP is introduced into the second classifier, so that the second classifier limits the sum of the outbound traffic sent by each second target floating IP to be less than the second rate limit value.
[0149] Figure 7 An example of a physical structure diagram of an electronic device is shown in FIG. Figure 7 As shown, the electronic device may include: a processor (processor) 710, a communication interface (Communications Interface) 720, a memory (memory) 730 and a communication bus 740, wherein the processor 710, the communication interface 720, and the memory 730 communicate with each other through the communication bus 740. The processor 710 may call the logic instructions in the memory 730 to execute a method for implementing a shared bandwidth of a cloud computing platform, the method comprising: obtaining target shared bandwidth information corresponding to a target virtual router; the target shared bandwidth information includes each first target floating Internet Protocol address IP and a first speed limit value; each first target floating IP has been bound to each first target virtual machine; each first target virtual machine has been connected to the target virtual router; based on the target shared bandwidth information and a first root queue configured on a gateway port of the target virtual router, a first filter corresponding to each first target floating IP is created on the gateway port, and based on the target shared bandwidth information, a target virtual port is created in the namespace of the target virtual router; the target virtual port is configured with a second root queue, a first classifier corresponding to the second root queue, and a second filter corresponding to each first target floating IP; each first filter corresponds to the first root queue; each second filter corresponds to the second root queue; based on the first root queue and each first filter, the inbound traffic received by each first target floating IP is directed to the target virtual port, so that the target virtual port limits the sum of the inbound traffic received by each first target floating IP to be less than the first speed limit value based on the second root queue, the first classifier, and each second filter.
[0150] In addition, the logic instructions in the above-mentioned memory 730 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.
[0151] On the other hand, the present invention also provides a computer program product, the computer program product includes a computer program, the computer program can be stored on a non-transitory computer-readable storage medium, when the computer program is executed by a processor, the computer can execute the cloud computing platform shared bandwidth implementation method provided by the above methods, the method comprising: obtaining target shared bandwidth information corresponding to the target virtual router; the target shared bandwidth information includes each first target floating Internet Protocol address IP and a first speed limit value; each first target floating IP has been bound to each first target virtual machine; each first target virtual machine has been connected to the target virtual router; based on the target shared bandwidth information and the first root queue configured on the gateway port of the target virtual router A first filter corresponding to each first target floating IP is created at the gateway port, and a target virtual port is created in the namespace of the target virtual router based on the target shared bandwidth information; the target virtual port is configured with a second root queue, a first classifier corresponding to the second root queue, and a second filter corresponding to each first target floating IP; each first filter corresponds to the first root queue; each second filter corresponds to the second root queue; based on the first root queue and each first filter, the inbound traffic received by each first target floating IP is imported into the target virtual port, so that the target virtual port limits the sum of the inbound traffic received by each first target floating IP to be less than the first speed limit value based on the second root queue, the first classifier, and each second filter.
[0152] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the method for implementing the shared bandwidth of the cloud computing platform provided by the above methods is implemented, the method comprising: obtaining target shared bandwidth information corresponding to the target virtual router; the target shared bandwidth information includes each first target floating Internet Protocol address IP and a first speed limit value; each first target floating IP is bound to each first target virtual machine; each first target virtual machine is connected to the target virtual router; based on the target shared bandwidth information and the first root queue configured on the gateway port of the target virtual router, each first target is created at the gateway port The first filter corresponding to the floating IP creates a target virtual port in the namespace of the target virtual router based on the target shared bandwidth information; the target virtual port is configured with a second root queue, a first classifier corresponding to the second root queue, and a second filter corresponding to each first target floating IP; each first filter corresponds to the first root queue; each second filter corresponds to the second root queue; based on the first root queue and each first filter, the inbound traffic received by each first target floating IP is imported into the target virtual port, so that the target virtual port limits the sum of the inbound traffic received by each first target floating IP to be less than the first speed limit value based on the second root queue, the first classifier, and each second filter.
[0153] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0154] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0155] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for implementing bandwidth sharing on a cloud computing platform, characterized in that: include: Obtain target shared bandwidth information corresponding to the target virtual router; the target shared bandwidth information includes each first target floating Internet Protocol address IP and a first speed limit value; Each of the first target floating IP addresses has been bound to each of the first target virtual machines; Each of the first target virtual machines has been connected to the target virtual router; Based on the target shared bandwidth information and the first root queue configured on the gateway port of the target virtual router, a first filter corresponding to each first target floating IP is created on the gateway port, and based on the target shared bandwidth information, a target virtual port is created in the namespace of the target virtual router; the target virtual port is configured with a second root queue, a first classifier corresponding to the second root queue, and a second filter corresponding to each first target floating IP; each of the first filters corresponds to the first root queue; each of the second filters corresponds to the second root queue; Based on the first root queue and each first filter, import the inbound traffic received by each first target floating IP to the target virtual port, so that the target virtual port limits the sum of the inbound traffic received by each first target floating IP to be less than the first rate limit value based on the second root queue, the first classifier and each second filter; Each of the first filters is used to filter the traffic output by the first root queue, and output the inbound traffic received by each of the first target floating IPs. Each of the first filters is also used to output the inbound traffic received by each of the first target floating IPs to the target virtual port, so that the inbound traffic received by the first target floating IP can be input into the second root queue through the target virtual port. Each of the second filters is used to filter the traffic output by the second root queue, and output the inbound traffic received by each of the first target floating IPs; Each of the first filters is further used to output the inbound traffic received by each of the first target floating IPs to the first filter corresponding to each of the first target floating IPs, so that the first classifier can implement the speed limit for the inbound traffic received by each of the first target floating IPs; when the target shared bandwidth information also includes each of the second target floating IPs and the second speed limit value, after acquiring the target shared bandwidth information corresponding to the target virtual router, the method further includes: Based on the target shared bandwidth information and the first root queue, create, at the gateway port, a third filter corresponding to each second target floating IP and a second classifier corresponding to the first root queue; Based on the first root queue and each third filter, import the outbound traffic sent by each second target floating IP to the second classifier, so that the second classifier limits the sum of the outbound traffic sent by each second target floating IP to be less than the second rate limit value; Each of the second target floating IPs has been bound to each of the second target virtual machines; each of the second target virtual machines has been connected to the target virtual router; each of the third filters corresponds to the first root queue; each of the third filters is used to filter the traffic output by the first root queue, and output the outgoing traffic sent by each of the second target floating IPs; each of the third filters is also used to output the outgoing traffic sent by each of the second target floating IPs to the second classifier, so that the second classifier can implement the speed limit of the outgoing traffic sent by each of the second target floating IPs; After creating, on the gateway port, a third filter corresponding to each second target floating IP and a second classifier corresponding to the first root queue based on the target shared bandwidth information and the first root queue, the method further includes: Based on a random fair queue algorithm, creating a second random fair queue corresponding to each second classifier at the gateway port; Correspondingly, after the outgoing traffic sent by each second target floating IP is directed to the second classifier based on the first root queue and each third filter so that the second classifier limits the sum of the outgoing traffic sent by each second target floating IP to be less than the second rate limit value, the method further includes: The traffic output by each second classifier is input into a second random fair queue corresponding to each second classifier, so that each second random fair queue limits the outgoing traffic sent by any two second target floating IPs to be equal.
2. The method for implementing bandwidth sharing on a cloud computing platform according to claim 1, characterized in that: The step of creating a target virtual port in the namespace of the target virtual router based on the target shared bandwidth information includes: Based on the target shared bandwidth information and the random fair queue algorithm, a target virtual port is created in the namespace of the target virtual router, wherein the target virtual port includes a second root queue, a first classifier corresponding to the second root queue, a second filter corresponding to each first target floating IP, and a first random fair queue corresponding to each first classifier.
3. The method for implementing bandwidth sharing on a cloud computing platform according to claim 1, characterized in that: The step of obtaining target shared bandwidth information corresponding to the target virtual router includes: When the shared bandwidth information corresponding to the target virtual router cached locally changes, the changed shared bandwidth information is determined as the target shared bandwidth information.
4. The method for implementing bandwidth sharing on a cloud computing platform according to claim 3, characterized in that: When the shared bandwidth information corresponding to the target virtual router cached locally changes, determining the changed shared bandwidth information as the target shared bandwidth information includes: Creating original shared bandwidth information corresponding to the target virtual router; comparing the original shared bandwidth information with the shared bandwidth information; When the original shared bandwidth information is different from the shared bandwidth information, the locally cached shared bandwidth information corresponding to the target virtual router is updated based on the original shared bandwidth information, and the updated shared bandwidth information corresponding to the target virtual router is determined as the target shared bandwidth information.
5. The method for implementing bandwidth sharing on a cloud computing platform according to claim 4, characterized in that: The creating the original shared bandwidth information corresponding to the target virtual router includes: In the case that any first target floating IP is bound to a quality of service QoS rule, removing the QoS rule bound to any first target floating IP; The original shared bandwidth information is created based on all first target floating IPs to which no QoS rules are bound.
6. A device for implementing bandwidth sharing on a cloud computing platform, characterized in that: include: A data acquisition module, used to acquire target shared bandwidth information corresponding to a target virtual router; The target shared bandwidth information includes each first target floating Internet Protocol address IP and a first speed limit value; each first target floating IP is bound to each first target virtual machine; Each of the first target virtual machines has been connected to the target virtual router; The bandwidth comparison module is used to create a first filter corresponding to each first target floating IP on the gateway port based on the target shared bandwidth information and the first root queue configured on the gateway port of the target virtual router, and create a target virtual port in the namespace of the target virtual router based on the target shared bandwidth information; the target virtual port is configured with a second root queue, a first classifier corresponding to the second root queue, and a second filter corresponding to each first target floating IP; each of the first filters corresponds to the first root queue; each of the second filters corresponds to the second root queue; a bandwidth limiting module, configured to import the inbound traffic received by each first target floating IP to the target virtual port based on the first root queue and each first filter, so that the target virtual port limits the sum of the inbound traffic received by each first target floating IP to be less than the first rate limit value based on the second root queue, the first classifier and each second filter; In the case where the target shared bandwidth information also includes each second target floating IP and the second speed limit value, after the data acquisition module acquires the target shared bandwidth information corresponding to the target virtual router, the data acquisition module is further used to create, at the gateway port, a third filter corresponding to each second target floating IP and a second classifier corresponding to the first root queue based on the target shared bandwidth information and the first root queue; based on the first root queue and each third filter, import the outgoing traffic sent by each second target floating IP into the second classifier, so that the second classifier limits the sum of the outgoing traffic sent by each second target floating IP to be less than the second speed limit value; Wherein, each second target floating IP is bound to each second target virtual machine; Each of the second target virtual machines has been connected to the target virtual router; each of the third filters corresponds to the first root queue; The data acquisition module is further configured to create, based on the target shared bandwidth information and the first root queue, a second random fair queue corresponding to each second classifier at the gateway port based on a random fair queue algorithm after creating, at the gateway port, a third filter corresponding to each second target floating IP and a second classifier corresponding to the first root queue; Correspondingly, the data acquisition module, based on the first root queue and each third filter, imports the outgoing traffic emitted by each second target floating IP into the second classifier, so that the second classifier limits the sum of the outgoing traffic emitted by each second target floating IP to be less than the second speed limit value, and is also used to input the traffic output by each second classifier into the second random fair queue corresponding to each second classifier, so that each second random fair queue limits the outgoing traffic emitted by any two second target floating IPs to be equal.
7. A cloud computing platform, characterized in that: include: The device for implementing bandwidth sharing of a cloud computing platform as described in claim 6.
8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the method for implementing bandwidth sharing of the cloud computing platform as described in any one of claims 1 to 5 is implemented.
9. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method for implementing bandwidth sharing of a cloud computing platform as claimed in any one of claims 1 to 5 is implemented.
Citation Information
Patent Citations
External network bandwidth speed limiting method, device and system of cloud host in IaaS cloud platform
CN105915387A