CN112866433A - Message load balancing processing method and device and computer equipment - Google Patents

Message load balancing processing method and device and computer equipment Download PDF

Info

Publication number
CN112866433A
CN112866433A CN202110087862.2A CN202110087862A CN112866433A CN 112866433 A CN112866433 A CN 112866433A CN 202110087862 A CN202110087862 A CN 202110087862A CN 112866433 A CN112866433 A CN 112866433A
Authority
CN
China
Prior art keywords
data message
session
ipv4
address
ipv6
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
Application number
CN202110087862.2A
Other languages
Chinese (zh)
Inventor
庞成
刘宝春
何军
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
JD Digital Technology Holdings Co Ltd
Original Assignee
JD Digital Technology Holdings Co Ltd
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 JD Digital Technology Holdings Co Ltd filed Critical JD Digital Technology Holdings Co Ltd
Priority to CN202110087862.2A priority Critical patent/CN112866433A/en
Publication of CN112866433A publication Critical patent/CN112866433A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/09Mapping addresses
    • H04L61/25Mapping addresses of the same type
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1001Protocols in which an application is distributed across nodes in the network for accessing one among a plurality of replicated servers

Abstract

The application provides a load balancing processing method and device for a message and computer equipment, wherein the method comprises the following steps: the method comprises the steps of obtaining a first data message sent by a client, carrying out network address conversion on the first data message by adopting conversion information of the first session according to the first session to which the first data message belongs, obtaining a second data message, wherein the first data message and the second data message are different in internet protocol base, carrying out load balancing processing on the second data message, so as to determine an application server of the second data message, and sending the second data message to the application server. In the application, the network address is converted based on the conversion information aiming at two data messages with different network protocols so as to obtain the supported data message format, thereby quickly realizing the compatibility of various protocols and reducing the cost.

Description

