Skip to content

Have monitor thread calculate hitrate using unique success packets, not filtered success packets#864

Merged
zakird merged 2 commits intomainfrom
phillip/863
May 1, 2024
Merged

Have monitor thread calculate hitrate using unique success packets, not filtered success packets#864
zakird merged 2 commits intomainfrom
phillip/863

Conversation

@phillip-stephens
Copy link
Contributor

@phillip-stephens phillip-stephens commented Apr 30, 2024

Closes #863

Used git bisect to find this bug, looks like it's been in the code since 2021. (introduced in commit a66169).

We want to calculate hit-rate using the de-duplicated success packets. By using filter_success, the default behavior is to not de-duplicate responses. This led to the wild hit-rates.

Testing

main

$ cmake . && make -j4 && sudo ./src/zmap -p 80 -n 1000000 -B 100M -o /dev/null -c 5 -i enp0s8 --output-fields="*"
...
 0:13 100% (0s left); send: 1000000 done (137 Kp/s avg); recv: 39246 0 p/s (3.01 Kp/s avg); drops: 0 p/s (0 p/s avg); hitrate: 3.92%

Phillip/863 (with fix)

$ cmake . && make -j4 && sudo ./src/zmap -p 80 -n 1000000 -B 100M -o /dev/null -c 5 -i enp0s8 --output-fields="*"
...
 0:13 100% (0s left); send: 1000000 done (136 Kp/s avg); recv: 13290 0 p/s (1.02 Kp/s avg); drops: 0 p/s (0 p/s avg); hitrate: 1.33%

v2.1.1 (old behavior)

$ cmake . && make -j4 && sudo ./src/zmap -p 80 -n 1000000 -B 100M -o /dev/null -c 5 -i enp0s8 --output-fields="*"
...
 0:11 94% (1s left); send: 1000000 done (149 Kp/s avg); recv: 13437 0 p/s (1.22 Kp/s avg); drops: 0 p/s (0 p/s avg); hitrate: 1.34%

@phillip-stephens phillip-stephens marked this pull request as ready for review April 30, 2024 22:51
@zakird zakird merged commit d2bdeb0 into main May 1, 2024
@zakird zakird deleted the phillip/863 branch May 1, 2024 02:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Hitrate significantly higher when using --output-fields="*"

2 participants