Community Documents

cancel
Showing results for 
Search instead for 
Did you mean: 

Netstat: List active network connections

Overview

This example uses the command line 'netstat' to query the network stack for active network connections. The active local and foreign ip addresses and port numbers are return in addition to the state of the connection.

Connection States

Netstat returns the state of each network connection, shown in the following table.

StateDescription
LISTENaccepting connections
ESTABLISHEDconnection up and passing data
SYN_SENTTCP session has been requested by us; waiting for reply from remote endpoint
SYN_RECVTCP session has been requested by a remote endpoint for a socket on which we were listening
LAST_ACKTCP our socket is closed; remote endpoint has also shut down; we are waiting for a final acknowledgement
CLOSE_WAITTCP remote endpoint has shut down; the kernel is waiting for the application to close the socket
TIME_WAITTCP socket is waiting after closing for any packets left on the network
CLOSEDsocket is not being used
CLOSINGTCP our socket is shut down; remote endpoint is shut down; not all data has been sent
FIN_WAIT1TCP our socket has closed; we are in the process of tearing down the connection
FIN_WAIT2TCP the connection has been closed; our socket is waiting for the remote endpoint to shut down

(Ref: http://linux-ip.net/html/tools-netstat.html)

Use this function to find available port numbers to use in your applications.

Block Diagram

Netstat.png

LabVIEW 2015 SP1

Comments
acordero0710
NI Employee (retired)
on

Hi,

The NI Community Hub is actually a location for questions/support on using the NI Community.

I think you will have a lot more luck if you post this question to the NI Discussion Forums: http://forums.ni.com/ - there is a very active community on the forums that may be able to provide some help.

I hope that helps!

Alberto

NI Community Team

Contributors