Message load balancing processing method and device and computer equipment
Technical Field
The present application relates to the field of computer technologies, and in particular, to a method and an apparatus for load balancing processing of a packet, and a computer device.
Background
Load balancing is the most important application service flow access mode of each large internet service provider at present; by setting a Virtual service address (VS), the flow for accessing the Virtual service address is distributed to a plurality of rear-end application servers (RS) according to a forwarding strategy, and the external overall service capability of the application system is expanded.
IPv4 is the basis for the rapid development of the Internet as the most mature and widespread IP (Internet Protocol) Protocol. At present, internet service providers almost have an IPv 4-based network architecture to provide services to the outside, and load balancing, which is one of the important functions of the network architecture, also supports the IPv4 protocol. As the internet is increasingly expanded and IPv4 addresses are about to be exhausted, the IPv6 protocol is gradually gaining attention as a next-generation IP protocol that replaces the IPv4 protocol, and is gradually spreading.
At present, internet service providers almost all adopt mature IPv4 network architecture. As the industry and the trust department continuously pushes the IPv6 service scale, the existing internet service is required to increase the IPv6 access mode. Therefore, internet service providers need to make full link IPv6 modifications. While full link IPv6 modifications may consume significant human resources and time, urgent modifications may have an impact on the normal access to existing services. Therefore, how to support the IPv6 mode access service on the basis of being compatible with the original IPv4 mode access service is a technical problem to be solved urgently.
Disclosure of Invention
The present application is directed to solving, at least to some extent, one of the technical problems in the related art.
Therefore, a first objective of the present application is to provide a method for load balancing processing of packets, which performs network address translation based on translation information for two data packets with different network protocols to obtain a supported data packet format, thereby avoiding a large amount of hardware improvements for compatibility and reducing cost.
A second object of the present application is to provide a message load balancing processing apparatus.
A third object of the present application is to propose a computer device.
A fourth object of the present application is to propose a non-transitory computer-readable storage medium.
A fifth object of the present application is to propose a computer program product.
To achieve the above object, an embodiment of a first aspect of the present application provides a method for load balancing processing of a packet, including:
acquiring a first data message sent by a client;
according to a first session to which the first data message belongs, converting the network address of the first data message by adopting conversion information of the first session to obtain a second data message; wherein the first data message and the second data message are based on different internet protocols;
and performing load balancing processing on the second data message to determine an application server of the second data message, and sending the second data message to the application server.
To achieve the above object, an embodiment of a second aspect of the present application provides a load balancing processing apparatus for a packet, including:
the acquisition module is used for acquiring a first data message sent by a client;
the conversion module is used for converting the network address of the first data message by adopting the conversion information of the first session according to the first session to which the first data message belongs, so as to obtain a second data message; wherein the first data message and the second data message are based on different internet protocols;
and the processing module is used for carrying out load balancing processing on the second data message so as to determine an application server of the second data message and sending the second data message to the application server.
To achieve the above object, a third aspect of the present application provides a computer device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, and when the processor executes the computer program, the processor implements the load balancing processing method according to the first aspect.
In order to achieve the above object, a fourth aspect of the present application provides a non-transitory computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the load balancing processing method according to the first aspect.
In order to achieve the above object, an embodiment of a fifth aspect of the present application provides a computer program product, where when executed by an instruction processor of the computer program product, the method for load balancing processing according to the first aspect is implemented.
The technical scheme provided by the embodiment has the following beneficial effects:
the method comprises the steps of obtaining a first data message sent by a client, carrying out network address conversion on the first data message by adopting conversion information of the first session according to the first session to which the first data message belongs, obtaining a second data message, wherein the first data message and the second data message are different in internet protocol base, carrying out load balancing processing on the second data message, so as to determine an application server of the second data message, and sending the second data message to the application server. In this embodiment, for two data packets with different network protocols, network address conversion is performed based on the conversion information to obtain a supported data packet format, so that compatibility of multiple protocols is quickly achieved, and cost is reduced.
Additional aspects and advantages of the present application will be set forth in part in the description which follows and, in part, will be obvious from the description, or may be learned by practice of the present application.
Drawings
The foregoing and/or additional aspects and advantages of the present application will become apparent and readily appreciated from the following description of the embodiments, taken in conjunction with the accompanying drawings of which:
fig. 1 is a schematic flowchart of a load balancing processing method for a packet according to an embodiment of the present application;
fig. 2 is a schematic flowchart of another load balancing processing method for a packet according to an embodiment of the present application;
fig. 3 is a schematic diagram of address translation of the first data packet and the second data packet provided in this embodiment;
fig. 4 is a schematic flowchart of another load balancing processing method for a packet according to an embodiment of the present application;
fig. 5 is a schematic diagram of a session provided in an embodiment of the present application;
fig. 6 is a schematic flowchart of another load balancing processing method for a packet according to an embodiment of the present application;
fig. 7 is a schematic structural diagram of a load balancing scenario provided in an embodiment of the present application;
fig. 8 is a schematic structural diagram of a load balancing processing apparatus for a packet according to an embodiment of the present application;
FIG. 9 illustrates a block diagram of an exemplary computer device suitable for use to implement embodiments of the present application.
Detailed Description
Reference will now be made in detail to embodiments of the present application, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to the same or similar elements or elements having the same or similar function throughout. The embodiments described below with reference to the drawings are exemplary and intended to be used for explaining the present application and should not be construed as limiting the present application.
The following describes a method, an apparatus, and a computer device for load balancing processing of a packet according to an embodiment of the present application with reference to the drawings.
Fig. 1 is a schematic flowchart of a load balancing processing method for a packet according to an embodiment of the present application.
As shown in fig. 1, the method comprises the steps of:
step 101, a first data message sent by a client is obtained.
The first data packet of this embodiment may be one packet in a data stream sent by an acquired client, and the data stream may include a plurality of packets.
And 102, according to the first session to which the first data message belongs, performing network address conversion on the first data message by using conversion information of the first session to obtain a second data message.
The first data message and the second data message are based on different internet protocols. The first data packet is a data packet incompatible with the current network device, and the second data packet is a data packet supported by the current network device. For example, the first data packet is a packet of an IPv6 protocol, and the second data packet is a packet of an IPv4 protocol.
In this embodiment, the conversion information is preset in the first session, and the conversion information includes conversion information required for converting the first data packet into the second data packet, so as to implement network address conversion based on the conversion information, so as to obtain the second data packet, and implement conversion into a data packet corresponding to a network protocol supported in a related network architecture, thereby avoiding the problems of high cost, long time consumption, and possible influence on normal access of the existing service, which are caused by modification of multiple devices in the network architecture.
Step 103, performing load balancing processing on the second data message to determine an application server of the second data message, and sending the second data message to the application server.
In an implementation manner of this embodiment, according to a set forwarding policy, a second data packet is scheduled to obtain an application server of the second data packet, and according to an address of the application server, a network address of the second data packet is converted, so that a route is performed according to the network address obtained by the conversion, so as to send the second data packet to the application server, and a target flag bit is added in a second session to which the second data packet belongs, where the target flag bit is used to represent that the second data packet is obtained by converting the first data packet, so that when a corresponding feedback packet is subsequently obtained, corresponding processing is performed based on the target flag bit.
In the load balancing processing method of the message in this embodiment, a first data message sent by a client is acquired, and network address conversion is performed on the first data message by using conversion information of the first session according to a first session to which the first data message belongs, so as to obtain a second data message, where the first data message and the second data message are based on different internet protocols, so as to perform load balancing processing on the second data message, so as to determine an application server of the second data message, and send the second data message to the application server. In the application, the network address is converted based on the conversion information aiming at two data messages with different network protocols so as to obtain the supported data messages, the compatibility of various protocols is quickly realized, the compatibility of a large amount of hardware improvement is avoided, and the cost is reduced.
Based on the foregoing embodiments, this embodiment provides another load balancing processing method for packets, which takes an example that a first data packet supports an IPv6 protocol, and a second data packet supports an IPv4 protocol, to describe how to obtain a second data packet after performing network address translation on the first data packet. Fig. 2 is a schematic flow chart of another load balancing processing method for packets according to the embodiment of the present application, and as shown in fig. 2, step 102 includes the following steps:
step 201, according to the header in the first data packet, a first session to which the first data packet belongs is queried.
In this embodiment, a header in the first data packet includes a correspondence between the first data packet and a first session to which the first data packet belongs, and the first session to which the first data packet belongs is determined by querying according to the correspondence, where conversion information for converting the first data packet into the second data packet is stored in advance in the first session.
Step 202, according to the conversion information of the first session, querying an IPv4 destination address corresponding to the IPv6 destination address in the first data packet, and querying an IPv4 source address corresponding to the IPv6 source address in the first data packet.
In this embodiment, the first data packet includes a source address and a destination address, and the second data packet also includes a source address and a destination address. Converting the first data packet into the second data packet requires converting according to the address conversion corresponding relationship between the first data packet and the second data packet stored in the conversion information, specifically, according to the IPv6 destination address in the first data packet, querying the corresponding IPv4 destination address in the conversion information of the first session, and according to the IPv6 source address in the first data packet, querying the corresponding IPv4 source address.
And step 203, replacing the IPv6 destination address in the first data message with the IPv4 destination address, and replacing the IPv6 source address in the first data message with the IPv4 source address to obtain a second data message.
In this embodiment, the IPv6 destination address in the first data packet is replaced with the IPv4 destination address, and the IPv6 source address is replaced with the IPv4 source address, so as to obtain the second data packet, because both the destination address and the source address in the second data packet are addresses supporting the IPv4 protocol, the second data packet obtained after conversion according to the first data packet can support the IPv4 protocol, so that the second data packet supported by the network can be obtained without performing a major change of hardware, the cost of conversion is reduced, and the efficiency is improved.
In the load balancing processing method of the packet in this embodiment, for two data packets with different network protocols, based on the destination address and the source address of the first data packet and the second data packet included in the conversion information, network address conversion is performed to obtain the supported second data packet, so that compatibility of multiple protocols is quickly realized based on a small change.
Based on the foregoing embodiment, in an implementation manner of the present application, the first data packet includes, in addition to the source address and the destination address in the foregoing embodiment, a source port and/or a destination port, and a next-layer protocol number, and similarly, the second data packet also includes the source address, the destination address, the source port and/or the destination port, and the next-layer protocol number.
Therefore, in this embodiment, after replacing the IPv6 destination address in the first data packet with the IPv4 destination address and replacing the IPv6 source address in the first data packet with the IPv4 source address, the method further includes:
according to the conversion information of the first session, inquiring a source port of an IPv4 source address corresponding to a source port of an IPv6 source address in the first data message, and replacing the source port of the IPv6 source address in the first data message by using the source port of the IPv4 source address;
and/or inquiring a destination port of an IPv4 destination address corresponding to the destination port of the IPv6 destination address in the first data message according to the conversion information of the first session, and replacing the destination port of the IPv6 destination address in the first data message by using the destination port of the IPv4 destination address.
Therefore, the first data message is converted into the second data message.
In an implementation manner of this embodiment, a case is described in which each of the first data packet and the second data packet includes at least 4 elements, that is, a destination address, a source address, a destination port, and a source port.
As shown in fig. 3, fig. 3 is a schematic diagram of address conversion of the first data packet and the second data packet provided in this embodiment. Wherein, the first data message and the second data message both contain 4 elements. In this embodiment, when the first data packet and the second data packet both include 4 types of elements, the conversion information of the first session, which is pre-established, includes the corresponding conversion relationships among the 4 types of elements, as shown in fig. 3, numbers 1 to 8 respectively indicate the corresponding relationships among each type of elements in the conversion information. The numbers 3 to 6 thereof indicate the correspondence between the above-mentioned 4 elements in the present embodiment. The concrete description is as follows:
number 1: according to the IPv6 protocol and the IPv4 protocol header field definitions, initialization of each field value is carried out.
Number 2: and directly assigning the value of the next layer protocol number field of the IPv6 header to the protocol number field of the IPv4 header.
Number 3: when the source IPv6 address of the first data packet is converted into the source IPv4 address, a local IPv4 address is selected from a local preconfigured IPv4 address pool according to a preset rule, for example, randomly selected, round-robin selected, or selected according to a Hash value, and is used as the IPv4 source address of the converted second data packet.
Number 4: according to the searched matching mapping rule, the destination IPv4 address after the destination IPv6 address is converted is the IPv4 address attribute in the rule.
And 5, selecting an unoccupied port value on the source IPv4 address as a TCP/UDP source port in the converted IPv4 message according to the source IPv4 address selected in the number 3.
Number 6: and directly assigning the TCP/UDP target port in the IPv6 message to the TCP/UDP target port in the IPv4 message.
Number 7: and directly assigning other fields of the TCP/UDP header in the IPv6 message to corresponding fields of the TCP/UDP header in the IPv4 message, wherein the check code field needs to be recalculated.
Number 8: the data load in the IPv6 message is directly mapped into the IPv4 message without any change.
Based on the foregoing embodiment, this embodiment provides another load balancing processing method for a packet, and in the foregoing embodiment, it is described that conversion information of a first session needs to be used for conversion when a first data packet is converted into a second data packet. As shown in fig. 4, before querying the first session, the following steps are included:
step 401, when receiving the first data packet belonging to the first session, generating the conversion information of the first session.
In this embodiment, the first data packet is sent in a data stream, where the data stream includes at least one first data packet, and when a first data packet in the first data packet stream is received, according to the correspondence relationship between address translations of the first data packet and the second data packet in fig. 3, the second data packet after translation is determined, a corresponding session, called a first session, is created, and basic information of the first data packet and basic information of the second data packet are recorded in the first session, so as to generate translation information of the first session, for example, if the first data packet is an IPv6 data packet, the basic information is 4 elements corresponding to the IPv6 data packet in the above embodiment, and the basic information of the second data packet is 4 elements corresponding to the IPv4 data packet in the above embodiment. After the first session is established, the first data packet in each data stream establishes a corresponding relationship with the corresponding first session, for example, the head of the first data packet records the first session to which the first data packet belongs, so that after a subsequent first data packet in the data stream arrives, the conversion information of the first session can be acquired according to the first session to which the first data packet recorded in the head of the first packet belongs, and therefore, based on the conversion information, the network address of the first data packet is converted to obtain the second data packet, and the conversion efficiency of the second data packet is improved.
Wherein, the conversion information is used for representing at least one of the following corresponding relations:
the IPv4 source address corresponding to the IPv6 source address, and the IPv4 source address are unoccupied IPv4 addresses selected from an IPv4 address pool;
the source port of the IPv4 source address corresponds to the source port of the IPv6 source address, and the source port of the IPv4 source address is selected from the idle port of the IPv4 source address;
the IPv4 destination address corresponding to the IPv6 destination address, and the IPv4 destination address is obtained by matching the IPv6 destination address with a preset mapping rule;
the destination port of the IPv4 destination address corresponds to the destination port of the IPv6 destination address, and the destination port of the IPv6 destination address is the same as the destination port of the IPv4 destination address.
Step 402, storing the conversion information in a hash table of the first session.
In this embodiment, the conversion information is stored in the hash table of the first session, and the conversion information is stored in the hash table, so that the speed of searching the conversion information of the first session can be increased.
It should be noted that, as shown in fig. 5, the first data packet flow is an IPv6 flow, the HashKey of the IPv6 flow is calculated and obtained from four elements of the IPv6 flow, that is, from the source address, the destination address, the source port, and the destination port, and similarly, the second data packet flow obtained by conversion is an IPv4 flow, the HashKey of the IPv4 flow is calculated and obtained from a quadruple of the IPv4 flow after conversion, and the two hashkeys point to the same first session information. All the subsequent messages of the IPv6 flow and the IPv4 flow search the corresponding first session according to the four-tuple information of the messages and carry out the mutual conversion of the network addresses according to the first session information.
In the load balancing processing method of the packet in this embodiment, when the first data packet belonging to the first session is received, the conversion information of the first session is generated, and the conversion information is stored in the hash table of the first session, so that the lookup efficiency of the first session is improved. Based on the generated first session, the network address of the subsequent first data message can be converted according to the conversion information of the first session, so that the second data message meeting the network transmission requirement can be obtained, the service support of the first data message can be completed without great hardware change, the efficiency is improved, and the cost is reduced.
Based on the foregoing embodiment, this embodiment provides another load balancing processing method for a packet, and fig. 6 is a schematic flow chart of the load balancing processing method for a packet provided in this embodiment, as shown in fig. 6, where step 103 includes the following steps:
step 601, scheduling the second data message according to the set forwarding strategy to obtain the application server of the second data message.
The forwarding policy includes a mapping relationship between the second data packet and the corresponding application server, and the application server corresponding to the second packet can be determined according to the mapping relationship.
Step 602, according to the address of the application server, performing network address translation on the second data message, and adding a target flag bit in the second session to which the second data message belongs.
The target mark bit is used for representing that the second data message is obtained by converting the first data message.
Step 603, sending the second data packet to the application server.
In this embodiment, in order to send the second data packet to the corresponding server, the network address of the second data packet needs to be converted, so that the second data packet can be routed to the corresponding application server according to the address of the second data packet after the network address conversion, and the second data packet is sent to the application server.
Step 604, receiving the first feedback packet sent by the application server.
Step 605, when the target flag bit is found in the second session to which the first feedback packet belongs, the first feedback packet is converted according to the conversion information of the second session and the conversion information of the first session in sequence to obtain a second feedback packet. In the embodiment of the application, after the obtained second data message is sent to the corresponding application server, the application server may also feed back the corresponding feedback message, which is called a first feedback message.
The first feedback message and the second message belong to the same internet protocol, and the second feedback message and the first message belong to the same internet protocol.
In this embodiment, the first feedback packet is generated by the server according to the second packet, so that there is a corresponding relationship between the first feedback packet and the second packet, and a session to which the first feedback packet belongs is the second session. The conversion information of the second session is generated according to a mapping relationship between the address of the application server and the address carried by the second data packet, and the feedback packet obtained by converting the first feedback packet according to the conversion information of the second session is the same as the internet protocol based on the first feedback packet, for example, the first feedback packet and the feedback packet obtained by converting according to the conversion information of the second session may be based on IPv 4. If the target flag bit is found in the second session, it indicates that further conversion is required according to the conversion information of the first session. Specifically, according to the conversion information of the first session, the feedback packet obtained according to the conversion of the conversion information of the second session is converted to obtain a second feedback packet. The internet protocol on which the second feedback packet is based is different from the internet protocol on which the feedback packet converted according to the conversion information of the second session is based, for example: the second feedback message may be based on IPv6, and the feedback message converted from the conversion information of the second session may be based on IPv 4. And after the second feedback message is obtained, sending the second feedback message to the client equipment.
It should be noted that, if the target flag bit is not found in the second session, the first feedback packet is converted according to the conversion information of the second session, and conversion according to the conversion information of the first session is not required. In this case, a feedback packet obtained by converting the first feedback packet according to the conversion information of the second session is sent to the client device as the second feedback packet.
In an implementation manner of this embodiment, the second session and the first session are associated with each other, the first session is a stateless session, the second session is a stateful session, the second session may change according to a change of a TCP/UDP protocol state, and when the second session disappears due to the change of the TCP/UDP protocol state, the corresponding first session may end, that is, a lifecycle of the first session may be managed by a lifecycle of the second session.
Based on the foregoing embodiments, to illustrate the foregoing embodiments, the present implementation provides a scenario, that is, a usage scenario of load balancing, where the first data packet is a packet supporting an IPv6 protocol, and the second data packet is a packet supporting an IPv4 protocol. Fig. 7 is a schematic structural diagram of a load balancing scenario provided in this embodiment, and as shown in fig. 7, a border switch for client traffic access is configured, so that the border switch supports forwarding of an IPv6 protocol, and a dynamic routing protocol of the configured switch supports dynamic routing distribution of an IPv 6. The method comprises the steps of modifying the existing IPv4 load balancing equipment, issuing an IPv6 route through a dynamic routing protocol to access IPv6 traffic, adding an NAT64 module for converting the IPv6 traffic into IPv4 traffic, and processing the converted IPv4 traffic by using the original IPv4 load balancing processing logic, wherein according to the use scene of load balancing, a four-layer protocol processed by the NAT64 module is mainly TCP/UDP, and a three-layer protocol processed by the NAT 4 module is IPv6/IPv 4.
It should be noted that the explanation of the load balancing processing method for the packet is also applicable to the embodiment, and the principle is the same, and is not described herein again.
In the embodiment, through the improvement, a plurality of switches and application servers in the related IPv4 network architecture can support the client to access the existing service in an IPv6 mode without improvement, so that the efficiency is improved, and the cost is reduced.
In order to implement the foregoing embodiment, the present application further provides a load balancing processing apparatus for a packet.
Fig. 8 is a schematic structural diagram of a load balancing processing apparatus for a packet according to an embodiment of the present application.
As shown in fig. 8, the apparatus includes: an acquisition module 81, a conversion module 82 and a processing module 83.
The obtaining module 81 is configured to obtain a first data packet sent by a client.
A conversion module 82, configured to perform network address conversion on the first data packet by using conversion information of the first session according to the first session to which the first data packet belongs, so as to obtain a second data packet; wherein the first data message and the second data message are based on different internet protocols;
the processing module 83 is configured to perform load balancing processing on the second data packet to determine an application server of the second data packet, and send the second data packet to the application server.
Further, in a possible implementation manner of the embodiment of the present application, the processing module 83 is specifically configured to;
scheduling the second data message according to the set forwarding strategy to obtain an application server of the second data message;
according to the address of the application server, converting the network address of the second data message, and adding a target mark bit in a second session to which the second data message belongs; the target mark bit is used for representing that the second data message is obtained by converting the first data message;
and sending the second data message to the application server.
In a possible implementation manner of the embodiment of the present application, the apparatus further includes:
and the receiving module is used for receiving the first feedback message sent by the application server.
The conversion module 82 is configured to, if the target flag bit is found in the session to which the first feedback packet belongs, convert the first feedback packet according to the conversion information to obtain a second feedback packet.
In a possible implementation manner of the embodiment of the present application, the conversion module 82 is specifically configured to:
inquiring the first session to which the first data message belongs according to a message header in the first data message; according to the conversion information of the first session, inquiring an IPv4 destination address corresponding to an IPv6 destination address in the first data message and inquiring an IPv4 source address corresponding to an IPv6 source address in the first data message; and replacing the IPv6 destination address in the first data message with the IPv4 destination address, and replacing the IPv6 source address in the first data message with the IPv4 source address to obtain the second data message.
In a possible implementation manner of the embodiment of the present application, the conversion module 82 is further specifically configured to:
according to the conversion information of the first session, inquiring a source port of an IPv4 source address corresponding to the source port of the IPv6 source address in the first data message; replacing the source port of the IPv6 source address in the first data message by the source port of the IPv4 source address;
and/or inquiring a destination port of an IPv4 destination address corresponding to the destination port of the IPv6 destination address in the first data message according to the conversion information of the first session; and replacing the destination port of the IPv6 destination address in the first data message by the destination port of the IPv4 destination address.
In a possible implementation manner of the embodiment of the present application, the apparatus further includes:
a generating module, configured to generate conversion information of the first session when receiving the first data packet belonging to the first session;
wherein, the conversion information is used for representing at least one of the following corresponding relations:
the IPv4 source address corresponding to the IPv6 source address, and the IPv4 source address are unoccupied IPv4 addresses selected from an IPv4 address pool;
the source port of the IPv4 source address corresponding to the source port of the IPv6 source address, wherein the source port of the IPv4 source address is selected from the idle port of the IPv4 source address;
the IPv4 destination address corresponds to the IPv6 destination address, and the IPv4 destination address is obtained by matching the IPv6 destination address with a preset mapping rule;
the destination port of the IPv6 destination address corresponds to the destination port of the IPv4 destination address, and the destination port of the IPv6 destination address is the same as the destination port of the IPv4 destination address.
In a possible implementation manner of the embodiment of the present application, the apparatus further includes:
and the storage module is used for storing the conversion information into a hash table of the first session.
It should be noted that the foregoing explanation of the method embodiment is also applicable to the apparatus of this embodiment, and is not repeated herein.
In the load balancing processing apparatus for a packet in this embodiment, a first data packet sent by a client is obtained, and according to a first session to which the first data packet belongs, network address translation is performed on the first data packet by using translation information of the first session to obtain a second data packet, where the first data packet and the second data packet are based on different internet protocols, and load balancing processing is performed on the second data packet to determine an application server of the second data packet, and the second data packet is sent to the application server. In the application, aiming at two data messages with different network protocols, network address conversion is carried out based on conversion information so as to obtain the supported data messages, so that compatibility of various protocols is quickly realized based on small change.
In order to implement the foregoing embodiments, an embodiment of the present application provides a computer device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, where when the processor executes the computer program, the computer device implements the method for load balancing processing of a packet according to the foregoing method embodiments.
In order to achieve the above object, an embodiment of the present application provides a non-transitory computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements a method for load balancing processing of a packet according to the foregoing method embodiment.
In order to achieve the above object, an embodiment of the present application provides a computer program product, which when executed by an instruction processor in the computer program product, implements the method for load balancing processing of packets according to the foregoing method embodiment.
FIG. 9 illustrates a block diagram of an exemplary computer device suitable for use to implement embodiments of the present application. The computer device 12 shown in fig. 9 is only an example, and should not bring any limitation to the function and the scope of use of the embodiments of the present application.
As shown in FIG. 9, computer device 12 is in the form of a general purpose computing device. The components of computer device 12 may include, but are not limited to: one or more processors or processing units 16, a system memory 28, and a bus 18 that couples various system components including the system memory 28 and the processing unit 16.
Bus 18 represents one or more of any of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, and a processor or local bus using any of a variety of bus architectures. These architectures include, but are not limited to, Industry Standard Architecture (ISA) bus, Micro Channel Architecture (MAC) bus, enhanced ISA bus, Video Electronics Standards Association (VESA) local bus, and Peripheral Component Interconnect (PCI) bus, to name a few.
Computer device 12 typically includes a variety of computer system readable media. Such media may be any available media that is accessible by computer device 12 and includes both volatile and nonvolatile media, removable and non-removable media.
Memory 28 may include computer system readable media in the form of volatile Memory, such as Random Access Memory (RAM) 30 and/or cache Memory 32. Computer device 12 may further include other removable/non-removable, volatile/nonvolatile computer system storage media. By way of example only, storage system 34 may be used to read from and write to non-removable, nonvolatile magnetic media (not shown in FIG. 9, and commonly referred to as a "hard drive"). Although not shown in FIG. 9, a disk drive for reading from and writing to a removable, nonvolatile magnetic disk (e.g., a "floppy disk") and an optical disk drive for reading from or writing to a removable, nonvolatile optical disk (e.g., a Compact disk Read Only Memory (CD-ROM), a Digital versatile disk Read Only Memory (DVD-ROM), or other optical media) may be provided. In these cases, each drive may be connected to bus 18 by one or more data media interfaces. Memory 28 may include at least one program product having a set (e.g., at least one) of program modules that are configured to carry out the functions of embodiments of the application.
A program/utility 40 having a set (at least one) of program modules 42 may be stored, for example, in memory 28, such program modules 42 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each of which examples or some combination thereof may comprise an implementation of a network environment. Program modules 42 generally perform the functions and/or methodologies of the embodiments described herein.
Computer device 12 may also communicate with one or more external devices 14 (e.g., keyboard, pointing device, display 24, etc.), with one or more devices that enable a user to interact with computer device 12, and/or with any devices (e.g., network card, modem, etc.) that enable computing device 12 to communicate with one or more other computing devices. Such communication may be through an input/output (I/O) interface 22. Moreover, computer device 12 may also communicate with one or more networks (e.g., a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public Network such as the Internet) via Network adapter 20. As shown, network adapter 20 communicates with the other modules of computer device 12 via bus 18. It should be understood that although not shown in the figures, other hardware and/or software modules may be used in conjunction with computer device 12, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, among others.
The processing unit 16 executes various functional applications and data processing, for example, implementing the methods mentioned in the foregoing embodiments, by executing programs stored in the system memory 28.
In the description herein, reference to the description of the term "one embodiment," "some embodiments," "an example," "a specific example," or "some examples," etc., means that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the application. In this specification, the schematic representations of the terms used above are not necessarily intended to refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples. Furthermore, various embodiments or examples and features of different embodiments or examples described in this specification can be combined and combined by one skilled in the art without contradiction.
Furthermore, the terms "first", "second" and "first" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one such feature. In the description of the present application, "plurality" means at least two, e.g., two, three, etc., unless specifically limited otherwise.
Any process or method descriptions in flow charts or otherwise described herein may be understood as representing modules, segments, or portions of code which include one or more executable instructions for implementing steps of a custom logic function or process, and alternate implementations are included within the scope of the preferred embodiment of the present application in which functions may be executed out of order from that shown or discussed, including substantially concurrently or in reverse order, depending on the functionality involved, as would be understood by those reasonably skilled in the art of the present application.
The logic and/or steps represented in the flowcharts or otherwise described herein, e.g., an ordered listing of executable instructions that can be considered to implement logical functions, can be embodied in any computer-readable medium for use by or in connection with an instruction execution system, apparatus, or device, such as a computer-based system, processor-containing system, or other system that can fetch the instructions from the instruction execution system, apparatus, or device and execute the instructions. For the purposes of this description, a "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device. More specific examples (a non-exhaustive list) of the computer-readable medium would include the following: an electrical connection (electronic device) having one or more wires, a portable computer diskette (magnetic device), a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disc read-only memory (CDROM). Additionally, the computer-readable medium could even be paper or another suitable medium upon which the program is printed, as the program can be electronically captured, via for instance optical scanning of the paper or other medium, then compiled, interpreted or otherwise processed in a suitable manner if necessary, and then stored in a computer memory.
It should be understood that portions of the present application may be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, the various steps or methods may be implemented in software or firmware stored in memory and executed by a suitable instruction execution system. If implemented in hardware, as in another embodiment, any one or combination of the following techniques, which are known in the art, may be used: a discrete logic circuit having a logic gate circuit for implementing a logic function on a data signal, an application specific integrated circuit having an appropriate combinational logic gate circuit, a Programmable Gate Array (PGA), a Field Programmable Gate Array (FPGA), or the like.
It will be understood by those skilled in the art that all or part of the steps carried by the method for implementing the above embodiments may be implemented by hardware related to instructions of a program, which may be stored in a computer readable storage medium, and when the program is executed, the program includes one or a combination of the steps of the method embodiments.
In addition, functional units in the embodiments of the present application may be integrated into one processing module, or each unit may exist alone physically, or two or more units are integrated into one module. The integrated module can be realized in a hardware mode, and can also be realized in a software functional module mode. The integrated module, if implemented in the form of a software functional module and sold or used as a stand-alone product, may also be stored in a computer readable storage medium.
The storage medium mentioned above may be a read-only memory, a magnetic or optical disk, etc. Although embodiments of the present application have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present application, and that variations, modifications, substitutions and alterations may be made to the above embodiments by those of ordinary skill in the art within the scope of the present application.

