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.
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.
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/
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.
An additional method is the standalone Network Emulator Toolkit (NEWT), which despite it's age is quite capable and works for x86 and x64 Windows operating systems.
https://blog.mrpol.nl/2010/01/14/network-emulator-toolkit/
Using the included XML templates with the installer, you can quickly get up and running on simulating latency, bandwidth, jitter, and other network variables.
I have tested and used this application on all versions of Windows from XP -> Windows 10.
Sounds like you need netem
You can insert packet loss, Latency, jitter etc
If it is just for delaying packets, on Linux you can simply use tc and daisy-chain queueing disciplines (e.g. HTB):
losses can also be introduced with iptables and the
random
module: