Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve netmap docs #813

Merged
merged 1 commit into from Mar 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
28 changes: 20 additions & 8 deletions README.netmap.md
Expand Up @@ -36,19 +36,31 @@ For best results on hardware that supports AES acceleration, additionally use

### Running

Run zmap as you would normally. For best results, use the `--cores` option to
pick which cores to pin to, pinning to different physical cores. The number of
send threads is automatically capped to the number of TX rings, and to the
number of available cores after setting aside one core for the receive thread,
but you may still want to override the number of threads with `-T`.
Run zmap as you would normally.

```
$ sudo ./src/zmap -p 443 -i ix0 -o output.csv
```

Warning: Netmap will disconnect the NIC from the host network stack for the
duration of the scan. If you use an interface that you depend on for e.g. SSH
access, you will lose connectivity until ZMap exits.

```
$ sudo ./src/zmap -p 443 -i ix0 -o output.csv
```

### Performance tuning

For best results, use the `--cores` option to pick which cores to pin to,
pinning to different physical cores. By default, the number of send threads is
set to the number of available cores after setting aside one core for the
receive thread, capped to 4 send threads, but you may still want to override
the number of send threads with `-T`. The number of send threads cannot exceed
the number of TX rings of the NIC.

Tuning batch size can also have an effect on send rate. `--batch 256` is not
an unreasonable starting point on 10 GbE hardware.


### Switch ports and STP

Going into and leaving Netmap mode causes the link to go down and up as part of
a PHY reset. If the interface is connected to a switch with STP enabled, then
Expand Down
2 changes: 1 addition & 1 deletion src/zopt.ggo.in
Expand Up @@ -37,7 +37,7 @@ option "rate" r "Set send rate in packets/sec"
option "bandwidth" B "Set send rate in bits/second (supports suffixes G, M and K)"
typestr="bps"
optional string
option "batch" - "Set batch size for how many packets to send in a single syscall. Only advantageous on Linux (default=64)"
option "batch" - "Set batch size for how many packets to send in a single syscall. Advantageous on Linux or with netmap (default=64)"
typestr="pps"
optional int
option "max-targets" n "Cap number of targets to probe (as a number or a percentage of the address space). A target is an IP/port pair, if scanning multiple ports, and an IP otherwise."
Expand Down