Disclosure of Invention
In order to overcome the problem that network resource access is slow or even unavailable due to the configuration of a local area network with multiple operator networks in the prior art, an embodiment of the present invention provides a resource access method based on a local area network, where the local area network includes a switch, egress routers corresponding to the operator networks one to one, and DNS servers corresponding to the egress routers one to one, and the resource access method includes:
the exchanger receives a DNS request message of a user terminal;
the switch determines a distribution outlet router corresponding to the user terminal;
the switch sends the DNS request message to the distribution outlet router;
the distribution exit router sends the DNS request message to a distribution DNS server, and the distribution DNS server corresponds to the distribution exit router;
and the distribution DNS server acquires an IP address from a distribution operator network based on the DNS request message, and sends the IP address to the user terminal through the distribution outlet router and the switch, so that the user terminal accesses the resource of the distribution operator network based on the IP address, the switch and the distribution outlet router, and the distribution operator network corresponds to the distribution outlet router.
The DNS request message comprises an IP management address and DNS request information, wherein the IP management address is an IP management address in a local area network with the same configuration of each DNS server;
the switch sends the DNS request packet to the distribution egress router, including:
the switch inquires whether a routing table item corresponding to the IP management address exists in a preset switch routing table;
if not, the switch sends the DNS request message to the distribution outlet router;
the distribution exit router sends the DNS request message to a distribution DNS server, and the method comprises the following steps:
the distribution outlet router inquires whether a routing table item corresponding to the IP management address exists in a preset router routing table;
and if so, the distribution exit router sends the DNS request message to the distribution DNS server based on the queried routing table entry.
The method for sending the DNS request packet to the distribution egress router includes:
and the switch sends the DNS request message to the distribution outlet router based on the default route.
And the routing table entry inquired by the distribution outlet router is the direct route of the IP management address.
Wherein the switch determining a distribution egress router corresponding to the user terminal comprises:
and the switch determines an allocation outlet router corresponding to the user terminal based on a preset dynamic routing strategy.
On the other hand, the embodiment of the invention provides a resource access system, which comprises a switch, egress routers in one-to-one correspondence with each operator network, and DNS servers in one-to-one correspondence with each egress router;
the switch is used for receiving a DNS request message of a user terminal, determining a distribution outlet router corresponding to the user terminal, and sending the DNS request message to the distribution outlet router;
the distribution exit router is used for sending the DNS request message to a distribution DNS server, and the distribution DNS server corresponds to the distribution exit router;
the distribution DNS server is used for acquiring an IP address from a distribution operator network based on the DNS request message, and sending the IP address to the user terminal through the distribution outlet router and the switch, so that the user terminal accesses resources of the distribution operator network based on the IP address, the switch and the distribution outlet router, and the distribution operator network corresponds to the distribution outlet router.
The DNS request message comprises an IP management address and DNS request information, wherein the IP management address is an IP management address with the same configuration of each DNS server;
the switch is specifically used for receiving a DNS request message of a user terminal, determining a distribution outlet router corresponding to the user terminal, inquiring whether a routing table entry corresponding to the IP management address exists in a preset switch routing table, and if not, sending the DNS request message to the distribution outlet router;
the distribution exit router is specifically configured to query whether a routing table entry corresponding to the IP management address exists in a preset router routing table, and if so, send the DNS request packet to the distribution DNS server based on the queried routing table entry.
The switch comprises a default route, and a preset next hop router of the default route is the distribution outlet router;
the switch is further used for receiving a DNS request message of the user terminal, inquiring whether a routing table entry corresponding to the IP management address exists in a preset switch routing table, if not, sending the DNS request message to the distribution outlet router based on the default route.
And the routing table entry inquired by the distribution outlet router is a direct routing table entry of the IP management address.
The switch is specifically configured to receive a DNS request packet of a user terminal, and determine an egress router corresponding to the user terminal based on a preset dynamic routing policy.
The embodiment of the invention allocates DNS servers for each operator network in a local area network in a one-to-one corresponding manner, allocates outlet routers for each operator network in a one-to-one corresponding manner, when a user terminal needs to access resources, an exchanger determines an allocated outlet router of the user terminal, and sends a DNS request message to the allocated outlet router when receiving the message, the allocated outlet router acquires the returned IP address of the corresponding allocated operator network through the allocated DNS server corresponding to the allocated outlet router, and after receiving the IP address, a client terminal accesses the resources of the allocated operator network based on the allocated outlet router determined by the exchanger, so that the acquired IP address can be matched with the operator network used by the client terminal, and the phenomenon that when the user terminal accesses the corresponding IP address of a second operator network by using a first operator network does not occur, resulting in slow or even no access.
Detailed Description
In order to make the technical problems, technical solutions and advantageous effects solved by the present invention more clearly apparent, the present invention is further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
Fig. 1 is a flowchart illustrating a resource access method based on a local area network according to a first embodiment of the present invention. The local area network comprises a switch, exit routers which are in one-to-one correspondence with the operator networks, and DNS servers which are in one-to-one correspondence with the exit routers. The resource access method comprises the following steps:
step 101, a switch receives a DNS request message of a user terminal. Typically, the DNS request message includes DNS request information, which includes a URL address.
In step 102, the switch determines the distribution egress router corresponding to the user terminal. Since the plurality of egress routers are provided in the local area network, the switch determines in advance to which egress router the DNS request packet is to be sent. Specifically, the switch may determine, based on a preset dynamic routing policy, an allocation egress router corresponding to the user terminal. The dynamic routing policy may specifically be a user load balancing routing policy. After the switch configures the user load balancing routing strategy, the user terminal is randomly distributed to different egress links according to the size of the egress bandwidth in proportion to access the corresponding network, so as to form the current data forwarding path of the user terminal. And the switch transmits the data of the user terminal according to the data transmission path within the time that the user stops the aging of the internet surfing list items.
Step 103, the switch sends the DNS request message to the distribution egress router.
And step 104, the distribution exit router sends the DNS request message to a distribution DNS server. Wherein the distribution DNS server corresponds to the distribution egress router.
And 105, acquiring the IP address from the distribution operator network by the distribution DNS server based on the DNS request message, and sending the IP address to the user terminal through the distribution outlet router and the switch so that the user terminal accesses the resource of the distribution operator network based on the IP address, the switch and the distribution outlet router. Wherein, the distribution operator network corresponds to the distribution outlet router. The distributing DNS server recursively queries a public network DNS server of the distributing operator network based on the URL address to obtain an IP address corresponding to the URL address. After receiving the IP address, the user terminal generates a resource access request message corresponding to the IP address and sends the message to the switch, the switch sends the resource access request message to the distribution outlet router based on a predetermined data forwarding path of the user terminal, and finally the distribution outlet router sends the message to a distribution operator network so as to acquire corresponding network resources.
It should be noted that, in order to implement the resolution of the internal network resources, the resolution configuration of each DNS server set in the local area network is completely the same, and an upper level DNS recursive query is configured according to the operator where the upper connection router is located, so as to provide a network resource resolution service.
It is noted that the order between step 101 and step 102 may be interchanged.
The embodiment of the invention allocates DNS servers for each operator network in a local area network in a one-to-one corresponding manner, allocates outlet routers for each operator network in a one-to-one corresponding manner, when a user terminal needs to access resources, an exchanger determines an allocated outlet router of the user terminal, and sends a DNS request message to the allocated outlet router when receiving the message, the allocated outlet router acquires the returned IP address of the corresponding allocated operator network through the allocated DNS server corresponding to the allocated outlet router, and after receiving the IP address, a client terminal accesses the resources of the allocated operator network based on the allocated outlet router determined by the exchanger, so that the acquired IP address can be matched with the operator network used by the client terminal, and the phenomenon that when the user terminal accesses the corresponding IP address of a second operator network by using a first operator network does not occur, resulting in slow or even no access.
Fig. 2 is a flowchart illustrating a resource access method based on a local area network according to a second embodiment of the present invention. The local area network comprises a switch, exit routers which are in one-to-one correspondence with the operator networks, and DNS servers which are in one-to-one correspondence with the exit routers. The resource access method comprises the following steps:
step 201, the switch receives a DNS request message of a user terminal. Typically, the DNS request message includes DNS request information and an IP management address, and the DNS request information includes a URL address. Wherein the IP management address is an IP management address in the local area network with the same configuration of each DNS server. That is, each DNS server has the same IP management address.
Step 202, the switch inquires whether a routing table entry corresponding to the IP management address exists in a preset switch routing table.
And step 203, if the query result is negative, the switch sends the DNS request message to the distribution outlet router.
In order to prevent the DNS servers configured with the same IP management address from colliding, the switch routing table is not provided with a routing table entry of the DNS server. Specifically, the devices in the local area network communicate with each other by using a dynamic routing protocol, and the IP management address of the DNS server does not issue routing information in the dynamic routing protocol, so that a routing table entry without the DNS server in the switch routing table can be realized.
The IP management gateway of the user is arranged on the layer of the switch, the switch is provided with default routes which are in one-to-one correspondence with the exit routers, and the default routes take the corresponding exit routers as the next hop. When the switch queries the switch routing table, if the switch finds that no routing table entry of the DNS server exists in the table, the switch uses the default route and then matches with a preset dynamic routing strategy to send the DNS request message to the distribution outlet router.
Step 204, the distribution exit router inquires whether there is a routing table entry corresponding to the IP management address in a preset router routing table.
In step 205, if the query result is yes, the distribution egress router sends the DNS request packet to the distribution DNS server based on the queried routing table entry. And each exit router is provided with an IP management address direct routing of the DNS server. In practical operation, the egress router is physically connected to the corresponding DNS server, that is, direct routing can be implemented. After the distribution exit router receives the DNS request message, the DNS request message is directly forwarded to the corresponding distribution DNS server by the distribution exit router because the routing table entry in the router routing table has the direct route of the IP management address.
Step 206, the distribution DNS server obtains an IP address from the distribution operator network based on the DNS request message, and sends the IP address to the user terminal through the distribution egress router and the switch, so that the user terminal accesses the resource of the distribution operator network based on the IP address, the switch, and the distribution egress router. Wherein, the distribution operator network corresponds to the distribution outlet router. The distributing DNS server recursively queries a public network DNS server of the distributing operator network based on the URL address to obtain an IP address corresponding to the URL address. After receiving the IP address, the user terminal generates a resource access request message corresponding to the IP address and sends the message to the switch, the switch sends the resource access request message to the distribution outlet router based on a predetermined data forwarding path of the user terminal, and finally the distribution outlet router sends the message to a distribution operator network so as to acquire corresponding network resources.
It should be noted that, in order to implement the resolution of the internal network resources, the resolution configuration of each DNS server set in the local area network is completely the same, and an upper level DNS recursive query is configured according to the operator where the upper connection router is located, so as to provide a network resource resolution service.
The embodiment of the invention configures the IP management address of the DNS server on the exit router to directly connect the route, and the IP management address of the DNS server does not issue the routing information in the dynamic routing protocol, so that the DNS server configures the same IP management address, but because the route is not issued, the route table of the switch does not have the IP management address, and the DNS servers do not generate conflict.
The above is a detailed description of the local area network-based resource access method of the present invention, and the following will further describe a resource access system corresponding to the above method.
Fig. 3 is a schematic structural diagram of a resource access system according to an embodiment of the present invention. As shown, the resource access system 100 includes a switch 110, egress routers (as shown, a first egress router 120 and a second egress router 130) corresponding to the respective operator networks (as shown, a first operator network 200 and a second operator network 300), and DNS servers (as shown, a first DNS server 140 and a second DNS server 150) connected to the respective egress routers in a one-to-one correspondence.
The switch 110 is configured to receive a DNS request message of the user terminal 400, determine an egress router corresponding to the user terminal, and send the DNS request message to the egress router. Because a plurality of exit routers are arranged in the local area network, the switch is respectively connected with each exit router. Therefore, the switch determines in advance to which egress router the DNS request message is to be sent.
Specifically, the DNS request message includes an IP management address and DNS request information, and the IP management address is an IP management address with the same configuration for each DNS server. The switch is specifically configured to receive a DNS request message of a user terminal, determine an assignment exit router corresponding to the user terminal, query whether a routing table entry corresponding to the IP management address exists in a preset switch routing table, and send the DNS request message to the assignment exit router if the query result is negative.
Further, the switch comprises a default route, and the default route is a preset next hop router and is the distribution outlet router. The switch is further used for receiving a DNS request message of the user terminal, inquiring whether a routing table entry corresponding to the IP management address exists in a preset switch routing table, if not, sending the DNS request message to the distribution outlet router based on a default route.
Preferably, the switch is specifically configured to receive a DNS request packet of a user terminal, and determine, based on a preset dynamic routing policy, an egress router corresponding to the user terminal. The dynamic routing strategy is also described in detail above, and therefore will not be described herein.
And the distribution exit router is used for sending the DNS request message to a distribution DNS server, and the distribution DNS server corresponds to the distribution exit router.
Specifically, the distribution exit router is specifically configured to query whether there is a routing table entry corresponding to the IP management address in a preset router routing table, and if so, send the DNS request packet to the distribution DNS server based on the queried routing table entry. And the routing table entry inquired by the distribution outlet router is a direct routing table entry of the IP management address.
And the distribution DNS server is used for acquiring an IP address from a distribution operator network based on the DNS request message, and sending the IP address to the user terminal through the distribution outlet router and the switch, so that the user terminal accesses resources of the distribution operator network based on the IP address, the switch and the distribution outlet router, and the distribution operator network correspondingly distributes the outlet router.
The embodiment of the invention allocates DNS servers for each operator network in a local area network in a one-to-one corresponding manner, allocates outlet routers for each operator network in a one-to-one corresponding manner, when a user terminal needs to access resources, an exchanger determines an allocated outlet router of the user terminal, and sends a DNS request message to the allocated outlet router when receiving the message, the allocated outlet router acquires the returned IP address of the corresponding allocated operator network through the allocated DNS server corresponding to the allocated outlet router, and after receiving the IP address, a client terminal accesses the resources of the allocated operator network based on the allocated outlet router determined by the exchanger, so that the acquired IP address can be matched with the operator network used by the client terminal, and the phenomenon that when the user terminal accesses the corresponding IP address of a second operator network by using a first operator network does not occur, resulting in slow or even no access.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by a computer program, which can be stored in a computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. The storage medium may be a magnetic disk, an optical disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), or the like.
The foregoing is illustrative of one or more embodiments provided in connection with the detailed description and is not intended to limit the practice of the invention to the particular forms disclosed. Similar or identical methods, structures and the like as those of the present invention or several technical deductions or substitutions made on the premise of the conception of the present invention should be considered as the protection scope of the present invention.