Address management method, network device and storage medium

By receiving preset messages from networking devices in network equipment and adjusting initial address information, the problem of manual confirmation and manual configuration in the prior art LLDP address management is solved, and automatic adaptation and efficient address management are achieved.

CN113783971BActive Publication Date: 2025-06-06ZTE CORP
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202010525782.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-06-10
Publication Date
2025-06-06
Estimated Expiration
2040-06-10

AI Technical Summary

Technical Problem

In existing communication networks, the management of LLDP address between devices requires manual confirmation and manual configuration, which leads to large workload and inconvenient maintenance, especially when the equipment is expanded and changed, it requires frequent adjustments.

Method used

By receiving networking requests from networking devices, sending initial address information, and receiving the preset message it returns, adjusting the initial address information based on the address information in the preset message, and realizing automatic adaptation and self-configuration.

Benefits of technology

It improves the efficiency of initial address information adjustment of network equipment, reduces manual intervention, and improves the convenience of address management and interoperability between devices.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113783971B_ABST
    Figure CN113783971B_ABST
Patent Text Reader

Abstract

The present application discloses an address management method, a network device and a storage medium, belonging to the field of communication technology, the method comprising: when receiving a networking request from a networking device, sending initial address information to the networking device based on the networking request; receiving a preset message returned by the networking device based on the initial address information; adjusting the initial address information according to the address information of the networking device carried in the preset message. The scheme adaptively adjusts the initial address information of the network device through the address information of the networking device to adapt to the interaction with the networking devices with different address requirements, avoids manual confirmation and manual adjustment, improves the efficiency of adjusting the initial address information of the network device, and improves the convenience of address management.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of communication technology, and in particular to an address management method, a network device and a storage medium. Background Art

[0002] Link Layer Discovery Protocol (LLDP) is a protocol standard for link layer discovery. Different types of devices from different manufacturers can discover each other and exchange information based on LLDP in the network. With the promotion of Internet Protocol Version 6 (IPv6), when exchanging address information, the LLDP protocols of different devices will face the problem that some devices only support Internet Protocol Version 6 (IPv4) address information, some devices only support IPv6 address information, or some devices support dual stack management of IPv4 and IPv6 address information. Among them, LLDP address management is usually configured manually by the user. For example, on devices that support IPv6, the user will configure the LLDP management address to be IPv6 address information.

[0003] The devices involved in networking in the existing communication network may come from different manufacturers, and the LLDP configuration methods implemented may be different. Some devices are configured with IPv4 management addresses, only support IPv4 protocols, and do not recognize any information of IPv6 protocols. In networking scenarios, it is inevitable that some ports need to be configured with IPv4 address information to connect to networking devices, and some ports need to be configured with IPv6 address information to connect to networking devices. At present, it all depends on manual confirmation and manual configuration, which increases the maintenance workload of the staff. In the future, when the network maintenance changes, expands the capacity, and adds equipment, it is necessary to manually confirm the network and change the configuration again. Summary of the invention

[0004] The embodiments of the present application provide an address management method, a network device, and a storage medium, which can improve the efficiency of adjusting the initial address information of the network device and improve the convenience of address management.

[0005] In a first aspect, an embodiment of the present application provides an address management method, including:

[0006] When receiving a networking request from a networking device, sending initial address information to the networking device based on the networking request;

[0007] Receiving a preset message returned by the networking device based on the initial address information;

[0008] The initial address information is adjusted according to the address information of the networking device carried in the preset message.

[0009] In a second aspect, an embodiment of the present application further provides a network device, including a memory and a processor, wherein the memory stores a computer program, and when the processor calls the computer program in the memory, it executes any one of the address management methods provided in the embodiment of the present application.

[0010] In a third aspect, an embodiment of the present application further provides a storage medium for computer-readable storage, wherein the storage medium is used to store a computer program, and the computer program is loaded by a processor to execute any one of the address management methods provided in the embodiments of the present application.

[0011] In the embodiment of the present application, when a networking request of a networking device is received, initial address information is sent to the networking device based on the networking request, and then a preset message returned by the networking device based on the initial address information is received, and the initial address information is adjusted according to the address information of the networking device carried in the preset message. This solution adaptively adjusts the initial address information of the network device through the address information of the networking device to adapt to the interaction with the networking devices with different address requirements, avoids manual confirmation and manual adjustment, improves the efficiency of adjusting the initial address information of the network device, and improves the convenience of address management. BRIEF DESCRIPTION OF THE DRAWINGS

