Skip to content
GDPR compliant. Hosted in DE.
14-day free trial →
TCP port checksMail, SSH, databaseChecks from three locations
Monitoring 13 min read 25 Aug 2026

TCP Port Monitoring: Watching Services Beyond HTTP

Mail servers, SSH and databases have no page to load. Here is how to check TCP ports for reachability, handshake time and a genuinely responding protocol.

X

XICTRAQ Team

XICTRAQ

MonitoringTCPInfrastructureAvailability
127 s
until a default connection attempt is finally abandoned (Linux kernel documentation)
1 s
default wait before the first retransmission of a connection attempt (IETF RFC 6298)
31 %
of analysed breaches started with the exploitation of a vulnerability (Verizon DBIR 2026)
Port monitoring: three depths of proofAn open port, an accepted connection and a responding protocol are three different statementsServices without a web layerPort and purpose25SMTP between servers587Mail submission993IMAP over TLS22SSH and SFTP3306Database, internal6379Cache service, internalInternal services do not belongon the open internet (BSI IT-Grundschutz)How deep the check reachesEvidence1The port is openproves: the network path is clear and a process holds the portdoes not prove: that the service actually answers2The connection is acceptedproves: handshake complete, connect time measurabledoes not prove: that the protocol is working3The protocol respondsproves: greeting line or version string read backSMTP 220, FTP 220, SSH version (IETF RFC 5321, 959, 4253)127 suntil a default connection attempt isfinally abandoned (Linux kernel documentation)Mail, SSH, database and cache checked next to the website in one accountProbed from three EU locations; an outage counts only after two nodes confirm itPort 587 has been the defined path for mail submission since 2011 (IETF RFC 6409)
The website returns status 200, the dashboard is green - and yet every order confirmation has been sitting in the queue for two hours because the mail server on port 587 no longer accepts connections. Outages like this stay unnoticed for a long time because conventional monitoring stops at the web layer: it fetches an address, reads a status code and is satisfied. Services without a web page - mail submission and retrieval, SSH remote access, databases, file handovers, cache and search services - simply do not appear in that view. Port monitoring closes exactly this gap: at fixed intervals it opens a TCP connection to the service in question, measures how long the connection setup takes and checks whether anyone answers at all. How meaningful that answer is depends on the depth of the check, because an open port, an accepted connection and a working protocol are three different things. Connection setup follows a fixed sequence of three packets (IETF RFC 9293), and the port numbers of the well-known services sit below 1024 (IETF RFC 6335). This guide shows which services live behind which ports, how deep a check should reach, when a port deliberately must not be public, and how to read connection timeouts without alert noise - embedded in uptime and port monitoring that keeps website and infrastructure in one account.

Why monitoring stops at the web layer

The common monitoring repertoire grew up around HTTP. A check calls an address, evaluates the status code, measures response time and fires when one of those falls outside the expected range. Every more advanced method builds on that: assertions in API monitoring for REST endpoints, recorded browser flows, checks of form journeys and login paths. These methods share one prerequisite that is rarely stated out loud: the service being checked has to speak HTTP. For a substantial part of a company's infrastructure, that is not the case.

A mail server accepts messages from other mail servers on port 25 (IETF RFC 5321) and messages from its own users on port 587, which has been the defined path for submission since 2011 (IETF RFC 6409). Retrieval runs over port 993 and submission with immediate encryption over port 465, both with a TLS connection established from the outset (IETF RFC 8314). An SSH service listens on port 22 and first exchanges a version string in the clear (IETF RFC 4253). Databases wait on port 3306 or 5432 (IANA), cache services usually on 6379. None of these services delivers a page that an HTTP call could fetch. Anyone who wants to monitor them has to work one layer lower - at the TCP connection itself.

The practical effect of this gap is uncomfortable: the visible part of the business, the website, is checked closely, while the invisible part - the one doing the actual work - runs unobserved. An outage there typically announces itself only when a customer calls or someone on the team notices that no enquiry has arrived since the morning. By then hours have usually passed in which no one received an alert, because no monitor existed for that service.

A reachable website does not mean a reachable business

A company website can keep responding normally for days while mail submission is stuck in the background, the database service failed to come back up after a restart and the nightly file handover to the accountant has been failing for a week. The website is static enough not to notice any of it. How silently such paths can fail is shown in the article on monitoring contact form delivery: the form keeps saying thank you, yet the message arrives nowhere.

Which services live behind which ports

Port numbers are not arbitrary, they are administered. IANA maintains a registry of service names and port numbers that is split into three ranges: system ports from 0 to 1023, user ports from 1024 to 49151 and dynamic ports from 49152 upwards (IETF RFC 6335). The classic infrastructure services sit almost entirely in the first range, which makes monitoring easier - the target ports are known and rarely change. The overview below maps the most important ports to what their failure actually means day to day.

