CN-122001855-A - IP address recovery method, device and related equipment
Abstract
The present application relates to the field of network communications technologies, and in particular, to a method and an apparatus for recovering an IP address, and related devices. The method can be applied to a scene that a terminal accesses a FTTR network through PONAP, access equipment in a FTTR network compares an online terminal list recorded locally with a local ARP list to determine that the ARP list does not exist and a target list item exists in the online terminal list, respectively sends detection messages to each terminal equipment corresponding to the target list item, and if a response message fed back by one terminal equipment is not received, deletes the mapping relation between the IP address and the MAC address of the terminal equipment in the online terminal list, and informs a DHCP server to recover the IP address allocated to the terminal equipment. Through dynamic management of the IP address, real-time detection and IP address release after the terminal is offline are realized, network management automation is enhanced, and network resource utilization rate is improved.
Inventors
- CAI TIANJIE
Assignees
- 新华三信息技术有限公司
Dates
- Publication Date
- 20260508
- Application Date
- 20260127
Claims (16)
- 1. The IP address recycling method is characterized by being applied to access equipment, wherein the access equipment can have a DHCP relay function, and the method comprises the following steps: Based on process interaction information of the IP address acquired by the target terminal equipment from the DHCP server, recording the mapping relation between the IP address and the MAC address of the target terminal equipment in an online terminal table, wherein the target terminal equipment is terminal equipment accessed by a local interface of the access equipment; comparing the online terminal list with a local ARP list, and determining that the ARP list does not exist and a target list item exists in the online terminal list; Sending detection messages to each terminal device corresponding to the target list item respectively, and deleting the mapping relation between the IP address and the MAC address of the terminal device in the online terminal list if a response message fed back by one terminal device is not received; And notifying the DHCP server to recover the IP address allocated to the terminal equipment.
- 2. The method of claim 1, wherein the step of comparing the online terminal list with a local ARP list to determine that no target entry exists in the ARP list, and wherein the step of including: And comparing the online terminal list with a local ARP list by taking the MAC address as a key value to determine that the ARP list does not exist and that the target list item corresponding to the MAC address exists in the online terminal list.
- 3. The method of claim 1, wherein the method further comprises: receiving a detection configuration customized and issued by a controller, wherein the detection configuration comprises a detection command and a detection aging time; And executing the step of respectively sending the detection message to each terminal device corresponding to the target table item based on the detection command.
- 4. A method according to any of claims 1-3, characterized in that the step of informing the DHCP server to reclaim the IP address allocated to the terminal device comprises: and reporting the deleted mapping relation between the IP address and the MAC address of the terminal equipment to a controller so that the controller informs the DHCP server to recover the IP address allocated to the terminal equipment.
- 5. The method of claim 3 wherein the step of deleting the mapping of the IP address and the MAC address of the terminal device in the online terminal table comprises: after the detection aging time is reached, determining a target table entry corresponding to the terminal equipment which does not receive the response message as a table entry to be deleted; And aiming at each terminal device corresponding to the list item to be deleted, the terminal device sends a detection message, and if the response message fed back by the terminal device is not received yet, the mapping relation between the IP address and the MAC address of the terminal device in the online terminal list is deleted.
- 6. A method according to any one of claims 1-3, wherein the step of sending the probe message to each terminal device corresponding to the target entry comprises: And randomly sending n detection messages to each terminal device corresponding to the target table item within a preset detection duration, wherein nn is a positive integer greater than or equal to 1.
- 7. The method of claim 4, wherein the method further comprises: And reporting the deleted mapping relation between the IP address and the MAC address of the terminal equipment to a controller so that the controller informs the authentication server of deleting the authentication information of the terminal equipment.
- 8. An IP address reclamation apparatus, applied to an access device, the access device having a DHCP relay function, the apparatus comprising: the system comprises an acquisition unit, a processing unit and a processing unit, wherein the acquisition unit is used for acquiring process interaction information of an IP address from a DHCP server based on target terminal equipment, and recording the mapping relation between the IP address and an MAC address of the target terminal equipment in an online terminal table, wherein the target terminal equipment is terminal equipment accessed by a local interface of the access equipment; the determining unit is used for comparing the online terminal list with a local ARP list, and determining that the ARP list does not exist and the target list item exists in the online terminal list; the sending unit is used for respectively sending the detection messages to the terminal devices corresponding to the target table items; A deleting unit, configured to delete a mapping relationship between an IP address and an MAC address of the terminal device in the online terminal table if the deleting unit does not receive a response message fed back by the terminal device; And the notification unit is used for notifying the DHCP server to recover the IP address allocated to the terminal equipment.
- 9. The apparatus of claim 8, wherein the determining unit is configured to, when comparing the online terminal table with a local ARP table to determine that no ARP table exists and the target table entry exists in the online terminal list, specifically: And comparing the online terminal list with a local ARP list by taking the MAC address as a key value to determine that the ARP list does not exist and that the target list item corresponding to the MAC address exists in the online terminal list.
- 10. The apparatus of claim 8, wherein the apparatus further comprises: the receiving unit is used for receiving detection configuration customized and issued by the controller, wherein the detection configuration comprises a detection command and detection aging time; And the sending unit executes the step of sending the detection message to each terminal device corresponding to the target table item based on the detection command.
- 11. The apparatus according to any of claims 8-10, wherein the notifying unit is configured to, when notifying the DHCP server to recover the IP address allocated to the terminal device: and reporting the deleted mapping relation between the IP address and the MAC address of the terminal equipment to a controller so that the controller informs the DHCP server to recover the IP address allocated to the terminal equipment.
- 12. The apparatus of claim 10, wherein when deleting the mapping relationship between the IP address and the MAC address of the terminal device in the online terminal table, the deleting unit is specifically configured to: after the detection aging time is reached, determining a target table entry corresponding to the terminal equipment which does not receive the response message as a table entry to be deleted; And aiming at each terminal device corresponding to the list item to be deleted, the terminal device sends a detection message, and if the response message fed back by the terminal device is not received yet, the mapping relation between the IP address and the MAC address of the terminal device in the online terminal list is deleted.
- 13. The apparatus according to any one of claims 8-10, wherein when sending a detection message to each terminal device corresponding to the target table entry, the sending unit is specifically configured to: And randomly sending n detection messages to each terminal device corresponding to the target table item within a preset detection duration, wherein nn is a positive integer greater than or equal to 1.
- 14. The apparatus of claim 11, wherein the notification unit is further to: And reporting the deleted mapping relation between the IP address and the MAC address of the terminal equipment to a controller so that the controller informs the authentication server of deleting the authentication information of the terminal equipment.
- 15. An IP address reclamation apparatus, characterized in that the IP address reclamation apparatus comprises: a memory for storing program instructions; A processor for invoking program instructions stored in the memory and performing the steps of the method according to any of claims 1-7 in accordance with the obtained program instructions.
- 16. A computer readable storage medium storing computer executable instructions for causing a computer to perform the steps of the method according to any one of claims 1-7.
Description
IP address recovery method, device and related equipment Technical Field The present application relates to the field of network communications technologies, and in particular, to a method and an apparatus for recovering an IP address, and related devices. Background FTTR (Fiber to the Room, fiber-to-room) is to extend fiber from a communication base station all the way to every corner in the home, providing very high speed internet access services for home users. In a campus network based on FTTR architecture, after a terminal device in the campus network accesses the network through PONAP (PON Access Point, wireless PON device in the campus scheme, optical link Wi-Fi Access Point), an IP address (Internet Protocol Address ) is usually obtained from a DHCP (Dynamic Host Configuration Protocol ) server. However, when the terminal device leaves the network or disconnects, or the terminal MAC Address (MEDIA ACCESS Control Address) changes, the IP Address is reacquired, and those passive zombie terminals always occupy the IP Address resource, so that the DHCP server cannot timely sense, and the IP Address is not released, and finally the Address pool is exhausted. This situation is particularly prominent in the case of frequent access, offline and dynamic changes of the terminal MAC, which brings great trouble to network management. For example, a hospital visitor terminal is frequently connected and disconnected in a short time, and the MAC address of the wireless terminal is dynamically changed, so that the IP resources are exhausted in a short time. Currently, lease timeout mechanisms or manual cleaning are mainly relied on: 1. the DHCP server recovers the IP by depending on a lease timeout mechanism, and after the terminal equipment leaves the network, the DHCP server cannot sense that the terminal has left, and the IP address applied by the terminal equipment is released after the lease timer expires; 2. manual release, after the network IP resource is exhausted, the network administrator manually executes a command (such as RESET DHCP SERVER IP-in-use) to release a part of addresses; however, these methods have problems of untimely response and complex operation, and as a result, an effective method capable of timely detecting that the terminal is offline and dynamically releasing the occupation of the IP address is needed. Disclosure of Invention The application provides an IP address recovery method, an IP address recovery device and related equipment. In a first aspect, the present application provides an IP address recovery method, applied to an access device, where the access device enables a DHCP relay function, the method includes: Based on process interaction information of the IP address acquired by the target terminal equipment from the DHCP server, recording the mapping relation between the IP address and the MAC address of the target terminal equipment in an online terminal table, wherein the target terminal equipment is terminal equipment accessed by a local interface of the access equipment; comparing the online terminal list with a local ARP list, and determining that the ARP list does not exist and a target list item exists in the online terminal list; Sending detection messages to each terminal device corresponding to the target list item respectively, and deleting the mapping relation between the IP address and the MAC address of the terminal device in the online terminal list if a response message fed back by one terminal device is not received; And notifying the DHCP server to recover the IP address allocated to the terminal equipment. Optionally, the step of comparing the online terminal table with a local ARP table to determine that no ARP table exists, and the step of determining that a target table entry exists in the online terminal list includes: And comparing the online terminal list with a local ARP list by taking the MAC address as a key value to determine that the ARP list does not exist and that the target list item corresponding to the MAC address exists in the online terminal list. Optionally, the method further comprises: receiving a detection configuration customized and issued by a controller, wherein the detection configuration comprises a detection command and a detection aging time; And executing the step of respectively sending the detection message to each terminal device corresponding to the target table item based on the detection command. Optionally, the step of informing the DHCP server to reclaim the IP address allocated to the terminal device includes: and reporting the deleted mapping relation between the IP address and the MAC address of the terminal equipment to a controller so that the controller informs the DHCP server to recover the IP address allocated to the terminal equipment. Optionally, the step of deleting the mapping relationship between the IP address and the MAC address of the terminal device in the online terminal table includes: after the de