[0012] Figure 1 This is a scenario diagram of an address management method provided by an embodiment of the present application;

[0013] Figure 2 It is a flowchart of an address management method provided by an embodiment of the present application;

[0014] Figure 3 is a flowchart of an address management method provided by another embodiment of the present application;

[0015] Figure 4 is a flowchart of an address management method provided by another embodiment of the present application;

[0016] Figure 5 is a flowchart of an address management method provided by another embodiment of the present application;

[0017] Figure 6 is a flowchart of an address management method provided by another embodiment of the present application;

[0018] Figure 7 It is a structural diagram of a network device provided by an embodiment of the present application. DETAILED DESCRIPTION

[0019] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of this application.

[0020] The flowcharts shown in the accompanying drawings are only examples and do not necessarily include all the contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps may be decomposed, combined or partially merged, so the actual execution order may change according to actual conditions.

[0021] In conjunction with the accompanying drawings, some embodiments of the present application are described in detail below. In the absence of conflict, the following embodiments and features in the embodiments can be combined with each other.

[0022] The embodiments of the present application provide an address management method, a network device and a storage medium. The address management method can be applied to a network device, which can include a hub, a switch, a bridge, a router, a gateway, a repeater and other devices.

[0023] See also Figure 1 , Figure 1 is a schematic diagram of a scenario for implementing the address management method provided in the embodiment of the present application, such as Figure 1 As shown, the network device can interact with the networking device, and the networking device can include terminals such as desktop computers, laptops, and smart TVs. For example, the networking device can be connected to the port of the network device through a network cable, and a networking request is generated. When the network device receives the networking request of the networking device, the network device can send the initial address information (such as IP address information) of the port preset configuration to the networking device based on the networking request. Then, the networking device can return a preset message (such as LLDP message) carrying the address information of the networking device to the network device after receiving the initial address information of the network device. At this time, the network device can receive the preset message returned by the networking device based on the initial address information. The network device can adjust the initial address information according to the address information of the networking device carried in the preset message, so as to perform networking. The address management method provided in the embodiment of the present application realizes the adaptive adjustment of the initial address information of the network device through the address information of the networking device to adapt to the interaction between the networking devices with different address requirements, avoids manual confirmation and manual adjustment, improves the efficiency of adjusting the initial address information of the network device, and improves the convenience of address management.

[0024] See also Figure 2 , Figure 21 is a flow chart of an address management method provided by an embodiment of the present application. The address management method may include but is not limited to steps S10 to S30, etc., and may be specifically as follows:

[0025] S10. When a networking request from a networking device is received, initial address information is sent to the networking device based on the networking request.

[0026] Among them, the networking request can be generated according to actual needs. For example, when the networking device is connected to the network device through a network cable, a networking request is generated and sent to the network device. At this time, the network device can receive the networking request of the networking device; for another example, when the networking device needs to use the network provided by the network device for networking, a networking request can be generated based on a wireless connection and sent to the network device. At this time, the network device can receive the networking request of the networking device. The specific content and format of the networking request can be flexibly set according to actual needs and are not limited here. Then, when receiving the networking request of the networking device, the network device can send initial address information to the networking device based on the networking request. The initial address information can be the address information pre-configured by the network device, and the initial address information can include one or more.

[0027] Reference Figure 3 In one embodiment, before step S10, the address management method may also include but is not limited to step S40 and step S50, etc., which may be specifically as follows:

[0028] Step S40, configuring the Internet communication protocol version 4 IPv4 address information and / or the Internet communication protocol version 6 IPv6 address information based on the link layer discovery protocol LLDP for the network device;

[0029] Step S50: Set the IPv4 address information and / or the IPv6 address information as initial address information.

[0030] In order to ensure the reliability of the interaction between the network device and the networking device, the address information can be pre-configured for the network device, and the address information can be an IP address, wherein the configuration method of the initial address information of the network device can be manual configuration by the user, or automatic configuration of the network device according to its own characteristics. Specifically, the IPv4 address information based on the LLDP protocol can be configured for the network device, and the IPv4 address information can be set as the initial address information of the network device; or, the IPv6 address information based on the LLDP protocol can be configured for the network device, and the IPv6 address information can be set as the initial address information of the network device; or, the IPv4 address information and IPv6 address information based on the LLDP protocol can be configured for the network device, and the IPv4 address information and IPv6 address information can be set as the initial address information of the network device; and so on.

[0031] When receiving a networking request from a networking device, if the initial address information configured by the network device is IPv4, the network device can send IPv4 address information to the networking device based on the networking request; if the initial address information configured by the network device is IPv6, the network device can send IPv6 address information to the networking device based on the networking request; if the initial address information configured by the network device is IPv4 and IPv6, the network device can send IPv4 address information and IPv6 address information (which can be called dual-stack address information) to the networking device based on the networking request.

[0032] In one embodiment, configuring Internet Communication Protocol Version 4 IPv4 address information and / or Internet Communication Protocol Version 6 IPv6 address information based on the Link Layer Discovery Protocol LLDP for a network device may include: configuring the network device with LLDP-based IPv4 address information and / or IPv6 address information according to the overall management address of the network device; or configuring the network device with LLDP-based IPv4 address information and / or IPv6 address information according to the management addresses of the individual ports of the network device.

[0033] Specifically, in one embodiment, in order to improve the flexibility and convenience of address information configuration, in the process of configuring address information for a network device, LLDP-based IPv4 address information can be configured for each port of the network device according to the total management address of the network device (e.g., the total IP address), or, according to the total management address of the network device, LLDP-based IPv6 address information can be configured for each port of the network device, or, according to the total management address of the network device, LLDP-based IPv4 address information and IPv6 address information can be configured for each port of the network device according to the total management address of the network device.

[0034] In another embodiment, in order to improve the accuracy of address information configuration, in the process of configuring address information for the network device, the address information can be configured for each port of the network device according to the management address of each port (for example, the IP address of each port). For example, according to the management address 1 of port 1 of the network device, the IPv4 address information based on LLDP is configured for port 1 of the network device; or, according to the management address 2 of port 2 of the network device, the IPv6 address information based on LLDP is configured for port 2 of the network device; or, according to the management address 3 of port 3 of the network device, the IPv4 address information and IPv6 address information based on LLDP are configured for port 3 of the network device; or, according to the management address 4 of port 4 of the network device, the IPv4 address information and IPv6 address information based on LLDP are configured for port 4 of the network device; or, according to the management address 5 of port 5 of the network device, the IPv6 address information based on LLDP is configured for port 5 of the network device; and so on.

[0035] Reference Figure 4 In one embodiment, after step S50, the address management method may further include but is not limited to step S60, which may be specifically as follows:

[0036] Step S60: receiving a modification instruction, and modifying the initial address information according to the modification instruction;

[0037] Step S10 may include but is not limited to step S11, which may be specifically as follows:

[0038] Step S11: Send the modified initial address information to the networking device based on the networking request.

[0039] After completing the configuration of the initial address information of the network device, in the subsequent use process, the initial address information of the network device can be modified according to actual needs to improve the flexibility of the initial address information configuration, and improve the ease of use and maintainability of the network device. Among them, the modification instruction can include deletion, addition or replacement, etc. Specifically, the network device can receive the modification instruction of the initial address information and modify the initial address information according to the modification instruction. For example, when the initial address information of port 1 of the network device is IPv4, the initial address information IPv6 can be added according to the received modification instruction, and the initial address information of port 1 of the network device is IPv4 and IPv6; for another example, when the initial address information of port 2 of the network device is IPv4 and IPv6, the initial address information IPv4 can be deleted according to the received modification instruction, and the initial address information of port 2 of the network device is IPv6; for another example, when the initial address information of port 3 of the network device is IPv4, the initial address information IPv4 can be replaced with IPv6 according to the received modification instruction, and the initial address information of port 3 of the network device is IPv6; and so on. When the initial address information of the network device is modified, the modified initial address information can be sent to the networking device based on the networking request.

[0040] Reference Figure 5 In one embodiment, step S10 may include but is not limited to steps S12, S13 and S14, etc., which may be specifically as follows:

[0041] Step S12: determining an activated port in the network device based on the networking request;

[0042] Step S13, obtaining the LLDP-based initial address information of the port configuration;

[0043] Step S14: Send the initial address information to the networking device.

