CN106790340B - Link scheduling method and device - Google Patents

Link scheduling method and device Download PDF

Info

Publication number
CN106790340B
CN106790340B CN201610266086.1A CN201610266086A CN106790340B CN 106790340 B CN106790340 B CN 106790340B CN 201610266086 A CN201610266086 A CN 201610266086A CN 106790340 B CN106790340 B CN 106790340B
Authority
CN
China
Prior art keywords
link
dns
resource pool
domain name
information
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.)
Active
Application number
CN201610266086.1A
Other languages
Chinese (zh)
Other versions
CN106790340A (en
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.)
Hangzhou H3C Technologies Co Ltd
Original Assignee
Hangzhou H3C Technologies 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 Hangzhou H3C Technologies Co Ltd filed Critical Hangzhou H3C Technologies Co Ltd
Priority to CN201610266086.1A priority Critical patent/CN106790340B/en
Publication of CN106790340A publication Critical patent/CN106790340A/en
Application granted granted Critical
Publication of CN106790340B publication Critical patent/CN106790340B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • 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
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/45Network directories; Name-to-address mapping
    • H04L61/4505Network directories; Name-to-address mapping using standardised directories; using standardised directory access protocols
    • H04L61/4511Network directories; Name-to-address mapping using standardised directories; using standardised directory access protocols using domain name system [DNS]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/50Address allocation
    • H04L61/5061Pools of addresses
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/56Provisioning of proxy services

Abstract

The embodiment of the invention discloses a link scheduling method and a device, wherein the method comprises the following steps: after receiving a first DNS request message carrying domain name information, the DNS proxy server firstly determines a resource pool corresponding to the domain name information and obtained by a request of a load balancing LB (server/server) device, wherein the resource pool comprises at least one link information; and determining target link information from at least one link information included in the resource pool, and sending a first DNS response message carrying a target link IP address corresponding to the target link information to the client.

Description

