Method and device for managing static IP address in local area network
By generating an address list and judging static IP address entries, the network chaos problem of static IP address management in local area networks is solved, achieving efficient static IP address management and saving hardware resources, which is suitable for FTTR networks.
Patent Information
- Application Number
- CN202411613551.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-12
- Publication Date
- 2025-01-10
AI Technical Summary
In a local area network (LAN), incorrect or repeated use of static IP addresses can lead to network chaos. Existing technologies make it difficult to quickly locate and manage unauthorized devices, and hardware entries limit the number of legitimate users.
By generating an address list to record the MAC and IP addresses of user devices, and using ARP request messages and DHCP confirmation/release messages to update the list, static IP address entries are identified and retained, while non-static IP address entries are deleted, thereby reducing hardware requirements and improving query efficiency.
It enables precise management of static IP addresses, reduces the number of address list entries, lowers gateway device hardware requirements, supports larger-scale network deployments, ensures comprehensive and complete management, and saves OLT device resources.
Smart Images

Figure CN119299428A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to network communication technology, and in particular to a method and device for managing static IP addresses in a local area network. Background Art
[0002] In a local area network, in order to simplify network management and improve the convenience of network access, the Dynamic Host Configuration Protocol (DHCP) is usually used to dynamically assign IP addresses to user devices. In actual applications, if a user modifies a static IP address for a user device or some users automatically use static IP addresses in certain situations, these static IP addresses are incorrect or repeated in large numbers, which will cause confusion or interruption of the entire network. Therefore, how to prohibit static IP access to the Internet in a local area network and quickly locate the illegal device is an urgent problem to be solved. Summary of the invention
[0003] The embodiments of the present application provide a method and device for managing static IP addresses in a local area network.
[0004] A method for managing static IP addresses in a local area network, the method comprising: Receiving an ARP request message, and updating an address list according to the received ARP request message; and receiving a DHCP confirmation message and a DHCP release message, and updating a binding list according to the received DHCP confirmation message and the DHCP release message; wherein each address entry in the address list records the MAC address of the user equipment and the IP address currently used to access the network, and each binding relationship in the binding list records the MAC address of the user equipment and the IP address obtained based on the DHCP application; When any of the address list and the binding list changes, determine the address entry corresponding to the MAC address whose information in the address list has changed, obtain the target entry, and set the status of each target entry to be verified; For each target entry, the following operations are performed, including: In the binding list, query whether there is a binding relationship corresponding to the MAC address in the current target entry to obtain a first judgment result; According to the first judgment result, determining whether the IP address in the current target entry is a static IP address; If the IP address in the current target entry is a static IP address, retain the current address entry in the address list and set the status of the current target entry to verification completed; otherwise, delete the current target entry from the address list; The address entries in the address list whose status is "verification completed" are used to indicate user equipment using a static IP address in the current local area network.
[0005] A device for managing static IP addresses in a local area network, the device comprising: An acquisition module is configured to receive an ARP request message and update an address list according to the received ARP request message; and receive a DHCP confirmation message and a DHCP release message, and update a binding list according to the received DHCP confirmation message and the DHCP release message; wherein each address entry in the address list records a MAC address of a user device and an IP address currently used to access the network, and each binding relationship in the binding list records a MAC address of a user device and an IP address obtained based on a DHCP application; a determination module configured to determine, when any of the address list and the binding list changes, an address entry corresponding to the MAC address whose information has changed in the address list, obtain a target entry, and set a status of each target entry to be verified; The management module is configured to perform the following operations on each target entry, including: In the binding list, query whether there is a binding relationship corresponding to the MAC address in the current target entry to obtain a first judgment result; According to the first judgment result, determining whether the IP address in the current target entry is a static IP address; If the IP address in the current target entry is a static IP address, retain the current address entry in the address list and set the status of the current target entry to verification completed; otherwise, delete the current target entry from the address list; The address entries in the address list whose status is "verification completed" are used to indicate user equipment using a static IP address in the current local area network.
[0006] In the embodiment of the present application, by retaining the address entries of user devices using static IP addresses in the address list, the number of entries in the address list can be effectively controlled, thereby achieving the purpose of streamlining the address list, facilitating the gateway device to quickly query and locate the required address entries, and reducing the hardware requirements for the gateway device. Furthermore, since the number of illegal user devices attached to the gateway device usually does not exceed the maximum value of the entries in the hardware table, there is no need to limit the deployment scale of the network, and it has better versatility; in addition, the address list generated by the ARP request message ensures the comprehensiveness and integrity of the user device management. This solution can be applied to FTTR networks and can effectively save the hardware table resources of the OLT device.
[0007] Other features and advantages of the present application will be described in the following description, and partly become apparent from the description, or be understood by implementing the present application. Other advantages of the present application can be realized and obtained by the schemes described in the description and the drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0008] The accompanying drawings are used to provide an understanding of the technical solution of the present application and constitute a part of the specification. Together with the embodiments of the present application, they are used to explain the technical solution of the present application and do not constitute a limitation on the technical solution of the present application.
[0009] Figure 1 A schematic diagram of a flow chart of a method for managing static IP addresses in a local area network provided in an embodiment of the present application; Figure 2 A flowchart of a method for managing a static IP address provided in Example 1 of the present application; Figure 3 A flowchart of a method for managing a static IP address provided in Example 2 of the present application; Figure 4 A schematic diagram of the structure of a static IP address management device in a local area network provided in an embodiment of the present application. DETAILED DESCRIPTION
[0010] The present application describes multiple embodiments, but the description is exemplary rather than restrictive, and it is obvious to those skilled in the art that there may be more embodiments and implementations within the scope of the embodiments described in the present application. Although many possible feature combinations are shown in the drawings and discussed in the specific embodiments, many other combinations of the disclosed features are also possible. Unless specifically limited, any feature or element of any embodiment may be used in combination with any other feature or element in any other embodiment, or may replace any other feature or element in any other embodiment.
[0011] The present application includes and contemplates combinations of features and elements known to those of ordinary skill in the art. The embodiments, features and elements disclosed in the present application may also be combined with any conventional features or elements to form a unique invention scheme. Any features or elements of any embodiment may also be combined with features or elements from other invention schemes to form another unique invention scheme. Therefore, it should be understood that any feature shown and / or discussed in the present application may be implemented individually or in any appropriate combination. Therefore, except for the limitations made according to the attached claims and their equivalents, the embodiments are not subject to other restrictions. In addition, various modifications and changes may be made within the scope of protection of the attached claims.
[0012] In addition, when describing representative embodiments, the specification may have presented the method and / or process as a specific sequence of steps. However, to the extent that the method or process does not rely on the specific order of the steps described herein, the method or process should not be limited to the steps of the specific order described. As will be understood by those of ordinary skill in the art, other sequences of steps are also possible. Therefore, the specific sequence of the steps set forth in the specification should not be interpreted as a limitation to the claims. In addition, the claims for the method and / or process should not be limited to the steps of performing them in the order written, and those skilled in the art can easily understand that these sequences can be changed and still remain within the spirit and scope of the embodiments of the present application.
[0013] In the related art, in order to prevent user devices from accessing the network using static IP addresses, a hardware table entry that allows data flows to pass can be generated. The gateway device can use the hardware table entry to allow data flows from legitimate user devices to pass and discard data flows from illegitimate user devices.
[0014] In the process of implementing this application, it was found that the above management method has at least the following problems, including: In the hardware table, one legitimate user corresponds to one hardware entry that is allowed to pass. Since the size of the device's hardware table is generally 128 to 4096 entries, the number of legitimate users attached to the gateway device is limited; especially for some small network devices, the hardware table is small, which greatly limits the number of legitimate users attached to the gateway device.
[0015] In addition, the hardware table entry cannot quickly locate which specific user device is connected to which specific port in the gateway device and uses a static IP address.
[0016] Based on the above analysis, the present application embodiment proposes the following solutions: Acquire an address list, wherein each address entry in the address list records a MAC address of a user device and an IP address currently used to access a network; Determining whether the IP addresses in at least some of the address entries in the address list are static IP addresses; If the IP address in the address entry is a static IP address, the address entry of the user equipment is retained in the address list; otherwise, the address entry of the user equipment is deleted from the address list.
[0017] In the above scheme, since the number of illegal user devices is significantly less than the number of legal users, by retaining the address entries of user devices using static IP addresses in the address list, the number of entries in the address list can be effectively controlled, achieving the purpose of streamlining the address list, facilitating the gateway device to quickly query and locate the required address entries, and reducing the hardware requirements for the gateway device. Furthermore, since the number of illegal user devices attached to the gateway device usually does not exceed the maximum value of the entries in the hardware table (4096), the above method will not limit the deployment scale of the network and has better versatility.
[0018] Furthermore, the method is applied to a gateway device.
[0019] The gateway device can be deployed in a FTTR (Fiber to The Room) network, where FTTR extends optical fiber directly to every room in the user's home to provide high-bandwidth, low-latency network connections. It is the core technology of the new generation of home networking.
[0020] The gateway device may be an optical line terminal (OLT) device in an FTTR network, and can effectively save hardware table entry resources of the OLT device.
[0021] The address list is generated based on the ARP request message.
[0022] Specifically, after the local area network is initialized, an ARP request message sent by a user device is received, wherein the ARP request message is used to request the IP address of a gateway; the MAC address and IP address of the user device are obtained from each received ARP request message to obtain the address list.
[0023] In the above method, when a user terminal accesses the network, it sends an ARP request message to the gateway device. Since the communication protocol stipulates that the ARP request message carries the MAC and IP of the user terminal, the gateway device can receive the ARP request messages of all user devices in the network, thereby managing whether all users use static IP addresses, ensuring the comprehensiveness and integrity of static IP address management in the network.
[0024] In addition, as the LAN operation time increases, the usage of the IP addresses of user devices will change, so the gateway device makes adaptive judgments based on the usage requests of the IP addresses.
[0025] Figure 1 The following is a flow chart of a method for managing static IP addresses in a local area network provided in an embodiment of the present application. Figure 1 As shown, the method includes:
[0026] Step 101: receiving an ARP request message, and updating an address list according to the received ARP request message; and receiving a DHCP confirmation message and a DHCP release message, and updating a binding list according to the received DHCP confirmation message and the DHCP release message; Each address entry in the address list records the MAC address of the user equipment and the IP address currently used to access the network, and each binding relationship in the binding list records the MAC address of the user equipment and the IP address obtained based on the DHCP application; In step 101, each user equipment needs to send an ARP request message to successfully access the network. Therefore, the ARP request message can be used to generate an address list to improve information collection efficiency.
[0027] In addition, you can use the DHCP SNOOPING function or the DHCP RELAY function to dynamically record the binding list.
[0028] Specifically, for the received DHCP confirmation (ACK) message, parse the message content, obtain the MAC address and the applied IP address, VLAN and lease time, generate a binding relationship, and dynamically maintain the binding relationship according to the lease time, wherein the binding relationship is deleted after the lease expires.
[0029] For the received DHCP release (RELEASE) message, parse the message content, obtain the MAC address and IP address, and delete the corresponding binding relationship based on the MAC address and IP address.
[0030] Step 102: When any of the address list and the binding list changes, determine the address entry corresponding to the MAC address whose information in the address list has changed, obtain the target entry, and set the status of each target entry to be verified; In step 102, the address list records the IP addresses that need to be verified, and the binding list is used as the judgment basis for the verification operation. When either of the two changes, the verification result will be affected. Therefore, it is necessary to re-determine the address entries to be verified to ensure the accuracy of the management operation of the static IP address. In addition, by setting the status of each target entry to be verified, it is possible to effectively provide an operational basis for whether the address entry in the address list can be output or issued. Among them, if the status of an address entry is to be verified, the address entry cannot be issued to the hardware of the gateway device, nor can it be output to the network management personnel, so as to avoid performing operations based on the unverified information.
[0031] Step 103: Perform the following operations on each target entry, including: In the binding list, query whether there is a binding relationship corresponding to the MAC address in the current target entry to obtain a first judgment result; According to the first judgment result, determining whether the IP address in the current target entry is a static IP address; If the IP address in the current target entry is a static IP address, retain the current address entry in the address list and set the status of the current target entry to verification completed; otherwise, delete the current target entry from the address list; The address entries in the address list whose status is "verification completed" are used to indicate user equipment using a static IP address in the current local area network.
[0032] In step 103, since the number of illegal user devices is significantly less than the number of legal users, by retaining the address entries of user devices using static IP addresses in the address list, the number of entries in the address list can be effectively controlled, thereby achieving the purpose of streamlining the address list, facilitating the gateway device to quickly query and locate the required address entries, and reducing the hardware requirements for the gateway device. Furthermore, since the number of illegal user devices attached to the gateway device usually does not exceed the maximum value (4096) of the entries in the hardware table, the above method will not limit the deployment scale of the network and has better versatility.
[0033] In summary, the embodiment of the present application provides a simple and efficient network management solution, which manages static IP addresses by recording information of illegal user devices in an address list. The solution can be applied to FTTR networks and can effectively save hardware table resources of OLT devices.
[0034] Embodiment 1 Figure 2 The following is a flow chart of the static IP address management method provided in the first embodiment of the present application. Figure 2 As shown, this embodiment takes the scenario where both the address list and the binding list are generated for the first time as an example for description:
[0035] Step A01: receiving an ARP request message sent by a user device, wherein the ARP request message is used to request an IP address of a gateway; Step A02: Acquire the MAC address and IP address of the user equipment from each received ARP request message to obtain an address list, wherein each address entry in the address list records the MAC address of the user equipment and the IP address currently used to access the network; Step A03: determine that each address entry in the address list is a target entry, and set the status of each target entry to be verified; Step A04: In the pre-acquired binding list, query whether there is a binding relationship corresponding to the MAC address in the i-th target entry, and obtain a first judgment result; The binding list is obtained before receiving the ARP request message sent by the user equipment, and each binding relationship in the binding list records the MAC address of the user equipment and the IP address obtained based on the DHCP application, where i=1,2,3,...,N, where N is the total number of target entries and N is a positive integer; If the first judgment result is that there is no binding relationship, it is determined that the IP address in the current target entry is a static IP address, and step A05 is executed; otherwise, steps A06 to 07 are executed; Step A05, retaining the i-th target entry in the address list, setting the status of the current target entry to verification completed, and executing step A08; Step A06, determining whether the IP address in the i-th target entry is the same as the IP address in the binding relationship, and obtaining a second determination result; If the second judgment result is the same, it is determined that the IP address in the current target entry is not a static IP address, and step A07 is executed; otherwise, step A05 is executed; Step A07, deleting the current address entry from the address list, and executing step A08; Step A08, update the value of i to i+1; Step A09, determining whether the updated value of i is greater than N; If the updated value of i is greater than N, the process ends; otherwise, continue to step A04.
[0036] It should be noted that after the user device applies for an IP address from the DHCP server, the user may manually modify the IP address for accessing the network to a static IP address and abandon the IP address assigned by DHCP. By executing step A06, the misjudgment caused by the above situation can be effectively avoided, and the management accuracy can be improved.
[0037] Embodiment 2 Figure 3 The following is a flow chart of the method for managing static IP addresses provided in Example 2 of the present application. Figure 3 As shown, this embodiment is described by taking a scenario in which at least one of the address list and the binding list is not generated for the first time as an example:
[0038] Step B00, receiving an ARP request message, and updating the address list according to the received ARP request message; Step B01: when the address list changes, obtain the address entries in the address list whose information has changed, and obtain the target entries, wherein the status of each target entry is to be verified; Step B02: receiving a DHCP response message and a DHCP release message, and updating the binding list according to the received DHCP response message and DHCP release message; Step B03: when the binding list changes, obtain the address entry corresponding to the MAC address whose information in the binding list has changed in the address list, and obtain the target entry, wherein the status of each target entry is to be verified; The operations on the address list (step B00 and step B01) and the operations on the binding list (step B02 and step B03) are merely illustrative examples and there is no obvious order of execution.
[0039] Step B04: In the current binding list, query whether there is a binding relationship corresponding to the MAC address in the i-th target entry, and obtain a first judgment result; Each binding relationship in the binding list records the MAC address of the user device and the IP address obtained based on the DHCP application, where i=1,2,3,...,N, where N is the total number of target entries and N is a positive integer; If the first judgment result is that there is no binding relationship, it is determined that the IP address in the current target entry is a static IP address, and step B05 is executed; otherwise, steps B06 to 07 are executed; Step B05, retaining the i-th target entry in the address list, setting the status of the current target entry to verification completed, and executing step B08; Step B06, determining whether the IP address in the i-th target entry is the same as the IP address in the binding relationship, and obtaining a second determination result; If the second judgment result is the same, it is determined that the IP address in the current target entry is not a static IP address, and step B07 is executed; otherwise, step B05 is executed; Step B07, deleting the current address entry from the address list, and executing step B08; Step B08, update the value of i to i+1; Step B09, determine whether the updated value of i is greater than N; If the updated value of i is greater than N, the process ends; otherwise, continue to step B04.
[0040] It should be noted that after the user device applies for an IP address from the DHCP server, the user may manually modify the IP address for accessing the network to a static IP address and abandon the IP address assigned by DHCP. By executing step B06, the misjudgment caused by the above situation can be effectively avoided, and the management accuracy can be improved.
[0041] Further, the address entry whose information has changed in the address list is obtained in the following manner, including: When a new ARP request message is received, determine whether there is an address entry corresponding to the MAC address in the new ARP request message in the address list: If there is an address entry corresponding to the MAC address in the address list, the IP address is updated in the corresponding address entry in the address list according to the IP address in the new ARP request message; otherwise, the address entry corresponding to the new ARP request message is added to the address list.
[0042] Specifically, for the received ARP request message, the address entry corresponding to the MAC address in the ARP request message in the address list is determined, which can ensure that there is only one address entry for each MAC address in the address list, effectively controlling the number of address entries in the address list. This solution can be applied to FTTR networks and can effectively save the hardware table resources of OLT equipment. In addition, by updating the IP address in the address entry, it can ensure that the information in the ARP request message is recorded in a timely and accurate manner.
[0043] Further, the address entry corresponding to the MAC address whose information in the binding list has changed in the address list is obtained in the following manner, including: When adding a new binding relationship to the binding list, determining the corresponding address entry in the address list according to the MAC address in the newly added binding relationship to obtain a first address entry; Specifically, after sending an APR request message carrying a static IP address, the user device may try to apply for an IP address from a DHCP server, thereby generating a new binding relationship; in addition, a user device that has newly joined the network may also apply for an IP address from a DHCP server, thereby generating a new binding relationship. Since the added binding relationship as a newly added judgment basis will change the judgment result of the static IP address, it is necessary to re-judge the address entry corresponding to the MAC address in the above binding relationship.
[0044] When the existing binding relationships in the binding list are reduced, a corresponding address entry is added to the address list according to the MAC address in the reduced binding relationship to obtain a second address entry; Specifically, when the lease of the IP address applied by the user device expires or the user device requests the DHCP server to release the IP address, the number of binding relationships will be reduced. Since the reduced binding relationships will change the judgment result of the static IP address, it is necessary to re-judge the address entry corresponding to the MAC address in the above binding relationship. For example, after the lease of a user device expires, if the user manually sets a static IP address for the user device to continue to surf the Internet, it is necessary to re-judge the address entry of the user device.
[0045] When an IP address in an existing binding relationship in the binding list changes, a corresponding address entry is added to the address list according to the MAC address of the binding relationship whose IP address has changed, to obtain a third address entry.
[0046] Specifically, since the IP address in the binding relationship may be reallocated by DHCP, in order to ensure the management accuracy of the static IP address, the relevant address entries also need to be re-judged.
[0047] The following describes the first and second embodiments: In an exemplary embodiment, each address entry has its own judgment number, wherein when the IP address currently used by the user equipment to access the network is a static IP address, the judgment number of the address entry of the user equipment is increased by 1; Among them, when the number of judgments of the address entry of the current user equipment reaches a preset number threshold, the IP address in the address entry of the current user equipment is deleted, and only the MAC address of the user equipment is retained to indicate that the static IP address judgment operation will no longer be performed on the IP address carried in the ARP request message sent by the user equipment with the MAC address.
[0048] The verification times based on each MAC address can effectively prevent malicious attacks and reduce the processing pressure of ARP request messages.
[0049] In an exemplary embodiment, after receiving a configuration message carrying a trusted address, a trust list is generated based on the configuration message using address entries corresponding to the trusted address in the address list, wherein data streams corresponding to the IP address in each address entry in the trust list are allowed to be transmitted through a gateway device.
[0050] The trusted address may be identified by at least one of an IP address and a MAC address.
[0051] Under the premise of ensuring that the address list stores information of user devices using static IP addresses, the use of the trust list can meet the special use requirements of some user devices for static IP addresses.
[0052] In another implementation, according to the configuration message, a trust identifier is added to the address entry corresponding to the trusted address in the address list, wherein the trust identifier is used to indicate that data flow of the IP address is allowed to be transmitted through the gateway device.
[0053] In an exemplary embodiment, each of the address entries further includes a port in the gateway device connected to the user device; When a query request for a static IP address is received, the address entries in the address list whose status is verification completed are output.
[0054] The above method can quickly and accurately locate the port and MAC address of the user device using the static IP address, which is convenient for the maintenance and management of the network administrator.
[0055] Figure 4 This is a schematic diagram of the structure of a static IP address management device in a local area network provided by an embodiment of the present application. Figure 4 As shown, the device comprises:
[0056] The acquisition module 401 is configured to receive an ARP request message and update an address list according to the received ARP request message; and receive a DHCP confirmation message and a DHCP release message, and update a binding list according to the received DHCP confirmation message and the DHCP release message; wherein each address entry in the address list records a MAC address of a user device and an IP address currently used to access the network, and each binding relationship in the binding list records a MAC address of a user device and an IP address obtained based on a DHCP application; The determination module 402 is configured to determine the address entry corresponding to the MAC address whose information in the address list has changed when any of the address list and the binding list has changed, obtain the target entry, and set the status of each target entry to be verified; The management module 403 is configured to perform the following operations on each target entry, including: In the binding list, query whether there is a binding relationship corresponding to the MAC address in the current target entry to obtain a first judgment result; According to the first judgment result, determining whether the IP address in the current target entry is a static IP address; If the IP address in the current target entry is a static IP address, retain the current address entry in the address list and set the status of the current target entry to verification completed; otherwise, delete the current target entry from the address list; The address entries in the address list whose status is "verification completed" are used to indicate user equipment using a static IP address in the current local area network.
[0057] Preferably, the apparatus is applied to a gateway device.
[0058] The gateway device may be an OLT device in a FTTR network. When the solution can be applied to a FTTR network, the hardware table entry resources of the OLT device can be effectively saved.
[0059] The device provided in the embodiment of the present application can effectively control the number of entries in the address list by retaining the address entries of user devices using static IP addresses in the address list, thereby achieving the purpose of streamlining the address list, facilitating the gateway device to quickly query and locate the required address entries, and reducing the hardware requirements for the gateway device. Furthermore, since the number of illegal user devices attached to the gateway device usually does not exceed the maximum value of the entries in the hardware table, there is no need to limit the deployment scale of the network, and it has better versatility; in addition, the address list generated by the ARP request message ensures the comprehensiveness and integrity of the user device management. This solution can be applied to FTTR networks and can effectively save the hardware table resources of the OLT device.
[0060] It will be appreciated by those skilled in the art that all or some of the steps, systems, and functional modules / units in the methods disclosed above may be implemented as software, firmware, hardware, and appropriate combinations thereof. In hardware implementations, the division between the functional modules / units mentioned in the above description does not necessarily correspond to the division of physical components; for example, a physical component may have multiple functions, or a function or step may be performed by several physical components in cooperation. Some or all components may be implemented as software executed by a processor, such as a digital signal processor or a microprocessor, or implemented as hardware, or implemented as an integrated circuit, such as an application-specific integrated circuit. Such software may be distributed on a computer-readable medium, which may include a computer storage medium (or non-transitory medium) and a communication medium (or transient medium). As is known to those skilled in the art, the term "computer storage medium" includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules, or other data). Computer storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tapes, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to store the desired information and can be accessed by a computer. In addition, it is well known to those skilled in the art that communication media typically contain computer-readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transport mechanism, and may include any information delivery media.
Claims
1. A method for managing static IP addresses in a local area network, the method comprising: Receive the ARP request message and update the address list according to the received ARP request message; And, receiving the DHCP confirmation message and the DHCP release message, and updating the binding list according to the received DHCP confirmation message and the DHCP release message; Each address entry in the address list records the MAC address of the user equipment and the IP address currently used to access the network, and each binding relationship in the binding list records the MAC address of the user equipment and the IP address obtained based on the DHCP application; When any of the address list and the binding list changes, determine the address entry corresponding to the MAC address whose information in the address list has changed, obtain the target entry, and set the status of each target entry to be verified; For each target entry, the following operations are performed, including: In the binding list, query whether there is a binding relationship corresponding to the MAC address in the current target entry to obtain a first judgment result; According to the first judgment result, determining whether the IP address in the current target entry is a static IP address; If the IP address in the current target entry is a static IP address, retain the current address entry in the address list and set the status of the current target entry to verification completed; otherwise, delete the current target entry from the address list; The address entries in the address list whose status is "verification completed" are used to indicate user equipment using a static IP address in the current local area network.
2. The method according to claim 1, characterized in that The step of determining the address entry corresponding to the MAC address whose information has changed in the address list to obtain the target entry includes: When the address list is generated for the first time, determining that each address entry in the address list is a target entry; When the address list is not generated for the first time, the address entries in the address list whose information has changed and the address entries in the address list corresponding to the MAC addresses in the binding list whose information has changed are obtained to obtain the target entries.
3. The method according to claim 2, characterized in that The address entry whose information has changed in the address list is obtained in the following manner, including: When a new ARP request message is received, determine whether there is an address entry corresponding to the MAC address in the new ARP request message in the address list: If there is an address entry corresponding to the MAC address in the address list, the IP address is updated in the corresponding address entry in the address list according to the IP address in the new ARP request message; otherwise, the address entry corresponding to the new ARP request message is added to the address list.
4. The method according to claim 2, characterized in that: The address entry corresponding to the MAC address whose information in the binding list has changed in the address list is obtained in the following manner, including: When adding a new binding relationship to the binding list, determining the corresponding address entry in the address list according to the MAC address in the newly added binding relationship, and obtaining a first address entry; When the existing binding relationships in the binding list are reduced, according to the MAC addresses in the reduced binding relationships, the corresponding address entries are added to the address list to obtain a second address entry; When an IP address in an existing binding relationship in the binding list changes, a corresponding address entry is added to the address list according to the MAC address of the binding relationship whose IP address has changed, to obtain a third address entry.
5. The method according to any one of claims 1 to 4, characterized in that: The determining, according to the first judgment result, whether the IP address in the current target entry is a static IP address includes: When the first judgment result is that a binding relationship exists, determining whether the IP address in the current target entry is the same as the IP address in the binding relationship, and obtaining a second judgment result; If the second determination result is the same, it is determined that the IP address in the current target entry is a static IP address; otherwise, it is determined that the IP address in the current target entry is not a static IP address.
6. The method according to any one of claims 1 to 4, characterized in that: Each address entry has its own judgment number, wherein when the IP address currently used by the user equipment to access the network is a static IP address, the judgment number of the address entry of the user equipment is increased by 1; Wherein, the method further comprises: When the number of judgments of the address entry of the current user device reaches a preset number threshold, the IP address in the address entry of the current user device is deleted, and only the MAC address of the user device is retained to indicate that the static IP address judgment operation will no longer be performed on the IP address carried in the ARP request message sent by the user device with the MAC address.
7. The method according to any one of claims 1 to 4, characterized in that: The method further comprises: After receiving a configuration message carrying a trusted address, a trust list is generated according to the configuration message using address entries corresponding to the trusted address in the address list, wherein data streams corresponding to the IP address in each address entry in the trust list are allowed to be transmitted through the gateway device.
8. The method according to any one of claims 1 to 4, characterized in that: Each address entry also includes a port in the gateway device connected to the user device; Wherein, the method further comprises: When a query request for a static IP address is received, the address entries in the address list whose status is verification completed are output.
9. A device for managing static IP addresses in a local area network, the device comprising: The acquisition module is configured to receive the ARP request message and update the address list according to the received ARP request message; And, receiving the DHCP confirmation message and the DHCP release message, and updating the binding list according to the received DHCP confirmation message and the DHCP release message; Each address entry in the address list records the MAC address of the user equipment and the IP address currently used to access the network, and each binding relationship in the binding list records the MAC address of the user equipment and the IP address obtained based on the DHCP application; a determination module configured to determine, when any of the address list and the binding list changes, an address entry corresponding to the MAC address whose information has changed in the address list, obtain a target entry, and set a status of each target entry to be verified; The management module is configured to perform the following operations on each target entry, including: In the binding list, query whether there is a binding relationship corresponding to the MAC address in the current target entry to obtain a first judgment result; According to the first judgment result, determining whether the IP address in the current target entry is a static IP address; If the IP address in the current target entry is a static IP address, retain the current address entry in the address list and set the status of the current target entry to verification completed; otherwise, delete the current target entry from the address list; The address entries in the address list whose status is "verification completed" are used to indicate user equipment using a static IP address in the current local area network.
10. The device according to claim 9, characterized in that The device is applied to a gateway device.