[0044] In order to improve the accuracy and reliability of the initial address information transmission, the activated port in the network device can be determined based on the networking request, that is, the port in the Link up state can be determined, and then the initial address information of the LLDP configuration corresponding to the port can be loaded and sent to the networking device. For example, when the network cable connecting the network device and the networking device is inserted into port 1 of the network device, it is determined that port 1 of the network device is activated. If the IPv4 and IPv6 address information corresponding to port 1 are configured, the dual stack automatic adaptation state machine starts to work, and the initial address information IPv4 and IPv6 corresponding to port 1 are loaded at this time, and the initial address information IPv4 and IPv6 are sent to the networking device, and it works in the dual stack state by default.

[0045] Reference Figure 6 In one embodiment, step S14 may include but is not limited to steps S141, S142 and S143, and may be specifically as follows:

[0046] Step S141, encapsulate the initial address information into a triplet TLV format;

[0047] Step S142: Generate an LLDP message according to the initial address information in TLV format;

[0048] Step S143: Send the LLDP message carrying the initial address information to the networking device.

[0049] In order to improve the reliability and security of the transmission of the initial address information, the initial address information can be encapsulated into an LLDP message for transmission. For example, the device information such as the port number and object identifier (OID) corresponding to the initial address information of the network device can be obtained, and the device information such as the port number and object identifier, as well as the initial address information can be encapsulated into a triple TLV format, and then a plurality of TLV format data are combined into a Link Layer Discovery Protocol Data Unit (LLDPDU) and encapsulated in the data part of the LLDP message for transmission, that is, the LLDP message can be generated according to the data such as the initial address information in the TLV format, and the LLDP message carrying the initial address information can be sent to the networking device.

[0050] Among them, TLV is the unit that makes up LLDPDU, and each TLV represents a device information. Address information (also called management address) TLV is a basic TLV type specified by the LLDP protocol. This type of TLV mainly contains address information, as well as the port number and object identifier corresponding to the address information. LLDP messages can be used by network management systems and engineering maintenance personnel to query and determine the communication status of the link, as well as to view networking device information, including system description, management address, device identification, and port identification (i.e., port number).

[0051] S20: Receive a preset message returned by the networking device based on the initial address information.

[0052] The preset message may be flexibly set according to actual needs. For example, when the LLDP protocol is used, the preset message may be an LLDP message.

[0053] In one embodiment, receiving a preset message returned by the networking device based on the initial address information may include: receiving an LLDP message carrying the address information of the networking device returned by the networking device based on the initial address information.

[0054] For example, when the address information supported or configured by the networking device is IPv4 and IPv6, the network device can receive LLDP messages returned by the networking device and carrying address information of IPv4 and IPv6; for another example, when the address information supported or configured by the networking device is IPv4, the network device can receive LLDP messages returned by the networking device and carrying address information of IPv4; for another example, when the address information supported or configured by the networking device is IPv6, the network device can receive LLDP messages returned by the networking device and carrying address information of IPv6.

[0055] S30. Adjust the initial address information according to the address information of the networking device carried in the preset message.

[0056] Taking the preset message as an LLDP message as an example, after receiving the LLDP message returned by the networking device, the LLDP message can be parsed to obtain data in TLV format, and the address information of the networking device can be extracted from the data in TLV format. Then, the network device can adjust its own initial address information according to the address information of the networking device.

[0057] For example, if the address information of the networking device received is IPv4 and IPv6, the network device can adjust the initial address information to IPv4 and IPv6; if the address information of the networking device received is IPv4, the network device can adjust the initial address information to IPv4; if the address information of the networking device received is IPv6, the network device can adjust the initial address information to IPv6. The adaptive adjustment of the address information of IPv4 and IPv6 dual stacks of the network device based on the LLDP protocol is realized, which overcomes the problem of manual configuration in the prior art and improves the ease of use and maintainability of the network device.

