Why UDP does not show LISTENING in the state column in netstat?
TCP shows LISTENING in the state column while UDP does not show anything:
Is it because UDP has only one state (which is LISTENING) so there is no need to show it, or is there another reason?
Solution 1:
As mentioned in the comments, UDP is connectionless. Unlike with TCP, it has no concept of "listening", "established", "closed", or anything like that. If a UDP port is open, it appears in the listing; if it's not open, it doesn't. There is no other state to display. Showing LISTENING
or something similar in that column could imply that there are other possible states, and that would be false.
Solution 2:
In spite of claims that netstat doesn't show state because UDP is stateless, netstat on non-Windows OS's does show a value for the State column. For instance, Solaris shows either "Idle" or "Unbound". As far as I can tell "Idle" sockets are the ones bound to particular local ports, while "Unbound" sockets are always "*.*" and so presumably somehow open but not tied to particular ports. netstat on Linux can show at least "ESTABLISHED". Also, I'd still like to know whether a UDP port is expecting connections from elsewhere to initiate traffic or is just open so it can send stuff elsewhere.