Link scheduling method and device
Technical Field
The present invention relates to the field of information communication technologies, and in particular, to a link scheduling method and apparatus.
Background
In a typical application networking based on DNS (Domain Name System ) link load sharing, when a client is used as an external internet user accessing an intranet server and accesses the intranet server (i.e. a server providing data services), the existing workflow is as follows: firstly, a client initiates a DNS request message to a local DNS server (serving as a DNS proxy server), wherein the DNS request message contains domain name information; the local DNS server then sends another DNS request message generated according to the DNS request message to an LB Device (Load Balancing Device, hereinafter abbreviated as LB Device); the LB device selects an optimal link from the multiple links according to a preset scheduling algorithm, and sends a link IP address corresponding to the optimal link to the local DNS server through a DNS response message; after receiving the link IP address, the local DNS server caches the corresponding relation between the link IP address and the domain name information, and sends the link IP address to the client, and the client acquires the link IP address sent by the local DNS server and executes subsequent actions for accessing the intranet server according to the link IP address, wherein for the DNS request message and the other DNS request message, the source address and the destination address corresponding to the DNS request message are different, and the specific data information carried by the DNS request message and the other DNS request message is the same.
For the existing work flow, after the local DNS server caches the correspondence between the link IP address and the domain name information, and receives the DNS request message about the domain name information sent by the client again, the local DNS server directly sends the DNS response message about the corresponding link IP address to the client, and does not request the LB device any more. As can be seen, in the existing work flow, all clients sending information about the same domain name access the intranet server through the same link IP address, and all traffic is transmitted on one link, which results in an excessive load on the link.
Disclosure of Invention
The embodiment of the invention discloses a link scheduling method and a link scheduling device, which are used for realizing load sharing of a link under the condition that a client uses a Domain Name System (DNS) proxy. The specific scheme is as follows:
in one aspect, an embodiment of the present invention provides a link scheduling method, which is applied to a domain name system DNS proxy server, and the method includes:
receiving a first DNS request message sent by a client, wherein the first DNS request message carries domain name information;
determining a resource pool corresponding to the domain name information requested by a load balancing LB device, wherein the resource pool comprises at least one link information, each link information comprises a link IP address corresponding to the domain name information, and the link information and the link IP address have unique correspondence;
determining target link information from the at least one link information contained in the resource pool;
and sending a first DNS response message carrying the IP address of the target link included by the target link information to the client.
On one hand, the embodiment of the invention also provides a link scheduling method, which is applied to the load balancing LB equipment and comprises the following steps:
receiving a second DNS request message sent by a DNS proxy server, wherein the second DNS request message carries domain name information, and the domain name information is the domain name information carried by a first DNS request message sent by a client to the DNS proxy server;
generating a resource pool containing at least one link message according to the domain name message, wherein each link message comprises a link IP address corresponding to the domain name message, and the link message and the link IP address have unique correspondence;
generating a second DNS response message corresponding to the second DNS request message, wherein the second DNS response message carries the resource pool;
sending the second DNS response message to the DNS proxy server, wherein the second DNS response message carries the resource pool, so that: and the DNS proxy server determines target link information from the resource pool and sends a first DNS response message carrying the target link IP address included by the target link information to the client.
In one aspect, an embodiment of the present invention further provides a link scheduling apparatus, which is applied to a domain name system DNS proxy server, and the apparatus includes: the system comprises a first request message receiving module, a resource pool determining module, a first target information determining module and a first response message sending module;
the first request message receiving module: the system comprises a first DNS request message used for receiving a first DNS request message sent by a client, wherein the first DNS request message carries domain name information;
the resource pool determination module: the resource pool is used for determining a resource pool corresponding to the domain name information obtained by a request of a load balancing LB device, wherein the resource pool comprises at least one link information, each link information comprises a link IP address corresponding to the domain name information, and the link information and the link IP address have unique correspondence;
the first target information determination module: for determining target link information from the at least one link information contained in the resource pool;
the first response message sending module: and the first DNS response message carrying the IP address of the target link included by the target link information is sent to the client.
On the other hand, an embodiment of the present invention further provides a link scheduling apparatus, which is applied to a load balancing LB device, and the apparatus includes: the resource pool generation module is used for generating a first response message;
the second request message receiving module: the DNS server is used for receiving a first DNS request message sent by a DNS proxy server, wherein the first DNS request message carries domain name information;
the resource pool generation module: the resource pool is used for generating a resource pool containing at least one link message according to the domain name message, wherein each link message comprises a link IP address corresponding to the domain name message, and the link message and the link IP address have unique correspondence;
the second response message generating module: the server is used for generating a second DNS response message corresponding to the second DNS request message, wherein the second DNS response message carries the resource pool;
the second response message sending module: the DNS proxy server is configured to send the second DNS reply message to the DNS proxy server, where the second DNS reply message carries the resource pool, so that: and the DNS proxy server determines target link information from the resource pool and sends a first DNS response message carrying the target link IP address included by the target link information to the client.
In the scheme, different from the prior art, after receiving a first DNS request message carrying domain name information, the DNS proxy server first determines a resource pool corresponding to the domain name information requested by a load balancing LB device, where the resource pool includes at least one link information, determines target link information from the at least one link information included in the resource pool, and sends a first DNS reply message carrying a target link IP address corresponding to the target link information to a client, so as to implement load sharing of a link when the client uses a domain name system DNS proxy. Of course, it is not necessary for any product or method of practicing the invention to achieve all of the above-described advantages at the same time.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a schematic flowchart of a link scheduling method according to an embodiment of the present invention;
fig. 2 is another flowchart illustrating a link scheduling method according to an embodiment of the present invention;
fig. 3 is a schematic structural diagram of a link scheduling apparatus according to an embodiment of the present invention;
fig. 4 is another schematic structural diagram of a link scheduling apparatus according to an embodiment of the present invention;
fig. 5 is a networking diagram of a domain name system DNS according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The embodiment of the invention provides a link scheduling method and a link scheduling device, which are used for realizing load sharing of a link under the condition that a client uses a Domain Name System (DNS) proxy.
First, a link scheduling method provided in an embodiment of the present invention is described below.
It should be noted that the link scheduling method provided by the embodiment of the present invention may be applied to a domain name system DNS proxy server. The DNS proxy server is communicated with the load balancing LB device, and the DNS proxy server is provided with a certain storage space for storing a received resource pool containing at least one link message and selecting the at least one link message contained in the resource pool. The storage space may be a locally carried storage space or an extended storage space.
In addition, it should be emphasized that the "first" in the "first DNS request message" and the "second" in the "second DNS request message" mentioned later in the embodiments of the present invention are only used for distinguishing the DNS proxy server from the DNS request message received by the LB device from the naming, and do not have any limiting meaning. The source address and the destination address corresponding to the first DNS request message and the second DNS request message are different, and the data information carried by the first DNS request message and the second DNS request message is the same.
An embodiment of the present invention provides a link scheduling method, as shown in fig. 1, which may include the following steps:
s101: receiving a first DNS request message sent by a client, wherein the first DNS request message carries domain name information;
it can be understood that, when a client has a requirement for accessing an intranet server, the client may send a first DNS request message to the DNS proxy server, and at this time, the DNS proxy server receives the first DNS request message, where the first DNS request message carries domain name information. The receiving of the first DNS request packet sent by the client may adopt the prior art, which is not described herein again. For example, when the domain name information of the intranet server is www.test.com, the domain name information carried in the first DNS request packet may be www.test.com.
S102: determining a resource pool corresponding to the domain name information requested by the load balancing LB equipment, wherein the resource pool comprises at least one link information, each link information comprises a link IP address corresponding to the domain name information, and the link information and the link IP address have unique correspondence;
after receiving the first DNS request packet carrying domain name information, the DNS proxy server may determine a resource pool corresponding to the domain name information requested by the LB device in order to feed back a link IP address corresponding to the requested domain name information to the client, and then perform subsequent processing based on the resource pool. It can be understood that the resource pool may be a resource pool (i.e., a resource pool already stored in a local area) corresponding to the domain name information obtained by the present request, or a resource pool corresponding to the domain name information obtained by the present request. In addition, the client may access the intranet server corresponding to the domain name information according to each link information included in the resource pool, and then perform the data service. The determination of the resource pool may adopt the prior art, which is not described herein.
In this embodiment, the LB device determines, based on the domain name, at least one piece of better link information, where the determined at least one piece of better link information may use any existing link selection mechanism, and the corresponding selection mechanism may be a bandwidth busy degree mechanism, and may sort the link information from low to high according to the busy degree of the current link, and select a plurality of pieces of link information with low busy degrees, which are ranked at the top, in the sort to form a resource pool; or the busy degree is quantified by adopting the prior art, and the link information with the busy degree lower than a certain threshold value is selected to be combined into a resource pool.
S103: determining target link information from the at least one link information contained in the resource pool;
it can be understood that, when the DNS proxy determines the resource pool corresponding to the domain name information requested by the LB device, the DNS proxy may determine the target link information from at least one link information included in the resource pool according to a preset link scheduling algorithm, where the preset link scheduling algorithm may be a round-robin selection algorithm, a random selection algorithm, or a minimum connection number selection algorithm, and the preset link scheduling algorithm may be adjusted according to an actual situation.
For example, at least one link information included in the resource pool is link information 1, link information 2, and link information 3, respectively, where each link information includes a link IP address uniquely corresponding to each link information, and the link information includes: link info 1-link IP address 1, link info 2-link IP address 2, and link info 3-link IP address 3. When the preset link scheduling algorithm is a polling selection algorithm, the link information 1, the link information 2 and the link information 3 may be circularly determined as target link information, and subsequent processes are performed; when the preset link scheduling algorithm is a random selection algorithm, one link information can be randomly selected from the link information 1, the link information 2 and the link information 3 to be determined as target link information; when the preset link scheduling algorithm is the minimum connection number selection algorithm, the link information with the minimum connection number in the link IP address 1, the link IP address 2, and the link IP address 3 respectively corresponding to the link information 1, the link information 2, and the link information 3 may be selected, and the link information with the minimum connection number may be determined as the target link information.
S104: and sending a first DNS response message carrying the target link IP address corresponding to the target link information to the client.
It should be noted that, after the DNS proxy server determines the target link information, a first DNS response packet carrying a target link IP address corresponding to the target link information is sent to the client, so that the client resolves the target link IP address after receiving the first DNS response packet, and accesses the intranet server corresponding to the domain name information according to the target link IP address. The first DNS reply message carrying the target link IP address corresponding to the target link information may be sent by using the prior art, which is not described herein again.
After receiving a first DNS request message carrying domain name information, the DNS proxy server first determines a resource pool corresponding to the domain name information, which is requested by a load balancing LB device, where the resource pool includes at least one link information, determines target link information from the at least one link information included in the resource pool, and sends a first DNS reply message carrying a target link IP address corresponding to the target link information to a client, thereby realizing load sharing of a link when the client uses a domain name system DNS proxy.
Furthermore, it should be noted that, for the first DNS request packet carrying the domain name information received by the DNS proxy server, it may be that the DNS proxy server receives the first DNS request packet related to the domain name information for the first time, or it may be that the DNS proxy server does not receive the first DNS request packet related to the domain name information for the first time. When the time is the first time, the DNS proxy server does not locally store the resource pool requested from the LB device for the domain name information to be accessed. When not the first time, the DNS proxy server may or may not locally store the resource pool for the domain name information requested from the LB device. Therefore, in order to ensure the response to the first DNS request packet, when the resource pool corresponding to the domain name information requested by the LB device is not locally stored, at this time, the link scheduling method provided in the embodiment of the present invention may further include:
sending a second DNS request message to the LB device, wherein the second DNS request message carries the domain name information, so that the LB device generates a resource pool corresponding to the domain name information;
and receiving a second DNS response message which is sent by the LB equipment and carries the resource pool.
It can be understood that, when determining the resource pool corresponding to the domain name information requested by the load balancing LB device and determining that the resource pool corresponding to the domain name information is not stored locally in the DNS proxy server, the DNS proxy server needs to request the resource pool corresponding to the domain name information from the LB device, that is, send a second DNS request packet carrying the domain name information to the LB device, receive the resource pool carrying the domain name information and sent by the LB device, and after receiving the resource pool, determine target link information from the at least one link information included in the resource pool, and send a first DNS reply packet carrying a target link IP address corresponding to the target link information to the client. The generation of the second DNS request message may adopt the prior art, which is not described herein. After receiving the resource pool, the DNS proxy server may store the correspondence between the domain name information and the resource pool.
In a specific implementation manner, in order to enable the LB device to distinguish whether a resource pool corresponding to the domain name information needs to be sent to the DNS proxy server, the second DNS request packet may further carry a predetermined field;
when judging that the predetermined field is valid, the LB device may generate a resource pool corresponding to the domain name information according to the second DNS request packet, and send the resource pool to the DNS proxy server. When the predetermined field is judged to be invalid, the LB device can send a DNS error message to the DNS proxy server, and after receiving the DNS error message, the DNS proxy server can send a second DNS request message to the LB device again or switch to the process in the prior art; or, the LB device may discard the second DNS request packet carrying the predetermined field silently, and at this time, when the DNS proxy server does not receive the second DNS response packet or the DNS error packet generated for the second DNS request packet and sent by the LB device within a certain time, the DNS proxy server may also send the second DNS request packet to the LB device again or switch to a flow in the prior art; it is certainly preferable that the process in the prior art is switched to after the number of times of sending the second DNS request packet to the LB device exceeds the predetermined number of times.
It is emphasized that the predetermined field may be a field which is not specified and legal by the current domain name system DNS protocol pre-negotiated by the DNS proxy and the LB device. In a specific implementation manner, the predetermined field may be a type field of the second DNS request packet. For example, the domain name information corresponding to the intranet server is www.test.com, the domain name information carried in the second DNS request packet is www.test.com, and the type field (predetermined field) carried in the second DNS request packet may be resource pool (0x 0099).
Further, after the storage time of the resource pool locally stored by the DNS proxy server is long, the link IP address corresponding to at least one link information included in the resource pool is not necessarily the superior link IP address corresponding to the current time, for example: the number of connections corresponding to the link IP address corresponding to the intranet server and existing in the resource pool to which the domain name information is directed is too large, and the link IP address corresponding to the intranet server and not existing in the resource pool to which the domain name information is directed is in an idle state, it is obvious that the link IP address not existing in the resource pool is wasted, and the link IP address existing in the resource pool is overloaded, so that the link IP address corresponding to at least one link information included in the resource pool is not necessarily the better link IP address corresponding to the current time. In order to better realize load sharing of the link IP address and improve the utilization rate of the link IP address, in one implementation, the resource pool may further include an aging time related to the resource pool;
the link scheduling method provided by the embodiment of the present invention may further include:
and when the storage time of the resource pool in the DNS proxy server exceeds the aging time, discarding the resource pool.
It can be understood that, after the resource pool is discarded, after the DNS proxy server receives the first DNS request for the domain name information corresponding to the discarded resource pool, it needs to request the LB device to obtain the resource pool again, or, when the resource pool is discarded, the DNS proxy server sends the second DNS request packet carrying the domain name information to the LB device again, and requests the LB device for the resource pool corresponding to the domain name information again. The specific value of the aging time may be set according to actual conditions, and is not limited herein.
Furthermore, for at least one link information included in the resource pool, a limit value exists for the number of connections that can be loaded by the link IP address corresponding to each link information, and the limit value also exists differently for different link IP addresses, in order to better utilize the link IP addresses in the system and improve the utilization rate of the link IP addresses, the link information further includes an allocable number corresponding to the link IP addresses;
the link scheduling method provided by the embodiment of the present invention may further include:
after a first DNS response message carrying a target link IP address corresponding to the target link information is sent to the client, the allocable number corresponding to the target link IP address is reduced by one until the corresponding allocable number is 0, and the target link IP address is not used for allocation any more; and the number of the first and second electrodes,
when the allocable numbers corresponding to the link IP addresses included in the at least one link information are all 0, the resource pool is discarded.
Further, after the DNS proxy server receives the first DNS request packet carrying the domain name information, the domain name information may be locally stored. In order to better improve the processing performance of the DNS proxy server, the link scheduling method provided in the embodiment of the present invention may further include:
when the resource pool is discarded, sending a second DNS request message to the LB device, wherein the second DNS request message carries the domain name information, so that the LB device regenerates the resource pool corresponding to the domain name information;
and receiving a second DNS response message which is sent by the LB device and carries the regenerated resource pool corresponding to the domain name information.
It can be understood that, when the requested resource pool is discarded, the second DNS request packet carrying the domain name information may be directly sent to the LB device, so as to avoid requesting the LB device again when the first DNS request packet is received again, increasing the processing load of the DNS proxy server, and at the same time, improving the processing efficiency of the first DNS request packet. And sending a second DNS request message carrying the domain name information to the LB device periodically until a resource pool corresponding to the domain name information is requested.
Specifically, after receiving a first DNS request message carrying domain name information sent by a client, the DNS proxy server determines a resource pool corresponding to the domain name information obtained from the LB device, determines target link information from at least one link information included in the resource pool, and sends a first DNS reply message carrying a target link IP address included in the target link information to the client; and, when a discard mechanism is reached that discards the resource pool, discarding the resource pool. When the resource pool is discarded, the DNS proxy server may directly send the second DNS request packet carrying the domain name information to the LB device, and re-request the resource pool corresponding to the domain name information from the LB device, or re-request the resource pool corresponding to the domain name information from the LB device after receiving the first DNS request packet carrying the domain name information again. The discarding mechanism comprises that the storage time of the resource pool stored in the DNS proxy server exceeds the aging time, and the allocable number corresponding to the link IP address and included in at least one link information in the resource pool is 0.
Corresponding to the above method embodiment, an embodiment of the present invention further provides a link scheduling method, which may be applied to a load balancing LB device, where the LB device communicates with a DNS proxy server, as shown in fig. 2, and the method may include the steps of:
s201: receiving a second DNS request message sent by a DNS proxy server, wherein the second DNS request message carries domain name information, and the domain name information is the domain name information carried by a first DNS request message sent by a client to the DNS proxy server;
it should be noted that, in a specific implementation manner, when the DNS proxy determines that the resource pool corresponding to the domain name information requested by the LB device is not locally stored, the DNS proxy sends a second DNS request packet carrying the domain name information to the LB device, and the LB device may receive the second DNS request packet sent by the DNS proxy by using the prior art, and perform a subsequent process according to the carried domain name information.
S202: generating a resource pool containing at least one link message according to the domain name message, wherein each link message comprises a link IP address corresponding to the domain name message, and the link message and the link IP address have unique correspondence;
it can be understood that, after receiving the second DNS request packet, the LB device generates a resource pool including at least one link information according to the domain name information. Different from the prior art, the prior art selects the currently optimal link information, and in the embodiment of the invention, at least one link information which is currently better is selected.
S203: generating a second DNS response message corresponding to the second DNS request message, wherein the second DNS response message carries the resource pool;
the generation of the second DNS reply message may adopt the prior art, which is not described herein again. It can be understood that the LB device may process multiple second DNS request messages at the same time, where the generated second DNS reply message has a correspondence with the received second DNS request message, and the LB device sends the generated second DNS reply message to the corresponding DNS proxy server through the correspondence. The correspondence may be determined, for example, by the source and destination IP addresses of the reply and request messages,
s204: sending the second DNS reply message to the DNS proxy server, where the second DNS reply message carries the resource pool, so that: and the DNS proxy server determines target link information from the resource pool and sends a first DNS response message carrying the target link IP address included by the target link information to the client.
It should be noted that, the sending of the second DNS reply message to the DNS proxy server may adopt the prior art, which is not described herein again.
After receiving a second DNS request packet carrying domain name information sent by a DNS proxy server, the LB device generates a resource pool containing at least one link information according to the domain name information, and sends the resource pool to the DNS proxy server, so that: after receiving any first DNS request message carrying the domain name information, the DNS proxy server determines target link information from the at least one link information contained in the resource pool; and sending a first DNS response message carrying the target link IP address corresponding to the target link information to the client. To enable load sharing of the link in case the client uses a domain name system, DNS, proxy.
Further, in a specific implementation manner, in order to enable the LB device to distinguish whether the resource pool corresponding to the domain name information needs to be sent to the DNS proxy server, the second DNS request packet may further carry a predetermined field;
the link scheduling method provided by the embodiment of the present invention may further include:
judging whether the predetermined field is valid; when judged to be valid, S202 is executed.
It can be understood that, when the LB device determines that the preset field is valid, the second DNS request packet may be determined to be a request for requesting a resource pool corresponding to the domain name information, and the LB device may generate, according to the domain name information, a resource pool including at least one link information to feed back to the DNS proxy server. In a specific implementation manner, when the LB device determines that the predetermined field is invalid, the LB device may return a DNS error message to the DNS proxy server for the second DNS request message according to an existing DNS protocol, where the DNS error message may carry different error codes, so that the DNS proxy server may identify that the second DNS request message has an error according to the error code, or the LB device does not support the scheme provided by the embodiment of the present invention, and further make the DNS proxy server decide whether to resend the second DNS request message to request the resource pool or transfer to a flow in the prior art. It should be noted that when the LB device determines that the predetermined field is invalid, the LB device may discard the second DNS request packet silently, and when a second DNS response packet or a DNS error packet for the second DNS request packet carrying the domain name information, which is returned by the LB device, is not received within a certain time for the DNS proxy server, the LB device may resend the second DNS request packet to request the resource pool, or may directly transfer to a flow in the prior art.
Further, after the storage time of the resource pool locally stored by the DNS proxy server is long, the link IP address corresponding to at least one link information included in the resource pool is not necessarily the superior link IP address corresponding to the current time, for example: the number of connections corresponding to the link IP address corresponding to the intranet server and existing in the resource pool to which the domain name information is directed is too large, and the link IP address corresponding to the intranet server and not existing in the resource pool to which the domain name information is directed is in an idle state, it is obvious that the link IP address not existing in the resource pool is wasted, and the link IP address existing in the resource pool is overloaded, so that the link IP address corresponding to at least one link information included in the resource pool is not necessarily the better link IP address corresponding to the current time. In order to better realize load sharing of the link IP address and improve the utilization rate of the link IP address, in one implementation, the resource pool may further include an aging time related to the resource pool;
and when the storage time of the resource pool in the DNS proxy server exceeds the aging time, discarding the resource pool.
It can be understood that, after the resource pool is discarded, after the DNS proxy server receives the first DNS request for the domain name information corresponding to the discarded resource pool, it needs to request the LB device to obtain the resource pool again, or, when the resource pool is discarded, the DNS proxy server sends the second DNS request packet carrying the domain name information to the LB device again, and requests the LB device for the resource pool corresponding to the domain name information again. The specific value of the aging time may be set according to actual conditions, and is not limited herein.
Further, for at least one link information included in the resource pool, a limit value exists for the number of connections that can be loaded by the link IP address corresponding to each link information, and the limit value also exists differently for different link IP addresses, in order to better utilize the link IP addresses in the system and improve the utilization rate of the link IP addresses, the link information further includes an allocable number corresponding to the link IP addresses, so that after the DNS proxy server sends the first DNS reply packet carrying the target link IP address included in the target link information to the client, the allocable number corresponding to the target link IP address is reduced by one until the corresponding allocable number is 0, the target link IP address is no longer used for allocation; and the number of the first and second electrodes,
and when judging that the assignable quantity corresponding to the link IP address included in the at least one link information is 0, the DNS proxy server discards the resource pool.
In order to more clearly describe the scheme provided by the embodiment of the present invention, the following describes the link scheduling method provided by the embodiment of the present invention by referring to fig. 5 through a specific application example.
Fig. 5 is a networking diagram of a domain name system DNS, wherein a Local DNS is a DNS proxy according to an embodiment of the present invention; the Client host is the Client mentioned in the embodiment of the invention; cluster represents a network group which respectively comprises network operators ISP-1, ISP-2 and ISP-3, three links to an intranet server Intermal server, namely Link1, Link2 and Link3 (respectively corresponding to Link IP addresses of 1.0.0.1, 2.0.0.1 and 3.0.0.1); LBdevice is the LB device mentioned in the embodiments of the present invention; the Internal server is the intranet server mentioned in the embodiment of the present invention, and the domain name information of the intranet server is www.test.com.
In one implementation, the workflow may be: the Client host sends a first DNS request message carrying domain name information www.test.com to a Local DNS, the Local DNS determines a resource pool which is obtained from a load balancing LB device through request and corresponds to the domain name information 'www.test.com' and contains at least one link information, one link information is selected from the resource pool, and a link IP address (a first DNS response message) corresponding to the link information is sent to the Client host. When determining that the resource pool which is obtained by the request of the LB device and corresponds to the domain name information 'www.test.com' and contains at least one link information is not stored locally, sending a second DNS request message carrying the domain name information 'www.test.com' to the LB device, determining the resource pool containing at least one link information by the LB device according to the domain name information 'www.test.com' carried in the second DNS request message, and sending the resource pool (a second DNS response message) to the Local DNS.
It can be seen that through the workflow, the Client host can realize load sharing of the link under the condition of using the Local DNS proxy.
Corresponding to the foregoing method embodiment, an embodiment of the present invention further provides a link scheduling apparatus, as shown in fig. 3, which may be applied to a domain name system DNS proxy server, where the apparatus may include: a first request message receiving module 301, a resource pool determining module 302, a first target information determining module 303 and a first reply message sending module 304;
the first request packet receiving module 301: the system comprises a first DNS request message used for receiving a first DNS request message sent by a client, wherein the first DNS request message carries domain name information;
the resource pool determination module 302: the resource pool is used for determining a resource pool corresponding to the domain name information obtained by a request of a load balancing LB device, wherein the resource pool comprises at least one link information, each link information comprises a link IP address corresponding to the domain name information, and the link information and the link IP address have unique correspondence;
the first target information determination module 303: for determining target link information from the at least one link information contained in the resource pool;
the first response packet sending module 304: and the first DNS response message carrying the IP address of the target link included by the target link information is sent to the client.
After receiving a first DNS request message carrying domain name information, the DNS proxy server first determines a resource pool corresponding to the domain name information, which is requested by a load balancing LB device, where the resource pool includes at least one link information, determines target link information from the at least one link information included in the resource pool, and sends a first DNS reply message carrying a target link IP address corresponding to the target link information to a client, so as to implement load sharing of a link when the client uses a domain name system DNS proxy.
Specifically, the link scheduling apparatus provided in the embodiment of the present invention may further include a second request packet sending module and a second response packet receiving module;
the second request message sending module: the server is used for sending a second DNS request message to the LB device when the resource pool corresponding to the domain name information requested by the LB device is not stored locally, wherein the second DNS request message carries the domain name information, so that the LB device generates the resource pool corresponding to the domain name information;
the second response message receiving module: and the second DNS response message carrying the resource pool and sent by the LB device is received.
Specifically, the second DNS request message also carries a predetermined field;
and the LB device executes the step of generating the resource pool corresponding to the domain name information when judging that the preset field is valid.
Specifically, the resource pool further includes an aging time related to the resource pool;
the link scheduling apparatus provided by the embodiment of the present invention may further include a first discarding module;
the first discarding module: the method comprises the step of discarding the resource pool when the storage time of the resource pool in the DNS proxy server exceeds the aging time.
Specifically, the link information further includes an allocable number corresponding to the link IP address;
the link scheduling device provided by the embodiment of the invention can also comprise an allocable quantity minus one module and a second discarding module;
the assignable quantity is reduced by one module: after sending a first DNS response message carrying the target link IP address included in the target link information to the client, reducing the allocable number corresponding to the target link IP address by one until the corresponding allocable number is 0, wherein the target link IP address is not used for allocation any more;
the second discarding module: and discarding the resource pool when the allocable numbers corresponding to the link IP addresses included in the at least one link information are all 0.
The link scheduling device provided by the embodiment of the present invention may further include a third request message sending module and a third response message receiving module;
the third request message sending module: the server is configured to send a second DNS request packet to the LB device when the resource pool is discarded, where the second DNS request packet carries the domain name information, so that the LB device regenerates the resource pool corresponding to the domain name information;
the third response message receiving module: and the second DNS response message carrying the resource pool corresponding to the regenerated domain name information and sent by the LB device is received.
Corresponding to the foregoing method embodiment, an embodiment of the present invention further provides a link scheduling apparatus, which may be applied to a load balancing LB device, as shown in fig. 4, where the apparatus may include: a second request message receiving module 401, a resource pool generating module 402, a second response message generating module 403 and a second response message sending module 404;
the second request packet receiving module 401: the DNS server is used for receiving a first DNS request message sent by a DNS proxy server, wherein the first DNS request message carries domain name information;
the resource pool generation module 402: the resource pool is used for generating a resource pool containing at least one link message according to the domain name message, wherein each link message comprises a link IP address corresponding to the domain name message, and the link message and the link IP address have unique correspondence;
the second response packet generating module 403: the server is used for generating a second DNS response message corresponding to the second DNS request message, wherein the second DNS response message carries the resource pool;
the second response packet sending module 404: the DNS proxy server is configured to send the second DNS reply message to the DNS proxy server, where the second DNS reply message carries the resource pool, so that: and the DNS proxy server determines target link information from the resource pool and sends a first DNS response message carrying the target link IP address included by the target link information to the client.
After receiving a second DNS request packet carrying domain name information sent by a DNS proxy server, the LB device generates a resource pool containing at least one link information according to the domain name information, and sends the resource pool to the DNS proxy server, so that: after receiving any first DNS request message carrying the domain name information, the DNS proxy server determines target link information from the at least one link information contained in the resource pool; and sending a first DNS response message carrying the target link IP address corresponding to the target link information to the client. To enable load sharing of the link in case the client uses a domain name system, DNS, proxy.
Specifically, the second DNS request message may further carry a predetermined field:
the link scheduling device provided by the embodiment of the invention can also comprise a field judgment module;
the field judging module: for determining whether the predetermined field is valid; and when the judgment is valid, triggering the resource pool generation module 402.
Specifically, the resource pool may further include an aging time related to the resource pool;
and when judging that the storage time of the resource pool stored in the DNS proxy server exceeds the aging time, the DNS proxy server discards the resource pool.
Specifically, the link information further includes an allocable number corresponding to the link IP address, so that after the DNS proxy server sends the first DNS reply packet carrying the target link IP address included in the target link information to the client, the allocable number corresponding to the target link IP address is reduced by one until the corresponding allocable number is 0, and the target link IP address is no longer used for allocation; and the number of the first and second electrodes,
and when judging that the allocable number corresponding to the link IP address and included by the at least one link information is 0, the DNS proxy server discards the resource pool.
For the system/apparatus embodiments, since they are substantially similar to the method embodiments, the description is relatively simple, and reference may be made to some descriptions of the method embodiments for relevant points.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
Those skilled in the art will appreciate that all or part of the steps in the above method embodiments may be implemented by a program to instruct relevant hardware to perform the steps, and the program may be stored in a computer-readable storage medium, which is referred to herein as a storage medium, such as: ROM/RAM, magnetic disk, optical disk, etc.
The above description is only for the preferred embodiment of the present invention, and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention shall fall within the protection scope of the present invention.

