The present invention relates to a method for establishing network connection, and more particularly to a method for establishing network connection between a server and a network device. The present invention also relates to a network connection system, in which the method for establishing network connection is used.
In order to take advantage of capability of a server of centrally processing data and conducting calculations, a server is conventionally connected to multiple network devices via a network to process data generated by the multiple network devices and performing various types of calculations in response to requirements from the multiple network devices. For establishing network connections of the server and the network devices, the server reads predetermined network addresses to connect to the network devices. However, such a network connection establishment method cannot be easily applied to network devices that use Dynamic Host Configuration Protocol (DHCP) to obtain network addresses. Since a network device that obtains the network address through the dynamic host configuration protocol may be assigned thereto a different network address whenever it is started, it is necessary to frequently manually update the network address for the server to connect to the network device.
Therefore, an object of the present invention is to provide a method for establishing network connection between a server and a network device, by which the server is capable of automatically locating and connecting to the network device.
The present invention provides a method for establishing network connection between a server and a network device, wherein the network device uses a dynamic host configuration protocol to obtain a network address in a specific network segment. The method comprises: the server obtaining a parameter set related to the network device, and starting to establish a network connection to the network device; checking whether the network connection is stable; and when it is determined that the network connection is unstable and the server fails to connect to the network device, the server automatically searching the network addresses in the specific network segment to locate the network device, and connecting to the network device when the network device is found.
The present invention provides a network connection system, which includes a server; a network; and a network device optionally connecting to the server via the network. For connecting to the server, the network device uses a dynamic host configuration protocol to obtain a network address of the network in a specific network segment, the server obtains a parameter set related to the network device and starts to establish a network connection to the network device. When the server determines that the network connection is unstable and the server fails to connect to the network device, the server automatically searches network addresses in the specific network segment to locate the network device, and connects to the network device when the network device is found.
The above contents of the present invention will become more readily apparent to those ordinarily skilled in the art after reviewing the following detailed description and accompanying drawings, in which:
The present invention will now be described more specifically with reference to the following embodiments. It is to be noted that the following descriptions of preferred embodiments of this invention are presented herein for purpose of illustration and description only; it is not intended to be exhaustive or to be limited to the precise form disclosed.
Please refer to
Further refer to
After obtaining the parameter set 100, the server 10 starts to establish network connection to the device 14 according to the parameter set 100 (Step S202). For example, if the parameter set 100 includes a MAC address of the network device 14 and a specific network segment, the server 10 can search each of the MAC addresses in the specific network segment, and compares the MAC addresses with the MAC address contained in the parameter set 100. Once the server found an MAC address in compliance with the MAC address contained in the parameter set 100, it is determined the network device 14 to be connected is located. In another example, if the parameter set 100 includes a network address assigned to the network device 14 by default, the server 10 can directly connect to the network device 14 at the assigned network address. Of course, for reconfirmation, it is preferable that the parameter set 100 includes not only the assigned network address but also a MAC address of the network device 14. Then the searching process of consistent MAC address can be performed for double check. The searching process, for example, may be executed according to an Address Resolution Protocol (ARP), and the MAC address of the network device 14 and the located MAC address by searching can be recorded in an ARP Table.
Afterwards, the server 10 determines whether the connection to the network device 14 is stable or not (Step S204). If the network connection cannot be successfully established, the connection status is, of course, determined to be unstable. Furthermore, the connection status can be determined, for example, according to a data packet transmission condition. Concretely, if the server 10 successfully receives required data from the network device 14. In response to different requirements, the criteria for determining whether the connection in a network is stable or not may vary. For example, the server 10 may determine whether the connection to the network device 14 is stable or not according to a transmission condition of data packets and continuity of contents of the received data packets. If the server 10 receives no response to a connecting requirement from the network device 14, or some contents of the received data are missing, it is determined that the connection is unstable. It is understood that those skilled in the art may refer to other parameters to determine whether the connection is established or stable depending on practical requirements. For example, the network device 14 may automatically and regularly or optionally send a state-indicating signal to the server 10 to show a stable or unstable state thereof.
Provided that the connection between the server 10 and the network device 14 is stable enough for qualified data transmission, whether a firmware version of the network device 14 is supported by the server 10 is determined (Step S206). In practical, firmware versions which are surely supported by the server 10 are first obtained. For example, there may be a file recording a list of firmware versions supported by the server 10. Then the firmware version of the network device 14 is compared with the recorded firmware versions. If it is found to be in the list, it is determined that the firmware version of the network device 14 is supported by the server 10. Then after a period of time, the flow proceeds to Step S204 again to recheck the connection condition between the server 10 and the network device 14. It is understood by those skilled in the art, the length of the period of time may be predetermined according to practical requirements. On the contrary, if it is determined in Step S206 that the server 10 cannot support the firmware version of the network device 14, the server 14 issues and sends a first warning signal to notify a manager of the situation (Step S208).
On the other hand, if it is determined in Step S204 that the connection between the server 10 and the network device 14 is unstable, a series of checks and actions to respond to the unstable connection are automatically performed. It is understood that effective communication between the server 10 and the network device 14 requires, for example, unblocked network, successful connection of the network device 14 to the network, active state of the network device 14, common communication protocol between the server and the network device 14, etc. Therefore, one or more of the above-described factors may be checked in order to automatically perform trouble-shooting tasks.
For example, as illustrated in
Hereinafter, the detail of Step S218 is described. Basically, the server 10 searches network addresses by way of the Address Resolution Protocol (ARP). The server 10 queries one of the network addresses based on ARP to request a MAC address of the network device corresponding to this network address. If there is no such network device existing, the server 10 would not receive any response. On the other hand, if a specified network device responds to the query with its MAC address, the server 10 would receive the MAC address and updates the MAC address recorded in the ARP Table and corresponding to the specified network address with the received MAC address. Meanwhile, the server 10 compares the newly updated MAC address with the MAC address included in the parameter set 100 to identify whether the specified network device is the network device 14 or not. Upon finding the network device 14, the flow proceeds from Step S220 to S202 to restart the establishment of connection. If the network device 14 is found after all the network addresses included in the specific network segment are checked, the flow proceeds from Step S220 to Step S212, i.e. issuing and sending the second warning signal to the manager. Desirably but not necessarily, the current network address of the network device 14 is stored into the parameter set 100 for possible restarting later.
It is understood from the above descriptions that by way of the method for establishing network connection between a server and a network device according to the present invention, the DHCP network address of the network device can be automatically found. Therefore, the problems encountered in the prior art can be solved, so it is not necessary to frequently manually update the network address for the server to connect to the network device.
While the invention has been described in terms of what is presently considered to be the most practical and preferred embodiments, it is to be understood that the invention needs not to be limited to the disclosed embodiment. On the contrary, it is intended to cover various modifications and similar arrangements included within the spirit and scope of the appended claims which are to be accorded with the broadest interpretation so as to encompass all such modifications and similar structures.
| Number | Date | Country | Kind |
|---|---|---|---|
| 109114103 | Apr 2020 | TW | national |