WO2023116165A1 - 网络负载均衡方法、装置、电子设备、介质和程序产品 - Google Patents

网络负载均衡方法、装置、电子设备、介质和程序产品 Download PDF

Info

Publication number
WO2023116165A1
WO2023116165A1 PCT/CN2022/126674 CN2022126674W WO2023116165A1 WO 2023116165 A1 WO2023116165 A1 WO 2023116165A1 CN 2022126674 W CN2022126674 W CN 2022126674W WO 2023116165 A1 WO2023116165 A1 WO 2023116165A1
Authority
WO
WIPO (PCT)
Prior art keywords
message
information
load balancing
packet
device information
Prior art date
Application number
PCT/CN2022/126674
Other languages
English (en)
French (fr)
Inventor
房若民
Original Assignee
北京字节跳动网络技术有限公司
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by 北京字节跳动网络技术有限公司 filed Critical 北京字节跳动网络技术有限公司
Publication of WO2023116165A1 publication Critical patent/WO2023116165A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/10Flow control; Congestion control
    • H04L47/12Avoiding congestion; Recovering from congestion
    • H04L47/125Avoiding congestion; Recovering from congestion by balancing the load, e.g. traffic engineering
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/08Protocols for interworking; Protocol conversion
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/22Parsing or analysis of headers
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/08Key distribution or management, e.g. generation, sharing or updating, of cryptographic keys or passwords

