Layer 2 path tracing
By sending and receiving Layer 2 tracking packets in heterogeneous networks, the shortcomings of Layer 2 path tracking in existing technologies are addressed, enabling path tracking across Layer 2 hops and improving the efficiency of network diagnosis and troubleshooting.
Patent Information
- Application Number
- CN202210416901.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Priority Date
- 2022-01-04
- Filing Date
- 2022-04-20
- Publication Date
- 2025-10-28
- Estimated Expiration
- 2042-04-20
AI Technical Summary
Existing technologies lack effective Layer 2 path tracing mechanisms in heterogeneous networks, making it difficult to diagnose problems in Layer 2 networks, such as Layer 2 configuration errors and cabling issues. This is especially true in complex networks, such as those with tunnels and link aggregation, where existing Layer 3 tracing mechanisms cannot effectively track the expansion of the Layer 2 domain.
By sending Layer 2 tracking packets, using the packet type indication in the Layer 2 header to track the packets, and receiving Layer 2 response packets along the path to extract tracking information, including the address and port information of Layer 2 devices, and accumulating forward and reverse path information, path tracking across Layer 2 hops can be achieved.
It enables effective tracking of layer 2 paths in heterogeneous networks, can identify the addresses and ports of multiple layer 2 devices, improves the efficiency of troubleshooting and debugging processes, and avoids dependence on layer 3 solutions.
Smart Images

Figure CN116436725B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to communication networks. More specifically, this disclosure relates to methods and systems for facilitating hop-by-hop layer 2 path tracing. Summary of the Invention
[0002] This disclosure relates to Layer 2 path tracing. A method is provided comprising: sending a Layer 2 tracing packet having a packet type in a Layer 2 header of the Layer 2 tracing packet, wherein the packet type indicates that the Layer 2 tracing packet is a packet for Layer 2 path tracing; receiving a Layer 2 response packet from a corresponding participating device along a path to a target device of the Layer 2 tracing packet, wherein the participating device supports the Layer 2 path tracing; obtaining tracing information from the payload of the Layer 2 response packet associated with a forward path traversed by the Layer 2 tracing packet to the participating device and a reverse path traversed by the Layer 2 response packet from the participating device, wherein the tracing information in the Layer 2 response packet identifies a plurality of Layer 2 devices along the forward path and the reverse path, and wherein the tracing information includes a plurality of Layer 2 addresses respectively identifying the plurality of Layer 2 devices; and determining, based on the tracing information, a Layer 2 path tracing between the originating device and the target device, including at least the plurality of Layer 2 addresses.
[0003] A non-transitory computer-readable storage medium is also provided, storing instructions that, when executed by a computer, cause the computer to perform a method comprising: sending a Layer 2 tracing packet having a packet type in a Layer 2 header of the Layer 2 tracing packet from an originating device, wherein the packet type indicates that the Layer 2 tracing packet is a packet for Layer 2 path tracing; receiving a Layer 2 response packet from a corresponding participating device on a path to a target device of the Layer 2 tracing packet, wherein the participating device supports the Layer 2 path tracing; obtaining tracing information from the payload of the Layer 2 response packet associated with a forward path traversed by the Layer 2 tracing packet to the participating device and a reverse path traversed by the Layer 2 response packet from the participating device, wherein the tracing information in the Layer 2 response packet identifies a plurality of Layer 2 devices along the forward path and the reverse path, and wherein the tracing information includes a plurality of Layer 2 addresses respectively identifying the plurality of Layer 2 devices; and determining, based on the tracing information, a Layer 2 path tracing between the originating device and the target device, including at least the plurality of Layer 2 addresses.
[0004] A computer system is also provided, including at least one processing resource; and a storage device storing instructions executable by the at least one processing resource to: send a Layer 2 tracing packet having a packet type in a Layer 2 header of the Layer 2 tracing packet, wherein the packet type indicates that the Layer 2 tracing packet is a packet for Layer 2 path tracing; receive a Layer 2 response packet from a corresponding participating device on a path to a target device of the Layer 2 tracing packet, wherein the participating device supports Layer 2 path tracing; obtain from the payload of the Layer 2 response packet tracing information associated with a forward path traversed by the Layer 2 tracing packet to the participating device and a reverse path traversed by the Layer 2 response packet from the participating device, wherein the tracing information in the Layer 2 response packet identifies a plurality of Layer 2 devices along the forward path and the reverse path, and wherein the tracing information includes a plurality of Layer 2 addresses that respectively identify the plurality of Layer 2 devices; and determine a Layer 2 path tracing between an originating device and the target device, including at least the plurality of Layer 2 addresses, based on the tracing information. Attached Figure Description
[0005] Figure 1A An example of layer 2 path tracing in a heterogeneous network according to aspects of this application is illustrated.
[0006] Figure 1B An example of a layer 2 path tracking grouping according to an aspect of this application is illustrated.
[0007] Figure 2A An example of layer 2 path tracing across tunnels according to aspects of this application is illustrated.
[0008] Figure 2B An example of Layer 2 path tracing in a Virtual Gateway Switch (VGS) across a distributed tunneling architecture according to an aspect of this application is illustrated.
[0009] Figure 3A An example of Layer 2 path tracing for paths with unsupported switches, according to aspects of this application, is illustrated.
[0010] Figure 3B The illustration shows an example of Layer 2 path tracing to an unsupported target switch according to aspects of this application.
[0011] Figure 4A A flowchart illustrating the process of originating device publishing layer 2 path tracking groups according to aspects of this application is presented.
[0012] Figure 4B A flowchart illustrating the process of path tracking groups in the target device processing layer 2 according to aspects of this application is presented.
[0013] Figure 5A flowchart illustrating the process of path tracking groups in the intermediate device processing layer 2 according to aspects of this application is presented.
[0014] Figure 6 An example of a switch with Layer 2 path tracing support according to aspects of this application is illustrated.
[0015] Figure 7 An example of a computer system with Layer 2 path tracing support according to aspects of this application is illustrated.
[0016] In the accompanying drawings, the same reference numerals refer to the same elements. Detailed Implementation
[0017] The following description is presented to enable any person skilled in the art to make and use the invention, and is provided in the context of a particular application and its requirements. Various modifications to the disclosed examples will be apparent to those skilled in the art, and the general principles defined herein can be applied to other examples and applications without departing from the spirit and scope of the invention. Therefore, the invention is not limited to the aspects shown, but is accorded the widest scope consistent with the claims.
[0018] The Internet is the delivery medium for a wide range of applications running on both physical and virtual devices. These applications generate ever-increasing business demands. Consequently, equipment suppliers are racing to build switches with diverse functionalities. For this purpose, switches may support different protocols and services. Layer 2 protocols (such as Ethernet) facilitate the operation of multiple such protocols and services. Therefore, identifying problems in the Layer 2 path (e.g., links and nodes) is crucial for troubleshooting. Examples of such problems include, but are not limited to, Layer 2 misconfigurations, cabling issues, and identifying Layer 2 loops.
[0019] Features such as tunneling across Layer 2 domains on Layer 3 networks can improve network efficiency. For example, a switch can support tunneling with a remote switch (e.g., Virtual Extensible LAN (VXLAN) tunneling). The corresponding tunnel endpoint maps the corresponding client Virtual LAN (VLAN) to a corresponding Tunnel Network Identifier (TNI), which identifies the virtual network used for the tunnel. The TNI can appear in the tunnel header encapsulating packets and is used to forward the encapsulated packets via the tunnel. For example, if the tunnel is formed based on VXLAN, then the TNI could be the Virtual Network Identifier (VNI) in the VXLAN header, and the tunnel endpoint could be a VXLAN Tunnel Endpoint (VTEP).
[0020] However, managing and troubleshooting complex networks with tunneling and link aggregation (LAG) can be challenging. Tracing Layer 2 paths can enhance the debugging process in such networks. Tracing routes is a tool for diagnosing network problems at Layer 3 (e.g., based on Internet Protocol (IP)). However, a similar tool does not exist for Layer 2 (e.g., Ethernet). Due to the lack of tracing capabilities at Layer 2, diagnosing problems at Layer 2 can be challenging. Furthermore, heterogeneous networks with overlay technologies (such as tunneling) increase the complexity of the tracing process.
[0021] One aspect of this technology provides a system for Layer 2 path tracing. During operation, the system can send a Layer 2 tracing packet with a packet type in the Layer 2 header of the tracing packet from an originating device. The packet type can indicate that the Layer 2 tracing packet is a tracing packet. The system can then receive a Layer 2 response packet from a corresponding participating device that supports Layer 2 path tracing on the path to the target device of the Layer 2 tracing packet. Subsequently, the system can obtain tracing information from the payload of the Layer 2 response packet, including the forward (“forward”) path traversed by the Layer 2 tracing packet to the participating device and the reverse path traversed by the Layer 2 response packet from the participating device. The tracing information can identify one or more Layer 2 devices along the forward and reverse paths and can include one or more Layer 2 identifiers corresponding to the identified Layer 2 devices.
[0022] In this variation, Layer 2 tracking packets and Layer 2 response packets can be associated with a Virtual Local Area Network (VLAN). Then, one or more Layer 2 devices can belong to a VLAN.
[0023] In a variation of this, for the corresponding Layer 2 device among the identified one or more Layer 2 devices, the tracking information may also include one or more of the following: port identifier and hostname.
[0024] In this variation, the system can encapsulate Layer 2 tracking packets within a tunnel header associated with the tunnel between the originating device and the remote endpoint. The tunnel can be formed based on a tunneling protocol.
[0025] In a further variation, tracking information can indicate a tunnel as a Level 2 jump.
[0026] In this variation, the system can set the Time-To-Live (TTL) value in the header based on a predetermined initial value. The initial value can indicate the number of Layer 2 hops to be tracked. Therefore, the TTL value can be decremented at the corresponding participating device.
[0027] In a further variation, the system may receive a Layer 2 response packet from a participating device where the TTL value has expired. Therefore, the Layer 2 response packet may then include an indicator indicating the TTL value that has expired.
[0028] In this variant, the system can set the Layer 2 address of the target device to the destination address of the Layer 2 tracking packet. The destination address is not modified for the Layer 2 tracking packet at the corresponding Layer 2 hop.
[0029] In this variation, the direction indicator in the Layer 2 tracking packet can indicate the forward direction of the target device. Similarly, the direction indicator in the Layer 2 response packet can indicate the reverse direction of the originating device.
[0030] In a variation of this approach, the forward and reverse paths may include one or more non-participating devices that do not support Layer 2 path tracing. Non-participating devices may include one or more of the following: intermediate devices and target devices.
[0031] The aspects described herein address the problem of providing Layer 2 path tracing in heterogeneous networks by: (i) sending Layer 2 tracing packets capable of accumulating information on the forward path to the target device; and (ii) receiving response tracing packets capable of accumulating information on the reverse path from the corresponding participating device on that path. The corresponding participating device can support and participate in Layer 2 path tracing. The participating device can append its local information to the tracing packets on both the forward and reverse paths. Therefore, the originating device can obtain information from the corresponding participating Layer 2 hops on the path to the target device.
[0032] Layer 2 tracing in heterogeneous networks is limited using existing technologies. Such tracing may not support Layer 2 hops across tunnels or via LAGs. To address this limitation, Layer 3 tracing mechanisms (such as trace routing) are often applied to VXLAN tunnels by using an increased time-to-live (TTL) to send packets between two VTEPs. However, packets may only be traced within the underlying physical network of the VXLAN tunnel. Consequently, extensions of the Layer 2 domain across the VXLAN tunnel (e.g., using VNIs) may not be represented by packets. In other words, individual Layer 2 hops across the tunnel are not traced by packets. Furthermore, some trace routing variants may provide Layer 2 information for Layer 3 hops based on their corresponding Internet Protocol (IP) addresses. However, the information gathered by such variants is limited to the Layer 3 routes adopted by the packets.
[0033] To address this issue, a Layer 2 tracing mechanism can be used to accumulate Layer 2 information for corresponding Layer 2 hops along the path to the target device. This mechanism can be called a "tracepath" because it tracks the path. Tracepaths can be traced using Layer 2 tracing packets (such as Ethernet frames). Tracepath packets can be published, forwarded, and responded to based on corresponding Layer 2 addresses (e.g., Media Access Control (MAC) addresses). Therefore, by treating the Layer 2 domain traversing a VXLAN as a single Layer 2 hop, tracing paths facilitate the reverse operation of existing solutions.
[0034] During operation, the originating device may send Layer 2 trace packets to the target device. The trace packet may include a Layer 2 header, which includes a packet type indicating that the packet is a trace packet and a TTL value. If the trace packet is an Ethernet frame, the packet type may be indicated by the Ethertype field in the Ethernet header. The originating device may initialize the TTL value based on an initial TTL value. The source and destination addresses in the header may correspond to the Layer 2 addresses (e.g., MAC addresses) of the originating and target devices, respectively. The payload of the trace packet may include a forward tracing direction indicator (e.g., a Boolean value) indicating the forward tracing to the target device. The payload may also include trace information associated with the local device in the forward direction. The trace information associated with the local device may include one or more of the following: the device's hostname, a port identifier for the port used for the packet, and the device's Layer 2 address (e.g., MAC address).
[0035] Packets can be processed by the corresponding Layer 2 hop on the path to the target device based on packet type and destination address. If the Layer 2 hop device supports the tracing path, the device can identify the packet as a tracing packet based on its packet type and participate in the tracing process. Therefore, the Layer 2 hop and the device can be referred to as the participating hop and participating device, respectively. On the other hand, if the Layer 2 hop device does not support the tracing path, the device can forward the packet to the next Layer 2 hop based on its destination address. Therefore, the tracing path can combine participating Layer 2 hops and non-participating Layer 2 hops.
[0036] Participating devices can be networking devices (e.g., switches) or hosts (e.g., user equipment). If the participating device is an intermediate device (i.e., not the target device), it can append local tracing information associated with the forward direction to the payload and decrement the TTL value in the header. The participating device can then forward the updated packet to the next Layer 2 hop based on the packet's destination address. This process of appending tracing information is performed by the corresponding participating device on the path to the target device. As a result, tracing information can accumulate at the corresponding participating Layer 2 hop on the forward path to the target device. On the other hand, if the participating device is the target device, it terminates forward tracing after appending local tracing information.
[0037] The participating device can also generate a copy of the packet as a response packet. The participating device can modify the direction indicator in the payload to indicate reverse tracing to the originating device. The payload of the response packet can also include tracing information for the local device associated with the reverse direction. The participating device can set the Layer 2 addresses of the participating device and the originating device as the source and destination addresses of the response packet, respectively. The participating device can then forward the response packet to the next Layer 2 hop via the path back to the originating device. This process of attaching tracing information is performed by the corresponding participating device on the path to the originating device. As a result, tracing information can be accumulated at the corresponding participating Layer 2 hop on the reverse path to the originating device.
[0038] Since the response packet is generated from a copy of the trace packet, it can also include forward trace information up to the participating device. In this way, the originating device can receive the response packet from the corresponding participating Layer 2 hop, including the target device. The response packet can include both forward Layer 2 trace and reverse Layer 2 trace up to the participating device in its Layer 2 payload. Because the trace path is deployed in Layer 2 using Layer 2 addresses, it does not rely on any Layer 3-based solutions (e.g., trace routing) and does not require looking up the Address Resolution Protocol (ARP) table for IP addresses. Furthermore, the trace packet is encapsulated with a tunnel header for traversing tunnels. As a result, the trace path can treat a tunnel as a single Layer 2 hop between endpoints and combine tunnels with Layer 2 hops.
[0039] In this disclosure, the term "switch" is used in a general sense and can refer to any standalone or structured switch operating at any network layer. "Switch" should not be construed as limiting the examples of this invention to Layer 2 networks. Any device that can forward traffic to external devices or other switches can be called a "switch." Any physical or virtual device (e.g., a virtual machine or switch operating on a computing device) that can forward traffic to end devices can be called a "switch." Examples of "switch" include, but are not limited to, Layer 2 switches, Layer 3 routers, routing switches, components of Gen-Z networks, or structured switches comprising multiple similar or heterogeneous smaller physical and / or virtual switches.
[0040] The term "packet" refers to a group of bits that can be transmitted together across a network. "Packet" should not be construed as limiting the examples of this invention to Layer 3 networks. "Packet" can be replaced by other terms referring to a group of bits, such as "message," "frame," "cell," "datagram," or "transaction." Furthermore, the term "port" can refer to a port that can receive or transmit data. "Port" can also refer to the hardware, software, and / or firmware logic that facilitates the operation of that port.
[0041] Figure 1A An example of Layer 2 path tracing in a heterogeneous network according to aspects of this application is illustrated. The heterogeneous network 100 may include multiple switches and devices, and may include heterogeneous network components such as Layer 2 and Layer 3 hops and tunnels. In some examples, network 100 may be Ethernet, wireless bandwidth, or other networks, and may use corresponding communication protocols such as Internet Protocol (IP), Fibre Channel over Ethernet (FCoE), or other protocols. Network 100 may include a distributed tunneling structure 110, which includes switches 101, 102, 103, 104, and 105 associated with MAC addresses 172, 174, 170, 176, and 178, respectively.
[0042] In Figure 1, the links indicated by dashed lines in structure 110 can be tunnels. The switches in structure 110 can form a tunnel mesh. Examples of tunnels may include, but are not limited to, VXLAN, Generic Routing Encapsulation (GRE), Network Virtualization Using GRE (NVGRE), Geneve, and Internet Protocol Security (IPsec). The links indicated by solid lines in structure 110 can be links in the underlying network (or bearer network) 150 of structure 110. The underlying network 150 can be a physical network, and the corresponding links in the underlying network 150 can be physical links. A VPN 130 (such as an Ethernet VPN (EVPN)) can be deployed on structure 110. Structure 110 may include a Virtual Gateway Switch (VGS) 106, which can be coupled to an external switch 116 via a LAG 122. Here, LAG 122 can be a multi-chassis LAG, presenting the link between VGS 106 and switch 116 as an aggregated link.
[0043] Switches 102 and 105 can couple structure 110 to external network 120 via external switch 112. Switch 105 can also be coupled to external switch 114. Furthermore, switches 101 and 102 can be combined to operate as a single switch to facilitate VGS 106. VGS 106 can be associated with one or more virtual addresses (e.g., virtual IP addresses and / or virtual MAC addresses). Corresponding tunnels formed at VGS 106 can use virtual addresses to form tunnel endpoints. To efficiently manage data forwarding, switches 101 and 102 can maintain an inter-switch link (ISL) 108 between them for sharing control and / or data packets. ISL 108 can be a Layer 2 or Layer 3 connection that allows data forwarding between switches 101 and 102. ISL 108 can also be based on a tunnel (e.g., a VXLAN tunnel) between switches 101 and 102.
[0044] Because the virtual address of VGS106 is associated with both switches 101 and 102, other tunnel endpoints of fabric 110 (such as switches 103, 104, and 105) can treat VGS106 as another tunnel endpoint for tunneling, rather than switches 101 and 102. To forward traffic to VGS106 in fabric 110, a remote switch such as switch 103 can operate as a tunnel endpoint, while VGS106 can be another tunnel endpoint. From each of switches 103, 104, and 105, a set of paths (e.g., equal-cost multipath or ECMP) can exist to VGS106. A corresponding path in the underlying network 150 can lead to one of the participating switches of VGS106. Hosts (or terminal devices) 124 and 126 can be coupled to switches 114 and 116, respectively. Furthermore, host 128 can be coupled to external network 120 via switch 118.
[0045] In the prior art, Layer 2 tracing in network 100 is limited. Such tracing may not support Layer 2 hops across tunnels (such as tunnel 132) or LAGs (such as LAG 122). To overcome this limitation, Layer 3 mechanisms such as tracing routes can be applied on tunnel 132 by sending packets with an increased TTL between switch 103 and switch 105. However, packets may only trace hops within the underlying network 150 between switch 103 and switch 104, and between switch 104 and switch 105. As a result, the extension of the Layer 2 domain across tunnel 132 (e.g., using TNI) may not be represented by packets. In other words, individual Layer 2 hops across tunnel 132 are not traced by packets. Furthermore, some tracing route variants may provide Layer 2 information for Layer 3 hops based on their corresponding IP addresses (e.g., MAC addresses corresponding to IP addresses). However, the information collected by such variants is limited to the Layer 3 routes taken by packets in network 100.
[0046] To address this issue, one or more devices in network 100 may support instances of tracing paths (e.g., tracing daemons or hardware) that can facilitate effective Layer 2 path tracing in network 100 based on Layer 2 addresses. For example, switch 103 may be equipped with a tracing path instance 160, which may also be referred to as tracing path 160. Tracing path 160 may send Layer 2 tracing packets 152, which can accumulate information at the corresponding participating Layer 2 hops on the forward path to the target device (e.g., switch 114). Tracing path 160 may then receive response tracing packets 142 and 148 (or response packets 142 and 148), which can accumulate information on the reverse path from the corresponding participating devices (e.g., switches 105 and 114), respectively.
[0047] Packet 152 can be carried via tunnel 132 based on an encapsulated header (e.g., a VXLAN header). To forward packet 152 to switch 114 based on MAC address 162, switch 103 can encapsulate packet 152 using the tunnel header to generate an encapsulated packet 146 and forward packet 146 via tunnel 132. Therefore, switch 104 can forward packet 146 without processing packet 152. As a result, switch 104's MAC address 176 is not included in packet 152. Upon receiving packet 146, switch 105 can decapsulate the encapsulated header to obtain packet 152. Therefore, tunnel 132 can be considered a single Layer 2 hop between switches 103 and 105.
[0048] Switch 105 can determine that packet 152 is a tracking packet based on the packet type in the header of packet 152. Therefore, even if the destination of packet 152 is MAC address 162, which is not assigned to switch 105, switch 105 can still process packet 152. For example, a tracking path instance 140 of switch 105 (e.g., a tracking path daemon) can listen on an internal interface (e.g., a software interface) running on the central processing unit of switch 105. After identifying the packet type, switch 105 can forward packet 152 to tracking path 140. Tracking path 140 can then append local tracking information to the payload of packet 152 to generate packet 158 and provide packet 158 to the forwarding hardware of switch 105 without changing the source and destination addresses of packet 152. As a result, the packet types, source and destination addresses of packets 152 and 158 can remain unchanged.
[0049] Switch 105 can append its local tracing information to packet 152 on the forward path to generate an updated packet 158. Switch 105 can generate a copy of packet 158 as a response packet 142 and change the direction indicator to indicate reverse tracing to switch 103. Switch 105 can append its local tracing information to the response packet 142 associated with the reverse direction. In the same manner, switch 114 can send a response packet 144 to switch 103. Switch 105 can also append its local tracing information associated with the reverse direction to the payload of response packet 144 to generate packet 148. Switch 105 can decrement the TTL value in the header of packet 148 and send packet 148 to switch 103. In this way, tracing path 160 on switch 103 can obtain information from the corresponding participating layer 2 hops on the forward and reverse paths to and from switch 114, respectively.
[0050] Similarly, tracing path 160 can send Layer 2 tracing packets 154 and 156 to accumulate Layer 2 information for the corresponding Layer 2 hops on the paths to target switch 116 and target switch 118, respectively. Layer 2 tracing packets 152, 154, and 156, and response packets 142, 144, and 148 can be Ethernet frames. Therefore, tracing packets 152, 154, and 156, and response packets 142, 144, and 148 can be sent, forwarded, and responded to based on their corresponding Layer 2 addresses (e.g., MAC addresses).
[0051] For example, the source and destination addresses in the Layer 2 header of packet 152 can correspond to MAC addresses 170 and 162 of originating switch 103 and destination switch 114, respectively. Similarly, the source and destination addresses in packet 154 can correspond to MAC addresses 170 and 166 of switches 103 and 116, respectively. Likewise, the source and destination addresses in packet 156 can correspond to MAC addresses 170 and 164 of switches 103 and 118, respectively. On the other hand, the destination address in the Layer 2 headers of response packets 142, 144, and 148 can correspond to MAC address 170 of originating switch 103. The source address in the Layer 2 header of response packet 142 can correspond to MAC address 178 of switch 105. On the other hand, the source address in the Layer 2 headers of response packets 144 and 148 can correspond to MAC address 162 of switch 114.
[0052] The Layer 2 header of a corresponding tracking packet, such as tracking packet 152, may include a packet type and TTL value indicating that packet 152 is a tracking packet. If tracking packet 152 is an Ethernet frame, the packet type can be indicated by the Ethertype field in the Ethernet header. Tracking path 160 may initialize the TTL value based on an initial TTL value, which may be predefined. The payload of packet 152 may include a direction indicator indicating forward tracking from switch 103 to target switch 114. The payload may also include tracking information for the corresponding participating devices on the forward path associated with the forward direction. For example, the payload may accumulate tracking information for switches 103, 105, and 114 associated with the forward direction.
[0053] The trace information associated with participating devices such as switch 103 may include one or more of the following: the hostname of switch 103 (e.g., "switch 103"), the port identifier of the egress port for packet 152, and the MAC address 179 of switch 103. Because packet 152 is encapsulated when forwarded through tunnel 132, switch 104 forwards the encapsulated packet to switch 105 without processing the internal packet 152. As a result, packet 152 does not accumulate information associated with switch 104, thus treating tunnel 132 as a single Layer 2 hop.
[0054] Similarly, response packet 142 can accumulate tracking information associated with the corresponding participating device on the reverse path from switch 105 to switch 103. Furthermore, response packet 144 can accumulate tracking information associated with the corresponding participating device on the reverse path from switch 114 to switch 103. For example, switch 105 can append its local tracking information to packet 144 to generate packet 148 and send packet 148 to switch 103. This allows switch 103 to receive response packets from both switch 105 and switch 114. Since packets 142 and 144 are generated from copies of the corresponding tracking packets at switches 105 and 114, respectively, packets 142 and 148 can also include forward tracking information up to switches 105 and 114, respectively.
[0055] Since packet 142 originates from switch 105, packet 142 can include forward Layer 2 tracing information up to switch 105 and reverse Layer 2 tracing information in its Layer 2 payload response. Conversely, since packet 144 originates from switch 114 and packet 148 is generated from packet 144, packet 148 can include forward Layer 2 tracing information up to switch 114 and reverse Layer 2 tracing information in its Layer 2 payload response. It should be noted that MAC addresses can be used to deploy tracing path 160. Therefore, tracing path 160 does not rely on any Layer 3-based solutions (e.g., tracing routes) and does not require looking up the ARP table for IP addresses. Therefore, tracing path 160 can facilitate effective Layer 2 path tracing in heterogeneous network 100.
[0056] If packet 158 is dropped due to an expired TTL caused by a problem in network 100, a TTL expiration message is sent back to switch 103, indicating that the TTL value at the expiration hop has reached its expiration value (e.g., zero). The payload of the TTL expiration message may include forward tracking information up to the expiration hop. The TTL value in the payload of the TTL expiration message may be reset to its initial value or the TTL value from packet 158. The TTL expiration message may accumulate reverse tracking information from the drop location to the corresponding Layer 2 hop in switch 103. As a result, the TTL expiration message may include both forward and reverse tracking information up to the expiration hop. The expiration hop may indicate where the TTL value reached its expiration value at a Layer 2 hop.
[0057] Figure 1B An example of a Layer 2 path tracing packet according to an aspect of this application is illustrated. A tracing or response packet 180 may include a Layer 2 header 182 and a Layer 2 payload 184. The header 182 may include one or more of the following: packet type 192, source address 194, destination address 196, and TTL 198. If the header 182 is an Ethernet header, then type 192 may be the Ethernet type field of the Ethernet header, and the source address and destination address 194 and 196 may be MAC addresses. A corresponding intermediate participating device can determine that packet 180 is a tracing packet based on type 192 in the header 182 of packet 180. Therefore, even if packet 180 is destined for destination address 196, which may not be assigned to a local device, the intermediate participating device can still process packet 180 without changing the source address 192 and destination address 196 respectively.
[0058] Furthermore, payload 184 may include tracking information 190 for corresponding forward and reverse hops between the originating and destination devices. Payload 184 may include tracking information 190 associated with direction 191. For example, if a device includes information 190 on the forward path, direction 191 may indicate the forward direction. Conversely, the same device may include information 190 on the reverse path, and direction 191 may indicate the reverse direction. Direction 191 may be indicated based on values (e.g., "0" or "1") or character sets (e.g., "forward" or "reverse") in payload 184. Tracking path instances such as tracking path 160 on switch 103 or tracking path 140 on switch 105 may determine direction 191 based on a direction indicator 188, which may be a field in header 182 or a value in payload 184. Direction indicator 188 may be represented as a Boolean value.
[0059] Payload 184 can be represented based on a dictionary data structure. Packet 180 can then have metadata represented as a dictionary within payload 184, with "forward" or "reverse" indices and values as a list representing trace information 190. The trace information 190 associated with the device can include one or more of the following: the device's hostname, the device's Layer 2 address, and the port identifier of the port used for packet 180. Therefore, the list can be in the form of ['hostname', 'MAC address', 'port identifier']. For example, a dictionary entry generated by switch 103 could be {'forward': [['switch 103', 'MAC address 170', 'port 134']]}.
[0060] When tracking or responding to packet 180 travels through a tunnel (e.g., tunnel 132), packet 180 can be encapsulated using a tunnel encapsulation header 186 (e.g., a VXLAN header). The Layer 3 source and destination addresses (such as IP addresses) of header 186 can correspond to the endpoints of the tunnel. For example, if packet 180 corresponds to packet 152, the encapsulated packet could correspond to packet 146. Then the source and destination IP addresses of header 186 could be the IP addresses of switch 103 and switch 105, respectively.
[0061] When tracing path 160 sends tracing packet 152, tracing path 160 may include tracing information associated with switch 103 in the payload of packet 152 and forward packet 152 via port 134 of switch 103. The tracing information associated with switch 103 may include: the hostname of switch 103 (e.g., "switch 103"), MAC address 170, and an identifier for port 134. Because packet 146 is forwarded via tunnel 132, switch 104 does not process internal packet 152 and therefore does not append local tracing information to packet 152. Switch 105 may receive packet 146 via port 136 of switch 105 and obtain packet 152 from packet 146.
[0062] Since switch 105 is an intermediate switch on the path to switch 114, tracing path 140 on switch 105 can append local tracing information associated with the forward direction (e.g., direction 191 in packet 180) to the payload of packet 152 and generate packet 158. The generation of packet 158 allows tracing information to accumulate at the corresponding participating Layer 2 hops on the forward path from switch 103 to switch 114. The tracing information associated with switch 105 may include: the hostname of switch 105 (e.g., “switch 105”), MAC address 178, and the identifier of port 136. The dictionary in packet 158 may be {'forward': [['switch 103', 'MAC address 170', 'port 134'], ['switch 105', 'MAC address 178', 'port 136']]}. Tracing path 140 can decrement the TTL value in the header of packet 158 based on the destination address (i.e., MAC address 162) of packet 158 and forward packet 158 to switch 114, which can be a next-layer 2 hop. Here, even if packet 152 is processed at the layer 2 hop at switch 105, the destination addresses for packet 152 and packet 158 remain unchanged.
[0063] The process of attaching trace information is performed by the corresponding participating device on the path to switch 114. When switch 114 receives packet 158, it can terminate forward tracing after attaching local trace information. Tracing path 140 can also generate response packet 142 to indicate reverse tracing to switch 103 by copying packet 158 and changing the direction indicator (e.g., indicator 188 in packet 180). For example, tracing path 140 can change the Boolean value of the direction indicator. Tracing path 140 can include reverse tracing information associated with the reverse direction in the payload of packet 142.
[0064] However, since packet 152 is received via tunnel 132, tracing path 140 can include tracing information associated with switch 103 (indicated by dashed lines) in packet 142. Such information may include the hostname of switch 103 (e.g., “switch 103”), MAC address 170, and the identifier of port 134. Tracing path 140 can also reset the TTL value in the header of packet 142 to a predetermined initial value or the TTL value from packet 152 based on a TTL selection policy. Switch 105 can then send packet 142 to switch 103. The dictionary in packet 142 can be {'forward': [['switch 103', 'MAC address 170', 'port 134'], ['switch 105', 'MAC address 178', 'port 136']]}; {'reverse': [['switch 103', 'MAC address 170', 'port 134']]}.
[0065] Similarly, switch 105 can receive response packet 144 from switch 114 via port 138 of switch 105. Trace path 140 can then append reverse trace information (indicated by dashed lines) associated with switch 105 to packet 144 to generate packet 148. Such information may include: the hostname of switch 105 (e.g., "switch 105"), MAC address 178, and the identifier of port 138. The generation of packet 148 allows trace information to be accumulated at the corresponding Participating Layer 2 hop on the reverse path from switch 114 to switch 103. Trace path 140 can decrement the TTL value in the header of packet 148. Switch 105 can then send packet 148 to switch 103.
[0066] Since packet 144 is received from switch 114 and packet 148 is generated from packet 144, packet 148 can include both forward tracing information and reverse tracing information to switch 114. Here, even if packet 144 is processed at a Layer 2 hop at switch 105, the destination address for packet 144 can remain the same. The process of attaching tracing information is performed by the corresponding participating device on the path to switch 103. When switch 103 receives packet 148, tracing path 160 can terminate reverse tracing after attaching local tracing information.
[0067] Figure 2AAn example of Layer 2 path tracing across tunnels according to aspects of this application is illustrated. During operation, switch 103 may attempt to locate a device (i.e., switch 114) with MAC address 162 in network 100. Switch 103 may receive instructions for initiating tracing from a management device or administrator. The management device may configure, monitor, and / or control one or more devices in network 100. Switch 103 may receive instructions in the form of scripts, remote commands, or command-line interface (CLI) commands. Switch 103 may learn MAC address 162 from tunnel 132. As a result, switch 103 may store MAC address 162 in association with tunnel 132 in its local Layer 2 forwarding table. Similarly, switch 105 may learn MAC address 162 from port 138 and store it in association with port 138 in its local forwarding table.
[0068] To initiate Layer 2 path tracing to switch 114, tracing path 160 can generate a Layer 2 tracing packet with a Layer 2 header. The packet type in the Layer 2 header indicates that the packet is a tracing packet. The source address and destination address in the Layer 2 header can correspond to MAC address 170 and MAC address 162, respectively. The TTL value of the header can be set to a predetermined initial value. Tracing path 160 can include local tracing information 202 associated with the forward direction in the payload of the tracing packet. Information 202 can include ['switch 103', 'MAC address 170', 'port 134']. Therefore, the dictionary in the tracing packet can be {'forward': [information 202]}. Based on the local forwarding table entry corresponding to MAC address 162, switch 103 can send the tracing packet via tunnel 132 by encapsulating the packet with an encapsulation header.
[0069] Since switch 105 is the remote endpoint of tunnel 132 and is reachable via port 134, switch 103 can send encapsulated packets to switch 104 via port 134. Based on the encapsulation header, switch 104 can send the encapsulated packets to switch 103 without processing the internal tracking packet. After receiving the encapsulated packet via port 136, switch 105 can remove the encapsulation header and obtain the internal tracking packet. Switch 105 can provide the tracking packet based on the tracking path 140 on switch 105. Tracking path 140 can decrement the TTL value in the header and append tracking information 204 associated with the forward direction to the payload of the tracking packet. Information 204 may include ['switch 105', 'MAC address 178', 'port 136']. Therefore, the dictionary in the tracking packet can be {'forward': [information 202, information 204]}. Based on the local forwarding table, switch 105 can send the tracking packet via port 138 without changing the source and destination addresses.
[0070] Tracing path 140 can also generate response packets from the tracing packets. Tracing path 140 can modify the direction indicator to indicate reverse tracing to switch 103. Therefore, the source address and destination address of the response packet can correspond to MAC address 178 and MAC address 170, respectively. Tracing path 140 can append tracing information 202 associated with the reverse direction to the payload of the response packet. Therefore, the dictionary in the response packet can be {'forward': [information 202, information 204]}; {'reverse': [information 202]}. Based on the local forwarding table, switch 105 can send the response packet via port 136.
[0071] After receiving a tracking packet via port 232, switch 114 can provide the tracking packet to tracking path 230 on switch 114 based on the packet type. Tracking path 230 can append tracking information 206 associated with the forward direction to the payload of the tracking packet. Information 206 may include ['switch 114', 'MAC address 162', 'port 232']. Since the destination MAC address 162 of the tracking packet is a local address (i.e., assigned to switch 114), tracking path 230 can terminate the forwarding of the tracking packet. Tracking path 230 can then generate a response packet from the tracking packet. Tracking path 230 can reset the TTL value and change the direction indicator to indicate reverse tracking in the header of the response packet. The source address and destination address of the response packet can correspond to MAC addresses 162 and 170, respectively.
[0072] Trace path 230 may append trace information 206 associated with the reverse direction to the payload of the response packet. Therefore, the dictionary in the response packet may be {'forward': [information 202, information 204, information 206]}; {'reverse': [information 206]}. Here, [information 202, information 204, information 206] may represent forward trace information 210. Based on the local forwarding table, switch 114 may send the response packet via port 232. After receiving the response packet via port 138, switch 105 may provide the response packet to trace path 140 based on the packet type. Trace path 140 may decrement the TTL value in the header and append trace information 208 associated with the reverse direction to the payload of the response packet. Information 208 may include ['switch 105', 'MAC address 178', 'port 138']. Therefore, the dictionary in the response packet can be {'Forward': [Message 202, Message 204, Message 206]}; {'Reverse': [Message 206, Message 208]}. Based on the local forwarding table, switch 105 can encapsulate the response packet and send the encapsulated packet to switch 103 via tunnel 132.
[0073] After receiving an encapsulated packet via port 134, switch 103 can remove the encapsulation header and obtain the internal response packet. Switch 103 can provide the response packet to tracing path 160 based on the packet type. Tracing path 160 can append tracing information 202 associated with the reverse direction to the payload of the response packet. Therefore, the dictionary in the response packet can be {'forward': [information 202, information 204, information 206]}; {'reverse': [information 206, information 208, information 202]}. Here, [information 206, information 208, information 202] can represent reverse tracing information 220. Since the destination MAC address 170 of the response packet is a local address, tracing path 160 can terminate the forwarding of the response packet. Tracing path 160 can store the forward tracing information 210 and the reverse tracing information 220 in a tracing table 200 associated with MAC address 162. Tracing path 160 can also provide the information to a device capable of displaying it.
[0074] Figure 2B An example of Layer 2 path tracing for a VGS across a distributed tunneling architecture according to aspects of this application is illustrated. Since VGS106 is a virtual gateway, it can be associated with a virtual address (e.g., a virtual IP address) shared by switches 101 and 102. Therefore, a tunnel 280 can be established between switch 103 and VGS106 based on the IP address of switch 103 and the virtual IP address of VGS106. Consequently, packets forwarded via tunnel 280 to the virtual IP address can take any path from one of the participating switches in the underlying network 150 that leads to VGS106. In other words, if switch 103 sends a packet via tunnel 280, the packet can be forwarded to switch 101 via port 272 or to switch 102 via port 274 based on a selection strategy for the VGS (e.g., based on round-robin distribution, load balancing, or bandwidth utilization).
[0075] Furthermore, switch 116 can be coupled to switches 101 and 102 via LAG 122. Therefore, the links in LAG 122 can be considered aggregated links. As a result, switch 116 can receive packets from switches 101 and 102. On the other hand, to forward packets via LAG 122, switch 116 can select one of switches 101 and 102 as the destination. Switch 116 can select a specific link or switch in LAG 122 for sending all traffic belonging to data flows indicating source and destination address pairs. Switch 116 can also select a link or switch in LAG 122 for sending individual packets. For example, when switch 116 sends a packet via LAG, the packet can be forwarded to switch 101 via port 276 or to switch 102 via port 278 based on the LAG's selection strategy (e.g., based on round-robin allocation, load balancing, or bandwidth utilization).
[0076] During operation, switch 103 may attempt to locate the device with MAC address 166 (i.e., switch 116) in network 100. Switch 103 can obtain MAC address 166 from tunnel 280. As a result, switch 103 can store the MAC address 166 associated with tunnel 280 in its local Layer 2 forwarding table. To initiate Layer 2 path tracing to switch 116, tracing path 160 can generate a Layer 2 tracing packet with a Layer 2 header. The source address and destination address of the Layer 2 header can correspond to MAC address 170 and MAC address 166, respectively. The TTL value of the header can be set to a predetermined initial value. To forward the tracing packet, switch 103 can select one of ports 272 and 274 as the egress port. Assuming the selection policy selects switch 102 as the destination switch associated with tunnel 280, switch 103 can therefore select 274 as the egress port.
[0077] The tracing path 160 can then include local tracing information 252 associated with the forward direction in the payload of the tracing packet. Information 252 may include ['Switch 103', 'MAC address 170', 'Port 274']. The dictionary in the tracing packet can then be {'Forward': [Information 252]}. Based on the local forwarding table, switch 103 can send packets via tunnel 280 by encapsulating the packets with an encapsulation header. The source and destination addresses of the encapsulation header can be the IP address of switch 103 and the virtual IP address of VGS106. Since VGS106 is the remote endpoint of tunnel 280 and the egress port is port 274, the tracing packet is forwarded to switch 102.
[0078] After receiving an encapsulated packet via port 284, switch 102 can remove the encapsulation header and obtain the internal tracking packet. Switch 102 can provide the tracking packet to tracking path 244 on switch 102 based on the packet type. Tracking path 244 can decrement the TTL value in the header and append tracking information 254 associated with the forward direction to the payload of the tracking packet. Information 254 may include ['switch 102', 'MAC address 174', 'port 284']. Therefore, the dictionary in the tracking packet can be {'forward': [information 252, information 254]}. Based on the local forwarding table, switch 102 can send the tracking packet via port 288 without changing the source and destination addresses.
[0079] Tracing path 244 can also generate response packets from the tracing packets. Tracing path 244 can modify the direction indicator to indicate reverse tracing to switch 103. Therefore, the source address and destination address of the response packet can correspond to MAC address 174 and MAC address 170, respectively. Tracing path 244 can append tracing information 252 associated with the reverse direction to the payload of the response packet. Therefore, the dictionary in the response packet can be {'forward': [information 252, information 254]}; {'reverse': [information 252]}. Based on the local forwarding table, switch 102 can send the response packet via port 284.
[0080] After receiving a tracking packet via port 278, switch 116 can provide the tracking packet to tracking path 246 on switch 116 based on the packet type. Tracking path 246 can append tracking information 256 associated with the forward direction to the payload of the tracking packet. Information 256 may include ['switch 116', 'MAC address 166', 'port 278']. Since the destination MAC address 166 of the tracking packet is a local address, tracking path 246 can terminate the forwarding of the tracking packet. Tracking path 246 can then generate a response packet from the tracking packet. Tracking path 246 can reset the TTL value and change the direction indicator to indicate reverse tracking in the header of the response packet. The source address and destination address of the response packet can correspond to MAC address 166 and MAC address 170, respectively.
[0081] Because the next-hop switch is VGS106, switch 116 can select one of ports 276 and 278, which lead to switches 101 and 102 respectively, as the egress port. Assume switch 116 selects port 276 as the egress port for forwarding via LAG 122. Therefore, tracing path 246 can append corresponding tracing information 262 associated with the reverse direction to the payload of the response packet. Information 262 can include ['switch 116', 'MAC address 166', 'port 276']. Therefore, the dictionary in the response packet can be {'forward': [information 252, information 254, information 256]}; {'reverse': [information 262]}. Here, [information 252, information 254, information 256] can represent forward tracing information 250. Switch 116 can then forward the response packet to switch 101 via port 276.
[0082] After receiving a response packet via port 286, switch 101 can provide the response packet to tracing path 242 based on the packet type. Tracing path 242 can decrement the TTL value in the header and append tracing information 264 associated with the reverse direction to the payload of the response packet. Information 264 may include ['switch 101', 'MAC address 172', 'port 286']. Therefore, the dictionary in the response packet can be {'forward': [information 252, information 254, information 256]}; {'reverse': [information 262, information 264]}. Based on the local forwarding table, switch 105 can encapsulate the response packet and send the encapsulated packet to switch 103 via tunnel 280.
[0083] After receiving an encapsulated packet via port 272, switch 103 can remove the encapsulation header and obtain an internal response packet. Switch 103 can provide the response packet to tracing path 160 based on the packet type. Tracing path 160 can append tracing information 266 associated with the reverse direction to the payload of the response packet. Information 266 can include ['switch 103', 'MAC address 170', 'port 272']. Therefore, the dictionary in the response packet can be {'forward': [information 252, information 254, information 256]}; {'reverse': [information 262, information 264, information 266]}. Here, [information 262, information 264, information 266] can represent reverse tracing information 260. Since the destination MAC address 170 of the response packet is a local address, tracing path 160 can terminate the forwarding of the response packet. Tracing path 160 can store the forward tracing information 250 and the reverse tracing information 260 associated with MAC address 166 in tracing table 220.
[0084] Figure 3A An example of Layer 2 path tracing for a path with an unsupported switch, according to aspects of this application, is illustrated. During operation, switch 103 may attempt to locate a device with MAC address 164 (i.e., switch 118) in network 100. Switch 103 may obtain MAC address 166 from port 332 of coupled switch 112. As a result, switch 103 may store MAC address 166 in association with port 332 in its local Layer 2 forwarding table. For this purpose, tracing path 160 may generate a Layer 2 tracing packet with a Layer 2 header. The packet type in the Layer 2 header may indicate that the packet is a tracing packet. The source address and destination address of the Layer 2 header may correspond to MAC address 170 and MAC address 164, respectively. The TTL value of the header may be set to a predetermined initial value.
[0085] The next-layer 2-hop (switch 112) for the tracking packet is reachable via port 332. Tracking path 160 can include local tracking information 302 associated with the forward direction in the tracking packet payload. Information 302 can include ['switch 103', 'MAC address 170', 'port 332']. Therefore, the dictionary in the tracking packet can be {'forward': [information 302]}. Based on the local forwarding table entry corresponding to MAC address 162, switch 103 can send the tracking packet to switch 112 via port 332.
[0086] After receiving a tracking packet via port 334, switch 112 can provide the tracking packet to tracking path 322 on switch 112 based on the packet type. Tracking path 322 can decrement the TTL value in the header and append tracking information 304 associated with the forward direction to the payload of the tracking packet. Information 304 may include ['switch 112', 'MAC address 330', 'port 334']. Therefore, the dictionary in the tracking packet can be {'forward': [information 302, information 304]}. Based on the local forwarding table, switch 112 can send the tracking packet via port 336 without changing the source and destination addresses.
[0087] Tracing path 322 can also generate response packets from the tracing packets. Tracing path 322 can modify the direction indicator to indicate reverse tracing to switch 103. Therefore, the source and destination addresses of the response packets can correspond to MAC addresses 330 and 170, respectively. Tracing path 322 can append tracing information 304 associated with the reverse direction to the payload of the response packets. Therefore, the dictionary in the response packets can be {'forward': [information 302, information 304]}; {'reverse': [information 304]}. Based on the local forwarding table, switch 112 can determine that MAC address 170 is reachable via port 334. Switch 112 can then forward the response packets to switch 103 via port 334.
[0088] However, switches 342 and 344 in external network 120 may be intermediate switches on the path to switch 118, but may not support Layer 2 packet tracing. For example, packet tracing may be VLAN-specific. The tracing packet and response packet may then belong to a specific VLAN. Therefore, switches configured with a VLAN can participate in the Layer 2 packet tracing process. If switches 342 and 344 are not configured with a VLAN for initiating packet tracing, they may not participate in packet tracing even if the tracing path is locally supported. In other words, the corresponding tracing switch may belong to that VLAN.
[0089] On the other hand, if tracing paths are not supported in switches 342 and 344, switch 342 may not recognize the tracing packet as a Layer 2 tracing packet based on the packet type. Since the destination MAC address 164 is not a local address, switch 342 can forward the tracing packet to the next hop switch 344. In the same way, switch 344 can forward the tracing packet to the next hop switch 118 based on the destination MAC address 164 of the tracing packet. In this way, even if the switches do not support tracing paths, the tracing process can continue to subsequent hops. Since switches 342 and 344 do not process tracing packets (indicated by dashed arrows), the TTL value is not decremented for the corresponding Layer 2 hop.
[0090] Switch 118 can receive tracking packets via port 338 and provide tracking packets to tracking path 324 on switch 118 based on packet type. Tracking path 324 can append tracking information 306 associated with the forward direction to the payload of the tracking packet. Information 306 may include ['Switch 118', 'MAC address 164', 'Port 338']. Since the destination MAC address 162 of the tracking packet is a local address, tracking path 324 can terminate the forwarding of the tracking packet. Tracking path 324 can then generate a response packet from the tracking packet. Tracking path 324 can reset the TTL value and change the direction indicator to indicate reverse tracking in the header of the response packet. The source address and destination address of the response packet can correspond to MAC addresses 164 and 170, respectively.
[0091] Tracing path 324 can append tracing information 306 associated with the reverse direction to the payload of the response packet. Therefore, the dictionary in the response packet can be {'forward': [information 302, information 304, information 306]}; {'reverse': [information 306]}. Here, [information 302, information 304, information 306] can represent forward tracing information 310. Based on the local forwarding table, switch 118 can send the response packet via port 338. Switches 342 and 344 can forward the tracing packet via external network 120 based on the destination MAC address 170 of the response packet.
[0092] After receiving a response packet via port 336, switch 112 can provide the response packet to tracing path 322 based on the packet type. Tracing path 322 can decrement the TTL value in the header and append tracing information 308 associated with the reverse direction to the payload of the response packet. Information 308 may include ['switch 112', 'MAC address 330', 'port 336']. Therefore, the dictionary in the response packet can be {'forward': [information 302, information 304, information 306]}; {'reverse': [information 306, information 308]}. Based on the local forwarding table, switch 112 can send a response packet to switch 103 via port 334.
[0093] Switch 103 can receive response packets via port 332 and provide response packets to tracing path 160 based on packet type. Tracing path 160 can append tracing information 302 associated with the reverse direction to the payload of the response packet. Therefore, the dictionary in the response packet can be {'forward': [information 302, information 304, information 306]}; {'reverse': [information 306, information 308, information 302]}. Here, [information 306, information 308, information 302] can represent reverse tracing information 320. Since the destination MAC address 170 of the response packet is a local address, tracing path 160 can terminate the forwarding of the response packet. Tracing path 160 can store the forward tracing information 310 and the reverse tracing information 320 in tracing table 200 in association with MAC address 164.
[0094] Figure 3B The illustration depicts an example of Layer 2 path tracing to a target switch that does not support an unsupported path, according to aspects of this application. In this example, the target switch 118 may not support the tracing path. However, switch 346 may support the tracing path, and this switch 346 may be on the path to switch 118 in the external network 120. As a result, switch 112 can forward tracing packets destined for switch 118 to switch 346 via port 372. Here, the dictionary in the tracing packet from switch 112 may be {'forward':[information 302, information 304]}. Furthermore, the dictionary in the response packet may be {'forward':[information 302, information 304]}; {'reverse':[information 302]}, as combined... Figure 3A As described.
[0095] After receiving a tracking packet via port 374, switch 346 can provide the tracking packet to tracking path 326 on switch 346 based on the packet type. Tracking path 326 can decrement the TTL value in the header and append tracking information 352 associated with the forward direction to the payload of the tracking packet. Information 352 may include ['switch 346', 'MAC address 340', 'port 374']. Therefore, the dictionary in the tracking packet can be {'forward': [information 302, information 304, information 352]}. Based on the local forwarding table, switch 112 can send the tracking packet to switch 118. However, since switch 118 does not support tracking paths, switch 118 may not provide a response.
[0096] Tracing path 326 can also generate response packets from the tracing packets. Tracing path 326 can modify the direction indicator to indicate reverse tracing to switch 103. Therefore, the source address and destination address of the response packet can correspond to MAC address 340 and MAC address 170, respectively. Tracing path 326 can append tracing information 352 associated with the reverse direction to the payload of the response packet. Therefore, the dictionary in the response packet can be {'forward': [information 302, information 304, information 352]}; {'reverse': [information 352]}. Based on the local forwarding table, switch 346 can determine that MAC address 170 is reachable via port 374. Switch 346 can then forward the response packet to switch 112 via port 374.
[0097] Switch 112 can receive response packets via port 372 and provide response packets to tracing path 322 based on the packet type. Tracing path 322 can decrement the TTL value in the header and append tracing information 356 associated with the reverse direction to the payload of the response packet. Information 356 may include ['Switch 112', 'MAC address 330', 'Port 372']. Therefore, the dictionary in the response packet can be {'Forward': [Information 302, Information 304, Information 352]}; {'Reverse': [Information 354, Information 356]}. Based on the local forwarding table, switch 112 can send response packets to switch 103 via port 334.
[0098] Switch 103 can receive response packets via port 332 and provide response packets to tracing path 160 based on packet type. Tracing path 160 can append tracing information 302 associated with the reverse direction to the payload of the response packet. Therefore, the dictionary in the response packet can be {'forward': [information 302, information 304, information 352]}; {'reverse': [information 354, information 356, information 302]}. Here, [information 354, information 356, information 302] can represent reverse tracing information 360. Furthermore, since switch 118 may not participate in the tracing process, [information 302, information 304, information 352] can represent forward tracing information 350 and can indicate the tracing segment of the path to switch 118.
[0099] Since the destination MAC address 170 of the response packet is a local address, tracing path 160 can terminate the forwarding of the response packet. If switch 103 does not receive a response packet from switch 118, tracing path 160 can resend the tracing packet to switch 118 a predetermined number of times. If no response packet is received from switch 118 after the retry, tracing path 160 can determine that switch 118 (i.e., the device associated with MAC address 164) does not support the tracing path. Tracing path 160 can then consider the forward tracing information 350 and the reverse tracing information 360 as the final trace of MAC address 164. Tracing path 160 can then store the forward tracing information 350 and the reverse tracing information 360 in tracing table 200 in association with MAC address 164.
[0100] Figure 4A A flowchart illustrating the process by which an originating device issues a Layer 2 path tracing packet according to aspects of this application is presented. During operation, the device may receive instructions for issuing a tracing path command for a target device (operation 402). The device may determine the egress port associated with the target device (operation 404) and determine the tracing information associated with the local device (operation 406). The tracing information may include the hostname, MAC address, and port identifier associated with the tracing packet. The device may then generate a Layer 2 tracing packet with a Layer 2 header (operation 408) and set the Layer 2 address of the target device as the destination address in the header (operation 410).
[0101] The device can then set the packet type to indicate a tracking packet and set an indicator to indicate forward tracking (operation 412). The device can also set the TTL value in the header based on an initial TTL value (operation 414). The initial TTL can be predetermined (e.g., based on a default value or a configuration value). The device can then include tracking information associated with the forward direction in the payload (operation 416). The tracking information can include tracking information in a dictionary data structure with an index indicating "forward". The device can then forward the tracking packet via the egress port (operation 418).
[0102] Figure 4BA flowchart illustrating the process by which a target device according to an aspect of this application processes Layer 2 path tracking packets is presented. During operation, the device may receive Layer 2 tracking packets destined for the local device via an ingress port (operation 452). The device may then determine whether it locally supports the tracking path (operation 454). If the local device does not support the tracking path, it may discard the packet (operation 474). On the other hand, if the local device supports the tracking path, it may identify the received packet as a tracking packet based on the packet type in the header (operation 456) and determine the forward tracking information associated with the local device (operation 458). The device may then append the forward tracking information associated with the forward direction to the payload (operation 460).
[0103] The device can then exchange the source and destination addresses in the header to generate a response packet (operation 462). The device can determine the egress port associated with the destination address (operation 464) and determine the reverse tracing information associated with the local device (operation 466). The forward and reverse tracing information can be tracing information for the forward and reverse tracing paths, respectively. The device can then append the reverse tracing information associated with the reverse direction to the payload (operation 468). The device can set the TTL value in the header based on the initial TTL value (operation 470). The device can then forward the response packet via the egress port corresponding to the destination address (operation 472).
[0104] Figure 5 A flowchart illustrating the process by which an intermediate device processes Layer 2 path tracing packets according to aspects of this application is presented. During operation, the device may receive Layer 2 tracing packets destined for a remote device via an ingress port (operation 502). The device may then determine whether it locally supports tracing paths (operation 504). If it locally supports tracing paths, the device may identify the received packet as a tracing packet based on the packet type in the header (operation 506) and determine the local tracing information associated with the local device (operation 508).
[0105] The device can then append local tracking information associated with the forward direction to the payload (operation 510). The device can then decrement the TTL value in the header (operation 512). If the tracking path is not supported locally (operation 504) or the TTL value has been decremented in the header (operation 512), the device can forward the tracking packet via the egress port corresponding to the destination address (operation 514). The device can check whether reverse tracking is enabled for intermediate devices (operation 516).
[0106] If reverse tracing is enabled for an intermediate device, the device can generate a copy of the tracing packet as a response packet and set a direction indicator to indicate reverse tracing (operation 518). The device can set the Layer 2 addresses of the originating device and the local device to the source address and destination address, respectively, in the header (operation 520). The device can append local tracing information associated with the reverse direction to the payload (operation 522). The device can set the TTL value in the header based on the initial TTL value (operation 524). The device can then forward the response packet via the egress port corresponding to the destination address (operation 526).
[0107] Figure 6 An example of a switch with Layer 2 path tracing support according to aspects of this application is illustrated. In this example, switch 600 may include multiple communication ports 602, packet processor 610, and storage device 650. Switch 600 may also include switch hardware 660 (e.g., processing hardware of switch 600, such as its application-specific integrated circuit (ASIC) chip), which includes information based on which switch 600 processes the packet (e.g., determining the output port used for the packet). Packet processor 610 extracts and processes header information from received packets. Packet processor 610 may identify a switch identifier (e.g., MAC address and / or IP address) associated with switch 600 in the packet header.
[0108] Communication port 602 may include an inter-switch communication channel for communicating with other switches and / or user equipment. The communication channel may be implemented via a conventional communication port and based on any open or proprietary format. Communication port 602 may include one or more Ethernet ports capable of receiving frames encapsulated in Ethernet headers. Communication port 602 may also include one or more IP ports capable of receiving IP packets. The IP ports are capable of receiving IP packets and may be configured with IP addresses. Packet processor 610 can process Ethernet frames and / or IP packets. The corresponding ports of communication port 602 can operate as ingress ports and / or egress ports.
[0109] Switch 600 may maintain database 652 (e.g., in storage device 650). Database 652 may be a relational database and may run on one or more database management system (DBMS) instances. Database 652 may store information associated with the routing, configuration, and interfaces of switch 600. Switch 600 may include tracing path logic block 630, which facilitates tracing path instances on switch 600. Tracing path logic block 630 may include forward logic block 632, reverse logic block 634, and intermediate logic block 636.
[0110] Forward logic block 632 allows switch 600 to operate as the originating device for forward tracing using a tracing path. To this end, forward logic block 632 can issue Layer 2 path tracing packets, such as in conjunction with... Figure 4A As described, the reverse logic block 634 allows the switch 600 to operate as a target device for reverse tracing using a tracing path. To this end, the reverse logic block 634 can process Layer 2 path tracing packets and initiate reverse tracing, as in conjunction with... Figure 4B As described, intermediate logic block 636 allows switch 600 to operate as an intermediate device for tracing using a tracing path. To this end, intermediate logic block 636 can continue forward tracing and initiate reverse tracing, as in combination with... Figure 5 As described.
[0111] Figure 7 An example of a computer system with Layer 2 path tracing support according to one aspect of this application is illustrated. The computer and communication system 700 includes a processor 702, a memory device 704, and a storage device 708. The memory device 704 may include a volatile memory device (e.g., a dual in-line memory module (DIMM)). Furthermore, the computer and communication system 700 may be coupled to a display device 710, a keyboard 712, and a pointing device 714. The storage device 708 may store an operating system 716, a Layer 2 path tracing system 718, and data 736. The Layer 2 path tracing system 718 can facilitate tracing path instances on the computer and communication system 700.
[0112] The Layer 2 path tracing system 718 may include instructions that, when executed by the computer and communication system 700, cause the computer and communication system 700 to perform the methods and / or processes described in this disclosure. Specifically, the Layer 2 path tracing system 718 may include instructions for issuing Layer 2 path tracing packets (forward logic block 720). The Layer 2 path tracing system 718 may also include instructions for processing Layer 2 path tracing packets and initiating reverse tracing (reverse logic block 722). Furthermore, the Layer 2 path tracing system 718 may include instructions for continuing forward tracing and initiating reverse tracing (intermediate logic block 724).
[0113] The Layer 2 path tracing system 718 may also include instructions (communication logic block 734) for sending and receiving messages such as tracking packets and response packets. Data 736 may include any data that may facilitate the operation of the Layer 2 path tracing system 718. Data 736 may include, but is not limited to, tracking information associated with the computer and communication system 700.
[0114] The data structures and code described in this detailed description are typically stored on a computer-readable storage medium, which can be any device or medium capable of storing code and / or data for use by a computer system. Computer-readable storage media include, but are not limited to, volatile memory, non-volatile memory, magnetic and optical storage devices such as magnetic disks, magnetic tapes, CDs (compressed discs), DVDs (digital versatile discs or digital video discs), or other media capable of storing computer-readable media now known or hereafter developed.
[0115] The methods and processes described in the detailed description section may be embodied in code and / or data, which may be stored in a computer-readable storage medium as described above. When a computer system reads and executes the code and / or data stored on the computer-readable storage medium, the computer system executes the methods and processes embodied in data structures and code and stored within the computer-readable storage medium.
[0116] The methods and processes described herein may be executed by and / or included in hardware modules or devices. These modules or devices may include, but are not limited to, application-specific integrated circuit (ASIC) chips, field-programmable gate arrays (FPGAs), dedicated or shared processors that execute specific software modules or pieces of code at specific times, and / or other programmable logic devices now known or developed later. When the hardware modules or devices are activated, they execute the methods and processes included therein.
[0117] The foregoing description of embodiments of the invention has been presented for illustrative and descriptive purposes only. It is not intended to be exhaustive or limiting of this disclosure. Therefore, many modifications and variations will be apparent to those skilled in the art. The scope of the invention is defined by the appended claims.
Claims
1. A method comprising: The originating device sends a Layer 2 tracking packet with a packet type in the Layer 2 header of the Layer 2 tracking packet, wherein the packet type indicates that the Layer 2 tracking packet is a packet for Layer 2 path tracking; Along the path to the target device of the Layer 2 tracking packet, a Layer 2 response packet is received from the corresponding participating device, wherein the participating device supports the Layer 2 path tracking; The payload of the Layer 2 response packet yields tracking information associated with the forward path from the Layer 2 tracking packet to the participating device and the reverse path from the Layer 2 response packet to the participating device, wherein the tracking information in the Layer 2 response packet identifies multiple Layer 2 devices along the forward path and the reverse path, and wherein the tracking information includes multiple Layer 2 addresses that respectively identify the multiple Layer 2 devices. as well as Based on the tracking information, a Layer 2 path tracing, including at least the plurality of Layer 2 addresses, is determined between the originating device and the target device.
2. The method of claim 1, wherein the Layer 2 tracking packet and the Layer 2 response packet are associated with a Virtual Local Area Network (VLAN), and wherein the identified plurality of Layer 2 devices belong to the VLAN.
3. The method of claim 1, wherein for a corresponding Layer 2 device among the identified plurality of Layer 2 devices, the tracking information further includes one or more of the following: a port identifier and a hostname.
4. The method according to claim 1, further comprising: The Layer 2 tracking packets are encapsulated in a tunnel header associated with a tunnel between the originating device and the remote endpoint, wherein the tunnel is formed based on a tunneling protocol.
5. The method of claim 4, wherein the tracking information indicates the tunnel as a layer 2 jump.
6. The method according to claim 1, further comprising: The departure time (TTL) value is set in the header based on a predetermined initial value, wherein the initial value indicates the number of layer 2 hops to be tracked, and wherein the TTL value is decremented at the corresponding participating device.
7. The method according to claim 6, further comprising: The participating device receives the Layer 2 response packet from the participating device whose TTL value has reached its expiration value, wherein the Layer 2 response packet includes an indicator indicating that the TTL value has reached the expiration value.
8. The method according to claim 1, further comprising: The Layer 2 address of the target device is set as the destination address of the Layer 2 tracking packet, wherein the destination address is not modified for the Layer 2 tracking packet at the corresponding Layer 2 hop.
9. The method of claim 1, wherein the direction indicator in the layer 2 tracking packet indicates the forward direction of the target device, and wherein the direction indicator in the layer 2 response packet indicates the reverse direction of the originating device.
10. The method of claim 1, wherein the forward path and the reverse path include one or more non-participating devices that do not support the layer 2 path tracing, wherein the non-participating devices include one or more of the following: intermediate devices and the target device.
11. A non-transitory computer-readable storage medium storing instructions that, when executed by a computer, cause the computer to perform a method, the method comprising: A Layer 2 tracking packet with a packet type is sent from the originating device, the packet type being in the Layer 2 header of the Layer 2 tracking packet, wherein the packet type indicates that the Layer 2 tracking packet is a packet for Layer 2 path tracking; On the path to the target device of the Layer 2 tracking packet, a Layer 2 response packet is received from the corresponding participating device, wherein the participating device supports the Layer 2 path tracking; The payload of the Layer 2 response packet yields tracking information associated with the forward path from the Layer 2 tracking packet to the participating device and the reverse path from the Layer 2 response packet to the participating device, wherein the tracking information in the Layer 2 response packet identifies multiple Layer 2 devices along the forward path and the reverse path, and wherein the tracking information includes multiple Layer 2 addresses that respectively identify the multiple Layer 2 devices. as well as Based on the tracking information, a Layer 2 path tracing, including at least the plurality of Layer 2 addresses, is determined between the originating device and the target device.
12. The non-transitory computer-readable storage medium of claim 11, wherein the Layer 2 tracking packet and the Layer 2 response packet are associated with a Virtual Local Area Network (VLAN), and wherein the plurality of Layer 2 devices identified belong to the VLAN.
13. The non-transitory computer-readable storage medium of claim 11, wherein, for a corresponding Layer 2 device among the identified plurality of Layer 2 devices, the tracking information further includes one or more of the following: a port identifier and a hostname.
14. The non-transitory computer-readable storage medium of claim 11, wherein the method further comprises: The Layer 2 tracking packet is encapsulated in a tunnel header associated with a tunnel between the originating device and the remote endpoint, wherein the tunnel is formed based on a tunneling protocol, and wherein the tracking information indicates the tunnel as a Layer 2 hop.
15. The non-transitory computer-readable storage medium of claim 11, wherein the method further comprises: The departure time (TTL) value is set in the header based on a predetermined initial value, wherein the initial value indicates the number of layer 2 hops to be tracked, and wherein the TTL value is decremented at the corresponding participating device.
16. The non-transitory computer-readable storage medium of claim 15, wherein the method further comprises: The participating device receives the Layer 2 response packet from the participating device whose TTL value has reached its expiration value, wherein the Layer 2 response packet includes an indicator indicating that the TTL value has reached the expiration value.
17. The non-transitory computer-readable storage medium of claim 11, wherein the method further comprises: The layer 2 address of the target device is set as the destination address of the layer 2 tracking packet, wherein the destination address is not modified for the layer 2 tracking packet at the corresponding layer 2 hop.
18. The non-transitory computer-readable storage medium of claim 11, wherein the direction indicator in the layer 2 tracking packet indicates a forward direction to the target device, and wherein the direction indicator in the layer 2 response packet indicates a reverse direction to the originating device.
19. The non-transitory computer-readable storage medium of claim 11, wherein the forward path and the reverse path include one or more non-participating devices that do not support the layer 2 path tracing, wherein the non-participating devices include one or more of the following: intermediate devices and the target device.
20. A computer system, comprising: At least one processing resource; as well as Storage device, storing instructions executable by the at least one processing resource to: Send a Layer 2 tracking packet with a packet type in the Layer 2 header of the Layer 2 tracking packet, wherein the packet type indicates that the Layer 2 tracking packet is a packet for Layer 2 path tracking; Receive a Layer 2 response packet from a corresponding participating device on the path to the target device of the Layer 2 tracking packet, wherein the participating device supports Layer 2 path tracking; The payload of the Layer 2 response packet yields tracking information associated with the forward path from the Layer 2 tracking packet to the participating device and the reverse path from the Layer 2 response packet to the participating device, wherein the tracking information in the Layer 2 response packet identifies multiple Layer 2 devices along the forward path and the reverse path, and wherein the tracking information includes multiple Layer 2 addresses that respectively identify the multiple Layer 2 devices. as well as Based on the tracking information, a Layer 2 path tracing, including at least the plurality of Layer 2 addresses, is determined between the originating device and the target device.
Citation Information
Patent Citations
Detection method and device of service path
CN102437931A
Traceroute for multi-path routing
CN108667681A