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.
More on Network Models, TCP, UDP & Ports
What are the layers of the OSI model, and why does a DevOps engineer care?BeginnerHow does the TCP/IP model map to the OSI model?BeginnerWhat is the difference between TCP and UDP?BeginnerDescribe the TCP three-way handshake.BeginnerHow does TCP close a connection, and what is TIME_WAIT?IntermediateWhat is a port, and what are well-known, registered and ephemeral ranges?Beginner