Confusion on output given by netstat
I gave the following commands on my production server with the outputs as below:
1) netstat -tulpn | wc –l
151
2) netstat -tupn | wc –l
139
Now the output of the 1st command is higher than the 2nd command. My understanding is that the port should be first open and then listening which should mean that 2nd command should give a higher value than command 1. Are there 3 states of a port which are
1) Open
2) Listening
3) Closed?
So is the transition between the ports from open->listening->closed as a life cycle of transitions? means that the port is first open, then listening & finally closed. Or is it that the status of a port can be straight from listening to closed.
I hope my question is clear of not much clarity in the output of netstat command.
Requesting a reply to my post.
Regards
|