Flow simulation method and device and simulation test system
By generating metadata messages for traffic simulation, the problem of physical port bandwidth limitation is solved, enabling accurate simulation and performance testing of high-speed network environments.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-01-09
- Publication Date
- 2026-04-07
AI Technical Summary
Existing network simulation solutions are limited by the bandwidth of a single network card on a physical server, making it impossible to simulate the traffic pressure, congestion control, and abnormal traffic of high-speed networks, which severely restricts their application in network capacity assessment and fault drills.
Simulation is achieved by extracting key features of the traffic to be simulated to generate metadata messages. These metadata messages carry complete traffic description information rather than the byte stream of the actual traffic, thus overcoming the limitations of physical port bandwidth.
It enables high-traffic simulation testing within limited bandwidth, improving the flexibility and practicality of network performance testing, and accurately simulating traffic pressure and abnormal behavior in high-speed network environments.
Smart Images

Figure CN121814596A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer network simulation technology, and in particular to a traffic simulation method, apparatus and simulation testing system. Background Technology
[0002] As network scale expands and topology complexity increases, network simulation technology, as a key carrier of digital twins, has become a core tool for network planning and operation. Existing network simulation solutions rely on virtual links between simulation nodes to communicate with a single network card on a physical server. Limited by the bandwidth of physical ports, they cannot simulate the traffic pressure, congestion control, and abnormal traffic of high-speed networks, which severely restricts their application in network capacity assessment and fault drills. Therefore, there is an urgent need for a high-speed network traffic simulation solution that combines high routing fidelity with breaking through hardware limitations. Summary of the Invention
[0003] This application provides a traffic simulation method, apparatus, and simulation testing system to address the limitation of port bandwidth on high-speed network traffic simulation.
[0004] In a first aspect, embodiments of this application provide a traffic simulation method, including: Determine the key traffic characteristics of the traffic to be simulated. The key traffic characteristics include at least the number of data packets, the number of bytes, and the duration of the flow. Generate metadata describing key traffic characteristics and encapsulate the metadata into metadata messages for traffic simulation based on the metadata messages.
[0005] In some embodiments, determining key traffic characteristics of the traffic to be simulated includes: extracting traffic characteristics of the traffic to be simulated based on the structured logs of the traffic to be simulated, and determining key traffic characteristics from the traffic characteristics of the traffic to be simulated; or, receiving traffic characteristic information input by a user, and determining key traffic characteristics based on the traffic characteristic information.
[0006] In some embodiments, the method further includes: transmitting traffic in a simulated network environment using metadata messages, the simulated network environment including multiple simulated network nodes and simulated links between each simulated network node; obtaining transmission records of metadata messages in each simulated network node; and determining the traffic transmission status of each simulated link in the simulated network environment based on the transmission records.
[0007] In some embodiments, traffic transmission in a simulated network environment using metadata messages includes: determining a source simulator node and a target simulator node among multiple simulated network nodes in the simulated network environment; and transmitting metadata messages in the simulated network environment using the IP address of the source simulator node as the source address and the IP address of the target simulator node as the destination address.
[0008] In some embodiments, obtaining the transmission record of metadata messages in each simulated network node includes: starting a network probe service on each simulated network node in the simulated network environment; intercepting metadata messages in the data stream passing through each simulated network node based on the network probe service, and parsing out the corresponding metadata; for any simulated network node, assigning a node identifier and a timestamp to the parsed metadata as a transmission record of the metadata message in the simulated network node.
[0009] In some embodiments, determining the traffic transmission status of each simulated link in the simulated network environment based on transmission records includes: for any simulated link in the simulated network environment, determining multiple metadata messages that pass through the simulated link within a preset time period based on the transmission records of the simulated network nodes on both sides of the simulated link within a preset time period; and determining the traffic transmission status of the simulated link based on the number of bytes described in the metadata of the multiple metadata messages.
[0010] In some embodiments, the method further includes: determining the network performance test results of the simulated network environment based on the traffic transmission status of each simulated link, wherein the network performance test results include at least the link utilization and packet loss rate of each simulated link.
[0011] In some embodiments, the network performance test results of the simulated network environment are determined based on the traffic transmission status of each simulated link, including: for any simulated link in the simulated network environment, determining the link utilization of the simulated link based on the traffic transmission status and the link bandwidth of the simulated link; and determining the packet loss rate of the simulated link based on the traffic transmission status, link utilization, and packet loss rate calculation model.
[0012] Secondly, embodiments of this application provide a flow simulation device, comprising: The traffic characteristic determination module is used to determine the key traffic characteristics of the traffic to be simulated. The key traffic characteristics include at least the number of data packets, the number of bytes, and the duration of the flow. The simulated traffic generation module is used to generate metadata describing key traffic characteristics and encapsulate the metadata into metadata messages for traffic simulation based on the metadata messages.
[0013] Thirdly, this application provides a simulation testing system, including a simulation network environment, a simulation traffic generator, a data acquisition module, and a computing module. The simulation network environment includes multiple simulated network nodes and simulation links between each simulated network node. The simulated traffic generator is used to determine the key traffic characteristics of the traffic to be simulated based on user input information or external traffic data sources, and encapsulate the key traffic characteristics into metadata messages so that the metadata messages can be transmitted as simulated traffic in the simulated network environment. The data acquisition module includes network probes deployed on each simulated network node in the simulated network environment, which are used to capture and parse metadata messages in the data stream passing through each simulated network node to obtain the transmission record of metadata messages on each simulated network node; The calculation module is used to determine the traffic transmission status of each simulated link in the simulated network environment based on the transmission records of metadata messages collected by the data acquisition module in each simulated network node, and to determine the network performance test results of the simulated network environment based on the traffic transmission status of each simulated link.
[0014] Based on the method of this application embodiment, key traffic features of the traffic to be simulated can be extracted and metadata describing the key traffic features can be generated. The metadata is then encapsulated into metadata messages for traffic simulation. The metadata messages carry complete traffic description information rather than the byte stream of real traffic when the simulated traffic is transmitted. This can overcome the limitation of physical port bandwidth on traffic simulation testing and improve the inference and prediction capabilities of digital twins.
[0015] The above description is only an overview of the technical solution of this application. In order to better understand the technical means of this application, it can be implemented according to the contents of the specification. In order to make the above and other objects, features and advantages of this application more obvious and understandable, specific embodiments of this application are given below. Attached Figure Description
[0016] The accompanying drawings are provided for a better understanding of this solution and do not constitute a limitation of this application. Wherein: Figure 1 This is a flowchart illustrating a traffic simulation method provided in an exemplary embodiment of this application. Figure 1 ; Figure 2 This is a flowchart illustrating a traffic simulation method provided in an exemplary embodiment of this application. Figure 2 ; Figure 3 This is a flowchart illustrating a traffic simulation method provided in an exemplary embodiment of this application. Figure 3 ; Figure 4 This is a schematic diagram of a process for performing traffic simulation testing in a simulated network environment using metadata messages, provided by an exemplary embodiment of this application. Figure 5 This is a schematic diagram of the system architecture of the simulation testing system provided in an exemplary embodiment of this application; Figure 6 This is a schematic diagram of a flow simulation apparatus provided in an exemplary embodiment of this application; Figure 7 This is a block diagram of an electronic device used to implement the embodiments of this application. Detailed Implementation
[0017] In the following description, only certain exemplary embodiments are briefly described. As those skilled in the art will recognize, the described embodiments can be modified in various ways without departing from the concept or scope of this application. Therefore, the drawings and description are considered to be exemplary in nature and not restrictive.
[0018] To facilitate understanding of the technical solutions of the embodiments of this application, the relevant technologies of the embodiments of this application are described below. The following relevant technologies are optional solutions and can be combined with the technical solutions of the embodiments of this application in any way, and all of them fall within the protection scope of the embodiments of this application.
[0019] Application scenarios Network simulation technology, as a key carrier of digital twins, is a core tool for network planning and operation. Existing network simulation technologies are mainly divided into two categories. The first category is discrete event simulators, such as NS-2 / 3 and OMNeT++. These tools use software to simulate the behavior of network devices and the transmission process of data packets. Their advantage lies in the extremely significant controllability and repeatability of the simulation.
[0020] However, to simulate complex large-scale networks, detailed models need to be built, which often results in extremely slow simulation speeds, significant discrepancies with the real environment, and limited fidelity, especially when simulating modern high-speed network equipment and complex routing protocols.
[0021] The second category is simulation platforms based on virtualization technology, such as simulation environments built using Linux namespaces, virtual Ethernet pairs, and open-source routing suites like FRR (Free Range Routing). This type of solution utilizes operating system-level virtualization technology to create multiple isolated network nodes (routers, hosts) on a single physical server and run a real routing protocol stack. Its greatest advantage lies in its ability to reproduce the actual network routing topology and policies with extremely high accuracy. By parsing the configuration files of actual network devices, it can reproduce router interfaces, ISIS / OSPF link states, BGP neighbor relationships, IPv4 / IPv6 routing tables, and policy routing in the simulation environment with near 1:1 accuracy, providing an unparalleled foundation of realism for network simulation.
[0022] However, in this virtualization-based high-performance routing simulation scheme, all virtual links between simulated nodes ultimately communicate through a single network interface card (NIC) port on the physical server. While virtualization technology can perfectly simulate routing logic, the port bandwidth of the physical NIC becomes a significant bottleneck. For example, the single-port bandwidth of a typical server is usually 1Gbps or 2.5Gbps. Although 10GbE NICs are widely used, their single-queue processing capacity may still be limited when simulating a large number of micro-latency interactions. This means that regardless of whether the link configuration in the simulation environment is 10Gbps, 100Gbps, or higher, the actual traffic it can carry will never exceed the total throughput capacity of the underlying physical ports (typically a maximum of about 2Gbps). Therefore, the inability to conduct real-world stress tests, congestion control tests, and abnormal traffic simulations under high-speed networks severely restricts the application value of this technology in network capacity assessment and fault drills.
[0023] Based on this, this application proposes a traffic simulation method that can extract key traffic features of the traffic to be simulated and generate metadata describing the key traffic features. The metadata is then encapsulated into metadata messages for traffic simulation. The metadata messages carry complete traffic description information rather than the byte stream of the real traffic when the simulated traffic is transmitted. This can overcome the limitation of physical port bandwidth on traffic simulation testing and enable large-volume simulation testing within limited bandwidth.
[0024] Exemplary methods Figure 1 This is a flowchart illustrating a traffic simulation method provided in an exemplary embodiment of this application. This embodiment can be applied to electronic devices, such as... Figure 1 As shown, the method includes steps S110-S120: Step S110: Determine the key flow characteristics of the flow to be simulated.
[0025] The traffic to be simulated can be actual business traffic that needs to be simulated in a simulated network environment, such as the interaction traffic between servers within a data center, tenant business traffic in a cloud computing platform, or data streams generated by a specific application system. Key traffic characteristics are parameters that can characterize the essential attributes of the traffic to be simulated. In this embodiment, traffic simulation requires at least obtaining the number of data packets, the number of bytes, and the duration of the flow of the traffic to be simulated.
[0026] In some embodiments, determining the key flow characteristics of the flow to be simulated in step S110 may include the following two methods: Method 1: Extract traffic features of the traffic to be simulated from the structured logs of the traffic to be simulated, and determine key traffic features from the traffic features of the traffic to be simulated.
[0027] Here, the real network traffic data source can be, for example, NetFlow data. NetFlow data, as a structured log of network traffic, records information in "flows" as the basic unit. A "flow" usually refers to a series of data packets with the same five-tuple (source IP, destination IP, source port, destination port, and protocol type). Each flow record can also include traffic quantification information (including the number of data packets and the number of bytes), time information (which can calculate the flow duration), and routing and interface information (the ingress / egress interface index, next-hop IP address, etc., reflecting the traffic transmission path). By analyzing the traffic logs recorded in the real network environment, representative traffic features can be identified and extracted, such as common source IP, destination IP, port information, protocol type, and traffic scale (number of data packets, number of bytes) and duration. These features are used as key traffic features for simulated traffic to ensure that the simulated traffic can reflect the traffic patterns and behavioral characteristics of the real network.
[0028] Method 2: Receive traffic characteristic information input by the user and determine key traffic characteristics based on the traffic characteristic information.
[0029] For example, the system can receive traffic characteristic information input by the user. The user manually inputs specific traffic characteristic parameters based on their testing needs and objectives. The system then determines key traffic characteristics based on this user-input traffic characteristic information. This approach is more flexible and can meet the personalized testing needs of different users in different scenarios.
[0030] Step S120: Generate metadata describing key traffic characteristics and encapsulate the metadata into a metadata message for traffic simulation based on the metadata message.
[0031] For example, metadata can be described using a predefined structured format, such as recording key traffic characteristics in the form of key-value pairs, like "PacketCount: 10000" indicating 10,000 data packets, "TotalBytes: 10485760" indicating a total of 10,485,760 bytes (10MB), and "FlowDuration: 60" indicating a flow duration of 60 seconds. After generating the metadata, this metadata is embedded into a custom message structure according to specific encapsulation rules, forming a metadata message. This metadata message can use a standard network protocol message format as its carrier, such as carrying metadata in the payload of a UDP or TCP message, or defining a new private protocol type specifically for transmitting metadata messages. The size of the metadata message is much smaller than the actual traffic byte stream it describes; for example, a metadata message describing 10GB of traffic may only require a few hundred bytes or even less space, thus greatly reducing the demand for transmission bandwidth.
[0032] The method described in this embodiment significantly reduces the bandwidth consumption of simulated traffic on physical ports by encapsulating key traffic features into metadata packets instead of transmitting actual traffic byte streams. Even when the bandwidth of a single physical server port is limited, simulation testing of high-traffic scenarios far exceeding the physical port bandwidth can be achieved by transmitting metadata packets carrying complete traffic description information. This effectively solves the problem of physical network card port bandwidth bottleneck in simulation platforms based on virtualization technology, improving the flexibility and practicality of network performance testing.
[0033] In some embodiments, such as Figure 2 As shown, based on traffic simulation using metadata messages, the traffic simulation method in this embodiment further includes steps S210-S230: Step S210: Use metadata messages to transmit traffic in the simulated network environment.
[0034] The simulated network environment comprises multiple simulated network nodes and simulated links between them. These simulated network nodes can be virtual hosts, virtual routers, virtual switches, etc., created using virtualization technologies such as Linux namespaces, Docker containers, or virtual machines, simulating various network devices in a real network. Simulated links are implemented using technologies such as virtual Ethernet devices (e.g., veth pairs), Linux bridging, or Open vSwitch, connecting the simulated network nodes and allowing configuration of parameters such as link bandwidth, latency, jitter, and packet loss rate to simulate different network link characteristics. When metadata packets are transmitted in the simulated network environment, they follow the same network path selection and forwarding rules as real traffic, including the virtual routers and switches they pass through, as well as application routing policies and access control lists, thus realistically simulating the transmission process of traffic in complex network topologies.
[0035] In some embodiments, step S210, which uses metadata messages to transmit traffic in a simulated network environment, includes: determining a source simulator node and a target simulator node among multiple simulated network nodes in the simulated network environment; and transmitting metadata messages in the simulated network environment using the IP address of the source simulator node as the source address and the IP address of the target simulator node as the destination address.
[0036] For example, there can be multiple transmission paths between the source simulator node and the target simulator node. Other simulated network nodes along each transmission path can be considered routing nodes. These routing nodes participate in the forwarding process of simulated traffic, and their forwarding behavior follows routing protocols and policies in the real network environment. For instance, if the protocol type specified in the key traffic characteristics is TCP, each routing node will select the optimal transmission path based on the path cost calculated by the TCP protocol, ensuring that the transmission process of simulated traffic in the virtual network is highly consistent with that of the real network.
[0037] Simulation traffic generation service can be started at a designated source simulator node, and simulation traffic receiving service can be started at the target simulator node. This allows the source simulator node to perform traffic simulation using metadata messages and send metadata messages to the target simulator node, enabling the metadata messages to be transmitted in the simulation network environment.
[0038] In some embodiments, the key traffic characteristics of the traffic to be simulated determined in step S110 may also include protocol type (such as TCP, UDP, ICMP, etc.), source IP address, destination IP address, source port, destination port, traffic transmission rate, etc. To faithfully reproduce the real network environment, the IP address of the source simulator node can be configured based on the source IP address in the key traffic characteristics, and the IP address of the target simulator node can be configured based on the destination IP address in the key traffic characteristics. Simultaneously, the transport layer protocol is set according to the protocol type (such as TCP or UDP) in the key traffic characteristics, and the metadata packets generated by the simulated traffic generation service are transmitted.
[0039] For example, metadata messages can use a structured data format, such as Protocol Buffers or JSON encoding. The metadata includes fields such as flow_id (flow identifier), source_ip (source address), source_port (source port), target_ip (destination address), target_port (destination port), packet_count (number of packets), total_bytes (number of bytes), and duration_ms (flow duration). The target service port can be, for example, 15555.
[0040] It should be noted that configuring the IP addresses of the source and destination simulator nodes based on the source and destination IP addresses in the key traffic characteristics is for high-fidelity reproduction of the real network environment. In practical applications, the source and destination IP addresses in the key traffic characteristics can also be omitted when configuring IP addresses in the simulated network, thereby reducing the overhead of configuring the simulated network. In addition, other parameters in the key traffic characteristics (such as source port and destination port) can be flexibly configured according to actual testing needs to meet the requirements of diverse testing scenarios.
[0041] Step S220: Obtain the transmission records of metadata messages in each simulated network node.
[0042] For example, lightweight monitoring modules can be deployed in each simulated network node of the simulated network environment to capture relevant information of metadata messages during transmission in real time, such as... Figure 3 As shown, step S220 may include the following steps S301-S303: Step S301: Start the network probe service on each simulated network node in the simulated network environment.
[0043] During the transmission of metadata messages, each simulated network node intercepts the passing metadata messages through pre-deployed network probe services such as eBPF probes. eBPF (extended Berkeley Packet Filter) is a sandbox virtual machine technology that runs in the Linux kernel. It allows users to write small programs and execute them safely and efficiently in kernel mode without modifying the kernel source code or loading kernel modules, enabling fine-grained monitoring, filtering, and modification of kernel behaviors (such as network packet processing, system calls, process scheduling, etc.).
[0044] eBPF probes can be mounted to the XDP (eXpressDataPath) mount point. XDP is the lowest-level and highest-performance packet processing framework provided by the Linux kernel. Its mount point is located in the "earliest stage" of the network card driver receiving packets - when the packet has just entered the kernel from the network card hardware and has not yet undergone any processing by the TCP / IP protocol stack (such as checksum verification, protocol parsing, route lookup, etc.), the XDP program can process it.
[0045] Network probes can also be mounted to the traffic control (TC) mount point. TC is a Linux kernel subsystem used for traffic control, and its mount point is located after TCP / IP protocol stack processing and before packet forwarding or outgoing interface transmission. TC manages traffic through components such as queue rules (qdisc) and filters. eBPF programs can be mounted on TC as filters to perform secondary processing on packets that have passed through the protocol stack.
[0046] In one embodiment, a network probe can be configured to inspect each data packet passing through the current network node and intercept metadata packets corresponding to the target service port. For example, when the service port of the simulated traffic receiving service is 15555 and the metadata packets are transmitted based on the TCP protocol, the network probe can intercept TCP packets with port 15555.
[0047] Step S302: Based on the network probe service, intercept metadata packets in the data stream passing through each simulated network node and parse out the corresponding metadata.
[0048] For example, for intercepted metadata messages, key fields (such as traffic identifiers, timestamps, and packet counts) are parsed to generate transmission records containing node identifiers, interception times, and traffic characteristics. These transmission records are centrally stored for subsequent link performance analysis. For instance, when simulated traffic passes through an intermediate node, the node's network probe records the traffic arrival time, forwarding delay, and current node load status, and stores this information in association with the traffic identifier, thereby providing data support for evaluating the performance of the entire transmission path.
[0049] Step S303: For any simulated network node, assign a node identifier and timestamp to the parsed metadata as a record of the metadata message transmission in the simulated network node.
[0050] For example, the node identifier can be a unique identifier for the simulated network node in the simulated network environment, such as the node's hostname, IP address, or pre-assigned numerical number. The timestamp precisely records the system time (such as a Unix timestamp, accurate to milliseconds or microseconds) when the metadata packet is intercepted by the node. For instance, if the flow_id in the metadata packet is "FLOW_001", when the packet passes through the virtual router node with IP address "192.168.1.10", the eBPF probe will generate a transmission record after interception and parsing. This record includes the node identifier "192.168.1.10", the timestamp "1620000000000" (assuming the corresponding specific time), and traffic characteristic information such as packet_count "1000" and total_bytes "10485760" parsed from the metadata. These transmission records will be uploaded to a centralized log server or database in real time or periodically, forming complete trajectory data of the metadata packet throughout the simulated network transmission path.
[0051] Step S230: Based on the transmission records, determine the traffic transmission status of each simulated link in the simulated network environment.
[0052] For example, key fields contained in the parsed metadata can be quickly written to a user-space accessible ring buffer or Perf event map. A user-space daemon can read these records from the buffer, add the identifier of the current node, and then send them in batches at a minute-level granularity to the computation module. After receiving the batch transmission records, the computation module groups the records according to the flow identifier (flow_id) to ensure that transmission records of the same simulated traffic are aggregated. For each group of records, the actual transmission path of the traffic in the simulated network is reconstructed by sorting by timestamp.
[0053] In some embodiments, step S230, based on transmission records, determines the traffic transmission status of each simulated link in the simulated network environment, including: for any simulated link in the simulated network environment, based on the transmission records of the simulated network nodes on both sides of the simulated link within a preset time period, determining multiple metadata messages that have passed through the simulated link within a preset time period; and determining the traffic transmission status of the simulated link based on the number of bytes described in the metadata of the multiple metadata messages.
[0054] For example, assume there is a simulated link L connecting simulated network node A (IP address 192.168.1.2) and simulated network node B (IP address 192.168.1.3) in the simulated network environment. The preset time is set to 5 minutes (i.e., 300 seconds). Within these 5 minutes, the network probe captures multiple metadata packets at node A and node B respectively. For example, node A intercepts a metadata packet with flow_id "FLOW_002" at timestamp T1, whose metadata describes a byte count of "TotalBytes: 52428800" (i.e., 50MB); and intercepts a metadata packet with flow_id "FLOW_003" at timestamp T2, whose metadata describes a byte count of "TotalBytes: 104857600" (i.e., 100MB). Meanwhile, node B intercepts a metadata message with flow_id "FLOW_002" at timestamp T1' (T1' is slightly later than T1) and a metadata message with flow_id "FLOW_003" at timestamp T2' (T2' is slightly later than T2). By matching the flow_id, it can be determined that both metadata messages passed through the simulated link L. Therefore, the total number of bytes described by the metadata messages passing through the simulated link L within these 5 minutes is 50MB + 100MB = 150MB. Based on this, it can be determined that the total traffic transmission of the simulated link L within this preset time period is 150MB, and then the average throughput of the link (e.g., 150MB / 300s = 0.5MB / s) and other traffic transmission indicators can be calculated.
[0055] The method in this embodiment deploys a network probe service in a simulated network environment to achieve fine-grained tracking of the transmission process of metadata messages between simulated network nodes. Records can be aggregated based on traffic identifiers, and the traffic transmission path can be reconstructed based on timestamps. For any simulated link in the simulated network, by analyzing the transmission records of simulated network nodes on both sides of the link within a preset time period, the total number of bytes of multiple metadata messages passing through that link can be accurately counted. This allows for precise calculation of the link's traffic transmission status, providing reliable data support for comprehensively evaluating the actual carrying capacity and transmission performance of each link in the simulated network environment, effectively enhancing the observability and analytical depth of the traffic simulation results.
[0056] In some embodiments, after obtaining the traffic transmission status of each simulated link, the method further includes: determining the network performance test results of the simulated network environment based on the traffic transmission status of each simulated link, wherein the network performance test results include at least the link utilization and packet loss rate of each simulated link.
[0057] Specifically, for any simulated link in the simulated network environment, the link utilization of the simulated link is determined based on the traffic transmission status and the link bandwidth of the simulated link; the packet loss rate of the simulated link is determined based on the traffic transmission status, link utilization, and packet loss rate calculation model.
[0058] Link utilization is the ratio of actual transmission traffic to link bandwidth. This indicator reflects the efficiency of link resource utilization. Packet loss rate is an important indicator for measuring network transmission reliability. When the actual traffic on a link exceeds its carrying capacity, the router will drop data packets due to cache exhaustion, leading to an increase in packet loss rate.
[0059] Since the metadata message only carries the metadata corresponding to the real traffic characteristics and does not generate the byte stream corresponding to the real traffic, the byte number field in the metadata is actually the number of virtual traffic bytes. Since the link bandwidth, such as 10Gbps, is in bits, in order to facilitate calculation, it is necessary to convert the number of virtual traffic bytes transmitted by each node within a preset time into traffic intensity in Gbps (Gigabits per second). Thus, the link utilization rate = traffic intensity / link bandwidth) × 100%.
[0060] For example, if the preset time is 60 seconds, the total number of bytes transmitted within the preset time is 7.5 × 10^10 bytes, which translates to a traffic intensity of 7.5 × 10^10 × 8 = 6 × 10^11 bits. If the link bandwidth is, for example, 10 Gbps, then the theoretical maximum traffic that the link can carry within 60 seconds is 10^10 × 60 = 6 × 10^11 bits. Therefore, the link utilization rate is (6 × 10^11 / 6 × 10^11) × 100% = 100%.
[0061] Regarding the calculation of packet loss rate, the load status of the target simulated link can be judged based on the link utilization rate obtained from the traffic intensity and link bandwidth. If the utilization rate is ≤100%, it means that the simulated traffic has not exceeded the link bandwidth, and the packet loss rate is determined to be 0. If the utilization rate is >100%, the simulated traffic has exceeded the bandwidth, and the specific packet loss rate needs to be calculated according to the excess ratio. For example, if the link bandwidth = 10Gbps and the traffic intensity = 11Gbps, then the excess ratio O = (1.1×10^10-10^10) / 10^10 = 10%.
[0062] For example, the packet loss rate L can be calculated using a function such as L = a × O^b, where a and b are adjustable parameters. Substituting the excess ratio O into the function yields the packet loss rate L.
[0063] In some embodiments, the packet loss rate L can also be calculated by a piecewise linear function. For example, if O <= 10%, then L = 5%; if 10% < O <= 50%, then L = 20%; if O > 50%, then L = 60%. The present application is not limited thereto.
[0064] It should be noted that based on the transmission records generated by all simulated network nodes, the network performance test results of the simulation network can be comprehensively calculated. In addition to the link utilization rate and the packet loss rate, key indicators such as transmission delay can also be calculated. As a QoS (Quality of Service) report, it can also be directly presented to the users of the simulation platform to visually evaluate the performance of the simulation link. For example, if the link utilization rate remains at a high level, it may indicate that there is a bandwidth bottleneck in the link and capacity expansion or optimization is required; if the packet loss rate is high, it may mean that there is network congestion or transmission error, and the cause needs to be further investigated and corresponding measures taken.
[0065] In addition, this method can also be extended to the performance evaluation of the entire simulation network. By comprehensively analyzing the transmission records of each link, the overall performance of the network can be comprehensively understood, providing strong support for network planning, optimization, and fault troubleshooting. In practical applications, this method has high flexibility and scalability, and can be customized and adjusted according to different test requirements and scenarios, so as to meet diverse network performance test needs, and thus achieve accurate simulation and performance testing of traffic pressure, congestion control, and abnormal behaviors in a high-speed network environment.
[0066] Figure 4 FIG. [ID] is a schematic flowchart of a traffic simulation test using metadata packets in a simulation network environment provided by an exemplary embodiment of the present application, including: Step 1: Obtain the key traffic characteristics of the simulation traffic First, extract the traffic characteristics to be simulated from the real network traffic data source (such as NetFlow, sFlow export files). Each flow characteristic may include, for example, source IP address, destination IP address, source port, destination port, protocol type (five-tuple), total number of data packets, total number of bytes, flow duration, etc., as the traffic template of the simulation traffic, providing a data basis for generating the simulation traffic.
[0067] Step 2: Generate metadata packets and inject them into the simulation network Based on the extracted key traffic features, lightweight metadata packets are generated (e.g., using TCP protocol, with a fixed destination port of 15555, and the payload containing fields such as flow_id and packet_count), and injected into the simulation network built based on Linux namespaces and FRRouting. The metadata packets are routed and forwarded in the simulation network according to the real routing path (e.g., node 1 → node 2 → … → node N). The forwarding logic follows the real routing policies (e.g., OSPF / BGP protocol and routing table) that have been restored in the simulation network.
[0068] Step 3: The eBPF probe captures and parses metadata messages. The eBPF probes deployed in the kernel of each simulated router (mounted on the XDP or tc point) monitor passing packets in real time, only intercepting TCP metadata packets destined for port 15555, parsing key information in their payload (such as flow_id, total_bytes, outgoing interface index, timestamp), and temporarily storing the parsing results.
[0069] Step 4: Determine if the message has reached the destination host (synchronized with Step 4). If the metadata message does not reach the destination host, it continues to be forwarded in the simulated network. If the metadata message reaches the destination host, it proceeds to step 5 for data aggregation and statistics.
[0070] Step 5, Data Aggregation and Statistics The eBPF probe reports the temporarily stored parsing results (including router ID, outgoing interface index, total_bytes, and timestamp) to the link calculation module. The module aggregates the data according to the dimension of "time window (e.g., 1 minute) + link", calculates the total_bytes of all metadata packets for each link within the corresponding time window, obtains the total simulated traffic of the link, and calculates the bandwidth utilization (link utilization) and packet loss rate based on the total simulated traffic of the link, generating a network performance report.
[0071] The specific settings and implementation methods of the embodiments of this application have been described above from different perspectives. Utilizing the methods provided in the above embodiments, traffic simulation is performed using metadata messages carrying traffic characteristics, fundamentally avoiding the limitation of physical port bandwidth on the simulation scale, realizing the simulation of ultra-high-speed links, and accurately reproducing the behavior patterns of real traffic in the simulated network environment. Furthermore, through the collaborative mechanism of metadata messages and network probes, refined capture and performance analysis of traffic characteristics in high-speed network environments are achieved, providing an efficient and reliable simulation testing method for network device development, protocol verification, and abnormal behavior detection.
[0072] Exemplary System Figure 5 This is a schematic diagram of the system architecture of a simulation testing system provided in an exemplary embodiment of this application. For example... Figure 5 As shown, the system includes a simulated network environment 510, a simulated traffic generator 520, a data acquisition module 530, and a calculation module 540. The simulated network environment 510 includes multiple simulated network nodes and simulated links between each simulated network node.
[0073] Among them, the simulated traffic generator 520 is used to determine the key traffic characteristics of the traffic to be simulated based on user input information or external traffic data sources, and encapsulate the key traffic characteristics into metadata messages so that the metadata messages can be transmitted as simulated traffic in the simulated network environment.
[0074] The data acquisition module 530 includes network probes (such as eBPF probes) deployed in each simulated network node in the simulated network environment 510, which are used to capture and parse metadata messages in the data stream passing through each simulated network node to obtain the transmission record of metadata messages in each simulated network node.
[0075] The calculation module 540 is used to determine the traffic transmission status of each simulation link in the simulation network environment 510 based on the transmission records of metadata messages collected by the data acquisition module 530 in each simulation network node, and to determine the network performance test results of the simulation network environment 510 based on the traffic transmission status of each simulation link.
[0076] Specifically, when simulation testing is required, the source simulator node and the target simulator node can be determined in the simulated network nodes of the simulation network environment 510. The simulation traffic generator 520 can be deployed on the simulation network environment 510 as the simulated network node of the source simulator node, and extract traffic features based on real network traffic data sources such as NetFlow data to obtain key traffic features. Then, metadata is generated based on the key traffic features and metadata packets are assembled. The assembled metadata packets can be used as the generated simulation traffic. The IP address of the source simulator node can be configured based on the source IP address in the key traffic features, and the IP address of the target simulator node can be configured based on the destination IP address in the key traffic features. The simulation traffic generation service is started on the source simulator node, and the simulation traffic receiving service is started on the target simulator node. The transport layer protocol is set according to the protocol type (such as TCP or UDP) in the key traffic features, and the metadata packets generated by the simulation traffic generation service are transmitted.
[0077] During the simulated traffic transmission process, the data acquisition module 530 deploys network probes at each simulated network node to check each data packet passing through the current network node and intercepts the metadata message corresponding to the target service port (the service port of the simulated traffic receiving service). For the intercepted metadata message, it parses the key fields in the metadata message (such as traffic identifier, timestamp, number of data packets, etc.) and generates a transmission record containing node identifier, interception time and traffic characteristics.
[0078] Furthermore, the calculation module 540 can calculate the total number of virtual traffic bytes for each link within a preset time window based on the transmission records collected by the data acquisition module 530, calculate the link utilization rate in conjunction with the link bandwidth, determine the packet loss rate based on the comparison result of the link utilization rate and a preset threshold, and generate QoS reports for single links and the entire network by combining these indicators. For example, when the utilization rate of a certain link is found to exceed 100%, the packet loss rate of that link is calculated according to a preset mapping relationship between the excess ratio and the packet loss rate (such as the aforementioned exponential function or piecewise linear function), and this packet loss rate is recorded in the performance evaluation data of that link. At the same time, the calculation module 540 will also track the transmission path of metadata packets from the source node to the destination node, check whether all metadata packets that should have reached the destination host have successfully arrived. If there are cases where they have not arrived, the link utilization rate, packet loss rate, and other data will be used to make a preliminary judgment on whether it is due to link congestion, routing errors, or node failures, and these judgment results will be used as preliminary clues for network fault diagnosis.
[0079] It should be noted that the functions of the simulation network environment, each device and module in the simulation test system of this application embodiment can be found in the corresponding description in the above exemplary method, and have corresponding beneficial effects, which will not be repeated here.
[0080] Exemplary device As an implementation of the above methods, such as Figure 6 As shown in the illustration, this application also provides a flow simulation device, which may include: The traffic characteristic determination module 610 is used to determine the key traffic characteristics of the traffic to be simulated. The key traffic characteristics include at least the number of data packets, the number of bytes, and the duration of the flow. The simulated traffic generation module 620 is used to generate metadata describing key traffic characteristics and encapsulate the metadata into metadata messages for traffic simulation based on the metadata messages.
[0081] In some embodiments, the traffic feature determination module 610 is used to: extract traffic features of the traffic to be simulated based on the structured logs of the traffic to be simulated, and determine key traffic features from the traffic features of the traffic to be simulated; or, receive traffic feature information input by the user, and determine key traffic features based on the traffic feature information.
[0082] In some embodiments, the apparatus further includes a simulation testing module, which is configured to: transmit traffic in a simulated network environment using metadata messages, the simulated network environment including multiple simulated network nodes and simulated links between each simulated network node; acquire transmission records of metadata messages in each simulated network node; and determine the traffic transmission status of each simulated link in the simulated network environment based on the transmission records.
[0083] In some embodiments, the simulation testing module is used to: determine the source simulator node and the target simulator node among multiple simulated network nodes in the simulated network environment; and transmit metadata messages in the simulated network environment using the IP address of the source simulator node as the source address and the IP address of the target simulator node as the destination address.
[0084] In some embodiments, the simulation testing module is used to: start a network probe service on each simulated network node in the simulated network environment; intercept metadata messages in the data stream passing through each simulated network node based on the network probe service, and parse out the corresponding metadata; for any simulated network node, assign a node identifier and timestamp to the parsed metadata as a transmission record of the metadata message in the simulated network node.
[0085] In some embodiments, the simulation test module is used to: for any simulated link in the simulated network environment, determine multiple metadata messages that pass through the simulated link within a preset time period based on the transmission records of the simulated network nodes on both sides of the simulated link within a preset time period; and determine the traffic transmission status of the simulated link based on the number of bytes described in the metadata of the multiple metadata messages.
[0086] In some embodiments, the simulation testing module is used to: determine the network performance test results of the simulated network environment based on the traffic transmission status of each simulated link, wherein the network performance test results include at least the link utilization and packet loss rate of each simulated link.
[0087] In some embodiments, the simulation testing module is used to: for any simulated link in the simulated network environment, determine the link utilization of the simulated link based on the traffic transmission status and the link bandwidth of the simulated link; and determine the packet loss rate of the simulated link based on the traffic transmission status, link utilization, and packet loss rate calculation model.
[0088] The functions of each unit, module, or sub-module in the various devices of this application embodiment can be found in the corresponding descriptions in the above method embodiments, and they have corresponding beneficial effects, which will not be repeated here.
[0089] Exemplary electronic devices and computer-readable storage media Figure 7 This is a block diagram of an electronic device used to implement embodiments of this application. For example... Figure 7 As shown, the electronic device includes a memory 701 and a processor 702. The memory 701 stores a computer program that can run on the processor 702. When the processor 702 executes the computer program, it implements the method described in the above embodiments. The number of memories 701 and processors 702 can be one or more.
[0090] The electronic device also includes: The communication interface 703 is used to communicate with external devices and perform data exchange and transmission.
[0091] If the memory 701, processor 702, and communication interface 703 are implemented independently, they can be interconnected via a bus to communicate with each other. This bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. This bus can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 7 The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.
[0092] Optionally, in a specific implementation, if the memory 701, processor 702, and communication interface 703 are integrated on a single chip, then the memory 701, processor 702, and communication interface 703 can communicate with each other through an internal interface.
[0093] This application also provides a chip including a processor for calling and executing instructions stored in a memory, causing a communication device with the chip installed to perform the method provided in this application.
[0094] This application also provides a chip, including: an input interface, an output interface, a processor, and a memory. The input interface, output interface, processor, and memory are connected through an internal connection path. The processor is used to execute code in the memory. When the code is executed, the processor is used to execute the method provided in this application.
[0095] It should be understood that the aforementioned processor can be a CPU, or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), FPGAs, or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. General-purpose processors can be microprocessors or any conventional processor. It is worth noting that the processor can be a processor supporting Advanced Reduced Instruction Set Machines (ARM) architecture.
[0096] Further, optionally, the aforementioned memory may include read-only memory and random access memory. The memory may be volatile memory or non-volatile memory, or may include both. Non-volatile memory may include read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. Volatile memory may include random access memory (RAM), which serves as an external cache. By way of example, but not limitation, many forms of RAM are available. Examples include Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDR SDRAM), Enhanced Synchronous DRAM (ESDRAM), Sync Link DRAM (SLDRAM), and Direct Rambus RAM (DR RAM).
[0097] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, as a computer program product. A computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions according to this application are generated. 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 transferred from one computer-readable storage medium to another.
[0098] In addition to the methods and apparatus described above, embodiments of this application may also provide a computer program product, including computer program instructions, which, when executed by a processor, cause the processor to perform the steps of the methods in the various embodiments of this application described in the "Exemplary Methods" section above.
[0099] Computer program products can be written in any combination of one or more programming languages to perform the operations of the embodiments of this application. These programming languages include object-oriented programming languages such as Java and C++, as well as conventional procedural programming languages such as C or similar languages. The program code can be executed entirely on the user's computing device, partially on the user's computing device, as a standalone software package, partially on the user's computing device and partially on a remote computing device, or entirely on a remote computing device or server.
[0100] In the description of this specification, references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of this application. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of those different embodiments or examples.
[0101] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of that feature. In the description of this application, "a plurality of" means two or more, unless otherwise explicitly specified.
[0102] Any process or method described in the flowchart or otherwise herein can be understood as representing a module, segment, or portion of code comprising one or more executable instructions for implementing a particular logical function or process. Furthermore, the scope of the preferred embodiments of this application includes additional implementations in which functions may be performed not in the order shown or discussed, including substantially simultaneously or in reverse order depending on the functionality involved.
[0103] The logic and / or steps described in the flowchart or otherwise herein, for example, can be considered as a sequenced list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by, or in conjunction with, an instruction execution system, apparatus or device (such as a computer-based system, a processor-included system or other system that can fetch and execute instructions from, an instruction execution system, apparatus or device).
[0104] It should be understood that various parts of this application can be implemented using hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented using software or firmware stored in memory and executed by a suitable instruction execution system. All or part of the steps of the methods in the above embodiments can be implemented by a program instructing related hardware, the program being stored in a computer-readable storage medium, which, when executed, includes one or a combination of the steps of the method embodiments.
[0105] Furthermore, the functional units in the various embodiments of this application can be integrated into a processing module, or each unit can exist physically separately, or two or more units can be integrated into a module. The integrated module can be implemented in hardware or as a software functional module. If the integrated module is implemented as a software functional module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. This storage medium can be a read-only memory, a disk, or an optical disk, etc.
[0106] The above description is merely an exemplary embodiment of this application, but the scope of protection of this application is not limited thereto. Any person skilled in the art can easily conceive of various variations or substitutions within the technical scope described in this application, and these should all be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A flow rate simulation method, characterized in that, include: Determine the key traffic characteristics of the traffic to be simulated, including at least the number of data packets, the number of bytes, and the duration of the flow; Metadata describing the key traffic characteristics is generated, and the metadata is encapsulated into a metadata message for traffic simulation based on the metadata message.
2. The method according to claim 1, characterized in that, The key flow characteristics for determining the flow to be simulated include: The traffic features of the traffic to be simulated are extracted from the structured logs of the traffic to be simulated, and the key traffic features are determined from the traffic features of the traffic to be simulated. Alternatively, the system can receive traffic characteristic information input by the user and determine the key traffic characteristics based on the traffic characteristic information.
3. The method according to claim 1, characterized in that, Also includes: The metadata messages are used to transmit traffic in a simulated network environment, which includes multiple simulated network nodes and simulated links between the simulated network nodes. Obtain the transmission records of the metadata messages in each of the simulated network nodes; Based on the transmission records, the traffic transmission status of each simulated link in the simulated network environment is determined.
4. The method according to claim 3, characterized in that, The process of transmitting traffic in a simulated network environment using the metadata message includes: The source simulator node and the target simulator node are determined from the plurality of simulation network nodes in the simulation network environment; The metadata message is transmitted in the simulation network environment using the IP address of the source simulator node as the source address and the IP address of the target simulator node as the destination address.
5. The method according to claim 3, characterized in that, The step of obtaining the transmission records of the metadata message in each of the simulated network nodes includes: Start the network probe service on each of the simulated network nodes in the simulated network environment; Based on the network probe service, the metadata packets are intercepted in the data streams of each of the simulated network nodes, and the corresponding metadata is parsed out; For any of the simulated network nodes, the parsed metadata is assigned a node identifier and a timestamp as a transmission record of the metadata message in the simulated network node.
6. The method according to claim 3, characterized in that, The step of determining the traffic transmission status of each simulated link in the simulated network environment based on the transmission records includes: For any simulated link in the simulated network environment, based on the transmission records of the simulated network nodes on both sides of the simulated link within a preset time, multiple metadata messages that have passed through the simulated link within the preset time are determined. Based on the number of bytes described in the metadata of the multiple metadata messages, the traffic transmission status of the simulated link is determined.
7. The method according to any one of claims 3-6, characterized in that, The method further includes: Based on the traffic transmission status of each simulated link, the network performance test results of the simulated network environment are determined. The network performance test results include at least the link utilization and packet loss rate of each simulated link.
8. The method according to claim 7, characterized in that, The determination of network performance test results for the simulated network environment based on the traffic transmission status of each simulated link includes: For any simulated link in the simulated network environment, the link utilization rate of the simulated link is determined based on the traffic transmission status and the link bandwidth of the simulated link. Based on the traffic transmission situation, the link utilization, and the packet loss rate calculation model, the packet loss rate of the simulated link is determined.
9. A flow rate simulation device, characterized in that, The device includes: The traffic characteristic determination module is used to determine the key traffic characteristics of the traffic to be simulated. The key traffic characteristics include at least the number of data packets, the number of bytes, and the duration of the flow. The simulated traffic generation module is used to generate metadata describing the key traffic characteristics and encapsulate the metadata into metadata messages for traffic simulation based on the metadata messages.
10. A simulation testing system, characterized in that, The system includes a simulated network environment, a simulated traffic generator, a data acquisition module, and a computing module. The simulated network environment includes multiple simulated network nodes and simulated links between the simulated network nodes. The simulated traffic generator is used to determine the key traffic characteristics of the traffic to be simulated based on user input information or external traffic data sources, and encapsulate the key traffic characteristics into metadata messages so that the metadata messages are transmitted as simulated traffic in the simulated network environment. The data acquisition module includes network probes deployed at each of the simulated network nodes in the simulated network environment, used to capture and parse the metadata messages in the data stream passing through each of the simulated network nodes, and obtain the transmission records of the metadata messages at each of the simulated network nodes; The calculation module is used to determine the traffic transmission status of each simulated link in the simulated network environment based on the transmission records of the metadata messages collected by the data acquisition module in each simulated network node, and to determine the network performance test results of the simulated network environment based on the traffic transmission status of each simulated link.