How do i monitor network traffic on Windows from the command line
typeperf in Windows should work to get the data.
typeperf "\Network Interface(*)\....
typeperf -q "Network Interface" will list all the object
\Network Interface(*)\Bytes Total/sec
\Network Interface(*)\Packets/sec
\Network Interface(*)\Packets Received/sec
\Network Interface(*)\Packets Sent/sec
\Network Interface(*)\Current Bandwidth
\Network Interface(*)\Bytes Received/sec
\Network Interface(*)\Packets Received Unicast/sec
\Network Interface(*)\Packets Received Non-Unicast/sec
\Network Interface(*)\Packets Received Discarded
\Network Interface(*)\Packets Received Errors
\Network Interface(*)\Packets Received Unknown
\Network Interface(*)\Bytes Sent/sec
\Network Interface(*)\Packets Sent Unicast/sec
\Network Interface(*)\Packets Sent Non-Unicast/sec
\Network Interface(*)\Packets Outbound Discarded
\Network Interface(*)\Packets Outbound Errors
\Network Interface(*)\Output Queue Length
\Network Interface(*)\Offloaded Connections
While tshark
is really powerful if you want to have fine grained statistics (according to hosts, protocols, ...), it has the main drawback to gather statistics during the time period it is running. As such, it is only good at reporting "instant" statistics but not to report poll traffic at regular points in time to have a view of how your network traffic changes along the day, week, ...
Moreover, as tshark
makes packets capturing, there is some overhead.
So, according to your needs, you might be interested in the MS Windows net
or netstat
commands (netstat
has option to report statistics by protocol). 'net statistics [Server|workstation]'
or 'netstat [-e|-s]'
are, as far as network traffic statistics are concerned, the MS Windows equivalents of Linux 'ifconfig'
(or 'cat /proc/net/dev'
if you prefer).
Note that, as ifconfig
do, net
or netstat
only report amount of data since the interface has been brought up.
In order to obtain traffic rates, you've got to timestamp your calls to those commands and do the computation yourself.
AFAIK, both commands are shipped with all recent MS Windows versions.