AI News HubLIVE
サイト内リライト6 分で読了

翻訳待ち:Show HN: Bean Network Tester – open-source bad network simulator

AI サービスが一時的に利用できないため、復旧後に翻訳を補完します。ソース概要:Uh oh! There was an error while loading. Please reload this page. Notifications You must be signed in to change notification settings Fork 1 Star 18 BranchesTags Open more actions menu Folders and files NameName Last co…

ソースHacker News AI著者: donislawdev

AI サービスが一時的に利用できないため、復旧後に翻訳を補完します。

Uh oh! There was an error while loading. Please reload this page. Notifications You must be signed in to change notification settings Fork 1 Star 18 BranchesTags Open more actions menu Folders and files NameName Last commit message Last commit date Latest commit History 284 Commits 284 Commits .github .github beantester beantester docs docs lang lang licenses licenses scenarios scenarios tests tests tools tools .gitattributes .gitattributes .gitignore .gitignore BeanNetworkTester.spec BeanNetworkTester.spec CHANGELOG.md CHANGELOG.md CODE_OF_CONDUCT.md CODE_OF_CONDUCT.md CONTRIBUTING.md CONTRIBUTING.md LICENSE LICENSE README.md README.md README.pl.md README.pl.md SECURITY.md SECURITY.md THIRD-PARTY-NOTICES.md THIRD-PARTY-NOTICES.md VERSION.txt VERSION.txt bean.ico bean.ico bean.png bean.png bean_network_tester.py bean_network_tester.py build.py build.py pyproject.toml pyproject.toml requirements-dev.txt requirements-dev.txt requirements.txt requirements.txt smoke_gui.py smoke_gui.py Repository files navigation Bean Network Tester is a tool for testers and developers: check how your application behaves on a poor connection. Like Clumsy or NetLimiter, it lets you deliberately degrade the network - add ping, drop packets, cap the speed, tear connections down, and more. It works by intercepting traffic with the WinDivert driver (via PyDivert), and offers both a clear windowed interface with tooltips and a command-line mode for CI. ⭐ If it saved you time, leave a star. That is how the next tester who needs it finds out it exists. This is the English documentation. Polish version: README.pl.md. What it can do Add lag and jitter - fixed or random delay. Drop, corrupt or duplicate packets - fake a flaky link. Cap download/upload speed - throttle to a set KB/s. Tear connections down - TCP resets or a dead link. Flap the link on and off - outages that come and go. Block ports or IPs - a small built-in firewall, plus LAN mode (no internet). Aim at one app - by process, PID, IP or port. Presets and saved profiles - 56k modem, Cafe WiFi, Satellite, In-flight Wi-Fi and more. Run scripted scenarios - timed steps that change the network on their own. Reproducible by seed - replay the exact same random loss and jitter. Watch it live - chart, connections table, counters. Command-line mode - scriptable for CI. No telemetry, fully offline - sends no data anywhere. Table of contents Quick start (3 steps) Language Requirements The window All options explained Filter syntax (process / IP / port) Statistics (what the counters mean) Configuration file Command-line mode (CLI) Connections columns CSV exports Scenario file format CI/CD recipes Building an .exe Gotchas (read before filing a bug) Tests Project layout How it works (in brief) Notes and limitations Contributing Support the project Author License Third-party components Privacy: no telemetry A note on SmartScreen and antivirus Quick start (3 steps) Download BeanNetworkTester (or build it: pyinstaller --noconfirm BeanNetworkTester.spec). Run BeanNetworkTester.exe - the program asks for administrator rights by itself (WinDivert needs them). From the repository: python bean_network_tester.py. Pick a preset from the "Profiles" list (e.g. "3G network") and click START. The same file runs the text mode: BeanNetworkTester.exe --simulate --loss 10 --duration 5. At the top of the window an "Active: ..." bar summarises what you are doing right now (e.g. Active: +150 ms ping, 1% loss, download .json files (bundled: lang/pl.json with full Polish characters and lang/en.json). On startup the app scans the lang/ directory and detects the available languages automatically, and the startup language follows your system locale (Polish system -> Polish, no match -> English). A Language / Jezyk selector in the top-right corner switches it at any time - the UI rebuilds in the chosen language while keeping your current settings. Everything in the interface is translated: tabs, labels, buttons, tooltips, column headers, statistics, the session panel, the event log, log messages, dialogs, and error messages (exceptions shown to the user). The code uses keys only (e.g. app.tabs.statistics) and the text comes from the language file. When a key is missing in the chosen language English is used, and as a last resort the key itself. (The command line - CLI - is always in English, regardless of system and UI language.) Adding a new language needs no code changes: copy lang/en.json to e.g. lang/de.json, translate the values and fill in the header "_meta": {"code": "de", "name": "Deutsch"} - the language appears in the list after a restart. A corrupted language file is skipped (it does not crash the app). Requirements Windows 10/11 (64-bit), Python 3.10+ (with the tcl/tk option) Administrator rights pydivert (traffic capture), psutil (a fallback, see below) Installing from source works on Python 3.10 and newer. CI tests and builds on 3.14 only - that is the version the released .exe is frozen with, so older ones are supported but not re-proven on every commit. psutil is installed with the tool but is not what makes process targeting work on Windows. There the socket table and the process names come straight from the OS, and targeting keeps working with psutil removed entirely (measured: 310 ports mapped, 37 of 37 names resolved). It is the fallback for everything else, which is how the engine's tests run on Linux with no driver at all. The window The window adapts to the screen and to system scaling (DPI). The initial size is computed from the resolution (fits on 1366x768 and grows on Full HD / 2K / 4K), and every dimension - column widths, table row heights, chart margins, text wrapping - scales with the font. The program declares itself Per-Monitor-V2 DPI aware, so moving the window to a second monitor with different scaling does not blur the interface. Window size and position, the selected tab, language, collapsed sections, the log/tabs split and table sort order are remembered in bean_network_tester_ui.json (next to the profiles). The saved geometry is validated before use - if the monitor is gone, the window returns to the centre of the current screen. Control - all impairment settings, grouped into collapsible sections (the collapsed state is remembered). On a wide window the sections lay out in two columns (instead of one narrow column and an empty right half), so there is far less scrolling. The whole tab scrolls - including with the mouse wheel. Statistics - three sub-tabs, so nothing is clipped on small screens: Live - counters (packets, lost, corrupted, torn down...) and a throughput chart. The counter grid picks its column count to fit the window width. An "Export CSV" button. Session - seed, duration, data used, peaks + "Mark bug", "Save repro report", "Copy CLI command" buttons. Events - the event log (START/STOP/CHANGE/SCENARIO/BUG/RESET). Connections - a view of which IP:port the tested system talks to. Every column is documented in Connections columns below, and each one also has a tooltip on its header. Traffic that has no ports at all - ping (ICMP) - is listed too, one row per address with the port cells left empty. "down"/"up"/"total" are what the application actually got, the same quantity the session panel calls "Downloaded (MB)". "down seen"/"up seen" are what the tool captured before impairing anything. With nothing set they are equal. The moment you add loss or a speed limit they part, and the gap between them is the damage on that connection. Hover any of them for the full sentence. (Before this split there was one pair, holding the captured bytes under headings that meant delivered: a row could read 5 MB received while its application got 0.4 MB.) Plus a search box (debounced, so it does not churn the table on every keystroke), click-to-sort headers, "Freeze" (rows stop escaping from under the cursor) and a right-click menu: copy row / IP, "Target this process", "Limit to this IP:port" - fills the filter fields with one click. The table is virtualised: it draws only the rows actually on screen, so scrolling is instant whether it holds 400 rows or a few hundred thousand. The old hard 400-row limit is gone - how many to show is set with the "Row limit" field (Tables section, 0 = no limit, default 50 000). At the bottom: START/STOP, Apply changes and Load/Save file, with the log beneath. This bar is anchored to the bottom edge - no tab can cover it. When changes take effect Nothing applies itself. A preset, profile, LAN mode and a loaded config file only fill the form. They reach a running session only through "Apply changes" - the button highlights when the form differs from what the engine is actually doing. The bar under the title tells you what you are looking at: Prefix Meaning Preview: the app is stopped - this describes what will happen after START Active: this is exactly what is applied to traffic right now Unapplied changes: the form was changed - click "Apply changes" While a session runs two elements are locked (they unlock on STOP): the traffic filter (applied only at START) and the language selector (changing language rebuilds the whole UI). The STOP button is red - it cannot be confused with START. A field another setting has taken over is greyed out together with its label, with a note saying which setting took it - "Download"/"Upload" do this when a Schedule is set, because the throughput then comes from the schedule steps. You can see at a glance what is actually in effect. Keyboard shortcuts Shortcut Action F5 START / STOP Ctrl+Enter Apply changes Ctrl+S / Ctrl+O Save / Load config file Ctrl+L Clear the log Field validation Numeric fields are checked live, together with their range (e.g. loss 0-100%, latency 0-600000 ms): a bad field turns red and the reason appears under the section. The same applies to filter expressions. The same range applies in the CLI - --loss 250 is now an error, not a silent clamp to 100%. All options explained Traffic to modify - which traffic to capture at all. Options: both directions (TCP+UDP+ICMP), outbound only, inbound only, TCP only, UDP only, ICMP only (ping), loopback only (127.0.0.1/::1 - for testing communication between local processes). Every filter covers IPv4 and IPv6. (If ping "does not react", it is almost always because the chosen filter does not include ICMP.) Note: port presets ("DNS/HTTP/HTTPS only") do not exist - to narrow by port use the Port field in "Target destination", which understands lists, ranges and exclusions (80,443,8000-8100, !53). Two places deciding about ports, with different semantics, would only confuse. Traffic filter is applied at start, so while running it is locked - to change it, stop (STOP), pick another and start again (START). LAN mode - a "LAN mode (local network only, no internet)" checkbox. It rejects traffic to/from public (internet) addresses and passes the local network: 10.0.0.0/8, 172.16-31.x, 192.168.x, loopback, link-local and CGNAT. It simulates "LAN works, internet is down" - a test of how the app behaves without internet access (e.g. no gateway/WAN, a captive portal). Target process - narrow the effect to chosen apps: process name (e.g. chrome.exe), PID, a comma-separated list, PID range, wildcard or regular expression - see Filter syntax. The rest of the machine's traffic stays untouched. Empty field = all traffic. Speed limit - maximum throughput separately for download (inbound) and upload (outbound), in KB/s. 0 = no limit. Ping is small packets, so a speed limit barely changes it - to test the limit use a file download. A positive value always limits something: an extremely smal [truncated for AI cost control]