CN114285826B - Method, system, device and medium for configuring IP address and detecting conflict by distributed device - Google Patents

Method, system, device and medium for configuring IP address and detecting conflict by distributed device Download PDF

Info

Publication number
CN114285826B
CN114285826B CN202111625186.6A CN202111625186A CN114285826B CN 114285826 B CN114285826 B CN 114285826B CN 202111625186 A CN202111625186 A CN 202111625186A CN 114285826 B CN114285826 B CN 114285826B
Authority
CN
China
Prior art keywords
address
client
mac address
conflict
mac
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
CN202111625186.6A
Other languages
Chinese (zh)
Other versions
CN114285826A (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.)
Vtron Group Co Ltd
Original Assignee
Vtron Group 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 Vtron Group Co Ltd filed Critical Vtron Group Co Ltd
Priority to CN202111625186.6A priority Critical patent/CN114285826B/en
Publication of CN114285826A publication Critical patent/CN114285826A/en
Application granted granted Critical
Publication of CN114285826B publication Critical patent/CN114285826B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The invention provides a method, a system, equipment and a medium for configuring an IP address and detecting conflict by distributed equipment, wherein the method applied to a service end in the distributed equipment comprises the following steps: acquiring an available IP address in a first network segment, and distributing an IP address for a client when the MAC address of the client in the distributed equipment is received; mapping the IP address and the MAC address of the client; and sending the MAC addresses by broadcasting the request of all the allocated clients, and determining the IP address conflict condition of the clients by utilizing the arping command according to the IP addresses of the clients, the received MAC addresses of the clients and the mapping relation table. The method takes an arping command as a basis to allocate IP addresses, maps two addresses of the same client, serves as an important basis for subsequently detecting IP address conflict, and determines the conflict condition of the IP addresses of the client by utilizing broadcasting and the arping command. The method has low execution cost, realizes efficient IP address allocation and conflict detection, and improves the configuration efficiency of the client.

Description

