Vlan transparent path construction and verification method, device and equipment for enterprise and medium
By acquiring and normalizing initial network resource data in the enterprise network, constructing Layer 3 node paths hop-by-hop and supplementing Layer 2 nodes, the problem of automatic construction and verification of VLAN service forwarding paths in the enterprise network is solved, improving the efficiency of service activation and acceptance and the accuracy of link auditing.
Patent Information
- Application Number
- CN202611363215.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-03
- Publication Date
- 2026-11-27
AI Technical Summary
In enterprise network environments, existing technologies struggle to automatically construct VLAN service forwarding paths and achieve VLAN pass-through, especially in complex networks where they cannot accurately identify Layer 2 switching nodes between Layer 3 nodes and identify key pass-through ports, making manual verification difficult and prone to errors.
By acquiring the enterprise's initial network resource data, normalizing it, constructing the three-layer network node path hop by hop, supplementing the two-layer network nodes, determining the port connection relationship, and judging the pass-through status based on the intersection of the port sets, the verification result is finally generated.
It enables the automatic construction of VLAN service forwarding paths in enterprise network environments, improving the efficiency of service activation and acceptance, reducing human error and omission, and enhancing the standardization of link audit results.
Smart Images

Figure CN123185016A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of network configuration technology, and in particular to a method, apparatus, device, and medium for constructing and verifying VLAN pass-through paths for enterprises. Background Technology
[0002] With the development of edge computing, cloud PCs, and enterprise leased line access services, enterprise businesses are gradually migrating to edge data centers and distributed computing nodes. Enterprise-side networks typically need to establish Layer 2 network connectivity with edge computing access devices through multiple switching devices, aggregation devices, and Layer 2 switching nodes within the data center, and require that designated service VLANs (Virtual Local Area Networks) can maintain continuous transparent transmission within the service link range.
[0003] In existing technologies, overlay solutions such as VXLAN (Virtual eXtensible Local Area Network) rely on network device capabilities and architecture adjustments, resulting in high deployment costs and long cycles, making them unsuitable for existing traditional data center environments. Traditional manual methods require maintenance personnel to log into devices to view routing tables, interface status, VLAN configurations, and link information. This only confirms network reachability between the source and destination, failing to automatically construct complete service forwarding paths. For complex networks involving both Layer 3 routing and Layer 2 switching, routing information alone cannot identify Layer 2 switching nodes between Layer 3 nodes, and link-layer adjacency information alone cannot form directed path relationships, leading to inaccurate determination of the actual devices and ports traversed by service VLANs. Furthermore, link-layer adjacency information in actual networks may be incomplete, with cross-carrier transmission devices and invisible links. Traditional LLDP-based methods cannot fully construct end-to-end link paths, making it difficult to accurately identify critical transparent ports. Additionally, differences exist between different vendors' devices in VLAN configuration models, interface naming, and link aggregation representations, making manual verification difficult to unify and prone to errors in transparent status judgment.
[0004] In summary, how to automatically construct VLAN service forwarding paths and implement VLAN pass-through verification in an enterprise network environment is a technical problem that urgently needs to be solved. Summary of the Invention
[0005] In view of this, the purpose of this invention is to provide a method, apparatus, device, and medium for constructing and verifying VLAN pass-through paths in an enterprise network environment, which can automatically construct VLAN service forwarding paths and realize VLAN pass-through verification. The specific solution is as follows: Firstly, this application provides a method for constructing and verifying VLAN pass-through paths for enterprises, including: Acquire the initial network resource data of the enterprise and normalize the initial network resource data to obtain the target network resource data; Starting from the enterprise access switching device and ending at the edge computing access device, an initial transparent path corresponding to the target VLAN is constructed hop-by-hop based on the target network resource data; the initial transparent path consists of three layers of network nodes. For adjacent Layer 3 network nodes that do not have a direct link layer adjacency relationship in the initial transparent transmission path, search for Layer 2 network nodes between the adjacent Layer 3 network nodes and add the Layer 2 network nodes to the initial transparent transmission path to obtain the target transparent transmission path. The first port set is determined based on the port connection relationship between adjacent nodes in the target pass-through path, and the pass-through status of the target VLAN between adjacent nodes is determined based on the intersection of the second port set that allows the target VLAN to pass through on the adjacent nodes and the first port set. Based on the pass-through status between adjacent nodes in the target pass-through path, a verification result corresponding to the target pass-through path is generated.
[0006] Optionally, the normalization process for the initial network resource data to obtain the target network resource data includes: The address information of each device in the initial network resource data is uniformly mapped to the corresponding management address, and the correspondence between the device name, system name and management address in the initial network resource data is established. The management address is used as a unique identifier, and the target network resource data is determined based on the correspondence.
[0007] Optionally, the step of constructing the initial transparent path corresponding to the target VLAN hop-by-hop based on the target network resource data includes: Taking the enterprise access switching device as the current node, and performing longest prefix matching in the routing table according to the target address corresponding to the target VLAN, the next-hop Layer 3 network node of the current node is determined; The next-hop Layer 3 network node is taken as the new current node, and the process jumps to the step of performing the longest prefix match in the routing table according to the target address corresponding to the target VLAN, until the routing type between the current node and the target address is direct connection, or the current node is the edge computing access device, or there is no next-hop Layer 3 network node. The initial transparent path is constructed according to the enterprise access switching device and each of the next-hop Layer 3 network nodes.
[0008] Optionally, the search for Layer 2 network nodes between adjacent three-layer network nodes includes: The adjacent three-layer network nodes that do not have a direct link-layer adjacency relationship in the initial transparent path are used as search endpoints. A breadth-first search is performed in the adjacency graph based on the link-layer adjacency relationship to determine the shortest reachable path between the adjacent three-layer network nodes. Each intermediate node in the shortest reachable path is used as a node in the second-layer network.
[0009] Optionally, determining the first port set based on the port connection relationship between adjacent nodes in the target transparent transmission path includes: When there is a direct link-layer adjacency relationship between adjacent nodes, the port mapping relationship is extracted based on the link-layer adjacency relationship, and the first port set is determined based on the port mapping relationship. When there is no direct link-layer adjacency between adjacent nodes, the corresponding interface information is searched in the IP address mapping relationship based on the interconnection address of the adjacent nodes, and the physical port is extracted based on the interface information to determine the first port set.
[0010] Optionally, the adjacent nodes include a first node and a second node, wherein the first node is located before the second node in the target transparent transmission path; Accordingly, determining the pass-through status of the target VLAN between adjacent nodes based on the intersection of the second set of ports allowed to pass through the target VLAN on adjacent nodes and the first set of ports includes: If the first port set of the first node and the second port set of the second node intersect, and the first port set of the second node and the second port set of the second node intersect, then the transparent transmission state is determined to be transparent transmission at both ends.
[0011] Optionally, the method for constructing and verifying VLAN pass-through paths for enterprises further includes: When any of the adjacent nodes belongs to the MLAG device group, the MLAG device group is expanded into physical devices; The pass-through status of the target VLAN between adjacent nodes of physical devices with link-layer adjacency within the same MLAG device group is determined to be pass-through at both ends. Accordingly, generating the verification result corresponding to the target transparent path based on the transparent state between adjacent nodes in the target transparent path includes: The pass-through status is deduplicated, and the verification result corresponding to the target pass-through path is generated based on the deduplicated pass-through status; the verification result includes device information, port information and the deduplicated pass-through status in the target pass-through path.
[0012] Secondly, this application provides a VLAN pass-through path construction and verification device for enterprises, including: The normalization processing module is used to obtain the initial network resource data of the enterprise and perform normalization processing on the initial network resource data to obtain the target network resource data. The transparent path construction module is used to construct an initial transparent path corresponding to the target VLAN hop by hop based on the target network resource data, starting from the enterprise access switching device and ending at the edge computing access device; the initial transparent path consists of three layers of network nodes. The network node supplementation module is used to search for the second-level network nodes between adjacent third-level network nodes that do not have a direct link-layer adjacency relationship in the initial transparent transmission path, and supplement the second-level network nodes into the initial transparent transmission path to obtain the target transparent transmission path. The pass-through status determination module is used to determine a first port set based on the port connection relationship between adjacent nodes in the target pass-through path, and to determine the pass-through status of the target VLAN between adjacent nodes based on the intersection of a second port set on adjacent nodes that allows the target VLAN to pass through and the first port set. The verification result generation module is used to generate a verification result corresponding to the target transparent path based on the transparent state between adjacent nodes in the target transparent path.
[0013] Thirdly, this application provides an electronic device, comprising: Memory, used to store computer programs; A processor is used to execute the computer program to implement the aforementioned method for constructing and verifying VLAN pass-through paths for enterprises.
[0014] Fourthly, this application provides a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, it implements the aforementioned method for constructing and verifying VLAN pass-through paths for enterprises.
[0015] In this application, the initial network resource data of the enterprise is first obtained and normalized to obtain the target network resource data. Then, starting from the enterprise access switching device and ending at the edge computing access device, an initial transparent path corresponding to the target VLAN is constructed hop-by-hop based on the target network resource data. The initial transparent path consists of three-layer network nodes. For adjacent three-layer network nodes in the initial transparent path that do not have a direct link-layer adjacency relationship, two-layer network nodes between the adjacent three-layer network nodes are searched and added to the initial transparent path to obtain the target transparent path. Next, a first port set is determined based on the port connection relationship between adjacent nodes in the target transparent path, and the transparent status of the target VLAN between adjacent nodes is determined based on the intersection of the second port set that allows the target VLAN to pass through on the adjacent nodes and the first port set. Finally, based on the transparent status between adjacent nodes in the target transparent path, a verification result corresponding to the target transparent path is generated. As can be seen from the above, this application first normalizes the initial network resource data of the enterprise to form target network resource data. Then, starting from the enterprise access switching equipment and ending at the edge computing access equipment, an initial transparent transmission path composed of three-layer network nodes is constructed hop-by-hop based on routing information. When there are adjacent three-layer nodes in the initial path that lack direct link-layer adjacency relationships, the two-layer network nodes are added to the path by searching for intermediate nodes in the link-layer adjacency topology to form a complete target transparent transmission path. Afterward, the first port set is determined based on the port connection relationship between adjacent nodes in the path, and hop-by-hop intersection is determined with the port set on each node that allows the target VLAN to pass through, thereby confirming the transparent transmission status of the target VLAN on each link segment. Finally, a structured verification result is generated based on the transparent transmission status of each link segment. In this way, this application can automatically construct VLAN service forwarding paths and realize VLAN transparent transmission verification in the enterprise's network environment, significantly improving the efficiency of service activation and acceptance, reducing human error, and enhancing the standardization of link audit results. Attached Figure Description
[0016] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.
[0017] Figure 1 This application provides a flowchart of a method for constructing and verifying VLAN pass-through paths for enterprises; Figure 2This application provides a specific flowchart for constructing a target transparent transmission path; Figure 3 This application provides a specific flowchart for adding nodes to a Layer 2 network. Figure 4 A specific port alignment diagram is provided for this application; Figure 5 A specific port derivation diagram is provided for this application; Figure 6 This application provides a schematic diagram of member unpacking and peer-link recognition in a specific MLAG scenario. Figure 7 This application provides a schematic diagram of a specific verification result output structure; Figure 8 This application provides a flowchart of a specific method for constructing and verifying VLAN pass-through paths for enterprises; Figure 9 This application provides a schematic diagram of a VLAN pass-through path construction and verification device for enterprises. Figure 10 This application provides a structural diagram of an electronic device. Detailed Implementation
[0018] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0019] With the development of edge computing, cloud PCs, and enterprise leased line access services, enterprise businesses are gradually migrating to edge data centers and distributed computing nodes. Enterprise-side networks typically need to establish Layer 2 network connectivity with edge computing access devices through multiple switching devices, aggregation devices, and Layer 2 switching nodes within the data center, and require that designated service VLANs maintain continuous transparent transmission within the service link range.
[0020] In existing technologies, overlay solutions such as VXLAN rely on network device capabilities and architecture adjustments, resulting in high deployment costs and long cycles, making them unsuitable for existing traditional data center environments. Traditional manual methods require maintenance personnel to log into devices to view routing tables, interface status, VLAN configurations, and link information, only confirming network reachability between the source and destination ends, and failing to automatically construct complete service forwarding paths. For complex networks involving both Layer 3 routing and Layer 2 switching, routing information alone cannot identify Layer 2 switching nodes between Layer 3 nodes, and link-layer adjacency information alone cannot form directed path relationships, leading to inaccurate determination of the actual devices and ports traversed by service VLANs. Furthermore, link-layer adjacency information in actual networks may be incomplete, with cross-carrier transmission devices and invisible links, making it difficult to construct complete end-to-end link paths using traditional LLDP-based methods, and critical transparent ports are difficult to identify accurately. Additionally, differences exist between different vendors' devices in VLAN configuration models, interface naming, and link aggregation representation methods, making manual verification difficult to unify and prone to errors in transparent status judgment. Therefore, this application provides a VLAN pass-through path construction and verification scheme for enterprises, which can automatically construct VLAN service forwarding paths and realize VLAN pass-through verification in the enterprise network environment.
[0021] See Figure 1 As shown in the figure, this invention discloses a method for constructing and verifying VLAN pass-through paths for enterprises, which may include: Step S11: Obtain the initial network resource data of the enterprise and normalize the initial network resource data to obtain the target network resource data.
[0022] In this embodiment, the system first receives input parameters from the service side, including the edge data center name (room_name), enterprise information (client_info), enterprise access node switch information (switch_info), target edge computing device list (cloud_info), and edge data center switch list information (device_list). The client information may include the target VLAN identifier to be verified (client_vlan_id).
[0023] Subsequently, the following pre-collected network resource data is read from the resource pool: FullPath information is used to provide hop-by-hop path information from the source device to the target address; RouterInfo, the routing and configuration information, is used to provide LLDP adjacency information, VLAN mapping, aggregation port members, and MLAG (Multi-Chassis Link Aggregation Group) information. IP address mapping information (IPAddressInfo) is used to provide the mapping relationship between service addresses, interconnection addresses, and device interfaces; The device basic information CmdbRow (Configuration Management Database Row) is used to provide device name, device type, and management address information.
[0024] After the resources are loaded, the cache structure is initialized, including routing cache, device cache, link layer LLDP (Link Layer Discovery Protocol) adjacency information cache, VLAN port cache, and MLAG member cache, to reduce the overhead of repeated queries in hop-by-hop auditing. Network resource data can be generated and stored in the database by periodic collection tasks or on-demand update interfaces.
[0025] Furthermore, the initial network resource data is normalized to obtain the target network resource data. The specific process may include: uniformly mapping the address information of each device in the initial network resource data to the corresponding management address, and establishing a correspondence between the device name, system name and management address in the initial network resource data; using the management address as a unique identifier, and determining the target network resource data based on the correspondence.
[0026] Specifically, in a real network, the same device may simultaneously have a service IP (Internet Protocol), an SVI (Switch Virtual Interface) address, an interconnect address, and a management IP. To avoid ambiguity in path association and port determination, address normalization is required. For any input device address, it is first determined whether the address already corresponds to a management IP; if not, the management IP of the device to which it belongs is looked up through the mapping relationship in IPAddressInfo. At the same time, a mapping relationship between device name, system name, and management IP is established so that when parsing link-layer adjacency information, the embedded IP is extracted first from remote_system; if it cannot be extracted, it is converted to a management IP through device name / system name mapping. In this way, all subsequent path construction, adjacency determination, port deduction, and result display are unified and processed according to the management address.
[0027] Step S12: Starting from the enterprise access switching device and ending at the edge computing access device, construct the initial transparent path corresponding to the target VLAN hop by hop based on the target network resource data; the initial transparent path consists of three layers of network nodes.
[0028] In this embodiment, starting from the enterprise access switching device and ending at the edge computing access device, an initial transparent path corresponding to the target VLAN is constructed hop-by-hop based on the target network resource data. The specific process may include: taking the enterprise access switching device as the current node and performing longest prefix matching in the routing table according to the target address corresponding to the target VLAN to determine the next-hop Layer 3 network node of the current node; taking the next-hop Layer 3 network node as the new current node and jumping to the step of performing longest prefix matching in the routing table according to the target address corresponding to the target VLAN, until the routing type between the current node and the target address is direct connection, or the current node is the edge computing access device, or there is no next-hop Layer 3 network node, and constructing the initial transparent path according to the enterprise access switching device and each of the next-hop Layer 3 network nodes.
[0029] Specifically, using the enterprise access switch as the source device and the edge computing access device as the target device, path construction is performed sequentially. For the current source and target devices, longest prefix matching is performed in FullPath based on the target address to determine the best next-hop information for the current source device. The next-hop information includes at least the following fields: next-hop address, target device address, interface name, device name, and whether it is a direct connection. After obtaining the next hop of the current hop node, the current source address is advanced to the next-hop device address, and the next round of longest prefix matching continues until: the target device has been reached, or the current hop node has been determined to be a direct connection, or no more valid next hops have been found.
[0030] This yields the initial transparent path from the source device to the target device, which is the L3 main path composed of three layer network nodes. During the construction of the L3 main path, the layer 3 path information of each hop is standardized into an L3 type path record, and path evidence such as hop number, interface name, next hop address, and target device information is saved. Port alignment and link layer adjacency evidence are further extracted and supplemented in the subsequent L2 completion and port identification stages, serving as the basis for subsequent L2 completion and VLAN auditing.
[0031] Step S13: For adjacent Layer 3 network nodes that do not have a direct link layer adjacency relationship in the initial transparent transmission path, search for Layer 2 network nodes between the adjacent Layer 3 network nodes, and add the Layer 2 network nodes to the initial transparent transmission path to obtain the target transparent transmission path.
[0032] In this embodiment, it is determined whether the current L3 node and the next-hop L3 node are direct link layer LLDP adjacencies.
[0033] If there is a direct LLDP link layer adjacency between the two, the hop node is considered to have a direct physical association and can directly proceed to subsequent port identification and VLAN verification.
[0034] If there is no direct LLDP link-layer adjacency between the two nodes, it indicates that there may be one or more intermediate Layer 2 switching nodes between the current L3 node and the next-hop L3 node. In this case, a BFS search is performed on the graph structure formed by the LLDP link-layer adjacency relationships in RouterInfo, using the management IPs of these two devices as the starting and ending points, to find the shortest reachable path between them.
[0035] If an intermediate device sequence is found, these intermediate devices are added one by one as L2 type path nodes and inserted into the L3 main path in path order to form a complete L3+L2 directed service path, i.e., the target transparent transmission path. Each added L2 node contains device name, system name, associated port, physical port, and available link layer LLDP adjacency information. For the construction process of the target transparent transmission path, please refer to [link to documentation]. Figure 2 As shown.
[0036] It should be noted that, see Figure 3 As shown, the specific process for searching for Layer 2 network nodes between adjacent Layer 3 network nodes may include: taking adjacent Layer 3 network nodes that do not have a direct link-layer adjacency relationship in the initial transparent path as search endpoints, performing a breadth-first search in the adjacency graph based on the link-layer adjacency relationship to determine the shortest reachable path between the adjacent Layer 3 network nodes; and taking each intermediate node in the shortest reachable path as the Layer 2 network node.
[0037] Step S14: Determine the first port set based on the port connection relationship between adjacent nodes in the target transparent path, and determine the transparent status of the target VLAN between adjacent nodes based on the intersection of the second port set that allows the target VLAN to pass through on the adjacent nodes and the first port set.
[0038] It should be noted that, considering the different naming methods for aggregation ports, interfaces and VLANs used by different manufacturers, a unified normalization process is performed before performing pass-through auditing. The normalization objects include, but are not limited to: VLAN, VLANif, VLAN-interface, Aggregation (Aggregation interface), Eth-Trunk (Ethernet link aggregation interface), Port-Channel (link aggregation interface), and port naming formats of different manufacturers.
[0039] For example, extract a unified and standardized representation from agg / Trunk / Eth-Trunk forms in the aggregation port name; extract VLAN IDs from interface names such as Vlan / Vlanif / Vlan-interface; and perform unified matching on VLAN keys with different capitalization or different zero-padding methods in vlans_map_port.
[0040] Through normalization, consistent logic can be used to extract VLAN ports and expand aggregated ports in multi-vendor mixed networks, reducing misjudgments caused by naming differences.
[0041] In this embodiment, the first port set is determined based on the port connection relationship between adjacent nodes in the target transparent transmission path. The specific process may include: when there is a direct link-layer adjacency relationship between adjacent nodes, extracting the port mapping relationship according to the link-layer adjacency relationship, and determining the first port set according to the port mapping relationship; when there is no direct link-layer adjacency relationship between adjacent nodes, searching for the corresponding interface information in the IP address mapping relationship according to the interconnection address of the adjacent nodes, and extracting the physical port according to the interface information to determine the first port set.
[0042] For details, see Figure 4 As shown, the link-layer LLDP adjacency port mapping between adjacent device pairs is obtained. If the source device's local_port has a link-layer LLDP adjacency record pointing to the peer device's remote_port, then the local_port to remote_port is extracted as the forward port mapping; if no valid result is obtained in this direction, the link-layer LLDP adjacency mapping from the peer to the source is extracted in the reverse direction and converted into the port mapping under the current direction. The local_port and remote_port obtained by port alignment are used as the link_ports set of interconnection ports between adjacent devices, i.e., the first port set.
[0043] It should be noted that, see Figure 5 As shown, if no valid port alignment result is obtained, the port inference process is initiated to obtain the interconnection port set. In non-link-layer LLDP adjacency relay scenarios, although there is a service connection between two switches, the connection is forwarded through carrier transmission equipment, transparent relay networks, or other invisible nodes, making it impossible for the two devices to directly obtain the LLDP link-layer adjacency relationship. That is, there is no direct link-layer adjacency relationship between adjacent nodes. For this scenario, when the link-layer LLDP adjacency information is insufficient, port-level judgment is not abandoned directly. Instead, port inference is performed by combining L3 interconnection addresses and interface information to determine the first port set.
[0044] Specifically, based on the next-hop address of the current node or the peer's interconnect address, the corresponding interface record is searched in IPAddressInfo; the VLAN (interconnect VLAN) corresponding to the VLAN interface is used to determine the interconnect trunk port set; the target VLAN is used for pass-through status determination. If the interface is an interconnect VLAN interface, the tag port set of the target VLAN is further extracted; if the interface itself is an aggregation port or a trunk port, its physical member ports are further expanded. Through the above method, even if the link layer LLDP adjacency alignment relationship cannot be directly obtained for the current link segment, the key physical port information of the source or peer end can still be supplemented.
[0045] Then, the set of tag ports corresponding to the target VLAN is extracted from the RouterInfo of both ends. In the switch interconnection transparent transmission scenario, the transparent transmission verification is mainly based on the set of tag ports of the target VLAN. If the port is an aggregated port, it is expanded into a set of physical ports based on the membership relationship of the aggregated port. The intersection operation is performed between the physical port actually carrying the link and the physical port of the target VLAN tag to determine whether the source end and the peer end have the transparent transmission capability of the target VLAN.
[0046] Furthermore, the adjacent nodes include a first node (source node) and a second node (peer node), with the first node located before the second node in the target pass-through path. Correspondingly, the pass-through status of the target VLAN between adjacent nodes is determined based on the intersection of the second port set and the first port set that the target VLAN is allowed to pass through on the adjacent nodes. The specific process may include: if the first port set of the first node and the second port set have an intersection, and the first port set of the second node and the second port set have an intersection, then the pass-through status is determined to be pass-through at both ends.
[0047] Understandably, the following verification rules are also supported: if there is an intersection only between the peer and the source, the pass-through status is determined to be peer-only pass-through; if there is an intersection only between the source and the source, the pass-through status is determined to be source-only pass-through; if there is no intersection between the two ends, the pass-through status is determined to be no pass-through at either end. Specifically, the following verification rules are adopted in this embodiment: (1) If the physical port of the source link and the VLAN Tag port of the source end intersect, and the physical port of the peer link and the VLAN Tag port of the peer end intersect, then vlan_check=3, and neither end is transparently transmitted. (2) If there is only an intersection between the two ends, then vlan_check=1 and only the other end passes through; (3) If there is an intersection only at the source end, then vlan_check=2, and only the source end passes through; (4) If there is no intersection between the two ends, then vlan_check=0, and neither end is transparent.
[0048] Meanwhile, the port alignment results are saved as source_port and direct_port respectively, so that the final output can indicate which side of the port the exception occurred on.
[0049] It should be further explained that, see [link / reference] Figure 6 As shown, in a network environment with MLAG, when any node in the adjacent nodes belongs to the MLAG device group, the MLAG device group is expanded into physical devices; the pass-through status of the target VLAN between adjacent nodes corresponding to physical devices with link layer adjacency within the same MLAG device group is determined to be pass-through at both ends.
[0050] Specifically, for network environments with MLAG, the virtualization status field (virtual_status) and virtual group identifier field (virtual_group) of the device are read first. If a device is in a virtual group state, the device is expanded to include all member management IPs of its virtual group for subsequent link matching and pass-through judgment.
[0051] After expansion, if LLDP link-layer adjacency exists between members of the same group, it is identified as a strict peer-link. For a strict peer-link, a link record is automatically added, and its pass-through status is marked as vlan_check=3, indicating that this type of heartbeat interconnection link is considered pass-through according to engineering rules. The identification conditions for a strict peer-link include at least: consistent virtual_group and existence of LLDP adjacency evidence. During the result convergence phase, undirected deduplication is performed on the peer-link results under the same virtual_group, retaining only one representative link record to avoid duplication or inconsistent direction in the external output.
[0052] Furthermore, in edge computing access scenarios, the VLAN port information collected by some computing access switches may be incomplete. When the target VLAN tag port set data is missing, the identifiable uplink interconnection port set is regarded as an equivalent substitute for the target VLAN transparent port set to reduce false alarms.
[0053] For this type of device, its role is first identified based on device type, device name, or name. When the target device is identified as a cloud host switch or computing power access device, and its LLDP-adjacent uplink physical port is identifiable but the target VLAN's tag port set has not been extracted, the uplink LLDP-adjacent physical port is considered to have the default pass-through capability for the target VLAN. This rule can reduce false alarms and improve the consistency between audit results and actual engineering experience when resource collection is incomplete.
[0054] Step S15: Based on the pass-through status between adjacent nodes in the target pass-through path, generate the verification result corresponding to the target pass-through path.
[0055] In this embodiment, a verification result corresponding to the target transparent transmission path is generated based on the transparent transmission status between adjacent nodes in the target transparent transmission path. The specific process may include: performing deduplication processing on the transparent transmission status, and generating the verification result corresponding to the target transparent transmission path based on the deduplicated transparent transmission status; the verification result includes device information, port information and the deduplicated transparent transmission status in the target transparent transmission path.
[0056] For details, see Figure 7 As shown, after completing the link construction and VLAN verification for all source devices to target devices, a unified convergence process is performed on the results. First, link records are deduplicated based on factors such as node number (hop), link type (hop_type), source device (source_dev), peer device (direct_dev), pass-through status (vlan_check), and ports at both ends (source_port, direct_port). For MLAG peer-links, further deduplication is performed according to virtual group categorization; records that differ only in link type (L3, L2) but have identical device pairs, port sets, and pass-through status undergo secondary deduplication, retaining only one L3 hop link record. Then, a stable sorting process is performed by node number, link type, source device, and peer device for front-end display and manual review.
[0057] Ultimately, two types of results are output: `link_infos`, representing the link details in the business path, including at least the hop node, hop node type, source device, peer device, source port, peer port, and pass-through status; and `device_infos`, representing the list of devices involved in this audit, including at least the device name, device management IP, and device type. `link_infos` can be directly used for business link display, automatic auditing, and anomaly location, while `device_infos` can be used for device side-view presentation, audit scope identification, and subsequent extended processing.
[0058] It should be noted that upon receiving an update command, the network resource update interface is first invoked to refresh path resources, device configuration resources, LLDP adjacency resources, and VLAN mapping resources. After the resource update is completed, the aforementioned path construction and VLAN auditing process is re-executed. This mode is suitable for scenarios where network configuration has just been changed and it is necessary to re-verify whether the enterprise VLAN has been correctly transmitted to the target edge computing node.
[0059] In one specific implementation, the enterprise's VLAN pass-through path construction and verification process can be found in [reference needed]. Figure 8 As shown, it can specifically include: First, input the audit parameters and load the resource model and path baseline, while parsing the target VLAN and completing the address normalization process; Next, each business source / target node pair is traversed, and the L3 main path is constructed hop by hop based on FullPath. It is then determined whether there is an LLDP adjacency relationship between adjacent L3 nodes. If there is, the LLDP port alignment relationship is extracted. If not, L2 topology completion or port reasoning is performed to obtain the set of interconnected ports between adjacent devices. Then, extract the set of Tag ports corresponding to the target VLAN, and combine it with the set of interconnected ports to perform hop-by-hop VLAN pass-through determination; Finally, MLAG link supplementation and deduplication, multi-target common link merging, result sorting, deduplication and output are performed on the judgment results to obtain the final verification result.
[0060] It should be noted that this embodiment transforms the traditional enterprise VLAN Layer 2 pass-through inspection process, which relies on manual login and item-by-item verification, into an automated identification and verification process based on service path topology, thereby improving service activation efficiency and configuration verification accuracy. It can also integrate L3 routing paths and L2 link topology information to construct a complete L3+L2 directed service path, improving the visualization and interpretability of service links. Simultaneously, it enables layer-by-layer location from service paths and device nodes to key physical ports, improving the efficiency of locating VLAN pass-through anomalies, configuration errors, and link problems. Furthermore, this embodiment can adapt to complex network environments such as multi-level Layer 2 switching nodes, aggregated links, MLAG virtualization devices, and intermediate transmission networks, improving the completeness of verification under complex topologies. Even in the absence of direct link layer adjacency information, key link port information can still be derived based on address relationships, interface relationships, and VLAN association relationships, breaking through the limitations of traditional link discovery that relies solely on LLDP. By normalizing configurations from multiple vendors and implementing rule compensation mechanisms, unified parsing and verification can be achieved across different equipment vendors and network scenarios, providing standardized basic data for subsequent automated activation, configuration completion, self-healing repair, and fault diagnosis.
[0061] As can be seen from the above, this embodiment first normalizes the initial network resource data of the enterprise to form target network resource data. Then, starting from the enterprise access switching device and ending at the edge computing access device, an initial transparent path composed of three-layer network nodes is constructed hop-by-hop based on routing information. When there are adjacent three-layer nodes in the initial path that lack direct link-layer adjacency relationships, the two-layer network nodes are added to the path by searching for intermediate nodes in the link-layer adjacency topology to form a complete target transparent path. Afterward, a first port set is determined based on the port connection relationship between adjacent nodes in the path, and a hop-by-hop intersection determination is performed with the port set on each node that allows the target VLAN to pass through, thereby confirming the transparent status of the target VLAN on each link segment. Finally, a structured verification result is generated based on the transparent status of each link segment. In this way, this embodiment can automatically construct VLAN service forwarding paths and realize VLAN transparent verification in the enterprise network environment, significantly improving the efficiency of service activation and acceptance, reducing human error, and enhancing the standardization of link audit results.
[0062] Accordingly, see Figure 9 As shown in the embodiments of this application, a device for constructing and verifying VLAN pass-through paths for enterprises is also provided, which may include: The normalization processing module 11 is used to acquire the initial network resource data of the enterprise and perform normalization processing on the initial network resource data to obtain the target network resource data. The transparent path construction module 12 is used to construct an initial transparent path corresponding to the target VLAN hop by hop based on the target network resource data, starting from the enterprise access switching device and ending at the edge computing power access device; the initial transparent path consists of three layers of network nodes. The network node supplementation module 13 is used to search for the second-level network nodes between adjacent third-level network nodes that do not have a direct link layer adjacency relationship in the initial transparent transmission path, and supplement the second-level network nodes into the initial transparent transmission path to obtain the target transparent transmission path. The pass-through status determination module 14 is used to determine a first port set based on the port connection relationship between adjacent nodes in the target pass-through path, and to determine the pass-through status of the target VLAN between adjacent nodes based on the intersection of the second port set on the adjacent nodes that allows the target VLAN to pass through and the first port set. The verification result generation module 15 is used to generate a verification result corresponding to the target transparent path based on the transparent state between adjacent nodes in the target transparent path.
[0063] In some specific embodiments, the normalization processing module 11 may include: The address mapping unit is used to uniformly map the address information of each device in the initial network resource data to the corresponding management address, and to establish the correspondence between the device name, system name and management address in the initial network resource data; The target network resource data determination unit is used to use the management address as a unique identifier and determine the target network resource data based on the correspondence.
[0064] In some specific embodiments, the transparent path construction module 12 may include: The next-hop determination unit is used to determine the next-hop Layer 3 network node of the current node by taking the enterprise access switching device as the current node and performing the longest prefix match in the routing table according to the target address corresponding to the target VLAN. The initial transparent path construction unit is used to take the next-hop Layer 3 network node as the new current node and jump to the step of performing the longest prefix matching in the routing table according to the target address corresponding to the target VLAN until the routing type between the current node and the target address is direct connection, or the current node is the edge computing access device, or there is no next-hop Layer 3 network node, and constructs the initial transparent path according to the enterprise access switching device and each of the next-hop Layer 3 network nodes.
[0065] In some specific embodiments, the network node supplementation module 13 may include: The path search unit is used to take the adjacent three-layer network nodes that do not have a direct link-layer adjacency relationship in the initial transparent path as search endpoints, and perform a breadth-first search in the adjacency graph based on the link-layer adjacency relationship to determine the shortest reachable path between the adjacent three-layer network nodes. The Layer 2 network node determination unit is used to determine each intermediate node in the shortest reachable path as the Layer 2 network node.
[0066] In some specific embodiments, the transparent transmission status determination module 14 may include: The first port set determination unit is used to extract port mapping relationships based on the link layer adjacency relationship when there is a direct link layer adjacency relationship between adjacent nodes, and determine the first port set based on the port mapping relationship; when there is no direct link layer adjacency relationship between adjacent nodes, it searches for corresponding interface information in the IP address mapping relationship based on the interconnection address of the adjacent nodes, and extracts physical ports based on the interface information to determine the first port set.
[0067] In some specific embodiments, the adjacent nodes include a first node and a second node, wherein the first node is located before the second node in the target transparent transmission path; Correspondingly, the transparent transmission status determination module 14 may include: The pass-through state determination unit is used to determine that the pass-through state is pass-through at both ends if there is an intersection between the first port set of the first node and the second port set, and an intersection between the first port set of the second node and the second port set.
[0068] In some specific embodiments, the VLAN pass-through path construction and verification device for enterprises may further include: The MLAG expansion module is used to expand the MLAG device group into physical devices when any of the adjacent nodes belongs to the MLAG device group; The pass-through status determination module is used to determine the pass-through status of the target VLAN between adjacent nodes of physical devices with link-layer adjacency within the same MLAG device group as pass-through at both ends. Accordingly, the verification result generation module 15 may include: The verification result generation unit is used to perform deduplication processing on the pass-through status and generate the verification result corresponding to the target pass-through path based on the deduplicated pass-through status; the verification result includes device information, port information and the deduplicated pass-through status in the target pass-through path.
[0069] Furthermore, embodiments of this application also disclose an electronic device, Figure 10 This is a structural diagram of an electronic device 20 according to an exemplary embodiment. The content of the diagram should not be construed as limiting the scope of this application. The electronic device 20 may specifically include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. The memory 22 stores a computer program, which is loaded and executed by the processor 21 to implement the relevant steps in the VLAN pass-through path construction and verification method for enterprises disclosed in any of the foregoing embodiments. Furthermore, the electronic device 20 in this embodiment may specifically be a computer.
[0070] In this embodiment, the power supply 23 is used to provide operating voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and external devices, and the communication protocol it follows can be any communication protocol applicable to the technical solution of this application, and is not specifically limited here; the input / output interface 25 is used to acquire external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs, and is not specifically limited here.
[0071] In addition, the memory 22, as a carrier for resource storage, can be a read-only memory, random access memory, disk or optical disk, etc. The resources stored thereon can include operating system 221, computer program 222, etc., and the storage method can be temporary storage or permanent storage.
[0072] The operating system 221 is used to manage and control the various hardware devices on the electronic device 20 and the computer program 222, which may be Windows Server, Netware, Unix, Linux, etc. In addition to including a computer program capable of performing the VLAN pass-through path construction and verification method for an enterprise, which is executed by the electronic device 20 as disclosed in any of the foregoing embodiments, the computer program 222 may further include computer programs capable of performing other specific tasks.
[0073] Furthermore, this application also discloses a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, it implements the aforementioned method for constructing and verifying VLAN transparent transmission paths for enterprises. Specific steps of this method can be found in the corresponding content disclosed in the foregoing embodiments, and will not be repeated here.
[0074] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the apparatus disclosed in the embodiments, since it corresponds to the method disclosed in the embodiments, the description is relatively simple; relevant parts can be referred to in the method section.
[0075] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0076] The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein can be implemented directly by hardware, a software module executed by a processor, or a combination of both. The software module can be located in random access memory (RAM), main memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other form of storage medium known in the art.
[0077] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0078] The technical solutions provided in this application have been described in detail above. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the methods and core ideas of this application. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application.
Claims
1. A method for constructing and verifying VLAN pass-through paths for enterprises, characterized in that, include: Acquire the initial network resource data of the enterprise and normalize the initial network resource data to obtain the target network resource data; Starting from the enterprise access switching device and ending at the edge computing access device, the initial transparent path corresponding to the target VLAN is constructed hop-by-hop based on the target network resource data. The initial transparent transmission path consists of three layers of network nodes; For adjacent Layer 3 network nodes that do not have a direct link layer adjacency relationship in the initial transparent transmission path, search for Layer 2 network nodes between the adjacent Layer 3 network nodes and add the Layer 2 network nodes to the initial transparent transmission path to obtain the target transparent transmission path. The first port set is determined based on the port connection relationship between adjacent nodes in the target pass-through path, and the pass-through status of the target VLAN between adjacent nodes is determined based on the intersection of the second port set that allows the target VLAN to pass through on the adjacent nodes and the first port set. Based on the pass-through status between adjacent nodes in the target pass-through path, a verification result corresponding to the target pass-through path is generated.
2. The method for constructing and verifying VLAN pass-through paths for enterprises according to claim 1, characterized in that, The normalization process for the initial network resource data to obtain the target network resource data includes: The address information of each device in the initial network resource data is uniformly mapped to the corresponding management address, and the correspondence between the device name, system name and management address in the initial network resource data is established. The management address is used as a unique identifier, and the target network resource data is determined based on the correspondence.
3. The method for constructing and verifying VLAN pass-through paths for enterprises according to claim 1, characterized in that, The step of constructing the initial transparent path corresponding to the target VLAN hop-by-hop based on the target network resource data includes: Taking the enterprise access switching device as the current node, and performing longest prefix matching in the routing table according to the target address corresponding to the target VLAN, the next-hop Layer 3 network node of the current node is determined; The next-hop Layer 3 network node is taken as the new current node, and the process jumps to the step of performing the longest prefix match in the routing table according to the target address corresponding to the target VLAN, until the routing type between the current node and the target address is direct connection, or the current node is the edge computing access device, or there is no next-hop Layer 3 network node. The initial transparent path is constructed according to the enterprise access switching device and each of the next-hop Layer 3 network nodes.
4. The method for constructing and verifying VLAN pass-through paths for enterprises according to claim 1, characterized in that, The search for second-layer network nodes between adjacent third-layer network nodes includes: The adjacent three-layer network nodes that do not have a direct link-layer adjacency relationship in the initial transparent path are used as search endpoints. A breadth-first search is performed in the adjacency graph based on the link-layer adjacency relationship to determine the shortest reachable path between the adjacent three-layer network nodes. Each intermediate node in the shortest reachable path is used as a node in the second-layer network.
5. The method for constructing and verifying VLAN pass-through paths for enterprises according to claim 1, characterized in that, The determination of the first port set based on the port connection relationship between adjacent nodes in the target transparent transmission path includes: When there is a direct link-layer adjacency relationship between adjacent nodes, the port mapping relationship is extracted based on the link-layer adjacency relationship, and the first port set is determined based on the port mapping relationship. When there is no direct link-layer adjacency between adjacent nodes, the corresponding interface information is searched in the IP address mapping relationship based on the interconnection address of the adjacent nodes, and the physical port is extracted based on the interface information to determine the first port set.
6. The method for constructing and verifying VLAN pass-through paths for enterprises according to any one of claims 1 to 5, characterized in that, The adjacent nodes include a first node and a second node, wherein the first node is located before the second node in the target transparent transmission path; Accordingly, determining the pass-through status of the target VLAN between adjacent nodes based on the intersection of the second set of ports allowed to pass through the target VLAN on adjacent nodes and the first set of ports includes: If the first port set of the first node and the second port set of the second node intersect, and the first port set of the second node and the second port set of the second node intersect, then the transparent transmission state is determined to be transparent transmission at both ends.
7. The method for constructing and verifying VLAN pass-through paths for enterprises according to claim 6, characterized in that, Also includes: When any of the adjacent nodes belongs to the MLAG device group, the MLAG device group is expanded into physical devices; The pass-through status of the target VLAN between adjacent nodes of physical devices with link-layer adjacency within the same MLAG device group is determined to be pass-through at both ends. Accordingly, generating the verification result corresponding to the target transparent path based on the transparent state between adjacent nodes in the target transparent path includes: The pass-through state is deduplicated, and the verification result corresponding to the target pass-through path is generated based on the deduplicated pass-through state. The verification result includes device information, port information, and the pass-through status after deduplication in the target pass-through path.
8. A device for constructing and verifying VLAN pass-through paths for enterprises, characterized in that, include: The normalization processing module is used to obtain the initial network resource data of the enterprise and perform normalization processing on the initial network resource data to obtain the target network resource data. The transparent path construction module is used to construct the initial transparent path corresponding to the target VLAN hop by hop based on the target network resource data, starting from the enterprise access switching device and ending at the edge computing power access device. The initial transparent transmission path consists of three layers of network nodes; The network node supplementation module is used to search for the second-level network nodes between adjacent third-level network nodes that do not have a direct link-layer adjacency relationship in the initial transparent transmission path, and supplement the second-level network nodes into the initial transparent transmission path to obtain the target transparent transmission path. The pass-through status determination module is used to determine a first port set based on the port connection relationship between adjacent nodes in the target pass-through path, and to determine the pass-through status of the target VLAN between adjacent nodes based on the intersection of a second port set on adjacent nodes that allows the target VLAN to pass through and the first port set. The verification result generation module is used to generate a verification result corresponding to the target transparent path based on the transparent state between adjacent nodes in the target transparent path.
9. An electronic device, characterized in that, The electronic device includes a processor and a memory; wherein the memory is used to store a computer program, which is loaded and executed by the processor to implement the VLAN pass-through path construction and verification method for an enterprise as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, Used to store a computer program, which, when executed by a processor, implements the VLAN pass-through path construction and verification method for an enterprise as described in any one of claims 1 to 7.
