How I can Specifying tcpreplay speed

networkingtcpreplay

I am tring to Specify tcpreplay speed but I can't do it
this is my detail of test:

$tcpreplay -V
tcpreplay version: 3.4.4 (build 2450)

1)$ tcpreplay -i %0 -p 100 -L 500 _udp_only.pcap
Actual: 500 packets (42247 bytes) sent in 5.05 seconds.Rated: 8365.7 bps, 0.06 Mbps, 99.01 pps
s

2)$ tcpreplay -i %0 -p 1000 -L 5000 _udp_only.pcap
Actual: 5000 packets (427710 bytes) sent in 5.19 seconds. Rated: 82410.4 bps, 0.63 Mbps, 963.39 pps

//here is problem I stay in 966.00 pps

3)$ tcpreplay -i %0 -p 10000 -L 50000 _udp_only.pcap
Actual: 50000 packets (4322559 bytes) sent in 51.76 seconds.Rated: 83511.6 bps, 0.64 Mbps, 966.00 pps

I have same problem when I try to Specify –mbps
for 8600 packets 86 byte avg for each packet

-M0.086 -L 860 —-> Rated: 10812.9 bps, 0.08 Mbps, 127.22 pps

-M0.86 -L 860 —-> Rated: 83062.5 bps, 0.63 Mbps, 977.27 pps

-M0.86 -L 8600 —-> Rated: 82554.9 bps, 0.63 Mbps, 965.21 pps

why and how I can to Specify speed?

I use OS windows7

Best Answer

A few comments:

  1. Windows support in tcpreplay is pretty much of a beta quality. High precision timing turns out to be very OS and hardware specific and Windows has the least amount of testing & development. You'll have better luck under Linux or OS X.

  2. Small packets + using the --mbps option (-M) is pretty much a worst case scenario for accurate packet timing. Using -M requires tcpreplay to dynamically calculate delays (more CPU intensive) and small packets makes even small inaccuracies in sending the packets look a lot worse when compared to larger packets.

  3. Your run of "-M0.086 -L 860 ----> Rated: 10812.9 bps, 0.08 Mbps, 127.22 pps" is pretty damn close. Tcpreplay only prints out two significant figures, so 0.08 for 0.086 is as "close" as you can expect.