Add packet pacing feature
jwbensley opened this issue · 2 comments
ISSUE TYPE
- Bug Report
- Enhancement/Feature Request
- Question
VERSION DETAILS
N/A
SUMMARY
Provide a packet pacing feature to smooth the inter-frame transmission timing.
STEPS TO REPRODUCE
Have a CLI option to enable a "smoothed" transmission interval between frames (packet pacing). When setting a max speed with -m
/-M
the NIC burst until the rate-limit is reached and then for the remainder of the 1 second interval the NIC is idle. -T
could set a delay between frame transmission which will smooth out the transmission rate of the max speed set in Mbps/MBps
e.g. -T
could be a flag to enable traffic "smoothing" (packet pacing) to smooth out a 10Mbps stream so that 825 frames of 1514 bytes are evenly paced over a 1 second interval:
1514 * 8 == 12112 bits per frame.
Target "smoothed" Tx rate == 10Mbps (10,000,000 bits per second)
10,000,000 / 12112 == ~825 frames per second
1Gbps NIC == 1,000,000,000 bits per second Tx rate
12112 / 1,000,000,000 == one frame takes 0.000012112 seconds to Tx.
0.000012112ns * 825 == 0.009992400 seconds required to Tx 825 frames
1.0 - 0.0099924 == 0.990007600 remaining to be spread out as inter-frame delay
0.990007600 / 825 == 0.00120000921 seconds inter-frame delay
sudo ./etherate -M 10000000 -T
Add some documentation information about how coalescing may interfere.
Can we use nanosleep instead?