Method, system, device and medium for configuring IP address and detecting conflict by distributed device
Technical Field
The present invention relates to the field of computer multimedia, and more particularly, to a method, system, device, and medium for a distributed device to configure IP addresses and detect conflicts.
Background
The conventional display system of the wall is generally composed of a plurality of boxes, each box is responsible for displaying and controlling an area, so that a large screen is displayed in a combined manner, and because of the display and control of a plurality of boxes, the system generally needs to be managed by an agent management system, namely, a multi-user control platform is provided by the agent management system, and the multi-user control also depends on that each box contained in the display system of the wall is allocated with an IP address (internet protocol address), so that each user can precisely control one or more boxes. In general, when IP addresses are assigned to boxes, a ping (Packet Internet Groper, internet packet explorer) command needs to be executed to determine available IP addresses, and manual operation is required, so that if the number of boxes is large, an IP address assignment conflict is likely to occur.
Disclosure of Invention
The invention aims to overcome at least one defect of the prior art, and provides a method, a system, equipment and a medium for configuring IP addresses and detecting conflicts of distributed equipment, which are used for solving the problems that the operation is troublesome and the IP address allocation conflicts are easy to occur when IP addresses are allocated to each box of a spliced wall display system in the prior art.
The technical scheme adopted by the invention comprises the following steps:
in a first aspect, the present invention provides a method for configuring an IP address and detecting a conflict by a distributed device, which is applied to a server in the distributed device, including: acquiring an available IP address in a first network segment, and distributing one of the available IP addresses to a client when the MAC address of the client in the distributed equipment is received; mapping the allocated IP address and the MAC address of the client to obtain a mapping relation table; and sending the MAC addresses by broadcasting the clients requesting all the allocated IP addresses in the first network segment, and after requesting and receiving the MAC addresses sent by the clients, determining the IP address conflict condition of the clients according to the IP addresses of the clients, the received MAC addresses of the clients and the mapping relation table by utilizing an arping command.
Further, according to the IP address of the client, the received MAC address of the client, and the mapping table, and by using an arping command, determining an IP address collision condition of the client, specifically: determining a first MAC address according to the IP address of the client and the mapping relation table; the first MAC address is the MAC address corresponding to the IP address of the client in the mapping relation table; judging whether the received MAC address of the client is the same as the first MAC address, if so, determining that the IP address conflict condition of the client is that no IP address conflict exists; if not, determining whether the IP address conflict situation of the client is that the IP address conflict occurs or not by utilizing the arping command.
Further, determining whether the IP address conflict situation of the client is that an IP address conflict occurs by using the arping command specifically includes: executing the arping command on the IP address of the client to obtain a second MAC address, judging whether the received MAC address of the client is the same as the second MAC address, if so, determining that the IP address conflict condition of the client is that no IP address conflict exists; if not, determining that the IP address conflict situation of the client is the occurrence of IP address conflict.
Further, the method comprises the following steps: and when the received MAC address of the client is the same as the second MAC address, replacing the first MAC address in the mapping relation table with the second MAC address.
Further, the method comprises the following steps: when the received MAC address of the client is different from the second MAC address, the IP address of the client and the received MAC address of the client are recorded.
Further, one of the available IP addresses is allocated to the client, and the allocated IP address and the MAC address of the client are mapped, specifically: distributing one of the available IP addresses to the client, and sending an MAC address corresponding to the distributed IP address to the client so that the client determines whether to send confirmation distribution information according to the MAC address corresponding to the available IP address; and after receiving the confirmation allocation information sent by the client, mapping the allocated IP address and the MAC address of the client.
In a second aspect, the present invention provides a method for configuring an IP address and detecting a conflict by a distributed device, which is applied to a client in the distributed device, and includes: sending the MAC address of the client to a server in the distributed equipment, so that the server distributes one of the available IP addresses for the client, and maps the distributed IP address and the MAC address of the client to obtain a mapping relation table; receiving the IP address distributed by the server; after receiving a request for sending the MAC address through broadcasting, sending the MAC address of the client to the server, so that the server can determine the IP address conflict condition of the client according to the IP address of the client, the MAC address of the client and the mapping relation table after receiving the request for the MAC address of the client and utilizing an arping command.
Further, the method comprises the following steps: and determining the IP address conflict condition of the client by using an arping command.
Further, the IP address conflict situation of the client is determined by using an arping command, specifically: when receiving the reply of the arping command, determining that the IP address conflict condition of the client side is that IP address conflict occurs; and when no reply of the arping command is received, determining that the IP address conflict situation of the client side is that no IP address conflict exists.
Further, sending the MAC address of the client to a server in the distributed equipment, so that the server distributes one of the available IP addresses for the client, and maps the distributed IP address and the MAC address of the client to obtain a mapping relation table; the IP address allocated by the server is received, specifically: sending the MAC address of the client to a server in the distributed equipment, so that the server distributes one of the available IP addresses for the client and sends out the MAC address corresponding to the distributed IP address; and receiving the IP address allocated by the server and the MAC address corresponding to the allocated IP address, judging whether the MAC address corresponding to the available IP address is the same as the MAC address of the client, if so, generating confirmation allocation information and sending the confirmation allocation information to the server so that the server maps the allocated IP address and the MAC address of the client to obtain a mapping relation table.
In a third aspect, the present invention provides a system for configuring IP addresses and detecting collisions for distributed devices, comprising: a server or a plurality of clients in the distributed equipment; the server side is used for acquiring an available IP address in the first network segment; the client is used for sending the MAC address of the client to the server; the server is further configured to allocate one of the available IP addresses to the client when receiving the MAC address of the client, and map the allocated IP address and the MAC address of the client to obtain a mapping relationship table; sending MAC addresses by broadcasting clients requesting all allocated IP addresses in the first network segment; the client is also used for sending the MAC address of the client to the server after receiving the request for sending the MAC address through broadcasting; the server is further configured to determine, after the request and the receipt of the MAC address of the client, an IP address conflict situation of the client according to the IP address of the client, the received MAC address of the client, and the mapping table, and by using an arping command.
In a fourth aspect, the present invention provides a computer device, including a memory and a processor, where the memory stores a computer program, and the processor implements the method for configuring IP addresses and detecting conflicts for the distributed device described above when executing the computer program.
The present invention also provides a computer readable storage medium having stored thereon a computer program which when executed by a processor implements the above-described method of configuring IP addresses and detecting conflicts for distributed devices.
Compared with the prior art, the invention has the beneficial effects that:
in the method and system for configuring IP addresses and detecting conflicts by using the distributed device according to the present embodiment, whether the server allocates an IP address or checks the conflict situation of the IP address of the client, the server allocates the IP address after receiving the MAC address sent by each client and maps two addresses of the same client, so as to obtain a mapping relationship table, which is used as an important basis for subsequently performing IP address detection conflicts, and in the process of checking conflicts, the broadcasting technology and the arping command are used to determine the conflict situation of the IP address of each client. Meanwhile, the client side can automatically and circularly detect and confirm the conflict condition of the IP address after being allocated with the IP address, so as to form double insurance. The method has low execution cost, can realize efficient IP address allocation and conflict detection, and improves the installation and configuration efficiency of each client.
Drawings
Fig. 1 is a schematic flow chart of steps S110 to S150 in embodiment 1 of the present invention.
Fig. 2 is a schematic flow chart of steps S151 to S154 in embodiment 1 of the present invention.
Fig. 3 is a schematic flow chart of steps S1541 to S1544 in embodiment 1 of the present invention.
Fig. 4 is a schematic flow chart of steps S210 to S220 in embodiment 1 of the present invention.
Fig. 5 is a schematic flow chart of steps S211 to S215 in embodiment 2 of the present invention.
Fig. 6 is a schematic flow chart of steps S231 to S233 in embodiment 2 of the present invention.
FIG. 7 is a schematic diagram showing the system configuration in example 3 of the present invention.
Detailed Description
The drawings are for illustrative purposes only and are not to be construed as limiting the invention. For better illustration of the following embodiments, some parts of the drawings may be omitted, enlarged or reduced, and do not represent the actual product dimensions; it will be appreciated by those skilled in the art that certain well-known structures in the drawings and descriptions thereof may be omitted.
Example 1
The embodiment provides a method for configuring an IP address and detecting conflict by a distributed device, which is applied to a server side in the distributed device, automatically acquires available IP addresses by using an arping command, and records each allocated IP address and a corresponding MAC address (media access control address) in a mapping relation table mode, wherein after IP address allocation is completed, the IP address conflict condition can be rapidly checked by using the mapping table and the arping command, and the whole method is low in implementation difficulty and low in cost.
In the method, the distributed equipment refers to a spliced wall display system, and consists of a plurality of boxes. The execution subject of the method, namely the server in the distributed equipment, refers to a master control server box in the distributed equipment, which is used for managing the rest boxes. The remaining boxes are referred to in the present method as clients of the distributed device.
As shown in fig. 1, the method includes:
s110: acquiring an available IP address in a first network segment;
in this step, the server needs to set an IP address of a certain network segment first, take the IP address as a first network segment, and obtain an available IP address in the first network segment. The specific means of acquisition is preferably acquisition by an arping command, in particular an ARP protocol (Address Resolution Protocol ) packet, the network is tested by a ping command check, the command is based on an ARP protocol broadcast mechanism, whether an IP address is already used on a network segment is checked by broadcasting, in the broadcasting process, if a reply is received, the IP address is occupied, and if no reply is received, the content of the reply is the MAC address of the IP address, and if the reply is not received, the IP address is not occupied yet.
S120: when the MAC address of the client in the distributed equipment is received, one available IP address is allocated to the client;
in this step, the client in the distributed device needs to wait to actively send out a custom protocol data packet at least including its MAC address, and the header of the data packet may be custom. That is, the allocation of the IP address needs to be actively initiated by the client of the distributed device, alternatively, the server may first send a request to each client, and request at least send its MAC address to the server, so that the server performs the allocation of the IP address. The need to assign an IP address based on the MAC address sent by the client is for recording in a later step.
In a preferred embodiment, when the available IP address is allocated to the client, the subsequent steps are only performed after receiving the acknowledgement allocation information of the client, based on which the specific implementation procedure of step S120 is: when the MAC address of the client in the distributed equipment is received, one of the available IP addresses is allocated to the client, and the MAC address corresponding to the allocated IP address is sent to the client.
In this step, after receiving the IP address allocated by the server and the MAC address corresponding to the allocated IP address, the client matches the corresponding MAC address with its own MAC address, and after confirming the matching, sends confirmation allocation information to the server to ensure that the allocated IP address corresponds to its own MAC address. After receiving the confirmation allocation information of the client, the server confirms that the allocated IP address has been allocated to the client successfully, if the confirmation allocation information is not received for a period of time, the server may choose to reallocate the IP address to the client.
S130: mapping the allocated IP address and the MAC address of the client to obtain a mapping relation table;
in this step, the server uses the mapping relation table to record the allocated IP address and the MAC address of the client corresponding to the allocated IP address, so as to be used as a basic basis for detecting whether the allocated IP addresses collide later, thereby more conveniently and rapidly detecting whether the allocated IP addresses collide.
S140: transmitting the MAC address by broadcasting a client requesting all the allocated IP addresses in the first network segment;
in this step, the server requests all clients with allocated IP addresses to send their own MAC addresses in a broadcast manner, so as to check whether the MAC addresses fed back by the clients are different from the MAC addresses recorded in the mapping relationship table.
S150: after the request and the receiving of the MAC address sent by the client, the IP address conflict condition of the client is determined according to the IP address of the client, the received MAC address of the client and the mapping relation table and by utilizing the arping command.
In this step, since one MAC address mapped corresponding to the IP address of the client is already recorded in the mapping table, it can be determined whether the MAC address fed back by the client is different from the MAC address recorded corresponding to the mapping table according to the IP address of the client, the received MAC address of the client, and the mapping table, and then, according to the arping command, the MAC address corresponding to the conflicting IP address is further determined if the IP address is in conflict, so as to determine whether there are a plurality of clients with the conflicting IP address.
Preferably, this step should be re-executed at regular intervals to ensure that the collision situation of the IP addresses of the clients is repeatedly detected and confirmed all the time.
As shown in fig. 2, the specific implementation procedure of step S150 is as follows:
s151: determining a first MAC address according to the IP address of the client and the mapping relation table;
in this step, the first MAC address is a MAC address corresponding to the IP address of the client in the mapping table.
S152: judging whether the received MAC address of the client is the same as the first MAC address, if so, executing step S153; if not, executing step S154;
s153: determining that the IP address conflict situation of the client is that the IP address conflict does not occur;
since the MAC address fed back by the request client is the same as the corresponding MAC address in the mapping relation table, namely the first MAC address, the IP address of the client only corresponds to one MAC address, and the MAC address is the MAC address of the client, and no conflict occurs in the allocation of the IP address.
S154: determining whether the IP address conflict situation of the client is that IP address conflict occurs or not by utilizing an arping command;
because the MAC address fed back by the requesting client is different from the corresponding MAC address in the mapping relationship table, that is, the first MAC address, the IP address of the requesting client may correspond to more than two MAC addresses, and there may be more than two clients using the same IP address at the same time, the allocation of the IP addresses may collide, or the current MAC address of the client may not coincide with the original mapping for some reasons, and the allocation of the IP addresses may not collide. The MAC address corresponding to the IP address of the client can be determined using the arping command to determine whether the allocation of the IP address conflicts.
As shown in fig. 3, the specific implementation procedure of step S154 is as follows:
s1541: executing an arping command on the IP address of the client to obtain a second MAC address;
s1542: judging whether the received MAC address of the client is the same as the second MAC address, if so, executing step S1543; if not, executing step S1544;
s1543: determining that the IP address conflict situation of the client is that the IP address conflict does not occur;
in this step, after the second MAC address is obtained by executing the arping command on the IP address of the client, if the received MAC address of the client is the same as the second MAC address, it means that there is only one MAC address corresponding to the current IP address, that is, the second MAC address. The reason that the MAC address fed back by the client is different from the first MAC address is that the MAC address of the client itself has changed for some reason, but the allocation of the IP address is not conflicting.
Preferably, in this step, although the case of the IP address collision of the client has been determined that no IP address collision has occurred, since the first MAC address is already different from the corresponding MAC address in the mapping table, it is proved that the MAC address of the client has been changed for some reason, and therefore the first MAC address in the mapping table should be replaced with the second MAC address, so that an unnecessary step needs to be performed to determine that no IP address collision has occurred when the IP address of the client is detected again.
S1544: determining that the IP address conflict situation of the client side is that IP address conflict occurs;
in this step, after the second MAC address is obtained by executing the ping command on the IP address of the client, if the received MAC address of the client is different from the second MAC address, which means that there are at least two MAC addresses corresponding to the current IP address actually, the reason why the MAC address fed back by the client is different from the first MAC address is that the allocation of the IP address conflicts.
Preferably, in this step, since it has been determined that the IP address of the client has collided, the collision situation should be recorded, and thus the IP address of the client and the received MAC address of the client should be recorded to mark the collision situation.
The method for configuring the IP address and detecting the conflict of the distributed equipment provided by the embodiment is applied to a server side in the distributed equipment, an arong command is taken as a basis, an available IP address in a certain network segment is obtained, after the MAC address sent by each client side is received, the IP address is distributed, mapping of two addresses of the same client side is made, a mapping relation table is obtained and is used as an important basis for detecting the conflict of the IP address subsequently, and in the process of detecting the conflict, the broadcasting technology and the arong command are utilized to determine the conflict condition of the IP address of each client side. The method has low execution cost, can realize efficient IP address allocation and conflict detection, and improves the installation and configuration efficiency of each client.
Example 2
Based on the same concept as the previous embodiment, the present embodiment provides a method for configuring an IP address and detecting a conflict by a distributed device, which is applied to a client in the distributed device, where the client refers to a box in the distributed device.
As shown in fig. 4, the method includes:
s210: sending the MAC address of the client to a server in the distributed equipment, and receiving the IP address distributed by the server;
in this step, the client actively sends out a custom protocol data packet at least including its MAC address to the server, where the header of the data packet may be custom. Alternatively, the client may send its own MAC address to the server after receiving the MAC address sending request from the server.
After receiving the self MAC address of the client, the server allocates one of the available IP addresses to the client, maps the allocated IP address and the MAC address of the client to obtain a mapping relation table, and meanwhile, the client receives the IP address allocated by the server.
In a preferred embodiment, as shown in fig. 5, the specific implementation procedure of step S210 is as follows:
s211: sending the MAC address of the client to a server in the distributed equipment;
s212: receiving an IP address allocated by a server and an MAC address corresponding to the allocated IP address sent by the server;
s213: judging whether the MAC address corresponding to the allocated IP address is the same as the MAC address of the client, if so, executing step S214; if not, executing step S215;
in this step, after the client acquires the allocated IP address, it is further confirmed whether the MAC address corresponding to the IP address matches the MAC address of the client.
S214: sending confirmation distribution information to a server;
if the MAC address corresponding to the IP address matches the own MAC address, it can be determined that the allocated IP address is the own IP address, and after receiving the confirmation allocation information, the server maps the allocated IP address with the MAC address of the client to obtain a mapping table.
S215: do not respond at all or send error allocation information to the server;
if the MAC address corresponding to the IP address does not match the own MAC address, which means that the allocated IP address cannot be used as the own IP address, the client may not respond to any response, and the server may resend the newly allocated IP address, or may feedback an error allocation message to the server, to inform the server that an IP address needs to be reassigned.
S220: after receiving a request for transmitting a MAC address through broadcasting, the MAC address of the client is transmitted to the server.
In this step, the server requests all clients to send their own MAC addresses through broadcasting, and then after receiving the request, the server sends the current MAC address to the server, so that after the server requests and receives the MAC address of the client, the server can determine the IP address conflict situation of the client according to the IP address of the client, the received MAC address of the client and the mapping table, and by using the arping command.
Therefore, the step is that the server side actively detects and confirms the IP address conflict condition of the client side.
In a preferred embodiment, the client may also actively detect and confirm the collision of its own IP address, so the method may perform the following steps while satisfying the condition to perform step S220 after performing step S215:
s230: and determining the IP address conflict condition of the client by using the arping command.
The step is that the client actively initiates the detection and confirmation of the conflict situation of the IP address of the client, and preferably, the step should be executed again at regular intervals so as to ensure that the conflict situation of the IP address of the client is repeatedly detected and confirmed all the time.
The specific implementation procedure of step S230 is as follows:
s231: determining the IP address conflict condition of the client by utilizing an arping command;
s232: judging whether a reply of an arping command is received, if yes, executing step S233; if not, go to step S234;
based on the arping command, whether a certain IP address is used on the network segment is checked through broadcasting, if a reply is received in the broadcasting process, the IP address is occupied, the content of the reply is the MAC address of the IP address, and if no reply is received, the IP address is unoccupied.
S233: determining that the IP address conflict situation of the client side is that IP address conflict occurs;
s234: determining that the IP address conflict situation of the client is that the IP address conflict does not occur;
the difference between the present embodiment and embodiment 1 is that the execution body of the present embodiment is a client in the distributed device, but both are based on the same inventive concept, so in the present embodiment, the same definition as mentioned in the foregoing two embodiments, the principle of the same steps executed by the same execution body and the beneficial effects thereof can be referred to the description in embodiment 1, and will not be repeated herein.
The method for configuring the IP address and detecting the conflict of the distributed equipment is applied to the client side in the distributed equipment, not only can the MAC address be confirmed again when the server side distributes the IP address, but also the IP address of the server side can be circularly detected to be in conflict after the IP address is distributed, and the method is parallel to the confirmation of the conflict condition of the IP addresses of all the client sides by the server side, so that double insurance is formed, and the conflict condition of the IP addresses of the client side can be more timely and accurately checked.
Example 3
Based on the same concept as embodiments 1 and 2, the present embodiment provides a system for configuring IP addresses and detecting conflicts by a distributed device, as shown in fig. 7, including a server 310 and a plurality of clients 320 of the distributed device.
The server 310 is configured to obtain an available IP address in the first network segment;
the client 320 is configured to send the MAC address of the client 320 to the server 310;
the service end 310 is configured to allocate one of the available IP addresses to the client 320 and send the MAC address corresponding to the allocated IP address to the client 320 when the MAC address of the client 320 is received
The client 320 is configured to receive the IP address allocated by the server 310 and the MAC address corresponding to the allocated IP address, determine whether the MAC address corresponding to the available IP address is the same as the MAC address of the client 320, if so, generate acknowledgement allocation information and send the acknowledgement allocation information to the server 310;
the server 310 is configured to map the allocated IP address and the MAC address of the client 320 to obtain a mapping relationship table; transmitting the MAC address by broadcasting the client 320 requesting all allocated IP addresses in the first network segment;
the client 320 is configured to send, after receiving a request for sending a MAC address through broadcasting, the MAC address of the client 320 to the server 320;
the server 310 is configured to, after requesting and receiving the MAC address sent by the client 320, determine, according to the IP address of the client, the received MAC address of the client 320, and the mapping table, an IP address collision condition of the client 320 by using an arping command.
The specific implementation procedure of the server 310 when determining the IP address conflict situation of the client 320320 is:
determining a first MAC address according to the IP address of the client 320 and the mapping table;
the first MAC address is a MAC address corresponding to the IP address of the client 320 in the mapping table;
judging whether the received MAC address of the client is the same as the first MAC address, if so, determining that the IP address conflict condition of the client 320 is that no IP address conflict exists; if not, the arping command is executed on the IP address of the client 320 to obtain a second MAC address, and whether the received MAC address of the client 320 is the same as the second MAC address is determined, if yes, it is determined that the IP address conflict situation of the client 320 does not occur; if not, the IP address conflict condition of the client 320 is determined to be that the IP address conflict occurs.
Preferably, the server 310 is further configured to replace the first MAC address in the mapping table with the second MAC address in determining whether the received MAC address of the client 320 is the same as the second MAC address.
The server 310 is further configured to record the IP address of the client 320 and the received MAC address of the client 320 when it is determined that the received MAC address of the client 320 is not identical to the second MAC address.
Preferably, the client 320 is further configured to determine, after being assigned to an IP address, an IP address conflict situation of the client 320 using an arping command. The specific process is as follows: when receiving the reply of the arping command, determining that the conflict situation of the IP address of the client 320 is that the IP address conflict occurs; when no reply to the arping command is received, it is determined that the IP address conflict situation of the client 320 is that no IP address conflict occurs.
The difference between the present embodiment and embodiments 1 and 2 is that the present embodiment is a system applying the foregoing 2 embodiments, but the three are based on the same inventive concept, so in the present embodiment, the same definitions as mentioned in the foregoing three embodiments, the same principle of the same steps executed by the same execution subject, and the advantages thereof will be referred to the description in embodiments 1 and 2, and will not be repeated herein.
Example 4
Based on the same concept as the foregoing embodiments, this embodiment provides a computer device including a memory storing a computer program and a processor implementing the method of configuring an IP address and detecting a conflict of the distributed devices provided in any one of embodiments 1 to 2 when the processor executes the computer program.
The present embodiment also provides a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements the method of configuring IP addresses and detecting conflicts for a distributed device provided by any one of embodiments 1-2.
It should be understood that the foregoing examples of the present invention are merely illustrative of the present invention and are not intended to limit the present invention to the specific embodiments thereof. Any modification, equivalent replacement, improvement, etc. that comes within the spirit and principle of the claims of the present invention should be included in the protection scope of the claims of the present invention.

Claims (9)

1. A method for configuring an IP address and detecting a conflict by a distributed device, which is applied to a server in the distributed device, and is characterized by comprising:
acquiring an available IP address in a first network segment, and distributing one of the available IP addresses to a client when the MAC address of the client in the distributed equipment is received;
mapping the allocated IP address and the MAC address of the client to obtain a mapping relation table;
the method comprises the steps that a client side requesting all allocated IP addresses in a first network segment sends MAC addresses through broadcasting, and after the MAC addresses sent by the client side are requested and received, the first MAC addresses are determined according to the IP addresses of the client side and the mapping relation table;
the first MAC address is the MAC address corresponding to the IP address of the client in the mapping relation table;
judging whether the received MAC address of the client is the same as the first MAC address, if so, determining that the IP address conflict condition of the client is that no IP address conflict exists; if not, executing an arping command on the IP address of the client to obtain a second MAC address, judging whether the received MAC address of the client is the same as the second MAC address, and if so, determining that the IP address conflict condition of the client is that no IP address conflict exists; if the IP address conflict conditions are different, the IP address conflict conditions of the client are determined to be the occurrence of IP address conflict.
2. The method for configuring an IP address and detecting a conflict of claim 1, further comprising:
and when the received MAC address of the client is the same as the second MAC address, replacing the first MAC address in the mapping relation table with the second MAC address.
3. The method for configuring an IP address and detecting a conflict of claim 1, further comprising:
when the received MAC address of the client is different from the second MAC address, the IP address of the client and the received MAC address of the client are recorded.
4. A method of configuring IP addresses and detecting collisions for a distributed device according to any of claims 1-3, characterized in that one of the available IP addresses is allocated to the client, and the allocated IP address and the MAC address of the client are mapped, in particular:
distributing one of the available IP addresses to the client, and sending an MAC address corresponding to the distributed IP address to the client so that the client determines whether to send confirmation distribution information according to the MAC address corresponding to the available IP address;
and after receiving the confirmation allocation information sent by the client, mapping the allocated IP address and the MAC address of the client.
5. A method for a distributed device to configure an IP address and detect conflicts, applied to a client in the distributed device, comprising:
sending the MAC address of the client to a server in the distributed equipment, so that the server distributes one available IP address for the client, and maps the distributed IP address and the MAC address of the client to obtain a mapping relation table;
receiving the IP address distributed by the server;
after receiving a request for sending an MAC address through broadcasting, sending the MAC address of the client to the server, so that the server determines a first MAC address according to the IP address of the client and the mapping relation table after receiving the request for the MAC address of the client;
the first MAC address is the MAC address corresponding to the IP address of the client in the mapping relation table;
the server side judges whether the received MAC address of the client side is the same as the first MAC address, if so, the IP address conflict condition of the client side is determined to be that IP address conflict does not occur, and the client side does not receive the reply of the arping command;
if not, executing the arping command on the IP address of the client to obtain a second MAC address, judging whether the received MAC address of the client is the same as the second MAC address, if so, determining that the IP address conflict condition of the client is that no IP address conflict exists, and the client does not receive a reply of the arping command; if the IP address conflict conditions are different, the IP address conflict condition of the client is determined to be the occurrence of the IP address conflict, and the client receives a reply of the arping command.
6. The method for configuring an IP address and detecting a conflict as recited in claim 5, wherein,
sending the MAC address of the client to a server in the distributed equipment, so that the server distributes one of the available IP addresses for the client, and maps the distributed IP address and the MAC address of the client to obtain a mapping relation table; the IP address allocated by the server is received, specifically:
sending the MAC address of the client to a server in the distributed equipment, so that the server distributes one of the available IP addresses for the client and sends out the MAC address corresponding to the distributed IP address;
and receiving the IP address allocated by the server and the MAC address corresponding to the allocated IP address, judging whether the MAC address corresponding to the available IP address is the same as the MAC address of the client, if so, generating confirmation allocation information and sending the confirmation allocation information to the server so that the server maps the allocated IP address and the MAC address of the client to obtain a mapping relation table.
7. A system for a distributed device to configure an IP address and detect conflicts, comprising: a server or a plurality of clients in the distributed equipment;
the server side is used for acquiring an available IP address in the first network segment;
the client is used for sending the MAC address of the client to the server;
the server is further configured to allocate one of the available IP addresses to the client when receiving the MAC address of the client, and map the allocated IP address and the MAC address of the client to obtain a mapping relationship table; sending MAC addresses by broadcasting clients requesting all allocated IP addresses in the first network segment;
the client is also used for sending the MAC address of the client to the server after receiving the request for sending the MAC address through broadcasting;
the server is further configured to determine a first MAC address according to the IP address of the client and the mapping relationship table after the request and the reception of the MAC address of the client; the first MAC address is the MAC address corresponding to the IP address of the client in the mapping relation table; judging whether the received MAC address of the client is the same as the first MAC address, if so, determining that the IP address conflict condition of the client is that no IP address conflict exists; if not, executing an arping command on the IP address of the client to obtain a second MAC address, judging whether the received MAC address of the client is the same as the second MAC address, and if so, determining that the IP address conflict condition of the client is that no IP address conflict exists; if the IP address conflict conditions are different, the IP address conflict conditions of the client are determined to be the occurrence of IP address conflict.
8. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor, when executing the computer program, implements the method of configuring IP addresses and detecting conflicts for a distributed device according to any of claims 1-6.
9. A computer readable storage medium having stored thereon a computer program, which when executed by a processor implements the method of configuring an IP address and detecting conflicts for a distributed device according to any of claims 1-6.
CN202111625186.6A 2021-12-28 2021-12-28 Method, system, device and medium for configuring IP address and detecting conflict by distributed device Active CN114285826B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111625186.6A CN114285826B (en) 2021-12-28 2021-12-28 Method, system, device and medium for configuring IP address and detecting conflict by distributed device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111625186.6A CN114285826B (en) 2021-12-28 2021-12-28 Method, system, device and medium for configuring IP address and detecting conflict by distributed device