PortServiceWhat an outage means day to day
22SSH remote access and SFTP (IANA)remote maintenance and file handovers come to a halt
25SMTP between mail servers (IETF RFC 5321)inbound mail is delayed or rejected
465Mail submission with immediate TLS (IETF RFC 8314)senders inside your own company cannot get through
587Mail submission by your own users (IETF RFC 6409)order confirmations and system messages pile up
993IMAP retrieval over TLS (IETF RFC 8314)mailboxes can no longer be fetched
21FTP control connection (IETF RFC 959)handovers to partners and providers break off
3306 / 5432Database services (IANA)applications run into the void although the page loads
6379Cache service, common default portresponse times rise, queues fill up

Two observations from this list matter in practice. First, far more than customer correspondence depends on the mail ports: password resets, invoice dispatch, contract confirmations and automated system messages all travel the same route. How to additionally secure and monitor the encryption of that route is described in the article on MTA-STS and TLS-RPT. Second, from a security standpoint the last two rows do not belong on the open internet at all - a point the article on the external attack surface of exposed services and the section further down both return to.

Open port, accepted connection, responding protocol

A TCP connection comes into being in three steps: the probe node sends a SYN packet, the service answers with SYN-ACK, the probe node confirms with ACK (IETF RFC 9293). Only then does the connection stand. What this sequence proves is routinely overrated in practice - it shows that a process on the target system holds the port and that the intermediate systems let the packet through. It does not show that this process is doing its actual job.

The difference matters as soon as something breaks. A security appliance can accept the connection on behalf of the service and discard it afterwards; an overloaded service can place connections in the accept queue without ever processing them; a mail server can complete the handshake and then reject every submission with a temporary error. In all three cases a plain port check reports success while the service is effectively down. It is therefore worth thinking of the check in levels and deciding per service which depth is appropriate.

Level 1: The port is open

A SYN packet reaches the target system and is not discarded. That proves the network path is clear and a process holds the port. It does not prove that the service answers, because an intermediate system can accept the connection on its behalf. On its own this level is useful for checking the network path, not for judging a service.

Level 2: The connection is accepted

The handshake is complete, the connection stands, and the time it took can be measured. This is the core of port monitoring: a service that accepts connections and does so in a consistent amount of time is usually working normally. If that time creeps up over days or weeks, it points to overload or to a problem on the network path.

Level 3: The protocol responds

Many services announce themselves as soon as the connection stands: an SMTP server sends a greeting line with code 220 (IETF RFC 5321), an FTP service acknowledges the control connection in the same way (IETF RFC 959), an SSH service sends a version string (IETF RFC 4253). Reading that first answer means checking the service behind the port, not just the port.

What level 3 still does not prove

A correct greeting says nothing about authentication, permissions, disk space or queue length. Those questions need signals from the system itself, such as regular signs of life from a background process. A port check is an outside view: it reliably detects the absence of a service, but not every form of its malfunction.

What the time to connection setup reveals

Beyond the yes-or-no verdict, every port check yields a number: the time from the first packet to a standing connection. It is made up of name resolution, the travel time across the network path and the reaction time of the service. Add encryption and the process grows by the TLS handshake; with TLS 1.3 a single round trip is enough, whereas TLS 1.2 needed two (IETF RFC 8446). Anyone monitoring port 465 or 993 measures that share inevitably, because encryption there is set up right at connection time (IETF RFC 8314).

This number is the most useful early warning signal a port check produces. A service rarely fails from one minute to the next; more often it first becomes slow because connections pile up, memory runs short or a network path has been rerouted. What matters is not the mean but the distribution: a p95 value shifting from 40 to 900 milliseconds is a finding, even when the average barely moves. Why percentiles beat the average is explained in the article on p95 and p99 instead of the average.

A second benefit comes from comparing probe locations. If the connection time to the mail server stays stable at one location and rises many times over at another, the problem most likely does not sit in the service but on the way to it. That is exactly what checking from several locations is for: it separates the failure of a service from the failure of a route and keeps a disrupted network segment from being reported as a server outage.

Handshake time is the early warning value of port monitoring

A service that still answers but noticeably slower than last week is a warning sign. Anyone who stores only the state reachable or not reachable throws that information away. Anyone who keeps connection time per location as a time series often sees the degradation days before the actual outage - and can act while the work still fits into a planned maintenance window.

When a port deliberately must not be public