[0058] Taking the address information as an IP address and the preset message as an LLDP message as an example, in one embodiment, when a new port of a network device joins the network, the adaptive method of the LLDP management address may include: first, the port of the network device is initially in a down state, and the port is in a link up state after docking with the networking device, and then starts to load the current configuration of the address information of the port based on the LLDP protocol, and determines whether both IPv4 and IPv6 dual stack addresses are configured; if the configured address information is 192.168.0.1 and 192::168:0:1, the dual stack adaptive state machine is started, and the state machine determines that the LLDP message sending address information is 192.168.0.1 and 192::168:0:1, that is, an LLDP message carrying 192.168.0.1 and 192::168:0:1 is sent to the networking device, and the configuration needs to be reloaded when the address information configuration changes. When the address information of the networking device carried in the LLDP message returned by the networking device is the IPv4 address information, the initial address information of the network device is adjusted to the IPv4 address information of 192.168.0.1. If the configured address information is 192.168.0.1, the dual stack adaptive state machine is closed, and the LLDP message is determined by the configuration of 192.168.0.1 to send only the address information, that is, the LLDP message carrying 192.168.0.1 is sent to the networking device, and the configuration needs to be reloaded when the address information is changed. When the address information of the networking device carried in the LLDP message returned by the networking device is the IPv4 address information, the initial address information of the network device is maintained at the IPv4 address information of 192.168.0.1.

[0059] In another embodiment, when the port of the network device is in the state of sending dual-stack address information and the address information of the networking device is a single stack, the specific process of the dual-stack adaptive state machine may include: first, the state machine of the port of the network device is initially in the state of sending LLDP dual-stack address information, such as two address information of 192.168.0.1 and 192::168:0:1, and then at a certain moment, it encounters that only one kind of address information, such as 192::168:0:2 IPv6 address information, is received from the networking device for three consecutive times in the LLDP message, then the network device switches the port LLDP message to only send 192::168:0:1 address information, that is, sends the LLDP message carrying 192::168:0:1 to the networking device. If only 192.168.0.2 IPv4 address information is received from the networking device for three consecutive times, then the switch port LLDP message only sends 192.168.0.1 address information.

[0060] In another embodiment, the port has started dual stack adaptation but the initial address information of the network device is in a state of sending only IPv4 address information. When the address information of the networking device is changed to include an IPv6 address, the specific process of the dual stack adaptation state machine may include: first, the LLDP message of the port of the network device only sends IPv4 address information, such as 192.168.0.1, and interacts with the networking device. Then at a certain moment, an IPv6 address appears in the address information of the docked networking device, such as 192::168:0:2, and the state machine of the port of the network device switches back to the state of sending LLDP dual stack address information, that is, 192.168.0.1 and 192::168:0:1 two address information, and interacts with the networking device. Similarly, if the port of the network device originally only sends address information IPv6 address, then when the address information of the docked networking device includes an IPv4 address, it will switch back to the state of sending LLDP dual stack address information.

[0061] In one embodiment, adjusting the initial address information according to the address information of the networking device carried in the preset message may include:

[0062] When the address information of the networking device carried in the preset messages returned by the networking device for the preset number of consecutive times is all IPv4 address information, the initial address information is adjusted to IPv4 address information; or,

[0063] When the address information of the networking device carried in the preset messages returned by the networking device for the preset number of consecutive times is all IPv6 address information, the initial address information is adjusted to the IPv6 address information; or,

[0064] When the address information of the networking device carried in the preset message returned by the networking device reaches the preset number of times, the initial address information is adjusted to the IPv4 address information and the IPv6 address information.

[0065] In order to improve the stability and accuracy of address information adjustment, the initial address information of the network device can be adjusted only when the address information of the networking device is received for a preset number of consecutive times and is consistent. The preset number of times can be flexibly set according to actual needs. For example, the preset number of times can be set to 3 times or 5 times. For example, when the address information returned by the networking device to the networking device received for 3 consecutive times is all IPv4, it means that the networking device may only support IPv4. At this time, the initial address information of the network device can be adjusted to IPv4. For another example, when the address information of the networking device received for 3 consecutive times is all IPv6, it means that the networking device may only use IPv6. At this time, the initial address information of the network device can be adjusted to IPv6. For another example, when the address information of the networking device is received for both IPv4 and IPv6 for three times, it means that the networking device may use IPv4 and IPv6. At this time, the initial address information of the network device can be adjusted to IPv4 and IPv6 (for example, if the initial address information of the network device is IPv4 and IPv6, the initial address information of the network device is maintained as IPv4 and IPv6; if the initial address information of the network device is IPv4, the initial address information of the network device is modified to IPv4 and IPv6).

[0066] It should be noted that when the address information of the networking device received for a consecutive preset number of times is IPv4, the initial address information of the network device has been adjusted to IPv4. At this time, if the address information of the networking device received is IPv6, the initial address information of the network device needs to be readjusted. The initial address information of the network device can be adjusted to IPv4 and IPv6 first to enter the dual-stack state. When the address information of the networking device received at intervals is IPv4 or IPv6, the initial address information of the network device can be maintained in the IPv4 and IPv6 state; when the address information of the networking device received for a consecutive preset number of times is IPv6, the initial address information of the network device needs to be readjusted, that is, the initial address information of the network device is adjusted to IPv6.

[0067] In one embodiment, adjusting the initial address information according to the address information of the networking device carried in the preset message may include:

[0068] When the address information of the networking device carried in the preset message returned by the networking device is IPv4 address information, the initial address information is adjusted to IPv4 address information; or,

[0069] When the address information of the networking device carried in the preset message returned by the networking device is IPv6 address information, the initial address information is adjusted to the IPv6 address information; or,

[0070] When the address information of the networking device carried in the preset message returned by the networking device is IPv4 address information and IPv6 address information, the initial address information is adjusted to IPv4 address information and IPv6 address information.

[0071] In order to improve the timeliness of address information adjustment, the initial address information of the network device can be adjusted in real time. For example, when the address information received from the networking device is IPv4, it means that the networking device may only use IPv4. At this time, the initial address information of the network device can be adjusted to IPv4; for another example, when the address information received from the networking device is IPv6, it means that the networking device may only use IPv6. At this time, the initial address information of the network device can be adjusted to IPv6; for another example, when the address information received from the networking device is IPv4 and IPv6, it means that the networking device may use IPv4 and IPv6. At this time, the initial address information of the network device can be adjusted to IPv4 and IPv6 (for example, if the initial address information of the network device is IPv4 and IPv6, the initial address information of the network device is maintained as IPv4 and IPv6; if the initial address information of the network device is IPv4, the initial address information of the network device is modified to IPv4 and IPv6).

[0072] In the embodiment of the present application, when a networking request of a networking device is received, initial address information is sent to the networking device based on the networking request, and then a preset message returned by the networking device based on the initial address information is received, and the initial address information is adjusted according to the address information of the networking device carried in the preset message. This solution adaptively adjusts the initial address information of the network device through the address information of the networking device to adapt to the interaction with the networking devices with different address requirements, avoids manual confirmation and manual adjustment, improves the efficiency of adjusting the initial address information of the network device, and improves the convenience of address management.

[0073] See also Figure 7 , Figure 7 It is a schematic block diagram of the structure of a network device provided in an embodiment of the present application.

[0074] like Figure 7 As shown, the network device 300 may include a processor 302, a memory 303, and a communication interface 304 connected via a system bus 301, wherein the memory 303 may include a non-volatile computer-readable storage medium and an internal memory.

[0075] The non-volatile computer-readable storage medium can store a computer program. The computer program includes program instructions, and when the program instructions are executed, the processor can execute any address management method.

[0076] The processor 302 is used to provide computing and control capabilities to support the operation of the entire network device.

[0077] The memory 303 provides an environment for the operation of a computer program in a non-volatile computer-readable storage medium. When the computer program is executed by the processor 302, the processor 302 can execute any address management method.

[0078] The communication interface 304 is used for communication. Those skilled in the art will appreciate that Figure 7 The structure shown in the figure is only a block diagram of a partial structure related to the solution of the present application, and does not constitute a limitation on the network device 300 to which the solution of the present application is applied. The specific network device 300 may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0079] It should be understood that the bus 301 is, for example, an I2C (Inter-integrated Circuit) bus, the memory 303 may be a Flash chip, a read-only memory (ROM) disk, an optical disk, a USB flash drive or a mobile hard disk, etc., the processor 302 may be a central processing unit (CPU), and the processor 302 may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. Among them, the general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.

[0080] In some embodiments, the processor 302 is used to run a computer program stored in the memory 303 to perform the following steps:

[0081] When a networking request of a networking device is received, initial address information is sent to the networking device based on the networking request; a preset message returned by the networking device based on the initial address information is received; and the initial address information is adjusted according to the address information of the networking device carried in the preset message.

[0082] In one embodiment, before sending the initial address information to the networking device based on the networking request, the processor 302 also executes: configuring the Internet Communication Protocol version 4 IPv4 address information and / or Internet Communication Protocol version 6 IPv6 address information based on the Link Layer Discovery Protocol LLDP for the network device; setting the IPv4 address information and / or IPv6 address information as the initial address information.

