rheaCRT

Manual

Timeouts and lost connections

A session never waits without a limit, and it always ends with a sentence that says what happened. This page lists every wait, how long it lasts, what the session says when it gives up, and what you can change. It also says what each host sees when rheaCRT itself stops, on purpose or not.

It covers SSH sessions and serial consoles. Local shells end when the shell exits, and report its exit code.

Before you are signed in (SSH)

Waiting forLimitSettingWhat you see when it passes
The host to accept the connection15 secondsConnect timeoutno answer from HOST:PORT within 15 seconds
The host to answer as an SSH server and finish the handshake15 secondsConnect timeoutHOST:PORT accepted the connection but did not answer as an SSH server within 15 seconds
The host to answer one step of signing in2 minutesSign-in timeoutthe host did not answer the sign-in within 120 seconds
The host to open the terminal after sign-in2 minutesSign-in timeoutthe host did not answer the request for a terminal within 120 seconds

Two endings here are not timeouts:

The second row of the table is the one to know. A host can accept a connection and then say nothing: a service that has hung, the wrong port, or a load balancer with nothing behind it. rheaCRT tells that apart from a host that never answered, because the fix is different.

Your time is never counted. While a question is on screen (trust this host key, a password, a passphrase, allow legacy algorithms) the clock is stopped. Take as long as you need to check a fingerprint. The host gets a fresh limit once you answer.

A connection lost at a sign-in prompt ends the session there. If the host or the network drops the connection while a user name, password, passphrase or one-time code prompt is up, the session says so straight away. You are not left typing a password into a session that has already gone.

The host-key question is the exception. While it is on screen a lost connection is not seen; it shows the moment you answer. An answer of "yes and save" is still saved, so connecting again goes straight through.

While you are connected (SSH)

What happensHow fast it is noticedWhat you see
The host ends the shell (exit, logout)At onceconnection closed (exit 0)
The host disconnects and gives a reason (an idle limit, a shutdown)At oncethe host closed the connection: REASON
The connection is closed with no reason givenAt oncethe connection was lost: the host or the network closed it
The connection is reset (a firewall, a restarting host)At oncethe connection was lost: it was reset by the host or the network
The link goes dead with no word at all (a cable pulled further along, a VPN that dropped)2½ minutesthe connection was lost: the host did not answer 4 keep-alive messages over 150 seconds

"At once" means within one 16 millisecond step of the test's clock on Windows, and 1 to 8 milliseconds on Linux, where the clock is finer.

Windows reports a connection as "aborted" when the host closes it while rheaCRT is sending. That says no more than "closed", so rheaCRT words it the same way.

Keep-alive messages

A dead link sends nothing, not even an error, so the only way to find it is to ask. After 30 seconds without a byte from the host, rheaCRT sends a keep-alive message. If four in a row go unanswered, the session ends. That is 150 seconds from the last byte: 30 seconds of silence before the first message, then four more intervals.

Any byte from the host resets the count, so a link that drops out and comes back within that time carries on, and nothing is lost: output that was on its way arrives in order. Time in which rheaCRT itself is not reading (see "When a window stops drawing") is not counted either: the host cannot answer what was not listened for. This is deliberate. A session that survives a Wi-Fi handover or a VPN renegotiation is worth more than one that reports a dead link a minute sooner.

Keep-alive messages also stop firewalls and address translators from forgetting an idle session.

They start once you are signed in. Before that, the limits in the first table do the watching.

Closing a session

Closing a tab ends its session whatever the session is doing: connecting, waiting for a silent host, waiting for a sign-in answer, or sending a large paste into a link that has died. The end is reported at once.

If the host can still hear, rheaCRT then sends the SSH goodbye (the disconnect message), closes its own side of the connection, and waits for the host to close the other. The wait is what lets a host that is in the middle of sending read the goodbye: a connection closed on top of unread output is reset by the system, and the reset can reach the host first. rheaCRT waits at most half a second, then lets go whatever the host has done.

When rheaCRT itself stops

A session left half-open on a device holds one of that device's few lines until the device's own timer frees it. So every connection is ended when rheaCRT stops, and each host is told where that is possible.

What happensWhat each host seesMeasured on Windows, 11 sessions
You quit rheaCRT with sessions openThe SSH goodbye, then the connection closed in orderAll 11 within 3 ms. rheaCRT waits at most 1 second.
A fault inside one sessionThe SSH goodbye for that session. Its tab says the session was stopped by a fault inside rheaCRT, and its connection was closed. The other sessions carry on.Ended in 77 ms; the session beside it answered 15 ms later
A fault that stops the whole programThe SSH goodbye on every session, as for a quitSee Limits
rheaCRT is killed, or the system ends itThe connection reset, with no goodbye: none of rheaCRT's code runs, and Windows closes the connectionsAll 11 within 5 ms
The computer loses power or drops off the networkNothing. Each host finds out by its own timers.

A host that gets the goodbye knows the session was ended on purpose, and logs it so. A host that only sees the connection go cannot tell a crash from a pulled cable. In both cases the session on the host is over at once.

With 11 hosts sending as fast as they could at the moment rheaCRT stopped, all 11 read the goodbye.

Ending a session does not undo what was typed into it. On many network devices, debugging that a session switched on stays on after that session has gone. Connect again and switch it off.

Faults are recorded in rheacrt.log, in rheaCRT's data folder (%LOCALAPPDATA%\rheaCRT).

Typing while output floods

Input does not wait behind output. A line typed into a session that is receiving a flood goes to the host ahead of the output that is still to be drawn.

