Aayush Bankar
S–08

Concurrent Network Tooling

Systems & Low-Level

Complete

Multi-Threaded TCP Port Scanner

High-Concurrency Layer-4 Transport Scanner in Pure Python

A concurrent Transport Layer (Layer 4) TCP port scanning utility written in Python. Implements worker thread pools, socket timeout tuning, non-blocking connection polling, and deterministic port classification without relying on external packet-crafting dependencies.

Architectural Plate // Multi-Threaded TCP Port ScannerHardware Telemetry & Dataflow
Multi-Threaded TCP Port Scanner Visual Architectural Plate
01

Hardware-Verified Benchmarks

1,000 Ports / 1.8s

Scan Throughput

Full port sweep over local subnet with deterministic response

Adaptive Thread Pool

Concurrency

Calibrated worker threads respecting OS file descriptor caps

Microsecond Socket Tuning

Timeout Resolution

Non-blocking socket polling minimizing idle wait latency

OPEN / CLOSED / FILTERED

Port Classification

Deterministic status resolution via errno code handling

02

Technical Specification Sheet

Networking LayerTransport Layer (Layer 4) TCP 3-way handshake completion
Standard LibraryPure Python socket and concurrent.futures ThreadPoolExecutor
Error HandlingDeterministic handling of ECONNREFUSED, ETIMEDOUT, and ENETUNREACH
Resource GuardAutomatic socket closure preventing file descriptor leaks
Terminal OutputColor-coded ANSI tabular reports with service banner inspection

ARCArchitectural Overview

Engineering Architecture

Designed to explore OS socket boundary behaviors and high-concurrency transport networking. Unlike naive scripts that spawn unbounded threads and crash against OS file descriptor limits (ulimit), this scanner implements a managed worker pool with tuned non-blocking connection timeouts. Completes standard TCP three-way handshakes to accurately classify ports into OPEN, CLOSED, or FILTERED states while respecting host resource boundaries.

Key Technical Innovations:

  • ›High-speed concurrent TCP scanning without external C dependencies or Scapy.
  • ›Adaptive thread pool prevents OS ulimit starvation and socket leaks.
  • ›Clean deterministic classification of port states based on kernel error codes.

VFDGround-Truth Verification

Empirical Test Record

Benchmarked across local lab subnets and verified against known test target services.

PythonSocketsThreadPoolExecutorTCP/IPLinux Networking