How can I simulate TCP/IP errors?

ⅰ亾dé卋堺 提交于 2019-11-29 07:50:51

问题


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.


回答1:


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




回答2:


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.




回答3:


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.



回答4:


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





回答5:


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.



来源:https://stackoverflow.com/questions/2121458/how-can-i-simulate-tcp-ip-errors

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!