[0083] In one embodiment, when configuring Internet Communication Protocol version 4 IPv4 address information and / or Internet Communication Protocol version 6 IPv6 address information based on the Link Layer Discovery Protocol LLDP for a network device, the processor 302 further executes: configuring the network device with LLDP-based IPv4 address information and / or IPv6 address information according to the overall management address of the network device; or configuring the network device with LLDP-based IPv4 address information and / or IPv6 address information according to the management address of each port of the network device.

[0084] In one embodiment, after setting the IPv4 address information and / or IPv6 address information as the initial address information, the processor 302 also executes: receiving a modification instruction, and modifying the initial address information according to the modification instruction; sending the initial address information to the networking device based on the networking request includes: sending the modified initial address information to the networking device based on the networking request.

[0085] In one embodiment, when sending initial address information to a networking device based on a networking request, the processor 302 further executes: determining an activated port in the network device based on the networking request; obtaining initial address information based on LLDP configured for the port; and sending the initial address information to the networking device.

[0086] In one embodiment, when sending the initial address information to the networking device, the processor 302 further executes: encapsulating the initial address information into a triplet TLV format; generating an LLDP message according to the initial address information in the TLV format; and sending the LLDP message carrying the initial address information to the networking device.

[0087] In one embodiment, when receiving a preset message returned by the networking device based on the initial address information, the processor 302 further executes: receiving an LLDP message carrying the address information of the networking device returned by the networking device based on the initial address information.

[0088] In one embodiment, when adjusting the initial address information according to the address information of the networking device carried in the preset message, the processor 302 further executes: when the address information of the networking device carried in the preset messages returned by the networking device received for a preset number of consecutive times is all IPv4 address information, adjusting the initial address information to IPv4 address information; or, when the address information of the networking device carried in the preset messages returned by the networking device received for a preset number of consecutive times is all IPv6 address information, adjusting the initial address information to IPv6 address information; or, when the address information of the networking device carried in the preset messages returned by the networking device received for a preset number of times is both IPv4 address information and IPv6 address information for a preset number of times, adjusting the initial address information to IPv4 address information and IPv6 address information.

[0089] In one embodiment, when adjusting the initial address information according to the address information of the networking device carried in the preset message, the processor 302 further executes: when the address information of the networking device carried in the preset message returned by the received networking device is IPv4 address information, adjusting the initial address information to IPv4 address information; or, when the address information of the networking device carried in the preset message returned by the received networking device is IPv6 address information, adjusting the initial address information to IPv6 address information; or, when the address information of the networking device carried in the preset message returned by the received networking device is IPv4 address information and IPv6 address information, adjusting the initial address information to IPv4 address information and IPv6 address information.

[0090] In the above embodiments, the description of each embodiment has its own focus. For the part that is not described in detail in a certain embodiment, please refer to the detailed description of the address management method above, and will not be repeated here.

[0091] The embodiments of the present application also provide a computer-readable storage medium, which stores a computer program, which includes program instructions, and the processor executes the program instructions to implement any address management method provided in the embodiments of the present application. For example, the computer program is loaded by the processor and can execute the following steps:

[0092] When a networking request of a networking device is received, initial address information is sent to the networking device based on the networking request; a preset message returned by the networking device based on the initial address information is received; and the initial address information is adjusted according to the address information of the networking device carried in the preset message.

[0093] The specific implementation of the above operations can be found in the previous embodiments, which will not be described in detail here.

[0094] The computer-readable storage medium may be an internal storage unit of the mobile terminal of the aforementioned embodiment, such as a hard disk or memory of the mobile terminal. The computer-readable storage medium may also be an external storage device of the mobile terminal, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (SecureDigital, SD) card, a flash card (Flash Card), etc. equipped on the mobile terminal.

[0095] Since the computer program stored in the computer-readable storage medium can execute any one of the address management methods provided in the embodiments of the present application, the beneficial effects that can be achieved by any one of the address management methods provided in the embodiments of the present application can be achieved. Please refer to the previous embodiments for details and will not be repeated here.

[0096] It should be understood that the terms used in this application specification are only for the purpose of describing specific embodiments and are not intended to limit the application. As used in this application specification and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include plural forms.

[0097] It should also be understood that the term "and / or" used in the specification of this application and the appended claims refers to any combination of one or more of the associated listed items and all possible combinations, including these combinations. It should be noted that, in this article, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or system including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or system. In the absence of further restrictions, an element defined by the sentence "including a..." does not exclude the presence of other identical elements in the process, method, article or system including the element.

