强制丢包 [英] Forcing packet loss

查看:123
本文介绍了强制丢包的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

出于测试目的,为了确定协议实现在丢包的情况下的行为,我想在我的一个网络设备上强制丢包.具体来说,我希望能够调整丢包率,介于0%和100%之间.我对iptables有一点经验,在我看来我应该可以使用iptables来实现它,但是我却没有能够做到.虽然实现100%的数据包丢失不是问题;).有关如何执行此操作的任何想法?

For testing purposes, to determine how a protocol implementation behaves in the presence of packet loss, I would like to force packet loss on one of my network devices. Specifically, I would like to be able to tune the packet loss anywhere between 0% and 100%. I have a little experience with iptables and it seems to me I should be able to achieve it using that, but I haven't been able to. Achieving 100% packet loss is not a problem though ;). Any ideas on how to do this?

推荐答案

查看 iptables'统计模块.

我猜是这样的

iptables -A FORWARD -m statistic --mode random --probability 0.5 -j DROP

应该在路由器上完成任务.

should do the trick on a router.

这篇关于强制丢包的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