Understanding BIND9 code

Dan Foster usenet at evilphb.org
Sat Jan 14 01:43:46 UTC 2006


In article <dq8lgc$26uc$1 at sf1.isc.org>, narendar reddy
<narendarreddy.pagadala at gmail.com> wrote:
> Hi all, I am doing my Project on* " Improving BIND9 name server *
> *Performance."*  For this i have to i dentify the hot spots ( code
> fragments which take more execution time) in BIND9 code. But i dont
> know where to start to understand the code.  i came to know  files
> like mem.c, name.c, buffer.c, client.c, qery.c, rdataset.c under the
> directories     \bind-9.3.1\lib\isc, \bind-9.3.1\lib\dns,
> \bind-9.3.1\named are major one.  Please suggest me in understanding
> these files. or send me the links where i will get the documentation
> about these files.

Are you in the same course as another person whom asked the same
question recently? Perhaps you know Christ Lee. You two could work on
the project together.

The only documentation is the source code itself.

These things will help:

	- Understanding of the C programming language. If you are not
	  familiar with C, I would highly recommend reading the "K&R"
	  book, 2nd edition, written by Brian Kernighan and Dennis Ritchie.

	- An utility to view files like 'more', 'less' or a text editor.

	- Using your C compiler's profiling options enabled.

	- Running gprof on profiled BIND 9 code. If you do not use gcc
	  to build BIND, then use your compiler and native environment
	  tools for profiling. Good compilers will come with something.

	- Understanding of BIND and DNS functions and data structures;
	  read the BIND & DNS book, 4th edition, by Paul Albitz and
	  Cricket Liu, and also do web searches for DNS internals.

	- Reading the Bind 9 Administrator Reference Manual; it is
	  included in the 'doc' subdirectory.

	- Reading the DNS RFC documents which specifies components of
	  the DNS protocol. Also included in the 'doc' subdirectory.

	- You might have to construct a synthetic DNS load generator
	  or put your profiled nameserver in action in production use
	  against 'real data' to better simulate typical patterns for
	  information-gathering and later analysis.

It is important to understand the DNS protocol itself in more depth,
because then the specific data structures and function names will start
to make more sense.

Basic information on how to turn on profiling:

http://www.network-theory.co.uk/docs/gccintro/gccintro_80.html

This assumes you are building BIND from sources with gcc and use gprof.

That website will not explain in depth how to analyze profiling results;
you will need a computer science textbook or search the web for that
information.

You will also have to decide on the scope of profiling BIND. Do you wish
to profile BIND's operation only as a caching nameserver? As an
authoritative and non-recursive nameserver? As some other combination?
All of its possible functionality, or only specific ones? These are
things you will have to decide to manage the project's scope.

Your question is too broad. You will get better answers if you can ask
more detailed and specific questions. For now, you will have to do
reading, searching, analyzing, planning, and practicing.

If you have difficulties, you should also feel free to ask your
professor for assistance, too. I am sure your professor is well
compensated. :-)

-Dan



More information about the bind-users mailing list