Claims (15)

1. A load balancing processing method of messages is characterized by comprising the following steps:
acquiring a first data message sent by a client;
according to a first session to which the first data message belongs, converting the network address of the first data message by adopting conversion information of the first session to obtain a second data message; wherein the first data message and the second data message are based on different internet protocols;
and performing load balancing processing on the second data message to determine an application server of the second data message, and sending the second data message to the application server.
2. The load balancing method according to claim 1, wherein the load balancing processing is performed on the second data packet to determine an application server of the second data packet, and the second data packet is sent to the application server, including;
scheduling the second data message according to the set forwarding strategy to obtain an application server of the second data message;
according to the address of the application server, converting the network address of the second data message, and adding a target mark bit in a second session to which the second data message belongs; the target mark bit is used for representing that the second data message is obtained by converting the first data message;
and sending the second data message to the application server.
3. The method according to claim 2, wherein after the load balancing processing is performed on the second data packet to determine an application server of the second data packet and the second data packet is sent to the application server, the method further comprises:
receiving a first feedback message sent by the application server;
and if the target mark position is inquired in the session to which the first feedback message belongs, converting the first feedback message according to the conversion information to obtain a second feedback message.
4. The load balancing processing method according to any one of claims 1 to 3, wherein the performing, according to the first session to which the first data packet belongs, network address translation on the first data packet by using translation information of the first session to obtain the second data packet includes:
inquiring the first session to which the first data message belongs according to a message header in the first data message;
according to the conversion information of the first session, inquiring an IPv4 destination address corresponding to an IPv6 destination address in the first data message and inquiring an IPv4 source address corresponding to an IPv6 source address in the first data message;
and replacing the IPv6 destination address in the first data message with the IPv4 destination address, and replacing the IPv6 source address in the first data message with the IPv4 source address to obtain the second data message.
5. The load balancing processing method according to claim 4, wherein the performing, according to the first session to which the first data packet belongs, network address translation on the first data packet by using translation information of the first session to obtain the second data packet further comprises:
according to the conversion information of the first session, inquiring a source port of an IPv4 source address corresponding to the source port of the IPv6 source address in the first data message; replacing the source port of the IPv6 source address in the first data message by the source port of the IPv4 source address;
and/or inquiring a destination port of an IPv4 destination address corresponding to the destination port of the IPv6 destination address in the first data message according to the conversion information of the first session; and replacing the destination port of the IPv6 destination address in the first data message by the destination port of the IPv4 destination address.
6. The load balancing processing method according to claim 5, further comprising:
when the first data message belonging to the first session is received, generating conversion information of the first session;
wherein, the conversion information is used for representing at least one of the following corresponding relations:
the IPv4 source address corresponding to the IPv6 source address, and the IPv4 source address are unoccupied IPv4 addresses selected from an IPv4 address pool;
the source port of the IPv4 source address corresponding to the source port of the IPv6 source address, wherein the source port of the IPv4 source address is selected from the idle port of the IPv4 source address;
the IPv4 destination address corresponds to the IPv6 destination address, and the IPv4 destination address is obtained by matching the IPv6 destination address with a preset mapping rule;
the destination port of the IPv6 destination address corresponds to the destination port of the IPv4 destination address, and the destination port of the IPv6 destination address is the same as the destination port of the IPv4 destination address.
7. The load balancing processing method according to claim 6, wherein after the generating the conversion information of the first session when the first data packet belonging to the first session is received, the method further comprises:
and storing the conversion information into a hash table of the first session.
8. A load balancing processing device for messages is characterized by comprising:
the acquisition module is used for acquiring a first data message sent by a client;
the conversion module is used for converting the network address of the first data message by adopting the conversion information of the first session according to the first session to which the first data message belongs, so as to obtain a second data message; wherein the first data message and the second data message are based on different internet protocols;
and the processing module is used for carrying out load balancing processing on the second data message so as to determine an application server of the second data message and sending the second data message to the application server.
9. The load balancing processing apparatus according to claim 8, wherein the processing module is specifically configured to;
scheduling the second data message according to the set forwarding strategy to obtain an application server of the second data message;
according to the address of the application server, converting the network address of the second data message, and adding a target mark bit in a second session to which the second data message belongs; the target mark bit is used for representing that the second data message is obtained by converting the first data message;
and sending the second data message to the application server.
10. The load balancing processing apparatus according to claim 9, further comprising:
and the receiving module is used for receiving the first feedback message sent by the application server.
The conversion module is configured to query the target flag bit in the session to which the first feedback packet belongs, and convert the first feedback packet according to the conversion information to obtain a second feedback packet.
11. The load balancing processing apparatus according to any one of claims 8 to 10, wherein the conversion module is specifically configured to:
inquiring the first session to which the first data message belongs according to a message header in the first data message;
according to the conversion information of the first session, inquiring an IPv4 destination address corresponding to an IPv6 destination address in the first data message and inquiring an IPv4 source address corresponding to an IPv6 source address in the first data message;
and replacing the IPv6 destination address in the first data message with the IPv4 destination address, and replacing the IPv6 source address in the first data message with the IPv4 source address to obtain the second data message.
12. The load balancing processing apparatus according to claim 11, wherein the conversion module is further specifically configured to:
according to the conversion information of the first session, inquiring a source port of an IPv4 source address corresponding to the source port of the IPv6 source address in the first data message; replacing the source port of the IPv6 source address in the first data message by the source port of the IPv4 source address;
and/or inquiring a destination port of an IPv4 destination address corresponding to the destination port of the IPv6 destination address in the first data message according to the conversion information of the first session; and replacing the destination port of the IPv6 destination address in the first data message by the destination port of the IPv4 destination address.
13. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the load balancing method according to any one of claims 1 to 7 when executing the program.
14. A non-transitory computer-readable storage medium having stored thereon a computer program, wherein the program, when executed by a processor, implements the load balancing processing method according to any one of claims 1 to 7.
15. A computer program product, characterized in that instructions in the computer program product, when executed by a processor, perform the load balancing processing method according to any one of claims 1-7.
CN202110087862.2A 2021-01-22 2021-01-22 Message load balancing processing method and device and computer equipment Pending CN112866433A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110087862.2A CN112866433A (en) 2021-01-22 2021-01-22 Message load balancing processing method and device and computer equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110087862.2A CN112866433A (en) 2021-01-22 2021-01-22 Message load balancing processing method and device and computer equipment

