views:

48

answers:

2

OK. So, this is exactly the opposite of what everyone asks about in network programming. Usually, people ask how to make a broken socket work. I, on the other hand am looking for the opposite.

I currently have sockets working fine, and want them to break to re-create this problem we are seeing. I am not sure how to go about intentionally making the socket fail by having a bad read. The trick is this: The socket needs to be a working, established connection, and then it must fail for whatever reason.

I'm writing this in C and the drivers are running on a Linux system. The sockets are handled by a non-IP Level 3 protocol in Linux by a Linux Device Driver. I have full access to all of the code-base, I just need to find a way to tease it out so that it can fail.

Any ideas?

+1  A: 

Can you modify your kernel? You could introduce a method to induce errors at the network stack level.

Shaggy Frog
Hi Shaggy, yes, I can customize the kernel. I have not done much in the kernel, yet, so I think it might be a good learning opportunity for me.Thanks for the suggestion.
Chad Rhyner
+1  A: 

One classic trick is to unplug the network cable.

R Samuel Klatchko
Thank you for the thought, but I forgot to mention something. This is one piece of hardware, and it does have a hardware module inserted into the appliance. All routing goes through hardware, and not through an Ethernet cable, so nothing to unplug. :-(I apologize for not mentioning this earlier.
Chad Rhyner