"""Small diagnostic of an already-authorized SSH path, not a PulseLAN benchmark.""" import subprocess,time,json,statistics,platform,shlex,hashlib from pathlib import Path import sys if len(sys.argv)!=2: raise SystemExit('Usage: python measure-ssh-path.py YOUR_AUTHORIZED_SSH_HOST') size=8*1024*1024 server="import sys; p=bytes(range(256))*4096; print('READY',flush=True);\nfor i in range(4):\n if sys.stdin.buffer.readline()!=b'GO\\n': break\n for j in range(8): sys.stdout.buffer.write(p)\n sys.stdout.buffer.flush()" proc=subprocess.Popen(['ssh','-o','BatchMode=yes','-o','Compression=no',sys.argv[1],'python3 -u -c '+shlex.quote(server)],stdin=subprocess.PIPE,stdout=subprocess.PIPE,stderr=subprocess.PIPE) assert proc.stdout.readline().strip()==b'READY' samples=[];expected=hashlib.sha256((bytes(range(256))*4096)*8).hexdigest() for i in range(4): start=time.perf_counter();proc.stdin.write(b'GO\n');proc.stdin.flush();left=size;digest=hashlib.sha256() while left: chunk=proc.stdout.read(min(left,256*1024));assert chunk,'Unexpected stream end';left-=len(chunk);digest.update(chunk) elapsed=time.perf_counter()-start assert digest.hexdigest()==expected samples.append({'window':i,'bytes':size,'seconds':round(elapsed,6),'mbps':round(size*8/elapsed/1e6,3),'warmup':i==0}) proc.stdin.close();assert proc.wait(timeout=15)==0 result={'date':__import__('datetime').date.today().isoformat(),'method':'One established SSH connection, compression disabled; server-to-client 8 MiB windows, client acknowledges each start; first window excluded as warmup. Client timing includes request, SSH encryption, buffering, Python reading and SHA-256 verification.','client_os':platform.system(),'direction':'Authorized SSH server to local client','path':'Existing private network SSH path; intermediate interfaces were not independently inventoried.','samples':samples,'median_mbps':round(statistics.median(x['mbps'] for x in samples[1:]),3),'limitations':['Not PulseLAN application results','Not an internet speed test','Not a direct Ethernet or Wi-Fi capacity measurement','Three short windows do not establish sustained performance','No hardware comparison or buying recommendation']} (Path(__file__).parent/'ssh-measurements.json').write_text(json.dumps(result,indent=2),encoding='utf-8') print(json.dumps(result,indent=2))