An impairment unit, comprising: a network interface (322, 324) to receive network traffic from a network and to transmit impaired network traffic to the network; an impairment engine to generate the impaired traffic based on the received network traffic, the impaired network traffic including at least some duplicate packets, the impairment engine comprising: input logic configured to - measure a gap length between each pair of successive packets in the received traffic and add available bandwidth corresponding to the gap length to a duplicate credit value, or - to sum a total length of packets in the received traffic over each of a plurality of successive time intervals, and to subtract the sum from a predetermined maximum cumulative packet length and add the remainder to the duplicate credit value after the end of each time interval, and a duplicate credit accumulator storing the duplicate credit value that is increased by the input logic and decreased by an output logic of the impairment engine, and the output logic being configured: to compare a length of a requested duplicate packet to the duplicate credit value when the length of the requested duplicate packet is less than or equal to the duplicate credit value, to schedule the requested duplicate packet for transmission as part of the outgoing impaired traffic and reduce the duplicate credit value by the length of the requested duplicate packet when the length of the requested duplicate packet is greater than the duplicate credit value, to discard the requested duplicate packet. a network interface (322, 324) to receive network traffic from a network and to transmit impaired network traffic to the network; an impairment engine to generate the impaired traffic based on the received network traffic, the impaired network traffic including at least some duplicate packets, the impairment engine comprising: input logic configured to - measure a gap length between each pair of successive packets in the received traffic and add available bandwidth corresponding to the gap length to a duplicate credit value, or - to sum a total length of packets in the received traffic over each of a plurality of successive time intervals, and to subtract the sum from a predetermined maximum cumulative packet length and add the remainder to the duplicate credit value after the end of each time interval, and a duplicate credit accumulator storing the duplicate credit value that is increased by the input logic and decreased by an output logic of the impairment engine, and input logic configured to - measure a gap length between each pair of successive packets in the received traffic and add available bandwidth corresponding to the gap length to a duplicate credit value, or - to sum a total length of packets in the received traffic over each of a plurality of successive time intervals, and to subtract the sum from a predetermined maximum cumulative packet length and add the remainder to the duplicate credit value after the end of each time interval, and a duplicate credit accumulator storing the duplicate credit value that is increased by the input logic and decreased by an output logic of the impairment engine, and - measure a gap length between each pair of successive packets in the received traffic and add available bandwidth corresponding to the gap length to a duplicate credit value, or - to sum a total length of packets in the received traffic over each of a plurality of successive time intervals, and to subtract the sum from a predetermined maximum cumulative packet length and add the remainder to the duplicate credit value after the end of each time interval, and the output logic being configured: to compare a length of a requested duplicate packet to the duplicate credit value when the length of the requested duplicate packet is less than or equal to the duplicate credit value, to schedule the requested duplicate packet for transmission as part of the outgoing impaired traffic and reduce the duplicate credit value by the length of the requested duplicate packet when the length of the requested duplicate packet is greater than the duplicate credit value, to discard the requested duplicate packet. to compare a length of a requested duplicate packet to the duplicate credit value when the length of the requested duplicate packet is less than or equal to the duplicate credit value, to schedule the requested duplicate packet for transmission as part of the outgoing impaired traffic and reduce the duplicate credit value by the length of the requested duplicate packet when the length of the requested duplicate packet is greater than the duplicate credit value, to discard the requested duplicate packet.