Publications (1)

Publication Number Publication Date
CN112866433A true CN112866433A (en) 2021-05-28

Family

ID=76007938

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110087862.2A Pending CN112866433A (en) 2021-01-22 2021-01-22 Message load balancing processing method and device and computer equipment

Country Status (1)

Country Link
CN (1) CN112866433A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113890879A (en) * 2021-09-10 2022-01-04 鸬鹚科技(深圳)有限公司 Load balancing method and device for data access, computer equipment and medium
CN113973110A (en) * 2021-10-25 2022-01-25 北京奇艺世纪科技有限公司 Message generation method and device and electronic equipment
CN114338832A (en) * 2021-12-17 2022-04-12 上海道客网络科技有限公司 Network protocol conversion method and system of container cloud platform
CN114938374A (en) * 2022-05-10 2022-08-23 北京交通大学 Cross-protocol load balancing method and system

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130235871A1 (en) * 2012-03-12 2013-09-12 Comcast Cable Communications, Llc Stateless Protocol Translation
CN103428229A (en) * 2012-05-14 2013-12-04 百度在线网络技术(北京)有限公司 Data center system and device and method for providing service
CN107070983A (en) * 2017-01-23 2017-08-18 天地融科技股份有限公司 A kind of load-balancing method, equipment and system forwarded based on address

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130235871A1 (en) * 2012-03-12 2013-09-12 Comcast Cable Communications, Llc Stateless Protocol Translation
CN103428229A (en) * 2012-05-14 2013-12-04 百度在线网络技术(北京)有限公司 Data center system and device and method for providing service
CN107070983A (en) * 2017-01-23 2017-08-18 天地融科技股份有限公司 A kind of load-balancing method, equipment and system forwarded based on address

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113890879A (en) * 2021-09-10 2022-01-04 鸬鹚科技(深圳)有限公司 Load balancing method and device for data access, computer equipment and medium
CN113890879B (en) * 2021-09-10 2023-12-29 鸬鹚科技(深圳)有限公司 Load balancing method and device for data access, computer equipment and medium
CN113973110A (en) * 2021-10-25 2022-01-25 北京奇艺世纪科技有限公司 Message generation method and device and electronic equipment
CN113973110B (en) * 2021-10-25 2024-03-15 北京奇艺世纪科技有限公司 Message generation method and device and electronic equipment
CN114338832A (en) * 2021-12-17 2022-04-12 上海道客网络科技有限公司 Network protocol conversion method and system of container cloud platform
CN114338832B (en) * 2021-12-17 2023-08-18 上海道客网络科技有限公司 Network protocol conversion method and system of container cloud platform
CN114938374A (en) * 2022-05-10 2022-08-23 北京交通大学 Cross-protocol load balancing method and system
CN114938374B (en) * 2022-05-10 2023-05-23 北京交通大学 Cross-protocol load balancing method and system

Similar Documents

Publication Publication Date Title
CN112866433A (en) Message load balancing processing method and device and computer equipment
US6892245B1 (en) Management information base for a multi-domain network address translator
CN110784562B (en) Message forwarding method, domain name address query method, device, equipment and medium
US7154891B1 (en) Translating between globally unique network addresses
US7107360B1 (en) Network address translation in a gateway
CN108270676B (en) Network data processing method and device based on Intel DPDK
JP5588345B2 (en) System and method for generating functional addresses
KR101501963B1 (en) Method and system for implementing interconnection between internet protocol version 4 network and new network
CN102938795B (en) The method of IPv6 address access IPv4 resource is realized by tunnel and address transition
CN111212134A (en) Request message processing method and device, edge computing system and electronic equipment
US10382391B2 (en) Systems and methods for managing network address information
CN102204191A (en) A message transmission method and a network-network routing device
CN104243631A (en) Method and device for stateful conversion between IPv4 address and IPv6 address
CN107580079A (en) A kind of message transmitting method and device
CN110691150A (en) SDN-based IPv4 and IPv6 interconnection method and system
JP7448597B2 (en) Message generation method and device and message processing method and device
CN107070719B (en) Equipment management method and device
WO2011147351A1 (en) Method and edging device for creating forwarding table, forwarding message, and obtaining address
JP6104406B2 (en) Method and processing device for handling network protocol addresses
CN115225606B (en) Domain name access method and system of cross-network protocol of container cloud platform
CN108234325B (en) System based on IP anycast and message forwarding method
JP2006174399A (en) Communication method in group, system and recording medium
CN111935336B (en) IPv 6-based network governance method and system
CN115242882A (en) Method and device for accessing k8s container environment based on transport layer route
CN114268604B (en) Method and system for providing access service

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
CB02 Change of applicant information

Address after: Room 221, 2 / F, block C, 18 Kechuang 11th Street, Beijing Economic and Technological Development Zone, 100176

Applicant after: Jingdong Technology Holding Co.,Ltd.

Address before: Room 221, 2 / F, block C, 18 Kechuang 11th Street, Beijing Economic and Technological Development Zone, 100176

Applicant before: Jingdong Digital Technology Holding Co.,Ltd.

CB02 Change of applicant information
RJ01 Rejection of invention patent application after publication

Application publication date: 20210528

RJ01 Rejection of invention patent application after publication