How do i monitor network traffic on Windows from the command line

后端 未结 4 2389
再見小時候
再見小時候 2021-02-20 14:33

How do i monitor network traffic on Windows from the command line; specifically the download/upload speeds and amount of data uploaded/downloaded ? Is there a script /batch for

4条回答
  •  再見小時候
    2021-02-20 14:37

    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.

提交回复
热议问题