[0098] The serial numbers of the embodiments of the present application are for description only and do not represent the advantages and disadvantages of the embodiments. The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed in the present application, and these modifications or replacements should be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be based on the protection scope of the claims.

Claims

1. An address management method, It is characterized in that The address management method is applied to a network device, and the address management method includes: When receiving a networking request from a networking device, sending an LLDP message carrying initial address information to the networking device based on the networking request, where the initial address information is IPv4 address information and / or IPv6 address information; Receiving a preset message returned by the networking device based on the initial address information, wherein the preset message is an LLDP message; According to the address information of the networking device carried in the preset message, the initial address information is adjusted to address information having an address type consistent with the address information of the networking device.

2. The address management method according to claim 1, It is characterized in that Before sending the initial address information to the networking device based on the networking request, the address management method further includes: Configuring the network device with Internet communication protocol version 4 IPv4 address information and / or Internet communication protocol version 6 IPv6 address information based on the link layer discovery protocol LLDP; The IPv4 address information and / or the IPv6 address information is set as initial address information.

3. The address management method according to claim 2, It is characterized in that The configuring of the fourth version of the Internet communication protocol IPv4 address information and / or the sixth version of the Internet communication protocol IPv6 address information based on the link layer discovery protocol LLDP for the network device comprises: According to the total management address of the network device, configure the LLDP-based IPv4 address information and / or IPv6 address information for the network device; or, According to the management addresses of the ports of the network device, LLDP-based IPv4 address information and / or IPv6 address information is configured for the network device.

4. The address management method according to claim 2, It is characterized in that After the IPv4 address information and / or the IPv6 address information is set as the initial address information, the address management method further comprises: receiving a modification instruction, and modifying the initial address information according to the modification instruction; The sending initial address information to the networking device based on the networking request includes: The modified initial address information is sent to the networking device based on the networking request.

5. The address management method according to claim 1, It is characterized in that The sending initial address information to the networking device based on the networking request includes: Determining an activated port in the network device based on the networking request; Obtaining LLDP-based initial address information of the port configuration; The initial address information is sent to the networking device.

6. The address management method according to claim 5, It is characterized in that The sending the initial address information to the networking device comprises: Encapsulating the initial address information into a triplet TLV format; Generate an LLDP message according to the initial address information in the TLV format; Sending an LLDP message carrying the initial address information to the networking device.

7. The address management method according to claim 1, It is characterized in that The receiving a preset message returned by the networking device based on the initial address information includes: Receive an LLDP message carrying the address information of the networking device, which is returned by the networking device based on the initial address information.

8. The address management method according to any one of claims 1 to 7, It is characterized in that The adjusting the initial address information according to the address information of the networking device carried in the preset message includes: When the address information of the networking device carried in the preset messages returned by the networking device for a preset number of consecutive times is all IPv4 address information, adjusting the initial address information to IPv4 address information; or, When the address information of the networking device carried in the preset messages returned by the networking device for consecutive preset times is all IPv6 address information, adjusting the initial address information to IPv6 address information; or, When the address information of the networking device carried in the preset message returned by the networking device reaches the preset number of times, the initial address information is adjusted to the IPv4 address information and the IPv6 address information.

9. The address management method according to any one of claims 1 to 7, It is characterized in that The adjusting the initial address information according to the address information of the networking device carried in the preset message includes: When the address information of the networking device carried in the preset message returned by the networking device is IPv4 address information, adjusting the initial address information to IPv4 address information; or, When the address information of the networking device carried in the preset message returned by the networking device is IPv6 address information, adjusting the initial address information to IPv6 address information; or, When the address information of the networking device carried in the preset message returned by the networking device is IPv4 address information and IPv6 address information, the initial address information is adjusted to IPv4 address information and IPv6 address information.

10. A network device, It is characterized in that The method comprises a processor and a memory, wherein the memory stores a computer program, and the processor executes the address management method according to any one of claims 1 to 9 when calling the computer program in the memory.

11. A storage medium for computer-readable storage, It is characterized in that The storage medium is used to store a computer program, and the computer program is loaded by a processor to execute the address management method according to any one of claims 1 to 9.

Citation Information

Patent Citations

  • IP address configuration method and network equipment

    CN106850869A