views:

68

answers:

5

Besides "no connection", what other failure modes should I test for? How do I simulate a high-latency link, an unreliable link, or all the other sorts of crazy stuff that will undoubtedly happen "in the wild"? How about wireless applications--how do I test the performance in a less-than-ideal WL environment?

A: 

You definitely want to test physically pulling the cable out. Lots of networking code will throw different exceptions in that scenario vs when the connection has just been lost.

TimK
A: 

To add to TimK's answer, if you have a router, test pulling the upstream link on the router, this will test a bad connection without your system knowing that you lost the physical link.

thelsdj
+1  A: 

To add to TimK's answer, if you have a router, test pulling the upstream link on the router, this will test a bad connection without your system knowing that you lost the physical link.

Also if you plug it back in after a few seconds it's possible that the connection won't be lost*. This can simulate a very high latency.

*this depends on your ISP and your router.

Michał Piaskowski
A: 

Our network/server closet is a spaghetti-mess of wires; I'm not going to walk in there and start unplugging stuff lest I hit something mission-critical. (At least I have access to it; I'm sure many readers don't even know where their routers are.) Similarly, both ends of the ethernet cable require a hands-and-knees adventure to reach.

I tested enabling/disabling the network adapter, and I'm going to test from my cable internet connection from home as well. Also, I had the idea of installing Tor to create a high latency connection.

For wireless connections, I have a metal box to test what happens when the signal dies, but I notice that network connection behavior is very different depending on how I test:

  • put the transmitter/reciever in a metal box
  • go stand next to the microwave in the kitchen and turn it on
  • go stand in a little closet which has concrete walls
Nick
+1  A: 

If you're using Linux, try Virtual Distributed Ethermet (VDE).

VDE gives you virtualised switches/hubs and Ethernet cables. You can tune network characteristics such as latency, delay, MTU, errored bits per MB, bandwidth, duplicates, etc on individual cables - all in real time!

asussex