Interview Prep/Networking/Network Models, TCP, UDP & Ports

What is the difference between "connection refused", "connection timed out" and "no route to host"?

IntermediateConceptNetwork Models, TCP, UDP & Ports
Answer

Refused: the packet reached a host and the kernel replied RST because nothing listens on that port. Timed out: no reply at all, typically a firewall or security group silently dropping, or a dead host. No route to host: the local routing table has no path, or an ICMP host-unreachable came back.

nc -zv 10.0.1.5 5432

Refused means the network path works and the service is the problem. Timeout means suspect filtering first.

All Networking questions Roadmap: Networking for DevOps

More on Network Models, TCP, UDP & Ports