Traffic mirroring system, traffic mirroring method and device and electronic equipment

By introducing a mirror network in the data center and directly connecting to the first network equipment, the problems of high cost and low efficiency of traffic mirroring in the prior art are solved, real-time and flexible traffic mirroring transmission are realized, and fault occurrence points can be located in a timely manner.

CN118921337APending Publication Date: 2024-11-08HUAWEI TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310513031.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-05-08
Publication Date
2024-11-08

AI Technical Summary

Technical Problem

In scenarios such as data centers, the existing technology is costly and inefficient when used for traffic mirroring, and it is difficult to locate the fault occurrence points in time, especially when the target application changes, it is necessary to redeploy the network shunt device, resulting in a long deployment time and low efficiency. .

Method used

By introducing a mirror network into the control device and the business network, directly connecting the first network device, the control device determines the target network device and sends mirror instructions, the target network device transmits the mirror traffic to the mirror network, reducing the configuration requirements for each node, and realizing the Real-time traffic mirror transmission.

Benefits of technology

It reduces the cost and deployment time of traffic mirroring, improves efficiency, and can timely locate the fault occurrence point in the fault location scenario, and supports flexible selection of transmission paths to optimize the transmission quality and delay of mirror traffic.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118921337A_ABST
    Figure CN118921337A_ABST
Patent Text Reader

Abstract

The invention discloses a traffic mirroring system, a traffic mirroring method and device and electronic equipment. The system comprises a control device, a service network, a mirror image network and an analysis device. The control device is used for determining a target network device in the service network based on the target data flow, wherein the target network device is a network device for transmitting the target data flow; the control equipment is also used for sending a first mirroring instruction to the target network equipment; the target network device is used for sending the mirror image flow of the target data flow to the first network device in the service network based on the first mirror image instruction; the first network equipment is used for sending the mirror image flow of the target data flow through the mirror image network.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of network technology, and in particular to a traffic mirroring system, a traffic mirroring method and device, and an electronic device. Background Art

[0002] In scenarios such as data centers, in order to locate the point where a fault occurs, it is necessary to mirror the traffic of each node through which the traffic of the target application passes, and transmit the mirrored traffic of each node to the control device.

[0003] If network diversion equipment is deployed at each node to mirror the traffic of each node, the implementation cost is high. Moreover, when the target application changes, the network diversion equipment needs to be reinstalled and deployed, which takes a long time and is inefficient. Even after the network diversion equipment is deployed, the application has returned to normal, resulting in the failure to locate the fault point in time. Summary of the invention

[0004] The present application provides a traffic mirroring system, a traffic mirroring method and device, and an electronic device, which can reduce traffic mirroring costs and improve efficiency.

[0005] In a first aspect, the present application provides a traffic mirroring system, which includes: a control device, a service network and a mirror network.

[0006] The control device is used to determine the target network device in the business network based on the target data flow, and the target network device is a network device that transmits the target data flow; the control device is also used to send a first mirror instruction to the target network device; the target network device is used to send the mirror traffic of the target data flow to the first network device in the business network based on the first mirror instruction; the first network device is used to send the mirror traffic of the target data flow through the mirror network.

[0007] In the implementation of the present application, the mirror network and the first network device in the service network are directly connected. After the control device determines the target network device that needs to perform traffic mirroring, it sends a first mirror instruction to the target network device. The target network device sends the mirror traffic to the first network device according to the instruction, and then the first network device sends it to other devices, such as analysis devices, through the mirror network. The above implementation method is used to realize the transmission of mirror traffic. On the one hand, it is not necessary to configure network diversion devices on each node that needs to be collected, and the cost is low. On the other hand, when the target data flow that needs to be analyzed changes, the target network device that reports the mirror traffic can be changed through instructions. It has good real-time performance and can locate the fault point in time in the fault location scenario.

[0008] In some implementations of the present application, the control device is used to obtain a transmission path of a target data flow in a service network; and determine at least one network device on the transmission path as a target network device.

[0009] In this implementation, the control device can determine the target network device as needed. For example, when the fault point needs to be located with high precision, all network devices on the transmission path can be selected as target network devices. For another example, when the fault point needs to be located with high efficiency or low overhead, some network devices on the transmission path can be selected as target network devices, such as those with low load.

[0010] In some implementations of the present application, the service network includes at least one first network device.

[0011] The control device is further configured to select, from the at least one first network device, a first network device for transmitting the mirrored traffic of the target data flow based on at least one of the length of the first path, the performance of the first path, and the load of the first network device;

[0012] The first path is a path from the target network device to the first network device.

[0013] In this implementation, by selecting a short path for mirrored traffic transmission, the transmission path length of the mirrored traffic is reduced and the transmission delay is reduced; a path with good performance is selected for mirrored traffic transmission to improve the transmission quality of the mirrored traffic; a low-load device is selected as the corresponding first network device to ensure that the first network device has sufficient resources to process the mirrored traffic and reduce the transmission delay and packet loss of the mirrored traffic.

[0014] In some implementations of the present application, the first network device is used to receive the mirrored traffic of the target data flow sent by the target network device; send the mirrored traffic of the target data flow to the mirrored network;

[0015] The mirror network is used to send the mirrored traffic of the mirrored target data flow to the analysis device.

[0016] In this implementation, the mirror network includes an access layer and a convergence layer, so that multiple mirrored flows can be converged together, allowing the analysis device to analyze more flows.

[0017] The sending of the mirrored traffic of the target data flow to the mirrored network may include: mirroring the mirrored traffic of the target data flow again, and sending the mirrored mirrored traffic of the target data flow to the mirrored network.

[0018] The first network device mirrors the mirrored traffic of the target data flow again, which can be achieved by using port mirroring (switched port analyzer, SPAN).

[0019] In this implementation, in order to prevent the first network device from processing the first mirror message, the port of the first network device that receives the mirror traffic of the target data flow is configured with a black hole route, so that the first network device will not receive the first mirror message and does not need to provide resources for receiving the first mirror message. However, it can still serve as a source port of SPAN to mirror the mirror traffic again.

[0020] In some implementations of the present application, the mirror network includes a plurality of mirror traffic transmission devices;

[0021] The mirrored traffic transmission device is used to determine the forwarding port of the mirrored traffic of the target data stream according to the mirrored traffic forwarding strategy when receiving the mirrored traffic of the target data stream; and send the mirrored traffic of the target data stream to the analysis device through the forwarding port.

[0022] In this implementation, the mirrored traffic transmission device determines the forwarding port of the mirrored traffic according to the mirrored traffic forwarding strategy. The mirrored traffic forwarding strategy can be configured by the control device, thereby achieving configurability of access and aggregation of the mirrored traffic.

[0023] In some implementations of the present application, the control device is further configured to determine, according to the topology of the mirror network, a forwarding path from the first network device to the analysis device based on at least one of the length of the second path and the performance of the second path; and send a mirrored traffic forwarding policy to a mirrored traffic transmission device of the mirrored network on the forwarding path based on the forwarding path;

[0024] The second path is a path from the first network device to the analysis device.

[0025] In this implementation, by selecting a short path for mirrored traffic transmission, the transmission path length of the mirrored traffic is reduced and the transmission delay is reduced; by selecting a path with good performance for mirrored traffic transmission, the transmission quality of the mirrored traffic is improved.

[0026] In some implementations of the present application, the control device and the analysis device are the same device, or the control device and the analysis device are different devices.

[0027] In a second aspect, the present application provides a traffic mirroring method, the method comprising:

[0028] The control device determines a target network device in the service network based on the target data flow, where the target network device is a network device that transmits the target data flow;

[0029] The control device sends a first mirroring instruction to the target network device, the first mirroring instruction is used to instruct the target network device to send the mirrored traffic of the target data flow to the first network device, and the first network device is used to send the mirrored traffic of the target data flow through the mirroring network.

[0030] Optionally, the control device determines a target network device in the service network based on the target data flow, including:

[0031] The control device obtains the transmission path of the target data flow in the service network;

[0032] The control device determines at least one network device on the transmission path as a target network device.

[0033] Optionally, the service network includes at least one first network device; and the method further includes:

[0034] The control device selects, based on at least one of the length of the first path, the performance of the first path, and the load of the first network device, a first network device as a first network device for transmitting the mirror traffic of the target data flow from at least one first network device;

