How can I simulate TCP/IP errors?
Asked Answered
W

5

15

On a multi-tier application, I need to simulate various TCP/IP errors to test some reconnection code. Does anyone know of any tools (Windows based) I can use for this purpose? Thanks.

Winters answered 23/1, 2010 at 0:22 Comment(2)
Got some great answers here. I'll post back as soon as I can try these out. Thanks everyone.Winters
Hi, Have you been able to test them? I want to introduce some errors which TCP cannot detect I wonder how.Outgeneral
D
5

Try netwox (formerly lcrzoex.) If it won't do it, it can't be done. It contains >200 tools.

Diagnostic answered 23/1, 2010 at 0:56 Comment(2)
This let me find what I needed the fastest. Thanks.Winters
Site is down, but there's a graveyard download page here: ntwox.sourceforge.netFourfold
S
6

Scapy allows you to control every aspect of the packets, and randomly modify ("fuzz") the ones you don't want to control. If you're a command-line kind of guy, it's a great tool.

Saturated answered 23/1, 2010 at 7:26 Comment(0)
D
5

Try netwox (formerly lcrzoex.) If it won't do it, it can't be done. It contains >200 tools.

Diagnostic answered 23/1, 2010 at 0:56 Comment(2)
This let me find what I needed the fastest. Thanks.Winters
Site is down, but there's a graveyard download page here: ntwox.sourceforge.netFourfold
P
1

On FreeBSD, the best tool, by far, is dummynet, "a tool originally designed for testing networking protocols, and since then used for a variety of applications including bandwidth management. It simulates/enforces queue and bandwidth limitations, delays, packet losses, and multipath effects."

On Linux, you will have to use netem. (It seems there is now a port of dummynet but I never tried it.)

More details (in French) in my article.

Platto answered 24/1, 2010 at 19:54 Comment(1)
Unfortunately, neither of these would work as we're a Windows shop, and I don't have time to try to port them. Thanks Though.Winters
C
1

Clumsy is a good tool for TCP error simulation on Windows. It can simulate (copy-pasted from link above):

  • Lag, hold the packets for a short period of time to emulate network lagging.
  • Drop, randomly discard packets.
  • Throttle, block traffic for a given time frame, then send them in a single batch.
  • Duplicate, send cloned packets right after to the original one.
  • Out of order, re-arrange the order of packets.
  • Tamper, nudge bits of packet's content.
Cowart answered 8/4, 2016 at 3:38 Comment(2)
I've just tried clumsy and it's pretty good! It seems to be more brutal in effect than what the parameters seem to imply, but certainly does the job of messing up the transmissions. (e.g. I found adding a 50ms lag, totally breaks TCP which I would't have anticipated)Fourfold
Even with all the "Functions" off, when it's "Started" the traffic is always seriously broken. So it's not working properly...but does make errors.Fourfold
H
0

No tools that I'm aware of, but most of TCP errors can be emulated by a custom LSP filter. This article can get you started writing one


Heterogenetic answered 23/1, 2010 at 0:40 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.