v139 · network / connectivity

Randomizing TCP Port Allocation on Windows

This launch enables TCP port randomization on versions of Windows (2020 H1 or later) where we do not expect to see issues with re-use of prior ports occurring too fast (causing rejection due to timeouts on port re-use). The rapid port re-use issue arises from the Birthday problem, where the probability of randomly re-picking a port alread

concepts

  1. Implementation Note

    Windows builds of Chromium now randomise outbound TCP source ports, matching macOS/Linux. Pure security-hardening; no API change.

  2. Birthday Collision Calculator

    Why the rollout was gated by Windows version: the Birthday Problem applied to port allocation. Tweak port range, connection rate, and TIME_WAIT hold, and see where randomisation is safe vs reckless.

  3. Collision Simulator

    A live 60-second simulation of three allocation strategies — sequential, random, and RFC 6056 — drawing collisions/sec on a canvas. Pick the connection rate, TIME_WAIT hold, and port range and watch the shape change.

  4. Port Entropy Visualizer

    Side-by-side sequential vs randomized port allocation simulations. Each step reveals the next port — the sequential list is trivially predictable; the random list isn't. Shows entropy in bits per allocation and a birthday-paradox collision probability curve as ports accumulate.

why it shipped

When port randomization is disabled (the default), sites are able to count the amount of connections opened by other tabs if they check the TCP port used for new connections before and after opening another window. This knowledge can be used to glean information about other sites like whether they are logged in or not.

references