[0035] The first path is a path from the target network device to the first network device.

[0036] Optionally, the method further comprises:

[0037] The control device determines, according to the topology of the mirror network and based on at least one of the length of the second path and the performance of the second path, a forwarding path from the first network device to the analysis device;

[0038] The control device sends a mirrored traffic forwarding policy to a mirrored traffic transmission device of a mirrored network on the forwarding path based on the forwarding path, wherein the traffic forwarding policy is used to instruct the mirrored traffic transmission device to determine a forwarding port for the mirrored traffic of a target data stream, and to send the mirrored traffic of the target data stream to the analysis device through the forwarding port;

[0039] The second path is a path from the first network device to the analysis device.

[0040] In a third aspect, the present application provides a traffic mirroring method, the method comprising:

[0041] The target network device receives the first mirroring instruction sent by the control device, and the target network device belongs to the service network;

[0042] The target network device sends the mirrored traffic of the target data flow to the first network device in the service network based on the first mirroring instruction, and the first network device is used to send the mirrored traffic of the target data flow through the mirroring network.

[0043] In a fourth aspect, the present application provides a traffic mirroring method, the method comprising:

[0044] The first network device receives the mirrored traffic of the target data flow sent by the target network device, and both the first network device and the target network device belong to the service network;

[0045] The first network device sends the mirrored traffic of the target data flow through the mirrored network.

[0046] In a fifth aspect, the present application provides a traffic mirroring device, the device comprising:

[0047] A determination unit, configured to determine a target network device in a service network based on a target data stream, wherein the target network device is a network device that transmits the target data stream;

[0048] The sending unit is used to send a first mirroring instruction to a target network device, wherein the first mirroring instruction is used to instruct the target network device to send the mirrored traffic of the target data flow to the first network device, and the first network device is used to send the mirrored traffic of the target data flow through the mirroring network.

[0049] Optionally, the determination unit is used to obtain a transmission path of the target data flow in the service network; and determine at least one network device on the transmission path as a target network device.

[0050] Optionally, the service network includes at least one first network device;

[0051] The determining unit is further configured to select, from the at least one first network device, a first network device for transmitting the mirrored traffic of the target data flow based on at least one of the length of the first path, the performance of the first path, and the load of the first network device;

[0052] The first path is a path from the target network device to the first network device.

[0053] Optionally, the determining unit is further configured to determine, according to the topology of the mirror network, a forwarding path from the first network device to the analysis device based on at least one of a length of the second path and a performance of the second path;

[0054] The sending unit is further used to send a mirrored traffic forwarding strategy to a mirrored traffic transmission device of the mirrored network on the forwarding path based on the forwarding path, wherein the traffic forwarding strategy is used to instruct the mirrored traffic transmission device to determine a forwarding port for the mirrored traffic of the target data flow, and send the mirrored traffic of the target data flow to the analysis device through the forwarding port;

[0055] The second path is a path from the first network device to the analysis device.

[0056] In a sixth aspect, the present application provides a traffic mirroring device, which belongs to a service network and includes:

[0057] A receiving unit, configured to receive a first mirroring instruction sent by a control device;

[0058] The sending unit is used to send the mirrored traffic of the target data flow to the first network device in the service network based on the first mirroring instruction, and the first network device is used to send the mirrored traffic of the target data flow through the mirroring network.

[0059] In a seventh aspect, the present application provides a traffic mirroring device, which belongs to a service network and includes:

[0060] A receiving unit, used to receive the mirrored traffic of the target data flow sent by the target network device in the service network;

[0061] The sending unit is used to send the mirrored traffic of the target data flow through the mirrored network.

[0062] In an eighth aspect, an electronic device is provided. The electronic device includes a processor and a memory. The memory is used to store software programs and modules. The processor implements the method in the second aspect or any possible implementation of the second aspect, or implements the method in the third aspect or any possible implementation of the third aspect, or implements the method in the fourth aspect or any possible implementation of the fourth aspect by running or executing the software program and / or module stored in the memory.

[0063] Optionally, the number of the processors is one or more, and the number of the memories is one or more.

[0064] Optionally, the memory may be integrated with the processor, or the memory may be provided separately from the processor.

[0065] In the specific implementation process, the memory can be a non-transitory memory, such as a read-only memory (ROM), which can be integrated with the processor on the same chip or can be set on different chips. This application does not limit the type of memory and the setting method of the memory and the processor.

[0066] In a ninth aspect, a computer program product is provided. The computer program product includes computer program code, and when the computer program code is executed by a computer, the computer executes the method in the second aspect or any possible implementation of the second aspect, or executes the method in the third aspect or any possible implementation of the third aspect, or executes the method in the fourth aspect or any possible implementation of the fourth aspect.

[0067] In the tenth aspect, the present application provides a computer-readable storage medium, which is used to store program codes executed by a processor, and the program codes include methods for implementing the above-mentioned second aspect or any possible implementation of the second aspect, or implementing the above-mentioned third aspect or any possible implementation of the third aspect, or implementing the above-mentioned fourth aspect or any possible implementation of the fourth aspect.

[0068] In the eleventh aspect, a chip is provided, comprising a processor, the processor being used to call and execute instructions stored in a memory from the memory, so that a communication device equipped with the chip executes the method in the second aspect or any possible implementation of the second aspect, or executes the method in the third aspect or any possible implementation of the third aspect, or executes the method in the fourth aspect or any possible implementation of the fourth aspect.

[0069] In the twelfth aspect, another chip is provided. The another chip includes an input interface, an output interface, a processor and a memory. The input interface, the output interface, the processor and the memory are connected via an internal connection path. The processor is used to execute the code in the memory. When the code is executed, the processor is used to execute the method in the second aspect or any possible implementation of the second aspect, or execute the method in the third aspect or any possible implementation of the third aspect, or execute the method in the fourth aspect or any possible implementation of the fourth aspect. BRIEF DESCRIPTION OF THE DRAWINGS

[0070] Figure 1 It is a structural schematic diagram of an application scenario provided by an embodiment of the present application;

[0071] Figure 2 This is a network topology diagram of a data center provided in an embodiment of the present application;

[0072] Figure 3 This is a network topology diagram of a data center provided in an embodiment of the present application;

[0073] Figure 4It is a structural diagram of a traffic mirroring system provided in an embodiment of the present application;

[0074] Figure 5 It is a flow chart of a traffic mirroring method provided by an embodiment of the present application;

[0075] Figure 6 It is a flow chart of a traffic mirroring method provided by an embodiment of the present application;

[0076] Figure 7 It is a flow chart of a traffic mirroring method provided by an embodiment of the present application;

[0077] Figure 8 It is a flow chart of a traffic mirroring method provided by an embodiment of the present application;

[0078] Fig. 9 is a block diagram of a traffic mirroring device provided in an embodiment of the present application;

[0079] Fig.10 is a block diagram of a traffic mirroring device provided in an embodiment of the present application;

[0080] Fig.11 is a block diagram of a traffic mirroring device provided in an embodiment of the present application;

[0081] Fig.12 It is a structural schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0082] In order to make the objectives, technical solutions and advantages of the present application clearer, the implementation methods of the present application will be further described in detail below with reference to the accompanying drawings.

[0083] Figure 1 is a structural diagram of an application scenario provided by an embodiment of the present application. Figure 1 , this application scenario is an example of a business network involved in this application. The business network is used to transmit, store and / or otherwise process business data of various applications. The business network includes multiple network devices 11. The network device 11 can be a switch, a routing device, a firewall device, a server, etc.

[0084] The following uses a data center as an example to illustrate the structure of a business network:

[0085] Figure 2 Schematic diagram of a network topology of a data center provided in an embodiment of the present application. Figure 2, the data center includes a spine switch 12, a leaf switch 13, and a virtual machine (VM) server 14. The VM servers 14 can communicate with each other through the commonly connected leaf switches 13. If the VM servers 14 are not connected to the same leaf switch 13, the VM servers 14 need to communicate with each other through the leaf switch 13 and the spine switch 12. Figure 2 As shown by the dotted line in the communication line, the VM server 14 on the left communicates with the VM server 14 on the right through the Leaf switch 13, the Spine switch 12, and the Leaf switch 13 in sequence.

[0086] Among them, the Spine switch 12 and the Leaf switch 13 both belong to the aforementioned network device 11.

[0087] When the data center is larger in scale, the data center may further include an intermediate switch located between the spine switch 12 and the leaf switch 13 .

[0088] Figure 3 Schematic diagram of a network topology of a data center provided in an embodiment of the present application. Figure 3 , Figure 3 and Figure 2 The main difference is that the data center also includes an intermediate switch 15.

[0089] VM servers 14 can communicate with each other through Leaf switches 13, intermediate switches 15, and Spine switches 12, for example Figure 3 The communication lines are shown by the dotted lines.

[0090] Among them, the intermediate switch 15 also belongs to the aforementioned network device 11.

[0091] In the above business network examples, the number and connection relationships of network devices are only examples and are not intended to limit the present application.

[0092] Figure 4 Schematic diagram of a traffic mirroring system provided by an embodiment of the present application. Figure 4 The traffic mirroring system includes: a control device 110, a service network 120 and a mirroring network 130. Figure 4 In the business network 120, Figure 2 As an example, the business network 120 can also adopt Figure 3 Or other structures, without limitation.

[0093] The mirror network 130 is a network dedicated to transmitting mirror traffic, and the mirror network 130 is directly connected to the first network device 122 in the service network 120 .

[0094] The control device 110 is used to determine a target network device 121 in the service network 120 based on the target data flow. The target network device 121 is a network device that transmits the target data flow.

[0095] The control device 110 is further configured to send a first mirroring instruction to the target network device 121 .

[0096] The target network device 121 is used to send the mirrored traffic of the target data flow to the first network device 122 in the service network 120 based on the first mirroring instruction.

[0097] The first network device 122 is used to send the mirror traffic of the target data flow through the mirror network 130 .

[0098] The target data flow and the mirrored traffic both include at least one message.

[0099] The first network device 122 may also be referred to as a fixed collection point, which is usually an aggregation or core device with sufficient bandwidth.

[0100] In the implementation of the present application, the mirror network 130 is directly connected to the first network device in the service network 120. After the control device 110 determines the target network device that needs to perform traffic mirroring, it sends the first mirror instruction to the target network device 121. The target network device 121 sends the mirror traffic to the first network device 122 according to the instruction, and then the first network device 122 sends it to other devices, such as analysis devices, through the mirror network 130. The above implementation method is used to realize the transmission of mirror traffic. On the one hand, it is not necessary to configure network diversion devices on each node that needs to be collected, and the cost is low; on the other hand, when the target data flow that needs to be analyzed changes, the target network device that reports the mirror traffic can be changed through instructions, which has good real-time performance. In the fault location scenario, the fault occurrence point can be located in time.

[0101] In some possible implementations of the present application, the control device 110 is used to query the analysis system for the target network device corresponding to the target data flow, thereby determining the target network device 121 in the service network 120 .

[0102] For example, query is performed through the identifier of the target data stream. The identifier of the target data stream is, for example, a two-tuple (including source Internet Protocol (IP) address, destination IP address), or a four-tuple (source IP address, source port number, destination IP address, destination port number), or a five-tuple (source IP address, source port number, destination IP address, destination port number, protocol type), or an application-aware IPv6 networking (APN) identifier (ID). Alternatively, query is performed through the identifier of the application corresponding to the target data stream, etc.

[0103] In some possible implementations of the present application, the control device 110 is used to obtain a transmission path of a target data flow in a service network; and determine at least one network device on the transmission path as a target network device.

[0104] There are multiple ways for the control device 110 to obtain the transmission path.

[0105] For example, the control device 110 can determine the transmission path of the target data flow in the service network based on the topology of the service network and the forwarding information of each network device and according to the information of the target data flow. For example, the destination address of the target data flow is matched with the forwarding table entries of each network device to determine the forwarding path, that is, the transmission path, of the target data flow.

[0106] For another example, when the control device 110 obtains the connection establishment for transmitting the target data stream, the network devices are sorted based on the time to live (TTL) of the SYN message uploaded by each network device during the three-way handshake of the transmission control protocol (TCP), thereby forming a transmission path for the target data stream.

[0107] In some examples, the target data flow may be a data flow, such as a data flow of an application.

[0108] In other examples, the target data stream may also be multiple data streams. For example, multiple data streams of an application, or multiple data streams with target addresses in the same network segment. When the target data stream is multiple data streams, the control device 110 needs to determine a target network device for each data stream, and send a first mirroring instruction to each target network device, so that each target network device sends mirrored traffic, thereby implementing traffic mirroring of multiple data streams in the target data stream.

[0109] In some examples, after determining the transmission path of the target data flow, the control device 110 selects all network nodes on the transmission path as target network devices.

[0110] In other examples, after determining the transmission path of the target data stream, the control device 110 selects some network nodes on the transmission path as target network devices, for example, selecting some nodes at intervals on the transmission path as target network devices, or selecting nodes with low load as target network devices according to node load.

[0111] In this implementation, the control device can determine the target network device as needed. For example, when the fault point needs to be located with high precision, all network devices on the transmission path can be selected as target network devices. For another example, when the fault point needs to be located with high efficiency or low overhead, some network devices on the transmission path can be selected as target network devices, such as those with low load.

[0112] After determining the target network devices, the control device 110 sends first mirroring instructions to the target network devices respectively. The first mirroring instructions instruct the target network devices to perform traffic mirroring, instruct the target network devices which traffic to mirror, and instruct the target network devices where to send the mirrored traffic.

[0113] In order to achieve the above three aspects of instructions, the first mirror instruction may include acquisition object information and a first instruction identifier.

[0114] Optionally, when there are multiple first network devices, the first mirroring instruction may further include destination device information to indicate through which first network device the target network device transmits the mirrored traffic.

[0115] The first indication identifier is used to instruct the target network device to perform a mirroring function of the target data flow upon receiving the instruction.

[0116] The collection object information may be information of the target data flow, such as a binary or quintuple of the target data flow; the collection object information may also be information of the port through which the target data flow passes, such as the corresponding inbound port of the target data flow on the target network device.

[0117] The destination device information may include the address and / or identification of the first network device.

[0118] Optionally, the first mirroring instruction may further include a mirroring time range, and the mirroring time range is used to limit the time during which the target network device mirrors the target data flow.

[0119] For example, the mirroring time range is expressed in an exact range, such as 0:00 to 24:00 on a certain day, or 0:00 to 60:00 on a certain hour on a certain day, etc. For another example, the mirroring time range is expressed in time granularity, such as one day, then the corresponding range is the current day, or one hour, then the corresponding range is within the current hour, etc.

[0120] Of course, when the first mirroring instruction does not include the mirroring time range, the control device can instruct the target network device to stop mirroring the target data stream through a second mirroring instruction. The second mirroring instruction can include acquisition object information and a second indication identifier, and the second indication identifier is used to instruct the target network device to stop the mirroring function of the target data stream when receiving the instruction.

[0121] In one example, the first mirroring instruction may be sent using a network management protocol message, the destination address of which is the address of the target network device, wherein the network management protocol includes but is not limited to a simple network management protocol (SNMP) or a network configuration (NETCONF) protocol.

[0122] The control device 110 is communicatively connected to the service network 120 , so the control device 110 can send the first mirroring instruction to the target network device.

[0123] After receiving the first mirroring instruction, the target network device 121 determines that traffic mirroring is required based on the first mirroring instruction, and determines that the data flow that needs traffic mirroring is the target data flow or the traffic of the specified port, and the destination address of the mirrored traffic of the target data flow is the address of the first network device.

[0124] In the implementation of the present application, the target network device 121 mirrors the target data flow or the traffic of the designated port based on the first mirror instruction, and sends the mirrored traffic to the first network device.

[0125] For example, the target network device 121 performs encapsulated remote SPAN (ERSPAN) on the target data flow or the traffic of the designated port to mirror the target data flow or the traffic of the designated port and send it to the first network device.

[0126] The target network device encapsulates the message of the original traffic based on ERSPAN to obtain a first mirror message, and sends the first mirror message to the first network device.

[0127] Encapsulation here refers to encapsulating messages using a generic routing encapsulation protocol (GRE), so that the encapsulated messages can be transmitted to the first network device through a network layer protocol.

[0128] The encapsulated message includes information of the target network device, such as the address and acquisition port of the target network device, so that the subsequent analysis device can locate the fault point according to the information of the target network device in the message. The destination address in the encapsulated message can be the address of the port of the first network device.

