Comcast 介绍
Comcast 是一个用来模拟各种常用的网络问题的工具,例如延迟、带宽限制以及丢包等等问题。
Comcast 使用可移植的方式封装了各种系统工具,例如 ipfw 和 pfctl 来注入网络通信失败问题。
安装
$ go get github.com/tylertreat/comcast
使用
在 Linux 中 Comcast 支持很多选项,包括设备、延迟、目标、默认带宽、丢包、协议和端口等。
$ comcast --device=eth0 --latency=250 --target-bw=1000 --default-bw=1000000 --packet-loss=10% --target-addr=8.8.8.8,10.0.0.0/24 --target-proto=tcp,udp,icmp --target-port=80,22,1000:2000
On OSX, Comcast will check for pfctl support (as of Yosemite), which
supports the same options as above. If pfctl is not available, it will use
ipfw instead, which supports device, latency, target bandwidth, and packet-
loss options.
On BSD (with ipfw), Comcast currently supports only: device, latency, target
bandwidth, and packet loss.
$ comcast --device=eth0 --latency=250 --target-bw=1000 --packet-loss=10%
This will add 250ms of latency, limit bandwidth to 1Mbps, and drop 10% of
packets to the targetted (on Linux) destination addresses using the specified
protocols on the specified port numbers (slow lane). The default bandwidth
specified will apply to all egress traffic (fast lane). To turn this off, run
the following:
$ comcast --stop
By default, comcast will determine the system commands to execute, log them to
stdout, and execute them. The --dry-run flag will skip execution.
Comcast 官网
https://github.com/tylertreat/comcast
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。