DNS-OARC / flamethrower

a DNS performance and functional testing utility supporting UDP, TCP, DoT and DoH
Apache License 2.0
318 stars 37 forks source link

Will multiple concurrent runners have potentially overlapping ids? #71

Closed leshow closed 3 years ago

leshow commented 3 years ago

Perhaps this is the wrong place to ask this, but I noted from the docs:

"You specify the amount of concurrent senders with the -c option [..] Each concurrent sender will pull the next query from the total queries generated by the Query Generator, looping once it reaches the end of the query list (if the program is configured to continue)."

I noted that each traffic generator creates a list of ids from 0 to 2^16 and randomly shuffles them: https://github.com/DNS-OARC/flamethrower/blob/master/flame/trafgen.cpp#L27

However, if there are multiple traffic generators, and each creates a new vector with these random ids, is it not possible that there will be multiple in-flight queries with the same id? The docs also mention starting multiple flamethrower processes and I would think this would cause a similar issue.

Is there any way around this or is it just an inescapable fact that this can happen due to the DNS protocol only having 16-bit ids?

weyrick commented 3 years ago

Hi @leshow, assuming we are talking about UDP - yes the ids may overlap between generators, but each generator has its own randomly/OS chosen UDP source port and the queries are tracked by (src port, query id) pair so essentially each generator has its own 2^16 id space.

leshow commented 3 years ago

I see, thanks for the response!