Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm trying to reproduce some issues on a deployed application where the MSSQL server and client are running in two separate machines. I think there may be network issues between the two machines, so I'd like to try and reproduce these conditions on two Hyper-V virtual machines (on the same virtual server). Of course, the network for these virtual machines is "local" so it's actually far from the conditions in a live environment.

Is there a program I can run on either virtual machine which will degrade the network performance? Or maybe any other work arounds? For example, one way to reproduce the conditions may be to run the VMs on separate Hyper-V servers in geographically dispersed locations (so the SQL traffic goes over VPN or something) -- but this is a little long winded I think. There must be a simpler way.

share|improve this question

5 Answers 5

On Linux you'd use netem, on FreeBSD you'd use dummynet.

Neither of those solutions would work on a single Windows machine using Hyper-V. I searched, and I'm not able to locate any Windows Hyper-V compatible network emulators.

You could put two VMs on two different physical machines, with a Linux or FreeBSD box between them. But it doesn't look like there's any solution that's going to do exactly what you want on a single VM host.

share|improve this answer

My friend has set something up using dummynet and FreeBSD in ESX. I know it's not Hyper-V, but you may be able to modify it to work for you. http://apocryph.org/2009/05/15/simulating-slow-wan-links-with-dummynet-and-vmware-esx/

share|improve this answer

Dummynet should work for you: http://info.iet.unipi.it/~luigi/dummynet/

It installs a service on the NIC and then through the command line you set your parameters.

I've used it to test website access over a high-latency or low bandwidth link on Windows XP, and it works very well.

share|improve this answer
    
At the moment there's no 64-bit signed driver for Win7/8 which (sadly) rules this out for some users. –  shuckc May 23 at 13:44

Sounds like you need netem

You can insert packet loss, Latency, jitter etc

share|improve this answer

If it is just for delaying packets, on Linux you can simply use tc and daisy-chain queueing disciplines (e.g. HTB):

[...] HTB as child of another HTB is NOT the same as class under another class within the same HTB. It is because when class in HTB can send it will send as soon as hardware equipment can. So that delay of underlimit class is limited only by equipment and not by ancestors. In HTB under HTB case the outer HTB simulates new hardware equipment with all consequences (larger delay)

losses can also be introduced with iptables and the random module:

# for randomly dropping 10% of incoming packets:
iptables -A INPUT -m statistic --mode random --probability 0.1 -j DROP

# and for dropping 10% of outgoing packets:
iptables -A OUTPUT -m statistic --mode random --probability 0.1 -j DROP
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.