Results
The port range cells
The measured numbers of this page are a study of kernel 7.0.0. The data comes from data file port-range-2026-11-17.json of 2026-11-17, at commit 9398ddb, on kernel 7.0.0. The oldest data of this page is 6 days old at this build, on 2026-11-23. The age limit of this data is 30 days, from 2026-12-07. The subject is the kernel of the runner, and GitHub updates it. The driver, the prober and the bands are code of this repository.
- Catalogs
- PR
- Date
- 2026-11-17
- Kernel
- Linux 7.0 · HZ 1000
- Cells
- 8
- Runs
- 32 runs
These are the results of the cells of the port range, from 2026-11-17. Each cell puts one client in a small ip_local_port_range against one target. The client connects again and again, and the cell records the local port of each connect. The page of the port range computes the same laws in your browser, and its orange dots link to these cells.
- The search (PR.1 to PR.4): a reset ends each connection, thus a closed connection holds no port. A search connects until a connect gets
EADDRNOTAVAIL. The cell counts the connects of each search and the ports that they got. - A held port (PR.5 to PR.8): one search takes each port, and then each connection closes. The cell measures the time until the first connect gets a port again.
The predictions come from portSearchSpan and portSearchShares of @mark1russell7/algebra, and from the timers of LINUX_TCP of @mark1russell7/machines. The low port of each range is 40000.
CI started the cells at main in the run 44177444372, in 4 shards on the hosted runners of GitHub. The kernel is Linux 7.0, with HZ 1000. Each cell has 4 runs in 2 fresh environments, with one warm-up run in each environment.
Each of the 8 cells holds against the prediction of the algebra. The cells have 32 counted runs, and no run is void.
What the cells found
Section titled “What the cells found”The search
Section titled “The search”- An even range gives each of its ports. A range of 16 ports gave 16 connects in each of the 200 searches of PR.1. The next connect got
EADDRNOTAVAILin 120 µs or less. - An odd range can lose its top port. A range of 3 ports gave 2 connects in each search of PR.2. The search rounds 3 down to 2, thus the top port stays out of reach.
- The share of each count comes from the search. A range of 5 ports gave 5 connects in 1,303 of the 1,600 searches of PR.3, and 4 connects in the others. The share of 5 in each run was 0.8 to 0.8275, inside the band of the algebra, 0.7291 to 0.9194.
- The count is for each destination. With two ports of one target, a range of 16 gave 16 connects to each port in each of the 400 searches of PR.4. The search refuses a 4-tuple, not a local port.
PR.1- Ports
- 16
- Destinations
- 1
- tcp_tw_reuse
- 2
- Each connection
- a reset after each round
- Connects of a search
- 16
The two passes of the search reach each port of an even range. A reset holds no port, thus each round has the same count. The first 8 connects get the ports of the parity of the low port.
Each of the 4 counted runs holds each term of the law. No run was void.
PR.2- Ports
- 3
- Destinations
- 1
- tcp_tw_reuse
- 2
- Each connection
- a reset after each round
- Connects of a search
- 2
The search rounds 3 down to 2. Each pass makes one try, at offset 0 and at offset 1.
Each of the 4 counted runs holds each term of the law. No run was void.
PR.3- Ports
- 5
- Destinations
- 1
- tcp_tw_reuse
- 2
- Each connection
- a reset after each round
- Connects of a search
- 4 or 5
The search rounds 5 down to 4, and each pass makes 2 tries. Thus a port can stay out of reach of each try of a connect, and a later connect from another start reaches it. The share comes from the exact chain of the search.
Each of the 4 counted runs holds each term of the law. No run was void.
PR.4- Ports
- 16
- Destinations
- 2
- tcp_tw_reuse
- 2
- Each connection
- a reset after each round
- Connects of a search
- 16
The search refuses a 4-tuple, not a port. A second destination port gets each port of the range again.
Each of the 4 counted runs holds each term of the law. No run was void.
A held port
Section titled “A held port”- TIME_WAIT holds a port for 60 s, plus the wheel. In PR.5 the client closes first. The first port came back 60.551 s to 61.121 s after the FIN of the target. The band is 59.999 s to 64.156 s. The default
tcp_tw_reuseof 2 is for loopback only, and this path is a veth. tcp_tw_reuse1 gives the port back after 1 s. In PR.6 the first port came back 1.001 s to 1.011 s after the FIN of the target. The band is 0.999 s to 1.061 s.- The side that closes first holds the port. In PR.7 the target closes first. Each of the 10 rounds of each run got the 4 ports at once, with no retransmission.
- A lost ACK of a FIN holds the port for one RTO. In PR.8 the first ACK of each FIN of the client drops. The client holds each port in
LAST_ACK, and its FIN goes again. The first port came back after 203.1 ms to 213.9 ms, inside the band of 199 ms to 268 ms. Each run had 4 retransmissions, one for each port.
PR.5- Ports
- 4
- Destinations
- 1
- tcp_tw_reuse
- 2
- Each connection
- the client closes first
- Connects of a search
- 4
- First free port
- 59.999 s to 64.156 s
The FIN of the peer moves the socket to TIME_WAIT and sets its timer again. The default tcp_tw_reuse of 2 is for loopback only, and this path is a veth.
Each of the 4 counted runs holds each term of the law. No run was void.
PR.6- Ports
- 4
- Destinations
- 1
- tcp_tw_reuse
- 1
- Each connection
- the client closes first
- Connects of a search
- 4
- First free port
- 999 ms to 1.061 s
With reuse, a connect takes a port in TIME_WAIT when tcp_tw_reuse_delay has passed from the FIN of the peer, and the search does not wait for the timer.
Each of the 4 counted runs holds each term of the law. No run was void.
PR.7- Ports
- 4
- Destinations
- 1
- tcp_tw_reuse
- 2
- Each connection
- the target closes first
- Connects of a search
- 4
- Retransmissions
- 0
TIME_WAIT is at the side that closes first, here the target. A new SYN with a newer timestamp passes that TIME_WAIT, thus no connect waits and no SYN is sent again.
Each of the 4 counted runs holds each term of the law. No run was void.
PR.8- Ports
- 4
- Destinations
- 1
- tcp_tw_reuse
- 2
- Each connection
- the target closes first
- Connects of a search
- 4
- First free port
- 199 ms to 268 ms
- Retransmissions
- 4
- Fault
- the first ACK of each FIN of the client drops
The side that closes second holds its port in LAST_ACK until the ACK of its FIN. The FIN goes again at the RTO at the latest, and the target in TIME_WAIT answers it. Thus each port makes one retransmission.
Each of the 4 counted runs holds each term of the law. No run was void.
The rate of PR.7
Section titled “The rate of PR.7”PR.7 held in this read, but it does not hold in each read. A read of 40 runs at main, the run 44163293814, failed in 7 of 40 runs with no fault in its plan. The rate is 0.175, and its Wilson interval of 95 % is 0.087 to 0.319.
Each failed run has one retransmission, and no run that held has one. That retransmission is a tail loss probe of a FIN with no data, from a client socket in LAST_ACK. In six runs it came during the rounds, thus the client held that port longer, and a later round got 3 ports, not 4. In one run it came 201 ms after the last round, thus each round got 4 ports. No counter of a drop moved at either end.
At this rate, a read of 4 runs holds PR.7 with a chance of 0.46. Thus a refresh can show PR.7 as a failure. That failure is a finding of the same cause, and no band gets wider to hide it.
Limits
Section titled “Limits”- Each cell has 4 runs. A rare failure, as the one of PR.7, needs a longer read.
- Each run puts the client and the target in two network namespaces, with a pair of veth devices between them. A NAT or a router on the path keeps its own table of connections, and these cells do not measure it.