Nmap Development mailing list archives

Re: nmap parallelization


From: Brandon Enright <bmenrigh () ucsd edu>
Date: Mon, 22 Dec 2008 23:50:13 +0000

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

On Mon, 22 Dec 2008 14:11:58 -0800 (PST)
Kantor Zsolt <kantorzsolt () yahoo com> wrote:

Hi, nmap uses parallelization to increase scan speed. I searched in
nmap source code to see what kind of library, functions are used for
that purpose. I searched for ptherad, the GNU pth . . . but nothing
found. My question is how is implemented then the parallelization in
nmap ? What kind of API is used for that ?

Thanks, 
  Kantor


All of Nmap's parallelization is implemented by Nmap itself and isn't a
threading/forking/cloning/multi-process model.  Most of it is done via
NSOCK's callback architecture.

You'll want to look at UltraScan() in scan_engine.cc and the NSOCK
library in nsock/

Threading in NSE uses Lua which implements interpreter-level (not
OS/kernel) threads.

Threading is one of the least portable features out there.  Event with
good standards like pthreads, Windows and many other OSes do threading
differently.  Java is a great example of a program that has had to
contend varying thread support across platforms.  Nmap side-steps the
problem.

Brandon

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.9 (GNU/Linux)

iEYEARECAAYFAklQJ7sACgkQqaGPzAsl94I+MQCguTKaOvx1MDpHe6Ga3Y9WJ5vf
01UAn3oIsKRX1bHfQdFa2uqP81B9H+l/
=lrLg
-----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: