When using UDP datagrams can get reordered/dropped/duplicated. However this is unlikely to occur when you test with 127.0.0.1.
Is there already a program that forwards UDP packets, dropping/duplicating/reordering them?
Expected us开发者_JAVA百科age:
udpdegrade 0.0.0.0 1234 127.0.0.1 1235 0.02 0.02 30 0.05
bind address sendto address drop prob. dup prob. reorder params
If no, what features should it have, how should it be configured, how should it be called?
Yes there are tools for this. You're looking for a network simulator/emulator.
WANem is one option http://wanem.sourceforge.net/ another option is netem http://www.linuxfoundation.org/collaborate/workgroups/networking/netem. I think you're asking whether or not there's value in developing another tool for this? Not sure. Both WANem and netem are imperfect; there are other commercial products such as Shunra which try to more closely replicate real network behavior.
As a developer I've implemented re-ordering and loss directly in my application code to test its robustness to those events. Perhaps code that does that generically would be useful (network emulation from inside your application)...
精彩评论