Search This Blog

2015-07-21

Limiting Bandwidth Using Robocopy

Robocopy does not have any built in bandwidth limiter by rate specifically.

But what you can do is use the inner packet gap switch /ipg:n to simulate a lower bandwidth by adding more delay between packets.

The equation to use to calculate is as follows:

Where
D is the calculated latency or inner packet gap
Bd is the desired bandwidth you would like to transfer at
Ba is the available bandwidth to you

Example:
If my
Bd is 200kbps
Ba is 1000kbps

D=((1000-200)/(1000*200))*512*1000=2048


Therefore my /ipg:n will be /ipg:2048

References:
https://yellowtriangle.wordpress.com/2012/06/28/bandwidth-throttling-with-robocopy/
http://www.zeda.nl/index.php/en/copy-files-on-slow-links
https://technet.microsoft.com/en-us/library/cc733145.aspx

3 comments:

  1. I have seen this formula elsewhere and I think it is bogus.

    The robocopy /IPG parameter specifies the inter-packet gap in milliseconds. The formula above inserts a full 2.048 seconds between each packet. In order to determine mathematically what the bandwidth utilization of a transfer that sends a single packet every 2 seconds is we would need to know what the packet size (MTU) is. To use the most common scenario let's use 1500 bytes, or (8*1500)=12,000 bits. If we are sending a single packet every 2 seconds then we are transferring at a rate of 12,000/2 or 6Kbps, not 200Kbps. And the fact that MTU is not even a factor in the formula tells me that it can't possibly be valid.

    ReplyDelete
  2. Actually the formula is correct because the value 512 in the above formula indicates a 64KB packet which is the size that robocopy uses. This was not stated in the explanation, but it is accounted for.

    ReplyDelete