Merge
authorRaj Bhattacharjea <raj.b@gatech.edu>
Tue, 05 Feb 2008 15:30:16 -0500
changeset 2317 e4fc78d60b6b
parent 2316 08b68583df24 (current diff)
parent 2315 df5e3f1d2a1a (diff)
child 2318 d4217d7ba4ba
Merge
src/internet-node/tcp-socket.cc
--- a/doc/tutorial/introduction.texi	Tue Feb 05 15:29:17 2008 -0500
+++ b/doc/tutorial/introduction.texi	Tue Feb 05 15:30:16 2008 -0500
@@ -4,103 +4,209 @@
 @c ========================================================================
 
 @c ========================================================================
-@c Introduction
+@c Tutorial Goals
 @c ========================================================================
 
-@node Introduction
-@chapter Introduction
+@node Tutorial Goals
+@unnumbered Tutorial Goals
+
+@c This is an unnumbered section, like a preface.  Numbering
+@c starts with section 1 (Introduction)
+
+The goal of this ns-3 tutorial is to introduce new users of ns-3 to enough
+of the system to enable them to author simple simulation scripts and extract
+useful information from the simulations.  We begin by introducing some of the
+other important resources that are available to those interested in using or
+writing scripts, models and even those interested in making contributions to
+the core ns-3 system.  We provide an overview of some of the 
+important abstractions, design patterns and idioms used when writing 
+ns-3 scripts, and then dig right in by begining to write simulation 
+scripts, run them and interpret results.
 
-The @command{ns-3} simulator is a discrete-event network
+After completing this tutorial, one should be able to:
+@itemize @bullet
+@item Find documentation resources in the distribution and on the web;
+@item Download and compile the ns-3 system;
+@item Understand the key software conventions of ns-3;
+@item Modify configuration parameters of existing scripts;
+@item Change the simulation output (tracing, logging, statistics);
+@item Extend the simulator to use new objects
+@item Write new ns-3 applications;
+@item See how to port code from ns-2;
+@item ... (more to follow)
+@end itemize
+
+@c ========================================================================
+@c PART:  Introduction
+@c ========================================================================
+@c The below chapters are under the major heading "Introduction"
+@c This is similar to the Latex \part command
+@c
+@c ========================================================================
+@c Overview
+@c ========================================================================
+@node Overview
+@chapter Overview
+
+@menu
+* For ns-2 users::
+* Contributing::
+* Tutorial organization::
+@end menu
+
+The ns-3 simulator is a discrete-event network
 simulator targeted primarily for research and educational use.  