Definitions

  • the present disclosure relates to the technical field of communications, and in particular to a network load balancing method, device, electronic equipment, media and program product.
  • Multi-Path Transmission Control Protocol defines a way to establish a connection between two hosts, allowing the connection to use multiple paths at the same time, where MPTCP is on each path that needs to be used Create a sub-connection.
  • a network load balancing device determines a target server from a server set through a load balancing algorithm, and sends a message to the target server.
  • the present disclosure provides a network load balancing method, device, electronic equipment, medium and program product.
  • a first aspect of the present disclosure provides a network load balancing method, the method comprising:
  • the first message includes: first source device information, first destination device information, sub-flow identification information belonging to the multiplex transmission control protocol MPTCP type, and verification information, and the verification information uses To indicate the main stream corresponding to the sub-stream identified by the sub-stream identification information;
  • the determining the packet conversion rule according to the verification information and the target flow of the first packet includes:
  • the target flow characterization message of the first message needs to be sent to the load balancing device, then determine the target server corresponding to the mainstream according to the verification information, and determine that the message conversion rule is used to convert the first message
  • the first target device information in the text is converted into the device information of the target server;
  • the target flow indication message of the first message needs to be sent to the client, determine that the message conversion rule is used to convert the first source device information in the first message into the load balancing device information Device Information.
  • the method before determining the target flow of the first message according to the information of the first destination device, the method further includes:
  • the message conversion rule includes: if the target flow direction representation message of the first message needs to be sent to a load balancing device, Then convert the first destination device information in the first message into the device information of the target server; if the target flow indication message of the first message needs to be sent to the client, then the first The first source device information in the packet is converted into device information of the load balancing device.
  • before receiving the first message it also includes:
  • control information sent by the load balancing device where the control information includes: the verification information and the device information of the target server;
  • the control information is stored in the database.
  • the packet conversion rule corresponding to the verification information after generating the packet conversion rule corresponding to the verification information according to the device information of the target server, it further includes:
  • a timer is started, and after the timer expires, the packet conversion rule is deleted.
  • the network load balancing method is performed by a virtual switch corresponding to the client.
  • a second aspect of the present disclosure provides a network load balancing method, the method comprising:
  • connection establishment response including: the mainstream identification information belonging to the multiplex transmission control protocol MPTCP type, the device information and the key of the target server;
  • control message Generate a control message according to the verification information and the device information of the target server, where the control message includes: the verification information and the device information of the target server;
  • the network load balancing method is performed by a load balancing device.
  • a third aspect of the present disclosure provides a network load balancing device, the device comprising:
  • a receiving module configured to receive a first message, the first message including: first source device information, first destination device information, sub-flow identification information belonging to the multiplex transmission control protocol MPTCP type, and verification information, The verification information is used to indicate the main stream corresponding to the sub-stream identified by the sub-stream identification information;
  • a processing module configured to determine the target flow of the first message according to the information of the first destination device; and determine a message conversion rule according to the verification information and the target flow of the first message, the message The conversion rule is used to direct the sub-flow and the main stream to the same target server; and based on the message conversion rule, perform the first source device information or the first destination device information in the first message Converting to obtain a second message, where the second message includes second source device information and second destination device information;
  • a sending module configured to send the second message to the second destination device according to the second destination device information in the second message.
  • a fourth aspect of the present disclosure provides a network load balancing device, the device comprising:
  • the receiving module is configured to receive a connection establishment response, which includes: mainstream identification information belonging to the multiplex transmission control protocol MPTCP type, device information and keys of the target server;
  • a processing module configured to generate verification information according to the key; and generate a control message according to the verification information and device information of the target server, where the control message includes: the verification information and the target server device information;
  • a sending module configured to send the control packet to the virtual switch corresponding to the client, so that the virtual switch generates a packet conversion rule based on the control packet, so as to direct the subflow corresponding to the main flow to the target server .
  • a fifth aspect of the present disclosure provides an electronic device, comprising: one or more processors; memory; and one or more computer programs; wherein the one or more computer programs are stored in the memory; the one When the one or more processors execute the one or more computer programs, the electronic device implements the network load balancing method according to any one of the first aspect or the network load balancing method according to the second aspect.
  • a sixth aspect of the present disclosure provides a computer storage medium, including computer instructions.
  • the computer instructions When the computer instructions are run on an electronic device, the electronic device executes the network load balancing method as described in any one of the first aspect or as described in The network load balancing method described in the second aspect.
  • a seventh aspect of the present disclosure provides a computer program product.
  • the computer program product runs on a computer, the computer executes the method as described in any one of the first aspect or the network load as described in the second aspect. balanced approach.
  • An eighth aspect of the present disclosure provides a network load balancing system, including: a virtual switch, corresponding to a client, configured to execute the network load balancing method according to any one of the claims in the first aspect.
  • the network load balancing system further includes: a load balancing device configured to execute the network load balancing method according to any one of the second aspect.
  • FIG. 1 is a schematic structural diagram of a load balancing system provided by the present disclosure
  • FIG. 2 is a schematic flowchart of an embodiment of a network load balancing method provided by the present disclosure
  • FIG. 3 is a schematic flowchart of another embodiment of a load balancing method provided by the present disclosure.
  • FIG. 4 is a schematic flowchart of another embodiment of a network load balancing method provided by the present disclosure.
  • FIG. 5 is a schematic flowchart of another embodiment of a load balancing method provided by the present disclosure.
  • FIG. 6 is a schematic flowchart of another embodiment of a load balancing method provided by the present disclosure.
  • FIG. 7 is a schematic flowchart of another embodiment of a load balancing method provided by the present disclosure.
  • FIG. 8 is a schematic structural diagram of a network load balancing device provided by the present disclosure.
  • FIG. 9 is a schematic structural diagram of another network load balancing device provided by the present disclosure.
  • TCP Transmission Control Protocol
  • IP Internet Protocol
  • MPTCP defines a way to establish a connection between two hosts, not between two interfaces. MPTCP allows connections to use multiple paths simultaneously, maximizing channel resource usage. Among them, MPTCP creates a subflow TCP connection on each path that needs to be used.
  • host A and host B uses host A and host B to establish an MPTCP connection as an example to illustrate how to establish an MPTCP connection.
  • host A has two addresses, namely address A1 and address A2, and the address of host B is address B1.
  • Host A sends a data packet (SYN) to host B's address B1 through address A1.
  • This data packet is the same as that sent when TCP establishes a connection, except that the MPTCP identification information (MP_CAPABLE) and a key A generated by host A are added.
  • MP_CAPABLE MPTCP identification information
  • the key A is used for verification when the sub-connection is subsequently established. Therefore, the key generated by the host A is different each time the MPTCP main connection is established).
  • Host B sends a data packet (SYN+ACK) to host A's address A1 through address B1, which also includes MPTCP identification information (MP_CAPABLE) and a key B generated by host B.
  • SYN+ACK data packet
  • MP_CAPABLE MPTCP identification information
  • Host A sends a data packet (ACK) to host B's address B1 through address A1, which contains MPTCP identification information (MP_CAPABLE), key A, and key B. At this time, host A and host B establish a main connection.
  • ACK data packet
  • MP_CAPABLE MPTCP identification information
  • Host A sends a data packet (SYN) to host B's address B1 through address A2, which includes subflow identification information (MP_JOIN), authentication information (Token) and random number A.
  • SYN data packet
  • MP_JOIN subflow identification information
  • Token authentication information
  • Token is the hash value of key B when the previous main connection is established, and random number A is generated by host A.
  • Host B sends a data packet SYN/ACK to host A's address A2 through address B1, which contains subflow identification information (MP_JOIN), authentication information (HMAC-B) and random number B, where HMAC-B consists of random number A and The random number B is obtained by performing a hash operation, and the random number B is generated by the host B.
  • MP_JOIN subflow identification information
  • HMAC-B authentication information
  • Host A sends a data packet (ACK) to host B's address B1 through address A2, which contains verification information (HMAC-A), where HMAC-A is obtained by hashing random number A and random number B.
  • ACK data packet
  • HMAC-A verification information
  • the host B sends a data packet (ACK) to the address A2 of the host A through the address B1, and at this time, the establishment of the sub-connection is completed.
  • ACK data packet
  • Load balancing is often required in the data center. Load balancing can form multiple servers into a server set, and through load sharing technology, distribute external requests to one of the servers in the server set. The server that receives the request Independently respond to client requests. Network load balancing solves the problem of a large number of concurrent access services by distributing client requests to different servers.
  • Network load balancing is divided into layer 4 load balancing and layer 7 load balancing according to the different layers defined in the OSI model.
  • Layer 4 load balancing can also be divided into TCP and UDP according to the protocols it supports. Among them, TCP type load balancing is used for load balancing of TCP type requests.
  • MPTCP for data center load balancing can effectively improve load balancing performance.
  • FIG. 1 is a schematic diagram of the architecture of a load balancing system provided by the present disclosure.
  • the load balancing system may include: a client 10, a virtual switch 20, a load balancing device 30, a virtual switch 40, a server 50, and a virtual switch 60 and server 70.
  • the virtual switch 20 may be referred to as a virtual switch of the client 10 .
  • the virtual switch 40 may be referred to as a virtual switch of the server 50 .
  • the virtual switch 60 may be referred to as a virtual switch of the server 70 .
  • the client 10 can be connected to one or more load balancing devices through the virtual switch 20 , and a load balancing device 30 is shown as an example in FIG. 1 .
  • the load balancing device 30 can be connected to multiple servers, and each server is connected to the load balancing device 30 through a virtual switch, as shown in Fig. 40 is connected to the load balancing device 30 , and the server 70 is connected to the load balancing device 30 through the virtual switch 60 .
  • the mobile phone can include two ways of accessing the Internet, cellular mobile data network (including 2G, 3G, 4G or 5G network, etc.) and WIFI network. Users hope to use WIFI as much as possible when WIFI is available, which can save costs, and automatically switch to cellular mobile network when there is no WIFI to avoid disconnection. In this way, an MPTCP connection can be established between the mobile phone and the server. The mobile phone can establish an MPTCP main connection with the server through the WIFI network, and then establish an MPTCP sub-connection with the same server through the cellular mobile data network.
  • the load balancing device 30 actually faces the client 10.
  • the client 10 needs to access a certain service, it sends an MPTCP main connection establishment request to the load balancing device 30 through the virtual switch 20, and the load balancing The device 30 will use it as a request to establish a TCP connection, and select a server from the server 50 and the server 70 according to the load balancing scheduling algorithm, assuming that the server 50 is selected so that the server 50 establishes a connection with the client 10, and the main connection is successfully established .
  • the client 10 when it needs to establish an MPTCP sub-connection, it sends an MPTCP connection establishment request to the load balancing device 30 through the virtual switch 20, and the load balancing device 30 will still use it as a request for establishing a TCP connection, and the load balancing device 30 will send it
  • a server is selected from the server 50 and the server 70, and there is a possibility that the load balancing device 30 selects the server 70, so that the access cannot be performed.
  • the present disclosure provides a network load balancing method. After the virtual switch corresponding to the client in the present disclosure determines that the packet belongs to the subflow according to the subflow identification information contained in the packet, according to the verification information in the packet Determine the main flow corresponding to the sub-flow, and direct the sub-flow to the same target server as the main flow based on the device information of the target server corresponding to the main flow obtained from the load balancing device, so that the sub-flow and the main flow can be directed to the same target server, ensuring normal access.
  • FIG. 2 is a schematic flowchart of an embodiment of a network load balancing method provided by the present disclosure. As shown in FIG. 2 , the method of this embodiment is executed by the virtual switch corresponding to the client, and the method of this embodiment is as follows:
  • S201 Receive a first packet.
  • the first packet includes: first source device information, first destination device information, sub-flow identification information belonging to the MPTCP type, and verification information.
  • the verification information is used to indicate the main stream corresponding to the sub-stream identified by the sub-stream identification information.
  • the first source device information may include a source address and a source port number.
  • the first destination device information may include a destination address and a destination port number.
  • the subflow identification information belonging to the MPTCP type is used to identify that the first packet belongs to the subflow of the MPTCP type.
  • the subflow identification information may be, for example, the above-mentioned MP_JOIN. According to the subflow identification information, it can be determined that the packet belongs to the subflow.
  • the verification information can uniquely identify a main stream, for example, the above-mentioned Token. Therefore, the main stream corresponding to the sub-stream can be determined according to the verification information.
  • the first packet received by the virtual switch corresponding to the client may be from the client or from the target server.
  • the first message may be a message for establishing a connection, or a message for data transmission, and the technical solution of the present disclosure may be applied.
  • S203 Determine a target flow of the first packet according to the first destination device information.
  • the target flow of the first message can be determined according to the first destination device information carried in the first message, including the following two situations:
  • the first destination device information of the first packet is the device information of the load balancing device, it means that the first packet needs to be sent to the load balancing device, that is, the target flow of the first packet is to be sent to the load balancing device.
  • the target flow may also be described as being sent to the load balancing device as an outbound direction.
  • the target flow that is sent to the client may also be described as inbound or forward, which is not limited in the present disclosure.
  • S205 Determine a packet conversion rule according to the verification information and the target flow of the first packet, where the packet conversion rule is used to direct the subflow and the main flow to the same target server.
  • the packet conversion rules corresponding to the main flow include: two flow directions (above Outbound and inbound) packet conversion rules, therefore, the packet conversion rules that the first packet needs to adopt can be determined based on the target flow of the first packet, and the subflow and the main flow can be directed to the same destination through the packet conversion rules server.
  • S207 Convert the first source device information or the first destination device information in the first message based on the message conversion rule to obtain a second message, the second message including the second source Device information and second destination device information.
  • one situation is: if the target flow characterization message of the first message needs to be sent to the load balancing device, then determine the target server corresponding to the main stream according to the verification information, and determine the message conversion rule and converting the first destination device information in the first packet into device information of the target server. That is, by replacing the destination address in the first packet with the device information of the load balancing device with the device information of the target server corresponding to the main stream, the sub-flow and the main stream can be directed to the same target server.
  • Another situation is: if the target flow characterization message of the first message needs to be sent to the client, determine that the message conversion rule is used to convert the first source device information in the first message into Device information of the load balancing device. That is, by converting the source address in the first packet from the device information of the target server to the device information of the load balancing device.
  • S209 Send the second packet to the second destination device according to the second destination device information in the second packet.
  • the first message needs to be sent to the load balancing device, it can be directly sent to the target server corresponding to the main flow according to the operation of S207, ensuring that the sub-flow and the main flow are directed to the same target server, and there is no need to go through load balancing in this process device, which reduces the burden on the load balancing device.
  • the device information of the target server can be changed to the device information of the load balancing device to ensure that the client can parse the packet normally.
  • the virtual switch of the client after receiving the first message sent by the client, determines the target flow direction of the first message according to the destination device information in the first message, based on the verification information carried in the first message and The target flow direction of the first message determines the message conversion rule, and converts the source device information or the destination device information in the first message based on the message conversion rule to obtain the second message, according to the destination device in the second message The information sends the second message to the second destination device.
  • the packet conversion rule can direct the sub-flow and the main stream to the same target server, so that the sub-flow and the main stream can be directed to the same target server, ensuring normal access.
  • the subflow does not need to pass through the load balancing device, which reduces the burden on the load balancing device and improves the system capacity.
  • Fig. 3 is a schematic flowchart of another embodiment of a load balancing method provided by the present disclosure.
  • Fig. 3 is based on the embodiment shown in Fig. 2 , further, before S203, it also includes:
  • S2021 Determine that the first packet is a subflow according to the subflow identification information of the MPTCP type.
  • the packet contains subflow identification information belonging to the MPTCP type, then it is determined that the first packet is a subflow.
  • the verification information can uniquely identify a mainstream, and the target server corresponding to the mainstream is recorded in the database, based on the verification information, the target server corresponding to the mainstream can be obtained from the database.
  • S2023 Generate the packet conversion rule corresponding to the verification information according to the device information of the target server.
  • the packet conversion rule includes: if the target flow direction representation packet of the first packet needs to be sent to the load balancing device, convert the first destination device information in the first packet into the target The device information of the server; if the target flow indication message of the first message needs to be sent to the client, converting the first source device information in the first message into the device information of the load balancing device.
  • the first packet is determined to be a subflow according to the subflow identification information of the MPTCP type, and then, according to the verification information, the target server corresponding to the mainstream direction of the verification information is obtained from the database, and the device based on the target server
  • the information generates and verifies the message conversion rules corresponding to the information, so that in the subsequent process of message transmission, the sub-flow and the main flow can be directed to the same target server based on the message conversion rules, ensuring normal access.
  • the message conversion rule after generating the message conversion rule, it further includes: starting a timer, and deleting the message conversion rule when the timer expires.
  • FIG. 4 is a schematic flowchart of another embodiment of a network load balancing method provided by the present disclosure.
  • FIG. 4 is based on the embodiment shown in FIG. 3 , and further includes:
  • the control information includes: the verification information and the device information of the target server.
  • the load balancing device receives the connection establishment response sent by the target server.
  • the connection establishment response includes: the mainstream identification information belonging to the MPTCP type, the device information and the key of the target server; Generating verification information with the key; and generating a control message according to the verification information and the device information of the target server, where the control message includes: the verification information and the device information of the target server;
  • the corresponding virtual switch sends the control packet, so that the virtual switch generates a packet conversion rule based on the control packet, so as to direct the subflow corresponding to the main flow to the same target server.
  • the virtual switch corresponding to the client After receiving the control information, the virtual switch corresponding to the client stores the control information in the database, so as to generate a packet conversion rule based on the packet control information after receiving the subflow.
  • the virtual switch corresponding to the client can be based on the control message Generate packet conversion rules to direct the sub-flows corresponding to the main flow to the same target server to ensure normal access.
  • FIG. 5 is a schematic flowchart of another embodiment of a load balancing method provided by the present disclosure.
  • this embodiment includes: a client 10, a virtual switch 20, a load balancing device 30, a virtual switch 40, and a server 50 , a virtual switch 60 and a server 70.
  • the virtual switch 20 is a virtual switch of the client 10 .
  • the virtual switch 40 is a virtual switch of the server 50 .
  • the virtual switch 60 may be a virtual switch of the server 70 .
  • the client 10 sends a first packet to the virtual switch 20.
  • the first message includes the TCP connection from the IP address 1 and port number 1 of the client 10 to the IP address 2 and port number 2 of the load balancing device 30 , MP_JOIN and token.
  • MP_JOIN corresponds to sub-flow identification information belonging to the MPTCP type
  • token is verification information
  • IP address 2 and port number 2 of the load balancing device 30 correspond to the information of the first destination device.
  • the virtual switch 20 determines according to the MP_JOIN that the first message belongs to the subflow of the MPTCP type, judges that the first target device information is the device information of the load balancing device, and then obtains the device of the target server corresponding to the Token in the database according to the carried Token information, and generate packet conversion rules based on the device information of the target server.
  • the target server corresponding to the token is the server 50 , and the device information of the server 50 ie IP address 3 and port 3 can be obtained.
  • the message conversion rules include: outbound message conversion rules and inbound message conversion rules.
  • Outgoing message conversion rules include: replacing the destination address and port number in the message with the address and port number of the target server corresponding to the mainstream;
  • the incoming packet conversion rules include: replacing the source address and source port number in the packet with the address and port number of the load balancing device.
  • source device information IP address 1 and port number 1 of client 10
  • Destination device information IP address 3 and port number 3 of server 50
  • subflow identification information MP_JOIN
  • authentication information token
  • the virtual switch 20 sends the second packet to the virtual switch 40 corresponding to the target server.
  • the first message can also be encapsulated by overlay (overlay), for example, the TCP data packet can be encapsulated using User Datagram Protocol (UDP) to obtain the second message arts.
  • overlay overlay
  • UDP User Datagram Protocol
  • the inner layer of the second message includes: the TCP connection from the IP address 1 and port number 1 of the client 10 to the IP address 3 and port number 3 of the server 50, MP_JOIN and token.
  • the second packet sent by the virtual switch 20 to the virtual switch 40 is a second packet after superposition and encapsulation.
  • the virtual switch 20 sends the second packet to the server 50.
  • the method provided in this embodiment may further include the following steps after step S505:
  • the server 50 generates a second response corresponding to the second packet.
  • the second response includes the TCP connection response, MP_JOIN and HMAC from the IP address 3 and port number 3 of the server 50 to the IP address 1 and port number 1 of the client 10 .
  • the server 50 sends a second response to the virtual switch 40.
  • the second response includes the TCP connection response, MP_JOIN and HMAC from the IP address 3 and port number 3 of the server 50 to the IP address 1 and port number 1 of the client 10 .
  • the virtual switch 40 sends a second response to the virtual switch 20.
  • the second response may also be overlay encapsulated, for example, the TCP data packet may be encapsulated using User Datagram Protocol (UDP) to obtain the second response.
  • UDP User Datagram Protocol
  • the inner layer of the updated second response includes: the TCP connection response from the IP address 3 and port number 3 of the server 50 to the IP address 1 and port number 1 of the client 10, MP_JOIN and HMAC.
  • step S508 the first connection establishment response sent by the virtual switch 40 to the virtual switch 20 is the second response after superposition and encapsulation.
  • the virtual switch 20 replaces the device information of the target server in the second response with the device information of the load balancing device according to the incoming packet conversion rule, to obtain the first response.
  • the IP address 3 and port number 3 of the server 50 in the second response are updated to the IP address 2 and port number 2 of the load balancing device 30 to obtain the first response.
  • the first response includes: source device information: IP address 2 of load balancing device 30, destination device information: port number 2 to IP address 1 and port number 1 of client 10, subflow identifier MP_JOIN and HMAC belonging to MPTCP .
  • the virtual switch 20 sends a first response to the client 10.
  • the sub-flow and the main stream are directed to the same target server, which ensures the normal progress of the access, and does not require the participation of the load balancing device in this process, which reduces the burden of the load balancing device and improves the system capacity.
  • S601 The client 10 sends a first packet to the virtual switch 20.
  • the first message includes: source device information: IP address 4 and port number 4 of the client 10, destination device information: IP address 2 and port number 2 of the load balancing device 30, mainstream identification information belonging to the MPTCP type ( MP_CAPABLE) and key (key1).
  • the virtual switch 20 sends the first packet to the load balancing device 30.
  • the virtual switch 20 encapsulates the first packet and sends it to the load balancing device.
  • the load balancing device 30 sends the updated first packet to the virtual switch 40.
  • the load balancing device 30 selects the target server according to the load balancing policy, assuming that the server 50 is selected. Replace the IP address 2 and port number 2 of the load balancing device 30 with the IP address 3 and port number 3 of the server 50 .
  • the load balancing device 30 sends the updated first packet to the virtual switch 40 .
  • the virtual switch 40 sends the updated first packet to the server 50.
  • the server 50 sends a first response to the virtual switch 40.
  • the first response includes: source device information: IP address 3 and port number 3 of the server 50, destination device information: IP address 4 and port number 4 of the client 10, mainstream identification information (MP_CAPABLE) belonging to the MPTCP type and Key key2.
  • source device information IP address 3 and port number 3 of the server 50
  • destination device information IP address 4 and port number 4 of the client 10
  • mainstream identification information MP_CAPABLE belonging to the MPTCP type and Key key2.
  • the virtual switch 40 sends a first response to the load balancing device 30.
  • the first response includes: source address: IP address 3 and port number 3 of server 50, TCP connection of IP address 4 and port number 4 of client 10, mainstream identification information (MP_CAPABLE) and key2 belonging to MPTCP type.
  • the load balancing device 30 sends a second response to the virtual switch 20.
  • the load balancing device converts the source device information in the first response, and encapsulates the first response to obtain the second response.
  • the load balancing device 30 updates the IP address 3 and port number 3 of the server 50 in the first response to the IP address 2 and port number 2 of the load balancing device 30 to obtain a second response.
  • the second response includes: source device information: IP address 2 and port number 2 of the load balancing device 30, destination device information: IP address 4 and port number 4 of the client 10, mainstream identification information (MP_CAPABLE) and key2 belonging to the MPTCP type .
  • the virtual switch 20 sends a second response to the client 10.
  • S609 The virtual switch 20 of the client learns the device information of the target server through the load balancing device.
  • S610 The client 10 sends a packet to the virtual switch 20.
  • the message includes: source device information, destination device information, sub-flow identification information belonging to the MPTCP type, and verification information.
  • source device information IP address 4 and port number 4 of client 10
  • destination device information IP address 2 and port number 2 of load balancing device 30
  • mainstream identification information MP_JOIN
  • Token verification information
  • the virtual switch 20 replaces the target device information with the device information of the target server according to the learned device information of the target server, and performs encapsulation to obtain an updated message.
  • the updated message includes: source device information, destination device information, sub-flow identification information belonging to the MPTCP type, and verification information.
  • Source device information IP address 4 and port number 4 of the client 10
  • destination device information IP address 3 and port number 3 of the server 50
  • sub-flow identification information MP_JOIN
  • verification information token
  • S613 The virtual switch 40 decapsulates the packet and sends it to the server 50.
  • the server 50 After receiving the message, the server 50 associates the message according to the sub-flow identification information and verification information.
  • S615 The server 50 sends a response to the virtual switch 40.
  • the response includes: source device information, destination device information, subflow identification information belonging to the MPTCP type, and HMAC of the virtual switch 40 .
  • S616 The virtual switch 40 sends a response to the virtual switch 20 of the client.
  • the virtual switch 40 encapsulates the response and sends it to the virtual switch 20 .
  • S617 The virtual switch 20 performs address translation and sends a response to the client 10.
  • the IP address 3 and port number 3 of the server 50 in the response are updated to the IP address 2 and port number 2 of the load balancing device 30, and an updated response is obtained.
  • the updated response includes: source device information: IP address 2 of load balancing device 30, destination device information: port number 2 to IP address 1 and port number 1 of client 10, subflow identifier MP_JOIN and HMAC belonging to MPTCP.
  • the client virtual machine learns the device information of the target server through the load balancing device, so that after receiving the sub-flow, the virtual switch corresponding to the client can, according to the stored control information Direct the substream and the main stream to the same target server.
  • the load balancing device 30 generates control information.
  • the load balancing device determines that the client and the server try to establish an MPTCP session according to the mainstream identification information belonging to the MPTCP type in the first response, and calculates the verification information Token according to the key2 carried in the message replied by the virtual switch 40, and the Token can uniquely identify In this session, control information is generated based on the device information of the server 50 and the calculated authentication information.
  • the load balancing device 30 sends the control information to the virtual switch 20.
  • the virtual switch 20 stores the control information in a database.
  • the load balancing device learns the device information of the target server, generates control information based on the device information of the target server and the obtained verification information, and sends the control information to the virtual switch corresponding to the client. Therefore, after receiving the sub-flow, the virtual switch corresponding to the client can direct the sub-flow and the main flow to the same target server according to the stored control information.
  • FIG. 8 is a schematic structural diagram of a network load balancing device provided by the present disclosure. As shown in FIG. 8 , the device of this embodiment includes: a receiving module 801 , a processing module 802 and a sending module 803 .
  • the receiving module 801 is configured to receive a first message, the first message including: first source device information, first destination device information, sub-flow identification information belonging to the multiplex transmission control protocol MPTCP type, and verification information , the verification information is used to indicate the main stream corresponding to the sub-stream identified by the sub-stream identification information;
  • a processing module 802 configured to determine a target flow of the first message according to the first destination device information; determine a message conversion rule according to the verification information and the target flow of the first message, and the message The conversion rule is used to direct the sub-flow and the main stream to the same target server; based on the message conversion rule, the first source device information or the first destination device information in the first message is converted , obtaining a second message, where the second message includes second source device information and second destination device information;
  • a sending module 803, configured to send the second message to the second destination device according to the second destination device information in the second message.
  • the processing module 802 is specifically configured to determine the target server corresponding to the mainstream according to the verification information if the target flow characterization message of the first message needs to be sent to the load balancing device, and determine The message conversion rule is used to convert the first destination device information in the first message into the device information of the target server; if the target flow direction of the first message indicates that the message needs to be sent to the client , determining that the packet conversion rule is used to convert the first source device information in the first packet into device information of the load balancing device.
  • the processing module 802 is further configured to determine that the first packet is a subflow according to the subflow identification information of the MPTCP type; obtain the corresponding subflow of the verification information from the database according to the verification information The target server directed by the mainstream; generate the message conversion rule corresponding to the verification information according to the device information of the target server, and the message conversion rule includes: if the target flow of the first message indicates that the message requires Sending to the load balancing device, converting the first destination device information in the first message into the device information of the target server; if the target flow direction representation message of the first message needs to be sent to the client, Then convert the first source device information in the first packet into the device information of the load balancing device.
  • the receiving module 801 is further configured to receive control information sent by a load balancing device, where the control information includes: the verification information and the device information of the target server;
  • the processing module 802 is also configured to store the control information in the database.
  • the processing module 802 is further configured to start a timer, and delete the packet conversion rule after the timer expires.
  • the device in this embodiment corresponds to the steps performed by the virtual switch corresponding to the client in the above method embodiments, and its implementation principle and technical effect are similar, and will not be repeated here.
  • FIG. 9 is a schematic structural diagram of another network load balancing device provided by the present disclosure. As shown in FIG. 9 , the device of this embodiment includes: a receiving module 901 , a processing module 902 and a sending module 903 .
  • the receiving module 901 is configured to receive a connection establishment response, which includes: mainstream identification information belonging to the multiplex transmission control protocol MPTCP type, device information and keys of the target server;
  • the processing module 902 is configured to generate verification information according to the key; and generate a control message according to the verification information and the device information of the target server, and the control message includes: the verification information and the target server device information;
  • the sending module 903 is configured to send the control packet to the virtual switch corresponding to the client, so that the virtual switch generates a packet conversion rule based on the control packet, so as to direct the subflow corresponding to the main flow to the target server .
  • the apparatus in this embodiment can be used to execute the steps performed by the load balancing device in the foregoing method embodiments, and its implementation principles and technical effects are similar, and will not be repeated here.
  • An embodiment of the present disclosure provides an electronic device, including: one or more processors; memory; and one or more computer programs; wherein one or more computer programs are stored in the memory; one or more processors are executing One or more computer programs enable the electronic device to implement the above-mentioned method.
  • An embodiment of the present disclosure provides a computer storage medium, including computer instructions.
  • the computer instructions When the computer instructions are run on an electronic device, the electronic device is made to execute the above method.
  • An embodiment of the present disclosure provides a computer program product, which enables the computer to execute the above method when the computer program product is run on the computer.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Security & Cryptography (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

提供一种网络负载均衡方法、装置、电子设备、介质和程序产品。客户端的虚拟交换机接收到客户端发送的第一报文后,根据第一报文中的目的设备信息确定第一报文的目标流向,基于第一报文中携带的验证信息以及第一报文的目标流向确定报文转换规则,基于报文转换规则对第一报文中的源设备信息或者目的设备信息进行转换,得到第二报文,根据第二报文中的目的设备信息向第二目的设备发送第二报文,从而,使得子流与主流能够定向到同一目标服务器,确保了访问的正常进行。

Description

网络负载均衡方法、装置、电子设备、介质和程序产品
相关申请的交叉引用
本申请是以中国申请号为202111571274.2,申请日为2021年12月21日、题目为“网络负载均衡方法、装置、电子设备、介质和程序产品”的申请为基础,并主张其优先权,该中国申请的公开内容在此作为整体引入本申请中。
技术领域
本公开涉及通信技术领域,尤其涉及一种网络负载均衡方法、装置、电子设备、介质和程序产品。
背景技术
多路传输控制协议(Multi-Path Transmission Control Protocol,简称MPTCP)定义了一种在两个主机之间建立连接的方式,允许连接同时使用多个路径,其中,MPTCP在每个需要使用的路径上创建一个子连接。
相关技术中,网络负载均衡设备通过负载均衡算法从服务器集合中确定目标服务器,并将报文发送至目标服务器。
发明内容
本公开提供了一种网络负载均衡方法、装置、电子设备、介质和程序产品。
本公开第一方面提供一种网络负载均衡方法,所述方法包括:
接收第一报文,所述第一报文中包括:第一源设备信息、第一目的设备信息、属于多路传输控制协议MPTCP类型的子流标识信息、以及验证信息,所述验证信息用于指示所述子流标识信息标识的子流对应的主流;
根据所述第一目的设备信息确定所述第一报文的目标流向;
根据所述验证信息以及所述第一报文的目标流向确定报文转换规则,所述报文转换规则用于将所述子流与所述主流定向到同一目标服务器;
基于所述报文转换规则对所述第一报文中的第一源设备信息或者所述第一目的设备信息进行转换,得到第二报文,所述第二报文包括第二源设备信息和第二目的设备信息;
根据所述第二报文中的第二目的设备信息向第二目的设备发送所述第二报文。
在一些实施例中,所述根据所述验证信息以及所述第一报文的目标流向确定报文转换规则,包括:
若所述第一报文的目标流向表征报文需要发送至负载均衡设备,则根据所述验证信息确定所述主流对应的目标服务器,确定所述报文转换规则用于将所述第一报文中的第一目的设备信息转换为所述目标服务器的设备信息;
若所述第一报文的目标流向表征报文需要发送至客户端,确定所述报文转换规则用于将所述第一报文中的第一源设备信息转换为所述负载均衡设备的设备信息。
在一些实施例中,所述根据所述第一目的设备信息确定所述第一报文的目标流向之前,还包括:
根据所述MPTCP类型的子流标识信息确定所述第一报文为子流;
根据所述验证信息从数据库中获取所述验证信息对应的主流定向的目标服务器;
根据所述目标服务器的设备信息生成所述验证信息对应的所述报文转换规则,所述报文转换规则包括:若所述第一报文的目标流向表征报文需要发送至负载均衡设备,则将所述第一报文中的第一目的设备信息转换为所述目标服务器的设备信息;若所述第一报文的目标流向表征报文需要发送至客户端,则将所述第一报文中的第一源设备信息转换为所述负载均衡设备的设备信息。
在一些实施例中,所述接收第一报文之前,还包括:
接收负载均衡设备发送的控制信息,所述控制信息中包括:所述验证信息以及所述目标服务器的设备信息;
将所述控制信息存储于所述数据库中。
在一些实施例中,所述根据所述目标服务器的设备信息生成所述验证信息对应的所述报文转换规则之后,还包括:
启动定时器,定时器到时后,删除所述报文转换规则。
在一些实施例中,所述网络负载均衡方法由与客户端对应的虚拟交换机执行。
本公开第二方面提供一种网络负载均衡方法,所述方法包括:
接收连接建立响应,所述连接建立响应中包括:属于多路传输控制协议MPTCP类型的主流标识信息、目标服务器的设备信息和密钥;
根据所述密钥生成验证信息;
根据所述验证信息和所述目标服务器的设备信息生成控制报文,所述控制报文中包括:所述验证信息和所述目标服务器的设备信息;
向客户端对应的虚拟交换机发送所述控制报文,以使所述虚拟交换机基于所述控制报文生成报文转换规则,以将主流对应的子流定向至所述目标服务器。
在一些实施例中,所述网络负载均衡方法由负载均衡设备执行。
本公开第三方面提供一种网络负载均衡装置,所述装置包括:
接收模块,用于接收第一报文,所述第一报文中包括:第一源设备信息、第一目的设备信息、属于多路传输控制协议MPTCP类型的子流标识信息、以及验证信息,所述验证信息用于指示所述子流标识信息标识的子流对应的主流;
处理模块,用于根据所述第一目的设备信息确定所述第一报文的目标流向;并根据所述验证信息以及所述第一报文的目标流向确定报文转换规则,所述报文转换规则用于将所述子流与所述主流定向到同一目标服务器;并基于所述报文转换规则对所述第一报文中的第一源设备信息或者所述第一目的设备信息进行转换,得到第二报文,所述第二报文包括第二源设备信息和第二目的设备信息;
发送模块,用于根据所述第二报文中的第二目的设备信息向第二目的设备发送所述第二报文。
本公开第四方面提供一种网络负载均衡装置,所述装置包括:
接收模块,用于接收连接建立响应,所述连接建立响应中包括:属于多路传输控制协议MPTCP类型的主流标识信息、目标服务器的设备信息和密钥;
处理模块,用于根据所述密钥生成验证信息;并根据所述验证信息和所述目标服务器的设备信息生成控制报文,所述控制报文中包括:所述验证信息和所述目标服务器的设备信息;
发送模块,用于向客户端对应的虚拟交换机发送所述控制报文,以使所述虚拟交换机基于所述控制报文生成报文转换规则,以将主流对应的子流定向至所述目标服务器。
本公开第五方面提供一种电子设备,包括:一个或多个处理器;存储器;以及一个或多个计算机程序;其中所述一个或多个计算机程序被存储在所述存储器中;所述一个或多个处理器在执行所述一个或多个计算机程序时,使得所述电子设备实现如第一方面任一项所述的网络负载均衡方法或者如第二方面所述的网络负载均衡方法。
本公开第六方面提供一种计算机存储介质,包括计算机指令,当所述计算机指令在电子设备上运行时,使得所述电子设备执行如第一方面任一项所述的网络负载均衡方法或者如第二方面所述的网络负载均衡方法。
本公开第七方面提供一种计算机程序产品,当所述计算机程序产品在计算机上运行时,使得所述计算机执行如第一方面任一项所述的方法或者如第二方面所述的网络负载均衡方法。
本公开第八方面提供一种网络负载均衡系统,包括:虚拟交换机,与客户端对应,被配置为执行如权利要求如第一方面任一项所述的网络均衡负载方法。
在一些实施例中,所述网络负载均衡系统还包括:负载均衡设备,被配置为执行如第二方面任一项所述的网络均衡负载方法。
附图说明
此处的附图被并入说明书中并构成本说明书的一部分,示出了符合本公开的实施例,并与说明书一起用于解释本公开的原理。
为了更清楚地说明本公开实施例或相关技术中的技术方案,下面将对实施例或相关技术描述中所需要使用的附图作简单地介绍,显而易见地,对于本领域普 通技术人员而言,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。
图1为本公开提供的一种负载均衡系统的架构示意图;
图2为本公开提供的一种网络负载均衡方法实施例的流程示意图;
图3为本公开提供的另一种负载均衡方法实施例的流程示意图;
图4为本公开提供的再一种网络负载均衡方法实施例的流程示意图;
图5为本公开的提供的又一种负载均衡方法实施例的流程示意图;
图6为本公开的提供的又一种负载均衡方法实施例的流程示意图;
图7为本公开的提供的又一种负载均衡方法实施例的流程示意图;
图8为本公开提供的一种网络负载均衡装置的结构示意图;
图9为本公开提供的另一种网络负载均衡装置的结构示意图。
具体实施方式
为了能够更清楚地理解本公开的上述目的、特征和优点,下面将对本公开的方案进行进一步描述。需要说明的是,在不冲突的情况下,本公开的实施例及实施例中的特征可以相互组合。
在下面的描述中阐述了很多具体细节以便于充分理解本公开,但本公开还可以采用其他不同于在此描述的方式来实施;显然,说明书中的实施例只是本公开的一部分实施例,而不是全部的实施例。
在标准TCP(Transmission Control Protocol,传输控制协议)中,连接应在两个网际互连协议(Internet Protocol,IP)地址之间建立。每个TCP连接由标志着源和目的地的地址和端口的四元组来标识。鉴于此限制,应用程序只能通过单个连接创建一个TCP连接,因此,会出现两个主机之间虽然可能同时建立了多个连接,但同一时刻只有单个连接被某个应用利用。
MPTCP定义了一种在两个主机之间建立连接的方式,而不是在两个接口之间建立连接的方式。MPTCP允许连接同时使用多个路径,从而最大化信道资源使用。其中,MPTCP在每个需要使用的路径上创建一个子连接(subflow)的TCP连接。
下面以主机A和主机B建立MPTCP连接为例说明MPTCP连接如何建立。 假设主机A有两个地址,分别为地址A1和地址A2,主机B的地址为地址B1。
首次建立主机A和主机B的MPTCP连接(也可以叫做主连接)时,遵守TCP的三次握手方式,与TCP三次握手方式的区别是每次发送的报文段需要添加MPTCP标识信息(MP_CAPABLE)和密钥(key)。具体如下:
主机A通过地址A1向主机B的地址B1发送数据包(SYN),该数据包和TCP建立连接时发送的一样,只不过增加了MPTCP标识信息(MP_CAPABLE),以及主机A生成的一个密钥A(密钥A用于后续建立子连接时进行验证,因此,主机A每次建立MPTCP主连接生成的密钥不同)。
主机B通过地址B1向主机A的地址A1发送数据包(SYN+ACK),其中同样包含MPTCP标识信息(MP_CAPABLE),以及主机B生成的一个密钥B。
主机A通过地址A1向主机B的地址B1发送数据包(ACK),其中包含MPTCP标识信息(MP_CAPABLE)、密钥A和密钥B,此时主机A和主机B建立了主连接。
然后若主机A需要通过地址A2与主机B的地址B1建立连接时(可以称为子连接),需经过四次握手,保证连接的安全性。具体如下:
主机A通过地址A2向主机B的地址B1发送数据包(SYN),其中包含子流标识信息(MP_JOIN)、验证信息(Token)和随机数A。其中,Token是前面主连接建立时的密钥B的哈希值,随机数A为主机A生成的。
主机B通过地址B1向主机A的地址A2发送数据包SYN/ACK,其中包含子流标识信息(MP_JOIN)、验证信息(HMAC-B)和随机数B,其中,HMAC-B由随机数A和随机数B进行哈希运算得到,随机数B为主机B生成的。
主机A通过地址A2向主机B的地址B1发送数据包(ACK),其中包含验证信息(HMAC-A),其中,HMAC-A由随机数A和随机数B进行哈希运算得到。
主机B通过地址B1向主机A的地址A2发送数据包(ACK),此时,子连接建立完成。
数据中心中常常需要进行负载均衡,负载均衡可以将多台服务器组成一个服务器集合,并通过负载分担技术,将外部发送来的请求分配到服务器集合中的某一台服务器上,接收到请求的服务器独立地回应客户端的请求。网络均衡负载通过分配客户端的请求到不同的服务器上,以解决大量并发访问服务问题。
网络负载均衡根据其工作在OSI模型中定义的不同层分为4层负载均衡与7 层负载均衡,其中4层负载均衡还可根据其支持的协议分为TCP与UDP等类型。其中TCP类型的负载均衡用来做TCP类型请求的负载分担。
使用MPTCP进行数据中心的负载均衡,能有效提高负载均衡性能。
下面结合图1说明本公开的技术方案所应用的系统。请参见图1,图1为本公开提供的一种负载均衡系统的架构示意图,负载均衡系统中可以包括:客户端10、虚拟交换机20、负载均衡设备30、虚拟交换机40、服务器50、虚拟交换机60和服务器70。其中,虚拟交换机20可以称为客户端10的虚拟交换机。虚拟交换机40可以称为服务器50的虚拟交换机。虚拟交换机60可以称为服务器70的虚拟交换机。
其中,客户端10可以为一个或多个。客户端10通过虚拟交换机20可以与一个或多个负载均衡设备连接,图1中示例性示出了一个负载均衡设备30。
其中,负载均衡设备30可以连接多个服务器,每个服务器通过虚拟交换机与负载均衡设备30连接,如图1示例性示出了两个服务器,分别为服务器50和服务器70,服务器50通过虚拟交换机40与负载均衡设备30连接,服务器70通过虚拟交换机60与负载均衡设备30连接。
下面结合图1所示的系统说明本公开的一种应用场景。以客户端10是手机为例,手机可以包含两种上网方式,蜂窝移动数据网络(其中包括2G、3G、4G或者5G网络等)和WIFI网络。用户希望在有WIFI的时候尽量使用WIFI,这样可以节省成本,没有WIFI的时候自动切换到蜂窝移动网络,避免断连。这样可以在手机和服务器之间建立MPTCP连接,手机可以通过WIFI网络与服务器建立MPTCP主连接,然后再通过蜂窝移动数据网络与同一个服务器建立MPTCP子连接。
在负载均衡场景下,实际面向客户端10的为负载均衡设备30,相关技术中,客户端10需访问某项服务时,通过虚拟交换机20向负载均衡设备30发送MPTCP主连接建立请求,负载均衡设备30会将其作为建立TCP连接的请求,根据负载均衡调度算法,从服务器50和服务器70中选择一个服务器,假设选择了服务器50,以使服务器50与客户端10建立连接,主连接建立成功。
然而,客户端10需建立MPTCP的子连接时,通过虚拟交换机20向负载均衡设备30发送MPTCP连接建立请求,负载均衡设备30依然会将其作为建立TCP连接的请求,负载均衡设备30会将其当做一个新的TCP连接进行处理,从服务 器50和服务器70中选择一个服务器,负载均衡设备30存在选择服务器70的可能性,这样,将导致访问无法进行。
然而,在MPTCP的应用场景中,需要将同一主机的MPTCP报文发送至同一目标服务器,而采用相关技术的通信方式无法实现将同一主机的MPTCP报文发送至同一目标服务器,从而导致访问异常。
为解决上述技术问题,本公开提供一种网络负载均衡方法,本公开的客户端对应的虚拟交换机根据报文中包含的子流标识信息确定报文属于子流之后,根据报文中的验证信息确定子流对应的主流,基于从负载均衡设备获取的主流对应的目标服务器的设备信息,将子流定向到与主流相同的目标服务器,从而,使得子流与主流能够定向到同一目标服务器,确保了访问的正常进行。
下面以具体的实施例进行说明本公开的技术方案。
图2为本公开提供的一种网络负载均衡方法实施例的流程示意图,如图2所示,本实施例的方法由客户端对应的虚拟交换机执行,本实施例的方法如下:
S201:接收第一报文。
其中,第一报文中包括:第一源设备信息、第一目的设备信息、属于MPTCP类型的子流标识信息、以及验证信息。
所述验证信息用于指示所述子流标识信息标识的子流对应的主流。
在一些实施例中,第一源设备信息可以包括源地址和源端口号。第一目的设备信息可以包括目的地址和目的端口号。属于MPTCP类型的子流标识信息用于标识该第一报文属于MPTCP类型的子流,子流标识信息例如可以是上述的MP_JOIN,根据子流标识信息可以确定报文属于子流。验证信息可以唯一标识一个主流,例如,可以是上述的Token,因此,根据验证信息可以确定子流对应的主流。
在一些实施例中,客户端对应的虚拟交换机接收到的第一报文可能来自于客户端,也可能来自于目标服务器。
在一些实施例中,第一报文可以是用于建立连接的报文,也可以是用于进行数据传输的报文,均可应用本公开的技术方案。
S203:根据所述第一目的设备信息确定所述第一报文的目标流向。
根据第一报文中携带的第一目的设备信息可以确定第一报文的目标流向,包括如下两种情况:
若第一报文的第一目的设备信息是负载均衡设备的设备信息,则意味着该第一报文需要发送至负载均衡设备,即第一报文的目标流向是发送至负载均衡设备。本公开中也可以将目标流向为发送至负载均衡设备描述为出向。
若第一报文的第一目的设备信息是客户端的设备信息,则意味着该第一报文需要发送至客户端,即第一报文的目标流向是发送至客户端。本公开中也可以将目标流向为发送至客户端描述为入向或者进向,对此本公开不做限制。
S205:根据所述验证信息以及所述第一报文的目标流向确定报文转换规则,所述报文转换规则用于将所述子流与所述主流定向到同一目标服务器。
由于验证信息能够唯一标识主流,因此,可以根据子流中携带的验证信息确定子流对应的主流,获取主流对应的报文转换规则,主流对应的报文转换规则包括:两个流向(上述的出向和入向)的报文转换规则,因此,可以基于第一报文的目标流向确定第一报文需要采用的报文转换规则,通过报文转换规则可以将子流与主流定向到同一目标服务器。
S207:基于所述报文转换规则对所述第一报文中的第一源设备信息或者所述第一目的设备信息进行转换,得到第二报文,所述第二报文包括第二源设备信息和第二目的设备信息。
具体地,一种情况为:若所述第一报文的目标流向表征报文需要发送至负载均衡设备,则根据所述验证信息确定所述主流对应的目标服务器,确定所述报文转换规则用于将所述第一报文中的第一目的设备信息转换为所述目标服务器的设备信息。即通过将第一报文中的目的地址由负载均衡设备的设备信息替换为主流对应的目标服务器的设备信息,从而,使得子流和主流能够定向到同一目标服务器。
另一种情况为:若所述第一报文的目标流向表征报文需要发送至客户端,确定所述报文转换规则用于将所述第一报文中的第一源设备信息转换为所述负载均衡 设备的设备信息。即通过将第一报文中的源地址由目标服务器设备信息转换成负载均衡设备的设备信息。
S209:根据所述第二报文中的第二目的设备信息向第二目的设备发送所述第二报文。
如果第一报文是需要发送至负载均衡设备的,则可以根据S207的操作直接发送至主流对应的目标服务器,保证子流和主流定向到同一目标服务器,并且,在该过程中无需经过负载均衡设备,减轻了负载均衡设备的负担。
如果第一报文是需要发送至客户端的,则可以通过将目标服务器的设备信息更改为负载均衡设备的设备信息,以确保客户端能够正常解析报文。
本实施例,客户端的虚拟交换机接收到客户端发送的第一报文后,根据第一报文钟的目的设备信息确定第一报文的目标流向,基于第一报文中携带的验证信息以及第一报文的目标流向确定报文转换规则,基于报文转换规则对第一报文中的源设备信息或者目的设备信息进行转换,得到第二报文,根据第二报文中的目的设备信息向第二目的设备发送第二报文,由于报文中包含验证信息以及MPTCP类型的子流标识信息,根据子流标识信息能够确定第一报文属于子流,验证信息能够指示子流标识信息标识的子流对应的主流,报文转换规则能够将子流与主流定向到同一目标服务器,从而,使得子流与主流能够定向到同一目标服务器,确保了访问的正常进行。并且,在此过程中,子流无需经过负载均衡设备,减轻了负载均衡设备的负担,提升了系统容量。
图3为本公开提供的另一种负载均衡方法实施例的流程示意图,图3是在图2所示实施例的基础上,进一步地,在S203之前,还包括:
S2021:根据所述MPTCP类型的子流标识信息确定所述第一报文为子流。
也就是,如果解析报文后发现报文中包含属于MPTCP类型的子流标识信息,则确定第一报文为子流。
S2022:根据所述验证信息从数据库中获取所述验证信息对应的主流定向的目标服务器;
由于验证信息能够唯一标识一个主流,数据库中记载了主流对应的目标服务 器,因此,基于验证信息可以从数据库中获取验证信息对应的主流定向的目标服务器。
S2023:根据所述目标服务器的设备信息生成所述验证信息对应的所述报文转换规则。
其中,所述报文转换规则包括:若所述第一报文的目标流向表征报文需要发送至负载均衡设备,则将所述第一报文中的第一目的设备信息转换为所述目标服务器的设备信息;若所述第一报文的目标流向表征报文需要发送至客户端,则将所述第一报文中的第一源设备信息转换为所述负载均衡设备的设备信息。
本实施例,通过根据所述MPTCP类型的子流标识信息确定所述第一报文为子流,然后,根据验证信息从数据库中获取验证信息对应的主流定向的目标服务器,基于目标服务器的设备信息生成验证信息对应的报文转换规则,从而,使得后续在进行报文传输的过程中,能够基于报文转换规则将子流与主流定向到同一目标服务器,确保了访问的正常进行。
在上述实施例的基础上,生成报文转换规则之后,还包括:启动定时器,当定时器到时后,删除报文转换规则。
图4为本公开提供的再一种网络负载均衡方法实施例的流程示意图,图4是在图3所示实施例的基础上,进一步地,还包括:
S2001:接收负载均衡设备发送的控制信息。
所述控制信息中包括:所述验证信息以及所述目标服务器的设备信息。
具体地,一种可能的实现方式如下:
负载均衡设备在主连接建立的过程中,接收目标服务器发送的连接建立响应,所述连接建立响应中包括:属于MPTCP类型的主流标识信息、目标服务器的设备信息和密钥;负载均衡设备根据所述密钥生成验证信息;并根据所述验证信息和所述目标服务器的设备信息生成控制报文,所述控制报文中包括:所述验证信息和所述目标服务器的设备信息;向客户端对应的虚拟交换机发送所述控制报文,以使所述虚拟交换机基于所述控制报文生成报文转换规则,以将主流对应的子流定向至同一目标服务器。
S2002:将所述控制信息存储于所述数据库中。
客户端对应的虚拟交换机接收到控制信息之后将控制信息存储与数据库中,以备在接收到子流之后基于报文控制信息生成报文转换规则。
本实施例,通过接收负载均衡设备发送控制信息,并将控制信息存储于数据库中,由于控制信息中包含验证信息和目标服务器的设备信息,因此,可以使得客户端对应的虚拟交换机基于控制报文生成报文转换规则,以将主流对应的子流定向至同一目标服务器,确保访问的正常进行。
下面以几个具体的示例对本公开的技术方案进行说明
图5为本公开的提供的又一种负载均衡方法实施例的流程示意图,如图5所示,本实施例包括:客户端10、虚拟交换机20、负载均衡设备30、虚拟交换机40、服务器50、虚拟交换机60和服务器70。其中,虚拟交换机20为客户端10的虚拟交换机。虚拟交换机40为服务器50的虚拟交换机。虚拟交换机60可以为服务器70的虚拟交换机。
S501、客户端10向虚拟交换机20发送第一报文。
其中,第一报文中包含客户端10的IP地址1和端口号1到负载均衡设备30的IP地址2和端口号2的TCP连接、MP_JOIN和token。
其中,MP_JOIN对应子属于MPTCP类型的子流标识信息,token为验证信息,负载均衡设备30的IP地址2和端口号2对应第一目的设备信息。
S502、虚拟交换机20根据MP_JOIN确定第一报文属于MPTCP类型的子流,判断第一目标设备信息为负载均衡设备的设备信息,则根据携带的Token,在数据库中获取Token对应的目标服务器的设备信息,并基于目标服务器的设备信息生成报文转换规则。
其中,通过查询数据库可以获取到token对应的目标服务器为服务器50,并获取到服务器50的设备信息即IP地址3和端口3。
报文转换规则包括:出向报文转换规则和入向报文转换规则。
出向报文转换规则包括:将报文中的目的地址和端口号替换为主流对应的目标服务器的地址和端口号;
入向报文转换规则包括:将报文中的源地址和源端口号替换为负载均衡设备 的地址和端口号。
S503、根据出向报文转换规则,将第一报文中的负载均衡设备信息替换为服务器50的设备信息,得到第二报文。
第二报文中包括:源设备信息:客户端10的IP地址1和端口号1;目的设备信息:服务器50的IP地址3和端口号3、子流标识信息(MP_JOIN)以及验证信息(token)。
S504、虚拟交换机20向目标服务器对应的虚拟交换机40发送第二报文。
在一些实施例中,步骤S503中,还可以将第一报文进行叠加(overlay)封装,例如,可以使用用户数据报协议(User Datagram Protocol,UDP)对TCP数据包进行封装,得到第二报文。其中,第二报文中内层包含:客户端10的IP地址1和端口号1到服务器50的IP地址3和端口号3的TCP连接、MP_JOIN和token。
相应的,步骤S504中,虚拟交换机20向虚拟交换机40发送的第二报文为进行叠加封装后的第二报文。
S505、虚拟交换机20向服务器50发送第二报文。
在图5所示实施例的基础上,本实施例提供的方法在步骤S505之后,还可以包括如下步骤:
S506、服务器50生成第二报文对应的第二响应。
其中,第二响应中包含服务器50的IP地址3和端口号3到客户端10的IP地址1和端口号1的TCP连接响应、MP_JOIN和HMAC。
S507、服务器50向虚拟交换机40发送第二响应。
其中,第二响应中包含服务器50的IP地址3和端口号3到客户端10的IP地址1和端口号1的TCP连接响应、MP_JOIN和HMAC。
S508、虚拟交换机40向虚拟交换机20发送第二响应。
在一些实施例中,步骤S508之前,还可以将第二响应进行叠加(overlay)封装,例如,可以使用用户数据报协议(User Datagram Protocol,UDP)对TCP数据包进行封装,得到第二响应。其中,更新后的第二响应中内层包含:服务器50的IP地址3和端口号3到客户端10的IP地址1和端口号1的TCP连接响应、MP_JOIN和HMAC。
相应的,步骤S508中,虚拟交换机40向虚拟交换机20发送的第一连接建立响应为进行叠加封装后的第二响应。
S509、虚拟交换机20根据入向报文转换规则将第二响应中的目标服务器的设备信息替换为负载均衡设备的设备信息,得到第一响应。
即将第二响应中的服务器50的IP地址3和端口号3更新为负载均衡设备30的IP地址2和端口号2,得到第一响应。
其中,第一响应中包含:源设备信息:负载均衡设备30的IP地址2、目的设备信息:端口号2到客户端10的IP地址1和端口号1、属于MPTCP的子流标识MP_JOIN和HMAC。
S510、虚拟交换机20向客户端10发送第一响应。
通过以上过程完成实现子流与主流定向到同一目标服务器,确保了访问的正常进行,并且,在此过程中无需负载均衡设备参与,减轻了负载均衡设备的负担,提高了系统容量。
下面描述客户端对应的虚拟客户端得到主流对应的目标服务器的设备信息并存储于数据库的过程。如图6所示,
S601:客户端10向虚拟交换机20发送第一报文。
其中,第一报文中包含:源设备信息:客户端10的IP地址4和端口号4,目的设备信息:负载均衡设备30的IP地址2和端口号2、属于MPTCP类型的主流标识信息(MP_CAPABLE)和密钥(key1)。
S602、虚拟交换机20向负载均衡设备30发送第一报文。
虚拟交换机20对第一报文进行封装之后发送至负载均衡设备。
S603、负载均衡设备30向虚拟交换机40发送更新后的第一报文。
负载均衡设备30根据负载均衡策略选择目标服务器,假设选择了服务器50。将负载均衡设备30的IP地址2和端口号2替换为服务器50的IP地址3和端口号3。
负载均衡设备30向虚拟交换机40发送更新后的第一报文。
S604、虚拟交换机40向服务器50发送更新后的第一报文。
S605、服务器50向虚拟交换机40发送第一响应。
其中,第一响应中包含:源设备信息:服务器50的IP地址3和端口号3,目的设备信息:客户端10的IP地址4和端口号4、属于MPTCP类型的主流标识信息(MP_CAPABLE)和密钥key2。
S606、虚拟交换机40向负载均衡设备30发送第一响应。
其中,第一响应中包含:源地址:服务器50的IP地址3和端口号3,客户端10的IP地址4和端口号4的TCP连接、属于MPTCP类型的主流标识信息(MP_CAPABLE)和key2。
S607、负载均衡设备30向虚拟交换机20发送第二响应。
其中,负载均衡设备对第一响应中的源设备信息进行转换,并对第一响应进行封装,得到第二响应。
负载均衡设备30将第一响应中的服务器50的IP地址3和端口号3更新为负载均衡设备30的IP地址2和端口号2,得到第二响应。
第二响应包括:源设备信息:负载均衡设备30的IP地址2和端口号2、目的设备信息:客户端10的IP地址4和端口号4、属于MPTCP类型的主流标识信息(MP_CAPABLE)和key2。
S608、虚拟交换机20向客户端10发送第二响应。
在S606之后,还包括:
S609:客户端的虚拟交换机20通过负载均衡设备学习到目标服务器的设备信息。
S610:客户端10向虚拟交换机20发送报文。
其中,报文中包括:源设备信息、目的设备信息、属于MPTCP类型的子流标识信息以及验证信息。
其中,源设备信息:客户端10的IP地址4和端口号4,目的设备信息:负载均衡设备30的IP地址2和端口号2、属于MPTCP类型的主流标识信息(MP_JOIN)和验证信息(Token)。
S611:虚拟交换机20根据学习到的目标服务器的设备信息将目的设备信息替换为目标服务器的设备信息,并进行封装,得到更新后的报文。
其中,更新后的报文中包括:源设备信息、目的设备信息、属于MPTCP类型的子流标识信息以及验证信息。
源设备信息:客户端10的IP地址4和端口号4,目的设备信息:服务器50的IP地址3和端口号3、子流标识信息(MP_JOIN)以及验证信息(token)。
S612:虚拟交换机20将更新后的报文发送至虚拟交换机40。
S613:虚拟交换机40对报文进行解封装并发送至服务器50。
S614:服务器50接收到报文之后,根据子流标识信息和验证信息对报文进行 关联。
S615:服务器50向虚拟交换机40发送响应。
响应中包括:源设备信息、目的设备信息、属于MPTCP类型的子流标识信息以及虚拟交换机40的HMAC。
S616:虚拟交换机40向客户端的虚拟交换机20发送响应。
虚拟交换机40对响应进行封装之后发送至虚拟交换机20。
S617:虚拟交换机20进行地址转换并将响应发送至客户端10。
即将响应中的服务器50的IP地址3和端口号3更新为负载均衡设备30的IP地址2和端口号2,得到更新后的响应。
更新后的响应中包含:源设备信息:负载均衡设备30的IP地址2、目的设备信息:端口号2到客户端10的IP地址1和端口号1、属于MPTCP的子流标识MP_JOIN和HMAC。
本实施例,通过在主流建立的过程中,客户端虚拟机通过负载均衡设备学习到目标服务器的设备信息,从而,使得客户端对应的虚拟交换机在接收到子流之后,能够根据存储的控制信息将子流和主流定向到同一目标服务器。
在图6所示实施例的基础上,S609的一种实现方式如图7所示,包括:
S6091:负载均衡设备30生成控制信息。
负载均衡设备根据第一响应中的属于MPTCP类型的主流标识信息确定客户端与服务器尝试建立MPTCP会话,根据虚拟交换机40回复的报文中携带的key2,计算得到验证信息Token,该Token能够唯一标识该会话,根据服务器50的设备信息和计算得到的验证信息,生成控制信息。
S6092:负载均衡设备30向虚拟交换机20发送所述控制信息。
S6093:虚拟交换机20将所述控制信息存储于数据库中。
通过如上方法,在主流建立的过程中,负载均衡设备学习到目标服务器的设备信息,并基于目标服务器的设备信息和得到的验证信息生成控制信息,将控制信息发送至客户端对应的虚拟交换机,从而,使得客户端对应的虚拟交换机在接收到子流之后,能够根据存储的控制信息将子流和主流定向到同一目标服务器。
图8为本公开提供的一种网络负载均衡装置的结构示意图,如图8所示,本实施例的装置包括:接收模块801、处理模块802和发送模块803。
接收模块801,用于接收第一报文,所述第一报文中包括:第一源设备信息、第一目的设备信息、属于多路传输控制协议MPTCP类型的子流标识信息、以及验证信息,所述验证信息用于指示所述子流标识信息标识的子流对应的主流;
处理模块802,用于根据所述第一目的设备信息确定所述第一报文的目标流向;根据所述验证信息以及所述第一报文的目标流向确定报文转换规则,所述报文转换规则用于将所述子流与所述主流定向到同一目标服务器;基于所述报文转换规则对所述第一报文中的第一源设备信息或者所述第一目的设备信息进行转换,得到第二报文,所述第二报文包括第二源设备信息和第二目的设备信息;
发送模块803,用于根据所述第二报文中的第二目的设备信息向第二目的设备发送所述第二报文。
在一些实施例中,所述处理模块802具体用于若所述第一报文的目标流向表征报文需要发送至负载均衡设备,则根据所述验证信息确定所述主流对应的目标服务器,确定所述报文转换规则用于将所述第一报文中的第一目的设备信息转换为所述目标服务器的设备信息;若所述第一报文的目标流向表征报文需要发送至客户端,确定所述报文转换规则用于将所述第一报文中的第一源设备信息转换为所述负载均衡设备的设备信息。
在一些实施例中,所述处理模块802还用于根据所述MPTCP类型的子流标识信息确定所述第一报文为子流;根据所述验证信息从数据库中获取所述验证信息对应的主流定向的目标服务器;根据所述目标服务器的设备信息生成所述验证信息对应的所述报文转换规则,所述报文转换规则包括:若所述第一报文的目标流向表征报文需要发送至负载均衡设备,则将所述第一报文中的第一目的设备信息转换为所述目标服务器的设备信息;若所述第一报文的目标流向表征报文需要发送至客户端,则将所述第一报文中的第一源设备信息转换为所述负载均衡设备的设备信息。
在一些实施例中,所述接收模块801还用于接收负载均衡设备发送的控制信息,所述控制信息中包括:所述验证信息以及所述目标服务器的设备信息;
所述处理模块802还用于将所述控制信息存储于所述数据库中。
在一些实施例中,所述处理模块802还用于启动定时器,定时器到时后,删除所述报文转换规则。
本实施例的装置对应的可用于执行上述各方法实施例中的客户端对应的虚拟交换机执行的步骤,其实现原理和技术效果类似,此处不再赘述。
图9为本公开提供的另一种网络负载均衡装置的结构示意图,如图9所示,本实施例的装置包括:接收模块901、处理模块902和发送模块903。
接收模块901用于接收连接建立响应,所述连接建立响应中包括:属于多路传输控制协议MPTCP类型的主流标识信息、目标服务器的设备信息和密钥;
处理模块902用于根据所述密钥生成验证信息;并根据所述验证信息和所述目标服务器的设备信息生成控制报文,所述控制报文中包括:所述验证信息和所述目标服务器的设备信息;
发送模块903用于向客户端对应的虚拟交换机发送所述控制报文,以使所述虚拟交换机基于所述控制报文生成报文转换规则,以将主流对应的子流定向至所述目标服务器。
本实施例的装置对应的可用于执行上述各方法实施例中的负载均衡设备执行的步骤,其实现原理和技术效果类似,此处不再赘述。
本公开实施例提供一种电子设备,包括:一个或多个处理器;存储器;以及一个或多个计算机程序;其中一个或多个计算机程序被存储在存储器中;一个或多个处理器在执行一个或多个计算机程序时,使得电子设备实现如上述方法。
本公开实施例提供一种计算机存储介质,包括计算机指令,当计算机指令在电子设备上运行时,使得电子设备执行如上述方法。
本公开实施例提供一种计算机程序产品,当计算机程序产品在计算机上运行时,使得计算机执行如上述方法。
上述实施例的装置,可以用于执行上述方法实施例的技术方案,其实现原理和技术效果类似,此处不再赘述。
需要说明的是,在本文中,诸如“第一”和“第二”等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。而且,术语“包括”、“包含” 或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括要素的过程、方法、物品或者设备中还存在另外的相同要素。
以上仅是本公开的具体实施方式,使本领域技术人员能够理解或实现本公开。对这些实施例的多种修改对本领域的技术人员来说将是显而易见的,本文中所定义的一般原理可以在不脱离本公开的精神或范围的情况下,在其它实施例中实现。因此,本公开将不会被限制于本文的这些实施例,而是要符合与本文所公开的原理和新颖特点相一致的最宽的范围。

Claims (16)

  1. 一种网络负载均衡方法,包括:
    接收第一报文,所述第一报文中包括:第一源设备信息、第一目的设备信息、属于多路传输控制协议MPTCP类型的子流标识信息、以及验证信息,所述验证信息用于指示所述子流标识信息标识的子流对应的主流;
    根据所述第一目的设备信息确定所述第一报文的目标流向;
    根据所述验证信息以及所述第一报文的目标流向确定报文转换规则,所述报文转换规则用于将所述子流与所述主流定向到同一目标服务器;
    基于所述报文转换规则对所述第一报文中的第一源设备信息或者所述第一目的设备信息进行转换,得到第二报文,所述第二报文包括第二源设备信息和第二目的设备信息;
    根据所述第二报文中的第二目的设备信息向第二目的设备发送所述第二报文。
  2. 根据权利要求1所述的网络负载均衡方法,其中,所述根据所述验证信息以及所述第一报文的目标流向确定报文转换规则,包括:
    若所述第一报文的目标流向表征报文需要发送至负载均衡设备,则根据所述验证信息确定所述主流对应的目标服务器,确定所述报文转换规则用于将所述第一报文中的第一目的设备信息转换为所述目标服务器的设备信息;
    若所述第一报文的目标流向表征报文需要发送至客户端,确定所述报文转换规则用于将所述第一报文中的第一源设备信息转换为所述负载均衡设备的设备信息。
  3. 根据权利要求1或2所述的网络负载均衡方法,其中,所述根据所述第一目的设备信息确定所述第一报文的目标流向之前,还包括:
    根据所述MPTCP类型的子流标识信息确定所述第一报文为子流;
    根据所述验证信息从数据库中获取所述验证信息对应的主流定向的目标服务器;
    根据所述目标服务器的设备信息生成所述验证信息对应的所述报文转换规则,所述报文转换规则包括:若所述第一报文的目标流向表征报文需要发送至负载均衡设备,则将所述第一报文中的第一目的设备信息转换为所述目标服务器的设备信息;若所述第一报文的目标流向表征报文需要发送至客户端,则将所述第一报文中的第一源设备信息转换为所述负载均衡设备的设备信息。
  4. 根据权利要求3所述的网络负载均衡方法,其中,所述接收第一报文之前,还包括:
    接收负载均衡设备发送的控制信息,所述控制信息中包括:所述验证信息以及所述目标服务器的设备信息;
    将所述控制信息存储于所述数据库中。
  5. 根据权利要求3所述的网络负载均衡方法,其中,所述根据所述目标服务器的设备信息生成所述验证信息对应的所述报文转换规则之后,还包括:
    启动定时器,定时器到时后,删除所述报文转换规则。
  6. 根据权利要求1或2所述的网络负载均衡方法,其中,所述网络负载均衡方法由与客户端对应的虚拟交换机执行。
  7. 一种网络负载均衡方法,包括:
    接收连接建立响应,所述连接建立响应中包括:属于多路传输控制协议MPTCP类型的主流标识信息、目标服务器的设备信息和密钥;
    根据所述密钥生成验证信息;
    根据所述验证信息和所述目标服务器的设备信息生成控制报文,所述控制报文中包括:所述验证信息和所述目标服务器的设备信息;
    向客户端对应的虚拟交换机发送所述控制报文,以使所述虚拟交换机基于所述控制报文生成报文转换规则,以将主流对应的子流定向至所述目标服务器。
  8. 根据权利要求7所述的网络负载均衡方法,其中,所述网络负载均衡方法由负载均衡设备执行。
  9. 一种网络负载均衡装置,包括:
    接收模块,用于接收第一报文,所述第一报文中包括:第一源设备信息、第 一目的设备信息、属于多路传输控制协议MPTCP类型的子流标识信息、以及验证信息,所述验证信息用于指示所述子流标识信息标识的子流对应的主流;
    处理模块,用于根据所述第一目的设备信息确定所述第一报文的目标流向;并根据所述验证信息以及所述第一报文的目标流向确定报文转换规则,所述报文转换规则用于将所述子流与所述主流定向到同一目标服务器;并基于所述报文转换规则对所述第一报文中的第一源设备信息或者所述第一目的设备信息进行转换,得到第二报文,所述第二报文包括第二源设备信息和第二目的设备信息;
    发送模块,用于根据所述第二报文中的第二目的设备信息向第二目的设备发送所述第二报文。
  10. 一种网络负载均衡装置,包括:
    接收模块,用于接收连接建立响应,所述连接建立响应中包括:属于多路传输控制协议MPTCP类型的主流标识信息、目标服务器的设备信息和密钥;
    处理模块,用于根据所述密钥生成验证信息;并根据所述验证信息和所述目标服务器的设备信息生成控制报文,所述控制报文中包括:所述验证信息和所述目标服务器的设备信息;
    发送模块,用于向客户端对应的虚拟交换机发送所述控制报文,以使所述虚拟交换机基于所述控制报文生成报文转换规则,以将主流对应的子流定向至所述目标服务器。
  11. 一种网络负载均衡系统,包括:
    虚拟交换机,与客户端对应,被配置为执行如权利要求1-6任一项所述的网络均衡负载方法。
  12. 根据权利要求11所述的网络负载均衡系统,还包括:
    负载均衡设备,被配置为执行如权利要求7或8所述的网络均衡负载方法。
  13. 一种电子设备,包括:一个或多个处理器;存储器;以及一个或多个计算机程序;其中所述一个或多个计算机程序被存储在所述存储器中;其中,所述一个或多个处理器在执行所述一个或多个计算机程序时,使得所述电子设备实现如权利要求1-8任一项所述的网络负载均衡方法。
  14. 一种计算机存储介质,包括计算机指令,当所述计算机指令在电子设备上运行时,使得所述电子设备执行如权利要求1-8任一项所述的网络负载均衡方法。
  15. 一种计算机程序产品,当所述计算机程序产品在计算机上运行时,使得所述计算机执行如权利要求1-8任一项所述的网络负载均衡方法。
  16. 一种计算机程序,包括:指令,所述指令当由处理器执行时使所述处理器执行根据权利要求1-8任一项所述的网络负载均衡方法。
PCT/CN2022/126674 2021-12-21 2022-10-21 网络负载均衡方法、装置、电子设备、介质和程序产品 WO2023116165A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202111571274.2A CN114285802A (zh) 2021-12-21 2021-12-21 网络负载均衡方法、装置、电子设备、介质和程序产品
CN202111571274.2 2021-12-21

Publications (1)

Publication Number Publication Date
WO2023116165A1 true WO2023116165A1 (zh) 2023-06-29

Family

ID=80873471

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/126674 WO2023116165A1 (zh) 2021-12-21 2022-10-21 网络负载均衡方法、装置、电子设备、介质和程序产品

Country Status (2)

Country Link
CN (1) CN114285802A (zh)
WO (1) WO2023116165A1 (zh)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114285802A (zh) * 2021-12-21 2022-04-05 北京字节跳动网络技术有限公司 网络负载均衡方法、装置、电子设备、介质和程序产品

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108353334A (zh) * 2015-12-25 2018-07-31 华为技术有限公司 业务传输方法、装置及设备
CN109155757A (zh) * 2016-06-10 2019-01-04 特斯萨瑞斯股份公司 混合接入网络中的多路径tcp
US10476992B1 (en) * 2015-07-06 2019-11-12 F5 Networks, Inc. Methods for providing MPTCP proxy options and devices thereof
CN112291815A (zh) * 2020-11-06 2021-01-29 网易(杭州)网络有限公司 一种mptcp连接建立方法及装置
CN114285802A (zh) * 2021-12-21 2022-04-05 北京字节跳动网络技术有限公司 网络负载均衡方法、装置、电子设备、介质和程序产品

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108667880A (zh) * 2017-03-31 2018-10-16 华为技术有限公司 一种负载均衡系统、方法及装置
EP3729785B8 (en) * 2017-12-22 2022-08-10 Nokia Technologies OY Designs of an mptcp-aware load balancer and load balancer using the designs
US10785163B2 (en) * 2019-02-27 2020-09-22 International Business Machines Corporation Maintaining a queuing policy with multipath traffic
CN112929264B (zh) * 2019-12-06 2022-10-28 厦门网宿有限公司 业务流量传输方法、系统及网络设备
CN111193773B (zh) * 2019-12-06 2022-12-09 腾讯云计算(北京)有限责任公司 负载均衡方法、装置、设备及存储介质

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10476992B1 (en) * 2015-07-06 2019-11-12 F5 Networks, Inc. Methods for providing MPTCP proxy options and devices thereof
CN108353334A (zh) * 2015-12-25 2018-07-31 华为技术有限公司 业务传输方法、装置及设备
CN109155757A (zh) * 2016-06-10 2019-01-04 特斯萨瑞斯股份公司 混合接入网络中的多路径tcp
CN112291815A (zh) * 2020-11-06 2021-01-29 网易(杭州)网络有限公司 一种mptcp连接建立方法及装置
CN114285802A (zh) * 2021-12-21 2022-04-05 北京字节跳动网络技术有限公司 网络负载均衡方法、装置、电子设备、介质和程序产品

Also Published As

Publication number Publication date
CN114285802A (zh) 2022-04-05

Similar Documents

Publication Publication Date Title
US10616379B2 (en) Seamless mobility and session continuity with TCP mobility option
US10079803B2 (en) Peer-to-peer connection establishment using TURN
US8244881B2 (en) Service virtualization over content-centric networks
US8996657B2 (en) Systems and methods for multiplexing network channels
US7882251B2 (en) Routing hints
US7107609B2 (en) Stateful packet forwarding in a firewall cluster
JP5629086B2 (ja) 同一ipポートを使用するアプリケーションの複数のインスタンス間で、受信したセッションを送信するための方法およびシステム
US8266294B2 (en) Routing hints
JP2013251925A (ja) モバイル機器に対するネットワークアドレス変更のための方法及び装置
WO2021047515A1 (zh) 一种服务路由方法及装置
JP2004128782A (ja) 鍵交換代理ネットワークシステム
WO2023151264A1 (zh) 负载均衡方法、装置、节点及存储介质
US20060047821A1 (en) System, method, and medium for relaying data using socket application program
EP3747165A1 (en) Application based routing of data packets in multi-access communication networks
WO2007019809A1 (fr) Procede et systeme d'etablissement d'un canal direct point par point
WO2023116165A1 (zh) 网络负载均衡方法、装置、电子设备、介质和程序产品
JP2008537421A (ja) 通信システム内の接続を確立する方法
WO2023186109A1 (zh) 节点访问方法以及数据传输系统
US20070147376A1 (en) Router-assisted DDoS protection by tunneling replicas
JP3929969B2 (ja) 通信システム、サーバ、端末装置、通信方法、プログラムおよび記憶媒体
US11902052B1 (en) Separate PFCP session model for network access by residential gateways
US20240039762A1 (en) Combined pfcp session model for network access by residential gateways
WO2022042370A1 (zh) Mptcp负载均衡方法、介质及设备
WO2021134860A1 (zh) 负载均衡方法、设备及系统
JP5415388B2 (ja) 仮想通信路接続システム、制御方法、制御プログラム、第1の端末及び第2の端末

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22909483

Country of ref document: EP

Kind code of ref document: A1

WWE Wipo information: entry into national phase

Ref document number: 18560866

Country of ref document: US