CN109347670B - Path tracking method and device, electronic equipment and storage medium - Google Patents

Path tracking method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN109347670B
CN109347670B CN201811244349.4A CN201811244349A CN109347670B CN 109347670 B CN109347670 B CN 109347670B CN 201811244349 A CN201811244349 A CN 201811244349A CN 109347670 B CN109347670 B CN 109347670B
Authority
CN
China
Prior art keywords
path
message
virtual host
virtual
physical
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201811244349.4A
Other languages
Chinese (zh)
Other versions
CN109347670A (en
Inventor
田钧宇
郭东侠
曾珍
韩广宇
刘思婷
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hangzhou Dt Dream Technology Co Ltd
Original Assignee
Hangzhou Dt Dream Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hangzhou Dt Dream Technology Co Ltd filed Critical Hangzhou Dt Dream Technology Co Ltd
Priority to CN201811244349.4A priority Critical patent/CN109347670B/en
Publication of CN109347670A publication Critical patent/CN109347670A/en
Application granted granted Critical
Publication of CN109347670B publication Critical patent/CN109347670B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/06Management of faults, events, alarms or notifications
    • H04L41/0631Management of faults, events, alarms or notifications using root cause analysis; using analysis of correlation between notifications, alarms or events based on decision criteria, e.g. hierarchy, tree or time analysis

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The application provides a path tracking method and device, an electronic device and a computer readable storage medium, wherein the path tracking method is applied to a physical node and can comprise the following steps: receiving a path tracking message sent by a virtual host configured on any physical node, wherein the path tracking message is used for acquiring address information of the virtual host on a transmission path between the virtual host and a target virtual host; judging whether a tracking target of the path tracking message is a next virtual host located on the physical node on the transmission path; and when the tracking target is the next virtual host, determining a physical output interface for forwarding the path tracking message to the next virtual host, and returning address information of the physical output interface to the virtual host.

Description

Path tracking method and device, electronic equipment and storage medium
Technical Field
The present application relates to the field of communications technologies, and in particular, to a path tracking method and apparatus, an electronic device, and a storage medium.
Background
Traceroute is a conventional network analysis tool that can be used to locate all network nodes from a host to a target host. By utilizing the characteristic, when the network fails, the faults can be eliminated through traceroute. For example, the entire path of a packet as it is transmitted over the network may be traced for troubleshooting the network.
Disclosure of Invention
In view of the above, the present application provides a path tracking method and apparatus, an electronic device, and a computer-readable storage medium.
In order to achieve the above purpose, the present application provides the following technical solutions:
according to a first aspect of the present application, a path tracing method is provided, which is applied to a physical node; the method comprises the following steps:
receiving a path tracking message sent by a virtual host configured on any physical node, wherein the path tracking message is used for acquiring address information of the virtual host on a transmission path between the virtual host and a target virtual host;
judging whether a tracking target of the path tracking message is a next virtual host located on the physical node on the transmission path;
and when the tracking target is the next virtual host, determining a physical output interface for forwarding the path tracking message to the next virtual host, and returning address information of the physical output interface to the virtual host.
According to a second aspect of the present application, a path tracking apparatus is provided, which is applied to a physical node; the device comprises:
the virtual host comprises a message receiving unit, a path tracing unit and a path tracing unit, wherein the message receiving unit is used for receiving a path tracing message sent by a virtual host configured on any physical node, and the path tracing message is used for acquiring address information of the virtual host on a transmission path between the virtual host and a target virtual host;
the judging unit is used for judging whether a tracking target of the path tracking message is the next virtual host located at the physical node on the transmission path;
and an interface determining unit, configured to determine, when the tracking target is the next virtual host, a physical outgoing interface used for forwarding the path tracking packet to the next virtual host, and return address information of the physical outgoing interface to the virtual host.
According to a third aspect of the present application, there is provided an electronic device comprising:
a processor;
a memory for storing processor-executable instructions;
wherein the processor implements the method as in any of the above embodiments by executing the executable instructions.
According to a fourth aspect of embodiments of the present disclosure, there is provided a computer-readable storage medium having stored thereon computer instructions which, when executed by a processor, implement the steps of the method as in any one of the above-mentioned embodiments.
According to the technical scheme, when the scheme of acquiring the address of the virtual host on the transmission path based on path tracking is implemented, the path tracking message is sensed by each physical node, and the address of the physical output interface for forwarding the path tracking message to the next virtual host is returned, so that the address of each physical output interface on the transmission path can be acquired under the condition that the address of the virtual host on the tracking transmission path is not influenced, the acquired address information on the transmission path is more comprehensive, and the error elimination of the transmission process is facilitated when a network fails.
Drawings
Fig. 1 is a schematic diagram of a cloud computing network according to an exemplary embodiment of the present application.
Fig. 2 is a flow chart illustrating a path tracking method according to an exemplary embodiment of the present application.
Fig. 3A to 3C are schematic diagrams illustrating a path tracing based on a traceroute packet according to an exemplary embodiment of the present application.
Fig. 4 is a flowchart illustrating a virtual switch device processing a traceroute message according to an exemplary embodiment of the present application.
Fig. 5 is a flowchart illustrating a virtual host processing a traceroute message according to an exemplary embodiment of the present application.
Fig. 6 is a schematic diagram illustrating path tracking based on a cloud computing network according to an exemplary embodiment of the present application.
Fig. 7 is a schematic structural diagram of an electronic device according to an exemplary embodiment of the present application.
Fig. 8 is a block diagram of a path tracking device according to an exemplary embodiment of the present application.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present application, as detailed in the appended claims.
The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. As used in this application and the appended claims, the singular forms "a", "an", and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and/or" as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items.
It is to be understood that although the terms first, second, third, etc. may be used herein to describe various information, such information should not be limited to these terms. These terms are only used to distinguish one type of information from another. For example, first information may also be referred to as second information, and similarly, second information may also be referred to as first information, without departing from the scope of the present application. The word "if" as used herein may be interpreted as "at … …" or "when … …" or "in response to a determination", depending on the context.
Compared with a conventional network, a cloud computing network is divided into an on-cloud network (overlay) and an off-cloud network (underlay). The off-cloud network is configured on corresponding entity equipment, such as a switch, a router and a server; the on-Cloud Network is a Virtual Private Cloud (VPC) customized by a client, for example, resource configurations such as a Virtual machine, nfv (Network Function Virtualization) and the like applied in Cloud computing, and an on-Cloud address can be customized by the client.
In the related art, as shown in fig. 1, both the Vm1(10.159.0.1) and Vm2(10.159.0.2) are within the same subnet 10.159.0.0/24, Vm1 is located on physical node 11(100.0.0.1), and Vm2 is located on physical node 12 (100.0.0.2). The result of Vm1 tracing the Vm2 path based on traceroute is 10.159.0.2. As can be seen, because the traceroute cannot track the IP addresses (belonging to the addresses under the cloud) of the physical node 11 and the physical node 12, when the virtual hosts cannot communicate with each other, the addresses tracked by the traceroute are not comprehensive enough, and an administrator cannot judge whether the physical node is in a problem, so that accurate debugging cannot be performed.
Therefore, the present application solves the above technical problems in the related art by improving a path tracing method in the related art.
Referring to fig. 2, fig. 2 is a flowchart illustrating a path tracking method according to an exemplary embodiment of the present application. As shown in fig. 2, the method applied to a physical node (such as a server) may include the following steps:
step 202, receiving a path tracing message sent by a virtual host configured on any physical node, where the path tracing message is used to obtain address information of the virtual host on a transmission path between the virtual host and a destination virtual host.
In this embodiment, the virtual host is configured on the physical node, and a path (i.e., a transmission path) for transmitting data between the virtual host and the destination virtual host can be detected by sending a path trace message to the destination virtual host. As an exemplary embodiment, the virtual host may send a traceroute message To a destination virtual host based on a User Datagram Protocol (UDP), manipulate a Time To Live (TTL) of the traceroute message and observe return information when the traceroute message is discarded, and may acquire all addresses (e.g., IP addresses of a router, a gateway, a virtual host, a physical node, and the like) on a transmission path between the virtual host and the destination virtual host. For example, when any virtual host receives a traceroute message (in the case of a UDP message) and the TTL of the traceroute message is 1, if the virtual host is the destination virtual host, a UDP port unreachable message is returned to notify that the traceroute message sent by the sender of the traceroute message has reached the destination virtual host and the IP address of the destination virtual host. Otherwise, returning an ICMP overtime message to the sender of the traceroute message, so that the sender of the traceroute message acquires the IP address of the sender.
Of course, the tracking process may also be implemented based on an ICMP (Internet Control Message Protocol). For example, unlike the above UDP-based interaction, the vm sends an ICMP echo request (echo request) message (including TTL). After receiving the ICMP echo request message (for the case of TTL ═ 1), if the other vm is the destination vm, returning an ICMP echo reply (echo reply) message to notify that the traceroute message sent by the sender of the traceroute message has reached the destination vm and the IP address of the destination vm; otherwise, returning an ICMP overtime message to the sender of the traceroute message, so that the sender of the traceroute message acquires the IP address of the sender.
Step 204, determining whether the tracking target of the path tracking packet is the next virtual host located on the physical node on the transmission path.
In this embodiment, a virtual switch device is configured on a physical node. When the virtual switching equipment forwards the path tracking message, the time-to-live value of the path tracking message is not modified; when the virtual host forwards the path tracking message, the time-to-live value of the path tracking message is modified. In other words, the virtual switch device simply "senses" the path trace packet, does not perform any processing on the path trace packet, and still forwards the path trace packet in the original manner. As for the virtual host, according to the principle of detecting a path by using a path trace message in the related art, when the path trace message received by the virtual host is not the last hop, the virtual host needs to forward the path trace message to the next hop, and before forwarding, the lifetime value of the path trace message needs to be modified to indicate that the path trace message goes through one hop again. It should be noted that, in the present application, when the virtual switch device forwards the path trace packet, the lifetime value of the path trace packet is not modified, and the "next hop" mentioned in the description does not include forwarding by the virtual switch device. Then, when determining whether the trace target of the path trace packet is the next virtual host located in the physical node on the transmission path, the virtual switching device may determine whether the lifetime value of the path trace packet indicates that the next hop of the path trace packet is the last hop. In other words, when the virtual switch device determines that the time to live value of the path trace packet indicates that the next hop of the path trace packet is the last hop, it may be determined that the trace target of the path trace packet is the next virtual host located on the physical node on the transmission path.
Further, after the address information of the physical outgoing interface is returned, the path tracking packet may be forwarded to the next virtual host through the physical outgoing interface, so that the next virtual host returns the address information of itself to the virtual host.
Taking traceroute as an example for explanation, in one case, when a virtual switch device receives a traceroute message, if TTL (which can be understood as an effective skip count) of the traceroute message is 1, it is necessary to return to a corresponding off-cloud address and continue to forward the traceroute message; and, the TTL of the traceroute message is not modified. Otherwise, the traceroute message is directly forwarded (similarly, the TTL of the traceroute message is not modified). In another case, when the virtual host receives a traceroute message, if the TTL of the traceroute message is 1, the virtual host needs to return to a corresponding on-cloud path and subtract 1 from the TTL, and since the TTL is modified to 0, the virtual host does not need to continue forwarding the traceroute message; otherwise, subtracting 1 from TTL and then forwarding the traceroute message.
Step 206, when the tracking target is the next vm, determining a physical outgoing interface for forwarding the path tracking packet to the next vm, and returning address information of the physical outgoing interface to the vm.
In this embodiment, a virtual switch device may be configured on a physical node for transmitting data. In other words, the path trace packet sent by the virtual host configured on any physical node may be received by the virtual switch device configured on the physical node. Then upon determining the physical egress interfaces for forwarding the path trace packet to the next vm, a physical egress interface of the physical interfaces bound to the virtual switch device for forwarding the path trace packet to the next vm may be searched.
In this embodiment, when the address information of the physical outbound interface is returned to the virtual host, the virtual host (i.e., the sender of the path tracking packet) may be notified of the address information of the found physical outbound interface (i.e., the address under the cloud) through a timeout packet. As an exemplary embodiment, the address information of the physical outgoing interface may be used as a source address to generate a timeout message, and then the generated timeout message is returned to the virtual host.
In this embodiment, in one case, the path trace message is from a virtual host configured on the path trace message itself; in another case, the path trace message is from a virtual host configured on another physical node different from the path trace message. The path trace packet may be a traceroute packet, and a UDP port number of the path trace packet is greater than 30000, and UDP port numbers of the path trace packets are the same. By setting the UDP port number of the path trace packet to be greater than 30000 and keeping the UDP port number unchanged, the path trace packet can be distinguished from other packets (including other types of packets and traceroute packets in the prior art) for identification by the virtual switching device and the virtual host.
According to the technical scheme, when the scheme of acquiring the address of the virtual host on the transmission path based on path tracking is implemented, the path tracking message is sensed by each physical node, and the address of the physical output interface for forwarding the path tracking message to the next virtual host is returned, so that the address of each physical output interface on the transmission path can be acquired under the condition that the address of the virtual host on the tracking transmission path is not influenced, the acquired address information on the transmission path is more comprehensive, and the error elimination of the transmission process is facilitated when a network fails.
For ease of understanding, the path tracking scheme of the present application is described in detail below with reference to specific scenarios and examples.
The following describes a process of performing path tracing based on traceroute packet with reference to fig. 3A to 3C. The client 30 obtains the IP addresses of the routers 31 to 32 and the server 33 on the transmission path by sending a traceroute message carrying TTL to the server 33. The server 33 returns an ICMP error message with an unreachable port after receiving the traceroute message from the client 30, and the client 30 can determine whether the traceroute message reaches the destination host by determining whether the TTL is over time or the port is unreachable. The above process is described in detail in the order in which the client 30 sends traceroute messages to the server 33.
As shown in fig. 3A, the client 30 sends a traceroute message with TTL of 1, port number greater than 30000, and destination address as the IP address of the server 33, the TTL of the traceroute message is subtracted by 1 after the traceroute message reaches the first hop router 31, and the first hop router 31 returns an ICMP timeout message (including the IP address of the first hop router 31), so that the client 30 obtains the IP address of the first hop router 31.
As shown in fig. 3B, the client 30 sends a traceroute message with TTL of 2, port number greater than 30000, and destination address as the IP address of the server 33. Similarly, the traceroute message times out after reaching the second-hop router 32, and the client 30 obtains the IP address of the second-hop router 32.
As shown in fig. 3C, the client 30 sends a traceroute message with TTL of 3, port number greater than 30000, and destination address as the IP address of the server 33. Similarly, the traceroute message successfully reaches the server 33 (i.e. the destination host), and the server 33 returns the ICMP message with the unreachable port (including the IP address of the server 33) to the client 30, so that the client 30 obtains the IP address of the server 33.
Based on the principle of traceroute message path tracing, the path tracing scheme of the present application is described in detail below with reference to fig. 4 to 7.
Referring to fig. 4, fig. 4 is a flowchart illustrating a virtual switch device processing a traceroute message according to an exemplary embodiment of the present application. As shown in fig. 4, the method applied to a virtual switch device configured on a physical node (such as a server) may include the following steps:
step 402, identify traceroute message.
In this embodiment, a traceroute message different from the original traceroute message may be constructed, a UDP port of the newly constructed traceroute message is a port number greater than 30000, and the virtual host in this application adopts the same port number each time the traceroute message is sent (in the prior art, the UDP port number of the traceroute message sent by the virtual host each time is randomly selected, that is, is not necessarily the same each time). The fixed and unchangeable UDP port number is selected by the application, an administrator can flexibly set the UDP port number according to actual conditions, and the application does not limit the UDP port number.
For example, a traceroute message may be constructed that contains:
User Datagram Protocol,Scr Port:38568,Dst Port:33000
Source Port:38568
Destination Port:33000
then, the virtual host can trace the transmission path with the destination virtual host by sending the newly constructed traceroute message. And the virtual switching device on the physical node can identify the traceroute message through the UDP port number. The virtual switch device may be a virtual device such as an OVS (Open vSwitch, Open virtual switch standard) or a linux bridge. Of course, any other type of virtual device may be used, and the present application is not limited thereto.
Step 404, if the TTL of the identified traceroute message is 1, go to step 406; otherwise, go to step 410.
Step 406, find the physical outgoing interface in the physical node for forwarding the traceroute packet.
Step 408, returning ICMP overtime message to the sender of the traceroute message.
In this embodiment, at least one physical interface is pre-bound in the virtual switch device for forwarding data. When the virtual switch device receives a traceroute message (which needs to be forwarded) containing TTL ═ 1, a physical outgoing interface used for forwarding the traceroute message to the next virtual host in the bound physical interfaces is determined, and an IP address of the physical outgoing interface is returned to a sender of the traceroute message (in this embodiment, the virtual host sending the traceroute message), so that the sender can obtain an address under the cloud on a transmission path between the sender and a destination virtual machine, and the error removal of the transmission process is facilitated when a network fails.
Further, the IP address of the physical egress interface may be returned via an ICMP timeout message. For example, the IP address of the physical egress interface may be used as the source IP address of the ICMP timeout message.
And step 410, continuing to forward the traceroute message.
In this embodiment, the accepting step 404 is performed, and when the TTL of the identified traceroute message is not equal to 1, which indicates that the traceroute message is not overtime, the traceroute message is continuously forwarded to the next vm. In step 408, when the virtual switch device returns an ICMP timeout message to the traceroute message sender, the traceroute message is forwarded to the next vm. It should be noted that the virtual switch device only "senses" the traceroute packet, does not modify the TTL of the traceroute packet, and still forwards the traceroute packet according to the original manner. By means of the method of sensing the traceroute message and returning the traceroute message to the corresponding physical output interface (namely the corresponding under-cloud address), the influence on the virtual host for processing the traceroute message can be avoided, namely the virtual host can process the traceroute message according to the existing method. It should be noted that, in the process of continuously forwarding the traceroute message to the next vm, the next object receiving the traceroute message may be a virtual switch device or a vm, which will be described below by way of example.
Referring to fig. 5, fig. 5 is a flowchart illustrating a virtual host processing a traceroute message according to an exemplary embodiment of the present application. As shown in fig. 5, the method is applied to a virtual host configured on a physical node (such as a server), and may include the following steps:
step 502, identify a traceroute message.
In this embodiment, the form of the traceroute message is similar to that in the step 402, and is not described herein again.
Step 504, if the TTL of the identified traceroute message is 1, go to step 506; otherwise, go to step 510.
Step 506, discarding the identified traceroute message.
And step 508, returning ICMP overtime message to the sender of the traceroute message.
In this embodiment, when the TTL of the traceroute message received by the virtual host is 1, it indicates that the traceroute message is overtime, that is, the corresponding on-cloud path (i.e., the own IP address) needs to be returned. Therefore, the virtual host may discard the identified traceroute message, and return a corresponding ICMP timeout message (including its own IP address) to a sender of the traceroute message (in this embodiment, the virtual host that sends the traceroute message), so that the sender may obtain an address on the cloud on a transmission path between the sender and the destination virtual machine, which is helpful for debugging the transmission process when the network fails. It should be noted that, when the virtual host receives the traceroute message, if the virtual host is the destination virtual host corresponding to the traceroute message (that is, the IP address of the virtual host is the destination IP address of the traceroute message), the virtual host returns a port unreachable message to notify that the traceroute message sent by the sender of the traceroute message has reached the destination virtual host and the IP address of the destination virtual host.
And step 510, continuing to forward the traceroute message.
In this embodiment, when the TTL of the traceroute message received by the virtual host is not 1, which indicates that the traceroute message is not time out, the TTL is decreased by 1, and then the traceroute message is forwarded. When the virtual host is the destination virtual host which receives the traceroute message (that is, the destination IP address of the message is the IP address of the virtual host), an ICMP message (including its own IP address) whose port is not reachable is returned to the sender of the traceroute message to inform the sender that the traceroute message has reached the destination virtual host and inform the sender of its own IP address.
For example, as shown in FIG. 6, both VM1(10.159.0.1) and VM2(10.159.0.2) are within the same subnet 10.159.0.0/24, Vm1 is located on physical node 11(100.0.0.1), and Vm2 is located on physical node 12 (100.0.0.2). The Vm1 sends traceroute messages with the destination IP address 10.159.0.2 successively.
Then, after the Vm1 sends a traceroute message, the virtual switch device 111 on the physical node 11 receives and identifies the traceroute message by using the UDP port number 33000, and further determines whether the TTL is 1. When the TTL is 1, traversing all bound physical interfaces to find a physical outgoing interface eth0 for forwarding the traceroute message, and then taking an IP address 100.0.0.1 of the physical outgoing interface (at this time, it is assumed that the physical node 11 allocates an IP address 100.0.0.1 to the physical outgoing interface eth0) as a source IP address to assemble an ICMP timeout message and return the ICMP timeout message to the Vm1, so that the Vm1 receives the ICMP timeout message, and obtains an IP address of the physical node 11 (i.e., an IP address of a physical outgoing interface used by the physical node 11 for transmitting data with the destination Vm 2) which is 100.0.0.1. And, the virtual switch device 111 forwards the traceroute packet with TTL of 1 (without modifying the value of TTL) in the original manner.
Similarly, when receiving the traceroute message, the virtual switch device 121 on the physical node 12 identifies the traceroute message by using the UDP port number 33000, and further determines whether the TTL is 1. When the TTL is 1, traversing all bound physical interfaces to find a physical outgoing interface eth1 for forwarding the traceroute message, and then taking an IP address 100.0.0.2 of the physical outgoing interface (at this time, it is assumed that the physical node 12 allocates the IP address 100.0.0.2 to the physical outgoing interface eth1) as a source IP address to assemble an ICMP timeout message and return the ICMP timeout message to the Vm1, so that the Vm1 receives the ICMP timeout message, and obtains an IP address of the physical node 12 (i.e., an IP address of a physical outgoing interface used by the physical node 12 for transmitting data with the destination Vm 2) which is 100.0.0.2. And, the virtual switch device 121 forwards the traceroute packet with TTL of 1 (without modifying the value of TTL) in the original manner.
When Vm2 receives a traceroute message, the traceroute message is identified by the UDP port number 33000. Because the Vm2 is the destination Vm of Vm1, an ICMP message (including its own IP address 10.159.0.2) whose port is unreachable is returned to Vm1 to notify the IP address of the destination Vm of Vm1, thereby completing the traceroute process.
It should be noted that, the path tracing scheme of the present application is described above by taking an example in which two virtual hosts are located in the same subnet. The principle of path tracing is similar to that described above when two vms are in different subnets or when two vms are on the same physical node, and therefore, the detailed description is omitted.
According to the technical scheme, when the scheme of acquiring the address of the virtual host on the transmission path based on path tracking is implemented, the path tracking message is sensed by each physical node, and the address of the physical output interface for forwarding the path tracking message to the next virtual host is returned, so that the address of each physical output interface on the transmission path can be acquired under the condition that the address of the virtual host on the tracking transmission path is not influenced, the acquired address information on the transmission path is more comprehensive, and the error elimination of the transmission process is facilitated when a network fails.
Fig. 7 shows a schematic structural diagram of an electronic device according to an exemplary embodiment of the present application. Referring to fig. 7, at the hardware level, the electronic device includes a processor 702, an internal bus 704, a network interface 707, a memory 708, and a non-volatile storage 710, but may also include hardware required for other services. The processor 702 reads the corresponding computer program from the non-volatile memory 710 into the memory 708 and runs it, forming a path tracing apparatus on a logical level. Of course, besides the software implementation, the present application does not exclude other implementations, such as logic devices or a combination of software and hardware, and the like, that is, the execution subject of the following processing flow is not limited to each logic unit, and may also be hardware or logic devices.
Referring to fig. 8, in a software implementation, the path tracing apparatus applied to a physical node may include:
a message receiving unit 81, configured to receive a path trace message sent by a virtual host configured on any physical node, where the path trace message is used to obtain address information of the virtual host on a transmission path between the virtual host and a destination virtual host;
a determining unit 82, configured to determine whether a tracking target of the path tracking packet is a next virtual host located on the physical node on the transmission path;
an interface determining unit 83, configured to determine, when the trace target is the next vm, a physical outgoing interface used for forwarding the path trace packet to the next vm, and return address information of the physical outgoing interface to the vm.
Optionally, a virtual switching device is configured on the physical node;
the message receiving unit 81 is specifically configured to: receiving, by the virtual switching device, the path trace packet;
the interface determining unit 83 is specifically configured to: and searching a physical output interface which is bound with the virtual switching equipment and used for forwarding the path tracking message to the next virtual host.
Optionally, a virtual switching device is configured on the physical node; the determining unit 82 is specifically configured to:
judging whether the survival time value of the path tracking message indicates that the next hop of the path tracking message is the last hop by the virtual switching equipment;
when the virtual switching equipment forwards the path tracking message, the time-to-live value of the path tracking message is not modified; when the virtual host forwards the path tracking message, the time-to-live value of the path tracking message is modified.
Optionally, the interface determining unit 83 is specifically configured to:
taking the address information of the physical outgoing interface as a source address to generate an overtime message;
and returning the generated overtime message to the virtual host.
Optionally, the method further includes:
the message forwarding unit 84 forwards the path trace message to the next vm through the physical egress interface, so that the next vm returns its address information to the vm.
Optionally, the path tracing packet is from a virtual host configured on the path tracing packet itself; or the path tracing message comes from a virtual host configured on other physical nodes different from the path tracing message.
Optionally, the path tracing packet belongs to a traceroute packet, a UDP port number of the path tracing packet is greater than 30000, and UDP port numbers of the path tracing packets are the same.
The implementation process of the functions and actions of each unit in the above device is specifically described in the implementation process of the corresponding step in the above method, and is not described herein again.
For the device embodiments, since they substantially correspond to the method embodiments, reference may be made to the partial description of the method embodiments for relevant points. The above-described embodiments of the apparatus are merely illustrative, and the units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the scheme of the application. One of ordinary skill in the art can understand and implement it without inventive effort.
In an exemplary embodiment, there is also provided a non-transitory computer readable storage medium, for example a memory, comprising instructions executable by a processor of the path tracking device to perform a method as in any one of the above embodiments, such as the method may comprise:
receiving a path tracking message sent by a virtual host configured on any physical node, wherein the path tracking message is used for acquiring address information of the virtual host on a transmission path between the virtual host and a target virtual host;
judging whether a tracking target of the path tracking message is a next virtual host located on the physical node on the transmission path;
and when the tracking target is the next virtual host, determining a physical output interface for forwarding the path tracking message to the next virtual host, and returning address information of the physical output interface to the virtual host.
Optionally, a virtual switching device is configured on the physical node;
the receiving a path tracing packet sent by a virtual host configured on any physical node includes: receiving, by the virtual switching device, the path trace packet;
when the tracking target is the next virtual host, determining a physical outgoing interface for forwarding the path tracking packet to the next virtual host includes: and searching a physical output interface which is bound with the virtual switching equipment and used for forwarding the path tracking message to the next virtual host.
Optionally, a virtual switching device is configured on the physical node; the determining whether the tracking target of the path tracking packet is the next virtual host located on the physical node on the transmission path includes:
judging whether the survival time value of the path tracking message indicates that the next hop of the path tracking message is the last hop by the virtual switching equipment;
when the virtual switching equipment forwards the path tracking message, the time-to-live value of the path tracking message is not modified; when the virtual host forwards the path tracking message, the time-to-live value of the path tracking message is modified.
Optionally, the returning address information of the physical outgoing interface to the virtual host includes:
taking the address information of the physical outgoing interface as a source address to generate an overtime message;
and returning the generated overtime message to the virtual host.
Optionally, the method further includes:
and forwarding the path tracking message to the next virtual host through the physical outgoing interface so that the next virtual host returns the address information of the next virtual host to the virtual host.
Optionally, the path tracing packet is from a virtual host configured on the path tracing packet itself; or the path tracing message comes from a virtual host configured on other physical nodes different from the path tracing message.
Optionally, the path tracing packet belongs to a traceroute packet, a UDP port number of the path tracing packet is greater than 30000, and UDP port numbers of the path tracing packets are the same.
The non-transitory computer readable storage medium may be a ROM, a Random Access Memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc., which is not limited in this application.
The above description is only exemplary of the present application and should not be taken as limiting the present application, as any modification, equivalent replacement, or improvement made within the spirit and principle of the present application should be included in the scope of protection of the present application.

Claims (16)

1. A path tracing method is characterized in that the method is applied to a physical node; the method comprises the following steps:
receiving a path tracking message sent by a virtual host configured on any physical node, wherein the path tracking message is used for acquiring address information of the virtual host on a transmission path between the virtual host and a target virtual host;
judging whether a tracking target of the path tracking message is a next virtual host located on the physical node on the transmission path;
and when the tracking target is the next virtual host, determining a physical output interface for forwarding the path tracking message to the next virtual host, and returning address information of the physical output interface to the virtual host.
2. The method of claim 1, wherein a virtual switching device is configured on the physical node;
the receiving a path tracing packet sent by a virtual host configured on any physical node includes: receiving, by the virtual switching device, the path trace packet;
when the tracking target is the next virtual host, determining a physical outgoing interface for forwarding the path tracking packet to the next virtual host includes: and searching a physical output interface which is bound with the virtual switching equipment and used for forwarding the path tracking message to the next virtual host.
3. The method of claim 1, wherein a virtual switching device is configured on the physical node; the determining whether the tracking target of the path tracking packet is the next virtual host located on the physical node on the transmission path includes:
judging whether the survival time value of the path tracking message indicates that the next hop of the path tracking message is the last hop by the virtual switching equipment;
the determining, by the virtual switching device, whether the time-to-live value of the path trace packet indicates that the next hop of the path trace packet is the last hop includes:
judging whether the survival time value of the path tracking message is 1 or not by the virtual switching equipment;
when the virtual switching equipment forwards the path tracking message, the time-to-live value of the path tracking message is not modified; when the virtual host forwards the path tracking message, the time-to-live value of the path tracking message is modified.
4. The method of claim 1, wherein returning address information of the physical egress interface to the virtual host comprises:
taking the address information of the physical outgoing interface as a source address to generate an overtime message;
and returning the generated overtime message to the virtual host.
5. The method of claim 1, further comprising:
and forwarding the path tracking message to the next virtual host through the physical outgoing interface so that the next virtual host returns the address information of the next virtual host to the virtual host.
6. The method of claim 1, wherein the path trace message is from a virtual host configured on itself; or the path tracing message comes from a virtual host configured on other physical nodes different from the path tracing message.
7. The method of claim 1, wherein the path trace packet belongs to a traceroute packet, a UDP port number of the path trace packet is greater than 30000, and a UDP port number of each path trace packet is the same.
8. A path tracking device is characterized in that the path tracking device is applied to a physical node; the device comprises:
the virtual host comprises a message receiving unit, a path tracing unit and a path tracing unit, wherein the message receiving unit is used for receiving a path tracing message sent by a virtual host configured on any physical node, and the path tracing message is used for acquiring address information of the virtual host on a transmission path between the virtual host and a target virtual host;
the judging unit is used for judging whether a tracking target of the path tracking message is the next virtual host located at the physical node on the transmission path;
and an interface determining unit, configured to determine, when the tracking target is the next virtual host, a physical outgoing interface used for forwarding the path tracking packet to the next virtual host, and return address information of the physical outgoing interface to the virtual host.
9. The apparatus of claim 8, wherein a virtual switching device is configured on the physical node;
the message receiving unit is specifically configured to: receiving, by the virtual switching device, the path trace packet;
the interface determination unit is specifically configured to: and searching a physical output interface which is bound with the virtual switching equipment and used for forwarding the path tracking message to the next virtual host.
10. The apparatus of claim 8, wherein a virtual switching device is configured on the physical node; the judgment unit is specifically configured to:
judging whether the survival time value of the path tracking message indicates that the next hop of the path tracking message is the last hop by the virtual switching equipment;
the determining, by the virtual switching device, whether the time-to-live value of the path trace packet indicates that the next hop of the path trace packet is the last hop includes:
judging whether the survival time value of the path tracking message is 1 or not by the virtual switching equipment;
when the virtual switching equipment forwards the path tracking message, the time-to-live value of the path tracking message is not modified; when the virtual host forwards the path tracking message, the time-to-live value of the path tracking message is modified.
11. The apparatus according to claim 8, wherein the interface determining unit is specifically configured to:
taking the address information of the physical outgoing interface as a source address to generate an overtime message;
and returning the generated overtime message to the virtual host.
12. The apparatus of claim 8, further comprising:
and the message forwarding unit forwards the path tracking message to the next virtual host through the physical outgoing interface so that the next virtual host returns the address information of the next virtual host to the virtual host.
13. The apparatus of claim 8, wherein the path trace message is from a virtual host configured on itself; or the path tracing message comes from a virtual host configured on other physical nodes different from the path tracing message.
14. The apparatus according to claim 8, wherein the path trace packet belongs to a traceroute packet, a UDP port number of the path trace packet is greater than 30000, and a UDP port number of each path trace packet is the same.
15. An electronic device, comprising:
a processor;
a memory for storing processor-executable instructions;
wherein the processor implements the method of any one of claims 1-7 by executing the executable instructions.
16. A computer-readable storage medium having stored thereon computer instructions, which when executed by a processor, perform the steps of the method according to any one of claims 1-7.
CN201811244349.4A 2018-10-24 2018-10-24 Path tracking method and device, electronic equipment and storage medium Active CN109347670B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811244349.4A CN109347670B (en) 2018-10-24 2018-10-24 Path tracking method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811244349.4A CN109347670B (en) 2018-10-24 2018-10-24 Path tracking method and device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN109347670A CN109347670A (en) 2019-02-15
CN109347670B true CN109347670B (en) 2021-09-28

Family

ID=65312009

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811244349.4A Active CN109347670B (en) 2018-10-24 2018-10-24 Path tracking method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN109347670B (en)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111683014B (en) * 2020-05-26 2022-02-15 中国人民解放军国防科技大学 Routing path tracking method and system of high-speed interconnection network
CN112995025B (en) * 2021-02-05 2023-02-28 杭州迪普科技股份有限公司 Path tracking method, device, equipment and computer readable storage medium
CN114244743B (en) * 2021-12-10 2022-10-21 北京天融信网络安全技术有限公司 Method, device, equipment and medium for transmitting data packets of resource pool
CN114157554B (en) * 2021-12-21 2024-02-23 唯品会(广州)软件有限公司 Fault checking method and device, storage medium and computer equipment
CN114967751B (en) * 2022-06-21 2022-12-06 深圳华创电科技术有限公司 Aircraft track tracking method, device, equipment and storage medium
CN115296985B (en) * 2022-09-27 2022-12-16 广州医科大学附属第五医院(广州再生医学与健康广东省实验室附属医院) Breakpoint positioning method and device and electronic equipment
CN116996392B (en) * 2023-09-27 2023-12-29 山东省计算中心(国家超级计算济南中心) Flow path reconstruction method and system based on weighted directed graph algorithm

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101931565A (en) * 2009-06-23 2010-12-29 中兴通讯股份有限公司 Network segment detection method and device
CN102334111A (en) * 2009-03-30 2012-01-25 亚马逊技术有限公司 For the managed computer network provides the logic network savvy
CN103166852A (en) * 2013-03-06 2013-06-19 杭州华三通信技术有限公司 Traceroute method for label switched paths (LSP) in multi-protocol label switching (MPLS) network and routing equipment
CN106330706A (en) * 2015-07-01 2017-01-11 中兴通讯股份有限公司 Method and device for acquiring device interface MRU (Maximum Receive Unit) value
CN107078963A (en) * 2014-10-16 2017-08-18 思科技术公司 Route tracking in virtual expansible LAN
WO2018050244A1 (en) * 2016-09-16 2018-03-22 Nokia Solutions And Networks Oy Malicious network activity mitigation

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102334111A (en) * 2009-03-30 2012-01-25 亚马逊技术有限公司 For the managed computer network provides the logic network savvy
CN101931565A (en) * 2009-06-23 2010-12-29 中兴通讯股份有限公司 Network segment detection method and device
CN103166852A (en) * 2013-03-06 2013-06-19 杭州华三通信技术有限公司 Traceroute method for label switched paths (LSP) in multi-protocol label switching (MPLS) network and routing equipment
CN107078963A (en) * 2014-10-16 2017-08-18 思科技术公司 Route tracking in virtual expansible LAN
CN106330706A (en) * 2015-07-01 2017-01-11 中兴通讯股份有限公司 Method and device for acquiring device interface MRU (Maximum Receive Unit) value
WO2018050244A1 (en) * 2016-09-16 2018-03-22 Nokia Solutions And Networks Oy Malicious network activity mitigation

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
"Traceroute in OpenFLow based SDN";肖宏辉;《https://zhuanlan.zhihu.com/p/24982540》;20170121;全文 *
"软件定义网络流表超时与路径追踪研究";朱惠康;《上海交通大学硕士学位论文》;20171129;全文 *

Also Published As

Publication number Publication date
CN109347670A (en) 2019-02-15

Similar Documents

Publication Publication Date Title
CN109347670B (en) Path tracking method and device, electronic equipment and storage medium
US11570285B2 (en) Packet processing method, network node, and system
US20210218704A1 (en) Method, Device, and System for Obtaining SRV6 Tunnel Information
US10999129B2 (en) Fault detection method, apparatus, and system in NFV system
US20180139098A1 (en) Integrating physical and virtual network functions in a service-chained network environment
US9110703B2 (en) Virtual machine packet processing
US7496685B2 (en) Method and system for managing a device within a private network using a management device external to the private network
EP3219087B1 (en) Methods, systems, and computer readable media for facilitating the resolving of endpoint hostnames in test environments with firewalls, network address translators(nats), or clouds
CN107547689B (en) CGN (Carrier grade network Address translation) method and device
US7283544B2 (en) Automatic network device route management
US10484259B2 (en) Packet loss locating in VXLAN
CN109379241B (en) Path information determination method and device
EP3591899B1 (en) Path detection
CN106656615B (en) Message processing method and device based on TRACERT command
CN107690004B (en) Method and device for processing address resolution protocol message
WO2016202059A1 (en) Ipv6 network access method and gateway
US20210203695A1 (en) Anti-spoofing attack check method, device, and system
CN111953810B (en) Method, device and storage medium for identifying proxy internet protocol address
JP7228712B2 (en) Abnormal host monitoring
US20230269216A1 (en) Communication method and apparatus
EP4383667A1 (en) Information verification method and device, storage medium, and electronic device
CN114827015B (en) Data forwarding method and virtualized cloud network architecture
CN110753364A (en) Network monitoring method, system, electronic device and storage medium
CN110677439B (en) Protection method and device for ND attack
CN112995025B (en) Path tracking method, device, equipment and computer readable storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant