Method for monitoring, storing and replaying network traffic based on port mirroring technology

By using port mirroring technology and tunneling technology on driverless cars, network traffic monitoring, storage and playback are realized, which solves the problem of information omission in sensor data collection and fault diagnosis, and improves fault location efficiency.

CN114500307BActive Publication Date: 2024-09-06ZHONGZHIXING (SUZHOU) TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111671847.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-31
Publication Date
2024-09-06
Estimated Expiration
2041-12-31

AI Technical Summary

Technical Problem

Existing technologies have problems with information omission and difficulty in fault diagnosis in the collection, storage, and analysis of sensor data for autonomous vehicles. In particular, it is difficult to effectively monitor and playback network traffic in multi-switch scenarios.

Method used

Adopting a network traffic monitoring, storage and playback method based on port mirroring technology, by configuring multiple network ports on the vehicle computing unit for port mirroring, the traffic receiving unit analyzes and stores data in real time, and uses GRE or VXLAN tunnel technology for traffic encapsulation and decomposition Encapsulation, supporting traffic replay.

Benefits of technology

It achieves complete monitoring and playback of autonomous vehicle network traffic, avoids information omissions in fault diagnosis, improves the efficiency of fault location and analysis, and reduces the impact on the system environment and performance of the on-board computing unit.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114500307B
    Figure CN114500307B
Patent Text Reader

Abstract

The present invention discloses a method for monitoring, storing and replaying network traffic based on port mirroring technology, including S1, selection of traffic receiving unit; S2, network design and connection; S3, configuration of port mirroring function; S4, operation of traffic receiving unit; S5, preservation of data stream; S6, realization of analysis and replay functions; the port mirroring technology commonly used in the field of network switches is transplanted to the Linux system for use through technical means, and is used in unmanned driving scenarios. A dedicated traffic receiving unit is externally installed to avoid affecting the system environment or performance of the on-board computing unit. Traffic replay can restore the packet capture scenario as it is to perform fault location and performance analysis. It avoids the situation where multiple tests are required to reproduce the fault when the diagnostic information such as logs collected by the application cannot locate the problem.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of autonomous driving, in particular to a method for monitoring, storing and replaying network traffic based on port mirroring technology. Background Art

[0002] Currently, the aggregation, storage and playback of sensor data of unmanned vehicles are often in the following two forms:

[0003] Form 1: Record rosbag (rosbag is also called bag, which is the file format used to store message data in ROS) through ROS (Robot Operating System), or use other tools to collect and store data from various sensors.

[0004] This technical solution only collects and stores specific data at the application layer, which may miss some important information. When performing fault diagnosis later, the data can only be analyzed or replayed through the corresponding application, and the system and data status at that time cannot be fully and truly restored.

[0005] Form 2: Port mirroring technology is used in the field of network switches to copy the traffic of one or more ports and forward it to a specific mirror port for network analysis.

[0006] This technical solution is to configure port mirroring on the switch, and it is unclear whether it can be used in unmanned driving scenarios. This solution is to collect, store or analyze global traffic from the perspective of the switch. If the on-board computing unit is connected to multiple switches at the same time, it is also necessary to perform relevant configurations on multiple switches and connect to the traffic receiving unit. In addition, only high-end fully managed switches support the port mirroring function, and such switches are rarely used in unmanned vehicles.

[0007] In summary, existing solutions cannot effectively solve the problems of data collection, storage or analysis. In the event of a failure at a later stage, it is also impossible to effectively analyze or replay the situation at the time of the accident. Summary of the invention

[0008] The purpose of the present invention is to solve the above deficiencies in the prior art and provide a method for network traffic monitoring, storage and playback based on port mirroring technology.

[0009] A method for monitoring, storing and replaying network traffic based on port mirroring technology. The on-board computing unit will be equipped with multiple network ports to connect various sensors through Ethernet, including but not limited to lidar, millimeter-wave radar, and cameras. There will also be a network port for connecting to 4G and 5G CPE for access to the Internet and cloud servers, and another network port for connecting to the traffic receiving unit. Port mirroring is configured on all network ports of the on-board computing unit, and a copy of the traffic from these ports will be sent to the mirroring port, that is, the network port connected to the traffic receiving unit. After receiving the traffic, the traffic receiving unit can perform real-time analysis and storage. If necessary, the traffic receiving unit can replay the traffic to the on-board computing unit or other devices.

[0010] Common name explanation:

[0011] On-board computing unit: An on-board terminal with computing processing capabilities on an unmanned vehicle. It can be an industrial personal computer (IPC) or other computing devices based on x86 or arm architectures. It has important computer properties and features, such as a computer motherboard, CPU, GPU, hard disk, memory, various peripherals and ports, an operating system, a control network and protocols, etc. Generally, various Linux operating systems are installed.

[0012] Traffic receiving unit: Similar to the on-board computing unit, it is also a computer of x86 or ARM architecture, with a computer motherboard, CPU, memory, hard disk and at least one network port for receiving network traffic from the on-board computing unit, and needs to install the Linux operating system.

[0013] Various sensors: including but not limited to various radars, cameras and other sensors that send data to the on-board computing unit through the network.

[0014] CPE: (Customer Premise Equipment) literally means customer premise equipment, which is actually a mobile signal access device that receives 4G or 5G mobile signals and forwards them in the form of wireless WiFi signals or wired networks.

[0015] If the real-time traffic monitoring and analysis service is deployed on the traffic receiving unit, real-time traffic monitoring and analysis can be performed directly through the traffic receiving unit. The collected traffic data can be saved in formats such as cap, pcap or pcapng. cap, pcap or pcapng are all file formats specifically used to save captured data packets. You can use tools such as tcpreplay to open pcap or pcapng files to replay the traffic on the vehicle computing unit and completely restore the network scene at that time. You can also connect the traffic receiving unit to a computer in the development or test environment to replay the traffic.

[0016] This method specifically comprises the following steps:

[0017] S1. Selection of flow receiving unit;

[0018] Computer equipment, including a motherboard, CPU, memory, hard disk and at least one network port for receiving traffic data; the computer equipment is preset with a Linux-based operating system; low-power, lightweight computer equipment is preferred. It has a motherboard, CPU, memory, hard disk and at least one network port for receiving traffic data from the on-board computing unit. No other peripheral devices such as GPU are required. The network port should support 10G network, and the hard disk should be a solid-state drive. If a real-time traffic monitoring or analysis system needs to be deployed on the traffic receiving unit, a better CPU and memory are required. The Linux operating system needs to be installed on the traffic receiving unit.

[0019] S2, network design and connection;

[0020] Through port aggregation, multiple network ports on the vehicle computing unit are aggregated into a virtual network port, and the bandwidth of the virtual network port is increased;

[0021] The vehicle computing unit generally has multiple network ports, and it is necessary to evaluate the aggregate traffic of the service ports such as sensors or CPE. The transmission capacity of the network port to which the traffic receiving unit is connected needs to be greater than the aggregate traffic of the service port. Otherwise, it is necessary to filter and screen the traffic data in the port mirroring configuration step. Alternatively, multiple network ports can be used to connect the vehicle computing unit and the traffic receiving unit, and multiple physical network ports can be virtualized into one logical network port through technologies such as port aggregation to achieve the function of increasing bandwidth.

[0022] S3, port mirroring function configuration;

[0023] Based on the functional module with flow control function in the Linux kernel, through encapsulation technology, the original data packet of the mirrored flow is used as the payload, the physical address and IP address of the on-board computing unit are encapsulated as the source address, the physical address and IP address of the flow receiving unit are encapsulated as the destination address, and the encapsulated flow information is obtained;

[0024] Configuration of port mirroring function:

[0025] 1. The Linux kernel has a flow control module, TC, which can realize the mirroring function of data packets. The network tool iproute2 in Linux contains the tc command to realize the mirroring or redirection of data packets. (Mirroring means to copy an extra copy of the data to send, and redirection means to forward the current data directly). The command also includes the settings of packet filtering and other functions.

[0026] 2. Traffic mirrored by TC cannot be sent directly to the traffic receiving unit. The reason is that the source address or destination address of the original data packet header is the on-board computing unit itself, which will cause a loop and prevent the traffic from being sent out. In addition, the traffic receiving unit will also check the source address and destination address of the data packet header. If it is not itself, it will directly discard the data packet.

[0027] 3. You can use GRE (Generic Routing Encapsulation is a general routing encapsulation protocol that can encapsulate datagrams of certain network layer protocols so that these encapsulated datagrams can be transmitted in the IPv4 network) or VXLAN (Virtual eXtensible Local Area Network is a tunnel technology that can establish a Layer 2 Ethernet network tunnel based on a Layer 3 network, thereby achieving cross-regional Layer 2 interconnection) and other traffic encapsulation technologies to encapsulate and send the mirrored traffic in the vehicle computing unit. The traffic receiving unit can also perform relevant configurations of GRE or VXLAN to receive the corresponding mirrored traffic and decapsulate it.

[0028] 4. These encapsulation technologies are usually called tunneling technologies. They use the original data packets of the mirrored traffic as the payload, and encapsulate the physical address and IP address of the on-board computing unit as the source address, and the physical address and IP address of the encapsulated traffic receiving unit as the destination address in the outer header. The on-board computing unit and the traffic receiving unit will check the addresses encapsulated in the outer header, and if they are correct, they will send and receive the mirrored traffic packets normally. The following is the data encapsulation method of VXLAN, and GRE is also a similar encapsulation method.

[0029] 5. Tunnel technologies such as GRE or VXLAN will create corresponding virtual network ports on the physical network ports. A virtual tunnel will be created between the corresponding virtual network ports at both ends. The traffic will be encapsulated before entering the tunnel and decapsulated after leaving the tunnel. The traffic mirrored by TC on the vehicle computing unit needs to be specified to be sent from the virtual network port created by the tunnel technology, and the traffic receiving unit needs to receive the traffic on the virtual network port created by the tunnel technology.

[0030] S4, the flow receiving unit works;

[0031] Set up a traffic receiving unit and capture and obtain the encapsulated traffic information;

[0032] S5, data stream preservation;

[0033] Monitor the data network in real time, package and save the information that needs to be saved, and issue an alarm or take major response measures for suspicious data transmission;

[0034] S6, realization of analysis and replay functions;

[0035] The saved traffic data is replayed through the tool and sent to the on-board computing unit through the network port during playback.

[0036] Furthermore, the S4 traffic receiving unit operation includes the following steps:

[0037] S1, determining whether the original data packet in the vehicle-mounted computing unit needs to be filtered;

[0038] S2, sending the original data packets that do not need to be filtered and the filtered data packets to Linux;

[0039] S3, in the Linux kernel space, mirroring is performed through TC;

[0040] S4, encapsulate the data through GRE live water VXLAN tunnel technology;

[0041] S5, sending the encapsulated data to the traffic receiving unit;

[0042] S6. Receiving the data stream on the virtual port with high bandwidth;

[0043] S7. Use tools to convert data into a dedicated format for storage.

[0044] On the traffic receiving unit, you can use tools such as tcpdump or Wireshark to receive traffic on the virtual port created by the tunnel technology. tcpdump is a sniffing tool that runs under the command line. It allows users to intercept and display network data packets sent or received through the network connected to the computer. Wireshark is a network data packet analysis software that can intercept and analyze network data packets. These software support saving received data packets in file formats such as cap, pcap, pcapng, etc.

[0045] Further, proprietary formats include .cap, .pcap or .pcapng.

[0046] Furthermore, the data replay function is realized by directly replaying the saved storage information through the tcpreplay tool.

[0047] Further, the architecture of the port mirroring function includes an onboard computing unit and a traffic receiving unit;

[0048] The vehicle-mounted computing unit and the traffic receiving unit are connected via a physical network;

[0049] Several physical network ports on the vehicle computing unit and the traffic receiving unit each constitute their own virtual network port, and a virtual network tunnel is formed between the two virtual network ports.

[0050] Furthermore, the type of the virtual network port is GRE or VXLAN.

[0051] Furthermore, the tool used on the traffic receiving unit is tcpdump or Wireshark.

[0052] Traffic receiving unit deploys real-time traffic monitoring and analysis system:

[0053] You can use Wireshark, tcpdump or deploy commercial software such as PRTG, Solarwinds and other professional data packet analysis software for real-time traffic monitoring and analysis. You can also deploy network security services such as IDS (Intrusion Detection System, an intrusion detection system is a network security device that monitors network transmission in real time and issues an alarm or takes active response measures when suspicious transmission is found).

[0054] Traffic replay using related tools:

[0055] Since the received traffic is all decapsulated, you can directly replay the saved cap, pcap, or pcapng through tools such as tcpreplay. (tcpreplay is a pcap packet replay tool that can replay the packets captured by tools such as Ethreal and Wireshark as is or after any modification. It allows you to make any modification to the message, mainly to the layer 2, layer 3, and layer 4 message headers, specify the speed of replaying the message, etc., so that tcpreplay can be used to reproduce the packet capture scenario to locate bugs, and replay at a very fast speed to achieve stress testing. tcpreplay also includes some other auxiliary tools such as tcpprep, tcprewrite, tcpreplay, tcpbridge, etc., which can be used to prepare the cache for sending packets, rewrite messages, etc.) You can choose to replay the traffic on the traffic receiving unit, and send it out from the specified network port during playback to replay the traffic to the on-board computing unit or other devices.

[0056] Beneficial effects:

[0057] The port mirroring technology commonly used in the field of network switches is transplanted to the Linux system through technical means for use, and is used in unmanned driving scenarios. A dedicated traffic receiving unit is installed externally to avoid the impact on the system environment or performance of the on-board computing unit. Traffic replay can restore the captured packet scenario as it is for fault location and performance analysis. This avoids the situation where multiple tests are required to reproduce the fault when the diagnostic information such as logs collected by the application cannot locate the problem. BRIEF DESCRIPTION OF THE DRAWINGS

[0058] Figure 1 A flowchart of the network traffic monitoring, storage and playback method;

[0059] Figure 2 A network structure diagram for tunneling technology;

[0060] Figure 3 Refer to the figure for the implementation steps of the configuration of the port mirroring function;

[0061] Figure 4 This is a reference diagram of the state changes of the original data packet. DETAILED DESCRIPTION

[0062] The following will disclose the embodiments of the present invention with drawings. For the purpose of clear description, many practical details will be described together in the following description. However, it should be understood that these practical details should not be used to limit the present invention. That is, in some embodiments of the present invention, these practical details are not necessary. In addition, for the purpose of simplifying the drawings, some conventional structures and components will be depicted in a simple schematic manner in the drawings.

[0063] Implementation example: Figure 1-4 As shown, a method for monitoring, storing and replaying network traffic includes the following components:

[0064] Flow receiving unit selection:

[0065] Choose a low-power, lightweight computer device. It has a motherboard, CPU, memory, hard disk and at least one network port for receiving traffic data from the vehicle computing unit.

[0066] Other peripheral devices such as GPU are required. The network port supports 10G network and the hard disk uses a solid state drive.

[0067] If you need to deploy a real-time traffic monitoring or analysis system on the traffic receiving unit, you need to choose a better CPU and memory.

[0068] The Linux operating system needs to be installed on the traffic receiving unit.

[0069] Network design and connection:

[0070] The vehicle computing unit generally has multiple network ports, and it is necessary to evaluate the aggregate traffic of the service ports such as sensors or CPE. The transmission capacity of the network port to which the traffic receiving unit is connected needs to be greater than the aggregate traffic of the service port. Otherwise, it is necessary to filter and screen the traffic data in the port mirroring configuration step.

[0071] Use multiple network ports to connect the on-board computing unit and the traffic receiving unit, and use technologies such as port aggregation to virtualize multiple physical network ports into one logical network port to achieve the function of increasing bandwidth.

[0072] Port mirroring function configuration;

[0073] Based on the functional module with flow control function in the Linux kernel, through encapsulation technology, the original data packet of the mirrored flow is used as the payload, the physical address and IP address of the on-board computing unit are encapsulated as the source address, the physical address and IP address of the flow receiving unit are encapsulated as the destination address, and the encapsulated flow information is obtained;

[0074] The traffic receiving unit receives the mirrored traffic:

[0075] On the traffic receiving unit, the Wireshark tool can be used to receive traffic on the virtual port created by the tunnel technology. Wireshark is a network packet analysis software that can intercept and analyze network packets. These software support saving received packets in file formats such as cap, pcap, and pcapng. The state changes of the original data packet refer to Figure 4 .

[0076] Traffic receiving unit deploys real-time traffic monitoring and analysis system:

[0077] Network security services such as IDS can be deployed. Intrusion Detection System is a network security device that monitors network transmission in real time and issues alarms or takes proactive response measures when suspicious transmission is detected.

[0078] Traffic replay using related tools:

[0079] Since the received traffic is all decapsulated traffic, the saved pcapng can be directly replayed using the tcpreplay tool.

[0080] tcpreplay is a pcap packet replay tool that can replay packets captured by tools such as Ethreal and Wireshark as is or after any modification.

[0081] It allows you to make arbitrary modifications to the message, mainly to the layer 2, layer 3, and layer 4 message headers, specify the speed of replaying the message, etc., so that tcpreplay can be used to reproduce the packet capture scenario to locate bugs, and replay at a very fast speed to achieve stress testing.

[0082] Tcpreplay also includes some other auxiliary tools such as tcpprep, tcprewrite, tcpreplay, tcpbridge, etc., which can be used to prepare the cache for sending packets, rewrite messages, etc. You can choose to replay the traffic on the traffic receiving unit, and send it from the specified network port to replay the traffic to the on-board computing unit or other devices during playback.

[0083] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims

1. A method for monitoring, storing and replaying network traffic based on port mirroring technology, characterized in that: The following steps are involved: S1. Selection of flow receiving unit; Computer equipment, including a motherboard, a CPU, a memory, a hard disk, and at least one network port for receiving traffic data; The computer equipment is pre-installed with a Linux-based operating system; S2, network design and connection; Through port aggregation, multiple network ports on the vehicle computing unit are aggregated into a virtual network port, and the bandwidth of the virtual network port is increased; S3, port mirroring function configuration; Based on the functional module with flow control function in the Linux kernel, through encapsulation technology, the original data packet of the mirrored flow is used as the payload, the physical address and IP address of the on-board computing unit are encapsulated as the source address, the physical address and IP address of the flow receiving unit are encapsulated as the destination address, and the encapsulated flow information is obtained; S4, the flow receiving unit works; Set up a traffic receiving unit and capture and obtain the encapsulated traffic information; S5, data stream preservation; Monitor the data network in real time, package and save the information that needs to be saved, and issue an alarm or take major response measures for suspicious data transmission; S6, realization of analysis and replay functions; The saved traffic data is replayed through the tool and sent to the on-board computing unit through the network port during playback.

2. The method for monitoring, storing and replaying network traffic based on port mirroring technology according to claim 1, characterized in that: The S4 traffic receiving unit operation includes the following steps: S1, determining whether the original data packet in the vehicle-mounted computing unit needs to be filtered; S2, sending the original data packets that do not need to be filtered and the filtered data packets to Linux; S3, in the Linux kernel space, mirroring is performed through TC; S4, encapsulate the data through GRE live water VXLAN tunnel technology; S5, sending the encapsulated data to the traffic receiving unit; S6. Receiving the data stream on the virtual port with high bandwidth; S7. Use tools to convert data into a dedicated format for storage.

3. The method for monitoring, storing and replaying network traffic based on port mirroring technology according to claim 2, characterized in that: Specialized formats include .cap, .pcap, or .pcapng.

4. The method for monitoring, storing and replaying network traffic based on port mirroring technology according to claim 1, characterized in that: The data replay function is realized by directly replaying the saved storage information through the tcpreplay tool.

5. The method for monitoring, storing and replaying network traffic based on port mirroring technology according to claim 1, characterized in that: The architecture of the port mirroring function includes an on-board computing unit and a traffic receiving unit; The vehicle-mounted computing unit and the traffic receiving unit are connected via a physical network; Several physical network ports on the vehicle computing unit and the traffic receiving unit each constitute their own virtual network port, and a virtual network tunnel is formed between the two virtual network ports.

6. The method for monitoring, storing and replaying network traffic based on port mirroring technology according to claim 5, characterized in that: The type of the virtual network port is GRE or VXLAN.

7. The method for monitoring, storing and replaying network traffic based on port mirroring technology according to claim 1, characterized in that: The tools used on the traffic receiving unit are tcpdump or Wireshark.