Not every port that can be reached from outside should be. Database and cache services, admin interfaces, search indexes and message queues belong in an internal network or behind a secured gateway; the IT-Grundschutz modules consistently recommend exposing only the services that are genuinely needed (BSI IT-Grundschutz). The reason is not theoretical: in the Verizon Data Breach Investigations Report 2026, exploitation of vulnerabilities is the most common initial access path at 31 percent (Verizon DBIR 2026), an increase of 55 percent year over year (Verizon DBIR 2026); more than 22,000 confirmed data breaches across 145 countries were analysed (Verizon DBIR 2026). Every unnecessarily open service port enlarges that surface.

For monitoring this inverts the question. For a public service it reads: does it answer? For an internal service it reads: does it answer inwards - and stay silent outwards? Both checks make sense, but they measure opposite things. A port check from outside against port 3306 should fail; if it succeeds, that is a finding for the security side and not evidence of availability. This difference belongs in writing, otherwise the green indicator of such a monitor will be misread later on.

Availability of internal services can still be measured, just not from outside. The usual route runs via regular signs of life: a process on the system reports at a fixed cadence that it is running, and the absence of that report triggers the alert. That approach is described in the article on heartbeat monitoring for background processes. Anyone creating many service monitors should settle in parallel who may view and change them - which is where the article on access rights and an audit trail in the monitoring team comes in.

A database port reachable from outside is a finding, not a success

When a check from the internet against 3306, 5432 or 6379 reports a standing connection, the right reaction is not relief but a look at the firewall rules. Keep such checks separate from availability monitoring: the desired state here is the refused connection, and a hit belongs on the security list, not on the public status page.

Check interval and the noise of connection timeouts

Port checks have a characteristic failure signature. Where an HTTP check usually returns a status code that hints at the cause, a failed TCP connection as a rule ends in a timeout with no further information. The reason lies in the protocol itself: if a SYN packet is lost, the system stack retries after a default wait of one second, doubling with every further attempt (IETF RFC 6298). In a widespread default configuration the attempt is retried six times, so connection setup is only finally abandoned after roughly 127 seconds (Linux kernel documentation).

For monitoring this means the check's own time limit is the decisive control, not the operating system's. A probe node that gives up after five seconds already reports an outage while the system stack is still patiently retrying. A limit set too short produces false alarms on every brief packet loss, one set too long delays the detection of genuine outages. It has proven useful to derive the limit from the observed connection time - roughly ten times the p95 value - rather than from a round number picked by gut feeling.

AspectHTTP checkTCP port check
What comes back on failurestatus code, headers, often an error pageusually just a timeout with no explanation
Most common cause of a false alarma brief 5xx spike during a restarta discarded SYN packet on the network path
Weight of a single failed attemptmedium, the status code narrows the causelow, as long as no second location confirms it
Sensible safeguardassertions on content and durationconfirmation by several probe locations
Wait before the first retransmissiondepends on the library in useone second, doubling thereafter (IETF RFC 6298)
Default point where the system stack gives updepends on the client in useafter roughly 127 seconds (Linux kernel documentation)

From this failure signature follows the second control: a single failed attempt is a weaker signal for port checks than for HTTP checks. Turning it straight into an alert produces up-down noise that wears the on-call rota down and buries real outages. A consensus across locations is more reliable: an outage counts as confirmed only once two of three probe nodes see it. How to damp this noise systematically is described in the article on taming flapping alerts; which detection time requires which interval is worked through in the article on choosing the check interval.

One last point concerns the other side. Repeated connection attempts from the same addresses look like a scanning attempt to some protection mechanisms, and an automatic block then hits your own monitoring of all things. The result is an outage that does not exist. The addresses of the probe nodes therefore belong on the exception list of protective systems - a task covered in detail in the article on the firewall whitelist for monitoring.

Setting up service monitors: a six-step approach

Theory turns into operational safety only once the checks move into fixed routines. A pragmatic approach that fits into a single afternoon:

  1. Take stock of the services: note every service that can fail without the website noticing - mail submission and retrieval, SSH, databases, file handovers, cache and search services. Record for each one which port is responsible and whether it should be publicly reachable or not.
  2. Decide the depth per service: for internal services a plain connection check is often enough, while for mail and handover services the level that reads the first protocol response is worth the effort. Write the decision down so it stays traceable later what a green tick at that spot actually says.
  3. Derive time limit and interval from measurements: let the check run for a week before you set thresholds. Align the time limit with the observed p95 of the connection time and the interval with the detection time you need - for critical services, 60 seconds is a common starting point.
  4. Require confirmation from several locations: set the alert threshold so an outage only counts once a second probe location has confirmed it. That costs a few seconds of detection time and, in practice, saves the bulk of false alarms caused by discarded packets.
  5. Bundle the alert paths: route web and service checks into the same notification paths and escalation levels instead of running a second tool for infrastructure. An on-call rota that has to watch two separate inboxes will sooner or later miss one of them.
  6. Keep and report the results: record availability and connection times per service over time so trends and achieved targets can be evidenced. How long that data may be kept and when it has to be deleted is covered in the article on a deletion policy for monitoring data.

