Skip to content

Commit

Permalink
Docs update
Browse files Browse the repository at this point in the history
  • Loading branch information
chenjiandongx committed Dec 4, 2021
1 parent 60a790d commit c67dc06
Showing 1 changed file with 36 additions and 4 deletions.
40 changes: 36 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 28,17 @@ On macOS, the [lsof](https://ss64.com/osx/lsof.html) command is invoked, which r

**Debian/Ubuntu**
```shell
sudo apt-get install libpcap-dev
$ sudo apt-get install libpcap-dev
```

**CentOS/Fedora**
```shell
sudo yum install libpcap libpcap-devel
$ sudo yum install libpcap libpcap-devel
```

**MacOS**
```shell
brew install libpcap
$ brew install libpcap
```

**Windows**
Expand All @@ -48,7 48,7 @@ Windows need to have [npcap](https://nmap.org/npcap/) installed for capturing pa
After that, install sniffer by `go get` command.

```shell
go get -u github.com/chenjiandongx/sniffer
$ go get -u github.com/chenjiandongx/sniffer
```

## Usages
Expand Down Expand Up @@ -90,6 90,38 @@ Flags:
| <kbd>s</kbd> | switch next view mode |
| <kbd>q</kbd> / <kbd>Ctrl</kbd> <kbd>C</kbd> | quit |
## Performance
[iperf](https://github.com/esnet/iperf) is a tool for active measurements of the maximum achievable bandwidth on IP networks. Next we use this tool to forge massive packets on the `lo` device.
```shell
$ iperf -s -p 5001
$ iperf -c localhost --parallel 40 -i 1 -t 2000
```
***sniffer vs bandwhich vs nethogs***
As you can see, CPU overheads `bandwhich > sniffer > nethogs`, memory overheads `sniffer > nethogs > bandwhich`.
```shell
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME COMMAND
128405 root 20 0 210168 5184 3596 S 31.0 0.3 1:21.69 bandwhich
128596 root 20 0 1449872 21912 8512 S 20.7 1.1 0:28.54 sniffer
128415 root 20 0 18936 7464 6900 S 5.7 0.4 0:11.56 nethogs
```
See what stats they show, sniffer and bandwhich output are very approximate(~ 2.5GB/s). netlogs can only handles packets 1.122GB/s. May this be the reason for its low CPU consumption?
```shell
# sniffer
Total </ Connections: 80 Up: 2.5GBps Down: 0.0GBps />

# bandwhich
Total Up / Down: 2.5GiBps / 964Bps

# nethogs
TOTAL 1.122 0.000 GB/sec
```
## View Mode
***Bytes Mode:*** display traffic stats in bytes by the Table widget.
Expand Down

0 comments on commit c67dc06

Please sign in to comment.