[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-5037":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":16,"stars7d":17,"stars30d":18,"stars90d":16,"forks30d":16,"starsTrendScore":16,"compositeScore":19,"rankGlobal":10,"rankLanguage":10,"license":20,"archived":21,"fork":21,"defaultBranch":22,"hasWiki":23,"hasPages":21,"topics":24,"createdAt":10,"pushedAt":10,"updatedAt":31,"readmeContent":32,"aiSummary":33,"trendingCount":16,"starSnapshotCount":16,"syncStatus":34,"lastSyncTime":35,"discoverSource":36},5037,"comcast","tylertreat\u002Fcomcast","tylertreat","Simulating shitty network connections so you can build better systems.","",null,"Go",10510,378,152,24,0,1,7,68.94,"Apache License 2.0",false,"master",true,[25,26,27,28,29,30],"bandwidth","chaos","chaos-engineering","go","latency","packet-loss","2026-06-12 04:00:24","# Comcast\n\nTesting distributed systems under hard failures like network partitions and instance termination is critical, but it's also important we test them under [less catastrophic conditions](http:\u002F\u002Fwww.bravenewgeek.com\u002Fsometimes-kill-9-isnt-enough\u002F) because this is what they most often experience. Comcast is a tool designed to simulate common network problems like latency, bandwidth restrictions, and dropped\u002Freordered\u002Fcorrupted packets.\n\nIt works by wrapping up some system tools in a portable(ish) way. On BSD-derived systems such as OSX, we use tools like `ipfw` and `pfctl` to inject failure. On Linux, we use `iptables` and `tc`. Comcast is merely a thin wrapper around these controls. Windows support may be possible with `wipfw` or even the native network stack, but this has not yet been implemented in Comcast and may be at a later date.\n\n## Installation\n\n```\n$ go install github.com\u002Ftylertreat\u002Fcomcast@latest\n```\n\n### Path addition may be needed\n\nIn unix-like systems, after installing comcast with go, it may be needed to add it to the `PATH`. Go installs by default in `$HOME\u002Fgo\u002Fbin`.\n```\n$ export PATH=$PATH:$HOME\u002Fgo\u002Fbin\n```\n\n## Usage\n\nOn Linux, Comcast supports several options: device, latency, target\u002Fdefault bandwidth, packet loss, protocol, and port number.\n\n```\n$ comcast --device=eth0 --latency=250 --target-bw=1000 --default-bw=1000000 --packet-loss=10% --target-addr=8.8.8.8,10.0.0.0\u002F24 --target-proto=tcp,udp,icmp --target-port=80,22,1000:2000\n```\n\nOn 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.\n\nOn BSD (with `ipfw`), Comcast currently supports only: device, latency, target bandwidth, and packet loss. \n\n```\n$ comcast --device=eth0 --latency=250 --target-bw=1000 --packet-loss=10%\n```\n\nThis 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:\n\n```\n$ comcast --stop\n```\n\nBy default, comcast will determine the system commands to execute, log them to stdout, and execute them. The `--dry-run` flag will skip execution.\n\n## I don't trust you, this code sucks, I hate Go, etc.\n\nIf you don't like running code that executes shell commands for you (despite it being open source, so you can read it and change the code) or want finer-grained control, you can run them directly instead. Read the man pages on these things for more details.\n\n### Linux\n\nOn Linux, you can use `iptables` to drop incoming and outgoing packets.\n\n```\n$ iptables -A INPUT -m statistic --mode random --probability 0.1 -j DROP\n$ iptables -A OUTPUT -m statistic --mode random --probability 0.1 -j DROP\n```\n\nAlternatively, you can use `tc` which supports some additional options.\n\n```\n$ tc qdisc add dev eth0 root netem delay 50ms 20ms distribution normal\n$ tc qdisc change dev eth0 root netem reorder 0.02 duplicate 0.05 corrupt 0.01\n```\n\nTo reset:\n\n```\n$ tc qdisc del dev eth0 root netem\n```\n\n### BSD\u002FOSX\n\nTo shape traffic in BSD-derived systems, create an `ipfw` pipe and configure it. You can control incoming and outgoing traffic separately for any specific host or network.\n\n```\n$ ipfw add 1 pipe 1 ip from me to any\n$ ipfw add 2 pipe 1 ip from any to me\n$ ipfw pipe 1 config delay 500ms bw 1Mbit\u002Fs plr 0.1\n```\n\nTo reset:\n\n```\n$ ipfw delete 1\n```\n\n*Note: `ipfw` was removed in OSX Yosemite in favor of `pfctl`.*\n\n## Network Condition Profiles\n\nHere's a list of network conditions with values that you can plug into Comcast. Please add any more that you may come across.\n\nName | Latency | Bandwidth | Packet-loss\n:-- | --: | --: | --:\nGPRS (good) | 500 | 50 | 2\nEDGE (good) | 300 | 250 | 1.5\n3G\u002FHSDPA (good) | 250 | 750 | 1.5\nDIAL-UP (good) | 185 | 40 | 2\nDSL (poor) | 70 | 2000 | 2\nDSL (good) | 40 | 8000 | 0.5\nWIFI (good) | 40 | 30000 | 0.2\nStarlink | 20 | - | 2.5\n","Comcast 是一个用于模拟网络问题的工具，旨在帮助开发者构建更加健壮的分布式系统。它能够模拟延迟、带宽限制以及丢包等常见网络故障，通过封装 `iptables`、`tc`（Linux）、`ipfw` 和 `pfctl`（BSD\u002FOSX）等系统级网络控制工具来实现跨平台的网络条件模拟。适用于需要测试软件在网络状况不佳时表现的各种场景，如微服务架构下的容错性测试、移动应用的弱网环境适应性评估等。项目采用 Go 语言编写，支持 Linux、OSX 和 BSD 系统，并遵循 Apache License 2.0 开源许可协议。",2,"2026-06-11 03:02:11","top_language"]