Comcast是一个用来模拟各种常用的网络问题的工具,例如延迟、带宽限制以及丢包等等问题。
Comcast使用可移植的方式封装了各种系统工具,例如ipfw和pfctl来注入网络通信失败问题。
安装$gogetgithub.com/tylertreat/comcast使用在Liux中 Comcast支持很多选项,包括设备、延迟、目标、默认带宽、丢包、协议和端口等。
$comcast--device=eth0--latecy=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:2000OOSX,Comcastwillcheckfor pfctl support(asofYosemite),whichsupportsthesameoptiosasabove.If pfctl isotavailable,itwilluse ipfw istead,whichsupportsdevice,latecy,targetbadwidth,adpacket-lossoptios.
OBSD(with ipfw),Comcastcurretlysupportsoly:device,latecy,targetbadwidth,adpacketloss.
$comcast--device=eth0--latecy=250--target-bw=1000--packet-loss=10%Thiswilladd250msoflatecy,limitbadwidthto1Mbps,addrop10%ofpacketstothetargetted(oLiux)destiatioaddressesusigthespecifiedprotocolsothespecifiedportumbers(slowlae).Thedefaultbadwidthspecifiedwillapplytoallegresstraffic(fastlae).Toturthisoff,ruthefollowig:
$comcast--stopBydefault,comcastwilldetermiethesystemcommadstoexecute,logthemtostdout,adexecutethem.The --dry-ru flagwillskipexecutio.
评论