Measured in the engine on Windows, with nothing drawn on screen: 11 sessions open, every host sending lines as fast as rheaCRT would take them (about 20,000 lines a second each, 224,000 in all), and the same line sent to all 11 at once.

The line is read by its hostTypicalSlowest
Every window taking output as fast as it comes1.8 ms6.7 ms
Every window slow (half a megabyte a second each)0.5 ms1.7 ms
Every window stopped0.6 ms0.8 ms

5.9 million lines were delivered in that run, none lost and none out of order.

The screen is behind the host by what was already on its way. Output is shown in order, so the answer to a line appears after the output the host sent before it. An SSH host may send 2 MiB ahead of what has been taken. At this flood that was about a second: the answer appeared after 1.1 seconds, typically, and after a line that stops the output every session was quiet 1.1 seconds later. Equipment that sends less than rheaCRT can take has no such lag.

When a window stops drawing

A window can stop taking output: it is hidden and the system has slowed it, or a dialog is holding it up. The session then keeps a little of the host's output ready (256 KiB) and stops reading the connection, so the host is held back as it would be by any slow reader, and nothing is lost. Three things still hold:

Large pastes

A host echoes what it reads, and it reads only as fast as its echo is taken. rheaCRT keeps reading while it sends, so a paste of any size goes through, including into equipment that accepts only a few kilobytes at a time. While a paste is being sent, input typed after it waits its turn, so order is kept.

Two things make this hold. The session takes the host's output while a send is waiting for the host to accept more. And a write never waits for the network: what the socket cannot take at once is held, up to 4 MiB, and goes out as the socket takes it. The second matters most on Windows, whose sockets hold far less than Linux's. Measured on Windows: 8 MiB pasted and echoed in 0.31 seconds.

Serial consoles

What happensHow fast it is noticedWhat you see
The cable or its adapter is unpluggedWithin about 50 millisecondsCOM3 stopped: REASON (cable unplugged?)
The port stops taking dataOn the next sendthe port stopped accepting data
You close the tabWithin about 50 millisecondsdisconnected

A serial line has no keep-alive: a device that is powered off, or a cable unplugged at the far end, looks exactly like a device with nothing to say. Only the near end can be seen.

Settings

All three are per session, and inherited like every other setting: all sessions, then the folder, then the session.

SettingIn the session fileDefaultRangeWhy this default
Connect timeout[connection] connect_timeout_secs150 to 600A host that is going to answer does so well within 15 seconds, and it is short enough to wait out. It applies to reaching the host, and again to the handshake.
Sign-in timeout[connection] sign_in_timeout_secs1200 to 3600The answer can depend on a person: an approval on a phone, a touch on a security key. An OpenSSH server allows the same two minutes. It applies to each step, not to the whole sign-in.
Keep-alive interval[security] keepalive_secs300 to 3600Short enough to keep firewalls from dropping an idle session, long enough to cost nothing.

0 switches a limit off. With the connect timeout at 0 the session waits as long as the operating system does. With the keep-alive interval at 0 a dead link is not noticed until you type and the system gives up on delivering it, which can take many minutes.

The number of unanswered keep-alive messages (4) is fixed.

These settings are in the session files today. They get a place in session Properties with the rest of the SSH settings.

Checked against real servers

Everything above is measured against a server built into the tests. The same engine was then run against OpenSSH 9.6 on two other machines, across the internet, with faults put on the line by a relay on the testing computer and, for two of them, made on the host itself. The keep-alive interval was 2 seconds, so a dead link is given up after 10.

What was doneWhat the session did
The line dead for 3 to 4 seconds: both ways, toward the session only, toward the host onlyCarried on. A stream and a paste under way arrived whole and in order.
The line slowed to 32 KiB a second, or dropping several times a secondThe same
The line dead for good, either way or bothEnded 10.0 to 10.5 seconds later, with the keep-alive sentence
The host's server process stopped, so that it stays connected and answers nothingEnded 10.0 seconds after its last byte, with the keep-alive sentence
The line resetEnded in under 1 ms, saying it was reset
The line closedEnded within 30 ms, saying it was closed
The host's server process killedEnded 14 to 60 ms later: one trip across the network
The connection cut before the shell, at 31 points from the first byte to the lastEnded every time, at its limit, with the sentence for the stage it had reached
The whole line down under six sessions at onceAll six ended saying so. Six new sessions asked for in the same moment were all ready within 1.5 seconds.

Two silences with no byte between them count as one: a line that drops, comes back for an instant without anything getting through, and drops again is given up 10 seconds after the last byte heard, not 10 seconds after the second drop.

With nothing in the way: a typed command was answered in 14 ms; 2 million numbered lines arrived in order; a 4 MiB paste of every byte value matched the host's own checksum; and Ctrl+C into a flood was answered 14 ms after the key. After a session was ended by a fault, a new one to the same host was ready in about 0.4 seconds. Sessions beside the one with the fault were not disturbed.

Then faults at random, for 30 minutes, on both machines at once, four sessions on each. 1,220 sessions were started and 1,332 connections were ended by a fault, each with the right sentence in the right time: a silence ended its session between 10.0 and 10.9 seconds later, every time. 350 million numbered lines were checked in order, 691 MiB of pastes matched the hosts' checksums, and 12,558 commands were answered, in 16 ms typically, while faults were being made on the sessions beside them. At the end neither the testing computer nor either host was left holding anything.

Nothing was changed on either host, and the hosts' own defences recorded nothing against the testing computer: only correct sign-ins were ever attempted.

Limits

Where it lives in the code