synfinatic/tcpreplay — pull request #112 by fklassen (2013-11-24 08:21:55+00:00)
Title: Enhancement mbps option accuracy

This branch increases the accuracy of the --mbps option and removes unnecessary calls to gettimeofday(). Before changes my 10GigE network behaved as follows...
```
root@portwell29:~/tcpreplay-netmap# bin4.0_master/tcpreplay --intf1=eth7 --preload-pcap --mbps=4000 --loop=50 bosTap.pcap
File Cache is enabled
Actual: 39580750 packets (17770889200 bytes) sent in 45.06 seconds.
Rated: 394382816.0 Bps, 3155.06 Mbps, 878401.00 pps
Statistics for network device: eth7
Attempted packets: 39580750
Successful packets: 39580750
Failed packets: 0
Retried packets (ENOBUFS): 0
Retried packets (EAGAIN): 0
```

After changes ...

```
root@portwell29:~/tcpreplay-netmap# bin4.0/tcpreplay --intf1=eth7 --preload-pcap --mbps=4000 --loop=50 bosTap.pcap
File Cache is enabled
Actual: 39580750 packets (17770889200 bytes) sent in 35.54 seconds.
Rated: 500025024.0 Bps, 4000.20 Mbps, 1113695.88 pps
Statistics for network device: eth7
Attempted packets: 39580750
Successful packets: 39580750
Failed packets: 0
Retried packets (ENOBUFS): 0
Retried packets (EAGAIN): 0
```