VS2010 supports true network emulation i.e. the ability to simulate network conditions by directly manipulating the network packets. The Network Emulation that we provide in Visual Studio 2010 is a software-based emulator which can emulate the behaviour of both wired and wireless networks using a reliable physical link, such as an Ethernet. A variety of network attributes are incorporated into the VS2010 Network Emulation model, including round-trip time across the network (latency), the amount of available bandwidth, queuing behaviour, packet loss, reordering of packets, and error propagations.
You can specify network mix while creating load test. The network mix gives you a way to simulate load more realistically in a load test scenario. Load is generated by using a heterogeneous mix of network types instead of one single network type. You create a closer approximation of how end-users interact with your applications. You can read here regarding how to specify n/w mix while creating load test.
Right now these profiles are available out of box for a Visual Studio Load Test user:
You can find *.network file for each of above profile at %ProgramFiles%\Microsoft Visual Studio 10.0\Common7\IDE\Templates\LoadTest\Networks e.g.Cable-DSL 1.5Mbps.network. This file contains all imp settings for a network file like Latency, Packet Loss, Queue Management etc.
You can either modify an existing file / create a new file according to your requirement to create a new custom network profile. After you restart VS, This new profile will be available to you while creating n/w mix in load test so creating a new custom network profile is very simple as such. But imp thing is understanding the various imp parameters available inside network profile that you can tweak according to your requirements. So let’s have a look at them:
Upstream / Downstream LinkRule
upstream network traffic flows away from the local computer toward the remote destination. Conversely, downstream traffic flows to the user's computer. The following are the imp network attributes that can be defined for them:
Let’s cover these network attributes in detail:
Bandwidth describes “the amount of data that can be transferred to or from the website or server, measured in bytes transferred over a prescribed period of time.” –Wikipedia. You can specify the bandwidth for the upstream and downstream of a link. If no bandwidth is specified then network emulation will do nothing to modify the rate at which the packet passes through.
<Bandwidth> <Speed unit="kbps">1500</Speed> </Bandwidth>
Latency is “the time taken for a packet of data to be sent from one application, travel to, and be received by another application. This includes transit time over the network, and processing time at the source and the destination computers.” -Wikipedia.
There are five type of latencies that you can specify:
<Latency> <Fixed> <Time unit="msec">150</Time> </Fixed> </Latency>
In the real world, packets traveling across a network may fail to reach their target and packet loss occurs. You can use any one of four packet loss patterns specified below:
<Loss> <Random> <Rate>0.035</Rate> </Random> </Loss>
Queuing behaviour describes how received packets are queued and processed. You can specify normal / RED queue in network profile:
Dropping rules are also defined for queuing behaviour, and the following dropping rules are available:
<QueueManagement> <NormalQueue> <Size>100</Size> <QueueMode>packet</QueueMode> <DropType>DropTail</DropType> </NormalQueue> </QueueManagement>
I hope now you’ll be able to create a custom network profile easily. Let me know in case of any Qs / issues. You can post your query here as well.