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

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

Info

Publication number
CN114285826A
CN114285826A CN202111625186.6A CN202111625186A CN114285826A CN 114285826 A CN114285826 A CN 114285826A CN 202111625186 A CN202111625186 A CN 202111625186A CN 114285826 A CN114285826 A CN 114285826A
Authority
CN
China
Prior art keywords
address
client
mac address
conflict
addresses
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.)
Granted
Application number
CN202111625186.6A
Other languages
Chinese (zh)
Other versions
CN114285826B (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, a device and a medium for configuring an IP address and detecting conflict of distributed equipment, wherein the method applied to a server side 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 receiving an MAC address of the client in the distributed equipment; mapping the IP address and the MAC address of the client; all the allocated clients are requested to send MAC addresses through broadcasting, and the IP address conflict condition of the clients is determined by using an arping command according to the IP addresses of the clients, the received MAC addresses of the clients and a mapping relation table. The method uses an arping command as a basis to allocate IP addresses, two addresses of the same client side are mapped and used as important bases for detecting IP address conflicts subsequently, and the conflict situation of the IP addresses of the client side is determined by utilizing broadcasting and the arping command. The method has low execution cost, realizes high-efficiency 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 for 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 configuring an IP address and detecting a conflict for a distributed device.
Background
An existing tiled wall display system generally comprises a plurality of boxes, each box is responsible for displaying and controlling one area, so that large-screen display is achieved in a combined mode, due to the fact that display and control of the boxes are involved, an agent management system is generally needed to manage the tiled wall display system, namely a multi-user control platform is provided through the agent management system, multi-user control also depends on the fact that IP addresses (internet protocol addresses) are distributed to the boxes contained in the tiled wall display system, and each user can accurately control one or more boxes. When the IP address is allocated to the box, a ping (Packet Internet Groper, Internet Packet explorer) command is generally required to be executed to determine an available IP address, manual operation is required, and when the number of boxes is large, IP address allocation conflicts are likely to occur.
Disclosure of Invention
The present invention is directed to overcome at least one of the above-mentioned drawbacks of the prior art, and provides a method, a system, a device, and a medium for configuring an IP address and detecting a conflict for a distributed device, so as to solve the problems in the prior art that an operation is troublesome when an IP address is allocated to each box of a tiled wall display system, and an IP address allocation conflict is easily caused.
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 for a distributed device, which is applied to a server in the distributed device, and includes: acquiring available IP addresses in a first network segment, and distributing one of the available IP addresses for a client when receiving an MAC address of the client in distributed equipment; mapping the allocated IP address and the MAC address of the client to obtain a mapping relation table; requesting all clients with allocated IP addresses in the first network segment to send MAC addresses through broadcasting, and 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 using an arping command after requesting and receiving the MAC addresses sent by the clients.
Further, according to the IP address of the client, the received MAC address of the client, and the mapping relationship table, and by using an arping command, determining an IP address conflict 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 a 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 or not, if so, determining that the IP address conflict condition of the client is that no IP address conflict occurs; if not, determining whether the IP address conflict condition of the client is the occurrence of the IP address conflict by using the arping command.
Further, determining whether the IP address conflict condition of the client is an IP address conflict by using the arping command, specifically: 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, and if so, determining that the IP address conflict condition of the client is no IP address conflict; if not, determining that the IP address conflict condition of the client is the IP address conflict.
Further, the method also includes: 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 also includes: and when the received MAC address of the client is different from the second MAC address, recording the IP address of the client and the received MAC address of the client.
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: allocating one of the available IP addresses for the client, and sending the MAC address corresponding to the allocated IP address to the client, so that the client determines whether to send out allocation confirmation information according to the MAC address corresponding to the available IP address; and mapping the allocated IP address and the MAC address of the client after receiving the allocation confirmation information sent by the client.
In a second aspect, the present invention provides a method for configuring an IP address and detecting a conflict for 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 allocates one of the available IP addresses to the client, and mapping the allocated IP address and the MAC address of the client to obtain a mapping relation table; receiving an 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 after the server requests and receives the MAC address of the client, the IP address of the client is determined according to the IP address of the client, the MAC address of the client and the mapping relation table and by using an arping command.
Further, the method also includes: and determining the IP address conflict condition of the client by utilizing the arping command.
Further, determining the IP address conflict condition of the client 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 the occurrence of IP address conflict; and when the reply of the arping command is not received, determining that the IP address conflict condition of the client side is that no IP address conflict occurs.
Further, the MAC address of the client is sent to a server in the distributed equipment, so that the server allocates one of the available IP addresses to the client, and the allocated IP address and the MAC address of the client are mapped to obtain a mapping relation table; receiving the IP address allocated by the server, specifically: sending the MAC address of the client to a server in the distributed equipment, so that the server allocates one of the available IP addresses to the client and sends out the MAC address corresponding to the allocated IP address; and receiving the IP address distributed by the server and the MAC address corresponding to the distributed 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 allocation confirmation information and sending the allocation confirmation information to the server so that the server maps the distributed 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 an IP address and detecting a conflict for a distributed device, including: a server or a plurality of clients in the distributed equipment; the server is used for acquiring an available IP address in a 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 relation table; sending MAC addresses by all clients with allocated IP addresses in the first network segment through a broadcast request; the client is also used for sending the MAC address of the client to the server after receiving a request for sending the MAC address through broadcasting; and the server is also used for determining the IP address conflict condition of the client by using an arping command according to the IP address of the client, the received MAC address of the client and the mapping relation table after requesting and receiving the MAC address of the client.
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 an IP address and detecting a conflict for a 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 for a distributed device to configure an IP address and detect a conflict.
Compared with the prior art, the invention has the beneficial effects that:
in the method and system for configuring an IP address and detecting a conflict for a distributed device provided in this embodiment, a server allocates an IP address and performs mapping of two addresses of the same client after receiving an MAC address sent by each client based on an arping command, so as to obtain a mapping relationship table, which is used as an important basis for subsequent IP address detection conflicts, and during a conflict checking process, a broadcast technology and an arping command are used to determine a conflict situation of an IP address of each client. Meanwhile, the client can also circularly detect and confirm the IP address conflict condition by itself after being allocated with the IP address, thereby forming double insurance. The method has low execution cost, can realize high-efficiency 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 flowchart illustrating 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 flowchart illustrating steps S210 to S220 in embodiment 1 of the present invention.
Fig. 5 is a flowchart illustrating steps S211 to S215 in embodiment 2 of the present invention.
Fig. 6 is a flowchart illustrating steps S231 to S233 in embodiment 2 of the present invention.
Fig. 7 is a schematic diagram of a system configuration in embodiment 3 of the present invention.
Detailed Description
The drawings are only for purposes of illustration and are not to be construed as limiting the invention. For a better understanding of the following embodiments, certain features of the drawings may be omitted, enlarged or reduced, and do not represent the size of an actual product; it will be understood 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 a conflict for a distributed device, which is applied to a server in the distributed device, and is used for automatically acquiring an available IP address by using an arping command, and recording each allocated IP address and a corresponding MAC address (media access control address) in a mapping relation table manner, so that after the IP address allocation is completed, the IP address conflict situation can be quickly checked by using the mapping table and the arping command, and the overall 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 main body of the method, namely the server in the distributed equipment, refers to one of the master server boxes in the distributed equipment 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, and uses the IP address as a first network segment, and obtains an available IP address in the first network segment. The specific means of obtaining is preferably to obtain through an arping command, where the arping command is to test a network through a ping command check, where the command is based on an ARP broadcast mechanism, and checks whether a certain IP Address is already used in a network segment through broadcast, and in the broadcast process, if a reply is received, it indicates that the IP Address is already occupied, and the content of the reply is a MAC Address of the IP Address, and if no reply is received, it indicates that the IP Address is not already occupied.
S120: when the MAC address of a client in the distributed equipment is received, allocating one available IP address for the client;
in this step, it is necessary to wait for the client in the distributed device to actively send out a custom protocol data packet at least including its MAC address, where the header of the data packet may be custom. That is, the allocation of the IP address needs to be initiated by the client of the distributed device actively, or optionally, the server sends a request to each client first, requesting that the server send at least its MAC address to the server, so that the server allocates the IP address. The need to assign an IP address based on the MAC address sent by the client is for logging in subsequent steps.
In a preferred embodiment, when allocating an available IP address to the client, the following steps are performed only after receiving the allocation confirmation information of the client, and based on this, the specific implementation procedure of step S120 is: when the MAC address of the client in the distributed equipment is received, one available IP address is distributed to the client, and the MAC address corresponding to the distributed 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 sends an allocation confirmation message to the server after confirming the matching, so as to ensure that the allocated IP address is corresponding to its own MAC address. The server side confirms that the allocated IP address is successfully allocated to the client side after receiving the allocation confirmation information of the client side, and if the allocation confirmation information is not received for a period of time, the server side can select to reallocate the IP address for the client side.
S130: mapping the allocated IP address and the MAC address of the client to obtain a mapping relation table;
in this step, the server records the allocated IP addresses and the MAC addresses of the clients to which the IP addresses are allocated, using the mapping relationship table, so as to be used as a basis for detecting whether IP addresses conflict or not in the following process, thereby more conveniently and quickly detecting whether the allocated IP addresses conflict or not.
S140: sending MAC addresses by all clients which are allocated with IP addresses in a first network segment through a broadcast request;
in this step, the server requests all clients to which IP addresses have been allocated 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 table.
S150: after requesting and receiving the MAC address sent by the client, determining the IP address conflict condition of the client by using an arping command according to the IP address of the client, the received MAC address of the client and the mapping relation table.
In this step, since one MAC address mapped in correspondence with the IP address of the client is already recorded in the mapping relationship table, it can be already determined whether the MAC address fed back by the client is different from the MAC address correspondingly recorded in the mapping relationship table according to the IP address of the client, the received MAC address of the client, and the mapping relationship table, and then, it is further determined according to the arping command that if the IP addresses are in conflict, the MAC address corresponding to the conflicting IP address is used to determine whether there are multiple clients with IP address conflict.
Preferably, this step should be executed again at regular intervals to ensure that the conflict 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 condition of the client is that no IP address conflict occurs;
because the MAC address fed back by the client is requested to be the same as the corresponding MAC address in the mapping relation table, i.e. the first MAC address, it indicates that the IP address of the client corresponds to only one MAC address, and the MAC address is the MAC address of the client itself, and there is no conflict in the allocation of the IP addresses.
S154: determining whether the IP address conflict situation of the client is the occurrence of IP address conflict by using an arping command;
because the MAC address requested to be fed back by the client is different from the corresponding MAC address in the mapping relationship table, that is, the first MAC address, it indicates that the IP address of the client may correspond to more than two MAC addresses, and that more than two clients may use the same IP address at the same time, and the allocation of the IP address may conflict. Therefore, the MAC address corresponding to the IP address of the client can be determined by using an 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:
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, go to step S1544;
s1543: determining that the IP address conflict condition of the client side does not occur;
in this step, after the second MAC address is obtained by performing an 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 indicates that there is only one MAC address corresponding to the current IP address, that is, the second MAC address. The reason why the MAC address fed back by the client is different from the first MAC address is that the MAC address of the client itself is changed for some reason, but the allocation of the IP address is not conflicted.
Preferably, in this step, although the IP address conflict condition of the client has been determined that no IP address conflict occurs, 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 changed for some reason, the first MAC address in the mapping table should be replaced with the second MAC address, so as to avoid performing a redundant step to determine that no IP address conflict occurs when the IP address of the client is detected again.
S1544: determining that the IP address conflict condition of the client is the occurrence of IP address conflict;
in this step, after the second MAC address is obtained by executing an arping command on the IP address of the client, if the received MAC address of the client is different from the second MAC address, it indicates that there are actually at least two MAC addresses corresponding to the current IP address, and 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 is determined that the IP address of the client has collided, the collision should be recorded, and therefore, the IP address of the client and the received MAC address of the client should be recorded to mark the collision.
The method for configuring the IP address and detecting the conflict for the distributed device provided by this embodiment is applied to a server in the distributed device, and acquires an available IP address in a certain network segment based on an arping command, allocates an IP address after receiving an MAC address sent by each client, and performs mapping of two addresses of the same client to obtain a mapping relation table, which is used as an important basis for subsequent IP address collision detection, and during a collision checking process, determines a collision condition of the IP address of each client by using a broadcast technology and the arping command. The method has low execution cost, can realize high-efficiency IP address allocation and conflict detection, and improves the installation and configuration efficiency of each client.
Example 2
Based on the same concept as that of the previous embodiment, this embodiment provides a method for configuring an IP address and detecting a conflict for 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 a client to a server in the distributed equipment, and receiving an IP address distributed by the server;
in this step, the client actively sends a custom protocol data packet at least containing its MAC address to the server, and the header of the data packet may be custom. Optionally, the client may send its MAC address to the server after receiving the MAC address sending request of the server.
After receiving the 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 pride 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 distributed by a server and an MAC address corresponding to the distributed 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, go to step S215;
in this step, after acquiring the allocated IP address, the client further determines whether the MAC address corresponding to the IP address matches its own MAC address.
S214: sending confirmation distribution information to a server;
if the MAC address corresponding to the IP address matches the MAC address of the server, it can be determined that the allocated IP address is the IP address of the server, and the server maps the allocated IP address with the MAC address of the client after receiving the allocation confirmation information, so as to obtain a mapping table.
S215: no response is made or error distribution information is sent to the server;
if the MAC address corresponding to the IP address does not match the MAC address of the client, it indicates that the allocated IP address cannot be used as the IP address of the client, and the client may not respond any more, wait for the server to resend the newly allocated IP address, or may feed back an incorrect allocation message to the server, and notify the server that an IP address needs to be reallocated.
S220: and after receiving a request for sending the MAC address through broadcasting, sending the MAC address of the client to the server.
In this step, the server may request all the clients to send their own MAC addresses through broadcasting, and then the server may execute this step after receiving the request, that is, send the current MAC address to the server, so that the server may determine the IP address conflict condition of the client according to the IP address of the client, the received MAC address of the client, and the mapping relationship table, and by using an arping command after requesting and receiving the MAC address of the client.
Therefore, the step is that the server actively detects and confirms the IP address conflict condition of the client.
In a preferred embodiment, the client may also actively detect and confirm the IP address conflict condition of the client, so that the method may further perform the following steps while performing step S220 when the condition is satisfied 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 terminal actively initiates the detection and confirmation of the conflict condition of the IP address of the client terminal, preferably, the step should be executed again at a certain time interval so as to ensure that the conflict condition of the IP address of the client terminal is repeatedly detected and confirmed all the time.
The specific execution process of step S230 is:
s231: determining the IP address conflict condition of the client by using an arping command;
s232: judging whether a reply of an arping command is received, if so, executing step S233; if not, go to step S234;
and 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 reply content is the MAC address of the IP address, and if no reply is received, the IP address is not occupied.
S233: determining that the IP address conflict condition of the client is the occurrence of IP address conflict;
s234: determining that the IP address conflict condition of the client side does not occur;
the difference between this embodiment and embodiment 1 is that the execution main body of this embodiment is a client in a distributed device, but both are based on the same inventive concept, and therefore, in this embodiment, the same definitions as those mentioned in the foregoing two embodiments, the principle of the same step executed by the same execution main body, and the beneficial effects thereof may refer to the description in embodiment 1, and are not repeated herein.
The method for configuring the IP address and detecting the conflict for the distributed device provided by this embodiment is applied to the client in the distributed device, and not only determines whether the MAC address is determined again when the server allocates the IP address, but also circularly detects whether the IP address of the client conflicts after the IP address is allocated, and is performed in parallel with the determination of the conflict situation of the IP addresses of all the clients by the server, so as to form a double insurance, and the conflict situation of the IP addresses of the client 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 an IP address and detecting a conflict for a distributed device, as shown in fig. 7, including a server 310 and several clients 320.
The server 310 is configured to obtain an available IP address in the first network segment;
the client 320 is used for sending the MAC address of the client 320 to the server 310;
the server 310 is configured to, each time the MAC address of the client 320 is received, 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
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 allocation confirmation information and send the allocation confirmation 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; sending MAC addresses by broadcasting all clients 320 which have allocated IP addresses in the first network segment;
the client 320 is configured to send the MAC address of the client 320 to the server 320 after receiving a request for sending the MAC address through broadcasting;
the server 310 is configured to determine, after requesting and receiving the MAC address sent by the client 320, an IP address conflict condition of the client 320 according to the IP address of the client, the received MAC address of the client 320, and the mapping relationship table, and by using an arping command.
The specific implementation process of the server 310 when determining the IP address conflict situation of the client 320320 is as follows:
determining a first MAC address according to the IP address of the client 320 and the mapping relationship 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 occurs; if not, executing the arping command on the IP address of the client 320 to obtain a second MAC address, and determining whether the received MAC address of the client 320 is the same as the second MAC address, if so, determining that the IP address conflict condition of the client 320 is that no IP address conflict occurs; if not, the IP address conflict situation of the client 320 is determined to be that an 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 when 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 the same as the second MAC address.
Preferably, the client 320 is further configured to determine an IP address conflict situation of the client 320 by using an arping command after being assigned to an IP address. The specific process is as follows: when receiving the reply of the arping command, determining that the IP address conflict condition of the client 320 is that an IP address conflict occurs; when the reply of the arping command is not received, it is determined that the IP address conflict condition of the client 320 is that no IP address conflict occurs.
The difference between this embodiment and embodiments 1 and 2 is that this embodiment is a system applying the foregoing 2 embodiments, but the three embodiments are based on the same inventive concept, and therefore, in this embodiment, the same definitions as mentioned in the foregoing three embodiments, the same principles of steps executed by the same execution main body, and the beneficial effects thereof can refer to the description in embodiments 1 and 2, and are not repeated herein.
Example 4
Based on the same concept as that of the foregoing embodiments, this embodiment provides a computer device, including a memory and a processor, where the memory stores a computer program, and the processor executes the computer program to implement the method for configuring an IP address and detecting a conflict for a distributed device provided in any one of embodiments 1 to 2.
The present embodiment further provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the method for configuring an IP address and detecting a conflict for a distributed device provided in any one of embodiments 1 to 2.
It should be understood that the above-mentioned embodiments of the present invention are only examples for clearly illustrating the technical solutions of the present invention, and are not intended to limit the specific embodiments of the present invention. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present invention claims should be included in the protection scope of the present invention claims.

Claims (13)

1. A method for configuring an IP address and detecting a conflict for a distributed device is applied to a server in the distributed device, and is characterized by comprising the following steps:
acquiring available IP addresses in a first network segment, and distributing one of the available IP addresses for a client when receiving an MAC address of the client in distributed equipment;
mapping the allocated IP address and the MAC address of the client to obtain a mapping relation table;
requesting all clients with allocated IP addresses in the first network segment to send MAC addresses through broadcasting, and 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 using an arping command after requesting and receiving the MAC addresses sent by the clients.
2. The method of distributed device configuration IP address and detection of conflicts of claim 1,
determining the IP address conflict condition of the client by using an arping command according to the IP address of the client, the received MAC address of the client and the mapping relation table, specifically:
determining a first MAC address according to the IP address of the client and the mapping relation table;
the first MAC address is a 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 or not, if so, determining that the IP address conflict condition of the client is that no IP address conflict occurs; if not, determining whether the IP address conflict condition of the client is the occurrence of the IP address conflict by using the arping command.
3. The method for configuring IP addresses and detecting conflicts according to claim 2, wherein the arping command is utilized to determine whether the IP address conflict situation of the client is an IP address conflict, specifically:
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, and if so, determining that the IP address conflict condition of the client is no IP address conflict; if not, determining that the IP address conflict condition of the client is the IP address conflict.
4. The method for configuring an IP address and detecting a conflict for a distributed device according to claim 3, 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.
5. The method for configuring an IP address and detecting a conflict for a distributed device according to claim 3, further comprising:
and when the received MAC address of the client is different from the second MAC address, recording the IP address of the client and the received MAC address of the client.
6. The method for configuring IP addresses and detecting conflicts for distributed devices according to any one of claims 1 to 5, wherein 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:
allocating one of the available IP addresses for the client, and sending the MAC address corresponding to the allocated IP address to the client, so that the client determines whether to send out allocation confirmation information according to the MAC address corresponding to the available IP address;
and mapping the allocated IP address and the MAC address of the client after receiving the allocation confirmation information sent by the client.
7. A method for configuring an IP address and detecting a conflict for a distributed device is applied to a client in the distributed device, and is characterized by comprising the following steps:
sending the MAC address of the client to a server in the distributed equipment, so that the server allocates one of the available IP addresses to the client, and mapping the allocated IP address and the MAC address of the client to obtain a mapping relation table;
receiving an 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 after the server requests and receives the MAC address of the client, the IP address of the client is determined according to the IP address of the client, the MAC address of the client and the mapping relation table and by using an arping command.
8. The method for configuring an IP address and detecting a conflict for a distributed device according to claim 6, further comprising: and determining the IP address conflict condition of the client by utilizing the arping command.
9. The method for configuring IP addresses and detecting conflicts according to claim 7, wherein an arping command is used to determine the IP address conflict situation of the client, specifically:
when receiving the reply of the arping command, determining that the IP address conflict condition of the client side is the occurrence of IP address conflict;
and when the reply of the arping command is not received, determining that the IP address conflict condition of the client side is that no IP address conflict occurs.
10. The method for configuring IP address and detecting conflict of distributed device according to any claim 7 to 9,
sending the MAC address of the client to a server in the distributed equipment, so that the server allocates one of the available IP addresses to the client, and mapping the allocated IP address and the MAC address of the client to obtain a mapping relation table; receiving the IP address allocated by the server, specifically:
sending the MAC address of the client to a server in the distributed equipment, so that the server allocates one of the available IP addresses to the client and sends out the MAC address corresponding to the allocated IP address;
and receiving the IP address distributed by the server and the MAC address corresponding to the distributed 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 allocation confirmation information and sending the allocation confirmation information to the server so that the server maps the distributed IP address and the MAC address of the client to obtain a mapping relation table.
11. A system for a distributed device to configure IP addresses and detect conflicts, comprising: a server or a plurality of clients in the distributed equipment;
the server is used for acquiring an available IP address in a 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 relation table; sending MAC addresses by all clients with allocated IP addresses in the first network segment through a broadcast request;
the client is also used for sending the MAC address of the client to the server after receiving a request for sending the MAC address through broadcasting;
and the server is also used for determining the IP address conflict condition of the client by using an arping command according to the IP address of the client, the received MAC address of the client and the mapping relation table after requesting and receiving the MAC address of the client.
12. A computer device comprising a memory and a processor, the memory storing a computer program, wherein the processor when executing the computer program implements the method of configuring an IP address and detecting a conflict for a distributed device according to any one of claims 1 to 10.
13. A computer-readable storage medium, on which a computer program is stored, the computer program, when being executed by a processor, implementing the method for configuring an IP address and detecting a conflict for a distributed device according to any one of claims 1 to 10.
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 true CN114285826A (en) 2022-04-05
CN114285826B 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 (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1391173A (en) * 2001-06-08 2003-01-15 提阿克股份有限公司 Web device, servo device, client device, IP address providing method and program
US20060294257A1 (en) * 2005-06-24 2006-12-28 Olympus Corporation IP address obtaining method
CN102546849A (en) * 2010-12-30 2012-07-04 华为技术有限公司 Detection method for IP (Internet Protocol) address conflict and network equipment
CN102761499A (en) * 2011-04-26 2012-10-31 国基电子(上海)有限公司 Gateway and method for preventing same from being attacked
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
CN110445887A (en) * 2019-08-12 2019-11-12 北京百佑科技有限公司 Repeat IP recognition methods, device and intelligent talk back equipment
CN112187877A (en) * 2020-09-10 2021-01-05 华云数据控股集团有限公司 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
CN112637377A (en) * 2020-12-17 2021-04-09 上海云轴信息科技有限公司 Method and equipment for detecting IP address conflict

Patent Citations (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040230703A1 (en) * 2001-06-08 2004-11-18 Motoyuki Sukigara Network device, server device, client device, and method and program for assigning network IP address
CN1391173A (en) * 2001-06-08 2003-01-15 提阿克股份有限公司 Web device, servo device, client device, IP address providing method and program
US20060294257A1 (en) * 2005-06-24 2006-12-28 Olympus Corporation IP address obtaining method
CN102546849A (en) * 2010-12-30 2012-07-04 华为技术有限公司 Detection method for IP (Internet Protocol) address conflict and network equipment
CN102761499A (en) * 2011-04-26 2012-10-31 国基电子(上海)有限公司 Gateway and method for preventing same from being attacked
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
CN110445887A (en) * 2019-08-12 2019-11-12 北京百佑科技有限公司 Repeat IP recognition methods, device and intelligent talk back equipment
CN112187877A (en) * 2020-09-10 2021-01-05 华云数据控股集团有限公司 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
CN112637377A (en) * 2020-12-17 2021-04-09 上海云轴信息科技有限公司 Method and equipment for detecting IP address conflict

Also Published As

Publication number Publication date
CN114285826B (en) 2023-04-21

Similar Documents

Publication Publication Date Title
CN108307002B (en) DHCP message processing method and device
US20080028071A1 (en) Communication load reducing method and computer system
US8713136B2 (en) Method of allocating IP address of image forming apparatus using DHCP, image forming apparatus and system of allocating IP address using DHCP
KR100689734B1 (en) method and apparatus for allocating address in wireless network
CN109379448B (en) File distributed deployment method and device, electronic equipment and storage medium
US20210119965A1 (en) Address Management Method and Apparatus
CN108429824B (en) Address allocation method and device
US20120124242A1 (en) Server and method for testing pxe function of network interface card
CN106304396B (en) Method, system and related device for discovering wireless controller by access point
US20080056266A1 (en) Set top box address detection system and method thereof
CN106254571B (en) Client IP address allocation method and device
CN110324281B (en) Vehicle-mounted network controller refreshing system and method
CN110990114A (en) Virtual machine resource allocation method, device, equipment and readable storage medium
CN111935335A (en) DHCP address allocation method and device
CN111031149B (en) Server management method, system, equipment and computer readable storage medium
CN106302861B (en) Address allocation method and device
CN110769078A (en) Address allocation method and system
CN109474709B (en) Method and system device for dynamically allocating IP address of Ethernet access equipment
CN111629083B (en) Method and device for acquiring IP address, storage medium and electronic device
CN114285826B (en) Method, system, device and medium for configuring IP address and detecting conflict by distributed device
CN107547674B (en) Address allocation method and device
CN110321115B (en) Pod creation method and device
US11675510B2 (en) Systems and methods for scalable shared memory among networked devices comprising IP addressable memory blocks
CN115499414A (en) Address allocation method and device
JP4745008B2 (en) Client device, server device, and communication system

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