Claims (12)

1. A link scheduling method is applied to a Domain Name System (DNS) proxy server, and comprises the following steps:
receiving a first DNS request message sent by a client, wherein the first DNS request message carries domain name information;
determining a resource pool corresponding to the domain name information requested by a load balancing LB device, wherein the resource pool comprises at least one link information, each link information comprises a link IP address corresponding to the domain name information, and the link information and the link IP address have unique correspondence;
determining target link information from the at least one link information contained in the resource pool;
sending a first DNS response message carrying the IP address of the target link included in the target link information to the client;
when the resource pool corresponding to the domain name information requested by the LB device is not locally stored, the method further includes:
sending a second DNS request message to the LB device, wherein the second DNS request message carries the domain name information, so that the LB device generates a resource pool corresponding to the domain name information;
and receiving a second DNS response message which is sent by the LB equipment and carries the resource pool.
2. The method of claim 1, wherein the resource pool further comprises an aging time for the resource pool;
the method further comprises the following steps:
and when the storage time of the resource pool in the DNS proxy server exceeds the aging time, discarding the resource pool.
3. The method of claim 1, wherein the link information further includes an allocable number corresponding to a link IP address;
the method further comprises the following steps:
after a first DNS response message carrying the target link IP address included by the target link information is sent to the client, reducing the allocable number corresponding to the target link IP address by one until the corresponding allocable number is 0, wherein the target link IP address is not used for allocation any more;
and when the allocable number corresponding to the link IP address included in the at least one link information is all 0, discarding the resource pool.
4. The method of claim 3, further comprising:
when the resource pool is discarded, sending a second DNS request message to the LB device, wherein the second DNS request message carries the domain name information, so that the LB device regenerates the resource pool corresponding to the domain name information;
and receiving a second DNS response message which is sent by the LB equipment and carries the regenerated resource pool corresponding to the domain name information.
5. A link scheduling method is applied to a load balancing LB device, and comprises the following steps:
receiving a second DNS request message sent by a DNS proxy server, wherein the second DNS request message carries domain name information, and the domain name information is the domain name information carried by a first DNS request message sent by a client to the DNS proxy server; the second DNS request packet is sent to the LB device when the DNS proxy server does not locally store the resource pool corresponding to the domain name information requested to be obtained;
generating a resource pool containing at least one link message according to the domain name message, wherein each link message comprises a link IP address corresponding to the domain name message, and the link message and the link IP address have unique correspondence;
generating a second DNS response message corresponding to the second DNS request message, wherein the second DNS response message carries the resource pool;
sending the second DNS response message to the DNS proxy server, wherein the second DNS response message carries the resource pool, so that: and the DNS proxy server determines target link information from the resource pool and sends a first DNS response message carrying the target link IP address included by the target link information to the client.
6. The method according to claim 5, wherein the link information further includes an allocable number corresponding to a link IP address, so that after the DNS proxy server sends a first DNS reply message carrying the target link IP address included in the target link information to the client, the allocable number corresponding to the target link IP address is reduced by one until the corresponding allocable number is 0, and the target link IP address is no longer used for allocation; and the number of the first and second electrodes,
and when judging that the allocable number corresponding to the link IP address and included by the at least one link information is 0, the DNS proxy server discards the resource pool.
7. A link scheduling device applied to a Domain Name System (DNS) proxy server, the device comprising: the system comprises a first request message receiving module, a resource pool determining module, a first target information determining module and a first response message sending module;
the first request message receiving module: the system comprises a first DNS request message used for receiving a first DNS request message sent by a client, wherein the first DNS request message carries domain name information;
the resource pool determination module: the resource pool is used for determining a resource pool corresponding to the domain name information obtained by a request of a load balancing LB device, wherein the resource pool comprises at least one link information, each link information comprises a link IP address corresponding to the domain name information, and the link information and the link IP address have unique correspondence;
the first target information determination module: for determining target link information from the at least one link information contained in the resource pool;
the first response message sending module: the first DNS response message carrying the IP address of the target link included by the target link information is sent to the client;
the device further comprises: a second request message sending module and a second response message receiving module;
the second request message sending module: the server is used for sending a second DNS request message to the LB device when the resource pool corresponding to the domain name information requested by the LB device is not stored locally, wherein the second DNS request message carries the domain name information, so that the LB device generates the resource pool corresponding to the domain name information;
the second response message receiving module: and the second DNS response message carrying the resource pool and sent by the LB device is received.
8. The apparatus of claim 7, wherein the resource pool further comprises an aging time for the resource pool;
the apparatus also includes a first discard module;
the first discarding module: the method comprises the step of discarding the resource pool when the storage time of the resource pool in the DNS proxy server exceeds the aging time.
9. The apparatus of claim 7, wherein the link information further includes an allocable number corresponding to a link IP address;
the apparatus also includes an allocable quantity minus one module and a second discard module;
the assignable quantity is reduced by one module: after sending a first DNS response message carrying the target link IP address included in the target link information to the client, reducing the allocable number corresponding to the target link IP address by one until the corresponding allocable number is 0, wherein the target link IP address is not used for allocation any more;
the second discarding module: and discarding the resource pool when the allocable numbers corresponding to the link IP addresses included in the at least one link information are all 0.
10. The apparatus according to claim 9, wherein the apparatus further comprises a third request message sending module and a third response message receiving module;
the third request message sending module: the server is configured to send a second DNS request packet to the LB device when the resource pool is discarded, where the second DNS request packet carries the domain name information, so that the LB device regenerates the resource pool corresponding to the domain name information;
the third response message receiving module: and the second DNS response message carrying the resource pool corresponding to the regenerated domain name information and sent by the LB device is received.
11. A link scheduling apparatus applied to a Load Balancing (LB) device, the apparatus comprising: the resource pool generation module is used for generating a first response message;
the second request message receiving module: the DNS server is used for receiving a first DNS request message sent by a DNS proxy server, wherein the first DNS request message carries domain name information; the second DNS request packet is sent to the LB device when the DNS proxy server does not locally store the resource pool corresponding to the domain name information requested to be obtained;
the resource pool generation module: the resource pool is used for generating a resource pool containing at least one link message according to the domain name message, wherein each link message comprises a link IP address corresponding to the domain name message, and the link message and the link IP address have unique correspondence;
the second response message generating module: the server is used for generating a second DNS response message corresponding to the second DNS request message, wherein the second DNS response message carries the resource pool;
the second response message sending module: the DNS proxy server is configured to send the second DNS reply message to the DNS proxy server, where the second DNS reply message carries the resource pool, so that: and the DNS proxy server determines target link information from the resource pool and sends a first DNS response message carrying the target link IP address included by the target link information to the client.
12. The apparatus according to claim 11, wherein the link information further includes an allocable number corresponding to a link IP address, so that after the DNS proxy server sends a first DNS reply packet carrying a target link IP address included in the target link information to the client, the allocable number corresponding to the target link IP address is decremented by one until the corresponding allocable number is 0, the target link IP address is no longer used for allocation; and the number of the first and second electrodes,
and when judging that the allocable number corresponding to the link IP address and included by the at least one link information is 0, the DNS proxy server discards the resource pool.
CN201610266086.1A 2016-04-25 2016-04-25 Link scheduling method and device Active CN106790340B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610266086.1A CN106790340B (en) 2016-04-25 2016-04-25 Link scheduling method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610266086.1A CN106790340B (en) 2016-04-25 2016-04-25 Link scheduling method and device

