Uplink port identification method, device, electronic equipment and computer-readable storage medium
By monitoring DHCP messages and gateway connectivity, combined with ARP forwarding tables and MAC address tables, the uplink ports of downstream network devices can be quickly identified, solving the problem of slow acquisition speed in existing technologies and improving the efficiency of configuration information distribution.
Patent Information
- Application Number
- CN202211721616.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-30
- Publication Date
- 2026-03-06
- Estimated Expiration
- 2042-12-30
AI Technical Summary
The existing technology is slow in obtaining uplink port information, which affects the efficiency of configuration information distribution.
By monitoring whether a selected DHCP message is received or a connection to a specified gateway is established, the uplink port of the downstream network device is determined using the ARP forwarding table and MAC address table.
It improved the speed of obtaining uplink port information and increased the efficiency of distributing configuration information.
Smart Images

Figure CN118316907B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of communication technology, and more particularly to an uplink port identification method, apparatus, electronic device, and computer-readable storage medium. Background Technology
[0002] like Figure 1 The simplified optical network architecture shown includes access layer network devices, aggregation layer network devices, core layer network devices, and Aurora components. When an access layer network device is deployed with zero configuration or migrated from one aggregation layer network device to another, the Aurora components need to reissue configuration information for the access layer network device. The prerequisite for accurately issuing configuration information is that the Aurora components can obtain the port information of the uplink port of the access layer network device. The uplink port is the port that connects the access layer network device and the aggregation layer network device.
[0003] In related technologies, it is necessary to first obtain the network topology of the entire network, and then determine the port information of the uplink ports of the access layer network devices based on the network topology. Because this technology requires obtaining the network topology of the entire network first, it significantly reduces the speed of obtaining uplink port information, thus affecting the efficiency of configuration information distribution. Summary of the Invention
[0004] This invention provides an uplink port identification method, device, electronic device, and computer-readable storage medium to solve the problem in the prior art that greatly reduces the acquisition speed of uplink port information, thereby affecting the efficiency of configuration information distribution.
[0005] According to an embodiment of the present invention, an uplink port identification method is provided, which is applied in a downstream network device, including:
[0006] Monitor whether a selected Dynamic Host Configuration Protocol (DHCP) message is received or monitor whether there is connectivity with a specified gateway;
[0007] If the selected DHCP message is received, the receiving port of the selected DHCP message is determined, and the receiving port is determined as the uplink port for the lower-level network device to connect to the upper-level network device;
[0008] If a connection to the gateway is confirmed, the exit point of the lower-level network device to the gateway is determined based on the gateway's identifier, ARP forwarding table, and MAC address table, and the exit point is identified as the uplink port for the lower-level network device to connect to the upper-level network device.
[0009] Specifically, monitoring whether a selected DHCP message is received includes:
[0010] Send a request to the DHCP server to manage Internet Protocol (IP) addresses;
[0011] If a management IP address request response carrying a setting flag and a management IP address is received from the DHCP server, then a selected DHCP message is received.
[0012] Specifically, if the identifier of the gateway is the IP address of the gateway, then monitoring whether there is connectivity with the specified gateway includes:
[0013] After obtaining the IP address of the gateway, a Ping request message is sent based on the IP address of the gateway;
[0014] If a Ping response message is received from the gateway within the set time period, then it is determined that a connection has been established with the gateway.
[0015] Specifically, the exit point from the lower-level network device to the gateway is determined based on the gateway's identifier, ARP forwarding table, and MAC address table, including:
[0016] The MAC address of the gateway is obtained by looking up the MAC address corresponding to the IP address of the gateway in the ARP forwarding table.
[0017] The exit corresponding to the MAC address of the gateway is found in the MAC address table to obtain the exit point of the lower-level network device pointing to the gateway.
[0018] Optional, also includes:
[0019] The port information of the uplink port is reported to the corresponding Aurora component, so that the Aurora component can generate the configuration information of the lower-level network device based on the port information and send the configuration information down.
[0020] According to an embodiment of the present invention, an uplink port identification device is also provided, which is applied in a downstream network device, comprising:
[0021] The monitoring module is used to monitor whether a selected Dynamic Host Configuration Protocol (DHCP) message has been received or to monitor whether there is connectivity with a specified gateway.
[0022] The determination module is configured to, if the selected DHCP message is received, determine the receiving port of the selected DHCP message and designate the receiving port as the uplink port for the lower-level network device to connect to the upper-level network device; if it is determined that there is a connection with the gateway, determine the exit point of the lower-level network device to the gateway based on the gateway's identifier, ARP forwarding table, and MAC address table, and designate the exit point as the uplink port for the lower-level network device to connect to the upper-level network device.
[0023] Specifically, the monitoring module is used to monitor whether a selected DHCP message has been received, specifically for:
[0024] Send a request to the DHCP server to manage Internet Protocol (IP) addresses;
[0025] If a management IP address request response carrying a setting flag and a management IP address is received from the DHCP server, then a selected DHCP message is received.
[0026] Specifically, if the identifier of the gateway is the IP address of the gateway, then the monitoring module is used to monitor whether there is a connection with the specified gateway, specifically for:
[0027] After obtaining the IP address of the gateway, a Ping request message is sent based on the IP address of the gateway;
[0028] If a Ping response message is received from the gateway within the set time period, then it is determined that a connection has been established with the gateway.
[0029] Specifically, the determining module is used to determine the exit point of the lower-level network device pointing to the gateway based on the gateway's identifier, ARP forwarding table, and MAC address table, specifically for:
[0030] The MAC address of the gateway is obtained by looking up the MAC address corresponding to the IP address of the gateway in the ARP forwarding table.
[0031] The exit corresponding to the MAC address of the gateway is found in the MAC address table to obtain the exit point of the lower-level network device pointing to the gateway.
[0032] Optionally, the determining module is further configured to:
[0033] The port information of the uplink port is reported to the corresponding Aurora component, so that the Aurora component can generate the configuration information of the lower-level network device based on the port information and send the configuration information down.
[0034] According to an embodiment of the present invention, an electronic device is also provided, the electronic device including a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus;
[0035] Memory, used to store computer programs;
[0036] When a processor executes a program stored in memory, it implements the above method steps.
[0037] According to an embodiment of the present invention, a computer-readable storage medium is also provided, wherein a computer program is stored therein, and the computer program, when executed by a processor, implements the above-described method steps.
[0038] The beneficial effects of this invention are as follows:
[0039] This invention provides an uplink port identification method, apparatus, electronic device, and computer-readable storage medium. It monitors whether a selected DHCP message is received or whether there is connectivity with a specified gateway. If the selected DHCP message is received, the receiving port of the selected DHCP message is determined, and this receiving port is identified as the uplink port connecting the lower-level network device to the upper-level network device. If connectivity with the gateway is confirmed, the exit point from the lower-level network device to the gateway is determined based on the gateway's identifier, ARP forwarding table, and MAC address table, and this exit point is identified as the uplink port connecting the lower-level network device to the upper-level network device. In this scheme, after monitoring the receipt of a selected DHCP message or confirming connectivity with a specified gateway, the uplink port connecting the lower-level network device to the upper-level network device can be further determined. Compared to related technologies that require first determining the network topology of the entire network, this method significantly improves the speed of obtaining uplink port information, thereby increasing the efficiency of configuration information distribution. Attached Figure Description
[0040] Figure 1 This is an architecture diagram of the Aurora Network in related technologies;
[0041] Figure 2 This is a flowchart of an uplink port identification method in an embodiment of the present invention;
[0042] Figure 3 This is a flowchart of a method for distributing configuration information when an access layer network device goes online with zero configuration, according to an embodiment of the present invention;
[0043] Figure 4 This is a flowchart of a method for distributing configuration information after the migration of an access layer network device, as described in an embodiment of the present invention.
[0044] Figure 5 This is a schematic diagram of the structure of an uplink port identification device according to an embodiment of the present invention;
[0045] Figure 6 This is a schematic diagram of the structure of an electronic device shown in this application. Detailed Implementation
[0046] To address the problem in existing technologies that significantly reduce the speed of acquiring uplink port information, thereby affecting the efficiency of configuration information distribution, this invention provides an uplink port identification method. This solution is applied to applications such as... Figure 1 The lower-level network devices shown can be access layer network devices or aggregation layer network devices. The method flow is as follows: Figure 2 As shown, the execution steps are as follows:
[0047] S21: Process begins.
[0048] S22: Monitor whether a selected Dynamic Host Configuration Protocol (DHCP) message has been received or whether the connection with the specified gateway has been established. If a selected DHCP message has been received, proceed to S23; if the connection with the gateway has been established, proceed to S24.
[0049] Internet Protocol (IP) addresses in a network are generally divided into two types: those specifically assigned to actual users and those assigned to network devices within the network topology. IP addresses assigned to network devices primarily facilitate network administrators' control over these devices, hence they are called management IP addresses. Figure 1 In the Aurora network architecture shown, after a lower-level network device goes online with zero configuration, it will request a management IP address from the DHCP server. This request is based on the DHCP protocol, so it will receive a message carrying the management IP address sent by the DHCP server. The selected DHCP message can be, but is not limited to, this message. After a lower-level network device migrates from one upper-level network device to another, it will perform a connectivity test with the designated gateway. If the test result shows connectivity, it can continue to perform subsequent operations.
[0050] Different processing procedures can be adopted for the two scenarios: receiving a selected DHCP message and confirming connectivity with the gateway.
[0051] S23: Determine the receiving port for the selected DHCP message and designate the receiving port as the uplink port for the lower-level network device to connect to the upper-level network device.
[0052] If a selected DHCP message is received, the receiving port of the selected DHCP message can be determined as the uplink port for the lower-level network device to connect to the upper-level network device.
[0053] S24: Based on the gateway's identifier, Address Resolution Protocol (ARP) forwarding table, and Media Access Control Address (MAC) address table, determine the exit point of the lower-level network device pointing to the gateway, and identify the exit point as the uplink port for the lower-level network device to connect to the upper-level network device.
[0054] If a connection to the gateway is confirmed, the exit point of the lower-level network device pointing to the gateway can be defined as the uplink port connecting the lower-level network device to the upper-level network device.
[0055] In this scheme, after monitoring receives a selected DHCP message or confirms a connection with a specified gateway, the uplink port of the lower-level network device to the upper-level network device can be further determined. Compared with the method in related technologies that requires first determining the network topology of the entire network, since it is not necessary to determine the network topology of the entire network, the acquisition speed of the uplink port information can be greatly improved, thereby improving the efficiency of configuration information distribution.
[0056] Specifically, monitoring whether a selected DHCP message is received in S22 above includes:
[0057] Send a request to the DHCP server to manage Internet Protocol (IP) addresses;
[0058] If a DHCP server sends a response requesting a management IP address, carrying a configuration flag and a management IP address, then a selected DHCP message is received.
[0059] To assign management IP addresses to downstream network devices, a DHCP server pre-configures a management IP address pool. When a downstream network device comes online with zero configuration, it first needs to request a management IP address by sending a management IP address request to the DHCP server. After receiving the request, the DHCP server selects a management IP address from the pool and sends a management IP address request response to the downstream network device, carrying the management IP address and a setting flag. The downstream network device can determine that the management IP address is valid based on the setting flag. Therefore, if it receives a management IP address request response carrying the setting flag and the management IP address, it has received a selected DHCP message.
[0060] Specifically, if the gateway identifier is the gateway's IP address, then monitoring whether there is connectivity with the specified gateway in S23 above specifically includes:
[0061] After obtaining the gateway's IP address, a Ping request message is sent based on the gateway's IP address;
[0062] If a Ping response message is received from the gateway within the set time period, then a connection with the gateway is confirmed.
[0063] You can use a selected packet ping to check if you are connected to a specified gateway. There are many ways to identify a gateway, including but not limited to its IP address. The following explanation uses the gateway's IP address as an example.
[0064] If a downstream network device is migrated from one upstream network device to another, the downstream network device will have configuration information and will have already applied for a management IP address. In this case, the downstream network device will first obtain the gateway's IP address from the configuration information and perform a ping test based on the gateway's IP address. Specifically, it will send a ping request packet. If the gateway receives the ping request packet, it will reply with a ping response packet; otherwise, it will not reply with a ping response packet. In this case, the specified gateway needs to be changed, and the connectivity test will be performed again, repeating the above process. If the downstream network device receives a ping response packet within a set time period, it is considered to be connected to the gateway. The set time period can be configured according to actual needs.
[0065] Specifically, the step in S24 above, which involves determining the exit point from the gateway for the downstream network device based on the gateway's identifier, the ARP forwarding table, and the MAC address table, includes:
[0066] The gateway's MAC address is obtained by looking up the MAC address corresponding to the gateway's IP address in the ARP forwarding table.
[0067] The exit point corresponding to the gateway's MAC address is found in the MAC address table to obtain the exit point from the downstream network device pointing to the gateway.
[0068] When determining the exit point of a downstream network device pointing to a gateway, you can first look up the MAC address corresponding to the gateway's IP address in the ARP forwarding table. This is the gateway's MAC address. Then, look up the exit point corresponding to the gateway's MAC address in the MAC address table. This is the exit point of the downstream network device pointing to the gateway.
[0069] Optionally, the above methods also include:
[0070] The port information of the uplink port is reported to the corresponding JPush component, so that the JPush component can generate and distribute the configuration information of the lower-level network device based on the port information.
[0071] After determining the uplink port of the lower-level network device to connect to the upper-level network device, the lower-level network device can report the port information of the uplink port to the corresponding JPush component. The JPush component can generate configuration information for the lower-level network device based on the port information and send it down. After receiving the configuration information, the lower-level network device can configure itself based on the configuration information and thus perform normal business processing.
[0072] It should be noted that the Aurora components and DHCP server can be set up in the core network device or in a separate server.
[0073] The lower-level network device can be an access layer network device or an aggregation layer network device. If the lower-level network device is an access layer network device, then the upper-level network device is an aggregation layer network device; if the lower-level network device is an aggregation layer network device, then the upper-level device is a core layer network device. The uplink port identification method is the same in both cases. The following explanation uses an example where the lower-level network device is an access layer network device and the upper-level network device is an aggregation layer network device. The following section describes the configuration information distribution method for access layer network devices in two scenarios: zero-configuration deployment and migration. Figure 3 The diagram illustrates the process flow for distributing configuration information to access layer network devices during zero-configuration deployment, specifically including:
[0074] S31: The access layer network device sends a request for a management IP address to the DHCP server.
[0075] S32: After receiving a management IP address request from an access layer network device, the DHCP server returns a management IP address request response carrying a setting flag and the management IP address.
[0076] S33: When an access layer network device receives a management IP address request response from a DHCP server, carrying a setting flag and a management IP address, it determines that it has received a selected DHCP message and identifies the receiving port as the uplink port for the access layer network device to connect to the aggregation layer network device.
[0077] S34: The access layer network device reports the port information of the uplink port to the corresponding JPush component.
[0078] S35: The Aurora component generates and distributes the configuration information of the access layer network device based on the port information.
[0079] S36: After receiving the configuration information sent by the Aurora component, the access layer network device performs configuration according to the configuration information.
[0080] After the access layer network devices are put online with zero configuration, the uplink ports of the access layer network devices are identified through the above process. Then, the configuration information is quickly sent out by JPush, which can realize the rapid configuration of the access layer network devices without having to determine the network topology of the entire network. This can greatly speed up the configuration of access layer network devices.
[0081] like Figure 4 The diagram illustrates the process flow for distributing configuration information when an access layer network device migrates from one aggregation layer network device to another, specifically including:
[0082] S41: After obtaining the gateway's IP address, the access layer network device sends a Ping request message based on the gateway's IP address.
[0083] S42: After receiving the Ping request message, the gateway returns a Ping response message.
[0084] S43: When the access layer network device receives a Ping response message returned by the gateway, it determines that it is connected to the specified gateway, looks up the MAC address corresponding to the gateway's IP address in the ARP forwarding table, obtains the gateway's MAC address, looks up the exit corresponding to the gateway's MAC address in the MAC address table, obtains the exit point from the access layer network device to the gateway, and determines the exit point as the uplink port for the access layer network device to connect to the aggregation layer network device.
[0085] S44: The access layer network device reports the port information of the uplink port to the corresponding JPush component.
[0086] S45: The Aurora component generates and distributes the configuration information of the access layer network device based on the port information.
[0087] S46: After receiving the configuration information sent by the Aurora component, the access layer network device performs configuration according to the configuration information.
[0088] When an access layer network device migrates from one aggregation layer network device to another, after identifying the uplink port of the access layer network device through the above process, the configuration information can be quickly sent out by JPush, which can realize the rapid configuration of the access layer network device without having to determine the network topology of the entire network, thus greatly speeding up the configuration of the access layer network device.
[0089] Based on the same inventive concept, embodiments of the present invention provide an uplink port identification device, applied in a downstream network device, the structure of which is as follows: Figure 5 As shown, it includes:
[0090] Monitoring module 51 is used to monitor whether a selected DHCP message is received or to monitor whether there is a connection with a specified gateway;
[0091] The determination module 52 is used to determine the receiving port of the selected DHCP message if a selected DHCP message is received, and to determine the receiving port as the uplink port for the lower-level network device to connect to the upper-level network device; if it is determined that there is a connection with the gateway, it determines the exit point of the lower-level network device to the gateway according to the gateway's identifier, the ARP forwarding table and the MAC address table, and determines the exit point as the uplink port for the lower-level network device to connect to the upper-level network device.
[0092] In this scheme, after monitoring receives a selected DHCP message or confirms a connection with a specified gateway, the uplink port of the lower-level network device to the upper-level network device can be further determined. Compared with the method in related technologies that requires first determining the network topology of the entire network, since it is not necessary to determine the network topology of the entire network, the acquisition speed of the uplink port information can be greatly improved, thereby improving the efficiency of configuration information distribution.
[0093] Specifically, monitoring module 51 is used to monitor whether a selected DHCP message has been received, and is specifically used for:
[0094] Send a request to the DHCP server to manage Internet Protocol (IP) addresses;
[0095] If a DHCP server sends a response requesting a management IP address, carrying a configuration flag and a management IP address, then a selected DHCP message is received.
[0096] Specifically, if the gateway identifier is the gateway's IP address, then monitoring module 51 is used to monitor whether there is connectivity with the specified gateway, specifically for:
[0097] After obtaining the gateway's IP address, a Ping request message is sent based on the gateway's IP address;
[0098] If a Ping response message is received from the gateway within the set time period, it is determined that a connection has been established with the gateway.
[0099] Specifically, module 52 is used to determine the exit point of the lower-level network device pointing to the gateway based on the gateway's identifier, ARP forwarding table, and MAC address table. Specifically, it is used for:
[0100] The gateway's MAC address is obtained by looking up the MAC address corresponding to the gateway's IP address in the ARP forwarding table.
[0101] The exit point corresponding to the gateway's MAC address is found in the MAC address table to obtain the exit point from the downstream network device pointing to the gateway.
[0102] Optionally, module 52 is also used for:
[0103] The port information of the uplink port is reported to the corresponding JPush component, so that the JPush component can generate and distribute the configuration information of the lower-level network device based on the port information.
[0104] This application also provides an electronic device; please refer to [link to relevant documentation]. Figure 6 As shown, it includes a processor 610, a communication interface 620, a memory 630, and a communication bus 640, wherein the processor 610, the communication interface 620, and the memory 630 communicate with each other through the communication bus 640.
[0105] Memory 630 is used to store computer programs;
[0106] When the processor 610 executes the program stored in the memory 630, it implements the uplink port identification method described in any of the above embodiments.
[0107] The communication interface 620 is used for communication between the above-mentioned electronic devices and other devices.
[0108] The memory may include random access memory (RAM) or non-volatile memory (NVM), such as at least one disk storage device. Optionally, the memory may also be at least one storage device located remotely from the aforementioned processor.
[0109] The processors mentioned above can be general-purpose processors, including central processing units (CPUs), network processors (NPs), etc.; they can also be digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.
[0110] In this scheme, after monitoring receives a selected DHCP message or confirms a connection with a specified gateway, the uplink port of the lower-level network device to the upper-level network device can be further determined. Compared with the method in related technologies that requires first determining the network topology of the entire network, since it is not necessary to determine the network topology of the entire network, the acquisition speed of the uplink port information can be greatly improved, thereby improving the efficiency of configuration information distribution.
[0111] Accordingly, embodiments of this application also provide a computer-readable storage medium storing instructions that, when executed on a computer, cause the computer to perform any of the uplink port identification methods described in the above embodiments.
[0112] In this scheme, after monitoring receives a selected DHCP message or confirms a connection with a specified gateway, the uplink port of the lower-level network device to the upper-level network device can be further determined. Compared with the method in related technologies that requires first determining the network topology of the entire network, since it is not necessary to determine the network topology of the entire network, the acquisition speed of the uplink port information can be greatly improved, thereby improving the efficiency of configuration information distribution.
[0113] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0114] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0115] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0116] Although alternative embodiments of the invention have been described, those skilled in the art, upon learning the basic inventive concept, can make further changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the alternative embodiments as well as all changes and modifications falling within the scope of the invention.
[0117] Obviously, those skilled in the art can make various modifications and variations to the embodiments of the present invention without departing from the spirit and scope of the embodiments of the present invention. Thus, if these modifications and variations to the embodiments of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention also intends to include these modifications and variations.
Claims
1. An uplink port identification method, applied in a downstream network device, characterized in that, The method comprises the following steps: monitoring whether a selected dynamic host configuration protocol (DHCP) message is received or whether a specified gateway is connected; if the selected DHCP message is received, determining a receiving port of the selected DHCP message, and determining the receiving port as an uplink port of the lower-level network device connecting a higher-level network device; if the gateway is determined to be connected, determining an egress of the lower-level network device pointing to the gateway according to an identification of the gateway, an address resolution protocol (ARP) forwarding table, and a media access control (MAC) address table, and determining the egress as the uplink port of the lower-level network device connecting the higher-level network device.
2. The method of claim 1, wherein, The monitoring whether the selected DHCP message is received comprises the following steps: sending an application request of a management Internet protocol (IP) address to a DHCP server; if an application response of the management IP address carrying a set mark and a management IP address is received from the DHCP server, it is determined that the selected DHCP message is received.
3. The method of claim 1, wherein, If the identification of the gateway is an IP address of the gateway, the monitoring whether the specified gateway is connected comprises the following steps: after the IP address of the gateway is obtained, sending a Ping request message based on the IP address of the gateway; if a Ping response message returned by the gateway is received within a set time length, it is determined that the gateway is connected.
4. The method of claim 3, wherein, The determining the egress of the lower-level network device pointing to the gateway according to the identification of the gateway, the ARP forwarding table, and the MAC address table comprises the following steps: finding a MAC address corresponding to the IP address of the gateway in the ARP forwarding table to obtain the MAC address of the gateway; finding an egress corresponding to the MAC address of the gateway in the MAC address table to obtain the egress of the lower-level network device pointing to the gateway.
5. The method according to any one of claims 1 to 4, characterized in that, The method further comprises the following steps: reporting port information of the uplink port to a corresponding aurora component, so that the aurora component generates configuration information of the lower-level network device according to the port information and delivers the configuration information.
6. An upper port identification device applied to a lower network device, characterized in that, The method comprises the following steps: a monitoring module, configured to monitor whether a selected dynamic host configuration protocol (DHCP) message is received or whether a specified gateway is connected; a determining module, configured to, if the selected DHCP message is received, determine a receiving port of the selected DHCP message, and determine the receiving port as an uplink port of the lower-level network device connecting a higher-level network device; if the gateway is determined to be connected, determine an egress of the lower-level network device pointing to the gateway according to an identification of the gateway, an address resolution protocol (ARP) forwarding table, and a media access control (MAC) address table, and determine the egress as the uplink port of the lower-level network device connecting the higher-level network device.
7. The apparatus of claim 6, wherein, The monitoring module is specifically configured to: send an application request of a management Internet protocol (IP) address to a DHCP server; if an application response of the management IP address carrying a set mark and a management IP address is received from the DHCP server, it is determined that the selected DHCP message is received.
8. The apparatus of claim 6, wherein, If the identification of the gateway is an IP address of the gateway, the monitoring module is specifically configured to monitor whether the specified gateway is connected. After the IP address of the gateway is acquired, a Ping request message is sent based on the IP address of the gateway; If the Ping response message returned by the gateway is received within a set time length, it is determined that the gateway is connected.
9. The apparatus of claim 8, wherein, The determining module is configured to determine the egress of the subordinate network device pointing to the gateway according to the identifier of the gateway, an ARP forwarding table and a MAC address table, and specifically configured to: find the MAC address corresponding to the IP address of the gateway in the ARP forwarding table to obtain the MAC address of the gateway; find the egress corresponding to the MAC address of the gateway in the MAC address table to obtain the egress of the subordinate network device pointing to the gateway.
10. The apparatus of any one of claims 6-9, wherein, The determining module is further configured to: report the port information of the uplink port to the corresponding aurora component, so that the aurora component generates configuration information of the subordinate network device according to the port information and delivers the configuration information.
11. An electronic device, comprising: The electronic device includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory complete mutual communication through the communication bus; The memory is used to store a computer program; The processor is used to execute the program stored on the memory, and realize the method steps of any one of claims 1-5.
12. A computer-readable storage medium, characterized in that, The computer readable storage medium stores a computer program, and the computer program is executed by the processor to realize the method steps of any one of claims 1-5.
Citation Information
Patent Citations
Processing method, access device and communication system for address resolution protocol
CN101394360A
Method and device for realizing home gateway function in passive optical network (PON)
CN102082979A