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

Alternative way to estimate total size of NSEC3 chain #25

Open
pspacek opened this issue Mar 3, 2023 · 4 comments
Open

Alternative way to estimate total size of NSEC3 chain #25

pspacek opened this issue Mar 3, 2023 · 4 comments

Comments

@pspacek
Copy link

pspacek commented Mar 3, 2023

It's impossible for NSEC zones, but there is a neat and super-fast trick for NSEC3-signed zones!

https://blog.apnic.net/2017/03/10/surprising-connection-hyperloglog-dnssec-nsec3/

C++ implementation:
https://github.com/ahupowerdns/pdns/blob/dnssecmeasure/pdns/dnssecmeasure.cc

@pspacek
Copy link
Author

pspacek commented Mar 3, 2023

(Needless to say that this would enable nice progress bar for NSEC3-signed zones.)

@anonion0
Copy link
Owner

anonion0 commented Mar 3, 2023

We did something similar to this all the way back in 2011/2012, when nsec3map was initially written.

Our approach was to simply extrapolate the size of the NSEC3 chain by looking at the ratio of number of records / total hash distance covered. The difficulty was simply accounting for the sampling bias that (partial) NSEC3 enumeration produces (it doesn't produce a random sample because it tends to find records that cover a larger hash distance sooner).
I can't remember the exact math now (it's been a while), but it's probably described in our original paper.
It's implemented in the -p/--predict option.

(Needless to say that this would enable nice progress bar for NSEC3-signed zones.)

This is precisely what the -p option already does :)

@anonion0 anonion0 changed the title Estimate total number of names in zone Alternative way to estimate total size of NSEC3 chain Mar 3, 2023
@pspacek
Copy link
Author

pspacek commented Mar 3, 2023

I'm sorry for the noise, I don't know how I did miss that 🤦

@anonion0
Copy link
Owner

anonion0 commented Mar 3, 2023

No worries.
I'm going to leave this issue open until I've had a chance to compare the cited approach to ours.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants