When the internet at home gets flaky, the hard part is finding which link is at fault: the router, the provider, the Wi-Fi channel, DNS or the PC itself. Each one has its own tool (ping, tracert, netsh wlan, the router's app, a speed-test site) and you end up stitching the numbers together in your head.
I put all of it into one window. Airsweep is a Windows app with a single Check everything button. It walks computer → link → router → internet → DNS → websites and produces a list of findings, each with advice and, where possible, a Fix button. It also has speed tests with history, a device list, a Wi-Fi channel map, MTR-style tracing and an outage log.
It's free, open source (MIT), pure Python standard library, no pip packages. Here are the parts that turned out to be interesting.
ICMP without ping.exe
Parsing ping.exe output is a bad idea: it's localized (cp866 on Russian Windows) and spawning a process per probe is expensive. IcmpSendEcho from iphlpapi.dll does the job through ctypes, and unlike raw sockets it works without administrator rights.
ICMP_SLOTS = threading.BoundedSemaphore(24) # shared by pings and traces def ping_once(ip, timeout=1000, size=32): h = _ip.IcmpCreateFile() try: data = b'airsweep-' * (size // 9 + 1) buf = ctypes.create_string_buffer(64 + size + 16) with ICMP_SLOTS: t = time.perf_counter() n = _ip.IcmpSendEcho(h, _addr(ip), data[:size], size, None, buf, len(buf), timeout) dt = (time.perf_counter() - t) * 1000 if n and struct.unpack_from('<I', buf, 4)[0] == 0: # reply status is in the buffer return round(dt, 1) return None finally: _ip.IcmpCloseHandle(h) The semaphore is there for a reason. A trace sends probes with growing TTL to all hops at once, and when about 60 echoes are in flight at the same time, Windows starts completing some of them immediately (within tens of milliseconds, without waiting for the timeout) with IP_REQ_TIMED_OUT. The app then reports packet loss that doesn't exist. The fix is to cap in-flight requests at 24, shared between pings and traces, and to treat a "timeout" that came back before half of the wait as a send failure to retry, not as a loss. Another small trap: on "TTL expired", IcmpSendEcho may return 0 even though a valid reply is in the buffer, so read the status from there.
Where packets are really lost
An MTR table often shows 30-50% loss on some middle hop, and people blame that hop. Usually it's just a router that answers diagnostic ICMP slowly while forwarding real traffic fine. So the app only counts loss that continues to the destination, and looks for the hop where it starts:
def loss_start(hops): dest = next((h for h in hops if h['dest']), None) if not dest or not dest['sent'] or (dest['sent'] - dest['recv']) < 2 or dest['loss'] < 2: return None floor = max(1.0, dest['loss'] * 0.5) start = None for h in reversed([h for h in hops if h['recv']]): if h['loss'] >= floor: start = h else: break return start When an outage happens, a snapshot of the trace is saved, so the report says where the answer disappeared (router, home network, ISP or beyond). That is a much better thing to tell the support line than "it doesn't work".
DNS hijack check
An honest DNS server answers NXDOMAIN for a name that doesn't exist. A hijacking one returns the address of its own page. The check uses a random name and raw UDP queries, so no system resolver cache gets in the way:
def dns_hijack(system_dns): name = 'wc-' + ''.join(random.choice('abcdefghijklmnopqrstuvwxyz0123456789') for _ in range(14)) + '.com' out = {'name': name, 'system': None, 'public': None} for d in system_dns[:1]: r = dns_query(d, name, 3) if r['rcode'] is not None: out['system'] = {'server': d, 'fake': bool(r['ips']), 'ips': r['ips']} r = dns_query('1.1.1.1', name, 3) if r['rcode'] is not None: out['public'] = {'server': '1.1.1.1', 'fake': bool(r['ips']), 'ips': r['ips']} return out If even 1.1.1.1 returns an address for a made-up name, DNS traffic is being intercepted on the way.
Wi-Fi through the WLAN API
Nearby networks come from wlanapi.dll via ctypes: signal in dBm, standard, width, security, WPS and client count from the beacon. WLAN_BSS_ENTRY has to be exactly 360 bytes and I assert that at import, because garbage on screen is worse than a crash. For channel advice, 5 GHz is evaluated in blocks that match your network's width, and channels outside DFS (the DFS range is 52-144) win unless they're much worse.
The antivirus incident
My first entry point was app.py. During testing the server died and the file vanished, and I couldn't recreate it: Bitdefender was holding the path. Most likely a heuristic fired on "HTTP server + hidden PowerShell + elevation prompt + Wi-Fi password dump", which looks like malware from outside. So I renamed the file and removed everything that looked suspicious without losing features:
- Passwords are no longer dumped with
netsh wlan export key=clear. Profiles are read through the WLAN API, the list has no passwords, and one password is read only when you click Show, Copy or QR. - No
-EncodedCommand, no-ExecutionPolicy Bypass. PowerShell is only used for reading. - Repair actions go through a normal UAC prompt:
ShellExecutewithrunasforcmd.exewith fixedipconfigandnetshcommands, window minimized instead of hidden.
The takeaway: if your tool does things that malware also does, do them the textbook way, with the smallest request, not in one big call.
What it costs
Measured on my PC (Windows 10, wired), python.exe only, the Edge window is separate:
- start to a ready server: about 0.4 s
- idle memory: 36 MB, 8 threads
- peak during a full check: 44 MB, up to 29 threads, about 1.5 s of CPU time for the whole check (the check takes about 30 s, with a 15-round trace running alongside)
- no CPU use while idle
- release zip 11.4 MB with bundled Python, update zip 0.2 MB, about 4.9k lines of Python
What isn't verified
My PC is on a cable, so the "connected over Wi-Fi" branch was checked against sample netsh output, not a live adapter. The UAC prompt and password decryption with admin rights were not run automatically either. If something looks off on your machine, please tell me.
Download
Windows 10/11 (64-bit), Microsoft Edge required. Unpack and run Airsweep.bat. The app also updates itself: it checks the latest GitHub release at start and offers a one-click update.
Download: https://github.com/OlegChe77/airsweep/releases/latest/download/airsweep.zip
Source (MIT): https://github.com/OlegChe77/airsweep
What checks would you add?




