jwbensley / Etherate

Linux CLI Ethernet and MPLS Testing Tool
MIT License
175 stars 19 forks source link

Add packet pacing feature #37

Open jwbensley opened 6 years ago

jwbensley commented 6 years ago
ISSUE TYPE
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
jwbensley commented 6 years ago

Add some documentation information about how coalescing may interfere.

Ref: https://scholzd.github.io/MoonGen/rate_control.html

jwbensley commented 6 years ago

Can we use nanosleep instead?