-The @uref{http://www.nsnam.org,,@command{ns-3} project}, started in 
+The @uref{http://www.nsnam.org,,ns-3 project}, started in 
 2006, is an open-source project.  The goal of the project is to
-build a new netework simulator primarily for research and educational use.  
+build a new network simulator primarily for research and educational use.  
 
-The purpose of this tutorial is to introduce new @command{ns-3} users to the 
+Primary documentation for the ns-3 project is available in
+three forms:
+@itemize @bullet
+@item @uref{http://www.nsnam.org/doxygen/index.html,,ns-3 Doxygen/Manual}:  Documentation of the public APIs of the simulator
+@item Tutorial (this document)
+@item @uref{http://www.nsnam.org/wiki/index.php,, ns-3 wiki}
+@end itemize
+
+The purpose of this tutorial is to introduce new ns-3 users to the 
 system in a structured way.  It is sometimes difficult for new users to
 glean essential information from detailed manuals and to convert this
 information into working simulations.  In this tutorial, we will build 
 several example simulations, introducing and explaining key concepts and
 features as we go.
 
-As the tutorial unfolds, we will introduce the full @command{ns-3} 
+As the tutorial unfolds, we will introduce the full ns-3 
 documentation 
 and provide pointers to source code for those interested in delving deeper
 into the workings of the system.
 
-Primary documentation for the @command{ns-3} project is available in
-three forms:
-@itemize @bullet
-@item ns-3 Manual:  Documentation of the public APIs of the simulator
-@item Tutorial (this document)
-@item ns-3 wiki (http://www.nsnam.org/wiki/index.php)
-@end itemize
- 
 A few key points are worth noting at the onset:
 @itemize @bullet
-@item @command{ns-3} is not an extension of @command{ns-2}; it is a new
-simulator.  The two simulators are both written in C++ but @command{ns-3}
-is a new simulator that does not support the @command{ns-2} APIs.
-Some models from @command{ns-2} have already been ported from @command{ns-2}
-to @command{ns-3}. The project will continue to maintain @command{ns-2} while
-@command{ns-3} is being built, and will study transition and
+@item ns-3 is not an extension of @uref{http://www.isi.edu/nsnam/ns,,ns-2}; 
+it is a new
+simulator.  The two simulators are both written in C++ but ns-3
+is a new simulator that does not support the ns-2 APIs.
+Some models from ns-2 have already been ported from ns-2
+to ns-3. The project will continue to maintain ns-2 while
+ns-3 is being built, and will study transition and
 integration mechanisms.
-@item @command{ns-3} is open-source, and the project strives to maintain
+@item ns-3 is open-source, and the project strives to maintain
 an open environment for researchers to contribute and share their
 software.  
 @end itemize
  
-The goal of this tutorial is to introduce new users of @command{ns-3} to enough
-of the system to enable them to author simple simulation scripts and extract
-useful information from the simulations.  We begin by introducing some of the
-other important resources that are available to those interested in using or
-writing scripts, models and even those interested in making contributions to
-the core @command{ns-3} system.  We provide an overview of some of the 
-important abstractions, design patterns and idioms used when writing 
-@command{ns-3} scripts, and then dig right in by begining to write simulation 
-scripts, run them and interpret results.
+@node For ns-2 users
+@section For ns-2 users
+
+For those familiar with ns-2, the most visible outward change 
+when moving to ns-3 is the choice of scripting language.  
+ns-2 is typically scripted in Tcl and results of simulations can
+be visualized using the Network Animator @command{nam}.  In 
+ns-3 there is currently no visualization module, and Python
+bindings have been developed (Tcl bindings have been prototyped
+using @uref{http://www.swig.org,,SWIG}, but are not supported by the 
+current development team).  
+In this tutorial, we will concentrate on 
+scripting directly in C++ and interpreting results via trace files.  
+
+But there are similarities as well (both, for example, are based
+on C++ objects, and some code from ns-2 has already been ported
+to ns-3).  We will try to highlight differences between ns-2 and ns-3
+as we proceed in this tutorial.
+
+@node Contributing
+@section Contributing
 
-After completing this tutorial, one should be able to:
+@cindex software configuration management
+ns-3 is a research and educational simulator, by and for the
+research community.  It will rely on the ongoing contributions of 
+the community to develop new models, debug or maintain
+existing ones, and share results.  There are a few policies
+that we hope will encourage people to contribute to ns-3 like they
+have for ns-2:
 @itemize @bullet
-@item Find documentation resources in the distribution and on the web;
-@item Download and compile the @command{ns-3} system;
-@item Use the provided devices to author network simulations of fairly  
-significant complexity;
-@item Use the default value system to configure simulations;
-@item Write new @command{ns-3} applications;
-@item Use the tracing subsystem.
+@item open source licensing based on GNU GPLv2 compatibility
+@item @uref{http://www.nsnam.org/wiki/index.php,,wiki}
+@item @uref{http://www.nsnam.org/wiki/index.php/Contributed_Code,,Contributed Code} page, similar to ns-2's popular 
+@uref{http://nsnam.isi.edu/nsnam/index.php/Contributed_Code,,Contributed Code} 
+page
+@item @code{src/contrib} directory (we will host your contributed code)
+@item open @uref{http://www.nsnam.org/bugzilla,,bug tracker}
+@item ns-3 developers will gladly help potential contributors to get
+started with the simulator (please contact @uref{http://www.nsnam.org/people.html,,one of us})
+@end itemize  
+
+If you are an ns user, please consider to provide your feedback,
+bug fixes, or code to the project.  
+
+@node Tutorial organization
+@section Tutorial organization
+
+The tutorial assumes that new users might follow a path such as follows:
+
+@itemize @bullet
+@item browse the source code and documentation, to get a feel for 
+the simulator and what it might be like to handle;
+@item try to download and build a copy;
+@item try to run a few sample programs, and perhaps change some configurations;
+@item look at simulation output, and try to adjust it
+@item study the software architecture of the system, to consider hacking it or 
+extending it;
+@item write new models or port existing code to ns-3, and eventually post those
+models back to the community.
 @end itemize
 
+As a result, we have tried to organize the tutorial along the above
+broad sequences of events.
+
 @c ========================================================================
-@c Overview
+@c Browsing ns-3
 @c ========================================================================
 
-@node Overview
-@chapter Overview
+@node Browsing
+@chapter Browsing ns-3
+
+@menu
+* Source code::
+* Doxygen::
+* Other documentation::
+@end menu
 
-This chapter is a brief tour of @command{ns-3}.  It introduces the
-concept of discrete event simulation, provides a brief overview of
-@command{ns-3}, and provides a short contextual introduction for
-the existing @command{ns-2} user community.
+@node Source code
+@section Source code 
 
-@node Discrete Event Simulation
-@section Discrete Event Simulation  
+The most recent code can be browsed on our web server at the following link:
+@uref{http://code.nsnam.org/?sort=lastchange}.  If you click on the bold
+repository names on the left of the page, you will see changelogs for
+these repositories, and links to the @emph{manifest}.  From the manifest
+links, one can browse the source tree.
 
-@node ns-3 Overview
-@section ns-3 Overview
-
-@node For ns-2 users
-@section For @command{ns-2} users
+The top-level directory will look something like:
+@verbatim
+  AUTHORS  RELEASE_NOTES  examples/  src/       waf*
+  LICENSE  VERSION        ns3/       tutorial/  waf.bat*
+  README   doc/           samples/   utils/     wscript
+@end verbatim
+The source code is mainly in the @code{src} directory.  Example
+scripts are in the @code{examples} directory.  Both are good directories
+to start browsing some code.
 
-For those familiar with @command{ns-2}, the most visible outward change 
-when moving to @command{ns-3} is the choice of scripting language.  
-@command{ns-2} is typically scripted in Tcl and results of simulations are
-often visualized using the Network Animator @command{nam}.  In 
-@command{ns-3} there is currently no visualization module, and multiple 
-language bindings are allowed.  In this tutorial, we will concentrate on 
-scripting directly in C++ and interpreting results via trace files.  Scripting
-in other languages will typically be done via straightforward bindings of the 
-target language into the underlying C++.
+For ns-2 users, who may be familiar with the @code{simple.tcl} example script
+in the ns-2 documentation, an analogous script is found in 
+@code{examples/simple-point-to-point.cc} with a Python equivalent found
+in @emph{(pending Python merge)}. 
+
+@node Doxygen
+@section Doxygen
+
+We document all of APIs using @uref{http://www.stack.nl/~dimitri/doxygen/,,Doxygen}.  Current builds of this documentation are available at:
+@uref{http://www.nsnam.org/doxygen/index.html}, which are worth an initial
+look.  
+
+@node Other documentation
+@section Other documentation
+
+See:  @uref{http://www.nsnam.org/documents.html}.
 
 @c ========================================================================
 @c Resources
@@ -121,9 +227,9 @@
 @section The Web
 
 @cindex www.nsnam.org
-There are several important resources of which any @command{ns-3} user must be
+There are several important resources of which any ns-3 user must be
 aware.  The main web site is located at @uref{http://www.nsnam.org}
-and provides access to basic information about the @command{ns-3} system.  
+and provides access to basic information about the ns-3 system.  
 Detailed documentation is available through the main web site at
 @uref{http://www.nsnam.org/documents.html}.
 
@@ -133,7 +239,7 @@
 and also gain access to the detailed software documentation.  The software
 system is documented in great detail using 
 @uref{http://www.stack.nl/~dimitri/doxygen/,,Doxygen}.  There is a Wiki that
-complements the main @command{ns-3} web site which you will find at 
+complements the main ns-3 web site which you will find at 
 @uref{http://www.nsnam.org/wiki/}.
 
 You will find user and developer FAQs there as well as troubleshooting guides, 
@@ -157,7 +263,7 @@
 
 @cindex software configuration management
 @cindex Mercurial
-The @command{ns-3} project uses Mercurial as its source code management system.
+The ns-3 project uses Mercurial as its source code management system.
 Although you do not need to know much about Mercurial in order to complete
 this tutorial, we recommend becoming familiar with Mercurial and using it 
 to access the source code.  Mercurial has a web site at 
@@ -169,8 +275,8 @@
 and a QuickStart guide at
 @uref{http://www.selenic.com/mercurial/wiki/index.cgi/QuickStart/}.
 
-You can also find vital information about using Mercurial and @command{ns-3}
-on the main @command{ns-3} web site.
+You can also find vital information about using Mercurial and ns-3
+on the main ns-3 web site.
 
 @node Waf
 @section Waf
@@ -187,9 +293,9 @@
 alternatives have been developed.  Recently these systems have been developed
 using the Python language.
 
-The build system @code{Waf} is used on the @command{ns-3} project.  It is one 
+The build system @code{Waf} is used on the ns-3 project.  It is one 
 of the new generation of Python-based build systems.  You will not need to 
-understand any Python to build the existing @command{ns-3} system, and will 
+understand any Python to build the existing ns-3 system, and will 
 only have to understand a tiny and intuitively obvious subset of Python in 
 order to extend the system in most cases.
 
@@ -200,7 +306,7 @@
 @section Environment, Idioms, and Design Patterns
 
 @cindex C++
-As mentioned above, scripting in @command{ns-3} is done in C++.  A working 
+As mentioned above, scripting in ns-3 is done in C++.  A working 
 knowledge of C++ and object-oriented concepts is assumed in this document.
 We will take some time to review some of the more advanced concepts or 
 possibly unfamiliar language features, idioms and design patterns as they 
@@ -217,26 +323,26 @@
 
 @cindex toolchain
 @cindex GNU
-The @command{ns-3} system uses the GNU ``toolchain'' for development.  
+The ns-3 system uses the GNU ``toolchain'' for development.  
 A software toolchain is the set of programming tools available in the given 
 environment. For a quick review of what is included in the GNU toolchain see,
 @uref{http://en.wikipedia.org/wiki/GNU_toolchain}.
 
 @cindex Linux
-Typically a @command{ns-3} author will work in Linux or a Linux-like
+Typically an ns-3 author will work in Linux or a Linux-like
 environment.  For those running under Windows, there do exist environments 
-which simulate the Linux environment to various degrees.  The @command{ns-3} 
+which simulate the Linux environment to various degrees.  The ns-3 
 project supports development in the Cygwin and the MinGW environments for 
 these users.  See @uref{http://www.cygwin.com/} and 
 @uref{http://www.mingw.org/} for details on downloading and using these
-systems.  I use Cygwin in these cases since it provides all of the Linux tools
-I know and love.  It can, however, sometimes be problematic due to the way it 
+systems.  Cygwin provides many of the popular Linux system commands.
+It can, however, sometimes be problematic due to the way it 
 actually does its emulation, and sometimes interactions with other Windows
 software can cause problems.
 
 @cindex Cygwin
 @cindex MinGW
-If you do use Cygwin or MinGW; and use Logitech products, I will save you
+If you do use Cygwin or MinGW; and use Logitech products, we will save you
 quite a bit of heartburn right off the bat and encourage you to take a look
 at the @uref{http://www.mingw.org/MinGWiki/index.php/FAQ,,MinGW FAQ}.
 
@@ -254,7 +360,7 @@
 In any system, there are a number of problems to be solved that happen 
 repeatedly.  Often the solutions to these problems can be generalized and
 applied in a similar way across the system.  These solutions are called
-Design Patterns.  The @command{ns-3} system relies on several classic design
+Design Patterns.  The ns-3 system relies on several classic design
 patterns.
 
 @cindex design pattern
@@ -269,34 +375,34 @@
 
 These low-level constructs, or idioms, extend upward in complexity, eventually
 becoming implementations of design patterns.  As you are exposed to more 
-and more of the @command{ns-3} system, you will begin to recognize and be 
+and more of the ns-3 system, you will begin to recognize and be 
 comfortable with the C++ implementations (idioms) of several important design
 patterns.
 
 @cindex functor
 @cindex callback
 @cindex smart pointer
-The @command{ns-3} code relies heavily on 
+The ns-3 code relies heavily on 
 @emph{Generalized Functors, Callbacks, 
 Smart Pointers, Singletons, and Object Factories}.  Although we will 
 not assume any detailed knowledge of the idioms and design patterns used 
-in the @command{ns-3}
+in the ns-3
 system, it will be useful for readers who intend to delve deeply into the
 system to understand some important related concepts.  We recommend two 
 resources: @uref{http://www.amazon.com/Design-Patterns-Object-Oriented-Addison-Wesley-Professional/dp/0201633612/,,Design Patterns: Elements of Reusable Object-Oriented Software, Gamma et. al.} and
 @uref{http://www.amazon.com/exec/obidos/ASIN/0201704315,,Modern C++ Design: Generic Programming and Design Patterns Applied, Alexandrescu}.
 
 Gamma addresses the abstract design patterns, and Alexandrescu addresses the
-C++ idioms you will often see throughout the @command{ns-3} code.
+C++ idioms you will often see throughout the ns-3 code.
 
 @cindex template
-Almost any use of @command{ns-3} will require some basic knowledge of C++ 
+Almost any use of ns-3 will require some basic knowledge of C++ 
 templates.
 We will discuss the high-level uses in this tutorial.  However, if you venture
 deeply into the source code, you will see fairly heavy use of relatively
 sophisticated C++ templates in some of low-level modules of the system.  The
 You don't have to be a template guru to complete this tutorial but if you
-expect to work in @command{ns-3} at a low level you will have to be 
+expect to work in ns-3 within the simulation core, you will have to be 
 somewhat fluent
 with templates.  If you  want to truly grok C++ templates we recommend,
 @uref{http://www.amazon.com/Templates-Complete-Guide-David-Vandevoorde/dp/0201734842/,,C++ Templates: The Complete Guide, Vandevoorde and Josuttis}.
@@ -322,11 +428,11 @@
 that covers material you may need to understand for the multicast examples.
 
 @c ========================================================================
-@c The Basics
+@c Downloading and Compiling 
 @c ========================================================================
 
-@node The-Basics
-@chapter The Basics
+@node Downloading and Compiling
+@chapter Downloading and Compiling
 
 @cindex Linux
 @cindex Cygwin
@@ -340,21 +446,21 @@
 @cindex Waf
 We are going to assume that you have Mercurial and Waf installed and running
 on the target system as described in the Getting Started section of the 
-@command{ns-3} web site: @uref{http://www.nsnam.org/getting_started.html}.
+ns-3 web site: @uref{http://www.nsnam.org/getting_started.html}.
 
 @section Downloading
 @cindex tarball
-The @command{ns-3} code is available in Mercurial repositories on the server
+The ns-3 code is available in Mercurial repositories on the server
 code.nsnam.org.  You can download a tarball, but we recommend working with
 Mercurial --- it will make your life easier in the long run.
 
 @cindex repository
 If you go to the following link: @uref{http://code.nsnam.org/},
 you will see a number of repositories.  Many are the private repositories of
-the @command{ns-3} development team.  The repositories of interest to you 
+the ns-3 development team.  The repositories of interest to you 
 will be
 prefixed with ``ns-3''.  The current development snapshot (unreleased) of
-@command{ns-3} may be found at: @uref{http://code.nsnam.org/ns-3-dev/}.
+ns-3 may be found at: @uref{http://code.nsnam.org/ns-3-dev/}.
 
 The developers attempt to keep this repository in a consistent, working state
 but it is a development area with unreleased code present, so you may want to
@@ -362,7 +468,7 @@
 
 There will be a number of released repositories present at code.nsnam.org.
 These repos will have names like ns-3.0.1 --- which referes to release 3.0.1 
-of the network simulator (or if you like, release 0.1 of @command{ns-3}).  
+of the network simulator (or if you like, release 0.1 of ns-3).  
 Since the releases are changing at a rate of one per month, I will stick with 
 the more constant ns-3-dev here, but you can replace the string ns-3-dev with
 your choice of release (e.g., ns-3.0.5) below.  You can find the latest 
@@ -370,11 +476,12 @@
 to the ``Getting Started'' web page and looking for the latest release 
 identifier.
 
-I typically create a directory called @code{repos} in my home directory under
-which I keep all of my local Mercurial repositories.  @emph{Hint:  I will
+One practice is to create a directory called @code{repos} in one's home 
+directory under which one can keep local Mercurial repositories.  
+@emph{Hint:  we will
 assume you do this later in the tutorial.} If you adopt that approach, you 
-can get a copy of the development version of @command{ns-3} by typing 
-the following into your Linux shell (I use bash).
+can get a copy of any of the development versions of ns-3 by typing 
+the following into your Linux shell (assuming you have installed Mercurial):
 
 @verbatim
   cd
@@ -405,14 +512,14 @@
   README   doc/           samples/   utils/     wscript
 @end verbatim
 
-You are now ready to build the @command{ns-3} distribution.
+You are now ready to build the ns-3 distribution.
 
 @section Building
 @cindex Waf!build
 @cindex Waf!configure
 @cindex Waf!debug
 @cindex Waf!compile
-We use Waf to build the @command{ns-3} project.  The first thing you 
+We use Waf to build the ns-3 project.  The first thing you 
 will need to do is to configure the build.  For reasons that will become clear
 later, we are going to work with debug builds in the tutorial.  To explain to 
 Waf that it should do debug builds you will need to execute the following 
@@ -452,10 +559,10 @@
 @end verbatim
 
 The build system is now configured and you can build the debug versions of 
-the @command{ns-3} programs by simply typing,
+the ns-3 programs by simply typing,
 
 @verbatim
-  ./waf
+  ./waf check
 @end verbatim
 
 You will see many Waf status messages displayed as the system compiles.  The
@@ -465,12 +572,14 @@
   Compilation finished successfully
 @end verbatim
 
+and you will see a number of software unit tests subsequently execute.
+
 @section Running a Script
 @cindex Waf!run
 We typically run scripts under the control of Waf.  This allows the build 
 system to ensure that the shared library paths are set correctly and that
 the libraries are available at run time.  To run a program, simply use the
-@code{run} option in Waf.  Let's run the @command{ns-3} equivalent of the hello
+@code{run} option in Waf.  Let's run the ns-3 equivalent of the hello
 world program by typing the following:
 
 @verbatim
@@ -485,7 +594,10 @@
   Hello Simulator
 @end verbatim
 
-@emph{Congratulations.  You are now an @command{ns-3} user.}
+If you want to run programs under another tool such as gdb or valgrind,
+see this @uref{http://www.nsnam.org/wiki/index.php/User_FAQ#How_to_run_NS-3_programs_under_another_tool,,wiki entry}.
+
+@emph{Congratulations.  You are now an ns-3 user.}
 
 @c ========================================================================
 @c Some Prerequisites
@@ -502,19 +614,19 @@
 @section Abstractions
 
 In this section, we'll review some terms that are commonly used in
-networking, but have a specific meaning in @command{ns-3}.
+networking, but have a specific meaning in ns-3.
 
 @subsection Node
 @cindex Node
 In Internet jargon, a computing device that connects to a network is called
-a @emph{host} or sometimes an @emph{end system}.  Because @command{ns-3} is a 
+a @emph{host} or sometimes an @emph{end system}.  Because ns-3 is a 
 @emph{network} simulator, not specifically an @emph{Internet} simulator, we 
 intentionally do not use the term host since it is closely associated with
 the Internet and its protocols.  Instead, we use a more generic term also
 used by other simulators that originates in Graph Theory --- the @emph{node}.
 
 @cindex Node!class
-In @command{ns-3} the basic computing device abstraction is called the 
+In ns-3 the basic computing device abstraction is called the 
 node.  This abstraction is represented in C++ by the class @code{Node}.  The 
 @code{Node} class provides methods for managing the representations of 
 computing devices in simulations.  Developers are expected to specialize the 
@@ -527,7 +639,7 @@
 You should think of a @code{Node} as a computer to which you will add 
 functionality.  One adds things like applications, protocol stacks and
 peripheral cards with their associated drivers to enable the computer to do
-useful work.  We use the same basic model in @command{ns-3}.
+useful work.  We use the same basic model in ns-3.
 
 @subsection Application
 @cindex Application
@@ -542,14 +654,14 @@
 @cindex system call
 Often, the line of separation between system and application software is made
 at the privilege level change that happens in operating system traps.
-In @command{ns-3} there is no real concept of operating system and especially
+In ns-3 there is no real concept of operating system and especially
 no concept of privilege levels or system calls.  We do, however, have the
 idea of an application.  Just as software applications run on computers to
-perform tasks in the ``real world,'' @command{ns-3} applications run on
-@command{ns-3} @code{Node}s to drive simulations in the simulated world.
+perform tasks in the ``real world,'' ns-3 applications run on
+ns-3 @code{Node}s to drive simulations in the simulated world.
 
 @cindex Application!class
-In @command{ns-3} the basic abstraction for a user program that generates some
+In ns-3 the basic abstraction for a user program that generates some
 activity to be simulated is the application.  This abstraction is represented 
 in C++ by the class @code{Application}.  The @code{Application} class provides 
 methods for managing the representations of our version of user-level 
@@ -567,7 +679,7 @@
 over which data flows in these netowrks are called @emph{channels}.  When
 you connect your Ethernet cable to the plug in the wall, you are connecting 
 your computer to an Ethernet communication channel.  In the simulated world
-of @command{ns-3} one connects a @code{Node} to an object representing a
+of ns-3 one connects a @code{Node} to an object representing a
 communication channel.  Here the basic communication subnetwork abstraction 
 is called the channel and is represented in C++ by the class @code{Channel}.  
 
@@ -602,7 +714,7 @@
 collectively known as @emph{net devices}.  In Unix and Linux you refer
 to these net devices by names such as @emph{eth0}.
 
-In @command{ns-3} the @emph{net device} abstraction covers both the software 
+In ns-3 the @emph{net device} abstraction covers both the software 
 driver and the simulated hardware.  A net device is ``attached'' to a 
 @code{Node} in order to enable the @code{Node} to communicate with other 
 @code{Node}s in the simulation via @code{Channel}s.  Just as in a real
@@ -619,13 +731,13 @@
 
 @subsection Topology Helpers
 In a real network, you will find host computers with added (or built-in)
-NICs.  In @command{ns-3} we would say that you will find @code{Nodes} with 
+NICs.  In ns-3 we would say that you will find @code{Nodes} with 
 attached @code{NetDevices}.  In a large simulated network you will need to 
 arrange many connections between @code{Node}s, @code{NetDevice}s and 
 @code{Channel}s.
 
 Since connecting a @code{NetDevice} to a @code{Node}, and a @code{NetDevice}
-to a @code{Channel} is such a common task in @command{ns-3} we provide what we
+to a @code{Channel} is such a common task in ns-3 we provide what we
 call @emph{topology helpers} to make this as easy as possible.  Topology 
 helpers perform much of the dirty work of creating and connecting net devices.
 For example, it may take several distinct method calls to create a NetDevice,
@@ -650,14 +762,14 @@
 examine this in some detail here.
 
 @cindex InternetNode
-@cindex Create
+@cindex CreateObject
 @cindex Ptr
-In @command{ns-3}, if we want to create an @code{InternetNode} in a 
+In ns-3, if we want to create an @code{InternetNode} in a 
 script, we will 
 typically do something like the following example:
 
 @verbatim
-  Ptr<Node> p = Create<InternetNode> ();
+  Ptr<Node> p = CreateObject<InternetNode> ();
 @end verbatim
 
 @cindex smart pointer
@@ -677,7 +789,7 @@
 using C++ @emph{templates}.  
 
 @verbatim
-  Ptr<Node> p = Create<InternetNode> ();
+  Ptr<Node> p = CreateObject<InternetNode> ();
 @end verbatim
 
 The purpose of templates is to allow a programmer to write one version of code
@@ -884,12 +996,12 @@
 underlying data can be freed.
 
 @cindex reference counting!intrusive
-The @command{ns-3} smart pointer mechanism uses a mechanism called intrusive 
+The ns-3 smart pointer mechanism uses a mechanism called intrusive 
 reference counting to determine when a memory block should be automatically 
 deallocated.  The term ``intrusive'' means that a reference count (a count of
 variables required to have valid data) is stored in the object being managed
 instead of in a proxy object.  This means that each piece of memory managed by
-a @command{ns-3} smart pointer includes a reference count.  When a smart 
+a ns-3 smart pointer includes a reference count.  When a smart 
 pointer to a reference counted object is created, this reference count is 
 incremented.  This indicates that a new variable requires a valid data object 
 be present.  When a smart pointer to a reference counted object is destroyed
@@ -916,7 +1028,7 @@
 memory leaks.
 
 Now, we want to make this feature available as widely as possible to objects
-in the @command{ns-3} system.  The basic operations of the smart pointer class
+in the ns-3 system.  The basic operations of the smart pointer class
 are the same across any intrusively reference counted object.  C++ provides a
 mechanism to achieve this kind of generic behavior --- the template.  Let's
 examine the declaration of the smart pointer in more detail.  First consider
@@ -955,21 +1067,21 @@
 @end verbatim
 
 @subsection Object Creation
-@cindex Create
+@cindex CreateObject
 On the right hand side of the line of code we're examining (reproduced below
 for convenience) is the creation of an @code{InternetNode} object.
 
 @verbatim
-  ... = Create<InternetNode> ();
+  ... = CreateObject<InternetNode> ();
 @end verbatim
 
 @cindex template!function
 This turns out to be an instance of use of a C++ @emph{function template}. The
-definition of the @code{Create<typename T>()} template calls the new operator
-to create an object of the type T.  It then creates a new smart pointer of
-the appropriate type (i.e., @code{Ptr<T>}).  This new smart pointer is
-assigned initial responsibility for the new object which has its reference
-count set to one.
+definition of the @code{CreateObject<typename T>()} template calls the new 
+operator to create an object of the type T.  It then creates a new smart 
+pointer of the appropriate type (i.e., @code{Ptr<T>}).  This new smart 
+pointer is assigned initial responsibility for the new object which has its 
+reference count set to one.
 
 Since the underlying creation mechanism is via the @code{new} operator, and
 you can pass parameters to the constructor for an object, we provide several
@@ -979,7 +1091,7 @@
 
 @verbatim
   int parm = 1;
-  ... = Create<MyClass> (parm);
+  ... = CreateObject<MyClass> (parm);
 @end verbatim
 
 We provide Create templates with up to seven parameters, so you could 
@@ -987,7 +1099,7 @@
 
 @verbatim
   int parm = 1;
-  ... = Create<MyClass> (p1, p2, p3, p4, p5, p6, p7);
+  ... = CreateObject<MyClass> (p1, p2, p3, p4, p5, p6, p7);
 @end verbatim
 
 @subsection Type Safety
@@ -995,7 +1107,7 @@
 have been examining for some time (again reproduced below).
 
 @verbatim
-  Ptr<Node> p = Create<InternetNode> ();
+  Ptr<Node> p = CreateObject<InternetNode> ();
 @end verbatim
 
 @cindex smart pointer
@@ -1057,31 +1169,31 @@
 to a base class happening in the assignment.  That means that
 
 @verbatim
-  Ptr<Node> p = Create<InternetNode> ();
+  Ptr<Node> p = CreateObject<InternetNode> ();
 @end verbatim
 
 or,
 
 @verbatim
-  Ptr<Channel> p = Create<CsmaChannel> ();
+  Ptr<Channel> p = CreateObject<CsmaChannel> ();
 @end verbatim
 
 will work just fine.  Of course, if you try something @emph{bad} (TM), like:
 
 @verbatim
-  Ptr<Node> p = Create<CsmaChannel> ();
+  Ptr<Node> p = CreateObject<CsmaChannel> ();
 @end verbatim
 
 the compiler will quite appropriately complain that there is no conversion
 between these completely unrelated objects (CsmaChannel and Node).
 
 @subsection Summary
-Going back to our infamous first line of @command{ns-3} code, we said that if 
+Going back to our infamous first line of ns-3 code, we said that if 
 we want to create an InternetNode in a script, we will typically do something 
 like:
 
 @verbatim
-  Ptr<Node> p = Create<InternetNode> ();
+  Ptr<Node> p = CreateObject<InternetNode> ();
 @end verbatim
 
 @cindex Create
@@ -1106,9 +1218,9 @@
 @chapter A First ns-3 script
 @cindex design pattern
 @cindex idiom
-Lets build a simple network using the @command{ns-3} design patterns, idioms,
+Lets build a simple network using the ns-3 design patterns, idioms,
 classes and helpers we have just looked at.  If you downloaded the system as
-was suggested above, you will have a release of @command{ns-3} in a directory 
+was suggested above, you will have a release of ns-3 in a directory 
 called @code{repos} under your home directory.  Change into that directory, 
 where you should see a directory structure something like the following.
 
@@ -1140,8 +1252,8 @@
   }
 @end verbatim
 
-This is the @command{ns-3} version of the ubiquitous hello-world program.  It 
-uses the @command{ns-3} Log module to print ``Hello Simulator'' into the
+This is the ns-3 version of the ubiquitous hello-world program.  It 
+uses the ns-3 Log module to print ``Hello Simulator'' into the
  standard error output stream.
 
 @cindex logging
@@ -1162,7 +1274,7 @@
 @end verbatim
 
 @cindex include files
-The @command{ns-3} build system places the core include files it needs into a 
+The ns-3 build system places the core include files it needs into a 
 directory called @code{ns-3} and so whenever you need to include one of the
 core files you need to explicitly code this.  The file @code{ptr.h} defines
 the generic smart pointer that we use.  The file @code{internet-node.h}
@@ -1174,10 +1286,10 @@
 after the call to @code{NS_LOG_INFO}.
 
 @verbatim
-  Ptr<Node> n0 = Create<InternetNode> ();
-  Ptr<Node> n1 = Create<InternetNode> ();
-  Ptr<Node> n2 = Create<InternetNode> ();
-  Ptr<Node> n3 = Create<InternetNode> ();
+  Ptr<Node> n0 = CreateObject<InternetNode> ();
+  Ptr<Node> n1 = CreateObject<InternetNode> ();
+  Ptr<Node> n2 = CreateObject<InternetNode> ();
+  Ptr<Node> n3 = CreateObject<InternetNode> ();
 @end verbatim
 
 As we now understand, this will create four @code{InternetNode} objects on
@@ -1315,9 +1427,9 @@
 similar to a multi-homed host.  Each time you add a net device, you will get
 a new index.  Since the IP address for a multi-homed host is associated with
 a net device, we need to provide that index (which we have saved) to the
-topology helper.  We provide an IP version four address via the @command{ns-3} 
+topology helper.  We provide an IP version four address via the ns-3 
 class @code{Ipv4Address} which takes a dotted decimal string as a constructor 
-parameter.  We also provide a network mask using the @command{ns-3} class
+parameter.  We also provide a network mask using the ns-3 class
 @code{Ipv4Mask} which also takes a dotted decimal string.  The code to 
 perform the IP address assignment, then, looks like the following:
 
@@ -1359,10 +1471,10 @@
 
     NS_LOG_INFO ("Hello Simulator");
 
-    Ptr<Node> n0 = Create<InternetNode> ();
-    Ptr<Node> n1 = Create<InternetNode> ();
-    Ptr<Node> n2 = Create<InternetNode> ();
-    Ptr<Node> n3 = Create<InternetNode> ();
+    Ptr<Node> n0 = CreateObject<InternetNode> ();
+    Ptr<Node> n1 = CreateObject<InternetNode> ();
+    Ptr<Node> n2 = CreateObject<InternetNode> ();
+    Ptr<Node> n3 = CreateObject<InternetNode> ();
 
     Ptr<CsmaChannel> lan = 
       CsmaTopology::CreateCsmaChannel (DataRate (5000000), MilliSeconds (2));
@@ -1398,9 +1510,9 @@
 
 @section Using Applications
 @cindex Create
-As mentioned above, we use @code{Application}s in @command{ns-3} to generate 
+As mentioned above, we use @code{Application}s in ns-3 to generate 
 the data used to drive simulations.  An @code{Application} is added to a 
-@command{ns-3} node conceptually just as if you would add an application to a 
+ns-3 node conceptually just as if you would add an application to a 
 computer.  When an application is created (using the @code{Create} template) 
 we tell the application which @code{Node} it belongs to (and therefore on 
 which node it is running) by passing a smart pointer to that @code{Node} in 
@@ -1423,8 +1535,8 @@
   uint32_t maxPacketCount = 1;
   Time interPacketInterval = Seconds (1.);
 
-  Ptr<UdpEchoClient> client = Create<UdpEchoClient> (n0, "10.1.1.2", port, 
-    maxPacketCount, interPacketInterval, packetSize);
+  Ptr<UdpEchoClient> client = CreateObject<UdpEchoClient> (n0, "10.1.1.2", 
+    port, maxPacketCount, interPacketInterval, packetSize);
 @end verbatim
 
 @cindex packet
@@ -1466,7 +1578,7 @@
   Ipv4Address addr ("10.1.1.2");
   ...
 
-  Ptr<UdpEchoClient> client = Create<UdpEchoClient> (n0, addr, port, 
+  Ptr<UdpEchoClient> client = CreateObject<UdpEchoClient> (n0, addr, port, 
     maxPacketCount, interPacketInterval, packetSize);
 @end verbatim
 
@@ -1474,7 +1586,7 @@
 You can use the unnamed parameter idiom that we have previously seen:
 
 @verbatim
-  Ptr<UdpEchoClient> client = Create<UdpEchoClient> (n0, 
+  Ptr<UdpEchoClient> client = CreateObject<UdpEchoClient> (n0, 
     Ipv4Address ("10.1.1.2"), port, maxPacketCount, interPacketInterval, 
     packetSize);
 @end verbatim
@@ -1482,12 +1594,12 @@
 Or you can rely on implicit conversion sequences as we just saw:
 
 @verbatim
-  Ptr<UdpEchoClient> client = Create<UdpEchoClient> (n0, "10.1.1.2", port, 
-    maxPacketCount, interPacketInterval, packetSize);
+  Ptr<UdpEchoClient> client = CreateObject<UdpEchoClient> (n0, "10.1.1.2", 
+    port, maxPacketCount, interPacketInterval, packetSize);
 @end verbatim
 
 Which approach to take is a matter of style, really, and you will probably
-see all three approaches taken in the @command{ns-3} code.  You should be 
+see all three approaches taken in the ns-3 code.  You should be 
 comfortable seeing and using all three methods.
 
 @subsection A UDP Echo Server Application
@@ -1502,12 +1614,12 @@
 following code:
 
 @verbatim
-  Ptr<UdpEchoServer> server = Create<UdpEchoServer> (n1, port);
+  Ptr<UdpEchoServer> server = CreateObject<UdpEchoServer> (n1, port);
 @end verbatim
 
 We only need to tell the application which node to reside on and which port
 to listen on for UDP packets.  The code to actually create the
-@code{UdpEchoServer} application uses the now quite familiar @command{ns-3} object
+@code{UdpEchoServer} application uses the now quite familiar ns-3 object
 creation idiom.
 
 @subsection A UDP Echo Client-Server Simulation
@@ -1538,10 +1650,10 @@
 
     NS_LOG_INFO ("UDP Echo Simulation");
 
-    Ptr<Node> n0 = Create<InternetNode> ();
-    Ptr<Node> n1 = Create<InternetNode> ();
-    Ptr<Node> n2 = Create<InternetNode> ();
-    Ptr<Node> n3 = Create<InternetNode> ();
+    Ptr<Node> n0 = CreateObject<InternetNode> ();
+    Ptr<Node> n1 = CreateObject<InternetNode> ();
+    Ptr<Node> n2 = CreateObject<InternetNode> ();
+    Ptr<Node> n3 = CreateObject<InternetNode> ();
 
     Ptr<CsmaChannel> lan = 
       CsmaTopology::CreateCsmaChannel (DataRate (5000000), MilliSeconds (2));
@@ -1575,10 +1687,10 @@
     uint32_t maxPacketCount = 1;
     Time interPacketInterval = Seconds (1.);
 
-    Ptr<UdpEchoClient> client = Create<UdpEchoClient> (n0, "10.1.1.2", port, 
-      maxPacketCount, interPacketInterval, packetSize);
+    Ptr<UdpEchoClient> client = CreateObject<UdpEchoClient> (n0, "10.1.1.2", 
+      port, maxPacketCount, interPacketInterval, packetSize);
 
-    Ptr<UdpEchoServer> server = Create<UdpEchoServer> (n1, port);
+    Ptr<UdpEchoServer> server = CreateObject<UdpEchoServer> (n1, port);
 
   }
 @end verbatim
@@ -1586,14 +1698,14 @@
 @section Using the Simulation Engine
 @cindex model
 @cindex simulation executive
-You could say that the heart of the @command{ns-3} system is the 
+You could say that the heart of the ns-3 system is the 
 @emph{simulation engine} (sometimes called the simulation executive in other 
 systems).
 
 In a computer simulation, a computer @emph{model} of a real world @emph{system}
 is constructed.  This is typically done to minimize cost since you do not have
 to actually buy, install and maintain physical hardware.  In the case of
-@command{ns-3}, a model is a representation of a networking component that is
+ns-3, a model is a representation of a networking component that is
 designed to imitate some number of important behaviors or characteristics of 
 an actual component in a real network.  A system is a collection of models
 arranged for the purpose of analyzing some behavior.
@@ -1604,7 +1716,7 @@
 @cindex InternetNode
 @cindex NIC
 @cindex CSMA
-We have already encountered several @command{ns-3} models without specifically 
+We have already encountered several ns-3 models without specifically 
 calling them so.  The @code{InternetNode}, @code{CsmaNetDevice} and 
 @code{CsmaChannel} objects are models of an Internet computing node, a CSMA
 network interface card (NIC), and a network cable able to move data to and
@@ -1624,7 +1736,7 @@
 @cindex Ethernet
 No model will fully implement @emph{all} of the behaviors of a piece of
 hardware.  It is important to understand what is being modeled by the 
-@command{ns-3} components you are using and what is not.  For example, the Csma
+ns-3 components you are using and what is not.  For example, the Csma
 components we use in this tutorial model a highly abstract multiple access
 network that is topologically equivalent to an Ethernet.  It is not necessarily
 true that results found in a simulation using the Csma models will apply to
@@ -1661,7 +1773,7 @@
 @cindex function object
 @cindex callback
 @cindex Callback
-In @command{ns-3} an event is basically a pre-packaged function call called a 
+In ns-3 an event is basically a pre-packaged function call called a 
 @emph{functor}.  Functors are also known as @emph{function objects}, which is
 a more descriptive term --- an object (in the object-oriented programming 
 sense) that can be called as if it was a function.  Typically one uses a
@@ -1673,9 +1785,9 @@
 complete by calling some function you provide.  This provided function is
 known as a callback function.  [Imagine calling someone on the telephone and
 asking them to do something for you.  You also ask them to @emph{call you back}
-when they are done.]  Events in the @command{ns-3} system work conceptually
+when they are done.]  Events in the ns-3 system work conceptually
 the same way, except that instead of an I/O completion driving the process,
-the arrival of some simulated time drives the process.  The @command{ns-3} 
+the arrival of some simulated time drives the process.  The ns-3 
 deferred exectution mechanism is via a class called @code{Callback}.
 
 @cindex Time
@@ -1688,7 +1800,7 @@
 @section Driving the Simulation
 @cindex Application
 As mentioned previously, time is the driving force behind the progress of
-a @command{ns-3} simulation.  Events are scheduled to happen at certain times
+a ns-3 simulation.  Events are scheduled to happen at certain times
 by calling methods of the simulation engine, either directly or indirectly
 through, for example, an @code{Application}.
 
@@ -1738,7 +1850,7 @@
 you would attempt to start a client application in the real world.
 
 @cindex socket!sendto
-The @command{ns-3} equivalent of the call to @code{sendo} in the client will 
+The ns-3 equivalent of the call to @code{sendo} in the client will 
 schedule (immediately) the transmission of a UDP packet over the just created
 socket.  This will cause the packet to percolate down the protocol stack and
 eventually into the channel.  The channel will schedule a reception event in
@@ -1763,7 +1875,7 @@
   Simulator::Destroy ();
 @end verbatim
 
-We now have the makings of a complete @command{ns-3} network simulation.  The 
+We now have the makings of a complete ns-3 network simulation.  The 
 source code for the script should look like the following:
 
 @verbatim
@@ -1792,10 +1904,10 @@
 
     NS_LOG_INFO ("UDP Echo Simulation");
 
-    Ptr<Node> n0 = Create<InternetNode> ();
-    Ptr<Node> n1 = Create<InternetNode> ();
-    Ptr<Node> n2 = Create<InternetNode> ();
-    Ptr<Node> n3 = Create<InternetNode> ();
+    Ptr<Node> n0 = CreateObject<InternetNode> ();
+    Ptr<Node> n1 = CreateObject<InternetNode> ();
+    Ptr<Node> n2 = CreateObject<InternetNode> ();
+    Ptr<Node> n3 = CreateObject<InternetNode> ();
 
     Ptr<CsmaChannel> lan = 
       CsmaTopology::CreateCsmaChannel (DataRate (5000000), MilliSeconds (2));
@@ -1829,10 +1941,10 @@
     uint32_t maxPacketCount = 1;
     Time interPacketInterval = Seconds (1.);
 
-    Ptr<UdpEchoClient> client = Create<UdpEchoClient> (n0, "10.1.1.2", port, 
-      maxPacketCount, interPacketInterval, packetSize);
+    Ptr<UdpEchoClient> client = CreateObject<UdpEchoClient> (n0, "10.1.1.2", 
+      port, maxPacketCount, interPacketInterval, packetSize);
 
-    Ptr<UdpEchoServer> server = Create<UdpEchoServer> (n1, port);
+    Ptr<UdpEchoServer> server = CreateObject<UdpEchoServer> (n1, port);
 
     server->Start(Seconds(1.));
     client->Start(Seconds(2.));
@@ -1845,11 +1957,11 @@
   }
 @end verbatim
 
-@cindex csma-echo.cc
+@cindex tutorial-csma-echo.cc
 Just to make sure you don't get caught up in debugging typographical errors
 we have provided this source code for you (along with a copyright header) in
-the @code{tutorial} subdirectory of the @command{ns-3} distribution as 
-@code{csma-echo.cc}.  We used this opportunity to do some ``clean up''
+the @code{tutorial} subdirectory of the ns-3 distribution as 
+@code{tutorial-csma-echo.cc}.  We used this opportunity to do some ``clean up''
 of some of our example cases by passing parameters using implicit conversion 
 sequences and removing some of the named parameters. [These were used for
 pedagogic purposes and were not actually necessary.]
@@ -1861,7 +1973,7 @@
 which is Python-based.  We have to change gears slightly and switch ourselves
 to Python mode in order to proceed.
 
-In each subdirectory of the @command{ns-3} distribution in which there are
+In each subdirectory of the ns-3 distribution in which there are
 source files, you will find two files:  one will be named @code{waf} and one
 will be named @code{wscript}.  The former, @code{waf}, is a link that allows
 one to start the build process from any subdirectory.  We can ignore that one.
@@ -1891,34 +2003,30 @@
 
 All that needed to be done in order to build the new simulation using the new
 source file was to copy the two lines describing the @code{hello-simulator} 
-program and change the names to @code{csma-echo}.  You can see these lines
-in the @code{wscript} file,
+program and change the names to @code{tutorial-csma-echo}.  You can see these 
+lines in the @code{wscript} file,
 
 @verbatim
   def build(bld):
     obj = bld.create_ns3_program('hello-simulator')
     obj.source = 'hello-simulator.cc'
 
-    obj = bld.create_ns3_program('csma-echo')
-    obj.source = 'csma-echo.cc'
+    obj = bld.create_ns3_program('tutorial-csma-echo')
+    obj.source = 'tutorial-csma-echo.cc'
 
     ...
 @end verbatim
 
 When you built the system above, you actually already built this new 
 simulation and a number of other examples.  Since you have already configured
-@code{Waf} and built the @code{csma-echo} script, you can run the simulation
-in the same way as you ran the @code{hello-simulator} script using the 
-@code{waf --run} command:
+@code{Waf} and built the @code{tutorial-csma-echo} script, you can run the 
+simulation in the same way as you ran the @code{hello-simulator} script using 
+the @code{waf --run} command:
 
 @verbatim
-~/repos/ns-3-dev/tutorial > waf --run csma-echo
+~/repos/ns-3-dev/tutorial > waf --run tutorial-csma-echo
 Entering directory `~/repos/ns-3-dev/build'
 Compilation finished successfully
 UDP Echo Simulation
 ~/repos/ns-3-dev/tutorial >
 @end verbatim
-
-Wow!  Wasn't that cool!  I'm sure you can barely contain yourself at this
-point.  Okay, well, maybe we should figure out how to get some useful
-information out of that simulation.  It did run ... I promise.
--- a/doc/tutorial/other.texi	Tue Feb 05 15:29:17 2008 -0500
+++ b/doc/tutorial/other.texi	Tue Feb 05 15:30:16 2008 -0500
@@ -37,13 +37,13 @@
 @center @image{pp,,,,png}
 
 We have provided a file for you in the @code{tutorial}
-directory called @code{point-to-point.cc}.  You should now be familiar enough
-with the system to pick out fairly easily what has been changed.  Let's focus
-on the following lines:
+directory called @code{tutorial-point-to-point.cc}.  You should now be
+familiar enough with the system to pick out fairly easily what has been
+changed.  Let's focus on the following lines:
 
 @verbatim
-  Ptr<Node> n0 = Create<InternetNode> ();
-  Ptr<Node> n1 = Create<InternetNode> ();
+  Ptr<Node> n0 = CreateObject<InternetNode> ();
+  Ptr<Node> n1 = CreateObject<InternetNode> ();
 
   Ptr<PointToPointChannel> link = PointToPointTopology::AddPointToPointLink (
     n0, n1, DataRate (38400), MilliSeconds (20));
@@ -79,7 +79,7 @@
 to build and run this example and to locate and interpret the ASCII trace 
 file.  This is left as an exercise for you.
 
-The file @code{point-to-point.cc} is reproduced here for your 
+The file @code{tutorial-point-to-point.cc} is reproduced here for your 
 convenience:
 
 @verbatim
@@ -132,8 +132,8 @@
 
   NS_LOG_INFO ("Point to Point Topology Simulation");
 
-  Ptr<Node> n0 = Create<InternetNode> ();
-  Ptr<Node> n1 = Create<InternetNode> ();
+  Ptr<Node> n0 = CreateObject<InternetNode> ();
+  Ptr<Node> n1 = CreateObject<InternetNode> ();
 
   Ptr<PointToPointChannel> link = PointToPointTopology::AddPointToPointLink (
     n0, n1, DataRate (38400), MilliSeconds (20));
@@ -143,10 +143,10 @@
 
   uint16_t port = 7;
 
-  Ptr<UdpEchoClient> client = Create<UdpEchoClient> (n0, "10.1.1.2", port, 
-    1, Seconds(1.), 1024);
+  Ptr<UdpEchoClient> client = CreateObject<UdpEchoClient> (n0, "10.1.1.2", 
+    port, 1, Seconds(1.), 1024);
 
-  Ptr<UdpEchoServer> server = Create<UdpEchoServer> (n1, port);
+  Ptr<UdpEchoServer> server = CreateObject<UdpEchoServer> (n1, port);
 
   server->Start(Seconds(1.));
   client->Start(Seconds(2.));
@@ -167,7 +167,7 @@
 A point-to-point network is considered a special case of a star network.  As
 you might expect, the process of constructing a star network is an extension
 of the very simple process used for a point-to-point link.  We have provided
-a file for you in the @code{tutorial} directory called @code{star.cc}
+a file for you in the @code{tutorial} directory called @code{tutorial-star.cc}
 that implements a simple star network as seen below.
 
 @sp 1
@@ -190,13 +190,13 @@
 find and understand the code that creates these nodes.
 
 @verbatim
-  Ptr<Node> n0 = Create<InternetNode> ();
-  Ptr<Node> n1 = Create<InternetNode> ();
-  Ptr<Node> n2 = Create<InternetNode> ();
-  Ptr<Node> n3 = Create<InternetNode> ();
-  Ptr<Node> n4 = Create<InternetNode> ();
-  Ptr<Node> n5 = Create<InternetNode> ();
-  Ptr<Node> n6 = Create<InternetNode> ();
+  Ptr<Node> n0 = CreateObject<InternetNode> ();
+  Ptr<Node> n1 = CreateObject<InternetNode> ();
+  Ptr<Node> n2 = CreateObject<InternetNode> ();
+  Ptr<Node> n3 = CreateObject<InternetNode> ();
+  Ptr<Node> n4 = CreateObject<InternetNode> ();
+  Ptr<Node> n5 = CreateObject<InternetNode> ();
+  Ptr<Node> n6 = CreateObject<InternetNode> ();
 @end verbatim
 
 Next, we get into the differences between the @code{PointToPointTopology}
@@ -290,7 +290,7 @@
 to build and run this example and to locate and interpret the ASCII trace 
 file.  This is left as an exercise for you.
 
-The file @code{star.cc} is reproduced here for your convenience:
+The file @code{tutorial-star.cc} is reproduced here for your convenience:
 
 @verbatim
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
@@ -345,13 +345,13 @@
 
   NS_LOG_INFO ("Star Topology Simulation");
 
-  Ptr<Node> n0 = Create<InternetNode> ();
-  Ptr<Node> n1 = Create<InternetNode> ();
-  Ptr<Node> n2 = Create<InternetNode> ();
-  Ptr<Node> n3 = Create<InternetNode> ();
-  Ptr<Node> n4 = Create<InternetNode> ();
-  Ptr<Node> n5 = Create<InternetNode> ();
-  Ptr<Node> n6 = Create<InternetNode> ();
+  Ptr<Node> n0 = CreateObject<InternetNode> ();
+  Ptr<Node> n1 = CreateObject<InternetNode> ();
+  Ptr<Node> n2 = CreateObject<InternetNode> ();
+  Ptr<Node> n3 = CreateObject<InternetNode> ();
+  Ptr<Node> n4 = CreateObject<InternetNode> ();
+  Ptr<Node> n5 = CreateObject<InternetNode> ();
+  Ptr<Node> n6 = CreateObject<InternetNode> ();
 
   Ptr<PointToPointChannel> link01 = 
     PointToPointIpv4Topology::CreateChannel (DataRate (38400), 
@@ -439,10 +439,10 @@
 
   uint16_t port = 7;
 
-  Ptr<UdpEchoClient> client = Create<UdpEchoClient> (n0, "10.1.1.2", port, 
-    1, Seconds(1.), 1024);
+  Ptr<UdpEchoClient> client = CreateObject<UdpEchoClient> (n0, "10.1.1.2", 
+    port, 1, Seconds(1.), 1024);
 
-  Ptr<UdpEchoServer> server = Create<UdpEchoServer> (n1, port);
+  Ptr<UdpEchoServer> server = CreateObject<UdpEchoServer> (n1, port);
 
   server->Start(Seconds(1.));
   client->Start(Seconds(2.));
@@ -470,7 +470,7 @@
 enable internetwork routing.
 
 We have provided a file for you in the @code{tutorial} directory called 
-@code{star-routing.cc} to show you how this is done.  This extremely
+@code{tutorial-star-routing.cc} to show you how this is done.  This extremely
 tricky and difficult change is shown below:
 
 @verbatim 
@@ -483,11 +483,11 @@
 We changed the client application so that it runs on node four:
 
 @verbatim
-  Ptr<UdpEchoClient> client = Create<UdpEchoClient> (n4, "10.1.1.2", port,
-    1, Seconds(1.), 1024);
+  Ptr<UdpEchoClient> client = CreateObject<UdpEchoClient> (n4, "10.1.1.2", 
+    port, 1, Seconds(1.), 1024);
 @end verbatim
 
-Now if you build and run @code{star-routing.cc} you can examine the
+Now if you build and run @code{tutorial-star-routing.cc} you can examine the
 @code{tutorial.tr} file and see that your UDP echo packets are now correctly
 routed through the topology.
 
@@ -508,7 +508,7 @@
 
 We have provided a file that constructs this dumbbell network and creates 
 enough data flowing across the choke point that some packets will be dropped.
-The file is called @code{linear-dumbbell.cc} and is located in the 
+The file is called @code{tutorial-linear-dumbbell.cc} and is located in the 
 @code{tutorial} directory.  We have already covered all of the code used to
 create this network, so we will just quickly go over the main sections of the
 script.
@@ -521,10 +521,10 @@
 //
 // Create the lan on the left side of the dumbbell.
 //
-  Ptr<Node> n0 = Create<InternetNode> ();
-  Ptr<Node> n1 = Create<InternetNode> ();
-  Ptr<Node> n2 = Create<InternetNode> ();
-  Ptr<Node> n3 = Create<InternetNode> ();
+  Ptr<Node> n0 = CreateObject<InternetNode> ();
+  Ptr<Node> n1 = CreateObject<InternetNode> ();
+  Ptr<Node> n2 = CreateObject<InternetNode> ();
+  Ptr<Node> n3 = CreateObject<InternetNode> ();
 
   Ptr<CsmaChannel> lan1 = 
     CsmaTopology::CreateCsmaChannel (DataRate (10000000), MilliSeconds (2));
@@ -554,10 +554,10 @@
 //
 // Create the lan on the right side of the dumbbell.
 //
-  Ptr<Node> n4 = Create<InternetNode> ();
-  Ptr<Node> n5 = Create<InternetNode> ();
-  Ptr<Node> n6 = Create<InternetNode> ();
-  Ptr<Node> n7 = Create<InternetNode> ();
+  Ptr<Node> n4 = CreateObject<InternetNode> ();
+  Ptr<Node> n5 = CreateObject<InternetNode> ();
+  Ptr<Node> n6 = CreateObject<InternetNode> ();
+  Ptr<Node> n7 = CreateObject<InternetNode> ();
 
   Ptr<CsmaChannel> lan2 = 
     CsmaTopology::CreateCsmaChannel (DataRate (10000000), MilliSeconds (2));
@@ -615,19 +615,19 @@
 //
   uint16_t port = 7;
 
-  Ptr<UdpEchoClient> client0 = Create<UdpEchoClient> (n0, "10.1.2.1", port, 
-    100, Seconds(.01), 1024);
-  Ptr<UdpEchoClient> client1 = Create<UdpEchoClient> (n1, "10.1.2.2", port, 
-    100, Seconds(.01), 1024);
-  Ptr<UdpEchoClient> client2 = Create<UdpEchoClient> (n2, "10.1.2.3", port, 
-    100, Seconds(.01), 1024);
-  Ptr<UdpEchoClient> client3 = Create<UdpEchoClient> (n3, "10.1.2.4", port, 
-    100, Seconds(.01), 1024);
+  Ptr<UdpEchoClient> client0 = CreateObject<UdpEchoClient> (n0, "10.1.2.1", 
+    port, 100, Seconds(.01), 1024);
+  Ptr<UdpEchoClient> client1 = CreateObject<UdpEchoClient> (n1, "10.1.2.2", 
+    port, 100, Seconds(.01), 1024);
+  Ptr<UdpEchoClient> client2 = CreateObject<UdpEchoClient> (n2, "10.1.2.3", 
+    port, 100, Seconds(.01), 1024);
+  Ptr<UdpEchoClient> client3 = CreateObject<UdpEchoClient> (n3, "10.1.2.4", 
+    port, 100, Seconds(.01), 1024);
 
-  Ptr<UdpEchoServer> server4 = Create<UdpEchoServer> (n4, port);
-  Ptr<UdpEchoServer> server5 = Create<UdpEchoServer> (n5, port);
-  Ptr<UdpEchoServer> server6 = Create<UdpEchoServer> (n6, port);
-  Ptr<UdpEchoServer> server7 = Create<UdpEchoServer> (n7, port);
+  Ptr<UdpEchoServer> server4 = CreateObject<UdpEchoServer> (n4, port);
+  Ptr<UdpEchoServer> server5 = CreateObject<UdpEchoServer> (n5, port);
+  Ptr<UdpEchoServer> server6 = CreateObject<UdpEchoServer> (n6, port);
+  Ptr<UdpEchoServer> server7 = CreateObject<UdpEchoServer> (n7, port);
 
   server4->Start(Seconds(1.));
   server5->Start(Seconds(1.));
@@ -651,10 +651,10 @@
 @end verbatim
 
 The remainder of the file should be quite familiar to you.  Go ahead and 
-run @code{linear-dumbbell}.  Now take a look at the trace (@code{tutorial.tr})
-file.  You will now see trace lines that begin with @code{d}.  Alternatively 
-you can search for the string ``queue-drop'' which is the expansion of the 
-drop code.
+run @code{tutorial-linear-dumbbell}.  Now take a look at the trace 
+(@code{tutorial.tr}) file.  You will now see trace lines that begin with 
+@code{d}.  Alternatively you can search for the string ``queue-drop'' which
+is the expansion of the drop code ('d').
 
 Interpretation of a dropped packet is straightforward.  We have expanded
 the first @code{queue-drop} trace for you below.  See the section on ASCII 
@@ -699,7 +699,7 @@
 We have written a number of @command{ns-3} scripts in C++.  Although we have 
 been perfectly linear in our script implementations, just like any other C++ 
 program, an @command{ns-3} script can use any features of the language you
-desire.  If you will look back at the @code{linear-dumbbell.cc}
+desire.  If you will look back at the @code{tutorial-linear-dumbbell.cc}
 example, you may notice that the code to create the left and right sides of
 the dumbbell is operationally identical --- only the names change.  An obvious
 improvement of this program would be to use subroutines to create the sides.
@@ -841,12 +841,12 @@
 @end verbatim
 
 That's it.  We have actually already walked through almost all of the code
-required to construct a bus network in our @code{csma-echo.cc} 
+required to construct a bus network in our @code{tutorial-csma-echo.cc} 
 example, so let's just jump forward and take a look at an implementation
 of this thing.  We provide an implementation for you in the files 
 @code{ipv4-bus-network.h} and @code{ipv4-bus-network.cc} located in the
 @code{tutorial} directory.  We also provide an example that uses the new
-class in the file @code{bus-network.cc}.
+class in the file @code{tutorial-bus-network.cc}.
 
 The interesting method from our current perspective is the Ipv4BusNetwork
 constructor, shown below:
@@ -869,7 +869,7 @@
   
     for (uint32_t i = 0; i < n; ++i)
       {
-        Ptr<Node> node = Create<InternetNode> ();
+        Ptr<Node> node = CreateObject<InternetNode> ();
         uint32_t nd = CsmaIpv4Topology::AddIpv4CsmaNetDevice (node, m_channel, 
           Mac48Address::Allocate ());
         Ipv4Address address = Ipv4AddressGenerator::AllocateAddress (mask, 
@@ -978,7 +978,7 @@
   
     for (uint32_t i = 0; i < n; ++i)
       {
-        Ptr<Node> node = Create<InternetNode> ();
+        Ptr<Node> node = CreateObject<InternetNode> ();
         uint32_t nd = CsmaIpv4Topology::AddIpv4CsmaNetDevice (node, m_channel, 
           Mac48Address::Allocate ());
         Ipv4Address address = Ipv4AddressGenerator::AllocateAddress (mask, 
@@ -1093,9 +1093,10 @@
 
 The @command{ns-3} object model takes the C++ language (system level) object 
 model as its basis, and extends that model by providing an API for software
-componentry.  You will find terms like Component, Interface and QueryInterface
-in the following discussion.  It is important to understand from the outset
-that this is the @command{ns-3} object model, and not any other object model.
+componentry.  You may find terms like Component, Interface and QueryInterface
+in the following discussion, or used informally in other discussions about 
+@command{ns-3}.  It is important to understand from the outset that this is
+the @command{ns-3} object model, and not any other object model.
 Richard Feynman (an American physicist) once described the behavior of matter 
 and light on a very small scale in the following way,
 
@@ -1111,7 +1112,7 @@
 software componentry before continuing.  To paraphrase Feynman, @command{ns-3}
 components do not behave like COM Components, or Java Beans, or CORBA
 objects, or clouds or weights on springs, or like anything that you have 
-ever seen  they are @command{ns-3} components.
+ever seen --- they are @command{ns-3} components.
 
 @section The C++ Object Model is the Root of all Things
 @command{Ns-3} is primarily a C++ system.  The system is written in C++ and
@@ -1125,7 +1126,7 @@
 @code{Create} as in the following example:
 
 @verbatim
-  Ptr<Node> n0 = Create<InternetNode> ();
+  Ptr<Node> n0 = CreateObject<InternetNode> ();
 @end verbatim
 
 This line of code, while it may be unfamiliar to some, is pure C++.  If you
@@ -1180,7 +1181,7 @@
 
 @section Interfaces
 There are many different ideas floating around of what exactly the term
-@emph{Interface} means.  Originally an interface just meant a communication
+@emph{interface} means.  Originally an interface just meant a communication
 boundary between two entities.  As the concepts of object oriented programming
 (OOP) were surfacing in the 1980s, the term interface was applied to the
 collection of access methods for the modular entities that were being defined.
@@ -1216,21 +1217,22 @@
 When we speak of an ns-3 interface, we do not worry about interface definition
 languages, or pure virtual classes, or registries  we just think about C++
 object declarations and their associated methods.  When we instantiate an
-@command{ns-3} Interface, it is the C++ object model that dictates how that
+@command{ns-3} interface, it is the C++ object model that dictates how that
 object is brought into existence.  When a method is called on an @command{ns-3}
 Interface, it is the C++ object model that dictates how that method is 
 dispatched.
 
-The only difference between a vanilla C++ object and an ns-3 Interface, is
-that an object acting as an ns-3 Interface must inherit from the base class
-Object.  This inheritance gives the Interface object a very useful capability.
+The only difference between a vanilla C++ object and an ns-3 object with a
+specifically defined interface, is that an object acting as an ns-3 interface
+ must inherit from the base class Object.  This inheritance gives the Object
+a very useful capability conceptually similar to a COM Interface.
 
-@section The Ns-3 Capital I Interface and QueryInterface
-One thing that Microsoft got right in the Component Object Model was the idea
-of Interface aggregation and discovery via QueryInterface.  We have embraced
-these ideas in @command{ns-3}.  This was done primarily to address a common
-problem in large software systems.  A good example of this problem happens
-in the @command{ns-3} Node class.
+@section The Ns-3 Interface and GetObject
+One thing that Microsoft arguably got right in the Component Object Model was
+the idea of Interface aggregation and discovery via QueryInterface.  We have 
+embraced these ideas in @command{ns-3}.  This was done primarily to address a 
+common problem in large software systems.  A good example of this problem 
+happens in the @command{ns-3} Node class.
 
 If one were to take the standard OOP view of specializing a @code{Node} into
 an internet host, for example, one would typically inherit from the @code{Node}
@@ -1284,570 +1286,789 @@
 
 Composition, usually called @emph{aggregation}, along with runtime Interface
 discovery is the solution that Microsoft originally championed and that 
-@command{ns-3} has adopted.  In our example a @code{Node} would contain 
-separate Interface objects implementing internetwork routing and TCP/IP.
-These contained objects have interfaces in the C++ sense of collections of
-method signatures.  When objects are capable of participating in this
-aggregation process, they are called @command{ns-3} Interfaces and they
-receive the functionality required for this participation by inheriting
-from the base class @code{Object}.
+@command{ns-3} has adopted --- albeit with many simplifications and a few name
+changes.
+
+@subsection Objects and Interfaces
+Now that we have mentioned Microsoft COM and are almost obligated to mention 
+the terms Interface and QueryInterface.  For those familiar with COM, loosely
+speaking, QueryInterface is to COM as GetObject is to @command{ns-3}.
+The analogy, while good conceptually, is superficial from an implementation 
+point of view.
+
+Addressing our current example of a @code{Node}, generically speaking, each
+node needs to aggregate an object that will implement internetwork routing 
+and TCP/IP.  The system will need to provide a mechanism for locating the
+aggregated objects and allow a client to discover them.  
+
+These aggregated objects have interfaces in the C++ sense of collections of
+method signatures.  In @command{ns-3}, when objects are capable of 
+participating in this aggregation process, they are called @command{ns-3} 
+@code{Objects}.  @code{Object}s receive the functionality required for this
+ participation by inheriting from the @command{ns-3} base class @code{Object}.
 
-@subsection Object, interfaces and Interfaces
-As mentioned above, the class that implements the aggregation mechanism for
-@command{ns-3} objects is called @code{Object}.  The class named @code{Object}
-is simply a base class that you will inherit from if you want your objects
-to support aggregation and QueryInterface.  Many systems have a base class
-that implements common functionality and these base classes are typically
-called Object.  The @command{ns-3} version of this object base class relates
-primarily to Interface aggregation, although it does provide methods to help
-with intrusive reference counting and tracing as well.
+Note well that when we write the word @code{Object} (note the uppercase 'O' in
+the spelling and the change of font) we are referring to a kind of C++ object
+that has inherited the capability of participating in an aggregation.  The 
+@command{ns-3}-specific word @code{Object} can have a significantly different
+meaning than that of a vanilla C++ object outside the aforementioned 
+inheritance tree, and the difference is only readily apparent via context.
+In this tutorial we will always write the @command{ns-3}-specific kind of 
+@code{Object} in a fixed font; and will write the vanilla C++ term object in
+normal font.  In conversation, you will need to be careful to understand which
+term is meant:  object or @code{Object}.
+
+Once an object has inherited from class @code{Object} it has the ability to
+@emph{host} an aggregation.  This means that it has the ability to add other
+@code{Objects} to its aggregation via the method @code{AggregateObject}.  It
+also means that it can provide a service to @emph{discover} other objects in
+its aggregation via the method @code{GetObject}.
+
+
+Technically, the class named @code{Object} is simply a base class that you
+will inherit from if you want your @code{Objects} to support aggregation and
+discovery.  Many systems have a base class that implements common 
+functionality and these base classes are typically called somthing like 
+Object.  The @command{ns-3} version of this base class relates primarily to
+@code{Object} aggregation and discovery, although it does also provide methods
+to help with intrusive reference counting and tracing as well.
 
 When a C++ object inherits from the ns-3 Object base class, it is conceptually
-promoted to an ns-3 Interface (note the capital I in Interface) irrespective
-of how the object was declared (e.g., as an abstract base class, concrete
-class, with virtual methods, etc.).   In ns-3, you should associate
-inheritance from the class named @code{Object} with promotion of an object to 
-the status of Interface rather than the form of the Interface declaration.
+promoted to an ns-3 @code{Object} irrespective of how the object was declared
+(e.g., as an abstract base class, concrete class, with virtual methods, etc.).
+In ns-3, you should associate inheritance from the class named @code{Object}
+with promotion of an object to the status of some locatable @code{Object}
+rather than with the form of the class declaration.
 
-When you inherit from @code{Object}, you will get new methods and an
-Interface Identifier.  The Interface Identifer, or @emph{iid}, is the 
-@command{ns-3} version of the @emph{Universally Unique ID} (UUID) or 
-@emph{Globally Unique ID} (GUID) found in other systems.  Unlike the GUID, it
-is really a dynamically created process-local ID.  For now, consider it as
-simply a number which the system will generate for you that uniquely
-identifies an Interface class within the ns-3 system and allows you to
-specify an interface type to @code{QueryInterface}.
+For those of you unfamiliar with Microsoft COM, CORBA or ORBit, this might 
+sound obvious.  For those of with such a background, the point we are making 
+is that there is no such thing in @command{ns-3} as a separate Interface
+declaration, no such thing as an Interface Definiition Language, no such thing
+as a UUID or GUID, etc.  In @command{ns-3} we just work with C++ objects that
+may be given some very useful abilities by inheriting from the @command{ns-3}
+base class @code{Object}.  @command{Ns-3} @code{Object}s are not required to
+inherit from classes composed of pure virtual methods in order to define an
+Interface.  It's all really just ``plain old C++.''
 
 To summarize, when you instantiate an object that inherits from the 
 @code{Object} class, you will have a C++ object that has four important 
 properties:  
 
 @itemize @bullet
-@item The object has a C++ interface defined by the collection of method signatures in its inheritance tree; 
-@item The object has an Interface ID that uniquely identifies the C++ interface of its class;
-@item The object is a container that has the ability to aggregate other interfaces;
-@item The object exports a method that allows for discovery of aggregated interfaces (@code{QueryInterface}) according to Interface ID.
+@item The @code{Object} has a C++ interface defined by the collection of method signatures in its inheritance tree; 
+@item The @code{Object} has some way to identify its underlying class uniquely;
+@item The @code{Object} is a kind of container that has the ability to aggregate other @code{Object}s using the method @code{AggregateObject};
+@item The @code{Object} exports a method called @code{GetObject} that allows for discovery of other aggregated @code{Object}s.
 @end itemize
 
-It is crucially important to understand what we have described here.  A given
-C++ class has an object access interface that is essentially the collection
-of method signatures specified in its inheritance tree.  This is a C++ object
-model thing.  Ns-3 provides a base class from which the class in question can
-inherit and be promoted to the status of Interface.  Once a class becomes
-an Interface it has inherited the ability to set its own interface identifier
-(@code{iid}), and exports methods to aggregate and search other Interfaces
-that are added to its aggregation.
+It is crucially important to understand what we have described here
+(especially for those coming from other systems that provide similar 
+functionality).  A given C++ class has an object access interface that is
+essentially the collection of method signatures specified in its inheritance
+tree.  This is a C++ object model thing.  Ns-3 provides a base class from 
+which the class in question can inherit and be promoted to the status of
+@code{Object}.  Once a class becomes an @code{Object} it has inherited the
+ability to aggregate and search for other @code{Objects} that are added to
+its aggregation.
 
-That last detail is important.  In @command{ns-3} Interfaces are both
-containers and specifications for object method access.  We have previously
-mentioned the @code{Node} class acts as a container.  In fact, the @code{Node}
-class inherits from @code{Object} and is itself also an @command{ns-3}
-Interface.  When the @code{Node} object is created it is really an aggregation
-of one Interface, the @code{Node} Interface.  This is generally true ---
-Interfaces are both containers and Interfaces.
+That last detail is important.  In @command{ns-3} @code{Object}s are both
+containers and specifications for a object method access.  We have previously
+mentioned that the @code{Node} class acts as a container.  In fact, the 
+@code{Node} class inherits from @code{Object} and is itself an @command{ns-3} 
+@code{Object}.  So, when the @code{Node} object is created it is really an 
+aggregation of one @code{Object} and you can call @code{AggregateObject} or
+@code{GetObject} on the resulting @code{Node} object.  Along with being an
+aggregation, the @code{Node} class also describes a public interface.  THis
+public interface (API) is declared just as any C++ object is declared, via its
+class methods as specified in the inheritance tree.  For those steeped in 
+COM or CORBA, this is where the concept of Interface works in @command{ns-3}.
+Remember that it is generally true that @code{Object}s are both aggregations
+and APIs.
 
 @subsection Aggregations
-The figure below shows how an Interface could be illustrated in detail.  The 
-line with the circle at the top of the diagram represents the appearance of the
-Interface to the external world.  This circle and line are called a lollipop
-because of its superficial similarity to a kind of childs candy.  
+The figure below shows how an @code{Object} could be illustrated in detail.
+The line with the circle at the top of the diagram represents the appearance 
+of the @code{Object} API to the external world.  This circle and line are 
+together called a lollipop because of its superficial similarity to a kind of
+childs candy.  
 
 @sp 1
 @center @image{oneif,,,,png}
 
-You could declare this interface quite simply using a non-virtual class as 
-follows,
+You could declare this API and associated @code{Object} quite simply using a
+non-virtual class as follows,
 
 @verbatim
   class A : public Object {
   public:
-    static const InterfaceId iid;
+    static ns3::TypeId GetTypeId (void)
+    {
+      static ns3::TypeId tid = ns3::TypeId ("A")
+        .SetParent (Object::GetTypeId ())
+        .AddConstructor<A> ();
+      return tid;
+    }
+
+    A () 
+    {
+    }
+
     void MethodA (void);
   };
 @end verbatim
 
 The methods that are then available via the Interface labeled @code{A} in the
-figure above are the methods inherited from the @code{Object} base class (
-@code{QueryInterface}, @code{Ref}, and @code{Unref}) and those from class 
-@code{A} (@code{MethodA}).  Note that you must declare an @code{InterfaceId}
-for your Interface class, and it must be declared static to make it class-wide
-in scope.  This @code{iid} can be thought of as a kind of type information
-that uniquely identifies objects as being instantiated from this class.
+figure above are the methods inherited from the @code{Object} base class 
+(@code{GetObject}, @code{Ref}, and @code{Unref}) and those from class 
+@code{A} (@code{MethodA}).
 
-You can think of the arc and arrow device coming off each side of the
-Interface as part of a connector.  These connectors allow @code{QueryInterface}
-to search aggregations for a particular @code{iid}.  The figure below shows an
-aggregation of three Interfaces: A, B and C.  The class declarations for 
-classes @code{B} and @code{C} are substantially similar to that of class 
-@code{A}.
+Note that you must declare a @code{TypeId} in your @code{Object} class, and
+it must be declared static to make it class-wide in scope.  This @code{TypeId}
+is a unifying element in the @command{ns-3} object model and uniquely
+identifies @code{Objects} at run-time as being instantiated from a particular
+class.  We'll have much more to say about @code{TypiId} shortly.
+
+You can think of the arc and arrow device coming off each side of the 
+illustrated @code{Object}s as part of a connector.  These connectors allow 
+@code{GetObject} to search aggregations for an instance of a class type.
+The figure below shows an aggregation of three @code{Object}s: A, B and C.
+The class declarations for classes @code{B} and @code{C} are substantially 
+similar to that of class @code{A}.
 
 @sp 1
 @center @image{threeif,,,,png}
 
-You can visualize these Interfaces as being snapped together like Lego
-building blocks if you like.  When the Interfaces are aggregated, a
-@code{QueryInterface} search path is formed through the connectors.  In order
-to create this aggregation we first need to create the Interface objects.
+You can visualize these @code{Object}s as being snapped together like Lego
+building blocks if you like.  When @code{Object}s are aggregated, a
+@code{GetObject} search path is formed through the connectors.  In order
+to create this aggregation you will first need to create the Interface objects.
 These are just normal, everyday C++ objects that we can create using the
-@code{Create} template function and manage using smart pointers.  The 
+@code{CreateObject} template function and manage using smart pointers.  The 
 following code should be obvious to you by now:
 
 @verbatim
-  Ptr<A> a = Create<A> ();
-  Ptr<B> b = Create<B> ();
-  Ptr<C> c = Create<C> ();
+  Ptr<A> a = CreateObject<A> ();
+  Ptr<B> b = CreateObject<B> ();
+  Ptr<C> c = CreateObject<C> ();
 @end verbatim
 
-When you create an aggregation, you pick one of the Interfaces to act as
-the container.  In this case well pick Interface A.  In order to aggregate
-an Interface, you simply call the method @code{AddInterface} that your class
-inherited from @code{Object}.  The following code will aggregate Interface 
-@code{B} and Interface @code{C} onto the Interface (and container) @code{A}.
+When you create an aggregation, you pick one of the @code{Object}s of the
+aggregation to think of as the container.  In this case well pick @code{Object}
+A.  In order to aggregate an @code{Object}, you simply call the method
+@code{AggregateObject} that your class has inherited from class @code{Object}.
+The following code will aggregate @code{Object B} and @code{Object C} onto
+the @code{Object} (and container/aggregation) @code{A}.
 
 @verbatim
-  a->AddInterface (b);
-  a->AddInterface (c);
+  a->AggregateObject (b);
+  a->AggregateObject (c);
 @end verbatim
 
 Thats all there is to it.  Now that you have those connectors snapped
-together, you can ask each of the Interfaces in the aggregation for any of
-the Interfaces in the aggregation.  Lets look at a simple example:
-
-@verbatim
-  Ptr<B> newB = a->QueryInterface<B> (B:iid);
-@end verbatim
-
-The left hand side of this assignment declares a smart pointer to the class
-@code{B} to help with memory management of the returned Interface pointer.
-Object lifetime management is very important when dealing with Interfaces
-and our smart pointer will simply take care of it all for you.
-
-The right hand side illustrates the basic idea of @code{QueryInterface}.  We
-take a take a (smart) pointer to Interface @code{A} and ask it to search the
-aggregation for an interface associated with an interface identifier with
-the value of @code{B:iid} which is passed as a parameter.  Recall that 
-@code{B::iid} is the @code{static InterfaceId} of the Interface class 
-@code{B}.  Observe that @code{QueryInterface} is a template function and the
-type specified in the angle brackets, here @code{<B>}, tells it what kind of 
-smart pointer to return.  In this case @code{QueryInterface} will find an
-Interface object of type @code{B::iid} in its list of Interfaces and return a
-smart pointer to @code{B} as instructed.  
-
-Now that you have those connectors snapped together, you can ask each of
-the Interfaces in the aggregation for any of the Interfaces in the
-aggregation.  For example we could walk the Interfaces asking each for the
-next in the aggregation.  First we would ask the Interface pointed to by the
-smart pointer a to look for the InterfaceId representing @code{B}:
+together, you can ask each of the @code{Object}s in the aggregation for any of
+the other @code{Object}s in the aggregation.  Lets look at a simple example:
 
 @verbatim
-  Ptr<B> newB = a->QueryInterface<B> (B:iid);
+  Ptr<B> newB = a->GetObject<B> ();
 @end verbatim
 
-Next, we can ask the Interface pointed to by the smart pointer @code{newB}
-to look for the @code{InterfaceId} representing @code{C}:
+Now, the explanation of what this snippet does is not as simple as writing it.
+The left hand side of this assignment declares a smart pointer to the class 
+@code{B} to help with memory management of the returned @code{Object} pointer.
+You should be very familiar with smart pointers at this stage of the tutorial.
 
-@verbatim
-  Ptr<C> newC = newB->QueryInterface<C> (C:iid);
-@end verbatim
+The right hand side illustrates how @code{GetObject} is acutally used.  
+The method @code{GetObject} is templated.  The assocated template parameter 
+(between the brackets) specifies the @emph{class} that is being requested.
+This is important.  Since it is the class type that specifies the search
+criteron, there can be only one instance of a particular class present in an
+aggregation.  Looking back a little, although the parameter to
+@code{AggregateObject} appears to be a vanilla C++ object (@code{b} or @code{c}
+above), it actually represents (is an instance of) a class that has an
+associated @code{TypeId} and inherits from @code{Object}.  When you call
+@code{GetObject} you specify the search criterion (using the template 
+parameter) as a class name.  This referenced class must also have an
+associated @code{TypeId} and must also have inherited from @code{Object}.
 
-Then, we can ask the Interface pointed to by the smart pointer @code{newC}
-to look for the InterfaceId representing A and complete our circuit of the 
-aggregation:
+This may be summarized by saying that @code{AggregateObject} takes an
+@emph{instance} of an object of a particular class that inherits from 
+@code{Object}. GetObject looks for a @emph{class} of a particular type
+(that again inherits from @code{Object}) and possibly returns an aggregated
+object instance of that type.
+
+Now that you have those conceptual connectors snapped together, you can ask 
+each of the @code{Object}s in the aggregation for any of the @code{Object}s
+in the aggregation.  For example we could walk the @code{Object}s asking each
+for the next in the aggregation.  First we would ask the @code{Object} pointed
+to by the smart pointer @code{a} to look for the @code{Object} @code{class B}:
 
 @verbatim
-  Ptr<A> newA = newC->QueryInterface<A> (A:iid);
+  Ptr<B> newB = a->GetObject<B> ();
+@end verbatim
+
+Next, we can ask the @code{Object} pointed to by the smart pointer @code{newB}
+to look for the @code{Object} representing @code{class C}:
+
+@verbatim
+  Ptr<C> newC = newB->GetObject<C> ();
 @end verbatim
 
-@code{QueryInterface} (often abbreviated QI) has some important properties
-that we need to go over.  Technically, QI is a @emph{symmetric}, 
-@emph{reflexive} and @emph{transitive} operation with respect to the set of
-aggregated Interfaces.
+Then, we can ask the @code{Object} pointed to by the smart pointer @code{newC}
+to look for the @code{Object} representing @code{class A} and complete our
+circuit of the aggregation:
+
+@verbatim
+  Ptr<A> newA = newC->GetObject<A> ();
+@end verbatim
+
+@code{GetObject} has some important properties that we need to go over.
+Technically, @code{GetObject} is a @emph{symmetric}, @emph{reflexive} and 
+@emph{transitive} operation with respect to the set of aggregated 
+@code{Object}s.
 
 @subsubsection Symmetry
-The symmetric nature of QI guarantees that if one performs a QI on a given
-Interface for the Interface Id of that same interface, that 
-@code{QueryInterface} must succeed.  The existence of interface A in the
-aggregation implies the reachability of Interface A in the aggregation.  This
-is usually written (by Microsoft) as,
+The symmetric nature of @code{GetObject} guarantees that if one performs a 
+@code{GetObject} on a given @code{Object} for the class of that same
+@code{Object}, that @code{GetObject} must succeed.  In other words, the
+fact that you accessed the aggregation via an instance of an @code{Object A}
+in the aggregation implies the reachability of that @code{Object} in the
+aggregation.  This is usually written (by Microsoft) as,
 
 @center must succeed (A >> A)
 
 We can illustrate this property with the code snippet,
 
 @verbatim
-  Ptr<A> symmetricA = a->QueryInterface<A> (A:iid);
+  Ptr<A> symmetricA = a->GetObject<A> ();
   NS_ASSERT (symmetricA);
 @end verbatim
 
-Here we take as given an interface (smart) pointer named a on which we
-perform a QI looking for the InterfaceId of that same Interface.  This call
-must always succeed and a smart pointer to the Interface a is returned by QI.
+Here we take as given an interface (smart) pointer --- named @code{a} --- on
+which we perform a @code{GetObject} looking for the class that represents that
+same @code{Object}.  This call must always succeed and a smart pointer to the
+aggregated instance of that class is returned.
 
 @subsubsection Reflexivity
-Calls to QI must also be reflexive.  This means that if you successfully QI
-for interface B from interface A, then you must always be able to QI for A
-from B.  This is usually written as,
+Calls to @code{GetObject} must also be reflexive.  This means that if you
+successfully @code{GetObject} for @code{Object B} from @code{Object A}, then
+you must always be able to @code{GetObject} for @code{A} from @code{B}.  This
+is usually written as,
 
 @center must succeed (A >> B, then B >> A)
 
 This property can be illustrated with the code snippet,
 
 @verbatim
-  Ptr<B> b = a->QueryInterface<B> (B:iid);
-  Ptr<A> reflexiveA = b->QueryInterface<A> (A:iid);
+  Ptr<B> b = a->GetObject<B> ();
+  Ptr<A> reflexiveA = b->GetObject<A> ();
   NS_ASSERT (reflexiveA);
 @end verbatim
 
-If the first @code{QueryInterface} on Interface A looking for Interface B 
-succeeds, then a @code{QueryInterface} on Interface B looking for Interface A 
+If the first @code{GetObject} on @code{Object A} looking for @code{Object B} 
+succeeds, then a @code{GetObject} on @code{Object B} looking @code{Object A} 
 must succeed.
 
 @subsubsection Transitivity
-@code{QueryInteface} must also be transitive.  This means that if one can
-find Interface B from Interface A, and Interface C from Interface B, then one
-must also be able to find interface C from Interface A.  This is usually
-written as,
+@code{GetObject} must also be transitive.  This means that if one can
+find @code{Object B} from @code{Object A}, and @code{Object C} from
+@code{Object B}, then one must also be able to find @code{Object C} from
+@code{Object A}.  This is usually written as,
 
 @center must succeed (A >> B, and B >> C, then A >> C)
 
 This property can be illustrated with the code snippet,
 
 @verbatim
-  Ptr<B> b = a->QueryInterface<B> (B:iid);
-  Ptr<C> c = b->QueryInterface<C> (C:iid);
-  Ptr<C> transitiveC = a->QueryInterface<C> (C:iid);
+  Ptr<B> b = a->GetObject<B> ();
+  Ptr<C> c = b->GetObject<C> ();
+  Ptr<C> transitiveC = a->GetObject<C> ();
   NS_ASSERT (transitiveC);
 @end verbatim
 
-If you can get to Interface B from Interface A, and you can get to Interface C
-from Interface B, then a QueryInterface on Interface A looking for Interface C
-must also succeed.
+If you can get to @code{Object B} from @code{Object A}, and you can get to
+@code{Object C} from @code{Object B}, then a @code{GetObject} on
+@code{Object A} looking for @code{Object C} must also succeed.
+
+@subsection Creating the TypeId
+The final piece of this puzzle is the @code{TypeId}.  Recall that the
+declaration our eample object above included the following code
+
+@verbatim
+  static ns3::TypeId GetTypeId (void)
+  {
+    static ns3::TypeId tid = ns3::TypeId ("A")
+      .SetParent (Object::GetTypeId ())
+      .AddConstructor<A> ();
+    return tid;
+  }
+@end verbatim
 
-@subsection Creating the InterfaceId
-The final piece of this puzzle is to locate where the interface Ids actually
-come from.  The answer is from a static initializer that must be located in 
-the @code{.cc} file corresponding to the Interface.  For example, to 
-initialize the Interface Id for the class A above, you would simply add the
-following code to the source file that implements class A,
+This is the bit of code that ties this all together.  For those unfamiliar
+with the idioms involved, this declaration can be rather dense.  First, let's
+examine the function declaration itself.  The following code,
+
+@verbatim
+  static ns3::TypeId GetTypeId (void) ...
+@end verbatim
+
+declares a function that will be associated with all of the instances of the
+given class.  This is a function, not a method, in that it can be accessed 
+without a @emph{this} pointer; but it is associated with the class in a 
+namespace sense.  The use of this kind of declaration allows one to write,
+
+@verbatim
+  return A::GetTypeId (void);
+@end verbatim
+
+if the @code{TypeId} is needed for our @code{class A}.  More generically the
+class name can be substituted in a template, as is done deep in the 
+@command{ns-3} object system. 
+
+From this perspective, if you leave out the middle of the function definition,
+the boundaries should make sense to you.
 
 @verbatim
-  const InterfaceId A::iid = 
-    MakeInterfaceId (``A'', Object::iid);
+  static ns3::TypeId GetTypeId (void)
+  {
+    return tid;
+  }
+@end verbatim
+
+You are obviously looking at a global function associated with your class
+that simply returns a @code{TypeId}.  Now, what about the rest.  The code
+
+@verbatim
+    static ns3::TypeId tid = ns3::TypeId ("A")
+      .SetParent (Object::GetTypeId ())
+      .AddConstructor<A> ();
+@end verbatim
+
+when found inside the function declaration is called a function-local variable
+with associated initialization.  It'll be easier to pick this statement apart
+piece by piece as well.  The first line,
+
+@verbatim
+    static ns3::TypeId tid = ...
+@end verbatim
+
+is the declaration of the function-local variable tid.  This is essentially 
+an initialized global variable, the scope of which has been reduced to within
+the enclosing method.  You can think of this as a kind of global variable
+that can only be accessed right there where it is created.  If the variable
+is initialized, this amounts to the same behavior as if a global static 
+initializer was declared in a namespace of the same name as your class.  
+Global static initializers are guaranteed by the C++ language definition to
+be executed before your main procedure is entered.  So are function-local
+variables.
+
+The variable that is being initialized is of type @code{ns3::TypeId}, is 
+named @code{A::tid} since it is inside the class declaration for 
+@code{class A}, and is initialized by a call to the constructor for the class
+@code{TypeId}.  The constructor for @code{TypeId} takes a @code{std::string}
+that can be used to locate the type information for your class.  We usually
+privide the class name as the string.
+
+Hopefully, this much of the declaration is now clear:
+
+@verbatim
+  static ns3::TypeId GetTypeId (void)
+  {
+    static ns3::TypeId tid = ns3::TypeId ("A")
+    ...
+    return tid;
+  }
 @end verbatim
 
-This code is guaranteed by the C++ language definition to be executed before
-your main procedure is entered.  The call to MakeInterfaceId will assign a
-process-local unique identifier to your class and associate your interface
-with the name (string) ``A.''  This allows you to look up an InterfaceId by
-a human readable string.
+All that is left now are the lines including @code{SetParent} and
+@code{AddConstructor}.
+
+@verbatim
+  static ns3::TypeId tid = ns3::TypeId ("A")
+    .SetParent (Object::GetTypeId ())
+    .AddConstructor<A> ();
+@end verbatim
+
+The last bit may seem quite odd at first glance, but don't let the way the
+code is broken up over several lines throw you.  If you saw something like,
+
+@verbatim
+  pointer->TypeId()->SetParent()->AddConstructor();
+@end verbatim
+
+you probably wouldn't hesitate at all.  Clearly, you would think, a method
+called @code{TypeId} is called using the pointer called @code{pointer} as 
+shown below.
 
-An advanced ns-3 specific feature of QueryInterface is exposed here.  
-@code{MakeInterfaceId} takes an @code{InterfaceId} as a parameter.  This is
-the @code{iid} of the base class from which you inherited.  In most cases
-this will be @code{Object::iid}, which is the @code{InterfaceId} of the
-@code{Object} base class.  In @command{ns-3}, the @code{Object} base class
-has its own @code{iid} and you can QI for that @code{iid}.  The @code{Object}
-base class has a rough equivalence to the @emph{IUnknown} Interface in
-Microsofts COM, so you can QI for @code{Object::iid} in @command{ns-3}f just
-as you might QI for IID_IUnknown in COM.
+@verbatim
+  pointer->TypeId()
+@end verbatim
+
+The method @code{TypeId} must further return a pointer to an object that has
+a method called @code{SetParent}.  Just as clearly, @code{SetParent} must
+return a pointer to an object that has a method called @code{AddConstructor}.
+The same sort of thing is happening in our code snipped, except we are using
+references instead of pointers.  Perhaps if we rearrange this code to live on
+one line it will be clearer.
 
-The InterfaceId you pass to @code{MakeInterfaceId} is used to create an
-inheritance tree in the ns-3 interface manager.  This inheritance tree is also
-walked in @code{QueryInterface} Interface searches.  Consider a simple case
-of a base class and a derived class as shown below,
+@verbatim
+  ns3::TypeId ("A").SetParent (Object::GetTypeId ()).AddConstructor<A> ();
+@end verbatim
+
+It's just a string of method calls.  The remaining question is then, what do
+those three methods do.
+
+The first, @code{ns3::TypeId ("A")}, simply allocates a new type in the system
+and allows you to refer to it in the future by a string.  We have mentioned
+inheritance trees often in the previous discussion.  The second method,
+@code{SetParent} associates the class being defined with its parents in the
+tree.  Finally, the @code{AddConstructor} method allows you to specify a 
+constructor to be used when an instance of your class is created using
+@code{CreateObject}.  
 
 @verbatim
-  class Base : public Object
+  AddConstructor<A> ();
+@end verbatim
+
+You can interpret this as explaining to the @command{ns-3} object ssytem that
+you have a constructor named @code{A::A} which takes no parameters.  You are
+saying that this constructor should be used when @code{CreateObject} is called
+with no parameters.
+
+By including the structure of the inheritance tree, in @command{ns-3} we can
+use implementation inheritance to easily create new @code{Objects}.  You are
+prevented from doing so in Microsoft COM, but this was almost universally
+identified as a problem.
+
+@subsection A Very Real Example
+At this point you may be asking yourself what the point of all of this is,
+since you already had those pointers laying around when you created the
+objects.  The typical case is that one will create and aggregate some number
+of @code{Object}s in a constructor and return only a pointer to a single
+@code{Object} as in our canonical example with @code{class Node}.  In this
+case, the @code{Node} would be created and the @code{Node} constructor might
+create and call @code{AggregateObject} to aggregate the @code{Object}s for
+internetwork routing and TCP/IP.  From an external point of view, these 
+aggregated objects may be discovered at run-time using @code{GetObject}.
+
+Generally one tends to think of one of the @code{Object}s in the aggregation
+as being the container and other @code{Objects} being aggregated to that
+container.  In the case of a Node, for example, it is quite natural to think
+of the Node as being the container which contains protocol stacks, internet
+routing, etc.  So, lets start thinking about a real example by calling the 
+container @code{Object Node} instead of @code{A} as we have been.  The 
+creation of this @code<Object> is found all over our example programs.  For 
+example, you will find code like the following in 
+@code{samples/simple-point-to-point.cc}:
+
+@verbatim
+  Ptr<Node> n = CreateObject<InternetNode> ();
+@end verbatim
+
+It may appear obvious to you now that the @code{InternetNode} class name
+provided to the template function @code{CreateObject} means that 
+@code{InternetNode} is an @command{ns-3} @code{Object} and you will be able to
+call @code{GetObject} on the resulting smart pointer.  Well, I'm afraid that's
+not entirely true.  It's slightly more complicated.
+
+Take a look at @code{src/internet-node/internet-node.h} and find the class
+declaration for @code{InternetNode}.
+
+@verbatim
+  class InternetNode : public Node
   {
   public:
-    static const InterfaceId iid;
-    ...
-  };
-
-  class Derived : public Base
-  {
-  public:
-    static const InterfaceId iid;
+    InternetNode();
     ...
   };
 @end verbatim
 
-To assign the InterfaceId for each of these classes, we could add two calls
-to @code{MakeInterfaceId} reflecting the class hierarchy we just created.
-
-@verbatim
-  const InterfaceId Base::iid = 
-    MakeInterfaceId (``Base'', Object::iid);
-
-  const InterfaceId Derived::iid = 
-    MakeInterfaceId (``Derived'', Base::iid);
-@end verbatim
-
-The first Interface is shown to inherit from class @code{Object} and the
-second inherits from class @code{Base}.  We could create these interfaces
-as we usually do,
-
-@verbatim
-Ptr<Base> base = Create<Base> ();
-Ptr<Derived> derived = Create<Derived> ();
-@end verbatim
-
-The derived and base @code{InterfaceIds} are either present or not present
-based on the inheritance tree.  For example, a QI for the @code{Base
-InterfaceId} must succeed when done against a @code{Ptr<Base>}; but a QI for
-the @code{Derived InterfaceId} must fail when done against a @code{Ptr<Base>}.
-However, a QI for the @code{Base InterfaceId} must succeed when done against a
-@code{Ptr<Derived>}; and a QI for the @code{Derived InterfaceId} must succeed
-when done against a @code{Ptr<Derived>}.
+There is no declaration of a @code{static TypeId GetTypeId (void)} in this
+class.  This means that the @code{InternetNode} is really not an @code{Object}
+for which you can @code{GetObject}.  It turns out that the @code{InternetNode}
+is an @emph{implementation class} of the @code{Node Object}.
 
-This feature allows you to use implementation inheritance to easily create
-new Interfaces.  You are prevented from doing so in Microsoft COM, but this
-was almost universally identified as a problem.
-
-@subsection A Real Example
-At this point you may be asking yourself what the point of all of this is,
-since you already had those pointers laying around when you created the
-objects.  The typical case is that you would forget about the pointers to the
-contained objects and only export a single Interface.  Other Interfaces could
-be discovered using QI.
-
-Generally one tends to think of one of the Interfaces in the aggregation
-as being the container and other Interfaces being aggregated to that
-container.  In the case of a Node, for example, it is quite natural to think
-of the Node as being the container which contains Interfaces for the protocol
-stacks, internet routing, etc.  So, lets start developing an example by
-calling the container Interface Node instead of A.  The creation of this
-Interface is found all over our example programs.  For example, you will 
-find code like the following in @code{samples/simple-point-to-point.cc}:
-
-@verbatim
-  Ptr<Node> n = Create<InternetNode> ();
-@end verbatim
-
-This code is described in detail in previous sections, but the important thing
-to realize here is that the resulting @code{Node} is an @command{ns-3}
-Interface.  This is not at all obvious -- you must look at the source code to
-see that this is true.  Take a look at @code{src/node/node.h} and find the
-class declaration for class @code{Node}.  There you will find,
+You may recall that there can be an implicit cast in a smart pointer
+assignment if the cast is to a visible, unambiguous base class.  That is, in 
+fact, what is happening here.  Now, take a look at @code{src/node/node.h} and
+find the class declaration for @code{class Node}.  There you will find,
 
 @verbatim
   class Node : public Object
   {
   public:
-    static const InterfaceId iid;
+    static TypeId GetTypeId (void);
     ...
   };
 @end verbatim
 
-Class @code{Node} inherits from class @code{Object} and provides an
-@code{InterfaceId}, therefore it is an @command{ns-3} interface.  You now 
-know you can use @code{AddInterface} for aggregation and @code{QueryInterface}
-for Interface discovery against any @code{Node} in the system.
+Class @code{InternetNode} inherits from class @code{Node} that, in turn,
+inherits from class @code{Object}.  It is @code{Node} that provides a
+@code{GetTypeId} method.  Therefore it is @code{Node} that is an 
+@command{ns-3} @code{Object}.  Note well that @code{InternetNode} is not an
+@code{Object} in the sense that one should call @code{GetObject} on an 
+aggregation looking for an @code{InternetNode} class.  That is, you should not
+do,
+
+@verbatim
+  Ptr<InternetNode> i = node->GetObject<InternetNode> ();
+@end verbatim
+
+since there really is not InternetNode::GetTypeId.  It is @code{Node} that is 
+the @emph{proper} @code{Object} in this case and you should view 
+@code{InternetNode} as an implementation of the @code{Node Object}.  This may
+become clearer as we look a little deeper.
 
 We spoke of a protocol stack that is aggregated to a @code{Node} in our
 discussions above, what we see in the real @command{ns-3} code is that this
-is represented by the @code{Ipv4} Interface.  If you look in 
+is represented by the @code{Ipv4 Object}.  If you look in 
 @code{src/node/ipv4.h} you will find,
 
 @verbatim
   class Ipv4 : public Object
   {
   public:
-    static const InterfaceId iid;
+    static TypeId GetTypeId (void);
     ...
   };
 @end verbatim
 
 Since class @code{Ipv4} inherits from class @code{Object} and has a 
-@code{static InterfaceId}, it is an @command{ns-3} Interface.  If you look in
+@code{GetTypeId}, it is an @command{ns-3} @code{Object}.  If you look in
 @code{src/node/ipv4.cc} you will find,
 
 @verbatim
-  const InterfaceId Ipv4::iid = 
-    MakeInterfaceId (``Ipv4'', Object::iid);
+TypeId
+Ipv4::GetTypeId (void)
+{
+  static TypeId tid = TypeId ("Ipv4")
+    .SetParent<Object> ();
+  return tid;
+}
 @end verbatim
 
-After all of this reading you now know that this code snippet is asking the
-system to create a unique @code{InterfaceId} for the @code{Ipv4} class and
-declares that @code{Ipv4} inherits from class @code{Object}.
+After all of this reading you know that this code snippet is asking the
+system to create a unique @code{TypeId} for the @code{Ipv4} class and
+declares that @code{Ipv4} inherits from class @code{Object}.  This is what
+makes an @code{Ipv4} an @code{Object}.
 
 It turns out that the Ipv4 class is an abstract base class (ABC).  There are
 a number of pure virtual methods declared in that class.  This means that
-an @code{Ipv4} object may not be instantiated.  What is instantiated is an
-implementation class, called @code{Ipv4Impl}.  This class inherits from
-@code{Ipv4} and provides the required virtual methods.  This is where
-understanding what is an Interface and what is not gets tricky.  The 
-Interface is the @code{Ipv4} class since that is where the @code{InterfaceId}
-is found.  The fact that you see @code{ipv4::iid} tells you that the
-@code{Ipv4} class is the Interface and has the associated @code{InterfaceId}.
+an @code{Ipv4} object may not be instantiated.  This is reflected by the fact
+that there are no constructors registered in the @code{GetTypeId} method above.
+What is instantiated in the real system is an implementation class, called 
+@code{Ipv4Impl}.  This class inherits from @code{Ipv4} and provides the 
+required virtual methods.  This is where understanding what is an 
+@code{Object} and what is not can get tricky.  The @code{Object} is the 
+@code{Ipv4} class since that is where the @code{GetTypeId} is found.  The fact
+that you see @code{GetTypeId} there tells you that the @code{Ipv4} class is
+the class for which you can @code{GetObject}.
+
 The class @code{Ipv4Impl} provides an implementation for the pure virtual
 methods in @code{Ipv4}.  Since class @code{Ipv4} cannot be instantiated, one
-instantiates the @code{Ipv4Impl} class to create an @code{Ipv4} Interface.
-Once the @code{Ipv4Impl} class is instantiated, the pointer to it is
+instantiates the @code{Ipv4Impl} class to create an @code{Ipv4} @code{Object}.
+You will use the @code{CreateObject} template function to create an object that
+implements the methods of an @code{Object}.  You can probably see how this
+gets even more tricky in conversation.
+
+Once the @code{Ipv4Impl} object is instantiated, the resulting pointer is
 immediately cast to an @code{Ipv4} pointer.  Clients will then use the
-@code{Ipv4} object access methods (see @code{ipv4.h}) to talk to the
-@code{Ipv4Impl} object over the @code{Ipv4} Interface.  I urge you to not go
-any further until you thoroughly understand what youve just read.
+methods specified in the @code{Ipv4} class to access the @code{Ipv4 Object}
+methods which are, in turn, implemented in the @code{Ipv4Impl} object.
 
 If you now look in the file, @code{src/internet-node/internet-node.cc} you
 will see the following code in @code{InternetNode::Construct} that creates the
-@code{Ipv4} Interface and aggregates it to the @code{Node} interface (recall
-that class @code{Node} is an Interface and class @code{InternetNode} inherits
-from class @code{Node}):
+@code{Ipv4} Interface and aggregates it.
 
 @verbatim
-  Ptr<Ipv4Impl> ipv4Impl = Create<Ipv4Impl> (ipv4);
+  Ptr<Ipv4Impl> ipv4Impl = CreateObject<Ipv4Impl> (ipv4);
   ...
-  Object::AddInterface (ipv4Impl);
+  Object::AggregateObject (ipv4Impl);
 @end verbatim
 
-Note that the parameter @code{ipv4} passed to the @code{Create} template
+Note that the parameter @code{ipv4} passed to the @code{CreateObject} template
 function is actually a pointer to an @code{Ipv4L3Protocol} which you can
 ignore at this point --- it doesn't really have anything to do with the 
 @code{Ipv4} Interface.
 
-This last example does illustrate that the fact that whether an @command{ns-3}
-object is or is not an Interface can be quite well hidden.  The designers of
-the system had long and involved discussions on this issue and in the end
-decided that mnemonic aids such as Hungarian notation were a stylistic thing
-and you should just refer to the system documentation to determine what
-objects are ns-3 Interfaces and what those Interfaces actually are (RTFM ---
-Read the Fine Manual).
+This is exactly the same thing that is happening in the case of the 
+@code{InternetNode}.
+
+@verbatim
+  Ptr<Node> n = CreateObject<InternetNode> ();
+@end verbatim
 
-In this case, you know that the class @code{Ipv4Impl} inherits from some
-Interface since there is a call to @code{AddInterface} that refers to it.
-You can go to the header file @code{src/internet-node/ipv4-impl.h} and find
-that @code{Ipv4Impl} inherits from class @code{Ipv4}.  You then go to file
-@code{src/node/ipv4.h} and see that it inherits from @code{Object} and
-contains an @code{InterfaceId}.  Thus the Interface added is really the 
-@code{Ipv4} Interface with the interface Id @code{Ipv4::iid}.
+@code{CreateObject} is being called to create an implementation object,
+in this case @code{InternetNode}, which implements the methods of the 
+@code{Node Object}.  It is the resulting @code{Node Object} which you would
+use as the container and it is the @code{Node} class that you would use as
+the template parameter when calling @code{GetObject}.  In the same way, you
+would @emph{not} want to do,
 
-Returning to some @command{ns-3} example code, lets take a look at 
-@code{src/examples/simple-point-to-point.cc} again.  You will find the 
-following code:
+@verbatim
+  Ptr<Ipv4> ipv4 = node->GetObject<Ipv4Impl> ();
+@end verbatim
+
+Rather you should understand that the @emph{proper} @code{Object} is the 
+@code{Ipv4} not the @code{Ipv4Impl} and do the following,
 
 @verbatim
-  Ptr<Node> n0 = Create<InternetNode> ();
+  Ptr<Ipv4> ipv4 = node->GetObject<Ipv4> ();
+@end verbatim
+
+This does illustrate that the fact that whether an object created by 
+@code{CreateObject} is or is not an @code{Object} in the usual sense can be
+quite well hidden if you are casually looking at the object creation code.
+The designers of the system had long and involved discussions on this issue 
+and in the end decided that mnemonic aids such as Hungarian notation were a
+stylistic thing and you should just refer to the system documentation to
+determine what objects are @command{ns-3} @code{Object}s and what the APIs 
+of those @code{Object}s actually are (RTFM --- as in Read the Fine Manual, 
+of course).
+
+In the case of @code{Ipv4Impl}, you know that the class inherits somehow 
+from @code{Object} since there is a call to @code{AggregateObject} that
+refers to an instance of an @code{Ipv4Impl}.  You will have to go to
+the header file @code{src/internet-node/ipv4-impl.h} and find that
+@code{Ipv4Impl} inherits from class @code{Ipv4}.  You will then have go to
+the file @code{src/node/ipv4.h} and see that it inherits from @code{Object} and
+defines a @code{GetTypeId}.  Thus the @code{Object} for which you can
+@code{GetObject} is really the @code{Ipv4 Object}.
+
+Returning to some real @command{ns-3} example code, lets take a look at 
+@code{examples/simple-point-to-point.cc}.  You will find the following
+code in this file:
+
+@verbatim
+  Ptr<Node> n0 = CreateObject<InternetNode> ();
   ...
   Ptr<Ipv4> ipv4;
-  ipv4 = n0->QueryInterface<Ipv4> (Ipv4::iid);
+  ipv4 = n0->GetObject<Ipv4> ();
   ipv4->SetDefaultRoute (Ipv4Address (``10.1.1.2''), 1);
 @end verbatim
 
-The first line creates an @code{InternetNode} object and casts the resulting
-smart pointer to a @code{Node}.  The next line declares a smart pointer to an
-@code{Ipv4} object.  Because youve been through the code with us, you know
-that both the @code{Node} and the @code{Ipv4} objects are Interfaces.  They 
-should be able to participate in a @code{QueryInterface}.
-
-The next line confirms it.  We do a @code{QueryInterface} on the @code{Node},
-looking for the @code{Ipv4} Interface (@code{Ipv4::iid}).  
-@code{QueryInterface} then returns a smart pointer to its aggregated 
-@code{Ipv4} Interface.  [Recall that this Interface was aggregated in
-@code{InternetNode::Construct}.  We knew to start looking for the aggregation
-in @code{InternetNode} since we originally created an @code{InternetNode} in 
-the @code{Create} template function and then implicitly cast it to a 
-@code{Node}.]
-
-Once you have the @code{Ipv4} smart pointer, you simply use it as if it were
-any other C++ object.  The last line shows this by setting the default route 
-for the node.
+The first line creates an @code{InternetNode} implementation object and casts
+the resulting smart pointer to a @code{Node} as we have discussed extensively.
+The next line shown declares a smart pointer to an @code{Ipv4 Object}.  We
+then do a @code{GetObject} on the @code{Node} looking for the 
+@code{Ipv4 Object}.  You know since you've read every line of this tutorial
+in detail exactly how that @code{Ipv4 Object} got into every @code{Node}.  You
+know that the @code{GetObject} will return a smart pointer to its aggregated 
+@code{Ipv4} Interface.  Once we have the @code{Ipv4} smart pointer, we simply
+use it as if it were any other C++ object.  The last line shows this by
+setting the default route for the node.
 
 @section Caveats
 There are a few things that you should remember but which may not be 
 immediately obvious.  
 
-@subsection Interface Ids are Associated with Classes not Objects
-Interfaces are identified by an @code{InterfaceId} that is associated with
-the Interface class, not the Interface object.  That is indicated by the
-@code{static} keyword in the declaration of the @code{iid} in the class.  The
-interface Id for a given Interface class exists independently of any objects
-of that class that you may instantiate; and all objects of a given Interface
-type share the same @code{InterfaceId}.
+@subsection Ns-3 Objects are Associated with Classes not C++ objects
+Okay, you can see some of the problems with the terminology popping up again.
+We are reminding you that when you do a GetObject you are providing the key
+to the lookup by giving a class name and not anything that is unique to a
+C++ object.
 
-You cannot add more than one Interface of a given type (@code{iid}) to an
-aggregation.  If you need to contain a number of Interfaces of the same type
-in the same aggregation, you will need to provide a separate container over
-which you can iterate.  For example, the @code{Node} class provides methods,
+You cannot add more than one @code{Object} of a given type (class name) to an
+aggregation.  If you need to contain a number of @code{Object}s of the same
+type in the same aggregation, you will need to provide a separate container 
+over which you can iterate.  For example, the @code{Node} class provides 
+methods,
 
 @verbatim
   uint32_t GetNDevices (void) const;
   Ptr<NetDevice> GetDevice (uint32_t index) const;
 @end verbatim
 
-that are used iterate over the multiple @code{NetDevice} Interfaces associated
-with it.
+that are used iterate over the multiple @code{NetDevice} @code{Object}s
+associated with it.
 
-@emph{Interface Ids do not identify objects.}
+@emph{Remember:  Object types do not identify objects.}
 
 @subsection Dont use QI to Check Your Own Type.
-It is tempting to use @code{QueryInterface} as a form of runtime type
-information.  Dont do it.  You have no control over what other object may be
-added to your aggregation and this may cause problems.  Someone else may have
-appropriated (reimplemented) your type and aggregated themselves onto your 
+It is tempting to use @code{GetObject} as a form of runtime type
+information.  Dont do it.  You have no control over what @emph{other}
+object may be added to your aggregation.  Someone else may have
+appropriated (reimplemented) your type and aggregated themselves onto the
 aggregation.
 
 Consider a socket factory implementation.  Sockets can be either UDP sockets
 or TCP sockets.  A socket factory will have a generic @code{SocketFactory}
-Interface and either a UDP specific interface for setting UDP parameters or a
+Object and either a UDP specific interface for setting UDP parameters or a
 similar TCP-specific interface.
 
 Consider what might happen if you declared your socket factory as a partially
 abstract base class, and then provided separate implementations for UDP and
 TCP specific methods of this factory in separate concrete classes.  Now 
-consider what might happen if you used QueryInterface in your base class
+consider what might happen if you used @code{GetObject} in your base class
 to determine if you were a UDP or a TCP factory.
 
-If a factory, say the UDP version, were not aggregated to any other Interface,
-the base class could QueryInterface on itself for the UDP-specific interface.
-It could then infer that it was a UDP implementation and would then do any 
-UDP-specific tasks it could.  [Experienced C++ folks are cringing about how
+If a factory, say the UDP version, were not aggregated to any other 
+@code{Object}, the base class could @code{GetObject} on itself for the 
+UDP-specific class name.  If the @code{GetObject} succeeded, it could then
+infer that it was a UDP implementation and would then do any UDP-specific
+tasks it could.  [Experienced C++ folks are cringing about how
 horrible this design is, but bear with me --- its a simple illustration of 
 a specific and perhaps not-too-obvious problem.]
 
 If another factory, say the TCP version, were not aggregated to any other
-Interface, the base class could QueryInterface on itself for the UDP-specific
+Interface, the base class could @code{GetObject} on itself for the UDP-specific
 interface.  If this failed, it could then infer that it had a TCP
 implementation and would then do any TCP-specific tasks it could.
 
-Now, what happens when these two working objects are aggregated together.
-Since the Interfaces are conceptually snapped together the TCP implementation
-would suddenly begin finding the UDP Interface from the other class factory
-and fail.
+Now, what happens when these two working objects are aggregated together by
+some innocent end-user.  Since the @code{Object}s are conceptually snapped
+together, the TCP implementation would suddenly begin finding the UDP 
+Interface from the other class factory and think it was the UPD implementation.
 
-@emph{Interface Ids should not be used as run-time type information.}
+@emph{Objects should not be used as run-time type information.}
 
 @section Connecting the Dots
 This may all sound very complicated to you if this is your first exposure to
 these concepts.  It may be annoying if I tell you that its really not as hard
 as it sounds.  Rest assured that if you take some time, look at and understand
 the examples and write a little test code it will all come together for you.
-Grep around the system for AddInterface and QueryInterface and take a look at
-how we have used them.  This will also give you a good idea of what our core
-Interfaces are.  If you grep for @code{::iid} you will find most, if not all
-of the interface declarations in the system.  The more you see this idiom in
+Grep around the system for @code{AggregateObject} and @code{GetObject} and
+take a look at how we have used them.  This will also give you a good idea of
+what our core @code{Object}s and associated APIs are.  If you grep for 
+@code{GetTypeId} you will find most, if not all of the @code{Object} API
+interface declarations in the system.  The more you see this idiom in
 use, the more comfortable you will be with the idea and the more you will see
 how this addresses the weak base class, swiss army knife base class, and
 fragile base class problems I explained at the beginning.
 
 As I alluded to earlier, the developers had long discussions regarding how to
-make navigating the QueryInterface environment easier.  The primary issue was
+make navigating the @code{Object} environment easier.  The primary issue was
 how we could make it easier to convey to you, the model writer, that an object
-was an Interface.  One suggestion was to adopt the convention that classes
-that implement Interfaces begin with the letter I.  Microsoft does this, as
-exemplified by the class IUnknown.  We also toyed with the idea of beginning
-our header files with i- as in i-ipv4.h. We considered forcing some structure
-on Interfaces with a pure virtual class specification, the names of which
-begin with an I; and corresponding implementations, the names of which begin
-with a C.
+was an @code{Object}.  We originally used similar terminology as Microsoft
+COM and used QueryInterface instead of @code{GetObject}.  One suggestion was
+to adopt the convention that classes that implemented Interfaces must begin
+with the letter I.  Microsoft does this, as exemplified by the class IUnknown.
+We also toyed with the idea of beginning our header files with ``i-'' as in 
+``i-ipv4.h.'' We considered forcing some structure on Interfaces with a pure
+virtual class specification, the names of which begin with an I; and 
+corresponding implementations, the names of which begin with a C.  This all
+got out of hand fairly quickly.
 
 In the end we decided that we were really discussing issues of programming
 style, and we really could not come up with a strong reason to impose any
-particular solution.  In the end, we decided that we would not impose any
-structure on the source code, nor impose any naming convention.  We will
-rely on our documentation system (Doxygen) to break out all objects with
-InterfaceIds in their class hierarchy into a separate section.  For now,
-until this is implemented, grep is your friend.
+particular solution.  No matter what direction we took, we ended up with some
+form of extra confusion or extra complexity somewhere in the system.  The 
+resulting system is extremely flexible and easy to use.  It is, unfortunately,
+sometimes hard to document and talk about.
+
+If it helps you to think in terms of Microsoft COM and Interfaces, by all means
+do so, just be aware that even though @command{ns-3} @code{Object}s descend
+from COM in some sense, there are subtle differences that may get you lost or
+into trouble.  So to paraphrase Feynman one more time,
+
+@quotation
+``@command{Ns-3} @code{Objects} do not behave like COM Components, or Java
+Beans, or CORBA objects, or clouds or weights on springs, or like anything 
+that you have  ever seen --- they are @command{ns-3} components.''
+@end quotation
+
+Just get very familiar with the @command{ns-3} object model.  It is the heart
+of the system and if you do not understand it you will not understand how to
+write an @command{ns-3} model properly.
 
 @c ========================================================================
 @c Doxygen
--- a/doc/tutorial/output.texi	Tue Feb 05 15:29:17 2008 -0500
+++ b/doc/tutorial/output.texi	Tue Feb 05 15:30:16 2008 -0500
@@ -108,7 +108,7 @@
 
 Try running the following program from the command line:
 @verbatim
-  ./waf --run csma-echo-ascii-trace
+  ./waf --run tutorial-csma-echo-ascii-trace
 @end verbatim
 
 @cindex tutorial.tr
@@ -391,12 +391,12 @@
 many tools available for analyzing pcap traces; below, we show how
 tcpdump and Wireshark can be used..
 
-@cindex csma-echo-ascii-trace.cc
-@cindex csma-echo-pcap-trace.cc
+@cindex tutorial-csma-echo-ascii-trace.cc
+@cindex tutorial-csma-echo-pcap-trace.cc
 The code used to enable pcap tracing is similar to that for ASCII tracing.  
-We have provided another file, @code{csma-echo-pcap-trace.cc} that uses the
-pcap trace wrapper.  We have added the code to include the pcap trace wrapper
-defintions:
+We have provided another file, @code{tutorial-csma-echo-pcap-trace.cc} that 
+uses the pcap trace wrapper.  We have added the code to include the pcap 
+trace wrapper defintions:
 
 @verbatim
   #include "ns3/pcap-trace.h"
@@ -432,7 +432,7 @@
 
 @cindex Waf
 @verbatim
-  ./waf --run csma-echo-pcap-trace
+  ./waf --run tutorial-csma-echo-pcap-trace
 @end verbatim
 
 If you look at the top level directory of your distribution, you should now
--- a/doc/tutorial/routing.texi	Tue Feb 05 15:29:17 2008 -0500
+++ b/doc/tutorial/routing.texi	Tue Feb 05 15:30:16 2008 -0500
@@ -6,7 +6,7 @@
 module, and some details about the routing approachs currently
 implemented.
 
-@node Overview
+@node Routing-Overview
 @section Overview
 
 We intend to support traditional routing approaches and protocols,
@@ -341,8 +341,8 @@
   for (Iterator i = NodeList::Begin (); i != NodeList::End (); i++)
     {
       Ptr<Node> node = *i;
-      Ptr<GlobalRouter> globalRouter = Create<GlobalRouter> (node);
-      node->AddInterface (globalRouter);
+      Ptr<GlobalRouter> globalRouter = CreateObject<GlobalRouter> (node);
+      node->AggregateObject (globalRouter);
     }
 @end verbatim
 
--- a/doc/tutorial/troubleshoot.texi	Tue Feb 05 15:29:17 2008 -0500
+++ b/doc/tutorial/troubleshoot.texi	Tue Feb 05 15:30:16 2008 -0500
@@ -66,12 +66,12 @@
 
 Let's look around line 136 of tcp-point-to-point, as gdb suggests:
 @verbatim
-  Ptr<SocketFactory> socketFactory = n2->QueryInterface<SocketFactory> (Tcp::iid);
+  Ptr<SocketFactory> socketFactory = n2->GetObject<SocketFactory> (Tcp::iid);
   Ptr<Socket> localSocket = socketFactory->CreateSocket ();
   localSocket->Bind ();
 @end verbatim
 
-The culprit here is that the return value of QueryInterface is not being
+The culprit here is that the return value of GetObject is not being
 checked and may be null.  
 
 Sometimes you may need to use the @uref{http://valgrind.org,,valgrind memory
--- a/doc/tutorial/tutorial.texi	Tue Feb 05 15:29:17 2008 -0500
+++ b/doc/tutorial/tutorial.texi	Tue Feb 05 15:30:16 2008 -0500
@@ -66,7 +66,7 @@
 @contents
 
 @ifnottex
-@node Top, Introduction, Full Table of Contents 
+@node Top, Overview, Full Table of Contents 
 @top ns-3 Tutorial (html version)
 
 For a pdf version of this tutorial, 
@@ -76,14 +76,15 @@
 @end ifnottex
 
 @menu
-* Introduction::
-Part 1:  Overview
+* Tutorial Goals::
+Part 1:  Getting Started with ns-3
 * Overview::
+* Browsing::
 * Resources::
-* The-Basics::
+* Downloading and Compiling::
 * Some-Prerequisites::
 * A-First-ns-3-Script::
-Part 2:  Details
+Part 2-:  Details
 * ns-3 Callbacks::
 * Simulation Output::
 * ns-3 routing overview::
--- a/examples/simple-point-to-point-olsr.cc	Tue Feb 05 15:29:17 2008 -0500
+++ b/examples/simple-point-to-point-olsr.cc	Tue Feb 05 15:30:16 2008 -0500
@@ -21,7 +21,7 @@
 //
 // Network topology
 //
-//  n0
+//   n0
 //     \ 5 Mb/s, 2ms
 //      \          1.5Mb/s, 10ms
 //       n2 -------------------------n3
@@ -151,13 +151,12 @@
       channel2, n2, Ipv4Address("10.1.3.1"),
       n3, Ipv4Address("10.1.3.2"));
 
-  // Finally, we add static routes.  These three steps (Channel and
-  // NetDevice creation, IP Address assignment, and routing) are 
-  // separated because there may be a need to postpone IP Address
-  // assignment (emulation) or modify to use dynamic routing
+
+  // Enable OLSR
   NS_LOG_INFO ("Enabling OLSR Routing.");
   olsr::EnableAllNodes ();
 
+
   // Create the OnOff application to send UDP datagrams of size
   // 210 bytes at a rate of 448 Kb/s
   NS_LOG_INFO ("Create Applications.");
@@ -170,7 +169,6 @@
     ConstantVariable(0));
   // Start the application
   ooff->Start(Seconds(1.0));
-  ooff->Stop (Seconds(10.0));
 
   // Create an optional packet sink to receive these packets
   Ptr<PacketSink> sink = CreateObject<PacketSink> (
@@ -179,7 +177,6 @@
     "Udp");
   // Start the sink
   sink->Start (Seconds (1.0));
-  sink->Stop (Seconds (10.0));
 
   // Create a similar flow from n3 to n1, starting at time 1.1 seconds
   ooff = CreateObject<OnOffApplication> (
@@ -189,8 +186,7 @@
     ConstantVariable(1), 
     ConstantVariable(0));
   // Start the application
-  ooff->Start(Seconds(1.1));
-  ooff->Stop (Seconds(10.0));
+  ooff->Start (Seconds(1.1));
 
   // Create a packet sink to receive these packets
   sink = CreateObject<PacketSink> (
@@ -199,17 +195,7 @@
     "Udp");
   // Start the sink
   sink->Start (Seconds (1.1));
-  sink->Stop (Seconds (10.0));
 
-  // Here, finish off packet routing configuration
-  // This will likely set by some global StaticRouting object in the future
-  NS_LOG_INFO ("Set Default Routes.");
-  Ptr<Ipv4> ipv4;
-  ipv4 = n0->GetObject<Ipv4> ();
-  ipv4->SetDefaultRoute (Ipv4Address ("10.1.1.2"), 1);
-  ipv4 = n3->GetObject<Ipv4> ();
-  ipv4->SetDefaultRoute (Ipv4Address ("10.1.3.1"), 1);
-  
   // Configure tracing of all enqueue, dequeue, and NetDevice receive events
   // Trace output will be sent to the simple-point-to-point.tr file
   NS_LOG_INFO ("Configure Tracing.");
@@ -226,8 +212,8 @@
   pcaptrace.TraceAllIp ();
 
   NS_LOG_INFO ("Run Simulation.");
-  Simulator::StopAt (Seconds (10));
-  Simulator::Run ();    
+  Simulator::StopAt (Seconds (30));
+  Simulator::Run ();
   Simulator::Destroy ();
   NS_LOG_INFO ("Done.");
 }
--- a/examples/simple-point-to-point.cc	Tue Feb 05 15:29:17 2008 -0500
+++ b/examples/simple-point-to-point.cc	Tue Feb 05 15:30:16 2008 -0500
@@ -72,29 +72,7 @@
   // Users may find it convenient to turn on explicit debugging
   // for selected modules; the below lines suggest how to do this
 #if 0 
-  LogComponentEnable ("SimplePointToPointExample", LOG_LEVEL_INFO);
-
-  LogComponentEnable("Object", LOG_LEVEL_ALL);
-  LogComponentEnable("Queue", LOG_LEVEL_ALL);
-  LogComponentEnable("DropTailQueue", LOG_LEVEL_ALL);
-  LogComponentEnable("Channel", LOG_LEVEL_ALL);
-  LogComponentEnable("CsmaChannel", LOG_LEVEL_ALL);
-  LogComponentEnable("NetDevice", LOG_LEVEL_ALL);
-  LogComponentEnable("CsmaNetDevice", LOG_LEVEL_ALL);
-  LogComponentEnable("Ipv4L3Protocol", LOG_LEVEL_ALL);
-  LogComponentEnable("PacketSocket", LOG_LEVEL_ALL);
-  LogComponentEnable("Socket", LOG_LEVEL_ALL);
-  LogComponentEnable("UdpSocket", LOG_LEVEL_ALL);
-  LogComponentEnable("UdpL4Protocol", LOG_LEVEL_ALL);
-  LogComponentEnable("Ipv4L3Protocol", LOG_LEVEL_ALL);
-  LogComponentEnable("Ipv4StaticRouting", LOG_LEVEL_ALL);
-  LogComponentEnable("Ipv4Interface", LOG_LEVEL_ALL);
-  LogComponentEnable("ArpIpv4Interface", LOG_LEVEL_ALL);
-  LogComponentEnable("Ipv4LoopbackInterface", LOG_LEVEL_ALL);
-  LogComponentEnable("OnOffApplication", LOG_LEVEL_ALL);
-  LogComponentEnable("PacketSinkApplication", LOG_LEVEL_ALL);
-  LogComponentEnable("UdpEchoClientApplication", LOG_LEVEL_ALL);
-  LogComponentEnable("UdpEchoServerApplication", LOG_LEVEL_ALL);
+  LogComponentEnable ("SimplePointToPointExample", LOG_LEVEL_ALL);
 #endif
 
   // Set up some default values for the simulation.  Use the Bind()
@@ -108,8 +86,6 @@
   DefaultValue::Bind ("OnOffApplicationPacketSize", "210");
   DefaultValue::Bind ("OnOffApplicationDataRate", "448kb/s");
 
-  //DefaultValue::Bind ("DropTailQueue::m_maxPackets", 30);   
-
   // Allow the user to override any of the defaults and the above
   // Bind()s at run-time, via command-line arguments
   CommandLine::Parse (argc, argv);
@@ -170,8 +146,7 @@
     ConstantVariable(1), 
     ConstantVariable(0));
   // Start the application
-  ooff->Start(Seconds(1.0));
-  ooff->Stop (Seconds(10.0));
+  ooff->Start (Seconds(1.0));
 
   // Create an optional packet sink to receive these packets
   Ptr<PacketSink> sink = CreateObject<PacketSink> (
@@ -180,7 +155,6 @@
     "Udp");
   // Start the sink
   sink->Start (Seconds (1.0));
-  sink->Stop (Seconds (10.0));
 
   // Create a similar flow from n3 to n1, starting at time 1.1 seconds
   ooff = CreateObject<OnOffApplication> (
@@ -191,7 +165,6 @@
     ConstantVariable(0));
   // Start the application
   ooff->Start(Seconds(1.1));
-  ooff->Stop (Seconds(10.0));
 
   // Create a packet sink to receive these packets
   sink = CreateObject<PacketSink> (
@@ -200,7 +173,27 @@
     "Udp");
   // Start the sink
   sink->Start (Seconds (1.1));
-  sink->Stop (Seconds (10.0));
+
+  // TCP
+  // Create a file transfer from n0 to n3, starting at time 1.2
+  uint16_t servPort = 500;
+
+  ooff = CreateObject<OnOffApplication> (
+    n0, 
+    InetSocketAddress ("10.1.3.2", servPort), 
+    "Tcp",
+    ConstantVariable(1), 
+    ConstantVariable(0));
+  // Start the application
+  ooff->Start (Seconds(1.2));
+  ooff->Stop (Seconds(1.35));
+
+  // Create a packet sink to receive these TCP packets
+  sink = Create<PacketSink> (
+    n3,
+    InetSocketAddress (Ipv4Address::GetAny (), servPort),
+    "Tcp");
+  sink->Start (Seconds (1.2));
 
   // Here, finish off packet routing configuration
   // This will likely set by some global StaticRouting object in the future
@@ -227,7 +220,7 @@
   pcaptrace.TraceAllIp ();
 
   NS_LOG_INFO ("Run Simulation.");
-  Simulator::StopAt (Seconds (10));
+  Simulator::StopAt (Seconds (3.0));
   Simulator::Run ();    
   Simulator::Destroy ();
   NS_LOG_INFO ("Done.");
--- a/src/applications/onoff/onoff-application.cc	Tue Feb 05 15:29:17 2008 -0500
+++ b/src/applications/onoff/onoff-application.cc	Tue Feb 05 15:30:16 2008 -0500
@@ -195,6 +195,7 @@
   NS_LOG_FUNCTION;
 
   Simulator::Cancel(m_sendEvent);
+  m_socket->Close ();
 }
 
 // Private helpers
--- a/src/internet-node/tcp-socket.cc	Tue Feb 05 15:29:17 2008 -0500
+++ b/src/internet-node/tcp-socket.cc	Tue Feb 05 15:30:16 2008 -0500
@@ -121,6 +121,7 @@
   m_node = 0;
   m_endPoint = 0;
   m_tcp = 0;
+  m_retxEvent.Cancel ();
 }
 int
 TcpSocket::FinishBind (void)
--- a/src/internet-node/udp-socket.cc	Tue Feb 05 15:29:17 2008 -0500
+++ b/src/internet-node/udp-socket.cc	Tue Feb 05 15:30:16 2008 -0500
@@ -276,15 +276,19 @@
   //
   if (dest.IsBroadcast ())
     {
-      NS_LOG_LOGIC ("Limited broadcast");
+      NS_LOG_LOGIC ("Limited broadcast start.");
       for (uint32_t i = 0; i < ipv4->GetNInterfaces (); i++ )
         {
           Ipv4Address addri = ipv4->GetAddress (i);
           Ipv4Mask maski = ipv4->GetNetworkMask (i);
-          m_udp->Send (p->Copy (), addri, addri.GetSubnetDirectedBroadcast (maski),
+          Ipv4Address bcast = addri.GetSubnetDirectedBroadcast (maski);
+          NS_LOG_LOGIC ("Sending one copy from " << addri << " to " << bcast
+                        << " (mask is " << maski << ")");
+          m_udp->Send (p->Copy (), addri, bcast,
                        m_endPoint->GetLocalPort (), port);
           NotifyDataSent (p->GetSize ());
         }
+      NS_LOG_LOGIC ("Limited broadcast end.");
     }
   else if (ipv4->GetIfIndexForDestination(dest, localIfIndex))
     {
--- a/src/node/socket.h	Tue Feb 05 15:29:17 2008 -0500
+++ b/src/node/socket.h	Tue Feb 05 15:30:16 2008 -0500
@@ -78,21 +78,24 @@
    * \param closeCompleted Callback invoked when the close operation is
    *        completed.
    */
-  void SetCloseCallback (Callback<void,Ptr<Socket> > closeCompleted);
+  void SetCloseCallback (Callback<void, Ptr<Socket> > closeCompleted);
 
   /**
-   * \param connectionSucceeded this callback is invoked when the connection request
-   *        initiated by the user is successfully completed. The callback is passed
-   *        back a pointer to the same socket object.
-   * \param connectionFailed this callback is invoked when the connection request
-   *        initiated by the user is unsuccessfully completed. The callback is passed
-   *        back a pointer to the same socket object. 
-   * \param halfClose XXX When exactly is this callback invoked ? If it invoked when the
-   *        other side closes the connection ? Or when I call Close ?
+   * \param connectionSucceeded this callback is invoked when the 
+   *        connection request initiated by the user is successfully 
+   *        completed. The callback is passed  back a pointer to 
+   *        the same socket object.
+   * \param connectionFailed this callback is invoked when the 
+   *        connection request initiated by the user is unsuccessfully 
+   *        completed. The callback is passed back a pointer to the 
+   *        same socket object. 
+   * \param halfClose XXX When exactly is this callback invoked? If 
+   *        it invoked when the other side closes the connection ? 
+   *        Or when I call Close ?
    */
   void SetConnectCallback (Callback<void, Ptr<Socket> > connectionSucceeded,
-                          Callback<void, Ptr<Socket> > connectionFailed,
-                          Callback<void, Ptr<Socket> > halfClose);
+                          Callback<void,  Ptr<Socket> > connectionFailed,
+                          Callback<void,  Ptr<Socket> > halfClose);
   /**
    * \brief Accept connection requests from remote hosts
    * \param connectionRequest Callback for connection request from peer. 
@@ -100,28 +103,31 @@
    *        ip address and the port number of the connection originator. 
    *        This callback must return true to accept the incoming connection,
    *        false otherwise. If the connection is accepted, the 
-   *        "newConnectionCreated" callback will be invoked later to give access
-   *        to the user to the socket created to match this new connection. If the
-   *        user does not explicitely specify this callback, all incoming 
-   *        connections will be refused.
+   *        "newConnectionCreated" callback will be invoked later to 
+   *        give access to the user to the socket created to match 
+   *        this new connection. If the user does not explicitly 
+   *        specify this callback, all incoming  connections will be refused.
    * \param newConnectionCreated Callback for new connection: when a new
    *        is accepted, it is created and the corresponding socket is passed
-   *        back to the user through this callback. This user callback is passed
-   *        a pointer to the new socket, and the ip address and port number
-   *        of the connection originator.
+   *        back to the user through this callback. This user callback is 
+   *        passed a pointer to the new socket, and the ip address and 
+   *        port number of the connection originator.
    * \param closeRequested Callback for connection close request from peer.
    *        XXX: when is this callback invoked ?
    */
-  void SetAcceptCallback (Callback<bool, Ptr<Socket>, const Address &> connectionRequest,
-                                 Callback<void, Ptr<Socket>, const Address&> newConnectionCreated,
-                                 Callback<void, Ptr<Socket> > closeRequested);
+  void SetAcceptCallback (Callback<bool, Ptr<Socket>, 
+                            const Address &> connectionRequest,
+                          Callback<void, Ptr<Socket>, 
+                            const Address&> newConnectionCreated,
+                          Callback<void, Ptr<Socket> > closeRequested);
   void SetSendCallback (Callback<void, Ptr<Socket>, uint32_t> dataSent);
   /**
    * \brief Receive data
    * \param receivedData Invoked whenever new data is received.
    *
    */
-  void SetRecvCallback (Callback<void, Ptr<Socket>, Ptr<Packet>,const Address&> receivedData);
+  void SetRecvCallback (Callback<void, Ptr<Socket>, Ptr<Packet>,
+                          const Address&> receivedData);
 
   /** 
    * \param address the address to try to allocate
--- a/src/routing/olsr/olsr-agent-impl.cc	Tue Feb 05 15:29:17 2008 -0500
+++ b/src/routing/olsr/olsr-agent-impl.cc	Tue Feb 05 15:30:16 2008 -0500
@@ -167,6 +167,7 @@
   m_tcTimer (Timer::CANCEL_ON_DESTROY),
   m_midTimer (Timer::CANCEL_ON_DESTROY)
 {
+  NS_LOG_DEBUG ("Created olsr::AgentImpl");
   m_helloTimer.SetFunction (&AgentImpl::HelloTimerExpire, this);
   m_tcTimer.SetFunction (&AgentImpl::TcTimerExpire, this);
   m_midTimer.SetFunction (&AgentImpl::MidTimerExpire, this);
@@ -345,6 +346,18 @@
       DuplicateTuple *duplicated = m_state.FindDuplicateTuple
         (messageHeader.GetOriginatorAddress (),
          messageHeader.GetMessageSequenceNumber ());
+
+      // Get main address of the peer, which may be different from the packet source address
+      const IfaceAssocTuple *ifaceAssoc = m_state.FindIfaceAssocTuple (inetSourceAddr.GetIpv4 ());
+      Ipv4Address peerMainAddress;
+      if (ifaceAssoc != NULL)
+        {
+          peerMainAddress = ifaceAssoc->mainAddr;
+        }
+      else
+        {
+          peerMainAddress = inetSourceAddr.GetIpv4 () ;
+        }
       
       if (duplicated == NULL)
         {
@@ -352,17 +365,17 @@
             {
             case olsr::MessageHeader::HELLO_MESSAGE:
               NS_LOG_DEBUG ("OLSR node received HELLO message of size " << messageHeader.GetSerializedSize ());
-              ProcessHello (messageHeader, m_mainAddress, inetSourceAddr.GetIpv4 ());
+              ProcessHello (messageHeader, m_mainAddress, peerMainAddress);
               break;
 
             case olsr::MessageHeader::TC_MESSAGE:
               NS_LOG_DEBUG ("OLSR node received TC message of size " << messageHeader.GetSerializedSize ());
-              ProcessTc (messageHeader, inetSourceAddr.GetIpv4 ());
+              ProcessTc (messageHeader, peerMainAddress);
               break;
 
             case olsr::MessageHeader::MID_MESSAGE:
               NS_LOG_DEBUG ("OLSR node received MID message of size " << messageHeader.GetSerializedSize ());
-              ProcessMid (messageHeader, inetSourceAddr.GetIpv4 ());
+              ProcessMid (messageHeader, peerMainAddress);
               break;
 
             default:
@@ -395,7 +408,7 @@
           // Remaining messages are also forwarded using the default algorithm.
           if (messageHeader.GetMessageType ()  != olsr::MessageHeader::HELLO_MESSAGE)
             ForwardDefault (messageHeader, duplicated,
-                            m_mainAddress, inetSourceAddr.GetIpv4 ());
+                            m_mainAddress, peerMainAddress);
         }
 	
     }
@@ -775,13 +788,13 @@
         {
           RoutingTableEntry entry;
           bool foundEntry = m_routingTable->Lookup (nb2hop_tuple.neighborMainAddr, entry);
-          if (!foundEntry)
-            NS_FATAL_ERROR ("m_routingTable->Lookup failure");
-
-          m_routingTable->AddEntry (nb2hop_tuple.twoHopNeighborAddr,
-                                    entry.nextAddr,
-                                    entry.interface,
-                                    2);
+          if (foundEntry)
+            {
+              m_routingTable->AddEntry (nb2hop_tuple.twoHopNeighborAddr,
+                                        entry.nextAddr,
+                                        entry.interface,
+                                        2);
+            }
         }
     }
   
@@ -1239,7 +1252,7 @@
             }
           if (!ok)
             {
-              NS_ASSERT (!"Link tuple has no corresponding neighbor tuple\n");
+              continue;
             }
         }
 
--- a/src/routing/olsr/routing-table.cc	Tue Feb 05 15:29:17 2008 -0500
+++ b/src/routing/olsr/routing-table.cc	Tue Feb 05 15:30:16 2008 -0500
@@ -40,6 +40,7 @@
 void
 RoutingTable::Clear ()
 {
+  NS_LOG_FUNCTION;
   m_table.clear ();
 }
 
@@ -119,7 +120,7 @@
       Ipv4Route route = Ipv4Route::CreateHostRouteTo
         (ipHeader.GetDestination (), entry2.nextAddr, entry2.interface);
 
-      NS_LOG_DEBUG ("Olsr node" << m_mainAddress
+      NS_LOG_DEBUG ("Olsr node " << m_mainAddress
                     << ": RouteRequest for dest=" << ipHeader.GetDestination ()
                     << " --> destHop=" << entry2.nextAddr
                     << " interface=" << entry2.interface);
@@ -129,9 +130,19 @@
     }
   else
     {
-      NS_LOG_DEBUG ("Olsr node" << m_mainAddress
+      NS_LOG_DEBUG ("Olsr node " << m_mainAddress
                     << ": RouteRequest for dest=" << ipHeader.GetDestination ()
-                    << " --> NOT FOUND");
+                    << " --> NOT FOUND; ** Dumping routing table...");
+#if 0
+      for (std::map<Ipv4Address, RoutingTableEntry>::const_iterator iter = m_table.begin ();
+           iter != m_table.end (); iter++)
+        {
+          NS_LOG_DEBUG ("dest=" << iter->first << " --> next=" << iter->second.nextAddr
+                        << " via interface " << iter->second.interface);
+        }
+
+      NS_LOG_DEBUG ("** Routing table dump end.");
+#endif
       return false;
     }
 }
@@ -172,6 +183,14 @@
                         uint32_t interface,
                         uint32_t distance)
 {
+  NS_LOG_PARAMS_BEGIN ();
+  NS_LOG_PARAM (this);
+  NS_LOG_PARAM (dest);
+  NS_LOG_PARAM (next);
+  NS_LOG_PARAM (interface);
+  NS_LOG_PARAM (distance);
+  NS_LOG_PARAM (m_mainAddress);
+  NS_LOG_PARAMS_END ();
   // Creates a new rt entry with specified values
   RoutingTableEntry &entry = m_table[dest];
 
@@ -187,6 +206,14 @@
                         Ipv4Address const &interfaceAddress,
                         uint32_t distance)
 {
+  NS_LOG_PARAMS_BEGIN ();
+  NS_LOG_PARAM (this);
+  NS_LOG_PARAM (dest);
+  NS_LOG_PARAM (next);
+  NS_LOG_PARAM (interfaceAddress);
+  NS_LOG_PARAM (distance);
+  NS_LOG_PARAM (m_mainAddress);
+  NS_LOG_PARAMS_END ();
   RoutingTableEntry entry;
   NS_ASSERT (m_ipv4);
   for (uint32_t i = 0; i < m_ipv4->GetNInterfaces (); i++)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tutorial/energy-model.cc	Tue Feb 05 15:30:16 2008 -0500
@@ -0,0 +1,132 @@
+/* -*-  Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
+/*
+ * Copyright (c) 2007 University of Washington
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation;
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+#include "ns3/log.h"
+#include "energy-model.h"
+
+NS_LOG_COMPONENT_DEFINE("EnergyModel");
+
+namespace ns3 {
+
+//
+// Some dimensional analysis ...
+//
+// 1 [watt] = 1 [joule] / [second]
+// 1 [watt] = 1 [volt] * 1 [amp]
+// 1 [amp] = 1 [coulomb] / 1 [second]
+// 1 [watt-second] = 1 [joule] / [second] * [second] = 1 [joule]
+//
+// A watt has dimensions of energy per second.  A watt-second has dimensions
+// of energy.
+//
+// 1 [amp-hour] = 1 [coulomb] / 1 [second] * 1 [hour]
+// 1 [amp-hour] = 1 [coulomb] / 1 [second] * 3600 [seconds]
+// 1 [amp-hour] = 3600 [amp-seconds]
+// 1 [watt-second] = 1 [amp-seconds] * 1 [volt]
+//
+// To get the energy capacity of your battery in watt-seconds from its 
+// amp-hour rating, multiply by 3600 and then the voltage.  For example, your
+// Alkaline AAA battery may be rated at 1.5 volts and 900 milli-amp-hours;
+// so the energy capacity will be .9 * 3600 * 1.5 = 4860 watt-seconds.
+//
+// In a very simple battery model, we'll take this naively to mean that this
+// battery can supply one watt continuously for 4860 seconds and then will die
+// instantaneously.
+//
+// We'll assume our transmitter is measured in watts.  When it is turned on
+// it draws some amount of power, 100 milliwatts for example.  If it transmits
+// for one second, it will suck up .1 watt-seconds of our precious energy.
+// 
+
+const InterfaceId EnergyModel::iid = 
+  MakeInterfaceId ("EnergyModel", Object::iid);
+
+
+EnergyModel::EnergyModel (
+  double ampHours, 
+  double volts,
+  double idlePower,
+  double receivePower,
+  double transmitPower)
+:
+  m_capacity (ampHours * 3600. * volts),
+  m_idlePower (idlePower),
+  m_receivePower (receivePower),
+  m_transmitPower (transmitPower),
+  m_totalTransmitPower (0.),
+  m_totalReceivePower (0.)
+{
+  NS_LOG_FUNCTION;
+  SetInterfaceId (EnergyModel::iid);
+}
+
+EnergyModel::~EnergyModel ()
+{
+  NS_LOG_FUNCTION;
+}
+
+  double
+EnergyModel::GetCapacity (Time t)
+{
+  NS_LOG_FUNCTION;
+  double c = m_capacity - m_idlePower * t.GetSeconds ();
+  return c >= 0. ? c : 0.;
+}
+
+  double
+EnergyModel::GetTotalIdlePower (Time t)
+{
+  NS_LOG_FUNCTION;
+  return m_idlePower * t.GetSeconds ();
+}
+
+  double
+EnergyModel::GetTotalReceivePower (void)
+{
+  NS_LOG_FUNCTION;
+  return m_totalReceivePower;
+}
+
+  double
+EnergyModel::GetTotalTransmitPower (void)
+{
+  NS_LOG_FUNCTION;
+  return m_totalTransmitPower;
+}
+
+  bool
+EnergyModel::DrawTransmitPower (Time t)
+{
+  NS_LOG_FUNCTION;
+  double power = m_transmitPower * t.GetSeconds ();
+  m_totalTransmitPower += power;
+  m_capacity -= power;
+  return m_capacity - m_idlePower * t.GetSeconds () >= 0. ? true : false;
+}
+
+  bool
+EnergyModel::DrawReceivePower (Time t)
+{
+  NS_LOG_FUNCTION;
+  double power = m_receivePower * t.GetSeconds ();
+  m_totalReceivePower += power;
+  m_capacity -= power;
+  return m_capacity - m_idlePower * t.GetSeconds () >= 0. ? true : false;
+}
+
+}; // namespace ns3
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tutorial/energy-model.h	Tue Feb 05 15:30:16 2008 -0500
@@ -0,0 +1,62 @@
+/* -*-  Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
+/*
+ * Copyright (c) 2007 University of Washington
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation;
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+#ifndef ENERGY_MODEL_H
+#define ENERGY_MODEL_H
+
+#include "ns3/object.h"
+#include "ns3/ptr.h"
+#include "ns3/nstime.h"
+
+namespace ns3 {
+
+class EnergyModel : public Object
+{
+public:
+  static const InterfaceId iid;
+
+  EnergyModel (
+    double ampHours, 
+    double volts,
+    double idlePower,
+    double receivePower,
+    double transmitPower);
+
+  virtual ~EnergyModel ();
+
+  double GetCapacity (Time t);
+
+  double GetTotalIdlePower (Time t);
+  double GetTotalTransmitPower (void);
+  double GetTotalReceivePower (void);
+
+  bool DrawTransmitPower (Time t);
+  bool DrawReceivePower (Time t);
+
+private:
+  double m_capacity;
+  double m_idlePower;
+  double m_receivePower;
+  double m_transmitPower;
+  double m_totalTransmitPower;
+  double m_totalReceivePower;
+};
+
+}; // namespace ns3
+
+#endif /* ENERGY_MODEL_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tutorial/energy.cc	Tue Feb 05 15:30:16 2008 -0500
@@ -0,0 +1,124 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/*
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation;
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+#include "ns3/log.h"
+#include "ns3/ptr.h"
+#include "ns3/internet-node.h"
+#include "ns3/point-to-point-channel.h"
+#include "ns3/mac48-address.h"
+#include "ns3/point-to-point-net-device.h"
+#include "ns3/point-to-point-topology.h"
+#include "ns3/udp-echo-client.h"
+#include "ns3/udp-echo-server.h"
+#include "ns3/simulator.h"
+#include "ns3/nstime.h"
+#include "ns3/ascii-trace.h"
+#include "ns3/pcap-trace.h"
+#include "ns3/global-route-manager.h"
+
+#include "energy-model.h"
+
+NS_LOG_COMPONENT_DEFINE ("EnergyModelInterfaceExample");
+
+using namespace ns3;
+
+// Network topology
+//
+//                       point to point
+//                      +--------------+
+//                      |              |
+//                     n0             n1
+//
+int 
+main (int argc, char *argv[])
+{
+  LogComponentEnable ("EnergyModelInterfaceExample", LOG_LEVEL_ALL);
+  //  LogComponentEnable ("EnergyModel", LOG_LEVEL_ALL);
+
+  NS_LOG_INFO ("Energy Model Interface Example");
+
+  NS_LOG_INFO ("Creating Nodes");
+  Ptr<Node> n0 = CreateObject<InternetNode> ();
+  Ptr<Node> n1 = CreateObject<InternetNode> ();
+
+  NS_LOG_INFO ("Creating Channel");
+  Ptr<PointToPointChannel> link = PointToPointTopology::AddPointToPointLink (
+    n0, n1, DataRate (38400), MilliSeconds (20));
+
+  PointToPointTopology::AddIpv4Addresses (link, n0, "10.1.1.1", 
+    n1, "10.1.1.2");
+
+  NS_LOG_INFO ("Creating Applications");
+  uint16_t port = 7;
+
+  Ptr<UdpEchoClient> client = CreateObject<UdpEchoClient> (n0, "10.1.1.2", 
+    port, 1, Seconds(1.), 1024);
+
+  Ptr<UdpEchoServer> server = CreateObject<UdpEchoServer> (n1, port);
+
+  server->Start(Seconds(1.));
+  client->Start(Seconds(2.));
+
+  server->Stop (Seconds(10.));
+  client->Stop (Seconds(10.));
+
+  NS_LOG_INFO ("Initializing Tracing");
+  AsciiTrace asciitrace ("energy.tr");
+  asciitrace.TraceAllQueues ();
+  asciitrace.TraceAllNetDeviceRx ();
+//  
+// Pick a battery out of the air and use some somewhat real numbers found on
+// data sheets on the web.
+//
+// 2 AAA battery (900 mAh * 2, with imaginary wireless device that uses
+// 0.350 W at idle power, 0.025 W additional during receive, and 0.2 W 
+// additional power during transmission (10 mW TX power).
+//
+  NS_LOG_INFO ("Initializing Energy Models");
+  Ptr<EnergyModel> e0 = CreateObject<EnergyModel> (1.8, 1.5, 0.35, 0.025, 0.2);
+  n0->AddInterface (e0);
+
+  Ptr<EnergyModel> e1 = CreateObject<EnergyModel> (1.8, 1.5, 0.35, 0.025, 0.2);
+  n1->AddInterface (e1);
+
+#if 0
+//
+// As simulation progresses, the battereis draw idle power.  Down in the 
+// net device, we will want to call DrawTransmitPower and DrawReceivePower
+// as required.
+//
+// This is just some example code showing how to draw power and check 
+// consumption.
+//
+  NS_LOG_INFO("Node zero energy: " << e0->GetCapacity (Seconds (0.)) << 
+    " watt-seconds");
+  NS_LOG_INFO("Node one energy: " << e1->GetCapacity (Seconds (0.)) << 
+    " watt-seconds");
+
+  e0->DrawTransmitPower (Seconds (0.1));
+  e1->DrawReceivePower (Seconds (0.1));
+  e1->DrawTransmitPower (Seconds (0.1));
+  e0->DrawReceivePower (Seconds (0.1));
+
+  NS_LOG_INFO("Node zero energy: " << e0->GetCapacity (Seconds (10.)) << 
+    " watt-seconds");
+  NS_LOG_INFO("Node one energy: " << e1->GetCapacity (Seconds (10.)) << 
+    " watt-seconds");
+#endif
+
+  Simulator::Run ();
+  Simulator::Destroy ();
+}
--- a/tutorial/tutorial-bus-network.cc	Tue Feb 05 15:29:17 2008 -0500
+++ b/tutorial/tutorial-bus-network.cc	Tue Feb 05 15:30:16 2008 -0500
@@ -41,8 +41,8 @@
   uint32_t port = 7;
 
   Ptr<Node> n0 = bus.GetNode (0);
-  Ptr<UdpEchoClient> client = CreateObject<UdpEchoClient> (n0, "10.1.0.1", port, 
-    1, Seconds(1.), 1024);
+  Ptr<UdpEchoClient> client =  CreateObject<UdpEchoClient> (n0, "10.1.0.1", 
+    port, 1, Seconds(1.), 1024);
 
   Ptr<Node> n1 = bus.GetNode (1);
   Ptr<UdpEchoServer> server = CreateObject<UdpEchoServer> (n1, port);
--- a/tutorial/tutorial-csma-echo-ascii-trace.cc	Tue Feb 05 15:29:17 2008 -0500
+++ b/tutorial/tutorial-csma-echo-ascii-trace.cc	Tue Feb 05 15:30:16 2008 -0500
@@ -66,8 +66,8 @@
 
   uint16_t port = 7;
 
-  Ptr<UdpEchoClient> client = CreateObject<UdpEchoClient> (n0, "10.1.1.2", port, 
-    1, Seconds(1.), 1024);
+  Ptr<UdpEchoClient> client = CreateObject<UdpEchoClient> (n0, "10.1.1.2", 
+    port, 1, Seconds(1.), 1024);
 
   Ptr<UdpEchoServer> server = CreateObject<UdpEchoServer> (n1, port);
 
--- a/tutorial/tutorial-csma-echo-pcap-trace.cc	Tue Feb 05 15:29:17 2008 -0500
+++ b/tutorial/tutorial-csma-echo-pcap-trace.cc	Tue Feb 05 15:30:16 2008 -0500
@@ -67,8 +67,8 @@
 
   uint16_t port = 7;
 
-  Ptr<UdpEchoClient> client = CreateObject<UdpEchoClient> (n0, "10.1.1.2", port, 
-    1, Seconds(1.), 1024);
+  Ptr<UdpEchoClient> client = CreateObject<UdpEchoClient> (n0, "10.1.1.2",
+    port, 1, Seconds(1.), 1024);
 
   Ptr<UdpEchoServer> server = CreateObject<UdpEchoServer> (n1, port);
 
--- a/tutorial/tutorial-csma-echo.cc	Tue Feb 05 15:29:17 2008 -0500
+++ b/tutorial/tutorial-csma-echo.cc	Tue Feb 05 15:30:16 2008 -0500
@@ -65,8 +65,8 @@
 
   uint16_t port = 7;
 
-  Ptr<UdpEchoClient> client = CreateObject<UdpEchoClient> (n0, "10.1.1.2", port, 
-    1, Seconds(1.), 1024);
+  Ptr<UdpEchoClient> client = CreateObject<UdpEchoClient> (n0, "10.1.1.2",
+    port, 1, Seconds(1.), 1024);
 
   Ptr<UdpEchoServer> server = CreateObject<UdpEchoServer> (n1, port);
 
--- a/tutorial/tutorial-linear-dumbbell.cc	Tue Feb 05 15:29:17 2008 -0500
+++ b/tutorial/tutorial-linear-dumbbell.cc	Tue Feb 05 15:30:16 2008 -0500
@@ -124,14 +124,14 @@
 //
   uint16_t port = 7;
 
-  Ptr<UdpEchoClient> client0 = CreateObject<UdpEchoClient> (n0, "10.1.2.1", port, 
-    100, Seconds(.01), 1024);
-  Ptr<UdpEchoClient> client1 = CreateObject<UdpEchoClient> (n1, "10.1.2.2", port, 
-    100, Seconds(.01), 1024);
-  Ptr<UdpEchoClient> client2 = CreateObject<UdpEchoClient> (n2, "10.1.2.3", port, 
-    100, Seconds(.01), 1024);
-  Ptr<UdpEchoClient> client3 = CreateObject<UdpEchoClient> (n3, "10.1.2.4", port, 
-    100, Seconds(.01), 1024);
+  Ptr<UdpEchoClient> client0 = CreateObject<UdpEchoClient> (n0, "10.1.2.1", 
+    port, 100, Seconds(.01), 1024);
+  Ptr<UdpEchoClient> client1 = CreateObject<UdpEchoClient> (n1, "10.1.2.2", 
+    port, 100, Seconds(.01), 1024);
+  Ptr<UdpEchoClient> client2 = CreateObject<UdpEchoClient> (n2, "10.1.2.3", 
+    port, 100, Seconds(.01), 1024);
+  Ptr<UdpEchoClient> client3 = CreateObject<UdpEchoClient> (n3, "10.1.2.4", 
+    port, 100, Seconds(.01), 1024);
 
   Ptr<UdpEchoServer> server4 = CreateObject<UdpEchoServer> (n4, port);
   Ptr<UdpEchoServer> server5 = CreateObject<UdpEchoServer> (n5, port);
--- a/tutorial/tutorial-point-to-point.cc	Tue Feb 05 15:29:17 2008 -0500
+++ b/tutorial/tutorial-point-to-point.cc	Tue Feb 05 15:30:16 2008 -0500
@@ -58,8 +58,8 @@
 
   uint16_t port = 7;
 
-  Ptr<UdpEchoClient> client = CreateObject<UdpEchoClient> (n0, "10.1.1.2", port, 
-    1, Seconds(1.), 1024);
+  Ptr<UdpEchoClient> client = CreateObject<UdpEchoClient> (n0, "10.1.1.2", 
+    port, 1, Seconds(1.), 1024);
 
   Ptr<UdpEchoServer> server = CreateObject<UdpEchoServer> (n1, port);
 
--- a/tutorial/tutorial-star-routing.cc	Tue Feb 05 15:29:17 2008 -0500
+++ b/tutorial/tutorial-star-routing.cc	Tue Feb 05 15:30:16 2008 -0500
@@ -145,8 +145,8 @@
 
   uint16_t port = 7;
 
-  Ptr<UdpEchoClient> client = CreateObject<UdpEchoClient> (n4, "10.1.1.2", port, 
-    1, Seconds(1.), 1024);
+  Ptr<UdpEchoClient> client = CreateObject<UdpEchoClient> (n4, "10.1.1.2", 
+    port, 1, Seconds(1.), 1024);
 
   Ptr<UdpEchoServer> server = CreateObject<UdpEchoServer> (n1, port);
 
--- a/tutorial/tutorial-star.cc	Tue Feb 05 15:29:17 2008 -0500
+++ b/tutorial/tutorial-star.cc	Tue Feb 05 15:30:16 2008 -0500
@@ -145,8 +145,8 @@
 
   uint16_t port = 7;
 
-  Ptr<UdpEchoClient> client = CreateObject<UdpEchoClient> (n0, "10.1.1.2", port, 
-    1, Seconds(1.), 1024);
+  Ptr<UdpEchoClient> client = CreateObject<UdpEchoClient> (n0, "10.1.1.2", 
+    port, 1, Seconds(1.), 1024);
 
   Ptr<UdpEchoServer> server = CreateObject<UdpEchoServer> (n1, port);