Nmap Development mailing list archives

Re: --min-parallelism sets max parallelism too


From: Brandon Enright <bmenrigh () ucsd edu>
Date: Sun, 2 Sep 2007 15:06:42 +0000

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Sun, 2 Sep 2007 08:55:56 -0600 plus or minus some time David Fifield
<david () bamsoftware com> wrote:

On Sun, Sep 02, 2007 at 09:45:23AM -0500, Kris Katterjohn wrote:
On 9/2/07, David Fifield <david () bamsoftware com> wrote:

All this talk about parallelism made me look deeper into how its
works. And I found something a little surprising. Due to a quirk in
how options are processed, when you specify --min-parallelism without
also specifying --max-parallelism, the maximum parallelism is also
set to the minimum. In other words, the parallelism stays the same
for the whole scan, never dropping below the minimum but never rising
above it either.

The relevant code is in NmapOps.cc:

        max_parallelism = 0;

        ...

        /* Prevent performance values from getting out of whack */
        if (min_parallelism > max_parallelism)
                max_parallelism = min_parallelism;

This assignment should only take place if max_parallelism has been
defined, I think. Or is this the intended behavior?

Well, there is also this line above that:

  if (max_parallelism && min_parallelism && (min_parallelism >
max_parallelism)) {
    fatal("--min-parallelism=%i must be less than or equal to
--max-parallelism=%i",min_parallelism,max_parallelism);

So if they are both set, and min > max, then it bails.

But otherwise, max = min because you need to have max >= min and (I
guess) you can't really gauge how much the user wants for a max.

Right, but when I set --min-parallelism, I expect the parallelism to
actually be able to increase above the minimum.

We can just use the convention that 0 for min_parallelism and
max_parallelism means "unset". The other parts of the code already work
that way. ultra_scan, for example, uses 300 for the maximum congestion
window if o.max_parallelism is 0.

Or else we could just initialize the maximum to be something huge like
100000, like what is already done with o.max_host_group_sz.

David Fifield


When I was doing all the previous test I did play with making maxP larger
than minP and letting Nmap try to find the optimal parallelism within the
range. The results I got were not good so I gave up on those tests.  Before
I start spouting numbers off the top of my head let me go do some tests and
actually report something useful.

I have a feeling though that because ultrascan() is tuned to be accurate,
and to get the speeds I want I need to lose accuracy, Nmap is going to
detect this and stay pinned at the minP value.

I'll go test this.

Brandon

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (GNU/Linux)

iD8DBQFG2tGCqaGPzAsl94IRAjNVAKCw26dbneguzg/q6tUmJEm/ie2xXwCfaw2H
Sb2hloskwA4PWeyW765UXQ0=
=eSu2
-----END PGP SIGNATURE-----

_______________________________________________
Sent through the nmap-dev mailing list
http://cgi.insecure.org/mailman/listinfo/nmap-dev
Archived at http://SecLists.Org


Current thread: