A large-scale traffic generation method and system based on programmable network technology
By generating traffic on a server and controlling it in a programmable switch, and by utilizing task intent primitives and switch resource coordination mechanisms, the problem of resource constraints in programmable switches is solved, enabling low-cost, highly scalable, large-scale traffic generation.
Patent Information
- Application Number
- CN202310542543.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-15
- Publication Date
- 2025-10-24
- Estimated Expiration
- 2043-05-15
AI Technical Summary
Existing technologies cannot achieve large-scale traffic generation at low cost, and programmable switches have limited resources, making it difficult to support large-scale packet header modification and payload content filling.
By designing task intent primitives and dividing them into hardware-compatible and incompatible primitive sets, and utilizing the collaborative mechanism of servers and programmable switches, initial traffic is generated on the server and flexibly controlled by the switch pipeline processor to achieve large-scale traffic generation.
It achieves low-cost, highly scalable large-scale traffic generation, reduces the difficulty of describing the generation intent, and overcomes the resource limitations of switches.
Smart Images

Figure CN116566901B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of computer networks, and in particular to a large-scale traffic generation method and system based on programmable network technology. BACKGROUND
[0002] The generation of large-scale network traffic is of great significance for research work in network operation and network attack (such as DDoS) resistance. There are mainly two types of existing large-scale network traffic generation methods:
[0003] ① Using kernel-based tools to generate large-scale traffic. These tools rely on system kernel space libraries when generating traffic and will make frequent calls to the system kernel, which brings huge performance overhead and limits the size of the large-scale traffic that can be generated, generally only up to several gigabytes per second, thus unable to simulate real large-scale traffic, such as Tbps-level DDoS attacks.
[0004] ② Using kernel-bypassing methods to generate large-scale traffic. This method does not involve the kernel space, generates and sends packets in the user space, and this type of method can generate traffic up to tens of gigabytes per second, with high scalability. However, this type of device is costly, such as the cost of generating Tbps-level large-scale traffic has exceeded $100,000.
[0005] In summary, the current generation method cannot achieve the generation of large-scale traffic at a low cost. In recent years, the P4 programmable switch provides a new way to generate large-scale traffic.
[0006] The P4 programmable switch brings programmability to the data plane, and its packet processing pipeline architecture (Pipeline) can complete packet processing at line speed and support developers to customize network protocols and related processing procedures, that is, a single switch can rapidly expand data traffic to Tbps in a short time through mechanisms such as recirculation and multi-pipeline collaboration. At the same time, the cost of a single 6.4Tbps P4 programmable switch is less than $10,000, and the expansion cost is low. However, programmable switches can only provide limited resources, and the custom packet buffer is small and difficult to support large-scale packet header modification, payload content filling, and other tasks, making it difficult to achieve the task of generating large-scale traffic on programmable switches.
[0007] Therefore, the resource constraints of programmable switches and the technical problem of increasing the size of network traffic by adding server groups or switches need to be solved. SUMMARY
[0008] The present application aims at the deficiencies of the prior art, and provides a large-scale traffic generation method and system based on programmable network.
[0009] The present application is achieved by the following technical solutions:
[0010] The present application is achieved by the following technical solutions:
[0011] (1) Task intention primitive: the task intention primitive includes two types of traffic generation primitive and traffic control primitive, which are used to explicitly express the intention of generating large-scale traffic;
[0012] (2) Task primitive division: according to whether the primitive is compatible with the switch resource limit, the traffic generation task expressed by the primitive is divided into two sets of hardware compatible primitive set and hardware incompatible primitive set;
[0013] (3) Initial traffic generation: according to the primitive in the hardware incompatible primitive set, the server group is configured to generate data packets meeting the task requirements, thereby creating an initial traffic set;
[0014] (4) Server and switch interaction: while creating the initial traffic, the data packets in the initial traffic set and the traffic control configuration in the hardware compatible primitive set are sent to the switch through the link connecting the server group and the switch, so that the subsequent traffic control is performed by the pipeline processing program of the switch;
[0015] (5) Traffic control: according to the traffic control requirements of the hardware compatible primitive, the programmable switch uses the pipeline processor to control the transmission of the initial traffic set sent from the server group, so that the generated large-scale traffic meets the task configuration requirements.
[0016] Further, the traffic generation primitive in the step (1) is used to define the initial format of the data packets of the large-scale traffic, and specifically includes the following primitives:
[0017] (2.1) Set_Packet_Structure(L header ); header );
[0018] (2.2) Setting the header field L in different data packets field Value of: Select_Field(L field );
[0019] (2.3) Set the specific packet header field L field The value is the specified value L value :Set_Field_Value(L field ,L value );
[0020] (2.4) Set the length of each data packet to l: Set_Packet_Length(l);
[0021] (2.5) Set the k data flows with the largest traffic in the initial traffic set, namely the top-k flows, whose probability is μ min ,μ max Of
[0022] Time: Set_Prob(k,L field ,μ min ,μ max );
[0023] (2.6) Replay a certain data flow F specified by the user as large-scale traffic: Replay_Trace(F).
[0024] Furthermore, the flow control primitive in step (1) is used to express the task intention of controlling the initial flow set, which specifically includes the following primitives:
[0025] (3.1) Set up a list of switch ports L that send large-scale traffic port :Set_Port(L port );
[0026] (3.2) Set the rate γ for sending large-scale traffic: Set_Rate(γ);
[0027] (3.3) Set the total number of times N to send large-scale traffic test :Set_Number(N test );
[0028] (3.4) Set the duration D (seconds) of each large-scale traffic transmission: Set_Duration(D);
[0029] (3.5) Set the time interval I (seconds) between two consecutive large-scale traffic transmissions: Set_Interval(I).
[0030] Further, the task primitive division process is specifically: enumerate each primitive in the task T that generates large-scale traffic, because the task needs to change the packet header structure or payload, and these structures or payloads are disabled on the switch due to the limitation of switch resources; therefore, for each primitive P∈T, determine whether P belongs to an attack traffic generation primitive; if yes, P is incompatible with the switch resources, and it is added to the hardware incompatible primitive set Ω server , otherwise, P is divided into the hardware compatible primitive set Ω pipe .
[0031] Further, the step (3) initial traffic generation includes the following steps:
[0032] (5.1) Packet generation: set the packet header structure according to Set_Packet_Structure(L header ), initialize the fields, establish the dependency relationship of the header fields, and determine the total number of required initial packets;
[0033] (5.2) Field value setting: set the header fields of the packet according to the primitives Select_Field(L field ) and Set_Field_Value(L field , L value ) in two ways of random value or fixed value respectively;
[0034] (5.3) Packet length update: truncate or extend the payload part of the packet until it meets the packet length l specified by Set_Packet_Leln;
[0035] (5.4) Packet probability setting: set the probability of the first k traffic in the initial traffic between μ min and μ max according to Set_Prob(k, L field , μ min , μ max );
[0036] (5.5) Replay user-specified data stream: provide the function of user-defined initial data stream, replay the user-specified packet according to Replay_Trace(F) to form the final attack traffic set P T .
[0037] Further, the traffic control configuration extracted in the step (4) includes the expected sending rate γ, the switch port list L port that sends the packet, the total number of times N that sends large-scale traffic, the duration D of sending traffic each time, and the time interval I between two consecutive sending traffics.
[0038] Further, the pipeline processor in step (5) receives the initial traffic set P T and the user-specified hardware-compatible primitive set Ω pipe The traffic control requirement in the middle of the traffic control requirement is controlled by the basic data packet processing element in the pipeline to control the sending of large-scale traffic, including the following steps:
[0039] (7.1) Data packet rate control: apply recirculation and marking mechanism or multi-pipeline coordination mechanism to control the sending of large-scale traffic at multiple specified ports Set_Port(L port ) and control the sending rate of traffic to meet the expected sending rate Set_Rate(γ) requirement; optionally, the loopback mode of the port can be configured to enhance the recirculation capability and improve the performance of the control data packet rate;
[0040] (7.2) Data packet termination control: count and monitor the duration of the data packet, and when the test number Set_Number(N test ) requirement is met, terminate the data packet sending;
[0041] (7.3) Data packet duration control: record the timestamp of the start of data packet sending and monitor the difference between the current time and the timestamp, if the difference time reaches the user-specified per-test duration Set_Duration(D), stop sending test packets;
[0042] (7.4) Interval control: record the timestamp of the pause of data packet sending, and monitor whether the downtime reaches the user-specified time interval Set_Interval(I) between two consecutive tests, if so, resume data packet sending.
[0043] A large-scale traffic generation system based on programmable network technology, the system comprising the following modules:
[0044] Task intent primitive module: task intent primitives include two types of traffic generation primitives and traffic control primitives, which are used to explicitly express the intent of generating large-scale traffic tasks;
[0045] Task primitive division module: according to whether the primitive is compatible with the switch resource limit, the traffic generation task expressed by the primitive is divided into two sets of hardware-compatible primitive set and hardware-incompatible primitive set;
[0046] Initial traffic generation module: according to the primitives in the hardware-incompatible primitive set, configure the server group to generate data packets that meet the task requirements, and then create an initial traffic set;
[0047] The server interacts with the switch module: while creating the initial traffic, the data packets in the initial traffic set and the flow control configuration in the hardware compatible primitive set are sent to the switch through the link connecting the server group and the switch for subsequent flow control by the pipeline processing program of the switch.
[0048] The flow control module: according to the flow control requirements of the hardware compatible primitive, the programmable switch uses the pipeline processor to control the sending of the initial traffic set sent from the server group, so that the generated large-scale traffic meets the task configuration requirements.
[0049] The beneficial effects of the present application are that by abstracting the intention of generating large-scale traffic into a task intention primitive, the difficulty of describing the intention of generating large-scale traffic is reduced; at the same time, the task intention primitive is divided according to the compatibility of the primitive content and the switch, and the generation and control of large-scale traffic are performed in the switch and the server group respectively. At the same time, the collaborative design of the server group and the switch is used to overcome the resource limitation of the switch, so that the initial traffic can be directly generated and customized in the server based on the task intention primitive, and flexible flow control can be performed in the programmable switch, thereby realizing the on-demand generation of large-scale traffic with low cost and high scalability. BRIEF DESCRIPTION OF DRAWINGS
[0050] Figure 1 is the schematic diagram of the large-scale traffic generation method architecture based on the programmable network of the present application;
[0051] Figure 2 is the pipeline running schematic diagram of the large-scale traffic generation method based on the programmable network of the present application;
[0052] Figure 3 is the system flowchart of the present application; DETAILED DESCRIPTION
[0053] The technical solutions in the embodiments of the present application will be described clearly and completely in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor are within the scope of protection of the present application.
[0054] The application generates required large-scale traffic on demand by coordinating a server and a programmable network switch, wherein a server group is used to generate data packets of the large-scale traffic and deliver to the programmable switch, and the programmable switch controls the sending speed of the large-scale traffic, so as to realize low-cost and high-scalability generation of the large-scale traffic on demand. Specifically, a series of primitives based on intention and irrelevant to underlying architecture details are designed, so as to reduce the difficulty of describing the intention of generating the large-scale traffic; and a server and programmable switch coordination mechanism is designed, so as to complete the required configuration on the switch and the server according to the intention expressed by different kinds of primitives, and realize the generation of the large-scale traffic by coordinating the server and the switch resources.
[0055] The application aims to realize the following technical scheme: as shown in the figure, the embodiment of the application provides a large-scale traffic generation method of server and switch software and hardware coordination configuration; comprising the following steps: Figure 1
[0056] (1) task intention primitive: the task intention primitive contains two types of traffic generation primitive and traffic control primitive, which is used to explicitly express the intention of generating the large-scale traffic task T;
[0057] (2) task primitive division: according to whether the primitive is compatible with the switch resource limit, the traffic generation task T expressed by the primitive is divided into different kinds of primitive sets: a hardware compatible primitive set Ω pipe and a hardware incompatible primitive set Ω server ;
[0058] (3) initial traffic generation: according to the primitive in the hardware incompatible primitive set Ω server , the server group is configured to generate data packets meeting the task requirements, and then an initial traffic set P T is created;
[0059] (4) server and switch interaction: while creating the initial traffic, the data packets in the initial traffic set P T and the traffic control configuration in the hardware compatible primitive set Ω pipe are sent to the switch through the link connecting the server and the switch, so as to be processed by the subsequent traffic control of the pipeline processing program located in the switch;
[0060] (5) traffic control: according to the traffic control requirement of the hardware compatible primitive, the programmable switch uses the pipeline processor to control the sending of the initial traffic set sent from the server group, so that the generated large-scale traffic meets the task configuration requirement.
[0061] The task intent primitives in step (1) are used to describe the intent of the large-scale traffic generation task based on programmable switches, and an application program interface (API) is provided to support the addition of new primitives. The task intent primitives include two types: traffic generation primitives and traffic control primitives.
[0062] The traffic generation primitives are used to define the initial format of the data packets of the large-scale traffic, and are used to generate an initial traffic set with a large total number of packets but a small number of packets in a single data stream. The primitives included in such primitives are shown in Table 1.
[0063] Table 1
[0064]
[0065] The traffic control primitives are used to represent the intent of the task of controlling the initial traffic set. The attack traffic control primitives included in such primitives are shown in Table 2.
[0066] Table 2
[0067]
[0068] By way of example, the purpose of the task T is to generate a flooding attack (SYN flood attack), which is the most common type of DDoS attack. The purpose of the test task is to perform a 1 Tbps flooding attack on a target with an IP address of "10.0.0.2" and to perform a stress test for 1 minute. In this context, the present embodiment can use five primitives to form the task T.
[0069] P1 = Set_Packet_Structure ([Ethernet, IPv4, TCP]); that is, P1 specifies the packet header structure of the test packet, in the order of Ethernet, IPv4, and TCP packet headers.
[0070] P2 = Select_Field ([IPv4.srcIP]); that is, P2 sets the source IP address field of different test packets to be randomly changed.
[0071] P3 = Set_Field_Value ([IPv4.dstIP, TCP.flags], ["10.0.0.2", "S"]); that is, P3 assigns the value 10.0.0.2 to the destination address part of the test packet, and sets the SYN bit in the TCP flag to 1.
[0072] P4 = Set_Port ([Port1,..., Port10]); that is, P4 selects 10 switch ports (Port1-Port10) to send attack traffic.
[0073] P5 = Set_Rate(1000); i.e. P5 modifies the attack traffic sending rate to 1 Tbps.
[0074] P6 = Set_Duration(60); i.e. P6 indicates that the task lasts 1 minute. By default, the number of tests is equal to 1.
[0075] T = [P1, P2, P3, P4, P5, P6]
[0076] The task primitive division process in step (2) is specifically: enumerate each primitive in the task T that generates large-scale traffic, because the task needs to change the packet header structure or payload, and these structures or payloads are disabled on the switch due to the limitation of switch resources. Therefore, for each primitive P e T, determine whether P belongs to the attack traffic generation primitive. If yes, P is incompatible with the switch resources, and it is added to the hardware incompatible primitive set server , otherwise, P is divided into the hardware compatible primitive set pipe .
[0077] Exemplarily, the Set_Packet_Structure primitive constitutes multiple headers into the test packet, which cannot be implemented in the switch, therefore, P1 = Set_Packet_Structure([Ethernet, IPv4, TCP]) is added to the server category. In the task T that generates the flooding attack, [P1, P2, P3] is added to server , and [P4, P5, P6] is added to pipe .
[0078] The specific steps of creating the attack traffic P server according to the hardware incompatible primitive set T in step (3) include:
[0079] (3.1) Packet generation: set the header structure of the test packet according to the Set_Packet_Structure(L header ) primitive, initialize the field, establish the dependency relationship, and determine the total number of test packets required, and generate the final attack traffic set P T .
[0080] Exemplarily, the header structure of the test packet is set according to Set_Packet_Structure(L header ).
[0081] a) Convert L header to a directed sequence P = (V P , E P ): V Pcontains L header ; E P includes the conversion between the headers.
[0082] b) Enumerate V P and initialize the field values of each header in V P to 0.
[0083] c) Enumerate the dependencies in E P ; for each dependency, locate the two headers associated with it, set the specific field values in one of the headers, and create the dependency.
[0084] d) Determine the total number of test packets required; estimate the proportion of attack traffic in each test packet, create attack traffic instances according to the proportion, and add them to the final attack traffic set P T .
[0085] (3.1) List field value setting: set the header fields of the test packet to random values or fixed values according to the primitives Select_Field(L field ) and Set_Field_Value(L field , L value ). The Select_Field(L field ) and Set_Field_Value(L field , L value ) primitives are used to change the packet header fields of the test packet. Select_Field(L field ) identifies the corresponding field in the test packet for each f∈L field in the list and sets the value of the field to a random value. Set_Field_Value(L field , L value ) locates the header fields in the test packet according to L field and changes the values of these fields to the values specified by the user in L value .
[0086] Exemplarily, for P1 = Set_Packet_Structure([Ethernet, IPv4, TCP]), the service generates a TCP packet, for P2 = Select_Field([IPv4.srcIP]), the source IP address of the generated TCP packet is set randomly. For the primitive P3 = Set_Field_Value([IPv4.dstIP, TCP.flags], ["10.0.0.2", "S"]), the destination IP address of each test packet is set to 10.0.0.2.
[0087] (3.3) Data packet length update: The payload portion of the data packet is intercepted or extended until the data packet length l specified by Set_Packet_Leln is met.
[0088] For example, Set_Packet_Length1() specifies the length of the test data packet, l. The server agent enumerates each test packet P. If the total length of the test packet exceeds the expected length, the test packet is truncated until the length equals l; if the length is less than l, the test packet payload is extended with dummy bytes until the length equals the expected length.
[0089] (3.4) Packet probability setting: According to Set_Prob(k,L field ,μ min ,μ max ) Set the probability of the first k flows appearing in the attack flow at μ min to μ max From the attack traffic set P T Randomly select L field For k packets with different field values, generate k corresponding flows as top-k flows, and make the characteristics of these flows meet the primitive probability requirements (μ min to μ max between).
[0090] (3.5) Replay user-specified data stream: Provides the function of user-defined initial data stream, and replays the user-specified data packets according to Replay_Trace (F) to form the final attack traffic set P T Given a data stream file named F, the application program interface provided by the packet capture function library (libpcap) is used to extract data packets from it to form attack traffic.
[0091] The Ω extracted in step (4) pipe The flow control configuration includes the expected sending rate γ, the list of switch ports L that send data packets port , the total number of times N that large-scale traffic is sent, the duration of each traffic transmission D, and the time interval between two consecutive traffic transmissions I. At the same time, after the initial traffic is generated, the initial traffic set and Ω of the link connecting the server and the switch are pipe The flow control configuration in the command is sent to the switch.
[0092] The pipeline processor in step (5) receives the initial flow set P T and the user-specified hardware-compatible primitive set Ω pipe To meet the needs of medium flow control, the basic packet processing elements in the pipeline are used to control the sending of large-scale traffic. The specific steps for performing flow control include:
[0093] (5.1) Data packet rate control. Apply recirculation and marking mechanism or multi-pipeline cooperation mechanism to control the massive traffic sent out from multiple specified ports Set_Port(L port ) and control the rate of the traffic sent out to meet the expected sending rate Set_Rate(γ) requirement. Optionally, the loopback mode of the port can be configured to enhance the recirculation capability and improve the performance of the control packet rate.
[0094] Exemplarily, when γ does not exceed 100 Gbps, the P T recirculation and marking mechanism is applied in a single ASIC pipeline, and the test packets are sent with the marking satisfying the rate γ, otherwise, the recirculation is entered until the rate γ is satisfied. When γ is higher than 100 Gbps, the multi-pipeline cooperation mechanism is used to jointly perform the rate control. The rate control operation is divided into multiple sub-operations and assigned to specific pipelines L port , and the multi-pipeline cooperation accumulates the sending rate to γ.
[0095] (5.2) Data packet termination control. Count the number of data packets and monitor the duration, and when the requirement of the test number Set_Number(N test ) is met, terminate the sending of the data packets.
[0096] (5.3) Data packet duration control. Record the time stamp of the start of the sending of the data packets and monitor the difference between the current time and the time stamp, and if the difference time reaches the user-specified duration of each test Set_Duration(D), stop sending the test packets.
[0097] (5.4) Interval control. Record the time stamp of the pause of the sending of the data packets, and monitor whether the downtime reaches the user-specified time interval Set_Interval(I) between two consecutive tests, and if so, resume the sending of the data packets.
[0098] Exemplarily, as shown in Figure 2 , the pipeline handler receives the test packets from the server agent and recirculates the packets. In the recirculation process, the test data packets are evenly distributed to L port = [Port1,...,Port in accordance with P4 = Set_Port([Port1,...,Por, and each pipeline accelerates the data packets to the maximum sending rate of 100 Gbps, and the aggregated rate reaches 1 Tbps, satisfying P5 = Set_Rate(1000). At the same time, for P6 = Set_Duration(60), the duration of the ongoing test is monitored in each pipeline by calculating the difference between the current time and the time record of the first data packet sent. If the difference exceeds the expected duration D, the test is terminated.
[0099] As Figure 3 The system flow chart of the present application is shown, a large-scale traffic generation system based on programmable network technology, the system comprises the following modules:
[0100] Task intention primitive module: task intention primitive contains two types of traffic generation primitives and traffic control primitives, which are used to explicitly express the intention of generating large-scale traffic tasks;
[0101] Task primitive division module: according to whether the primitive is compatible with the switch resource limit, the traffic generation task expressed by the primitive is divided into two sets of hardware compatible primitive set and hardware incompatible primitive set;
[0102] Initial traffic generation module: according to the primitive in the hardware incompatible primitive set, the server group is configured to generate data packets that meet the task requirements, and then an initial traffic set is created;
[0103] Server and switch interaction module: while creating the initial traffic, the data packets in the initial traffic set and the traffic control configuration in the hardware compatible primitive set are sent to the switch through the link connecting the server group and the switch, so that the switch pipeline processing program performs subsequent traffic control;
[0104] Traffic control module: according to the traffic control requirements of the hardware compatible primitive, the programmable switch uses the pipeline processor to control the transmission of the initial traffic set sent from the server group, so that the generated large-scale traffic meets the task configuration requirements.
[0105] The above embodiments are only used to illustrate the technical solutions of the present application, but not limit it; although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that they can modify the technical solutions recorded in the foregoing embodiments, or make equivalent replacement for part of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. A method for large-scale traffic generation based on programmable network technology, characterized in that, The method specifically comprises the following steps: (1) task intention primitive: the task intention primitive includes two types of traffic generation primitives and traffic control primitives, which are used to explicitly express the intention of generating large-scale traffic; the traffic generation primitive is used to define the initial format of the data packet of the large-scale traffic, and specifically includes the following primitives: (2.1) Set the data packet header structure L header : Set_Packet_Structure(L header ); (2.2) Set the value of the header field L in different data packets field : Select_Field(L field ); (2.3) Set a specific data packet header field L field to a specified value L value : Set_Field_Value(L field , L value ); (2.4) set the length of each data packet as l: Set_Packet_Length(l); (2.5) Set the k data streams with the largest flow in the initial flow set, i.e. top-k streams, whose probability is between μ min and μ max : Set_Prob(k, L field , μ min , μ max ); (2.6) replay a certain data stream F specified by a user as large-scale traffic: Replay_Trace(F); The traffic control primitive is used to represent the task intention of controlling the initial traffic set, and specifically includes the following primitives: (3.1) Set the list L of switch ports that send large flows port : Set_Port(L port ); (3.2) set the rate γ of sending large-scale traffic: Set_Rate(γ); (3.3) Set the total number of times N of sending large-scale traffic test : Set_Number(N test ); (3.4) set the duration D (seconds) of sending large-scale traffic each time: Set_Duration(D); (3.5) set the time interval I (seconds) of sending large-scale traffic twice in succession: Set_Interval(I); (2) task primitive division: according to whether the primitive is compatible with the switch resource limit, the traffic generation task expressed by the primitive is divided into two sets of hardware compatible primitive set and hardware incompatible primitive set; (3) initial traffic generation: according to the primitive in the hardware incompatible primitive set, the server group is configured to generate data packets meeting the task requirements, and then an initial traffic set is created; (4) server and switch interaction: while creating the initial traffic, the data packets in the initial traffic set and the traffic control configurations in the hardware compatible primitive set are sent to the switch through the link connecting the server group and the switch, so that the switch pipeline processing program performs subsequent traffic control; (5) traffic control: according to the traffic control requirements of the hardware compatible primitive, the programmable switch uses the pipeline processor to control the sending of the initial traffic set sent from the server group, so that the generated large-scale traffic meets the task configuration requirements.
2. The method of claim 1, wherein, The task primitive division process is specifically: enumerating each primitive in a task T generating large-scale traffic; for each primitive P∈T, determining whether P belongs to an attack traffic generation primitive; if yes, P is incompatible with the switch resource, and is added to a hardware incompatible primitive set Ω server , otherwise, P is divided into a hardware compatible primitive set Ω pipe .
3. The method of claim 1, wherein, The step (3) initial traffic generation includes the following steps: (5.1) Packet Generation: Set the header structure of the data packet according to Set_Packet_Structure(L header ) primitive, initialize the fields, establish the dependency of the header fields, and determine the total number of initial data packets required; (5.2) Field value setting: According to the primitive Select_Field(L field ) and Set_Field_Value(L field ,L value ), set the header field of the data packet with a random value or a fixed value; (5.3) data packet length update: the payload part of the data packet is intercepted or extended until the data packet length l specified by Set_Packet_Length(l) is met; (5.4) Data packet probability setting: set the probability of the first k traffic in the initial traffic between μ min and μ max according to Set_Prob(k, L field , μ min , μ max ); (5.5) Replay user-specified data flow: provide the functionality of user customizing the initial data flow, replaying user-specified data packets according to Replay_Trace(F) to form the initial traffic set P T .
4. The method of claim 1, wherein, In the step (5), the pipeline processor receives the initial traffic set P T and the user-specified hardware compatible primitive set Ω pipe In the step (5), the pipeline processor receives the initial traffic set P T and the user-specified hardware compatible primitive set Ω pipe In the step (5), the pipeline processor receives the initial traffic set P T and the user-specified hardware compatible primitive set Ω pipe In the step (5), the pipeline processor receives the initial traffic set P T and the user-specified hardware compatible primitive set Ω pipe In the step ( (7.1) Data message rate control: Apply recirculation and marking mechanism or multi-pipeline cooperation mechanism to control the Set_Port(L port ) to send large-scale traffic, and control the rate of traffic sent to meet the Set_Rate(γ) requirements; (7.2) Packet termination control: Counting of packets and duration monitoring, termination of packet transmission when the requirement of Set_Number(N test ) is reached; (7.3) data packet duration control: record the timestamp of the start of data packet sending and monitor the difference between the current time and the timestamp, if the difference time reaches the user-specified Set_Duration(D), stop sending the test packet; (7.4) interval control: record the timestamp of the pause of data packet sending, and monitor whether the downtime reaches the user-specified Set_Interval(I) of twice continuous test, if it is met, the data packet sending is performed again.
5. A large-scale traffic generation system based on programmable network technology, characterized in that, The system includes the following modules: Task intention primitive module: the task intention primitive includes two types of traffic generation primitives and traffic control primitives, which are used to explicitly express the intention of generating large-scale traffic; The flow generation primitives are used to define the initial format of the data packets of the massive flow, and specifically include the following primitives: setting the packet header structure L header : Set_Packet_Structure(L header ); setting the values of the header fields L field in different data packets: Select_Field(L field ); setting the value of a specific data packet header field L field to a specified value L value : Set_Field_Value(L field , L value ); setting the length of each data packet as l: Set_Packet_Length(l); setting the top-k flows in the initial flow set, i.e., top-k flows, whose probabilities are between μ min , μ max : Set_Prob(k, L field , μ min , μ max ); replaying a user-specified data flow F as the massive flow: Replay_Trace(F); the flow control primitives are used to represent the task intention of controlling the initial flow set, and specifically include the following primitives: setting the switch port list L port for sending the massive flow: Set_Port(L port ); setting the rate γ for sending the massive flow: Set_Rate(γ); setting the total number N test of times for sending the massive flow: Set_Number(N test ); setting the duration D (seconds) of sending the massive flow each time: Set_Duration(D); setting the time interval I (seconds) between two consecutive times of sending the massive flow: Set_Interval(I); The task primitive division module divides the traffic generation task expressed by the primitive into a hardware compatible primitive set and a hardware incompatible primitive set according to whether the primitive is compatible with the switch resource limit; The initial traffic generation module configures the server group according to the primitive in the hardware incompatible primitive set, generates a data packet meeting the task requirement, and further creates an initial traffic set; The server and switch interaction module sends the data packet in the initial traffic set and the traffic control configuration in the hardware compatible primitive set to the switch through the link connecting the server group and the switch, so that the switch pipeline processing program performs subsequent traffic control; The traffic control module uses the pipeline processor to control the sending of the initial traffic set sent from the server group according to the traffic control requirement of the hardware compatible primitive, so that the generated large-scale traffic meets the task configuration requirement.
Citation Information
Patent Citations
Traffic generator for interchanger verification testing by software-hardware cooperation achieving
CN104168162A
Intention-driven network measurement method and system based on P4 programmable switch
CN115118617A