Publications (2)

Publication Number Publication Date
CN114285826A CN114285826A (en) 2022-04-05
CN114285826B true CN114285826B (en) 2023-04-21

Family

ID=80877952

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111625186.6A Active CN114285826B (en) 2021-12-28 2021-12-28 Method, system, device and medium for configuring IP address and detecting conflict by distributed device

Country Status (1)

Country Link
CN (1) CN114285826B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105245639A (en) * 2015-11-19 2016-01-13 浪潮(北京)电子信息产业有限公司 Host and IP address conflict prevention method thereof
CN106790745A (en) * 2016-12-02 2017-05-31 互联网域名系统北京市工程研究中心有限公司 A kind of method and system based on IP conflicts and Real-time Alarm in ARP protocol real-time monitoring subnet
CN107835264A (en) * 2016-09-09 2018-03-23 鸿富锦精密电子(天津)有限公司 IP address automatic distribution system, method and client
RU2690749C1 (en) * 2018-05-22 2019-06-05 федеральное государственное казенное военное образовательное учреждение высшего образования "Краснодарское высшее военное училище имени генерала армии С.М. Штеменко" Министерства обороны Российской Федерации Method of protecting computer networks

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP3800038B2 (en) * 2001-06-08 2006-07-19 ティアック株式会社 Network device, server device, client device, network IP address assigning method and program
JP4685520B2 (en) * 2005-06-24 2011-05-18 オリンパス株式会社 IP address acquisition method
CN102546849B (en) * 2010-12-30 2014-10-08 华为技术有限公司 Detection method for IP (Internet Protocol) address conflict and network equipment
CN102761499B (en) * 2011-04-26 2015-02-04 国基电子(上海)有限公司 Gateway and method for preventing same from being attacked
CN110445887A (en) * 2019-08-12 2019-11-12 北京百佑科技有限公司 Repeat IP recognition methods, device and intelligent talk back equipment
CN112187877B (en) * 2020-09-10 2022-04-01 华云数据控股集团有限公司 Node awakening method based on distributed cluster and controlled terminal
CN112511663A (en) * 2020-11-20 2021-03-16 广州朗国电子科技有限公司 IP conflict detection method and device based on android system and storage medium
CN112637377B (en) * 2020-12-17 2023-10-10 上海云轴信息科技有限公司 Method and equipment for detecting IP address conflict

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105245639A (en) * 2015-11-19 2016-01-13 浪潮(北京)电子信息产业有限公司 Host and IP address conflict prevention method thereof
CN107835264A (en) * 2016-09-09 2018-03-23 鸿富锦精密电子(天津)有限公司 IP address automatic distribution system, method and client
CN106790745A (en) * 2016-12-02 2017-05-31 互联网域名系统北京市工程研究中心有限公司 A kind of method and system based on IP conflicts and Real-time Alarm in ARP protocol real-time monitoring subnet
RU2690749C1 (en) * 2018-05-22 2019-06-05 федеральное государственное казенное военное образовательное учреждение высшего образования "Краснодарское высшее военное училище имени генерала армии С.М. Штеменко" Министерства обороны Российской Федерации Method of protecting computer networks

