The subject matter herein generally relates to IP address automatic distribution system.
IP addresses can be automatically distributed to clients based on Dynamic Host Configuration Protocol (DHCP). A DHCP server processes DHCP request from the client and distributes an IP address to the client. Thus, to issue IP addresses based on DHCP, a DHCP server is essential.
Implementations of the present technology will now be described, by way of example only, with reference to the attached figures.
It will be appreciated that for simplicity and clarity of illustration, where appropriate, reference numerals have been repeated among the different figures to indicate corresponding or analogous elements. In addition, numerous specific details are set forth in order to provide a thorough understanding of the embodiments described herein. However, it will be understood by those of ordinary skill in the art that the embodiments described herein can be practiced without these specific details. In other instances, methods, procedures, and components have not been described in detail so as not to obscure the related relevant feature being described. The drawings are not necessarily to scale and the proportions of certain parts may be exaggerated to better illustrate details and features. The description is not to be considered as limiting the scope of the embodiments described herein.
A definition that applies throughout this disclosure will now be presented.
The term “comprising” means “including, but not necessarily limited to”; it specifically indicates open-ended inclusion or membership in a so-described combination, group, series, and the like.
The instant disclosure provides an internet protocol (IP) address automatic distribution system 100.
The requesting module 22 is configured to send an address resolution protocol (ARP) request to the switch 40 after a first random waiting time. The first random waiting time may be larger than five seconds. In an embodiment, each client 20 may have a different first random waiting time. In another embodiment, at least two clients 20 have a same first random waiting time. The switch 40 transmits individual address information of other clients 20 in response to the ARP request. The address information per client 20 includes IP address and media access control (MAC) address of the client 20. The IP determining module 24 is configured to determine an IP address which has not been used by other client 20 according to the address information and the network segment. The IP assigning module 26 is configured to assign the IP address to the client 20.
The detecting module 28 is configured to detect whether the assigned IP address of the client 20 conflicts with respective IP addresses of other clients 20 after the assignment. In an embodiment, the detecting module 28 can detect whether the IP address of the client 20 conflicts with other client 20 through an ARP command. When IP address of the client 20 is found to be in conflict with one of other clients 20, the comparing module 30 is configured to compare values of MAC addresses of clients 20 which conflict, to determine whether the value of the MAC address of the client 20 meets a preset condition. In an embodiment, the preset condition is the value of the MAC address of the client 20 being the smallest. In another embodiment, the preset condition is the value of the MAC address of the client 20 is the largest. The detecting module 28 is further configured to again detect whether the assigned IP address of the client 20 conflicts with other clients 20 after a second random waiting time when the IP address of the client 20 is not in conflict with other clients 20. In an embodiment, each of the clients 20 may have a waiting time which is randomly different (second random waiting time). In another embodiment, the clients 20 may have a waiting time which is the same length.
The IP distribution module 32 is configured to release the assigned IP address of the client 20 when the MAC address of the client 20 does not meet the preset condition. The IP distribution module 32 is further configured to release the assigned address of the client 20 when the IP address of the client 20 is in conflict with one of other clients 20 at the second random waiting time. The distribution module 32 is further configured to keep the assigned IP address of the client 20 when the IP address of the client 20 does not conflict with other client 20 at the second random waiting time. The switch 40 records the IP address which is assigned and not released and the MAC address of the client 20 when there is no conflict.
At block 302, the requesting module 22 sends an address resolution protocol (ARP) request to the switch 40 after a first random waiting time.
At block 304, the switch 40 transmits individual IP address and MAC address of other clients to the client 20 in response to the ARP request.
At block 306, the IP determining module 24 determines an IP address which has not been used according to the address information and the network segment where the client 20 is located.
At block 308, the IP assigning module 26 assigns the IP address to the client 20.
At block 310, the detecting module 28 detects whether the assigned IP address of the client 20 conflicts with respective IP addresses of other clients 20 after the assignment. In an embodiment, the detecting module 28 detects whether the assigned IP address of the client 20 conflicts with other client 20 through sending an ARP command. If the assigned IP address of the client 20 conflicts with one of other clients 20, the procedure goes block 312, otherwise the procedure goes to block 314
At block 312, the comparing module 30 compares values of MAC addresses of clients 20 which conflict, to determine whether the value of the MAC address of the client 20 meets a preset condition. If the MAC address of the client 20 meets the preset condition, the procedure goes block 314, otherwise the procedure goes to block 316.
At block 314, after a second random waiting time, the detecting module 28 again detects whether the assigned IP address of the client 20 conflicts with other clients 20. If the assigned IP address of the client 20 conflicts with one of other clients 20, the procedure goes block 316, otherwise the procedure goes to block 318.
At block 316, the IP distribution module 32 releases the assigned address of the client 20.
At block 318, the IP distribution module 32 keeps the assigned address of the client 20.
At block 320, the switch 40 records IP address which is assigned and not released and the MAC address of the client 20.
The embodiments shown and described above are only examples. Even though numerous characteristics and advantages of the present technology have been set forth in the foregoing description, together with details of the structure and function of the present disclosure, the disclosure is illustrative only, and changes may be made in the detail, comprising in matters of shape, size, and arrangement of the parts within the principles of the present disclosure, up to the full extent established by the broad general meaning of the terms used in the claims.