Configs2026年7月20日·1 分钟阅读

Comcast — Simulate Bad Network Conditions for Testing

Comcast is a CLI tool that simulates degraded network conditions such as latency, bandwidth throttling, packet loss, and jitter. It helps developers test how their applications behave under realistic adverse network scenarios.

Agent 就绪

Agent 可直接安装

这个资产可安装;Agent 先选择当前运行时、检查安装计划,再运行匹配命令。

Native · 98/100策略:允许
Agent 入口
任意 MCP/CLI Agent
类型
Skill
安装
Single
信任
信任等级:Established
入口
Comcast
直接安装命令
npx -y tokrepo@latest install ab2d5558-8437-11f1-9bc6-00163e2b0d79 --target codex

先 dry-run 确认安装计划,再运行此命令。

Introduction

Comcast is a lightweight command-line tool for simulating poor network conditions on your local machine. Named after the notoriously unreliable ISP experience, it lets developers inject latency, throttle bandwidth, drop packets, and add jitter to any network interface. This makes it straightforward to verify application resilience before deploying to production.

What Comcast Does

  • Injects configurable latency (in milliseconds) on outgoing network traffic
  • Throttles bandwidth to a specified rate in kbps for upload and download
  • Simulates packet loss at a configurable percentage
  • Adds jitter to create variable latency that mimics real-world networks
  • Targets specific ports, protocols, or IP ranges for focused testing

Architecture Overview

Comcast wraps platform-native traffic control utilities to apply network rules. On Linux it uses tc (traffic control) and iptables, on macOS it uses ipfw or pfctl, and on Windows it uses the built-in packet scheduling. The tool builds the appropriate system commands based on the user-specified parameters and applies them to the chosen network interface.

Self-Hosting & Configuration

  • Install via go install or download a prebuilt binary from the GitHub releases page
  • Requires root or administrator privileges to modify network interface settings
  • Specify the network device with --device (e.g., eth0, en0, Wi-Fi)
  • Target specific traffic with --target-addr, --target-port, and --target-proto flags
  • Remove all applied rules with --stop to restore normal network behavior

Key Features

  • Cross-platform support for Linux, macOS, and Windows
  • Fine-grained control over latency, bandwidth, packet loss, and jitter independently
  • Port and protocol targeting to isolate specific service traffic
  • Stateless operation with no daemon or background process required
  • Simple one-command interface with no configuration files needed

Comparison with Similar Tools

  • tc (Linux) — Comcast wraps tc with a friendlier interface and cross-platform support
  • Toxiproxy — Toxiproxy operates as a TCP proxy between client and server; Comcast works at the network interface level
  • Clumsy (Windows) — GUI-based Windows tool; Comcast offers CLI automation across all platforms
  • netem — Comcast uses netem under the hood on Linux but adds simpler command-line ergonomics
  • Pumba — Pumba targets Docker containers specifically; Comcast shapes traffic system-wide

FAQ

Q: Does Comcast require a special network setup? A: No. It uses built-in OS networking tools (tc/iptables on Linux, pfctl on macOS) and only needs root access.

Q: Can I target traffic to a specific service? A: Yes. Use --target-port and --target-addr flags to limit shaping to traffic headed for a particular IP and port.

Q: Will Comcast affect all traffic on my machine? A: By default it shapes all traffic on the specified device. Use targeting flags to narrow the scope to specific destinations.

Q: How do I undo all changes? A: Run sudo comcast --device=eth0 --stop to remove all traffic shaping rules and restore normal behavior.

Sources

讨论

登录后参与讨论。
还没有评论,来写第一条吧。

相关资产