Two neighbouring topics belong in the same round. First, releases regularly move ports, certificates and configurations without anyone updating the monitors; that stale intermediate states can also linger after a deploy is shown in the article on cache traps after the deploy. Second, every newly created service monitor should be given a named owner, otherwise a list of checks accumulates over the years that can no longer be attributed and whose alerts are therefore ignored.

Watching website and infrastructure in one account

The core of the task is unspectacular: the services that carry the business need the same attention as the page that presents it to the outside world. The effort involved is manageable - a handful of port checks, sensibly set time limits and one confirmation rule cover most of it. What makes the difference is bringing them together: one place for web and infrastructure, one alert path, one status page. Separate tools create separate responsibilities, and between two responsibilities the outage nobody expected tends to slip through.

Alongside HTTP and HTTPS, XICTRAQ also checks arbitrary TCP ports, and with them mail servers, SSH access, databases, file handovers and cache services. The checks run from three EU data centres, two of them in Germany and one in Finland; an outage counts as confirmed only once two of three nodes see it. For every monitor, name resolution, connection setup, TLS handshake and response time are kept as a time series and shown as percentiles, so a gradual degradation becomes visible. Planned work can be entered in advance as a maintenance window so that it does not trigger an alert.

The results flow into the same reports and onto the same public status page as the website checks - customers and colleagues see one picture instead of two separate tools. Start with the free trial and create your first port monitor for your mail server, or see in a personal demo how service and website monitors come together in one account.

Sources and Studies

This article is based on data from IETF (RFC 959, RFC 4253, RFC 5321, RFC 6298, RFC 6335, RFC 6409, RFC 8314, RFC 8446, RFC 9293), IANA, the Linux kernel documentation, the BSI IT-Grundschutz modules and the Verizon Data Breach Investigations Report 2026. The figures quoted refer to the state of the respective publication.

What exactly does a TCP port monitor check?
A TCP port monitor opens a connection to a host and a port at fixed intervals and records whether the connection setup succeeds and how long it takes. Technically it runs through the three-step handshake of SYN, SYN-ACK and ACK (IETF RFC 9293). This makes it possible to monitor services that do not serve a web page, such as mail servers, SSH access, databases or file handovers. The measured connection time additionally serves as an early warning value.
Is an open port enough proof that a service is working?
As a rule, not entirely. An open port proves the network path is clear and a process holds the port; it does not prove that this process is doing its job. An overloaded service can accept connections and then reject every request. More meaningful is a check that additionally reads the first protocol response, such as the SMTP greeting with code 220 (IETF RFC 5321) or the SSH version string (IETF RFC 4253).
Which ports should I monitor on a mail server?
Typically four: port 25 for acceptance from other mail servers (IETF RFC 5321), port 587 for submission by your own users (IETF RFC 6409), and ports 465 and 993 for submission and retrieval with encryption established immediately (IETF RFC 8314). Which of them are relevant in your case depends on the configuration. If port 587 fails, automated messages such as order confirmations and password resets are usually the first things to pile up.
How often should a port check run?
That depends on the detection time you need. For services whose failure hits the business immediately, an interval of 60 seconds is a common starting point; for less critical services longer intervals are sufficient. More important than a particularly short interval is a suitably set time limit and confirmation by a second probe location, because otherwise individual discarded packets get reported as an outage.
What do I do if a database port is reachable from outside?
That is a finding for the security side, not evidence of availability. Database and cache services belong in an internal network or behind a secured gateway; the IT-Grundschutz modules recommend exposing only the services that are genuinely needed (BSI IT-Grundschutz). Review the firewall rules and document explicitly for such monitors that the desired state is the refused connection.
Can I run website and service monitoring in one account?
Yes. Alongside HTTP and HTTPS, XICTRAQ checks arbitrary TCP ports, so mail servers, SSH access, databases and cache services sit next to the website monitors in the same account. The checks run from three EU data centres, an outage counts only after confirmation by two of three nodes, and the results feed into the same notification paths, reports and status pages. That typically saves a second tool along with a separate line of responsibility.
Start in 60 seconds

Let XICTRAQ watch your website.

Permanent free plan available. No credit card, no installation, no hidden fees.