Looking At Local Sockets
Sometimes the problem is on your own machine. The netstat and the newer ss tools list the network sockets a host has open, so you can see what is listening and what is connected.
What They Show
Each row describes one socket and its state.
- A listening socket waits for inbound connections on a port.
- An established socket is an active connection with a remote address.
- States like TIME WAIT show connections that recently closed and are lingering.
The ss tool is faster than netstat on busy hosts because it reads kernel socket data more directly.
Common Uses
You can confirm a service is actually listening on the port you expect, find which process owns a socket, or count how many connections a server holds. A flood of sockets stuck in TIME WAIT can point to a client that opens and closes connections too aggressively rather than reusing them.
Key idea
Netstat and ss list a host local sockets and their states, letting you confirm a service is listening, see established connections, and spot a pile of TIME WAIT sockets that hints at connection churn.