Also Published As

Publication number Publication date
CN114285826A (en) 2022-04-05

Similar Documents

Publication Publication Date Title
KR100689734B1 (en) method and apparatus for allocating address in wireless network
US8713136B2 (en) Method of allocating IP address of image forming apparatus using DHCP, image forming apparatus and system of allocating IP address using DHCP
CN103856569B (en) A kind of method and apparatus of synchronous domain name system asset information
CN106341438B (en) Request processing method and device
US20080028071A1 (en) Communication load reducing method and computer system
CN101841520B (en) Domain name system and information processing method and device for domain name system
US20080056266A1 (en) Set top box address detection system and method thereof
CN108429824B (en) Address allocation method and device
CN110324281B (en) Vehicle-mounted network controller refreshing system and method
CN110661897A (en) Method and device for managing address
KR20160070471A (en) Method and apparatus for allocating ip address for direct communication mobile station
US20060253611A1 (en) Network address transition methods and systems
CN107615723A (en) A kind of Internet protocol address distribution method and trunking
CN114285826B (en) Method, system, device and medium for configuring IP address and detecting conflict by distributed device
CN110417876B (en) Session method, node server in distributed system and master control equipment
CN111629083B (en) Method and device for acquiring IP address, storage medium and electronic device
CN109474709A (en) The IP address dynamic allocation method and system and device of Ethernet access equipment
CN111629059A (en) Cluster communication method, system, equipment and computer readable storage medium
CN112367415B (en) Generation method and device of attribute information, electronic equipment and computer readable medium
CN107786682B (en) Method and device for processing DHCP REQUEST message
CN109151093A (en) A kind of method, apparatus, storage medium and computer equipment for distributing IP address
JP5678590B2 (en) Gateway device and IP communication relay method in gateway device
CN111064599B (en) Method and system for monitoring plug-in migration
CN110912997B (en) Method and device for checking Loopback interface of triangular networking
CN115051982B (en) Information processing method, system and storage medium based on FTP protocol

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