Tech Behind ThingsHow the ordinary machinery actually works

Networks

What A Router Forgets When A Connection Sits Idle

Your router keeps a table of active conversations and quietly discards entries that go quiet, which is why long-lived connections die without any error being sent.

Focused detail of a modern server rack with blue LED indicators in a data center.
Photograph by panumas nikhomkhai via Pexels
Editorial note. Independent reporting and analysis. Nothing here is sponsored or paid for. How we work.

A connection that has been open and silent for a while often turns out to be dead the moment you use it again. The cause is usually a table in your router that quietly forgot the connection existed.

One address serves a whole house

Your network has a single public address and many devices behind it. The router rewrites outgoing packets so they all appear to come from that address, using a different port number for each conversation.

To send replies back to the right device, it records every mapping in a translation table. That table is what makes the arrangement work at all.

The table lives in memory, it is finite, and nothing on the internet reliably tells the router when a conversation has genuinely ended.

Entries are removed by timer, not by notice

Connections that close politely announce themselves and their entries are released promptly. Connections that are simply idle look identical to connections that were abandoned.

The router therefore attaches a timer to each entry and deletes it after a period of silence. Established sessions typically get minutes to a couple of hours, while entries for connectionless traffic often get well under a minute.

Nothing is sent to either end when this happens. Both computers still believe the connection is open, because from their point of view nothing occurred.

The failure appears only on the next packet

When one side finally sends data, the router sees a packet belonging to no known conversation and drops it, or answers with a reset that terminates the session.

Applications experience this as a hang followed by an error, which is why remote sessions, database clients and messaging apps fail in a burst after a lunch break rather than during use.

The pattern is diagnostic. A connection that works, sits idle, and then fails is a timeout somewhere in the path rather than a bandwidth or reliability problem.

Keepalives exist to stop the timer

The standard remedy is to send a tiny packet periodically so the entry never goes quiet long enough to expire. Operating systems can do this, and many applications do it themselves.

The interval has to be shorter than the shortest timeout anywhere along the path, and there may be several translation devices between you and a server, each with its own settings.

Default system keepalive intervals were chosen long ago and are often far longer than any home router's timeout, which is why applications tend to implement their own.

Carrier networks make the timers shorter

Mobile and some broadband providers translate addresses again on their own equipment, serving many customers from one pool, and memory pressure there pushes timeouts down.

An application tuned for a home router can still drop on a cellular connection, because a second table with a stricter timer sits in the path and answers to nobody in your house.

Protocols designed recently tend to send their own periodic traffic for this reason, treating aggressive timeouts as a permanent property of the internet rather than a misconfiguration.

Questions readers ask

Is a mesh system better than a single powerful router?

Only where coverage is the limitation. One well-placed unit serving a small flat will beat three nodes relaying through each other.

Do more nodes always improve things?

No. Each wireless hop costs airtime, and nodes that hear each other well compete for the same channel. Two good positions beat four poor ones.

Networkswirelesshome networkcoveragenetworking
Grigor Petrov
Hardware writer, Tech Behind Things

Grigor writes about silicon, thermals and the physical limits designers keep bumping into.

Also by Grigor Petrov