A method for generating simulated network traffic using a plurality of different traffic flows and maintaining a configured distribution between the flows and a device under test, the method comprising:
- at a network emulator:
- determining a number of operations per flow for each of a plurality of flows that generate simulated network traffic between the flows and a device under test;
- determining a desired traffic distribution among the traffic generated by the traffic flows;
- assigning a weight to each flow that determines the number of times to execute each flow during execution of a batch of flows;
- and
- executing the flows in batches according to the assigned weights to generate the desired distribution of traffic between the different flows and the device under test;
- wherein each of the weights indicates a number of times to execute a flow in a given batch and wherein executing the flows in batches includes executing each flow wi times in a given batch, where wi is the weight that defines the number of times for executing the ith flow in a batch to achieve the desired traffic distribution.