Actual access router searching method and system based on multi-router networking
Through the main router, FDB data is summarized and parsed, relevant device entries are marked and updated, and the topology database is updated. The problem of identifying the actual access router in a multi-router networking environment is solved, and fast and accurate identification and management is achieved.
Patent Information
- Application Number
- CN202411905712.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-23
- Publication Date
- 2025-03-14
AI Technical Summary
In a multi-router networking environment, it is difficult to accurately identify the actual access router of wired terminal devices, resulting in poor network management and user experience, increasing the difficulty of network troubleshooting and reducing the reliability and stability of the network.
The main router summarizes the FDB data of all routers, parses and marks other related device entries corresponding to specific port numbers, updates the FDB table, and polls and compares the remaining device MAC address table entries, confirms that the actual access to the router, and updates the topology database.
It realizes the rapid and accurate identification of the actual access router of each wired terminal device in a multi-router networking environment, solves the problem of complex topology, and improves the efficiency and user experience of network management.
Smart Images

Figure CN119629104A_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of multi-channel terminal equipment networking, and in particular relates to a method and system for searching actual access routers based on multi-router networking. Background Art
[0002] In modern network architectures, especially in complex environments involving multi-router networking, when wired networking networks coexist with wired terminal devices, it is difficult to accurately identify the router to which a specific wired terminal device is actually connected due to the high complexity of the wired network topology. The wired connection topology identification means in the prior art mainly rely on the direct query mechanism of the Address Resolution Protocol (ARP) table or the Forwarding Database (FDB) table to search for the actual access router, which can usually provide sufficient information to determine the network access point of the terminal device in a network system managed by a single router. However, in a wired networking system containing multiple routers, such information often cannot fully and accurately reflect the actual connection path of the wired terminal device. This is because the network topology in a multi-router environment may include complex link aggregation, VLAN (virtual local area network) division, and dynamic routing protocols. These factors may cause differences between the actual physical connection of network traffic and the information recorded in the ARP table or FDB table. This inconsistency may cause network administrators or users to be unable to quickly and accurately obtain the actual connection status of the device, thereby adversely affecting device management and user experience. This not only increases the difficulty of network troubleshooting, but may also reduce the reliability and stability of the overall network. Summary of the invention
[0003] The present invention provides a method and system for searching actual access routers based on multi-router networking, which can summarize the FDB data of all routers through a main router, mark and remove other associated device entries corresponding to a specific port number after data analysis, so that the remaining port numbers that are more likely to be actually connected to the terminal device are processed in a targeted manner, and the remaining device MAC address table items are polled and compared after the FDB table is updated, so as to confirm the actual access router and update the topology database, which can solve the complex topology structure problem when wired networking and wired terminal connection devices coexist, and thus ensure that the system can quickly and accurately identify the actual access router of each wired terminal device.
[0004] A method for searching an actual access router based on a multi-router network, comprising: Monitor the device change events in the FDB table and aggregate the monitored router and FDB table information to the main router; Parse the obtained FDB table, mark and remove the device entry containing the port number of the router device MAC address in the FDB table, and update the FDB table; Poll and compare the remaining device MAC address entries in the updated FDB table, search one by one in the local network topology database, confirm the actual access router, and update the local network topology database.
[0005] The FDB data of all routers can be summarized through the main router. After data analysis, the entries of other downstream devices corresponding to the port numbers can be marked and removed, so that the ports actually connected to the terminal devices can be processed in a targeted manner. After the FDB table is updated, the MAC address table entries of the remaining devices are polled to confirm the actual access router and update the topology database. This can solve the complex topology structure problem when wired networking and wired terminal connection devices coexist, thereby ensuring that the system can quickly and accurately identify the actual access router of each wired terminal device.
[0006] Further, monitoring the device change event in the FDB table and aggregating the information of the monitored router and the FDB table to the main router includes: When the router that monitors the device change event in the FDB table is the main router, the MAC address of the current main router and all the data collected in the FDB table are recorded; When the router that monitors the device change event in the FDB table is a slave router, the current slave router device MAC address and all the data collected in the FDB table are synchronously transmitted to the master router.
[0007] The FDB data of all routers can be summarized through the main router, which facilitates the summary and organization of all data and provides a data basis for the subsequent confirmation of the actual access router.
[0008] Further, the parsing of the obtained FDB table, marking and removing the device entry containing the port number of the router device MAC address in the FDB table, and updating the FDB table include: Based on the obtained FDB table, the main router parses its data; Mark the port number of the associated device MAC that contains the router device MAC address in the FDB table, and remove all device entries belonging to the marked port number to obtain the remaining port number of the actual connected terminal device; Update the FDB table.
[0009] By removing other device entries under the port number of the current router device MAC address in the FDB table, the port actually connected to the terminal device can be processed in a targeted manner, which reduces the processing difficulty and improves the processing efficiency.
[0010] Furthermore, after parsing the acquired data in the FDB table, the main router further calculates the total number of device MAC addresses associated with each port number, and records the total number as mac_cnt.
[0011] By calculating the total number of device MAC addresses associated with each port number, a basis for subsequent topology analysis is provided.
[0012] Further, the polling and comparison of the remaining device MAC address entries in the updated FDB table, searching one by one in the local network topology database, confirming the actual access router, and updating the local network topology database include: Based on the local network topology database, obtain the latest network topology data; Traverse and poll the remaining device MAC address entries in the updated FDB table, and search and compare them one by one based on the latest network topology data to confirm the actual access router; The confirmed actual access router is rewritten into the network topology data to update the local networking topology database.
[0013] Furthermore, searching and comparing one by one based on the latest network topology data to confirm the actual access router includes: When the MAC address of the device currently being searched does not exist in the latest network topology data, the total number of device MAC addresses associated with the MAC address of the device and its associated port number is inserted into the network topology data, and the access router of the device is marked as the actual access router of the sent FDB table; When the MAC address of the device currently being searched already exists in the latest network topology data, but the recorded access router is inconsistent with the router that sent the FDB table, and the total number of device MAC addresses associated with the device-associated port number in the updated FDB table does not exceed the total number of device MAC addresses associated with the device-associated port number in the network topology data, the device MAC address of the router that sends this FDB table will overwrite the original access router device MAC address recorded in the network topology data as the final actual access router.
[0014] By setting different association rules, it is convenient to accurately find and confirm the router to which the wired terminal device is actually connected.
[0015] A system for searching an actual access router based on a multi-router network, comprising: An information acquisition module monitors the device change events in the FDB table and aggregates the monitored router and FDB table information to the main router; An FDB table parsing and updating module, which parses the obtained FDB table, marks and removes the port entries containing the MAC address of the router device in the FDB table, and updates the FDB table; The access router confirmation module polls and compares the remaining router device MAC address entries in the updated FDB table, searches one by one in the local network topology database, confirms the actual access router, and updates the local network topology database.
[0016] An electronic device comprises a memory and a processor, wherein the memory stores a computer program, and the processor implements the above method when executing the computer program.
[0017] A computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method described above is implemented.
[0018] The beneficial effects of the present invention are: The present invention can aggregate the FDB data of all routers through the main router, and after data parsing, mark and remove other associated device entries corresponding to specific port numbers, so that targeted processing is more likely to actually connect to the remaining port numbers of the terminal devices, and after the FDB table is updated, the MAC address table entries of the remaining devices are polled and compared, thereby confirming the actual access router and updating the topology database, which can solve the complex topology structure problem when wired networking and wired terminal connection devices coexist, thereby ensuring that the system can quickly and accurately identify the actual access router of each wired terminal device. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] Figure 1 is a flow chart of the present invention; Figure 2 The flowchart of the algorithm for finding the actual access router in the present invention; Figure 3 It is a schematic diagram of the system structure of the present invention; Figure 4 This is a schematic diagram of the computer equipment structure. DETAILED DESCRIPTION
[0020] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0021] It should be noted that various aspects of the embodiments within the scope of the appended claims are described below. It should be apparent that the aspects described herein can be embodied in a wide variety of forms, and any specific structure and / or function described herein is merely illustrative. Based on the present disclosure, it should be understood by those skilled in the art that an aspect described herein can be implemented independently of any other aspect, and two or more of these aspects can be combined in various ways. For example, any number of aspects described herein can be used to implement the device and / or practice the method. In addition, other structures and / or functionalities other than one or more of the aspects described herein can be used to implement this device and / or practice this method.
[0022] In addition, in the following description, specific details are provided to facilitate a thorough understanding of the examples, and a person of ordinary skill in the art can understand the specific meanings of the above terms in this application under specific circumstances.
[0023] Example 1 Figure 1 The method shown is a method for finding the actual access router based on multi-router networking. The FDB data of all routers can be summarized through the main router. After the data is parsed, the entries of other associated devices corresponding to the specific port number are marked and removed, so that the remaining port numbers that are more likely to be actually connected to the terminal device can be processed in a targeted manner. After the FDB table is updated, the MAC address table entries of the remaining devices are polled and compared to confirm the actual access router and update the topology database. This can solve the complex topology problem when wired networking and wired terminal connection devices coexist, thereby ensuring that the system can quickly and accurately identify the actual access router of each wired terminal device. Including: S1: monitors the device change events in the FDB table and summarizes the information of the monitored routers and FDB tables to the main router; In this embodiment, when the addition, deletion, or change event of a device in the FDB is monitored, the subsequent process is triggered to obtain all the data in the current FDB table, filter out the local interface, wireless interface, and invalid MAC address entries, retain the data of the wired terminal device, and record the current router device MAC address to mark the source of the FDB table data. At the same time, the data is summarized by judging the role of the current router.
[0024] S11: When the router that monitors the device change event in the FDB table is the main router, the MAC address of the current main router device and all the data collected in the FDB table are recorded; S12: When the router that monitors the device change event in the FDB table is a slave router, the MAC address of the current slave router device and all the data collected in the FDB table are synchronously transmitted to the master router; In this embodiment, the slave router synchronizes the collected FDB table and its own router device MAC address to the master router through a dedicated message channel.
[0025] S2: Parse the obtained FDB table, mark and remove the device entry containing the port number of the router device MAC address in the FDB table, and update the FDB table; S21: Based on the obtained FDB table, the master router parses its data; In this embodiment, after parsing the acquired data of the FDB table, the main router further calculates the total number of device MAC addresses associated with each port number, and records it as mac_cnt, thereby providing a basis for subsequent topology analysis.
[0026] S22: Mark the port number containing the MAC address of the router device in the associated device MAC in the FDB table, and remove all device entries belonging to the marked port number to obtain the remaining port numbers that are more likely to be actually connected to the terminal device; In this embodiment, the port numbers containing the router device MAC address in the associated device MAC are marked as rounter_ports in the FDB table, and because the associated devices under these port numbers will not be the directly connected devices of the router in the current FDB table, all device entries under the marked port numbers are removed, so that the remaining port numbers that are more likely to be actually connected to the terminal devices can be processed in a targeted manner.
[0027] S23: Update the FDB table.
[0028] By calculating the total number of device MAC addresses associated with each port number, a basis for subsequent topology analysis is provided.
[0029] S3: poll and compare the remaining device MAC address entries in the updated FDB table, search one by one in the local network topology database, confirm the actual access router, and update the local network topology database; S31: Based on the local network topology database, obtain the latest network topology data; S32: traverse and poll the remaining device MAC address entries in the updated FDB table, and search and compare them one by one based on the latest network topology data to confirm the actual access router; Among them, based on the latest network topology data, one by one search and comparison is performed to confirm the actual access router, including: S321: When the device MAC address currently being searched does not exist in the latest network topology data, the total number of device MAC addresses mac_cnt associated with the device MAC address and its associated port number is inserted into the network topology data, and the access router of the device is marked as the actual access router sending the FDB table; S322: When the MAC address of the device currently being searched already exists in the latest network topology data, but the recorded access router is inconsistent with the router that sent the FDB table, and the total number of device MAC addresses mac_cnt associated with the device-associated port number in the updated FDB table does not exceed the total number of device MAC addresses orig_cnt associated with the device-associated port number in the network topology data, the router device MAC address in the FDB table will overwrite the original access router device MAC address recorded in the network topology data as the final actual access router.
[0030] S33: re-write the confirmed actual access router into the network topology data to update the local networking topology database.
[0031] Example 2 Based on the same technical concept, Figure 2 As shown, this embodiment also provides a method for searching an actual access router based on a multi-router network, which specifically includes the following steps: T1: monitors the device change events in the FDB table and determines the role of the monitored router; T11: When the router that monitors the device change event in the FDB table is the main router, the MAC address of the current main router and all the data collected in the FDB table are recorded, and T2 is executed; T12: When the router that monitors the device change event in the FDB table is a slave router, the MAC address of the current slave router device and all the data collected in the FDB table are synchronously transmitted to the master router, and T2 is executed; T2: Parse the obtained FDB table, mark and remove the device entry containing the port number of the router device MAC address in the FDB table, and update the FDB table; T21: Based on the obtained FDB table, the main router parses its data and calculates the total number of device MAC addresses associated with each port number, which is recorded as mac_cnt; T22: Mark the port number containing the router device MAC address in the associated device MAC as rounter_ports in the FDB table, and remove all device entries belonging to the marked port number to obtain the remaining port numbers that are more likely to be actually connected to the terminal device; T23: Update FDB table; T3: Poll the remaining device MAC address entries in the updated FDB table, search them one by one in the local network topology database, confirm the actual access router, and update the local network topology database; T31: Obtain the latest network topology data based on the local network topology database; T32: Traverse and poll the remaining device MAC address entries in the updated FDB table, and search and compare them one by one based on the latest network topology data to confirm the actual access router; T321: When the device MAC address currently being searched does not exist in the latest network topology data, the total number of device MAC addresses mac_cnt associated with the device MAC address and its associated port number is inserted into the network topology data, and the access router of the device is marked as the actual access router sending the FDB table; T322: When the MAC address of the device currently being searched already exists in the latest network topology data, but the recorded access router is inconsistent with the router that sent the FDB table, the total number of device MAC addresses orig_cnt associated with the device's associated port number in the network topology data and the total number of device MAC addresses mac_cnt associated with the device's associated port number in the updated FDB table are obtained to verify the actual access device of the device; T3221: When mac_cnt≤orig_cnt, the MAC address of the router device sending this FDB table will be overwritten with the original router device MAC address recorded in the network topology data as the final actual access router; T3222: When mac_cnt>orig_cnt, the MAC address of the original router device recorded in the network topology data is used as the final actual access router; T33: Rewrite the actual access router into the network topology data and update the local networking topology database.
[0032] Example 3 Based on the same technical concept, Figure 3 As shown, this embodiment also provides an actual access router search system based on multi-router networking, including an information acquisition module, an FDB table parsing and updating module, and an access router confirmation module.
[0033] Specifically, the information acquisition module monitors the device change events in the FDB table and summarizes the information of the monitored router and the FDB table to the main router; Specifically, the FDB table parsing and updating module parses the obtained FDB table, marks and removes the port entries containing the MAC address of the router device in the FDB table, and updates the FDB table; Specifically, the access router confirmation module polls and compares the remaining router device MAC address entries in the updated FDB table, searches one by one in the local networking topology database, confirms the actual access router, and updates the local networking topology database.
[0034] Example 4 Based on the same technical concept, the embodiment of the present application also provides a computer device, including a memory 1 and a processor 2, such as Figure 4 As shown, the memory 1 stores a computer program, and the processor 2 implements any of the above-mentioned methods when executing the computer program.
[0035] Among them, the memory 1 includes at least one type of readable storage medium, and the readable storage medium includes flash memory, hard disk, multimedia card, card-type memory (for example, SD or DX memory, etc.), magnetic memory, disk, optical disk, etc. In some embodiments, the memory 1 can be an internal storage unit of the actual access router search system based on multi-router networking, such as a hard disk. In other embodiments, the memory 1 can also be an external storage device of the actual access router search system based on multi-router networking, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. Further, the memory 1 can also include both an internal storage unit and an external storage device of the actual access router search system based on multi-router networking. The memory 1 can not only be used to store application software and various types of data installed in the actual access router search system based on multi-router networking, such as the code of the actual access router search system program based on multi-router networking, but also can be used to temporarily store data that has been output or is to be output.
[0036] In some embodiments, the processor 2 can be a central processing unit (CPU), a controller, a microcontroller, a microprocessor or other data processing chip, which is used to run the program code stored in the memory 1 or process data, such as executing the actual access router search system program based on multi-router networking.
[0037] The disclosed embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, and the computer program is executed by a processor to perform the steps of the method described in the above method embodiment. The storage medium can be a volatile or non-volatile computer-readable storage medium.
[0038] The computer program product of the application page content refresh method provided in the disclosed embodiment of the present invention includes a computer-readable storage medium storing program code, and the instructions included in the program code can be used to execute the steps of the method described in the above method embodiment. For details, please refer to the above method embodiment, which will not be repeated here.
[0039] The disclosed embodiment of the present invention further provides a computer program, which implements any one of the methods of the aforementioned embodiments when executed by a processor. The computer program product can be implemented in hardware, software, or a combination thereof. In an optional embodiment, the computer program product is specifically embodied as a computer storage medium, and in another optional embodiment, the computer program product is specifically embodied as a software product, such as a software development kit (SDK), etc.
[0040] It can be understood that the same or similar parts of the above embodiments can be referenced to each other, and the contents not described in detail in some embodiments can refer to the same or similar contents in other embodiments.
[0041] It should be noted that, in the description of the present invention, the terms "first", "second", etc. are only used for descriptive purposes and cannot be understood as indicating or implying relative importance. In addition, in the description of the present invention, unless otherwise specified, the meaning of "plurality" refers to at least two.
[0042] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, segment or portion of code that includes one or more executable instructions for implementing the steps of a specific logical function or process, and the scope of the preferred embodiments of the present invention includes alternative implementations in which functions may not be performed in the order shown or discussed, including performing functions in a substantially simultaneous manner or in the reverse order depending on the functions involved, which should be understood by those skilled in the art to which the embodiments of the present invention belong.
[0043] It should be understood that the various parts of the present invention can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, multiple steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.
[0044] A person skilled in the art may understand that all or part of the steps in the method for implementing the above-mentioned embodiment may be completed by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, which, when executed, includes one or a combination of the steps of the method embodiment.
[0045] In addition, each functional unit in each embodiment of the present invention may be integrated into a processing module, or each unit may exist physically separately, or two or more units may be integrated into one module. The above-mentioned integrated module may be implemented in the form of hardware or in the form of a software functional module. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it may also be stored in a computer-readable storage medium.
[0046] The storage medium mentioned above can be a read-only memory, a magnetic disk or an optical disk, etc.
[0047] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "examples", "specific examples", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.
[0048] Although the embodiments of the present invention have been shown and described above, it is to be understood that the above embodiments are exemplary and are not to be construed as limitations of the present invention. A person skilled in the art may change, modify, replace and vary the above embodiments within the scope of the present invention.
Claims
1. A method for searching an actual access router based on a multi-router network, characterized in that: include: Monitor the device change events in the FDB table and summarize the monitored routers and FDB table information to the main router; Parse the obtained FDB table, mark and remove the device entry containing the port number of the router device MAC address in the FDB table, and update the FDB table; Poll and compare the remaining device MAC address entries in the updated FDB table, search one by one in the local network topology database, confirm the actual access router, and update the local network topology database.
2. The method for searching an actual access router based on a multi-router network according to claim 1, characterized in that: The monitoring of the device change event in the FDB table and the aggregation of the monitored router and the FDB table information to the main router include: When the router that monitors the device change event in the FDB table is the main router, the MAC address of the current main router and all the data collected in the FDB table are recorded; When the router that monitors the device change event in the FDB table is a slave router, the current slave router device MAC address and all the data collected in the FDB table are synchronously transmitted to the master router.
3. The method for searching an actual access router based on a multi-router network according to claim 1, characterized in that: The method of parsing the obtained FDB table, marking and removing the device entry containing the port number of the router device MAC address in the FDB table, and updating the FDB table includes: Based on the obtained FDB table, the main router parses its data; Mark the port number of the associated device MAC that contains the router device MAC address in the FDB table, and remove all device entries belonging to the marked port number to obtain the remaining port number of the actual connected terminal device; Update the FDB table.
4. The method for searching an actual access router based on a multi-router network according to claim 3, characterized in that: After parsing the acquired data in the FDB table, the main router further calculates the total number of device MAC addresses associated with each port number, and records it as mac_cnt.
5. The method for searching an actual access router based on a multi-router network according to claim 4, characterized in that: The polling and comparison of the remaining device MAC address entries in the updated FDB table, searching one by one in the local network topology database, confirming the actual access router, and updating the local network topology database include: Based on the local network topology database, obtain the latest network topology data; Traverse and poll the remaining device MAC address entries in the updated FDB table, and search and compare them one by one based on the latest network topology data to confirm the actual access router; The confirmed actual access router is rewritten into the network topology data to update the local networking topology database.
6. The method for searching an actual access router based on a multi-router network according to claim 5, characterized in that: The step of searching and comparing one by one based on the latest network topology data to confirm the actual access router includes: When the MAC address of the device currently being searched does not exist in the latest network topology data, the total number of device MAC addresses associated with the MAC address of the device and its associated port number is inserted into the network topology data, and the access router of the device is marked as the actual access router of the sent FDB table; When the MAC address of the device currently being searched already exists in the latest network topology data, but the recorded access router is inconsistent with the router that sent the FDB table, and the total number of device MAC addresses associated with the device-associated port number in the updated FDB table does not exceed the total number of device MAC addresses associated with the device-associated port number in the network topology data, the device MAC address of the router that sends this FDB table will overwrite the original access router device MAC address recorded in the network topology data as the final actual access router.
7. A system for the actual access router search method based on multi-router networking as claimed in claim 1, characterized in that: include: An information acquisition module monitors the device change events in the FDB table and aggregates the monitored router and FDB table information to the main router; An FDB table parsing and updating module, which parses the obtained FDB table, marks and removes the port entries containing the MAC address of the router device in the FDB table, and updates the FDB table; The access router confirmation module polls and compares the remaining router device MAC address entries in the updated FDB table, searches one by one in the local network topology database, confirms the actual access router, and updates the local network topology database.
8. An electronic device, characterized in that: The electronic device comprises a memory and a processor, the memory stores a computer program, and the processor implements the method according to any one of claims 1 to 6 when executing the computer program.
9. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.