[0129] In one example, there is only one first network device, that is, the service network includes one first network device; the mirrored traffic of the target data flow is sent to the analysis device through the first network device, that is, the destination device information indicated by each first mirroring instruction is the information of the first network device, and each target network device encapsulates the first mirroring message and sends it to the first network device. As mentioned above, the first mirroring instruction at this time does not need to carry the destination device information, and the default first network device information can be configured in each network device in advance. When the mirrored traffic is transmitted, the configured default first network device information is used.

[0130] In another example, there may be multiple first network devices, that is, the service network includes multiple first network devices; in this case, the control device needs to determine one corresponding first network device for each target network device, and the first mirror instruction sent to the target network device carries the information of the corresponding first network device, and the target network device also sends a first encapsulated message to the corresponding first network device.

[0131] The following describes how the control device determines a corresponding first network device for each target network device.

[0132] The control device is further configured to select, from the at least one first network device, a first network device for transmitting the mirrored traffic of the target data flow based on at least one of the length of the first path, the performance of the first path, and the load of the first network device;

[0133] The first path is a path from the target network device to the first network device.

[0134] The length of the path may refer to the number of hops of the path; the performance of the path may include the remaining bandwidth and / or delay of the path, for example, the remaining bandwidth and delay are quantified into component values ​​respectively, and the weighted sum of the two scores is used as the performance of the path.

[0135] Exemplarily, the control device determines the path from the target network device to each first network device according to the topology of the service network, selects the path that meets at least one of the shortest path, the best path performance, and the lowest device load, and determines the first network device corresponding to the path. The port corresponding to the target network device of the path is the egress port of the mirrored traffic, and the port corresponding to the first network device of the path is the ingress port of the mirrored traffic.

[0136] The control device may also obtain the network topology of the service network in advance. The present application does not limit the manner in which the control device obtains the network topology of the service network.

[0137] Since the target network device and the first network device need to transmit the service traffic in the service network in addition to the mirror traffic, only some ports of the target network device and the first network device can be used for the transmission of the mirror traffic, and these ports are referred to as mirror traffic transmission ports. In the implementation of the present application, when determining the path from the target network device to each first network device, the path selection is performed only from the path from the mirror traffic transmission port of the target network device to the mirror traffic transmission port of each first network device.

[0138] In the case where there is only one first network device, the above method may also be used to determine the port of the first network device.

[0139] In this implementation, by selecting a short path for mirrored traffic transmission, the transmission path length of the mirrored traffic is reduced and the transmission delay is reduced; a path with good performance is selected for mirrored traffic transmission to improve the transmission quality of the mirrored traffic; a low-load device is selected as the corresponding first network device to ensure that the first network device has sufficient resources to process the mirrored traffic and reduce the transmission delay and packet loss of the mirrored traffic.

[0140] When the device load is used as an indicator, the load of the first network device corresponding to the selected path is low. The load of the first network device may include at least one of the following: processing load, port load connected to the target network device, and path load between the target network device and the target network device.

[0141] In order to determine the first network device in the above manner, in some possible implementations, each first network device may periodically report its own load to the control device, or when the control device needs to use the load of each first network device, the control device may instruct each first network device to report its own load to the control device through instructions.

[0142] Of course, the above method of determining the first network device is only an example. In other implementations, the control device may also randomly select or sequentially select one from multiple first network devices as the first network device to which the target network device sends the mirrored traffic.

[0143] See again Figure 4 , the network also includes an analysis device 140, which is connected to the mirror network.

[0144] In the implementation of the present application, the first network device 122 is used to receive the mirrored traffic of the target data stream sent by the target network device; send the mirrored traffic of the target data stream to the mirrored network; the mirrored network is used to send the mirrored traffic of the mirrored target data stream to the analysis device.

[0145] The sending of the mirrored traffic of the target data flow to the mirrored network may include: mirroring the mirrored traffic of the target data flow again, and sending the mirrored mirrored traffic of the target data flow to the mirrored network.

[0146] The first network device 122 mirrors the mirrored traffic of the target data flow again, which can be implemented by using SPAN. SPAN copies a received first mirrored message to another port. Among them, SPAN copies the port message intactly.

[0147] In this implementation, in order to prevent the first network device from processing the first mirror message, the port of the first network device 122 receiving the mirror traffic of the target data flow is configured with a black hole route, so that the first network device will not receive the first mirror message and does not need to provide resources for receiving the first mirror message. However, it can still be used as a source port of SPAN to mirror the mirror traffic again.

[0148] In one example, the target network device does not include the first network device. For example, the first network device is a Spine switch, and the target network device is a Leaf switch. In this case, the mirrored traffic of the target data stream is transmitted in the aforementioned manner, that is, ERSPAN is used to mirror the target data stream, and the mirrored traffic is transmitted from the target network device to the first network device, and then SPAN is used to mirror the mirrored traffic, and the mirrored traffic is transmitted from one port of the first network device to another port.

[0149] In another example, the target network device includes a first network device, that is, at least one target network device and the first network device are the same network device. In the case where the target network device is the first network device, SPAN is used to mirror the target data flow, and the mirrored traffic is transmitted from one port of the first network device to another port, that is, the target network device sends the mirrored traffic of the target data flow to a local port, and then outputs it to the analysis device from the local port.

[0150] In the implementation of the present application, the SPAN of the first network device may be configured in advance, for example, the mirrored traffic received from the first port may be mirrored again to the second port through the SPAN, and thus outputted from the second port.

[0151] See again Figure 4 , the mirror network 130 includes multiple mirror traffic transmission devices 131. Figure 4 The mirror network 130 shown is a 2-layer network, including an access layer connected to the first network device 122, and a convergence layer connected to the analysis device 140. The mirror network includes an access layer and a convergence layer, so that multiple mirrored traffic can be aggregated together, so that the analysis device can analyze more traffic.

[0152] certainly, Figure 4 The structure of the mirror network given is only an example. In other implementations, the mirror network may also include more or fewer layers. Or the mirror network may also adopt other network structures.

[0153] The mirrored traffic transmission device 131 is used to determine the forwarding port of the mirrored traffic of the target data stream according to the mirrored traffic forwarding strategy when receiving the mirrored traffic of the target data stream; and send the mirrored traffic of the target data stream to the analysis device 140 through the forwarding port.

[0154] The mirror traffic forwarding strategy refers to that the mirror traffic received from the C port is output from the port associated with the C port. The C port is any ingress port of the mirror traffic transmission device 131 .

[0155] Exemplarily, the mirrored traffic transmission device 131 may be a test access point (TAP) device, also known as a network splitter.

[0156] In a TAP device, the C port is the ingress port, and the egress port corresponding to the C port is assigned to the same TAP group. The mirrored traffic received by the TAP device from the C port will be output from the port corresponding to the C port, such as to the next TAP device. The next TAP device also forwards the mirrored traffic according to its own mirrored traffic forwarding strategy until the mirrored traffic is sent to the analysis device. The C port can correspond to one or more ports. The ingress port can only join one TAP group, and the egress port can join multiple TAP groups at the same time.

[0157] In one example, the mirrored traffic forwarding strategy of each mirrored traffic transmission device 131 may be fixedly configured.

[0158] In another example, the mirrored traffic forwarding strategy of each mirrored traffic transmission device 131 may be determined by a control device and then issued to the mirrored traffic transmission device 131 .

[0159] Exemplarily, the control device 110 is used to determine a forwarding path from the first network device to the analysis device based on the topology of the mirror network and at least one of the length of the second path and the performance of the second path; based on the forwarding path, send a mirrored traffic forwarding policy to a mirrored traffic transmission device of the mirrored network on the forwarding path;

[0160] The second path is a path from the first network device to the analysis device.

[0161] For example, the control device determines the various paths from the first network device to the analysis device based on the topology of the mirror network, selects the path with the shortest path and / or the best performance, and determines the mirror traffic transmission device 131 corresponding to the path, as well as the inlet and outlet ports of the mirror traffic in each mirror traffic transmission device 131.

[0162] The control device may obtain the network topology of the mirror network in advance. The application does not limit the manner in which the control device obtains the network topology of the mirror network.

[0163] The mirrored traffic forwarding policy sent by the control device 110 to the mirrored traffic transmission device 131 includes an ingress port and an egress port.

[0164] Optionally, the mirrored traffic forwarding strategy may further include information of the mirrored traffic. The information of the mirrored traffic may be an address of a target network device.

[0165] See again Figure 4 The analysis device 140 includes one or more collectors 141. When the analysis device 140 includes multiple collectors, the control device 110 first determines a collector for analyzing the mirrored traffic from the multiple collectors, and then determines a transmission path from the first network device to the collector.

[0166] The control device 110 may select one or more collectors 141 as collectors for analyzing the mirrored traffic according to the loads of the collectors 141 .

[0167] Exemplarily, the collector may be a physical network card.

[0168] In order to implement the above-mentioned method to determine the forwarding path of the mirrored traffic in the mirrored network, in some possible implementation methods, each collector can periodically report its own load to the control device, or the control device can instruct each collector to report its own load to the control device through instructions when the load of each collector is needed.

[0169] See again Figure 4 , the control device 110 and the analysis device 140 are different devices.

[0170] In other implementations, the control device 110 and the analysis device 140 may be the same device.

[0171] by Figure 4 For example, Figure 4 The control device 110 may not exist separately, but the control device 110 may be integrated into the analysis device 140, and the actions of the control device 110 may be executed by the analysis device 140.

[0172] In addition, the control device 110 can not only be a single device, but also be split into two or more devices for implementation, for example, it can be split into an analysis system and a control device, wherein the analysis system is used to determine the collection task for the control device, and the control device is used to decompose the collection task issued by the analysis system into a first mirror instruction, a mirror traffic forwarding strategy, etc., and issue them to the target network device and the mirror traffic transmission device.

[0173] Figure 5 is a flow chart of a traffic mirroring method provided in an embodiment of the present application. Figure 5 , the traffic mirroring method can be Figure 4 The method is performed by a control device in the embodiment of the present invention, and the steps of the method include:

[0174] 201: The control device determines a target network device in the service network based on the target data flow.

[0175] The target network device is a network device that transmits the target data stream, and there may be one or more target network devices. If there are multiple target network devices, the control device performs the action of step 202 for each target network device.

[0176] 202: The control device sends a first mirroring instruction to the target network device.

[0177] The first mirroring instruction is used to instruct the target network device to send the mirrored traffic of the target data flow to the first network device, and the first network device is used to send the mirrored traffic of the target data flow through the mirroring network.

[0178] In the implementation of the present application, after the control device determines the target network device that needs to perform traffic mirroring, it sends a first mirroring instruction to the target network device, so that the target network device sends the mirrored traffic to the first network device according to the instruction, and then the first network device sends it to other devices, such as analysis devices, through the mirror network. The above implementation method is used to realize the transmission of mirrored traffic. On the one hand, it is not necessary to configure network diversion devices on each node that needs to be collected, which is low in cost; on the other hand, when the target data flow that needs to be analyzed changes, the target network device that reports the mirrored traffic can be changed through instructions, which has good real-time performance. In the fault location scenario, the fault occurrence point can be located in time.

[0179] Figure 6 is a flow chart of a traffic mirroring method provided in an embodiment of the present application. Figure 6 , the traffic mirroring method can be Figure 4 The target network device in the method is executed, and the steps of the method include:

[0180] 301: The target network device receives a first mirroring instruction sent by a control device.

[0181] The target network device belongs to the service network, for example, a Leaf switch in the service network.

[0182] 302: The target network device sends the mirrored traffic of the target data flow to the first network device in the service network based on the first mirroring instruction.

[0183] The first network device is used to send the mirrored traffic of the target data flow through the mirrored network.

[0184] In the implementation of the present application, the target network device receives the first mirror instruction sent by the control device, sends the mirror traffic to the first network device according to the first mirror instruction, and then the first network device sends it to other devices, such as analysis devices, through the mirror network. The above implementation method is used to realize the transmission of mirror traffic. On the one hand, it is not necessary to configure network diversion devices on each node that needs to be collected, which is low in cost; on the other hand, when the target data flow to be analyzed changes, the target network device that reports the mirror traffic can be changed through instructions, which has good real-time performance. In the fault location scenario, the fault occurrence point can be located in time.

[0185] Figure 7 is a flow chart of a traffic mirroring method provided in an embodiment of the present application. Figure 7 , the traffic mirroring method can be Figure 4 The method is performed by a first network device in the embodiment of the present invention, and the steps of the method include:

[0186] 401: A first network device receives mirrored traffic of a target data flow sent by a target network device.

[0187] The first network device and the target network device both belong to the service network.

[0188] 402: The first network device sends the mirrored traffic of the target data flow through the mirrored network.

[0189] In the implementation of the present application, the first network device sends the mirrored traffic to the target network device according to the mirrored traffic sent by the first mirroring instruction, and the first network device sends the mirrored traffic to the analysis device through the mirroring network. The above implementation method is used to realize the transmission of mirrored traffic. On the one hand, it is not necessary to configure network diversion equipment on each node that needs to be collected, which is low in cost; on the other hand, when the target data flow to be analyzed changes, the target network device that reports the mirrored traffic can be changed through instructions, which has good real-time performance. In the fault location scenario, the fault occurrence point can be located in time.

[0190] Figure 8 is a flow chart of a traffic mirroring method provided in an embodiment of the present application. Figure 8 , the traffic mirroring method can be Figure 4 The control device, the target network device, the first network device, the mirrored traffic transmission device and the analysis device are executed, and the steps of the method include:

[0191] 501: The control device obtains the transmission path of the target data flow in the service network.

[0192] In one example, the control device first obtains a collection task, which includes at least information of a target data stream, such as a binary or quintuple of the target data stream, and executes subsequent steps according to the collection task.

[0193] Exemplarily, the binary group of the target data flow includes: source address 192.168.1.100, destination address 172.16.1.2.

[0194] by Figure 2 Taking the dotted line in the network shown as the path of the target data flow as an example, the transmission path determined by the control device is: Leaf13→Spine12→Leaf13.

[0195] by Figure 3 Taking the dotted line in the network shown as the path of the target data flow as an example, the transmission path determined by the control device is: Leaf13→intermediate switch 15→intermediate switch 15→Spine12→intermediate switch 15→intermediate switch 15→Leaf13.

[0196] 502: The control device determines at least one network device on the transmission path as a target network device.

[0197] by Figure 2Taking the dotted line in the network shown as the path of the target data flow as an example, the determined target network device can be all network devices on the transmission path, that is, including two Leaf13 and 1 Spine12, and the determined target network device can be part of the network devices on the transmission path, for example, including two Leaf13.

[0198] Similarly, in Figure 3 In the corresponding example, the target network device may also be all network devices or part of the network devices on the transmission path, which will not be described in detail here.

[0199] After determining the target network device, the control device may obtain information about the target network device, where the information about the target network device may include a device identifier (ServerLeaf1), a port (10GE / 0 / 0 / 1), and an address.

[0200] For multiple target network devices, the steps for implementing mirrored traffic collection are the same. Therefore, only one target device is used as an example for description. Figure 4 Taking the target network device 121 (Leaf13) in the example, the subsequent steps are described.

[0201] 503: The control device selects a first network device from at least one first network device as a first network device for transmitting the mirrored traffic of the target data flow based on at least one of the length of the first path, the performance of the first path, and the load of the first network device.

[0202] The first path is a path from the target network device to the first network device.

[0203] See also Figure 4 , two paths are formed between the target network device 121 and the two first network devices 122. Exemplarily, based on the performance of the path and / or the load of the first network device, it is determined to use the first network device 122 on the left side to transmit the mirrored traffic.

[0204] After determining the first network device, the control device may obtain information of the first network device, that is, destination device information.

[0205] 504: The control device sends a first mirroring instruction to the target network device. The target network device receives the first mirroring instruction sent by the control device.

[0206] After determining the acquisition object information and the destination device information, the control device generates a first mirror instruction, which may include the acquisition object information (e.g., a binary or quintuple of the target data stream), the destination device information, and a first indication identifier. The destination device information is usually the destination address of the message carrying the instruction. The first mirror instruction is sent to the target network device.

[0207] The destination device information may include the address and / or identification of the first network device.

[0208] Optionally, the destination device information may further include port information, in which case the collection is performed based on the port; or the destination device information does not include port information, in which case the collection is performed based on the device globally, that is, the collection is performed based on all ports of the device.

[0209] The first indication identifier may be ERSPAN, which indicates that the target network device uses ERSPAN to mirror the target data flow to the first network device.

[0210] 505: The control device selects one or more collectors from the analysis device as collectors for analyzing the mirrored traffic according to the load of each collector in the analysis device.

[0211] The analysis device includes one or more collectors. When the analysis device includes multiple collectors, the control device first determines a collector (eg, Server 101) for analyzing the mirrored traffic from the multiple collectors.

[0212] After the control device determines the collector for analyzing the mirrored traffic, it also obtains the destination of the mirrored traffic transmitted through the mirrored network.

[0213] 506: The control device sends the collection and analysis strategy to the analysis device, and the analysis device receives the collection and analysis strategy.

[0214] In the implementation of the present application, the collection and analysis strategy includes information of the analysis object and the mirrored traffic.

[0215] Among them, the analysis object is the information of the collector determined in step 505, and the information of the mirrored traffic includes the identification of the mirrored traffic. Exemplarily, the identification of the mirrored traffic includes a two-tuple of the mirrored traffic, that is, the source address of the mirrored traffic (the address of the target network device) and the destination address of the mirrored traffic (the address of the first network device), or the identification of the mirrored traffic only includes the source address of the mirrored traffic, such as 10.10.10.2, or the identification of the mirrored traffic includes a five-tuple of the mirrored traffic, etc.

[0216] In addition to specifying the collector, you can also specify the port of the collector to be analyzed, such as eth-0.

[0217] Optionally, the collection and analysis strategy may further include a task name, where the task name is used to describe the target data flow, for example, the data flow of user a accessing site b.

[0218] 507: The control device determines a forwarding path from the first network device to the analysis device based on the topology of the mirror network and at least one of the length of the second path and the performance of the second path.

[0219] The second path is a path from the first network device to the analysis device. In this embodiment, it may refer to a path from the first network device to the collector determined in step 505 .

[0220] After determining the first network device and the collector, the control device determines a possible path from the first network device to the collector according to the topology of the mirror network, that is, the second path, and selects a suitable forwarding path from the second path according to the above method. Figure 4 As shown, the control device determines that the bold path in the mirror network 130 is a forwarding path according to the performance of the path.

[0221] 508: The control device sends the mirrored traffic forwarding policy to the mirrored traffic transmission device of the mirrored network on the forwarding path based on the forwarding path. The mirrored traffic transmission device receives the mirrored traffic forwarding policy.

[0222] The traffic forwarding strategy is used to instruct the mirror traffic transmission device to determine the forwarding port of the mirror traffic of the target data flow, and send the mirror traffic of the target data flow to the analysis device through the forwarding port.

[0223] like Figure 4 As shown, the mirrored traffic transmission device 131 receives mirrored traffic from ingress port C and needs to forward it from egress port A. Then, the mirrored traffic forwarding strategy sent by the control device to the mirrored traffic transmission device 131 includes information of ingress port C, egress port A and mirrored traffic.

[0224] For example, the mirrored traffic forwarding policy includes the ingress port eth-0-1, the egress port eth-0-9, and the source address of the mirrored traffic 10.10.10.2.

[0225] When the mirrored traffic transmission device is a TAP device, after receiving the mirrored traffic forwarding policy, the ingress port C and the egress port A are added to the same TAP group, so that when the mirrored traffic is subsequently received from the ingress port C, it will be forwarded through the egress port A.

[0226] The above only takes the policy delivery and configuration process of a mirrored traffic transmission device 131 as an example. The control device will configure the mirrored traffic forwarding policy for each mirrored traffic transmission device 131 on the forwarding path, which will not be repeated here.

[0227] 509: The target network device sends the mirrored traffic of the target data flow to the first network device in the service network based on the first mirroring instruction. The first network device receives the mirrored traffic of the target data flow sent by the target network device.

[0228] The target network device 121 performs GRE encapsulation on the target data stream to obtain a first mirror message, the source address of which is the address of the target network device and the destination address is the address of the first network device. The target network device 121 transmits the first mirror message to the first network device 122 via the network layer protocol.

[0229] 510: The first network device mirrors the mirrored traffic of the target data flow again.

[0230] The ingress port of the first network device 122 corresponding to the mirrored traffic is configured with a black hole message, so the first mirrored message will not be received. At the same time, the ingress port of the first network device 122 corresponding to the mirrored traffic is configured with SPAN, and the first mirrored message arriving at the ingress port is mirrored to the egress port.

[0231] like Figure 4 As shown, the first mirrored packet arriving at ingress port 1 is mirrored to egress port 2.

[0232] 511: The first network device sends the mirrored traffic of the target data stream to the mirrored traffic transmission device. The mirrored traffic transmission device receives the mirrored traffic of the target data stream.

[0233] The egress port indicated in step 510 is directly connected to the mirror network, so the mirrored message mirrored to the egress port is output to the mirror network by the egress port.

[0234] 512: The mirrored traffic transmission device determines a forwarding port for the mirrored traffic of the target data flow according to the mirrored traffic forwarding policy.

[0235] That is, the mirrored traffic transmission device determines the egress port corresponding to the ingress port receiving the mirrored traffic according to the mirrored traffic forwarding policy.

[0236] For example, when the mirrored traffic transmission device is a TAP device, the egress port that belongs to the same TAP group as the ingress port receiving the mirrored traffic is determined.

[0237] 513: The mirrored traffic transmission device sends the mirrored traffic of the target data stream through the forwarding port.

[0238] The mirrored traffic of the target data flow is forwarded by one or more mirrored traffic transmission devices and reaches the analysis device.

[0239] 514: The analysis device collects the mirrored traffic according to the collection and analysis policy and analyzes the mirrored traffic.

[0240] The analysis device collects the mirrored traffic of the collector indicated by the collection and analysis strategy, and then analyzes the traffic, such as analyzing the packet loss of the same data stream on different network devices, and then determines the node or link where the packet loss occurs, thereby locating the point where the fault occurs.

[0241] The solution provided by the embodiment of the present application is that after the control device receives the collection task, it issues the configuration in the business network, uses ERSPAN to mirror the traffic to be collected to a fixed collection point (first network device), and then forwards it to the TAP mirror network through local mirroring. According to the forwarding strategy in the mirror network, the traffic is transmitted to the analysis device, that is, the traffic of any node in the business network can be automatically mirrored to the destination analysis device, thereby solving the problem of on-demand collection of traffic in the network.

[0242] Fig. 9 601 and 602. The flow mirroring device is a block diagram of a flow mirroring device provided in an embodiment of the present application. The flow mirroring device can be implemented as all or part of a control device through software, hardware, or a combination of both. The flow mirroring device can include: a determination unit 601 and a sending unit 602.

[0243] Wherein, the determination unit 601 is used to determine a target network device in the service network based on the target data flow, and the target network device is a network device that transmits the target data flow;

[0244] The sending unit 602 is used to send a first mirroring instruction to the target network device, the first mirroring instruction is used to instruct the target network device to send the mirrored traffic of the target data flow to the first network device, and the first network device is used to send the mirrored traffic of the target data flow through the mirroring network.

[0245] Optionally, the determination unit 601 is configured to obtain a transmission path of a target data flow in a service network; and determine that at least one network device on the transmission path is a target network device.

[0246] Optionally, the service network includes at least one first network device;

[0247] The determining unit 601 is further configured to select, from at least one first network device, a first network device for transmitting the mirrored traffic of the target data flow based on at least one of the length of the first path, the performance of the first path, and the load of the first network device;

[0248] The first path is a path from the target network device to the first network device.

[0249] Optionally, the determining unit 601 is further configured to determine, according to the topology of the mirror network and based on at least one of the length of the second path and the performance of the second path, a forwarding path from the first network device to the analysis device;

[0250] The sending unit 602 is further configured to send a mirrored traffic forwarding strategy to a mirrored traffic transmission device of the mirrored network on the forwarding path based on the forwarding path, wherein the traffic forwarding strategy is configured to instruct the mirrored traffic transmission device to determine a forwarding port for the mirrored traffic of the target data flow, and to send the mirrored traffic of the target data flow to the analysis device through the forwarding port;

[0251] The second path is a path from the first network device to the analysis device.

[0252] Fig.10 701 is a block diagram of a traffic mirroring device provided in an embodiment of the present application. The traffic mirroring device can be implemented as all or part of a target network device through software, hardware, or a combination of both. The traffic mirroring device may include: a receiving unit 701 and a sending unit 702.

[0253] The receiving unit 701 is used to receive a first mirroring instruction sent by a control device;

[0254] The sending unit 702 is used to send the mirrored traffic of the target data flow to the first network device in the service network based on the first mirroring instruction, and the first network device is used to send the mirrored traffic of the target data flow through the mirroring network.

[0255] Fig.11 801 is a block diagram of a traffic mirroring device provided in an embodiment of the present application. The traffic mirroring device can be implemented as all or part of the first network device through software, hardware or a combination of both. The traffic mirroring device can include: a receiving unit 801 and a sending unit 802.

[0256] The receiving unit 801 is used to receive the mirrored traffic of the target data flow sent by the target network device in the service network;

[0257] The sending unit 802 is used to send the mirrored traffic of the target data flow through the mirrored network.

[0258] It should be noted that the traffic mirroring device provided in the above embodiment only uses the division of the above functional units as an example when performing data flow identification. In actual applications, the above functions can be assigned to different functional units as needed, that is, the internal structure of the device is divided into different functional units to complete all or part of the functions described above. In addition, the traffic mirroring device provided in the above embodiment and the traffic mirroring method embodiment belong to the same concept, and the specific implementation process is detailed in the method embodiment, which will not be repeated here.

[0259] The descriptions of the processes corresponding to the above-mentioned figures have different emphases. For parts that are not described in detail in a certain process, please refer to the relevant descriptions of other processes.

[0260] Fig.12 The schematic diagram of the structure of the electronic device 150 provided in the embodiment of the present application is shown. The electronic device may be a control device, a target network device or a first network device. Fig.12 The electronic device 150 is used to perform the above Figures 5 to 8 The operations involved in any of the traffic mirroring methods shown in the figure. The electronic device 150 can be implemented by a general bus architecture.

[0261] like Fig.12 As shown, the electronic device 150 includes at least one processor 151 , a memory 153 , and at least one communication interface 154 .

[0262] The processor 151 is, for example, a general-purpose central processing unit (CPU), a digital signal processor (DSP), a network processor (NP), a data processing unit (DPU), a microprocessor, or one or more integrated circuits for implementing the solution of the present application. For example, the processor 151 includes an application-specific integrated circuit (ASIC), a programmable logic device (PLD) or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. The PLD is, for example, a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL), or any combination thereof. It can implement or execute various logic blocks, modules, and circuits described in conjunction with the disclosure of the embodiments of the present application. The processor may also be a combination that implements a computing function, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, and the like.

[0263] Optionally, the electronic device 150 further includes a bus. The bus is used to transmit information between the components of the electronic device 150. The bus may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Fig.12 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.

[0264] The memory 153 is, for example, a read-only memory (ROM) or other types of static storage devices that can store static information and instructions, or a random access memory (RAM) or other types of dynamic storage devices that can store information and instructions, or an electrically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compressed optical disc, laser disc, optical disc, digital versatile disc, Blu-ray disc, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto. The memory 153 is, for example, independent and connected to the processor 151 through a bus. The memory 153 can also be integrated with the processor 151.

[0265] The communication interface 154 uses any transceiver-like device to communicate with other devices or communication networks, and the communication network can be Ethernet, a radio access network (RAN) or a wireless local area network (WLAN), etc. The communication interface 154 may include a wired communication interface and may also include a wireless communication interface. Specifically, the communication interface 154 may be an Ethernet interface, a Fast Ethernet (FE) interface, a Gigabit Ethernet (GE) interface, an Asynchronous Transfer Mode (ATM) interface, a wireless local area network (WLAN) interface, a cellular network communication interface or a combination thereof. The Ethernet interface may be an optical interface, an electrical interface or a combination thereof. In an embodiment of the present application, the communication interface 154 may be used for the electronic device 150 to communicate with other devices.

[0266] In a specific implementation, as an embodiment, the processor 151 may include one or more CPUs, such as Fig.12 0 and CPU1 shown in FIG. Each of these processors may be a single-CPU processor or a multi-CPU processor. A processor herein may refer to one or more devices, circuits, and / or processing cores for processing data (e.g., computer program instructions).

[0267] In a specific implementation, as an embodiment, the electronic device 150 may include multiple processors, such as Fig.12 1 and 155. Each of these processors may be a single-CPU or a multi-CPU. A processor herein may refer to one or more devices, circuits, and / or processing cores for processing data (such as computer program instructions).

[0268] In a specific implementation, as an embodiment, the electronic device 150 may also include an output device and an input device. The output device communicates with the processor 151 and can display information in a variety of ways. For example, the output device may be a liquid crystal display (LCD), a light emitting diode (LED) display device, a cathode ray tube (CRT) display device, or a projector. The input device communicates with the processor 151 and can receive user input in a variety of ways. For example, the input device may be a mouse, a keyboard, a touch screen device, or a sensor device.

[0269] In some embodiments, the memory 153 is used to store the program code 1510 for executing the solution of the present application, and the processor 151 can execute the program code 1510 stored in the memory 153. That is, the electronic device 150 can implement the traffic mirroring method provided by the method embodiment by executing the program code 1510 in the memory 153 through the processor 151. The program code 1510 may include one or more software modules. Optionally, the processor 151 itself may also store the program code or instructions for executing the solution of the present application.

[0270] In a specific embodiment, the electronic device 150 of the embodiment of the present application may correspond to the controller in each of the above method embodiments, and the processor 151 in the electronic device 150 reads the instructions in the memory 153 so that Fig.12 The illustrated electronic device 150 is capable of performing all or part of the operations performed by the controller.

[0271] Specifically, the processor 151 is used to determine a target network device in a service network based on a target data flow, where the target network device is a network device that transmits the target data flow; send a first mirror instruction to the target network device, where the first mirror instruction is used to instruct the target network device to send the mirror traffic of the target data flow to the first network device, where the first network device is used to send the mirror traffic of the target data flow through a mirror network.

[0272] Alternatively, the processor 151 is used to receive a first mirroring instruction sent by a control device, and the target network device belongs to a business network; based on the first mirroring instruction, the mirrored traffic of the target data flow is sent to a first network device in the business network, and the first network device is used to send the mirrored traffic of the target data flow through the mirrored network.

[0273] Alternatively, the processor 151 is configured to receive mirrored traffic of a target data flow sent by a target network device, wherein both the first network device and the target network device belong to a service network; and send the mirrored traffic of the target data flow through a mirrored network.

[0274] For the sake of brevity, other optional implementations are not described here in detail.

[0275] in, Figures 5 to 8 Each step of the traffic mirroring method shown in any one of the figures is completed by an integrated logic circuit of hardware or software instructions in the processor of the electronic device 150. The steps of the method disclosed in the embodiment of the present application can be directly embodied as being executed by a hardware processor, or can be executed by a combination of hardware and software modules in the processor. The software module can be located in a mature storage medium in the art such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory, and the processor reads the information in the memory and completes the steps of the above method in combination with its hardware. To avoid repetition, it will not be described in detail here.

[0276] The embodiment of the present application also provides a chip, including: an input interface, an output interface, a processor and a memory. The input interface, the output interface, the processor and the memory are connected through an internal connection path. The processor is used to execute the code in the memory. When the code is executed, the processor is used to execute any of the above-mentioned traffic mirroring methods.

[0277] It should be understood that the processor may be a CPU, or other general-purpose processors, DSPs, ASICs, FPGAs or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc. It is worth noting that the processor may be a processor supporting the ARM architecture.

[0278] Further, in an optional embodiment, the processor is one or more and the memory is one or more. Optionally, the memory can be integrated with the processor, or the memory and the processor are separately arranged. The memory can include a read-only memory and a random access memory, and provide instructions and data to the processor. The memory can also include a non-volatile random access memory. For example, the memory can also store a reference block and a target block.

[0279] The memory may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memory. Among them, the non-volatile memory may be a ROM, a PROM, an EPROM, an EEPROM, or a flash memory. The volatile memory may be a RAM, which is used as an external cache. By way of example but not limitation, many forms of RAM are available. For example, SRAM, DRAM, SDRAM, DDR SDRAM, ESDRAM, SLDRAM, and DR RAM.

[0280] In an embodiment of the present application, a computer-readable storage medium is also provided, which stores computer instructions. When the computer instructions stored in the computer-readable storage medium are executed by an electronic device, the electronic device executes the traffic mirroring method provided above.

[0281] In an embodiment of the present application, a computer program product including instructions is also provided, which, when executed on an electronic device, enables the electronic device to execute the traffic mirroring method provided above.

[0282] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in this application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) mode. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integration. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state hard disk Solid State Disk), etc.

[0283] A person skilled in the art will understand that all or part of the steps to implement the above embodiments may be accomplished by hardware or by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a disk or an optical disk, etc.

[0284] The above are only optional embodiments of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed in the present application should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

[0285] Unless otherwise defined, the technical or scientific terms used herein shall have the usual meanings understood by persons of ordinary skill in the field to which this application belongs. The words "first", "second", "third" and similar terms used in the patent application specification and claims of this application do not indicate any order, quantity or importance, but are only used to distinguish different components. Similarly, similar words such as "one" or "one" do not indicate a quantitative limitation, but rather indicate the presence of at least one. Similar words such as "include" or "comprise" mean that the elements or objects appearing before "include" or "comprises" cover the elements or objects listed after "include" or "comprises" and their equivalents, and do not exclude other elements or objects.

[0286] The above is only an embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application should be included in the protection scope of the present application.

Claims

1. A traffic mirroring system, characterized in that: The traffic mirroring system includes: a control device, a service network and a mirroring network; The control device is used to determine a target network device in the service network based on a target data flow, wherein the target network device is a network device that transmits the target data flow; The control device is further used to send a first mirroring instruction to the target network device; The target network device is used to send the mirrored traffic of the target data flow to the first network device in the service network based on the first mirroring instruction; The first network device is used to send the mirrored traffic of the target data flow through the mirrored network.

2. The traffic mirroring system according to claim 1, characterized in that: The control device is used to obtain the transmission path of the target data flow in the service network; and determine at least one network device on the transmission path as the target network device.

3. The traffic mirroring system according to claim 1 or 2, characterized in that: The service network includes at least one of the first network devices; The control device is further configured to select, based on at least one of a length of the first path, a performance of the first path, and a load of the first network device, one of the first network devices as a first network device for transmitting the mirrored traffic of the target data flow; The first path is a path from the target network device to the first network device.

4. The traffic mirroring system according to any one of claims 1 to 3, characterized in that: The first network device is used to receive the mirrored traffic of the target data flow sent by the target network device; and send the mirrored traffic of the target data flow to the mirrored network; The mirror network is used to send the mirror traffic of the target data flow to the analysis device.

5. The traffic mirroring system according to claim 4, characterized in that: The mirror network includes a plurality of mirror traffic transmission devices; The mirrored traffic transmission device is used to determine the forwarding port of the mirrored traffic of the target data flow according to the mirrored traffic forwarding strategy when receiving the mirrored traffic of the target data flow; The mirrored traffic of the target data flow is sent to the analysis device through the forwarding port.

6. The traffic mirroring system according to claim 5, characterized in that: The control device is further configured to determine, according to the topology of the mirror network, a forwarding path from the first network device to the analysis device based on at least one of a length of the second path and a performance of the second path; Based on the forwarding path, sending a mirrored traffic forwarding strategy to a mirrored traffic transmission device of the mirrored network on the forwarding path; The second path is a path from the first network device to the analysis device.

7. The traffic mirroring system according to any one of claims 4 to 6, characterized in that: The control device and the analysis device are the same device, or the control device and the analysis device are different devices.

8. A traffic mirroring method, characterized in that: The method comprises: The control device determines a target network device in the service network based on the target data flow, wherein the target network device is a network device that transmits the target data flow; The control device sends a first mirroring instruction to the target network device, wherein the first mirroring instruction is used to instruct the target network device to send the mirrored traffic of the target data flow to the first network device, and the first network device is used to send the mirrored traffic of the target data flow through the mirroring network.

9. The method according to claim 8, characterized in that The control device determines a target network device in the service network based on the target data flow, including: The control device obtains a transmission path of the target data flow in the service network; The control device determines at least one network device on the transmission path as the target network device.

10. The method according to claim 8 or 9, characterized in that: The service network includes at least one of the first network devices; the method further includes: The control device selects, based on at least one of the length of the first path, the performance of the first path, and the load of the first network device, one of the first network devices as a first network device for transmitting the mirror traffic of the target data flow; The first path is a path from the target network device to the first network device.

11. The method according to any one of claims 8 to 10, characterized in that: The method further comprises: The control device determines, according to the topology of the mirror network, a forwarding path from the first network device to the analysis device based on at least one of a length of the second path and a performance of the second path; The control device sends a mirrored traffic forwarding strategy to a mirrored traffic transmission device of the mirrored network on the forwarding path based on the forwarding path, wherein the traffic forwarding strategy is used to instruct the mirrored traffic transmission device to determine a forwarding port for the mirrored traffic of the target data flow, and to send the mirrored traffic of the target data flow to the analysis device through the forwarding port; The second path is a path from the first network device to the analysis device.

12. A traffic mirroring method, characterized in that: The method comprises: The target network device receives the first mirroring instruction sent by the control device, and the target network device belongs to the service network; The target network device sends the mirrored traffic of the target data flow to the first network device in the service network based on the first mirroring instruction, and the first network device is used to send the mirrored traffic of the target data flow through the mirroring network.

13. A traffic mirroring method, characterized in that: The method comprises: A first network device receives mirrored traffic of a target data flow sent by a target network device, wherein both the first network device and the target network device belong to a service network; The first network device sends the mirrored traffic of the target data flow through the mirrored network.

14. A traffic mirroring device, characterized in that: The device comprises: A determination unit, configured to determine a target network device in a service network based on a target data flow, wherein the target network device is a network device that transmits the target data flow; A sending unit is used to send a first mirroring instruction to the target network device, wherein the first mirroring instruction is used to instruct the target network device to send the mirrored traffic of the target data flow to the first network device, and the first network device is used to send the mirrored traffic of the target data flow through the mirroring network.

15. The device according to claim 14, characterized in that The determination unit is used to obtain a transmission path of the target data flow in the service network; and determine at least one network device on the transmission path as the target network device.

16. The device according to claim 14 or 15, characterized in that The service network includes at least one of the first network devices; The determining unit is further configured to select, based on at least one of a length of the first path, a performance of the first path, and a load of the first network device, one of the first network devices as a first network device for transmitting the mirrored traffic of the target data flow; The first path is a path from the target network device to the first network device.

17. The device according to any one of claims 14 to 16, characterized in that The determining unit is further configured to determine, according to the topology of the mirror network, a forwarding path from the first network device to the analysis device based on at least one of a length of the second path and a performance of the second path; The sending unit is further used to send a mirror traffic forwarding strategy to a mirror traffic transmission device of the mirror network on the forwarding path based on the forwarding path, wherein the traffic forwarding strategy is used to instruct the mirror traffic transmission device to determine a forwarding port for the mirror traffic of the target data flow, and send the mirror traffic of the target data flow to the analysis device through the forwarding port; The second path is a path from the first network device to the analysis device.

18. A traffic mirroring device, characterized in that: The traffic mirroring device belongs to a service network, and the device includes: A receiving unit, configured to receive a first mirroring instruction sent by a control device; A sending unit is used to send the mirrored traffic of the target data flow to the first network device in the service network based on the first mirroring instruction, and the first network device is used to send the mirrored traffic of the target data flow through the mirroring network.

19. A traffic mirroring device, characterized in that: The traffic mirroring device belongs to a service network, and the device includes: A receiving unit, configured to receive the mirrored traffic of the target data stream sent by the target network device in the service network; The sending unit is used to send the mirrored traffic of the target data flow through the mirrored network.

20. An electronic device, characterized in that: The electronic device comprises a processor and a memory, wherein the memory is used to store a software program, and the processor runs or executes the software program stored in the memory so that the electronic device implements the method according to any one of claims 8 to 13.

21. A computer-readable storage medium, characterized in that: The computer-readable storage medium is used to store program codes executed by a processor, wherein the program codes include instructions for implementing the method according to any one of claims 8 to 13.

22. A computer program product, characterized in that The computer program product comprises program codes, and when a computer runs the computer program product, the computer executes the method according to any one of claims 8 to 13.