Publications (2)

Publication Number Publication Date
CN106790340A CN106790340A (en) 2017-05-31
CN106790340B true CN106790340B (en) 2020-11-06

Family

ID=58972063

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610266086.1A Active CN106790340B (en) 2016-04-25 2016-04-25 Link scheduling method and device

Country Status (1)

Country Link
CN (1) CN106790340B (en)

Families Citing this family (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107894752B (en) * 2017-11-13 2020-12-04 阳信东泰精密金属有限公司 Numerical control machine tool system based on multiple communication means
CN108011994B (en) * 2017-12-15 2022-03-01 网宿科技股份有限公司 Method and system for querying DNS (Domain name System) record
CN108173979B (en) * 2017-12-25 2021-03-12 新华三信息安全技术有限公司 Message processing method, device, equipment and storage medium
CN112565481B (en) * 2018-11-21 2022-04-12 Oppo广东移动通信有限公司 Electronic equipment, domain name query method and related product
CN111953806B (en) * 2020-07-13 2023-05-12 深信服科技股份有限公司 Link selection method, device, computer equipment and computer storage medium
CN112286911B (en) * 2020-12-15 2021-06-04 中移(苏州)软件技术有限公司 Database management method and device, equipment and storage medium
CN114363288A (en) * 2021-12-16 2022-04-15 北京华耀科技有限公司 Message processing method and device, link load balancing equipment and storage medium
CN114584518B (en) * 2022-03-31 2023-10-20 中国工商银行股份有限公司 Websocket load balancing method and system based on resource pool
CN114629822A (en) * 2022-04-18 2022-06-14 北京小米移动软件有限公司 Link detection method and device, electronic equipment and storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102244613A (en) * 2011-08-11 2011-11-16 深信服网络科技(深圳)有限公司 DNS (domain name system)-based multilink traffic balancing method, gateway and network
CN104283804A (en) * 2014-10-27 2015-01-14 杭州华三通信技术有限公司 Link load balancing method and device
CN104301417A (en) * 2014-10-22 2015-01-21 网宿科技股份有限公司 Load balancing method and device

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102244613A (en) * 2011-08-11 2011-11-16 深信服网络科技(深圳)有限公司 DNS (domain name system)-based multilink traffic balancing method, gateway and network
CN104301417A (en) * 2014-10-22 2015-01-21 网宿科技股份有限公司 Load balancing method and device
CN104283804A (en) * 2014-10-27 2015-01-14 杭州华三通信技术有限公司 Link load balancing method and device

Also Published As

Publication number Publication date
CN106790340A (en) 2017-05-31

Similar Documents

Publication Publication Date Title
CN106790340B (en) Link scheduling method and device
US11632420B2 (en) Point of presence management in request routing
US11115500B2 (en) Request routing utilizing client location information
US9787599B2 (en) Managing content delivery network service providers
US7548945B2 (en) System, network device, method, and computer program product for active load balancing using clustered nodes as authoritative domain name servers
US9985927B2 (en) Managing content delivery network service providers by a content broker
US9734472B2 (en) Request routing utilizing cost information
US10601767B2 (en) DNS query processing based on application information
US9456056B2 (en) Load balancing utilizing adaptive thresholding
US8468247B1 (en) Point of presence management in request routing
EP3567881B1 (en) Request routing and updating routing information utilizing client location information
US20180288141A1 (en) Http scheduling system and method of content delivery network
CN110336848B (en) Scheduling method, scheduling system and scheduling equipment for access request
CN106254576B (en) Message forwarding method and device
CN108632173B (en) Resource access system and resource access method based on local area network
KR102043031B1 (en) Server and method for load balancing of using the same

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
GR01 Patent grant
GR01 Patent grant