CN107846365A - A kind of load balancing based on SDN realizes system and method - Google Patents
A kind of load balancing based on SDN realizes system and method Download PDFInfo
- Publication number
- CN107846365A CN107846365A CN201711003145.7A CN201711003145A CN107846365A CN 107846365 A CN107846365 A CN 107846365A CN 201711003145 A CN201711003145 A CN 201711003145A CN 107846365 A CN107846365 A CN 107846365A
- Authority
- CN
- China
- Prior art keywords
- data packet
- flow table
- switch
- load balancing
- terminal
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 14
- 238000012545 processing Methods 0.000 claims abstract description 13
- 238000006243 chemical reaction Methods 0.000 claims description 18
- 238000012217 deletion Methods 0.000 claims description 2
- 230000037430 deletion Effects 0.000 claims description 2
- 238000000844 transformation Methods 0.000 claims 1
- 230000009466 transformation Effects 0.000 claims 1
- 230000009286 beneficial effect Effects 0.000 abstract description 2
- 238000010586 diagram Methods 0.000 description 4
- 238000005516 engineering process Methods 0.000 description 4
- 230000008569 process Effects 0.000 description 4
- 230000004044 response Effects 0.000 description 4
- 230000003993 interaction Effects 0.000 description 2
- 230000005540 biological transmission Effects 0.000 description 1
- 238000004891 communication Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000006855 networking Effects 0.000 description 1
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L47/00—Traffic control in data switching networks
- H04L47/10—Flow control; Congestion control
- H04L47/12—Avoiding congestion; Recovering from congestion
- H04L47/125—Avoiding congestion; Recovering from congestion by balancing the load, e.g. traffic engineering
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L45/00—Routing or path finding of packets in data switching networks
- H04L45/74—Address processing for routing
- H04L45/745—Address table lookup; Address filtering
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
本发明的技术方案包括一种基于SDN的负载均衡实现系统及方法,该系统包括终端、控制器、交换机及多个后端服务器,用于实现:在达到负载均衡时,生成将终端的业务分配到后端服务器的报文,报文包括终端IP和虚拟IP地址,以及还包括用于业务处理的数据包;生成交换机可识别的流表,并将流表发送至交换机;根据流表预设的规则对虚拟IP地址进行修改,以及接收后端服务器发送的数据包并进行IP地址的还原;接收交换机发送的数据包,以及执行对应的业务运算并生成相应数据包,其中数据包包括报文。发明的有益效果为:实现了链路级的负载均衡,相比传统代理级的负载均衡;极大的提高了负载均衡的转发性能;动态修改流表规则,可实现网络的灵活定制。
The technical solution of the present invention includes a system and method for realizing load balancing based on SDN. The system includes a terminal, a controller, a switch and a plurality of back-end servers, and is used to realize: The message to the back-end server, the message includes the terminal IP and virtual IP address, and also includes the data packet for business processing; generate a flow table that the switch can identify, and send the flow table to the switch; preset according to the flow table Modify the virtual IP address according to the rules, and receive the data packet sent by the back-end server and restore the IP address; receive the data packet sent by the switch, and perform the corresponding business operation and generate the corresponding data packet, where the data packet includes the message . The beneficial effects of the invention are: realizing link-level load balancing, compared with traditional agent-level load balancing; greatly improving the forwarding performance of load balancing; dynamically modifying flow table rules, and realizing flexible customization of the network.
Description
技术领域technical field
本发明涉及一种基于SDN的负载均衡实现系统及方法,属于计算机数据处理领域。The invention relates to an SDN-based load balancing realization system and method, belonging to the field of computer data processing.
背景技术Background technique
负载均衡(Load Balance,简称LB)是一种服务器或网络设备的集群技术。负载均衡将特定的业务(网络服务、网络流量等)分担给多个服务器或网络设备,从而提高了业务处理能力,保证了业务的高可用性。Load Balance (LB for short) is a clustering technology of servers or network devices. Load balancing distributes specific services (network services, network traffic, etc.) to multiple servers or network devices, thereby improving service processing capabilities and ensuring high availability of services.
例如:某系统每天有7000万笔的业务量,单台服务器满负荷也只能处理5000万笔业务,单台服务器根本无法处理这么大的业务量。此时可以再增加一台处理能力相同的服务器,将所有业务分摊到这两台服务器,让他们分别处理一部分,负载均衡技术正是解决了如何将业务分摊到两台甚至多台服务器。For example: A certain system has 70 million transactions per day, and a single server can only handle 50 million transactions at full load, and a single server cannot handle such a large transaction volume at all. At this point, you can add another server with the same processing capacity, distribute all the business to these two servers, and let them handle part of it separately. The load balancing technology just solves how to distribute the business to two or more servers.
目前实现负载均衡的方式主要通过全代理来实现,通过全代理实现的负载均衡,客户端要与全代理建立连接,代理再与后端服务器建立连接,需要建立两次连接,这极大的降低了负载均衡的性能。At present, the way to achieve load balancing is mainly realized through the full proxy. To achieve load balancing through the full proxy, the client needs to establish a connection with the full proxy, and the proxy establishes a connection with the back-end server. Two connections need to be established, which greatly reduces the performance of load balancing.
如图1所示的全代理的负载均衡实现流程,具体如下:首先客户端和全代理(负载均衡全代理)建立TCP链接,将HTTP请求发送至全代理,全代理对HTTP请求进行解析,进行会话管理、访问控制等操作,之后根据负载均衡算法为该HTTP请求分配一个后端服务器,并将处理后的HTTP请求转发至该后端服务器,服务器在处理完成之后,将HTTP响应报文发送给全代理,经由全代理将该响应报文返回给客户端。这样一次请求需要建立两次连接。The load balancing implementation process of the full proxy as shown in Figure 1 is as follows: first, the client establishes a TCP connection with the full proxy (full load balancing proxy), sends the HTTP request to the full proxy, and the full proxy parses the HTTP request and performs Session management, access control and other operations, and then allocate a back-end server for the HTTP request according to the load balancing algorithm, and forward the processed HTTP request to the back-end server. After the server completes the processing, it sends the HTTP response message to The full proxy returns the response message to the client via the full proxy. Such a request requires two connections to be established.
SDN:软件定义网络;SDN: Software Defined Networking;
OpenFlow:SDN控制平面与转发平面通信协议;OpenFlow: SDN control plane and forwarding plane communication protocol;
OpenFlow交换机:支持OpenFlow协议的软件交换机。OpenFlow switch: A software switch that supports the OpenFlow protocol.
发明内容Contents of the invention
本发明的技术方案提供了一种基于SDN的负载均衡实现系统及方法,基于SDN技术的负载均衡实现了链路级的负载均衡,一次请求只需要建立一次连接,解决了现有技术的不足。The technical solution of the present invention provides a system and method for implementing load balancing based on SDN. The load balancing based on SDN technology realizes link-level load balancing. Only one connection needs to be established for one request, which solves the shortcomings of the prior art.
本发明的技术方案包括一种基于SDN的负载均衡实现系统,该系统包括终端、控制器、交换机及多个后端服务器,其中:终端,用于在达到负载均衡时,生成将终端的业务分配到后端服务器的报文,报文包括终端IP和虚拟IP地址,以及还包括用于业务处理的数据包;控制器,用于生成交换机可识别的流表,并将流表发送至所述交换机;交换机,用于接收所述终端发送的请求指令以及接收所述控制器发送的流表,根据流表预设的规则对虚拟IP地址进行修改,并将修改的数据包进行发送,以及接收所述后端服务器发送的数据包并进行IP地址的还原;后端服务器,用于接收所述交换机发送的数据包,以及执行对应的业务运算并生成相应数据包,其中数据包包括报文。The technical solution of the present invention includes a load balancing implementation system based on SDN, the system includes a terminal, a controller, a switch, and a plurality of back-end servers, wherein: the terminal is used to generate and distribute the service of the terminal when load balancing is achieved; The message to the back-end server, the message includes the terminal IP and virtual IP address, and also includes data packets for business processing; the controller is used to generate a flow table that can be recognized by the switch, and send the flow table to the A switch; a switch, configured to receive the request instruction sent by the terminal and the flow table sent by the controller, modify the virtual IP address according to the preset rules of the flow table, and send the modified data packet, and receive The data packet sent by the back-end server is restored to the IP address; the back-end server is used to receive the data packet sent by the switch, perform corresponding business operations and generate a corresponding data packet, wherein the data packet includes a message.
根据所述的基于SDN的负载均衡实现系统,其特征在于:所述终端进一步为用于执行业务处理的服务器,所述后端服务器用于分担业务负载调度的数据库。According to the SDN-based load balancing implementation system, it is characterized in that: the terminal is further a server for executing business processing, and the back-end server is used to share a database for business load scheduling.
根据所述的基于SDN的负载均衡实现系统,其中控制器还包括:流表规则定制模块,用于自定义流表规则,并将流表规则发送至所述交换机和服务器,所述流表规则用于对控制器的IP转换进行进行限定。According to the SDN-based load balancing implementation system, wherein the controller further includes: a flow table rule customization module for customizing the flow table rules, and sending the flow table rules to the switch and the server, the flow table rules It is used to limit the IP conversion of the controller.
根据所述的基于SDN的负载均衡实现系统,其中交换机用于执行以下步骤:在对任意数据包执行IP转换时记录转换规则,并将转换标识同时记载于数据包和控制器中;当流表规则发生动态变化时,校验经过控制器的数据包是否存在历史转换标识,若存在则调用历史转换规则对数据包执行还原转换,若不存在历史转换标识,则使用新的转换对数据包执行转换。According to the described SDN-based load balancing implementation system, wherein the switch is used to perform the following steps: record the conversion rules when performing IP conversion on any data packet, and record the conversion identification in the data packet and the controller at the same time; when the flow table When the rule changes dynamically, check whether there is a historical conversion identifier in the data packet passing through the controller. If it exists, call the historical conversion rule to perform restoration conversion on the data packet. If there is no historical conversion identification, use the new conversion to execute on the data packet. convert.
根据所述的基于SDN的负载均衡实现系统,其中交换机还包括:当识别到经过的数据包不存在于终端时,将数据包发送至控制器进行存储或删除。According to the SDN-based load balancing implementation system, the switch further includes: when it is recognized that the passing data packet does not exist in the terminal, sending the data packet to the controller for storage or deletion.
本发明的技术方案还包括一种基于SDN的负载均衡实现方法,其特征在于,该方法包括:在达到负载均衡时,生成将终端的业务分配到后端服务器的报文,报文包括终端IP和虚拟IP地址,以及还包括用于业务处理的数据包;生成交换机可识别的流表,并将流表发送至交换机;接收终端发送的请求指令以及接收控制器发送的流表,根据流表预设的规则对虚拟IP地址进行修改,并将修改的数据包进行发送,以及接收后端服务器发送的数据包并进行IP地址的还原;接收交换机发送的数据包,以及执行对应的业务运算并生成相应数据包,其中数据包包括报文。The technical solution of the present invention also includes an SDN-based load balancing implementation method, which is characterized in that the method includes: when load balancing is achieved, generating a message for distributing the business of the terminal to the back-end server, and the message includes the terminal IP and virtual IP address, as well as data packets used for business processing; generate a flow table recognizable by the switch, and send the flow table to the switch; receive the request instruction sent by the terminal and the flow table sent by the controller, according to the flow table The preset rules modify the virtual IP address, send the modified data packet, and receive the data packet sent by the back-end server and restore the IP address; receive the data packet sent by the switch, and execute the corresponding business operation and A corresponding data packet is generated, wherein the data packet includes a message.
本发明的有益效果为:实现了链路级的负载均衡,相比传统代理级的负载均衡;极大的提高了负载均衡的转发性能;动态修改流表规则,可实现网络的灵活定制。The invention has the beneficial effects of: realizing link-level load balancing, compared with traditional agent-level load balancing; greatly improving the forwarding performance of load balancing; dynamically modifying flow table rules, and realizing flexible customization of the network.
附图说明Description of drawings
图1所示为根据本现有技术的全代理的负载均衡实现流程图;Fig. 1 shows that according to the flow chart of the load balancing implementation of the full proxy of the present technology;
图2所示为根据本发明实施方式的总体结构框图;Fig. 2 shows the overall structural block diagram according to the embodiment of the present invention;
图3所示为根据本发明实施方式的交互图。Fig. 3 shows an interaction diagram according to an embodiment of the present invention.
具体实施方式Detailed ways
为了使本发明的目的、技术方案和优点更加清楚,下面结合附图和具体实施例对本发明进行详细描述。本发明的基于SDN的负载均衡实现系统及方法适用于服务器负载均衡的实现。In order to make the purpose, technical solution and advantages of the present invention clearer, the present invention will be described in detail below in conjunction with the accompanying drawings and specific embodiments. The SDN-based load balancing realization system and method of the present invention are applicable to the realization of server load balancing.
图2所示为根据本发明实施方式的总体结构框图。其中包括终端,交换机、控制器、多个服务器,其中交换机为OpenFlowFig. 2 is a general structural block diagram according to an embodiment of the present invention. These include terminals, switches, controllers, and multiple servers, among which the switch is OpenFlow
与传统的负载均衡不同,基于OpenFlow的负载均衡的转发最终是通过流表实现的。Different from traditional load balancing, the forwarding of OpenFlow-based load balancing is finally realized through the flow table.
首先控制器根据负载均衡的规则,生成OpenFlow交换机可以识别的流表,并将流表派发给OpenFlow交换机。First, the controller generates a flow table that can be recognized by the OpenFlow switch according to the load balancing rules, and distributes the flow table to the OpenFlow switch.
当OpenFlow交换机在接到发给虚拟IP的数据包后,根据流表中设定的规则,将数据包中的目的IP修改为后端服务器的IP,然后进行转发。当在本地流表中查找不到时,则将数据包交由控制器处理或者丢弃。When the OpenFlow switch receives the data packet sent to the virtual IP, it modifies the destination IP in the data packet to the IP of the backend server according to the rules set in the flow table, and then forwards it. When it cannot be found in the local flow table, the data packet is handed over to the controller for processing or discarded.
后端服务器的响应报文通过OpenFlow交换机时,交换机根据流表,将报文的源地址被还原为虚服务的VSIP,再返回给客户端,完成整个负载调度过程。When the response message from the backend server passes through the OpenFlow switch, the switch restores the source address of the message to the VSIP of the virtual service according to the flow table, and then returns it to the client to complete the entire load scheduling process.
图3所示为根据本发明实施方式的交互图。Fig. 3 shows an interaction diagram according to an embodiment of the present invention.
其包括以下流程:It includes the following processes:
(1)终端用户请求数据包的发送,即业务请求,此时目的IP=虚拟IP地址,源IP=终端IP地址;(1) The terminal user requests the transmission of the data packet, that is, the service request, at this time, the destination IP=virtual IP address, and the source IP=terminal IP address;
(2)交换机根据流表处理数据包,此时目的IP=(后端)服务器IP地址,源IP=终端IP地址;(2) switch is processed data packet according to flow table, and this moment purpose IP=(back end) server IP address, source IP=terminal IP address;
(3)服务器对交换机的响应,根据流表处理数据包目的IP=终端IP,源IP=服务器IP地址;(3) server is to the response of switch, according to flow table processing data packet purpose IP=terminal IP, source IP=server IP address;
(4)交换机对终端进行相应,其中目的IP=终端IP,源IP=虚拟IP地址。(4) The switch responds to the terminal, where destination IP=terminal IP, source IP=virtual IP address.
从以上流程可以看出,客户端请求到达负载均衡时,并没有建立连接而只是修改了IP包中的目的地址,然后将IP包直接转发到对应的服务器,从而实现了链路级的负载均衡,一次请求只是建立了一次连接,这样极大的提高了负载均衡的转发性能。It can be seen from the above process that when the client request reaches the load balancer, the connection is not established but the destination address in the IP packet is modified, and then the IP packet is directly forwarded to the corresponding server, thus realizing link-level load balancing , a request only establishes a connection, which greatly improves the forwarding performance of load balancing.
以上所述,只是本发明的较佳实施例而已,本发明并不局限于上述实施方式,只要其以相同的手段达到本发明的技术效果,都应属于本发明的保护范围。在本发明的保护范围内其技术方案和/或实施方式可以有各种不同的修改和变化。The above descriptions are only preferred embodiments of the present invention, and the present invention is not limited to the above-mentioned embodiments, as long as they achieve the technical effects of the present invention by the same means, they should all belong to the protection scope of the present invention. Various modifications and changes may be made to the technical solutions and/or implementations within the protection scope of the present invention.
Claims (6)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201711003145.7A CN107846365A (en) | 2017-10-24 | 2017-10-24 | A kind of load balancing based on SDN realizes system and method |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201711003145.7A CN107846365A (en) | 2017-10-24 | 2017-10-24 | A kind of load balancing based on SDN realizes system and method |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| CN107846365A true CN107846365A (en) | 2018-03-27 |
Family
ID=61663084
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN201711003145.7A Pending CN107846365A (en) | 2017-10-24 | 2017-10-24 | A kind of load balancing based on SDN realizes system and method |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN107846365A (en) |
Cited By (6)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN109451084A (en) * | 2018-09-14 | 2019-03-08 | 华为技术有限公司 | A kind of service access method and device |
| CN109495440A (en) * | 2018-09-06 | 2019-03-19 | 国家电网有限公司 | A kind of random device of Intranet dynamic security |
| CN111641724A (en) * | 2020-06-04 | 2020-09-08 | 山东汇贸电子口岸有限公司 | Application method of LVS load balancer under cloud |
| CN111970209A (en) * | 2020-07-13 | 2020-11-20 | 珠海高凌信息科技股份有限公司 | SIP service equalization system |
| CN113271260A (en) * | 2021-05-12 | 2021-08-17 | 康键信息技术(深圳)有限公司 | Load balancing processing method, device, equipment and storage medium |
| WO2022267458A1 (en) * | 2021-06-25 | 2022-12-29 | 平安科技(深圳)有限公司 | Load balancing method, apparatus and device, and storage medium |
Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN104811383A (en) * | 2015-03-19 | 2015-07-29 | 杭州华三通信技术有限公司 | Message forwarding method and equipment |
| US20160182378A1 (en) * | 2014-12-18 | 2016-06-23 | Telefonaktiebolaget L M Ericsson (Publ) | Method and system for load balancing in a software-defined networking (sdn) system upon server reconfiguration |
| CN106101298A (en) * | 2016-06-06 | 2016-11-09 | 刘昱 | Network address conversion device based on SDN and method |
| CN106850459A (en) * | 2017-02-27 | 2017-06-13 | 郑州云海信息技术有限公司 | A kind of method and device for realizing virtual network load balancing |
-
2017
- 2017-10-24 CN CN201711003145.7A patent/CN107846365A/en active Pending
Patent Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20160182378A1 (en) * | 2014-12-18 | 2016-06-23 | Telefonaktiebolaget L M Ericsson (Publ) | Method and system for load balancing in a software-defined networking (sdn) system upon server reconfiguration |
| CN104811383A (en) * | 2015-03-19 | 2015-07-29 | 杭州华三通信技术有限公司 | Message forwarding method and equipment |
| CN106101298A (en) * | 2016-06-06 | 2016-11-09 | 刘昱 | Network address conversion device based on SDN and method |
| CN106850459A (en) * | 2017-02-27 | 2017-06-13 | 郑州云海信息技术有限公司 | A kind of method and device for realizing virtual network load balancing |
Cited By (7)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN109495440A (en) * | 2018-09-06 | 2019-03-19 | 国家电网有限公司 | A kind of random device of Intranet dynamic security |
| CN109451084A (en) * | 2018-09-14 | 2019-03-08 | 华为技术有限公司 | A kind of service access method and device |
| CN109451084B (en) * | 2018-09-14 | 2020-12-22 | 华为技术有限公司 | A service access method and device |
| CN111641724A (en) * | 2020-06-04 | 2020-09-08 | 山东汇贸电子口岸有限公司 | Application method of LVS load balancer under cloud |
| CN111970209A (en) * | 2020-07-13 | 2020-11-20 | 珠海高凌信息科技股份有限公司 | SIP service equalization system |
| CN113271260A (en) * | 2021-05-12 | 2021-08-17 | 康键信息技术(深圳)有限公司 | Load balancing processing method, device, equipment and storage medium |
| WO2022267458A1 (en) * | 2021-06-25 | 2022-12-29 | 平安科技(深圳)有限公司 | Load balancing method, apparatus and device, and storage medium |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN107846365A (en) | A kind of load balancing based on SDN realizes system and method | |
| CN105610632B (en) | A kind of virtual network device and related method | |
| CN103746911B (en) | A kind of SDN structure and its communication means | |
| CA2968964C (en) | Source ip address transparency systems and methods | |
| US10148565B2 (en) | OPENFLOW communication method and system, controller, and service gateway | |
| CN103634364B (en) | A kind of system for realizing remote desktop, method, client and service centre | |
| CN102638582B (en) | Data communicating method and communication end | |
| CN102523207A (en) | VNC (Virtual Network Computer)-based remote resource access method and proxy device | |
| CN110609746A (en) | Method, apparatus and computer program product for managing network system | |
| US10230795B2 (en) | Data replication for a virtual networking system | |
| CN109040232A (en) | Load balancing method, device and equipment for video conference and storage medium thereof | |
| CN102369714A (en) | Method for cloud terminal to access cloud server in cloud computing system and cloud computing system | |
| CN108200158A (en) | request transmission system, method, device and storage medium | |
| CN110545230A (en) | Method and apparatus for forwarding VXLAN packets | |
| US20070226745A1 (en) | Method and system for processing a service request | |
| CN113726881B (en) | Communication connection establishment method, related device and computer readable storage medium | |
| CN112637285B (en) | Edge cloud communication method, management system, computer equipment and storage medium | |
| CN115460213B (en) | A business processing method, device, electronic device and computer readable medium | |
| CN102263808B (en) | Session control service method, device and system | |
| CN115883559A (en) | Stateless network load balancing method, device and storage medium | |
| CN1863202B (en) | Method for improving load balance apparatus and server processing performance | |
| JP7384952B2 (en) | Network load balancer, request message allocation method, program products and systems | |
| CN103051679B (en) | Data transmission method and interface equipment, cloud optimal control equipment | |
| KR101382177B1 (en) | Dynamic Message Routing System and Method | |
| CN113132248A (en) | Load balancing method, equipment and system |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| PB01 | Publication | ||
| PB01 | Publication | ||
| SE01 | Entry into force of request for substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| RJ01 | Rejection of invention patent application after publication | ||
| RJ01 | Rejection of invention patent application after publication |
Application publication date: 20180327 |