merged ns-3-lena-dev with ns-3-dev
authorNicola Baldo <nbaldo@cttc.es>
Wed, 11 Apr 2012 13:49:33 +0200
changeset 8702 d3e7f0d5e378
parent 8701 865f750a6b63 (current diff)
parent 7847 411299d94e07 (diff)
child 8703 e3b6612b0552
child 8704 207fc5214d3c
merged ns-3-lena-dev with ns-3-dev
.hgignore
doc/models/Makefile
doc/models/source/index.rst
src/buildings/doc/Makefile
src/core/model/config.cc
src/core/model/unix-system-thread.cc
src/core/wscript
src/lte/doc/Makefile
src/lte/doc/source/index.rst
src/lte/model/lte-amc.cc
src/network/utils/packet-socket.cc
src/spectrum/model/constant-spectrum-propagation-loss.cc
src/spectrum/model/constant-spectrum-propagation-loss.h
src/spectrum/model/spectrum-type.cc
src/spectrum/model/spectrum-type.h
src/spectrum/wscript
src/stats/model/basic-data-calculators.h
src/wscript
--- a/.hgignore	Wed Apr 11 11:00:27 2012 +0200
+++ b/.hgignore	Wed Apr 11 13:49:33 2012 +0200
@@ -29,9 +29,6 @@
 ^doc/manual/figures/.*pdf
 ^doc/manual/figures/.*png
 ^src/.*/doc/build
-^src/.*/doc/source/figures/.*.eps
-^src/.*/doc/source/figures/.*.pdf
-^src/.*/doc/source/figures/.*.png
 ^bindings/python/pybindgen/
 ms_print.*
 massif.*
--- a/CHANGES.html	Wed Apr 11 11:00:27 2012 +0200
+++ b/CHANGES.html	Wed Apr 11 13:49:33 2012 +0200
@@ -41,11 +41,17 @@
 our best but can guarantee that there will be things that fall through
 the cracks, unfortunately.  If you, as a user, can suggest improvements
 to this file based on your experience, please contribute a patch or drop
-us a note on ns-developers mailing list.  </p>
+us a note on ns-developers mailing list.</p>
 
 <hr>
 <h1>Changes from ns-3.13 to ns-3-dev</h1>
 
+<h2>New API:</h2>
+<ul>
+<li>The new class AntennaModel provides an API for modeling the radiation pattern of antennas.
+</li>
+</ul>
+
 <h2>Changes to existing API:</h2>
 <ul>
 <li> The Ipv6RawSocketImpl "IcmpFilter" attribute has been removed. Six 
@@ -74,6 +80,19 @@
 needed for TCP.  This lead to a small change in the UDP and ICMPv6 L4
 protocols as well.
 </li>
+<li>
+Ipv6RoutingHelper can now print the IPv6 Routing Tables at specific 
+intervals or time. Exactly like Ipv4RoutingHelper do.
+</li>
+<li>
+New "SendIcmpv6Redirect" attribute (and getter/setter functions) to 
+Ipv6L3Protocol. The behavior is similar to Linux's conf "send_redirects", 
+i.e., enable/disable the ICMPv6 Redirect sending.
+</li>
+<li> The SpectrumPhy abstract class now has a new method
+<pre>virtual Ptr&#60;AntennaModel&#62; GetRxAntenna () = 0;</pre>
+that all derived classes need to implement in order to integrate properly with the newly added antenna model. In addition, a new member variable "Ptr&#60;AntennaModel&#62; txAntenna" has been added to SpectrumSignalParameters in order to allow derived SpectrumPhy classes to provide information about the antenna model used for the transmission of a waveform.
+</li>
 </ul>
 
 <h2>Changes to build system:</h2>
--- a/RELEASE_NOTES	Wed Apr 11 11:00:27 2012 +0200
+++ b/RELEASE_NOTES	Wed Apr 11 13:49:33 2012 +0200
@@ -24,14 +24,26 @@
 - Dual-stacked IPv6 sockets are implemented. An IPv6 socket can accept an IPv4 
   connection, returning the senders address as an IPv4-mapped address 
   (IPV6_V6ONLY socket option is not implemented).
-
+- Ipv6RoutingHelper is now in-line with Ipv4RoutingHelper concerning the RT 
+  print functions. Various minor changes made in Ipv6RoutingProtocol and derived 
+  classes to make this possible.
+- New "SendIcmpv6Redirect" attribute (and getter/setter functions) to 
+  Ipv6L3Protocol. The behavior is similar to Linux's conf "send_redirects",
+  i.e., enable/disable the ICMPv6 Redirect sending.
+- An antenna module is now included, which includes different
+  radiation pattern models. See the corresponding new section of the
+  ns-3 models library documentation for details. 
+   
 Bugs fixed
 ----------
  - bug 1319 - Fix Ipv6RawSocketImpl Icmpv6 filter
  - bug 1318 - Asserts for IPv6 malformed packets
  - bug 1357 - IPv6 fragmentation fails due to checks about malformed extensions
  - bug 1378 - UdpEchoClient::SetFill () does not set packet size correctly
-
+ - bug 1351 and 1333 - TCP not able to take RTT samples on long delay network
+ - bug 1362 - ICMPv6 does not forward ICMPs to upper layers (and minor fixes to ICMPv6)
+ - bug 1395 - AODV DeferredRouteOutputTag missing constructor
+ 
 Known issues
 ------------
 In general, known issues are tracked on the project tracker available
--- a/doc/manual/source/attributes.rst	Wed Apr 11 11:00:27 2012 +0200
+++ b/doc/manual/source/attributes.rst	Wed Apr 11 13:49:33 2012 +0200
@@ -488,7 +488,7 @@
 
     ConfigStore::ConfigStore ()
     {
-      ObjectBase::ConstructSelf (AttributeList ());
+      ObjectBase::ConstructSelf (AttributeConstructionList ());
       // continue on with constructor.
     }
 
--- a/doc/manual/source/callbacks.rst	Wed Apr 11 11:00:27 2012 +0200
+++ b/doc/manual/source/callbacks.rst	Wed Apr 11 13:49:33 2012 +0200
@@ -239,7 +239,7 @@
   class A
   {
   public:
-  A (int ao) : a (a0) {}
+  A (int a0) : a (a0) {}
   int Hello (int b0)
   {
     std::cout << "Hello from A, a = " << a << " b0 = " << b0 << std::endl;
--- a/doc/models/Makefile	Wed Apr 11 11:00:27 2012 +0200
+++ b/doc/models/Makefile	Wed Apr 11 13:49:33 2012 +0200
@@ -200,6 +200,7 @@
 # rescale pdf figures as necessary
 $(FIGURES)/testbed.pdf_width = 5in
 $(FIGURES)/emulated-channel.pdf_width = 6in
+$(FIGURES)/antenna-coordinate-system.pdf_width = 7cm	
 $(FIGURES)/node.pdf_width = 5in
 $(FIGURES)/packet.pdf_width = 4in
 $(FIGURES)/buffer.pdf_width = 15cm
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/doc/tutorial-pt-br/Makefile	Wed Apr 11 13:49:33 2012 +0200
@@ -0,0 +1,150 @@
+# Makefile for Sphinx documentation
+#
+
+# You can set these variables from the command line.
+SPHINXOPTS    =
+SPHINXBUILD   = sphinx-build
+PAPER         =
+BUILDDIR      = build
+
+# Internal variables.
+PAPEROPT_a4     = -D latex_paper_size=a4
+PAPEROPT_letter = -D latex_paper_size=letter
+ALLSPHINXOPTS   = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source
+
+# Additional variables for figures, not sphinx default:
+DIA = dia
+EPSTOPDF = epstopdf
+FIGURES = source/figures
+IMAGES_EPS = \
+
+IMAGES_PNG = ${IMAGES_EPS:.eps=.png}
+IMAGES_PDF = ${IMAGES_EPS:.eps=.pdf}
+
+IMAGES = $(IMAGES_EPS) $(IMAGES_PNG) $(IMAGES_PDF)
+
+.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest
+
+%.eps : %.dia; $(DIA) -t eps $< -e $@
+%.png : %.dia; $(DIA) -t png $< -e $@
+%.pdf : %.eps; $(EPSTOPDF) $< -o=$@
+
+help:
+	@echo "Please use \`make <target>' where <target> is one of"
+	@echo "  html       to make standalone HTML files"
+	@echo "  dirhtml    to make HTML files named index.html in directories"
+	@echo "  singlehtml to make a single large HTML file"
+	@echo "  pickle     to make pickle files"
+	@echo "  json       to make JSON files"
+	@echo "  htmlhelp   to make HTML files and a HTML help project"
+	@echo "  qthelp     to make HTML files and a qthelp project"
+	@echo "  devhelp    to make HTML files and a Devhelp project"
+	@echo "  epub       to make an epub"
+	@echo "  latex      to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
+	@echo "  latexpdf   to make LaTeX files and run them through pdflatex"
+	@echo "  text       to make text files"
+	@echo "  man        to make manual pages"
+	@echo "  changes    to make an overview of all changed/added/deprecated items"
+	@echo "  linkcheck  to check all external links for integrity"
+	@echo "  doctest    to run all doctests embedded in the documentation (if enabled)"
+
+clean:
+	-rm -rf $(BUILDDIR)/*
+
+frag: pickle
+	@if test ! -d $(BUILDDIR)/frag; then mkdir $(BUILDDIR)/frag; fi
+	pushd $(BUILDDIR)/frag && ../../pickle-to-xml.py ../pickle/index.fpickle  > navigation.xml && popd
+	cp -r $(BUILDDIR)/pickle/_images $(BUILDDIR)/frag
+
+html: $(IMAGES)
+	$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
+	@echo
+	@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
+
+dirhtml: $(IMAGES)
+	$(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
+	@echo
+	@echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
+
+singlehtml: $(IMAGES)
+	$(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
+	@echo
+	@echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."
+
+pickle: $(IMAGES)
+	$(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
+	@echo
+	@echo "Build finished; now you can process the pickle files."
+
+json: $(IMAGES)
+	$(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
+	@echo
+	@echo "Build finished; now you can process the JSON files."
+
+htmlhelp: $(IMAGES)
+	$(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
+	@echo
+	@echo "Build finished; now you can run HTML Help Workshop with the" \
+	      ".hhp project file in $(BUILDDIR)/htmlhelp."
+
+qthelp: $(IMAGES)
+	$(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
+	@echo
+	@echo "Build finished; now you can run "qcollectiongenerator" with the" \
+	      ".qhcp project file in $(BUILDDIR)/qthelp, like this:"
+	@echo "# qcollectiongenerator $(BUILDDIR)/qthelp/ns-3.qhcp"
+	@echo "To view the help file:"
+	@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/ns-3.qhc"
+
+devhelp: $(IMAGES)
+	$(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
+	@echo
+	@echo "Build finished."
+	@echo "To view the help file:"
+	@echo "# mkdir -p $$HOME/.local/share/devhelp/ns-3"
+	@echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/ns-3"
+	@echo "# devhelp"
+
+epub: $(IMAGES)
+	$(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
+	@echo
+	@echo "Build finished. The epub file is in $(BUILDDIR)/epub."
+
+latex: $(IMAGES)
+	$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
+	@echo
+	@echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
+	@echo "Run \`make' in that directory to run these through (pdf)latex" \
+	      "(use \`make latexpdf' here to do that automatically)."
+
+latexpdf: $(IMAGES)
+	$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
+	@echo "Running LaTeX files through pdflatex..."
+	make -C $(BUILDDIR)/latex all-pdf
+	@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
+
+text: $(IMAGES)
+	$(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
+	@echo
+	@echo "Build finished. The text files are in $(BUILDDIR)/text."
+
+man: $(IMAGES)
+	$(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
+	@echo
+	@echo "Build finished. The manual pages are in $(BUILDDIR)/man."
+
+changes: $(IMAGES)
+	$(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
+	@echo
+	@echo "The overview file is in $(BUILDDIR)/changes."
+
+linkcheck: $(IMAGEs)
+	$(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
+	@echo
+	@echo "Link check complete; look for any errors in the above output " \
+	      "or in $(BUILDDIR)/linkcheck/output.txt."
+
+doctest: $(IMAGES)
+	$(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
+	@echo "Testing of doctests in the sources finished, look at the " \
+	      "results in $(BUILDDIR)/doctest/output.txt."
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/doc/tutorial-pt-br/figures/README	Wed Apr 11 13:49:33 2012 +0200
@@ -0,0 +1,18 @@
+Please write image files in a vector graphics format, when possible, and
+generate the .png and .pdf versions on the fly (see ../Makefile).  
+
+The currently supported tool is dia.  xfig could be added similarly
+if someone wants to add it.  The main requirement for adding another format
+is that the tool to edit it is freely available and that a cron script can 
+autogenerate the pdf and png from the figure source.  Tgif (.obj) files
+were once used but the file conversions require a valid X display to 
+be running, and are therefore to be avoided since our code server 
+does not run such a server.  Tgif pdf conversions were also cumbersome.
+
+Store the .dia versions in mercurial, but not the .png or .pdfs.  
+If the figure is not available in a vector graphics format, store both
+a .png and a .pdf version in this directory.
+
+If you add a source (.dia) file here, remember to add it to
+the list of figure sources in the Makefile in the directory above
+
Binary file doc/tutorial-pt-br/figures/cwnd.png has changed
Binary file doc/tutorial-pt-br/figures/dumbbell.dia has changed
Binary file doc/tutorial-pt-br/figures/helpers.dia has changed
Binary file doc/tutorial-pt-br/figures/oneobj.png has changed
Binary file doc/tutorial-pt-br/figures/pp.dia has changed
Binary file doc/tutorial-pt-br/figures/star.dia has changed
Binary file doc/tutorial-pt-br/figures/threeobj.png has changed
Binary file doc/tutorial-pt-br/locale/language/LC_MESSAGES/sphinx.mo has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/doc/tutorial-pt-br/pickle-to-xml.py	Wed Apr 11 13:49:33 2012 +0200
@@ -0,0 +1,42 @@
+#!/usr/bin/python
+
+
+# output xml format:
+# <pages>
+# <page url="xx"><prev url="yyy">zzz</prev><next url="hhh">lll</next><fragment>file.frag</fragment></page>
+# ...
+# </pages>
+
+import pickle
+import os
+import codecs
+
+def dump_pickles(out, dirname, filename, path):
+    f = open(os.path.join(dirname, filename), 'r')
+    data = pickle.load(f)
+    fragment_file = codecs.open(data['current_page_name'] + '.frag', mode='w', encoding='utf-8')
+    fragment_file.write(data['body'])
+    fragment_file.close()
+    out.write('  <page url="%s">\n' % path)
+    out.write('    <fragment>%s.frag</fragment>\n' % data['current_page_name'])
+    if data['prev'] is not None:
+        out.write('    <prev url="%s">%s</prev>\n' % 
+                  (os.path.normpath(os.path.join(path, data['prev']['link'])), 
+                   data['prev']['title']))
+    if data['next'] is not None:
+        out.write('    <next url="%s">%s</next>\n' % 
+                  (os.path.normpath(os.path.join(path, data['next']['link'])), 
+                   data['next']['title']))
+    out.write('  </page>\n')
+    f.close()
+    if data['next'] is not None:
+        next_path = os.path.normpath(os.path.join(path, data['next']['link']))
+        next_filename = os.path.basename(next_path) + '.fpickle'
+        dump_pickles(out, dirname, next_filename, next_path)
+    return
+
+import sys
+
+sys.stdout.write('<pages>\n')
+dump_pickles(sys.stdout, os.path.dirname(sys.argv[1]), os.path.basename(sys.argv[1]), '/')
+sys.stdout.write('</pages>')
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/doc/tutorial-pt-br/source/building-topologies.rst	Wed Apr 11 13:49:33 2012 +0200
@@ -0,0 +1,1917 @@
+.. include:: replace.txt
+
+..
+	========================================================================================
+	Translated for portuguese by the students of the inter-institutional doctorate program of IME-USP/UTFPR-CM.
+	
+	Traduzido para o português pelos alunos do programa de doutorado inter institucional do Instituto de Matemática e Estatística da Universidade de São Paulo --- IME-USP em parceria com a Universidade Tecnológica Federal do Paraná - Campus Campo Mourão --- UTFPR-CM:
+	
+	* Frank Helbert (frank@ime.usp.br);
+	* Luiz Arthur Feitosa dos Santos (luizsan@ime.usp.br);
+	* Rodrigo Campiolo (campiolo@ime.usp.br).
+	========================================================================================
+
+
+..
+	Building Topologies
+
+Construindo topologias
+----------------------
+
+..
+	Building a Bus Network Topology
+
+Construindo uma rede em barramento
+**********************************
+
+..
+	In this section we are going to expand our mastery of |ns3| network 
+	devices and channels to cover an example of a bus network.  |ns3|
+	provides a net device and channel we call CSMA (Carrier Sense Multiple Access).
+
+
+Nesta seção, o conhecimento sobre dispositivos de rede e canais de comunicação são expandidos de forma a abordar um exemplo de uma rede em barramento. O |ns3| fornece um dispositivo de rede e canal que é chamado de CSMA (*Carrier Sense Multiple Access*).
+
+..
+	The |ns3| CSMA device models a simple network in the spirit of 
+	Ethernet.  A real Ethernet uses CSMA/CD (Carrier Sense Multiple Access with 
+	Collision Detection) scheme with exponentially increasing backoff to contend 
+	for the shared transmission medium.  The |ns3| CSMA device and 
+	channel models only a subset of this.
+
+O dispositivo CSMA modela uma rede simples no contexto da Ethernet. Uma rede Ethernet real utiliza CSMA/CD (*Carrier Sense Multiple Access with Collision Detection*) com recuo binário exponencial para lidar com o meio de transmissão compartilhado. O dispositivo e o canal CSMA do |ns3| modelam apenas um subconjunto deste.
+
+..
+	Just as we have seen point-to-point topology helper objects when constructing
+	point-to-point topologies, we will see equivalent CSMA topology helpers in
+	this section.  The appearance and operation of these helpers should look 
+	quite familiar to you.
+
+Assim como foi visto nos assistentes ponto-a-ponto (objetos) na construção de topologias ponto-a-ponto, veremos assistentes (objetos) equivalentes da topologia CSMA nesta seção. O formato e o funcionamento destes assistentes serão bastante familiares para o leitor.
+
+..
+	We provide an example script in our examples/tutorial} directory.  This script
+	builds on the ``first.cc`` script and adds a CSMA network to the 
+	point-to-point simulation we've already considered.  Go ahead and open 
+	``examples/tutorial/second.cc`` in your favorite editor.  You will have already seen
+	enough |ns3| code to understand most of what is going on in this 
+	example, but we will go over the entire script and examine some of the output.
+
+Um novo código exemplo é fornecido na pasta ``examples/tutorial``. Este baseia-se no código ``first.cc`` e adiciona uma rede CSMA a simulação ponto-a-ponto já considerada. O leitor pode abrir o arquivo ``examples/tutorial/second.cc`` em seu editor favorito para acompanhar o restante desta seção. Embora seja redundante, o código será analisado em sua totalidade, examinando alguns de seus resultados.
+
+..
+	Just as in the ``first.cc`` example (and in all ns-3 examples) the file
+	begins with an emacs mode line and some GPL boilerplate.
+
+Assim como no exemplo ``first.cc`` (e em todos os exemplos ns-3), o arquivo
+começa com uma linha de modo Emacs e algumas linhas do padrão GPL.
+
+..
+	The actual code begins by loading module include files just as was done in the
+	``first.cc`` example.
+
+O código começa com o carregamento de módulos através da inclusão dos arquivos.
+
+::
+
+  #include "ns3/core-module.h"
+  #include "ns3/network-module.h"
+  #include "ns3/csma-module.h"
+  #include "ns3/internet-module.h"
+  #include "ns3/point-to-point-module.h"
+  #include "ns3/applications-module.h"
+  #include "ns3/ipv4-global-routing-helper.h"
+
+..
+	One thing that can be surprisingly useful is a small bit of ASCII art that
+	shows a cartoon of the network topology constructed in the example.  You will
+	find a similar "drawing" in most of our examples.
+
+Algo que pode ser surpreendentemente útil é uma pequena arte ASCII que mostra um desenho da topologia da rede construída. Um "desenho" similar é encontrado na maioria dos exemplos no projeto.
+
+..
+	In this case, you can see that we are going to extend our point-to-point
+	example (the link between the nodes n0 and n1 below) by hanging a bus network
+	off of the right side.  Notice that this is the default network topology 
+	since you can actually vary the number of nodes created on the LAN.  If you
+	set nCsma to one, there will be a total of two nodes on the LAN (CSMA 
+	channel) --- one required node and one "extra" node.  By default there are
+	three "extra" nodes as seen below:
+
+Neste caso, é possível perceber que o exemplo ponto-a-ponto (a ligação entre os nós n0 e n1 abaixo) está sendo estendido, agregando uma rede em barramento ao lado direito. Observe que esta é a topologia de rede padrão, visto que o número de nós criados na LAN pode ser mudado. Se o atributo ``nCsma`` for configurado para um, haverá um total de dois nós na LAN (canal CSMA) --- um nó obrigatório e um nó "extra". Por padrão, existem três nós "extra", como pode ser observado:
+
+::
+
+// Default Network Topology
+//
+//       10.1.1.0
+// n0 -------------- n1   n2   n3   n4
+//    point-to-point  |    |    |    |
+//                    ================
+//                      LAN 10.1.2.0
+
+..
+	Then the ns-3 namespace is ``used`` and a logging component is defined.
+	This is all just as it was in ``first.cc``, so there is nothing new yet.
+
+Em seguida, o `namespace` do ns-3 é `usado` e um componente de registro (`log`) é definido. Até aqui, tudo é exatamente como em ``first.cc``, não há nada novo ainda.
+
+::
+  
+  using namespace ns3;
+  
+  NS_LOG_COMPONENT_DEFINE ("SecondScriptExample");
+
+..
+	The main program begins with a slightly different twist.  We use a verbose
+	flag to determine whether or not the ``UdpEchoClientApplication`` and
+	``UdpEchoServerApplication`` logging components are enabled.  This flag
+	defaults to true (the logging components are enabled) but allows us to turn
+	off logging during regression testing of this example.
+
+O programa principal começa com um toque ligeiramente diferente. A variável 'verbose' é usada para determinar se os componentes de registro de ``UdpEchoClientApplication`` e ``UdpEchoServerApplication`` estarão habilitados. O valor padrão é verdadeiro (os componentes de registro estão ativados), mas é possível desligar durante os testes de regressão deste exemplo.
+
+..
+	You will see some familiar code that will allow you to change the number
+	of devices on the CSMA network via command line argument.  We did something
+	similar when we allowed the number of packets sent to be changed in the section
+	on command line arguments.  The last line makes sure you have at least one
+	"extra" node.
+
+Você verá códigos familiares que lhe permitirão mudar o número de dispositivos na rede CSMA via linha de comando. Fizemos algo semelhante, quando permitimos que o número de pacotes enviados em uma sessão fosse alterado. A última linha garante que você tenha pelo menos um nó "extra".
+
+..
+	The code consists of variations of previously covered API so you should be
+	entirely comfortable with the following code at this point in the tutorial.
+
+O código consiste em variações de APIs abordadas anteriormente neste tutorial.
+
+::
+
+  bool verbose = true;
+  uint32_t nCsma = 3;
+
+  CommandLine cmd;
+  cmd.AddValue ("nCsma", "Number of \"extra\" CSMA nodes/devices", nCsma);
+  cmd.AddValue ("verbose", "Tell echo applications to log if true", verbose);
+
+  cmd.Parse (argc, argv);
+
+  if (verbose)
+    {
+      LogComponentEnable("UdpEchoClientApplication", LOG_LEVEL_INFO);
+      LogComponentEnable("UdpEchoServerApplication", LOG_LEVEL_INFO);
+    }
+
+  nCsma = nCsma == 0 ? 1 : nCsma;
+
+..
+	The next step is to create two nodes that we will connect via the 
+	point-to-point link.  The ``NodeContainer`` is used to do this just as was
+	done in ``first.cc``.
+
+O próximo passo é a criação de dois nós que iremos conectar através da ligação ponto-a-ponto. O ``NodeContainer`` é usado para fazer isto, assim como foi feito em ``first.cc``.
+
+::
+
+  NodeContainer p2pNodes;
+  p2pNodes.Create (2);
+
+..
+	Next, we declare another ``NodeContainer`` to hold the nodes that will be
+	part of the bus (CSMA) network.  First, we just instantiate the container
+	object itself.  
+
+Em seguida, declaramos outro ``NodeContainer`` para manter os nós que serão parte da rede em barramento (CSMA). Primeiro, instanciamos somente o contêiner.
+
+::
+
+  NodeContainer csmaNodes;
+  csmaNodes.Add (p2pNodes.Get (1));
+  csmaNodes.Create (nCsma);
+
+..
+	The next line of code ``Gets`` the first node (as in having an index of one)
+	from the point-to-point node container and adds it to the container of nodes
+	that will get CSMA devices.  The node in question is going to end up with a 
+	point-to-point device *and* a CSMA device.  We then create a number of 
+	"extra" nodes that compose the remainder of the CSMA network.  Since we 
+	already have one node in the CSMA network -- the one that will have both a
+	point-to-point and CSMA net device, the number of "extra" nodes means the
+	number nodes you desire in the CSMA section minus one.
+
+Depois, na próxima linha de código, ``obtém-se`` o primeiro nó do contêiner ponto-a-ponto e o adiciona ao contêiner de nós que irão receber dispositivos CSMA. O nó em questão vai acabar com um dispositivo ponto-a-ponto *e* um dispositivo CSMA. Em seguida, criamos uma série de nós "extra" que compõem o restante da rede CSMA. Visto que já temos um nó na rede CSMA -- aquele que terá tanto um dispositivo ponto-a-ponto quanto um dispositivo de rede CSMA, o número de nós "extras" representa o número desejado de nós na seção CSMA menos um.
+
+..
+	The next bit of code should be quite familiar by now.  We instantiate a
+	``PointToPointHelper`` and set the associated default ``Attributes`` so
+	that we create a five megabit per second transmitter on devices created using
+	the helper and a two millisecond delay on channels created by the helper.
+
+Instanciamos um ``PointToPointHelper`` e definimos os atributos padrões de forma a criar uma transmissão de cinco megabits por segundo e dois milésimos de segundo de atraso para dispositivos criados utilizando este assistente.
+
+::
+
+  PointToPointHelper pointToPoint;
+  pointToPoint.SetDeviceAttribute ("DataRate", StringValue ("5Mbps"));
+  pointToPoint.SetChannelAttribute ("Delay", StringValue ("2ms"));
+
+  NetDeviceContainer p2pDevices;
+  p2pDevices = pointToPoint.Install (p2pNodes);
+
+..
+	We then instantiate a ``NetDeviceContainer`` to keep track of the 
+	point-to-point net devices and we ``Install`` devices on the 
+	point-to-point nodes.
+
+Em seguida, instanciamos um ``NetDeviceContainer`` para gerenciar os dispositivos ponto-a-ponto e então ``Instalamos`` os dispositivos nos nós ponto-a-ponto.
+
+..
+	We mentioned above that you were going to see a helper for CSMA devices and
+	channels, and the next lines introduce them.  The ``CsmaHelper`` works just
+	like a ``PointToPointHelper``, but it creates and connects CSMA devices and
+	channels.  In the case of a CSMA device and channel pair, notice that the data
+	rate is specified by a *channel* ``Attribute`` instead of a device 
+	``Attribute``.  This is because a real CSMA network does not allow one to mix,
+	for example, 10Base-T and 100Base-T devices on a given channel.  We first set 
+	the data rate to 100 megabits per second, and then set the speed-of-light delay
+	of the channel to 6560 nano-seconds (arbitrarily chosen as 1 nanosecond per foot
+	over a 100 meter segment).  Notice that you can set an ``Attribute`` using 
+	its native data type.
+
+Mencionamos anteriormente que abordaríamos um assistente para dispositivos e canais CSMA, as próximas linhas o introduzem. O ``CsmaHelper`` funciona como o ``PointToPointHelper``, mas cria e conecta dispositivos e canais CSMA. No caso de um par de dispositivos e canais CSMA, observe que a taxa de dados é especificada por um atributo do canal, ao invés de um atributo do dispositivo. Isto ocorre porque uma rede CSMA real não permite que se misture, por exemplo, dispositivos 10Base-T e 100Base-T em um mesmo meio. Primeiro definimos a taxa de dados a 100 megabits por segundo e, em seguida, definimos o atraso do canal como a velocidade da luz, 6560 nano-segundos (escolhido arbitrariamente como 1 nanossegundo por 30,48 centímetros sobre um segmento de 100 metros). Observe que você pode definir um atributo usando
+seu tipo de dados nativo.
+
+::
+
+  CsmaHelper csma;
+  csma.SetChannelAttribute ("DataRate", StringValue ("100Mbps"));
+  csma.SetChannelAttribute ("Delay", TimeValue (NanoSeconds (6560)));
+
+  NetDeviceContainer csmaDevices;
+  csmaDevices = csma.Install (csmaNodes);
+
+..
+	Just as we created a ``NetDeviceContainer`` to hold the devices created by
+	the ``PointToPointHelper`` we create a ``NetDeviceContainer`` to hold 
+	the devices created by our ``CsmaHelper``.  We call the ``Install`` 
+	method of the ``CsmaHelper`` to install the devices into the nodes of the
+	``csmaNodes NodeContainer``.
+
+
+Assim como criamos um ``NetDeviceContainer`` para manter os dispositivos criados pelo ``PointToPointHelper``, criamos um ``NetDeviceContainer`` para gerenciar os dispositivos criados pelo nosso ``CsmaHelper``. Chamamos o método ``Install`` do ``CsmaHelper`` para instalar os dispositivos nos nós do ``csmaNodes NodeContainer``.
+
+..
+	We now have our nodes, devices and channels created, but we have no protocol
+	stacks present.  Just as in the ``first.cc`` script, we will use the
+	``InternetStackHelper`` to install these stacks.
+
+Agora temos os nossos nós, dispositivos e canais criados, mas não temos nenhuma pilha de protocolos presente. Assim como no exemplo ``first.cc``, usaremos o ``InternetStackHelper`` para instalar estas pilhas.
+
+::
+
+  InternetStackHelper stack;
+  stack.Install (p2pNodes.Get (0));
+  stack.Install (csmaNodes);
+
+..
+	Recall that we took one of the nodes from the ``p2pNodes`` container and
+	added it to the ``csmaNodes`` container.  Thus we only need to install 
+	the stacks on the remaining ``p2pNodes`` node, and all of the nodes in the
+	``csmaNodes`` container to cover all of the nodes in the simulation.
+
+Lembre-se que pegamos um dos nós do contêiner ``p2pNodes`` e o adicionamos ao contêiner ``csmaNodes``. Assim, só precisamos instalar as pilhas nos nós ``p2pNodes`` restantes e todos os nós do contêiner ``csmaNodes`` para abranger todos os nós na simulação.
+
+..
+	Just as in the ``first.cc`` example script, we are going to use the 
+	``Ipv4AddressHelper`` to assign IP addresses to our device interfaces.
+	First we use the network 10.1.1.0 to create the two addresses needed for our
+	two point-to-point devices.
+
+Assim como no exemplo ``first.cc``, vamos usar o ``Ipv4AddressHelper`` para atribuir endereços IP para as interfaces de nossos dispositivos. Primeiro, usamos a rede 10.1.1.0 para criar os dois endereços necessários para os dispositivos ponto-a-ponto.
+
+::
+
+  Ipv4AddressHelper address;
+  address.SetBase ("10.1.1.0", "255.255.255.0");
+  Ipv4InterfaceContainer p2pInterfaces;
+  p2pInterfaces = address.Assign (p2pDevices);
+
+..
+	Recall that we save the created interfaces in a container to make it easy to
+	pull out addressing information later for use in setting up the applications.
+
+Lembre-se que salvamos as interfaces criadas em um contêiner para tornar mais fácil a obtenção de informações sobre o endereçamento para uso na criação dos aplicativos.
+
+..
+	We now need to assign IP addresses to our CSMA device interfaces.  The 
+	operation works just as it did for the point-to-point case, except we now
+	are performing the operation on a container that has a variable number of 
+	CSMA devices --- remember we made the number of CSMA devices changeable by 
+	command line argument.  The CSMA devices will be associated with IP addresses 
+	from network number 10.1.2.0 in this case, as seen below.
+
+Precisamos agora atribuir endereços IP às interfaces dos dispositivo CSMA. A operação é a mesma realizada para o ponto-a-ponto, exceto que agora estamos realizando a operação em um contêiner que possui um número variável de dispositivos CSMA --- lembre-se que fizemos o número de dispositivos CSMA serem passados na linha de comando. Os dispositivos CSMA serão associados com endereços IP da rede 10.1.2.0, como visto a seguir.
+
+::
+
+  address.SetBase ("10.1.2.0", "255.255.255.0");
+  Ipv4InterfaceContainer csmaInterfaces;
+  csmaInterfaces = address.Assign (csmaDevices);
+
+..
+	Now we have a topology built, but we need applications.  This section is
+	going to be fundamentally similar to the applications section of 
+	``first.cc`` but we are going to instantiate the server on one of the 
+	nodes that has a CSMA device and the client on the node having only a 
+	point-to-point device.
+
+Agora a topologia já está construída, mas precisamos de aplicações. Esta seção é muito similar a seção de aplicações do exemplo ``first.cc``, mas vamos instanciar o servidor em um dos nós que tem um dispositivo CSMA e o cliente em um nó que tem apenas um dispositivo ponto-a-ponto.
+
+..
+	First, we set up the echo server.  We create a ``UdpEchoServerHelper`` and
+	provide a required ``Attribute`` value to the constructor which is the server
+	port number.  Recall that this port can be changed later using the 
+	``SetAttribute`` method if desired, but we require it to be provided to
+	the constructor.
+
+Primeiro, vamos configurar o servidor de eco. Criamos um ``UdpEchoServerHelper`` e fornecemos o atributo obrigatório do construtor que é o número da porta. Lembre-se que esta porta pode ser alterada posteriormente, utilizando o método ``SetAttribute``.
+
+::
+
+  UdpEchoServerHelper echoServer (9);
+
+  ApplicationContainer serverApps = echoServer.Install (csmaNodes.Get (nCsma));
+  serverApps.Start (Seconds (1.0));
+  serverApps.Stop (Seconds (10.0));
+
+..
+	Recall that the ``csmaNodes NodeContainer`` contains one of the 
+	nodes created for the point-to-point network and ``nCsma`` "extra" nodes. 
+	What we want to get at is the last of the "extra" nodes.  The zeroth entry of
+	the ``csmaNodes`` container will be the point-to-point node.  The easy
+	way to think of this, then, is if we create one "extra" CSMA node, then it
+	will be at index one of the ``csmaNodes`` container.  By induction,
+	if we create ``nCsma`` "extra" nodes the last one will be at index 
+	``nCsma``.  You see this exhibited in the ``Get`` of the first line of 
+	code.
+
+Lembre-se que o ``csmaNodes NodeContainer`` contém um dos nós criados para a rede ponto-a-ponto e os ``nCsma`` nós "extra". O que queremos é o último dos nós "extra". A entrada zero do contêiner ``csmaNodes`` será o nó ponto-a-ponto. O jeito fácil de pensar nisso é, ao criar um nó CSMA "extra", este será o nó um do contêiner ``csmaNodes``. Por indução,
+se criarmos ``nCsma`` nós "extra", o último será o de índice ``nCsma``. Isto ocorre no ``Get`` da primeira linha de
+código.
+
+..
+	The client application is set up exactly as we did in the ``first.cc``
+	example script.  Again, we provide required ``Attributes`` to the 
+	``UdpEchoClientHelper`` in the constructor (in this case the remote address
+	and port).  We tell the client to send packets to the server we just installed
+	on the last of the "extra" CSMA nodes.  We install the client on the 
+	leftmost point-to-point node seen in the topology illustration.
+
+A aplicação cliente é criada exatamente como fizemos no exemplo ``first.cc``. Novamente, fornecemos os atributos necessários no construtor do ``UdpEchoClientHelper`` (neste caso, o endereço e porta remotos). Dizemos ao cliente para enviar pacotes para o servidor. Instalamos o cliente no nó ponto-a-ponto mais à esquerda visto na ilustração da topologia.
+
+::
+
+  UdpEchoClientHelper echoClient (csmaInterfaces.GetAddress (nCsma), 9);
+  echoClient.SetAttribute ("MaxPackets", UintegerValue (1));
+  echoClient.SetAttribute ("Interval", TimeValue (Seconds (1.)));
+  echoClient.SetAttribute ("PacketSize", UintegerValue (1024));
+
+  ApplicationContainer clientApps = echoClient.Install (p2pNodes.Get (0));
+  clientApps.Start (Seconds (2.0));
+  clientApps.Stop (Seconds (10.0));
+
+..
+	Since we have actually built an internetwork here, we need some form of 
+	internetwork routing.  |ns3| provides what we call global routing to
+	help you out.  Global routing takes advantage of the fact that the entire 
+	internetwork is accessible in the simulation and runs through the all of the
+	nodes created for the simulation --- it does the hard work of setting up routing 
+	for you without having to configure routers.
+
+Visto que construímos uma inter-rede, precisamos de alguma forma de roteamento. O |ns3| fornece o que chamamos de roteamento global para simplificar essa tarefa. O roteamento global tira proveito do fato de que toda a inter-rede é acessível na simulação --- ele realiza a disponibilização do roteamento sem a necessidade de configurar roteadores individualmente.
+
+..
+	Basically, what happens is that each node behaves as if it were an OSPF router
+	that communicates instantly and magically with all other routers behind the
+	scenes.  Each node generates link advertisements and communicates them 
+	directly to a global route manager which uses this global information to 
+	construct the routing tables for each node.  Setting up this form of routing
+	is a one-liner:
+
+Basicamente, o que acontece é que cada nó se comporta como se fosse um roteador OSPF que se comunica instantaneamente e magicamente com todos os outros roteadores transparentemente. Cada nó gera anúncios de ligações e os comunica diretamente a um gerente de rota global. O gerente, por sua vez, utiliza esta informação para construir as tabelas de roteamento de cada nó. A configuração deste tipo de roteamento é realizada em uma linha:
+
+::
+
+  Ipv4GlobalRoutingHelper::PopulateRoutingTables ();
+
+..
+	Next we enable pcap tracing.  The first line of code to enable pcap tracing 
+	in the point-to-point helper should be familiar to you by now.  The second
+	line enables pcap tracing in the CSMA helper and there is an extra parameter
+	you haven't encountered yet.
+
+Em seguida, vamos habilitar o rastreamento pcap. A primeira linha de código para habilita o rastreamento pcap
+no assistente ponto-a-ponto. A segunda linha habilita o rastreamento pcap no assistente CSMA e há um parâmetro extra que ainda não havíamos usado.
+
+::
+
+  pointToPoint.EnablePcapAll ("second");
+  csma.EnablePcap ("second", csmaDevices.Get (1), true);
+
+..
+	The CSMA network is a multi-point-to-point network.  This means that there 
+	can (and are in this case) multiple endpoints on a shared medium.  Each of 
+	these endpoints has a net device associated with it.  There are two basic
+	alternatives to gathering trace information from such a network.  One way 
+	is to create a trace file for each net device and store only the packets
+	that are emitted or consumed by that net device.  Another way is to pick 
+	one of the devices and place it in promiscuous mode.  That single device
+	then "sniffs" the network for all packets and stores them in a single
+	pcap file.  This is how ``tcpdump``, for example, works.  That final 
+	parameter tells the CSMA helper whether or not to arrange to capture 
+	packets in promiscuous mode.  
+
+A rede CSMA é uma rede multi-ponto-a-ponto. Isto significa que pode (e neste caso, de fato há) vários nós em um meio compartilhado. Cada um destes nós tem um dispositivo de rede associado. Existem duas alternativas para a coleta de informações de rastreamento em uma rede desse tipo. Uma maneira é criar um arquivo de rastreamento para cada dispositivo de rede e armazenar apenas os pacotes que são enviados ou recebidos por esse dispositivo. Outra maneira é escolher
+um dos dispositivos e colocá-lo em modo promíscuo. Esse dispositivo então "sniffs" a rede por todos os pacotes e os armazena em um único arquivo pcap. Isto é como o ``tcpdump`` funciona, por exemplo. O último parâmetro informa ao assistente CSMA se deve ou não capturar pacotes em modo promíscuo.
+
+..
+	In this example, we are going to select one of the devices on the CSMA
+	network and ask it to perform a promiscuous sniff of the network, thereby
+	emulating what ``tcpdump`` would do.  If you were on a Linux machine
+	you might do something like ``tcpdump -i eth0`` to get the trace.  
+	In this case, we specify the device using ``csmaDevices.Get(1)``, 
+	which selects the first device in the container.  Setting the final
+	parameter to true enables promiscuous captures.
+
+Neste exemplo, vamos selecionar um dos dispositivos CSMA e pedir para realizar uma captura promíscua na rede, emulando, assim, o que o ``tcpdump`` faria. Se você estivesse em uma máquina Linux faria algo como ``tcpdump -i eth0`` para obter o rastreamento. Neste caso, especificamos o dispositivo usando ``csmaDevices.Get(1)``, que seleciona o primeiro dispositivo no contêiner. Configurando o último parâmetro para verdadeiro habilita a captura no modo promíscuo.
+
+..
+	The last section of code just runs and cleans up the simulation just like
+	the ``first.cc`` example.
+
+A última seção do código apenas executa e limpa a simulação como no exemplo ``first.cc``.
+
+::
+
+    Simulator::Run ();
+    Simulator::Destroy ();
+    return 0;
+  }
+
+..
+	In order to run this example, copy the ``second.cc`` example script into 
+	the scratch directory and use waf to build just as you did with
+	the ``first.cc`` example.  If you are in the top-level directory of the
+	repository you just type,
+
+Para executar este exemplo, copie o arquivo de ``second.cc`` para o diretório "scratch" e use o comando waf para compilar exatamente como você fez com ``first.cc``. Se você estiver no diretório raiz do repositório, digite,
+
+::
+
+  cp examples/tutorial/second.cc scratch/mysecond.cc
+  ./waf
+
+..
+	Warning:  We use the file ``second.cc`` as one of our regression tests to
+	verify that it works exactly as we think it should in order to make your
+	tutorial experience a positive one.  This means that an executable named 
+	``second`` already exists in the project.  To avoid any confusion
+	about what you are executing, please do the renaming to ``mysecond.cc``
+	suggested above.
+
+Atenção: Usamos o arquivo ``second.cc`` como um dos nossos testes de regressão para verificar se ele funciona exatamente como achamos que deve, a fim de fazer o seu tutorial uma experiência positiva. Isto significa que um executável chamado ``second`` já existe no projeto. Para evitar qualquer confusão sobre o que você está executando, renomeie para ``mysecond.cc`` como sugerido acima.
+
+..
+	If you are following the tutorial religiously (you are, aren't you) you will
+	still have the NS_LOG variable set, so go ahead and clear that variable and
+	run the program.
+
+Se você está seguindo o tutorial religiosamente (você está? certo?), ainda vai ter a variável ``NS_LOG`` definida, então limpe a variável e execute o programa.
+
+::
+
+  export NS_LOG=
+  ./waf --run scratch/mysecond
+
+..
+	Since we have set up the UDP echo applications to log just as we did in 
+	``first.cc``, you will see similar output when you run the script.
+
+Uma vez que configuramos aplicações UDP de eco para rastrear, assim como fizemos em ``first.cc``, você verá uma saída semelhante quando executar o código.
+
+::
+
+  Waf: Entering directory `/home/craigdo/repos/ns-3-allinone/ns-3-dev/build'
+  Waf: Leaving directory `/home/craigdo/repos/ns-3-allinone/ns-3-dev/build'
+  'build' finished successfully (0.415s)
+  Sent 1024 bytes to 10.1.2.4
+  Received 1024 bytes from 10.1.1.1
+  Received 1024 bytes from 10.1.2.4
+
+..
+	Recall that the first message, "``Sent 1024 bytes to 10.1.2.4``," is the 
+	UDP echo client sending a packet to the server.  In this case, the server
+	is on a different network (10.1.2.0).  The second message, "``Received 1024 
+	bytes from 10.1.1.1``," is from the UDP echo server, generated when it receives
+	the echo packet.  The final message, "``Received 1024 bytes from 10.1.2.4``,"
+	is from the echo client, indicating that it has received its echo back from
+	the server.
+
+Lembre-se que a primeira mensagem, "``Sent 1024 bytes to 10.1.2.4``," é o cliente UDP enviando um pacote de eco para o servidor. Neste caso, o servidor está em uma rede diferente (10.1.2.0). A segunda mensagem, "``Received 1024 bytes from 10.1.1.1``," é do servidor de eco, gerado quando ele recebe o pacote de eco. A mensagem final, "``Received 1024 bytes from 10.1.2.4``," é do cliente de eco, indicando que ele recebeu seu eco de volta.
+
+..
+	If you now go and look in the top level directory, you will find three trace 
+	files:
+
+Se você olhar no diretório raiz, encontrará três arquivos de rastreamento:
+
+::
+
+  second-0-0.pcap  second-1-0.pcap  second-2-0.pcap
+
+..
+	Let's take a moment to look at the naming of these files.  They all have the 
+	same form, ``<name>-<node>-<device>.pcap``.  For example, the first file
+	in the listing is ``second-0-0.pcap`` which is the pcap trace from node 
+	zero, device zero.  This is the point-to-point net device on node zero.  The 
+	file ``second-1-0.pcap`` is the pcap trace for device zero on node one,
+	also a point-to-point net device; and the file ``second-2-0.pcap`` is the
+	pcap trace for device zero on node two.
+
+Vamos gastar um tempo para ver a nomeação desses arquivos. Todos eles têm a mesma forma, ``<nome>-<nó>-<dispositivo>.pcap``. Por exemplo, o primeiro arquivo na listagem é ``second-0-0.pcap `` que é o rastreamento pcap do nó
+zero, dispositivo zero. Este é o dispositivo na rede ponto-a-ponto no nó zero. O arquivo ``second-1-0.pcap`` é o rastreamento pcap para o dispositivo zero no nó um, também um dispositivo ponto-a-ponto. O arquivo ``second-2-0.pcap`` é o rastreamento pcap para o dispositivo zero no nó dois.
+
+..
+	If you refer back to the topology illustration at the start of the section, 
+	you will see that node zero is the leftmost node of the point-to-point link
+	and node one is the node that has both a point-to-point device and a CSMA 
+	device.  You will see that node two is the first "extra" node on the CSMA
+	network and its device zero was selected as the device to capture the 
+	promiscuous-mode trace.
+
+Se remetermos para a ilustração da topologia no início da seção, vai ver que o nó zero é o nó mais à esquerda da ligação ponto-a-ponto e o nó um é o nó que tem tanto um dispositivo ponto-a-ponto quanto um CSMA. Observamos que o nó dois é o primeiro nó "extra" na rede CSMA e seu dispositivo zero foi selecionado como o dispositivo para capturar pacotes de modo promíscuo.
+
+..
+	Now, let's follow the echo packet through the internetwork.  First, do a 
+	tcpdump of the trace file for the leftmost point-to-point node --- node zero.
+
+Agora, vamos seguir o pacote de eco através das redes. Primeiro, faça um tcpdump do arquivo de rastreamento para o nó ponto-a-ponto mais à esquerda --- nó zero.
+
+::
+
+  tcpdump -nn -tt -r second-0-0.pcap
+
+..
+	You should see the contents of the pcap file displayed:
+
+Teremos o conteúdo do arquivo pcap:
+
+::
+
+  reading from file second-0-0.pcap, link-type PPP (PPP)
+  2.000000 IP 10.1.1.1.49153 > 10.1.2.4.9: UDP, length 1024
+  2.007602 IP 10.1.2.4.9 > 10.1.1.1.49153: UDP, length 1024
+
+..
+	The first line of the dump indicates that the link type is PPP (point-to-point)
+	which we expect.  You then see the echo packet leaving node zero via the 
+	device associated with IP address 10.1.1.1 headed for IP address
+	10.1.2.4 (the rightmost CSMA node).  This packet will move over the 
+	point-to-point link and be received by the point-to-point net device on node 
+	one.  Let's take a look:
+
+A primeira linha do despejo (*dump*) indica que o tipo da ligação é PPP (ponto-a-ponto). Você então vê o pacote de eco deixando o nó zero através do dispositivo associado com o endereço IP 10.1.1.1, destinado para o endereço IP 10.1.2.4 (o nó CSMA mais à direita). Este pacote vai passar pela ligação ponto-a-ponto e será recebido pelo dispositivo ponto-a-ponto no nó um. Vamos dar uma olhada:
+
+::
+
+  tcpdump -nn -tt -r second-1-0.pcap
+
+..
+	You should now see the pcap trace output of the other side of the point-to-point
+	link:
+
+Observamos agora a saída de rastreamento pcap do outro lado da ligação ponto-a-ponto:
+
+::
+
+  reading from file second-1-0.pcap, link-type PPP (PPP)
+  2.003686 IP 10.1.1.1.49153 > 10.1.2.4.9: UDP, length 1024
+  2.003915 IP 10.1.2.4.9 > 10.1.1.1.49153: UDP, length 1024
+
+..
+	Here we see that the link type is also PPP as we would expect.  You see the
+	packet from IP address 10.1.1.1 (that was sent at 2.000000 seconds) headed 
+	toward IP address 10.1.2.4 appear on this interface.  Now, internally to this 
+	node, the packet will be forwarded to the CSMA interface and we should see it 
+	pop out on that device headed for its ultimate destination.  
+
+Aqui vemos que o tipo de ligação também é PPP. Vemos nesta interface o pacote do endereço IP 10.1.1.1 (que foi enviado a 2,000000 segundos) endereçado ao IP 10.1.2.4. Agora, internamente a este nó, o pacote será enviado para a interface CSMA e devemos vê-lo saindo nesse dispositivo a caminho de seu destino final.
+
+..
+	Remember that we selected node 2 as the promiscuous sniffer node for the CSMA
+	network so let's then look at second-2-0.pcap and see if its there.
+
+Lembre-se que selecionamos o nó 2 como o "sniffer" promíscuo para a rede CSMA, por isso, vamos analisar o arquivo second-2-0.pcap.
+
+::
+
+  tcpdump -nn -tt -r second-2-0.pcap
+
+..
+	You should now see the promiscuous dump of node two, device zero:
+
+Temos agora o despejo do nó dois, dispositivo zero:
+
+::
+
+  reading from file second-2-0.pcap, link-type EN10MB (Ethernet)
+  2.003696 arp who-has 10.1.2.4 (ff:ff:ff:ff:ff:ff) tell 10.1.2.1
+  2.003707 arp reply 10.1.2.4 is-at 00:00:00:00:00:06
+  2.003801 IP 10.1.1.1.49153 > 10.1.2.4.9: UDP, length 1024
+  2.003811 arp who-has 10.1.2.1 (ff:ff:ff:ff:ff:ff) tell 10.1.2.4
+  2.003822 arp reply 10.1.2.1 is-at 00:00:00:00:00:03
+  2.003915 IP 10.1.2.4.9 > 10.1.1.1.49153: UDP, length 1024
+
+..
+	As you can see, the link type is now "Ethernet".  Something new has appeared,
+	though.  The bus network needs ``ARP``, the Address Resolution Protocol.
+	Node one knows it needs to send the packet to IP address 10.1.2.4, but it
+	doesn't know the MAC address of the corresponding node.  It broadcasts on the
+	CSMA network (ff:ff:ff:ff:ff:ff) asking for the device that has IP address
+	10.1.2.4.  In this case, the rightmost node replies saying it is at MAC address
+	00:00:00:00:00:06.  Note that node two is not directly involved in this 
+	exchange, but is sniffing the network and reporting all of the traffic it sees.
+
+Observamos que o tipo de ligação agora é "Ethernet". Algo novo apareceu. A rede em barramento necessicita do ``ARP``, o "Address Resolution Protocol". O nó um sabe que precisa enviar o pacote para o endereço IP 10.1.2.4, mas
+não sabe o endereço MAC do nó correspondente. Ele transmite na rede CSMA (ff:ff:ff:ff:ff:ff) pedindo ao dispositivo que tem o endereço IP 10.1.2.4. Neste caso, o nó mais à direita responde dizendo que está no endereço MAC 00:00:00:00:00:06. Note que o nó dois não está diretamente envolvido nesta troca, mas está capturando todo o tráfego da rede.
+
+..
+	This exchange is seen in the following lines,
+
+Esta troca é vista nas seguintes linhas,
+
+::
+
+  2.003696 arp who-has 10.1.2.4 (ff:ff:ff:ff:ff:ff) tell 10.1.2.1
+  2.003707 arp reply 10.1.2.4 is-at 00:00:00:00:00:06
+
+..
+	Then node one, device one goes ahead and sends the echo packet to the UDP echo
+	server at IP address 10.1.2.4. 
+
+Em seguida, o nó um, dispositivo um, envia o pacote de eco UDP para o servidor no endereço IP 10.1.2.4.
+
+::
+
+  2.003801 IP 10.1.1.1.49153 > 10.1.2.4.9: UDP, length 1024
+
+..
+	The server receives the echo request and turns the packet around trying to send
+	it back to the source.  The server knows that this address is on another network
+	that it reaches via IP address 10.1.2.1.  This is because we initialized global
+	routing and it has figured all of this out for us.  But, the echo server node
+	doesn't know the MAC address of the first CSMA node, so it has to ARP for it
+	just like the first CSMA node had to do.
+
+O servidor recebe a solicitação de eco e tenta enviar de volta para a origem. O servidor sabe que este endereço está em outra rede que chega através do endereço IP 10.1.2.1. Isto porque inicializamos o roteamento global. Entretanto, o nó servidor de eco não sabe o endereço MAC do primeiro nó CSMA, por isso tem que solicitar via ARP assim como o primeiro nó CSMA teve que fazer.
+
+::
+
+  2.003811 arp who-has 10.1.2.1 (ff:ff:ff:ff:ff:ff) tell 10.1.2.4
+  2.003822 arp reply 10.1.2.1 is-at 00:00:00:00:00:03
+
+..
+	The server then sends the echo back to the forwarding node.
+
+O servidor então envia o eco de volta ao nó de encaminhamento.
+
+::
+
+  2.003915 IP 10.1.2.4.9 > 10.1.1.1.49153: UDP, length 1024
+
+..
+	Looking back at the rightmost node of the point-to-point link,
+
+Analisando o nó mais à direita da ligação ponto-a-ponto,
+
+::
+
+  tcpdump -nn -tt -r second-1-0.pcap
+
+..
+	You can now see the echoed packet coming back onto the point-to-point link as
+	the last line of the trace dump.
+
+Observamos o pacote que ecoou vindo de volta para a lingação ponto-a-ponto na última linha do despejo.
+
+::
+
+  reading from file second-1-0.pcap, link-type PPP (PPP)
+  2.003686 IP 10.1.1.1.49153 > 10.1.2.4.9: UDP, length 1024
+  2.003915 IP 10.1.2.4.9 > 10.1.1.1.49153: UDP, length 1024
+
+..
+	Lastly, you can look back at the node that originated the echo
+
+Finalmente, analisando o nó que originou o eco,
+
+::
+
+  tcpdump -nn -tt -r second-0-0.pcap
+
+..
+	and see that the echoed packet arrives back at the source at 2.007602 seconds,
+
+vericamos que o pacote eco chega de volta na fonte em 2,007602 segundos
+
+::
+
+  reading from file second-0-0.pcap, link-type PPP (PPP)
+  2.000000 IP 10.1.1.1.49153 > 10.1.2.4.9: UDP, length 1024
+  2.007602 IP 10.1.2.4.9 > 10.1.1.1.49153: UDP, length 1024
+
+..
+	Finally, recall that we added the ability to control the number of CSMA devices
+	in the simulation by command line argument.  You can change this argument in
+	the same way as when we looked at changing the number of packets echoed in the
+	``first.cc`` example.  Try running the program with the number of "extra" 
+	devices set to four:
+
+Finalmente, lembre-se que adicionamos a habilidade de controlar o número de dispositivos CSMA na simulação por meio da linha de comando. Você pode alterar esse argumento da mesma forma como quando alteramos o número de pacotes de eco no exemplo ``first.cc``. Tente executar o programa com o número de dispositivos "extra" em quatro:
+
+::
+
+  ./waf --run "scratch/mysecond --nCsma=4"
+
+..
+	You should now see,
+
+Você deve ver agora:
+
+::
+
+  Waf: Entering directory `/home/craigdo/repos/ns-3-allinone/ns-3-dev/build'
+  Waf: Leaving directory `/home/craigdo/repos/ns-3-allinone/ns-3-dev/build'
+  'build' finished successfully (0.405s)
+  Sent 1024 bytes to 10.1.2.5
+  Received 1024 bytes from 10.1.1.1
+  Received 1024 bytes from 10.1.2.5
+
+..
+	Notice that the echo server has now been relocated to the last of the CSMA
+	nodes, which is 10.1.2.5 instead of the default case, 10.1.2.4.
+
+Observe que o servidor de eco foi agora transferido para o último dos nós CSMA, que é 10.1.2.5 em vez de o caso padrão, 10.1.2.4.
+
+..
+	It is possible that you may not be satisfied with a trace file generated by
+	a bystander in the CSMA network.  You may really want to get a trace from
+	a single device and you may not be interested in any other traffic on the 
+	network.  You can do this fairly easily.
+
+É possível que você não se satisfaça com um arquivo de rastreamento gerado por um espectador na rede CSMA. Você pode querer obter o rastreamento de um único dispositivo e pode não estar interessado em qualquer outro tráfego na rede. Você pode fazer isso facilmente.
+
+..
+	Let's take a look at ``scratch/mysecond.cc`` and add that code enabling us
+	to be more specific.  ``ns-3`` helpers provide methods that take a node
+	number and device number as parameters.  Go ahead and replace the 
+	``EnablePcap`` calls with the calls below.
+
+Vamos dar uma olhada em ``scratch/mysecond.cc`` e adicionar o código permitindo-nos ser mais específicos. Os assistentes do ``ns-3`` fornecem métodos que recebem um número de nó e um número de dispositivo como parâmetros. Substitua as chamadas ``EnablePcap`` pelas seguites:
+
+::
+
+  pointToPoint.EnablePcap ("second", p2pNodes.Get (0)->GetId (), 0);
+  csma.EnablePcap ("second", csmaNodes.Get (nCsma)->GetId (), 0, false);
+  csma.EnablePcap ("second", csmaNodes.Get (nCsma-1)->GetId (), 0, false);
+
+..
+	We know that we want to create a pcap file with the base name "second" and
+	we also know that the device of interest in both cases is going to be zero,
+	so those parameters are not really interesting.
+
+Sabemos que queremos criar um arquivo pcap com o nome base "second" e sabemos também que o dispositivo de interesse em ambos os casos vai ser o zero, então estes parâmetros não são interessantes.
+
+..
+	In order to get the node number, you have two choices:  first, nodes are 
+	numbered in a monotonically increasing fashion starting from zero in the 
+	order in which you created them.  One way to get a node number is to figure 
+	this number out "manually" by contemplating the order of node creation.  
+	If you take a look at the network topology illustration at the beginning of 
+	the file, we did this for you and you can see that the last CSMA node is 
+	going to be node number ``nCsma + 1``.  This approach can become 
+	annoyingly difficult in larger simulations.  
+
+
+A fim de obter o número do nó, você tem duas opções: primeiro, os nós são numerados de forma crescente a partir de zero na ordem em que você os cria. Uma maneira de obter um número de nó é descobrir este número "manualmente" através da ordem de criação. Se olharmos na ilustração da topologia da rede no início do arquivo, perceberemos que foi o que fizemos. Isto pode ser visto porque o último nó CSMA vai ser o de número ``nCsma + 1``. Esta abordagem pode tornar-se muito difícil em simulações maiores.
+
+..
+	An alternate way, which we use here, is to realize that the
+	``NodeContainers`` contain pointers to |ns3| ``Node`` Objects.
+	The ``Node`` Object has a method called ``GetId`` which will return that
+	node's ID, which is the node number we seek.  Let's go take a look at the 
+	Doxygen for the ``Node`` and locate that method, which is further down in 
+	the |ns3| core code than we've seen so far; but sometimes you have to
+	search diligently for useful things.
+
+Uma maneira alternativa, que usamos aqui, é perceber que os ``NodeContainers`` contêm ponteiros para objetos ``Node`` do |ns3|. O objeto ``Node`` tem um método chamado ``GetId`` que retornará o ID do nó, que é o número do nó que buscamos. Vamos dar uma olhada por ``Node`` no Doxygen e localizar esse método, que está mais abaixo no código do núcleo do que vimos até agora. Às vezes você tem que procurar diligentemente por coisas úteis.
+
+..
+	Go to the Doxygen documentation for your release (recall that you can find it
+	on the project web site).  You can get to the ``Node`` documentation by
+	looking through at the "Classes" tab and scrolling down the "Class List" 
+	until you find ``ns3::Node``.  Select ``ns3::Node`` and you will be taken
+	to the documentation for the ``Node`` class.  If you now scroll down to the
+	``GetId`` method and select it, you will be taken to the detailed 
+	documentation for the method.  Using the ``GetId`` method can make 
+	determining node numbers much easier in complex topologies.
+
+Consulte a documentação em Doxygen para a sua distribuição do ns (lembre-se que você pode encontrá-la no site do projeto). Você pode chegar a documentação sobre o objeto ``Node`` procurando pela guia "Classes", até encontrar ``ns3::Node`` na "Class List". Selecione ``ns3::Node`` e você será levado a documentação para a classe ``Node``. Se você ir até o método ``GetId`` e selecioná-lo, será levado a documentação detalhada do método. Usar o método ``getId`` pode tornar muito mais fácil determinar os números dos nós em topologias complexas.
+
+..
+	Let's clear the old trace files out of the top-level directory to avoid confusion
+	about what is going on,
+
+Vamos limpar os arquivos de rastreamento antigos do diretório raiz para evitar confusão sobre o que está acontecendo,
+
+::
+
+  rm *.pcap
+  rm *.tr
+
+..
+	If you build the new script and run the simulation setting ``nCsma`` to 100,
+
+Se você compilar o novo código e executar a simulação com ``nCsma`` em 100,
+
+::
+
+  ./waf --run "scratch/mysecond --nCsma=100"
+
+..
+	you will see the following output:
+
+você vai observar a seguinte saída:
+
+::
+
+  Waf: Entering directory `/home/craigdo/repos/ns-3-allinone/ns-3-dev/build'
+  Waf: Leaving directory `/home/craigdo/repos/ns-3-allinone/ns-3-dev/build'
+  'build' finished successfully (0.407s)
+  Sent 1024 bytes to 10.1.2.101
+  Received 1024 bytes from 10.1.1.1
+  Received 1024 bytes from 10.1.2.101
+
+..
+	Note that the echo server is now located at 10.1.2.101 which corresponds to
+	having 100 "extra" CSMA nodes with the echo server on the last one.  If you
+	list the pcap files in the top level directory you will see,
+
+Observe que o servidor de eco está agora em 10.1.2.101, que corresponde a ter 100 nós CSMA "extras" com o servidor de eco no último. Se você listar os arquivos pcap no diretório principal, você verá,
+
+::
+
+  second-0-0.pcap  second-100-0.pcap  second-101-0.pcap
+
+..
+	The trace file ``second-0-0.pcap`` is the "leftmost" point-to-point device
+	which is the echo packet source.  The file ``second-101-0.pcap`` corresponds
+	to the rightmost CSMA device which is where the echo server resides.  You may 
+	have noticed that the final parameter on the call to enable pcap tracing on the 
+	echo server node was false.  This means that the trace gathered on that node
+	was in non-promiscuous mode.
+
+O arquivo de rastreamento ``second-0-0.pcap`` é o dispositivo ponto-a-ponto "mais à esquerda" que é a origem do pacote de eco. O arquivo ``second-101-0.pcap`` corresponde ao dispositivo CSMA mais à direita que é onde o servidor de eco reside. O leitor deve ter notado que o parâmetro final na chamada para ativar o rastreamento no nó servidor era falso. Isto significa que o rastreamento nesse nó estava em modo não-promíscuo.
+
+..
+	To illustrate the difference between promiscuous and non-promiscuous traces, we
+	also requested a non-promiscuous trace for the next-to-last node.  Go ahead and
+	take a look at the ``tcpdump`` for ``second-100-0.pcap``.
+
+Para ilustrar a diferença entre o rastreamento promíscuo e o não promíscuo, também solicitamos um rastreamento não-promíscuo para o nó vizinho ao último. Dê uma olhada no ``tcpdump`` para ``second-100-0.pcap``.
+
+::
+
+  tcpdump -nn -tt -r second-100-0.pcap
+
+..
+	You can now see that node 100 is really a bystander in the echo exchange.  The
+	only packets that it receives are the ARP requests which are broadcast to the
+	entire CSMA network.
+
+Agora observamos que o nó 100 é realmente um espectador na troca de eco. Os únicos pacotes que ele recebe são os pedidos ARP que são transmitidos para a rede CSMA inteira (em broadcast).
+
+::
+
+  reading from file second-100-0.pcap, link-type EN10MB (Ethernet)
+  2.003696 arp who-has 10.1.2.101 (ff:ff:ff:ff:ff:ff) tell 10.1.2.1
+  2.003811 arp who-has 10.1.2.1 (ff:ff:ff:ff:ff:ff) tell 10.1.2.101
+
+..
+	Now take a look at the ``tcpdump`` for ``second-101-0.pcap``.
+
+Agora, dê uma olhada no ``tcpdump`` para ``second-101-0.pcap``.
+
+::
+
+  tcpdump -nn -tt -r second-101-0.pcap
+
+..
+	You can now see that node 101 is really the participant in the echo exchange.
+
+Observamos que o nó 101 é realmente o participante na troca de eco.
+
+::
+
+  reading from file second-101-0.pcap, link-type EN10MB (Ethernet)
+  2.003696 arp who-has 10.1.2.101 (ff:ff:ff:ff:ff:ff) tell 10.1.2.1
+  2.003696 arp reply 10.1.2.101 is-at 00:00:00:00:00:67
+  2.003801 IP 10.1.1.1.49153 > 10.1.2.101.9: UDP, length 1024
+  2.003801 arp who-has 10.1.2.1 (ff:ff:ff:ff:ff:ff) tell 10.1.2.101
+  2.003822 arp reply 10.1.2.1 is-at 00:00:00:00:00:03
+  2.003822 IP 10.1.2.101.9 > 10.1.1.1.49153: UDP, length 1024
+
+
+.. Models, Attributes and Reality
+
+Modelos, atributos e a ``sua`` realidade
+*****************************************
+
+..
+	This is a convenient place to make a small excursion and make an important
+	point.  It may or may not be obvious to you, but whenever one is using a 
+	simulation, it is important to understand exactly what is being modeled and
+	what is not.  It is tempting, for example, to think of the CSMA devices 
+	and channels used in the previous section as if they were real Ethernet 
+	devices; and to expect a simulation result to directly reflect what will 
+	happen in a real Ethernet.  This is not the case.  
+
+Este é um local conveniente para fazer uma pequena excursão e fazer uma observação importante. Pode ou não ser óbvio para o leitor, mas sempre que alguém está usando uma simulação, é importante entender exatamente o que está sendo modelado e o que não está. É tentador, por exemplo, pensar nos dispositivos e canais CSMA utilizados na seção anterior como se fossem dispositivos Ethernet reais, e esperar um resultado que vai refletir diretamente o que aconteceria em uma Ethernet real. Este não é o caso.
+
+..
+	A model is, by definition, an abstraction of reality.  It is ultimately the 
+	responsibility of the simulation script author to determine the so-called
+	"range of accuracy" and "domain of applicability" of the simulation as
+	a whole, and therefore its constituent parts.
+
+Um modelo é, por definição, uma abstração da realidade. Em última análise, é responsabilidade do autor do código da simulação determinar a chamada "faixa de precisão" e "domínio de aplicabilidade" da simulação como um todo e, portanto, suas partes constituintes.
+
+..
+	In some cases, like ``Csma``, it can be fairly easy to determine what is 
+	*not* modeled.  By reading the model description (``csma.h``) you 
+	can find that there is no collision detection in the CSMA model and decide
+	on how applicable its use will be in your simulation or what caveats you 
+	may want to include with your results.  In other cases, it can be quite easy
+	to configure behaviors that might not agree with any reality you can go out
+	and buy.  It will prove worthwhile to spend some time investigating a few
+	such instances, and how easily you can swerve outside the bounds of reality
+	in your simulations.
+
+Em alguns casos, como no ``Csma``, pode ser bastante fácil de determinar o que é *não* modelado. Ao ler a descrição do fonte (``csma.h``) você descobrirá que não há detecção de colisão e poderá decidir sobre quão aplicável a sua utilização será em sua simulação ou quais ressalvas pode querer incluir em seus resultados. Em outros casos, pode ser razoavelmente fácil configurar comportamentos que podem não existir em qualquer equipamento real que possa ser comprado por aí. Vale a pena gastar algum tempo investigando tais casos e quão facilmente pode-se desviar para fora dos limites da realidade em suas simulações.
+
+..
+	As you have seen, |ns3| provides ``Attributes`` which a user
+	can easily set to change model behavior.  Consider two of the ``Attributes``
+	of the ``CsmaNetDevice``:  ``Mtu`` and ``EncapsulationMode``.  
+	The ``Mtu`` attribute indicates the Maximum Transmission Unit to the 
+	device.  This is the size of the largest Protocol Data Unit (PDU) that the
+	device can send.  
+
+Como você viu, o |ns3| fornece atributos que um usuário pode facilmente configurar para mudar o comportamento do modelo. Considere dois dos ``atributos`` do ``CsmaNetDevice``: ``Mtu`` e ``EncapsulationMode``. O atributo ``Mtu`` indica a unidade máxima de transmissão para o dispositivo. Este é o tamanho máximo do Protocol Data Unit (PDU) que o dispositivo pode enviar.
+
+..
+	The MTU defaults to 1500 bytes in the ``CsmaNetDevice``.  This default
+	corresponds to a number found in RFC 894, "A Standard for the Transmission
+	of IP Datagrams over Ethernet Networks."  The number is actually derived 
+	from the maximum packet size for 10Base5 (full-spec Ethernet) networks -- 
+	1518 bytes.  If you subtract the DIX encapsulation overhead for Ethernet 
+	packets (18 bytes) you will end up with a maximum possible data size (MTU) 
+	of 1500 bytes.  One can also find that the ``MTU`` for IEEE 802.3 networks
+	is 1492 bytes.  This is because LLC/SNAP encapsulation adds an extra eight 
+	bytes of overhead to the packet.  In both cases, the underlying hardware can
+	only send 1518 bytes, but the data size is different.
+
+O valor padrão para o MTU é 1500 bytes na ``CsmaNetDevice``. Este padrão corresponde a um número encontrado na RFC 894, "Um padrão para a transmissão de datagramas IP sobre redes Ethernet". O número é derivado do tamanho máximo do pacote para redes 10Base5 (full-spec Ethernet) -- 1518 bytes. Se você subtrair a sobrecarga de encapsulamento DIX para pacotes Ethernet (18 bytes), você vai acabar com o tamanho máximo possível de dados (MTU) de 1500 bytes. Pode-se também encontrar que o ``MTU`` para redes IEEE 802.3 é 1492 bytes. Isto é porque o encapsulamento LLC/SNAP acrescenta oito bytes extra de sobrecarga para o pacote. Em ambos os casos, o hardware subjacente pode enviar apenas 1518 bytes, mas o tamanho dos dados é diferente.
+
+..
+	In order to set the encapsulation mode, the ``CsmaNetDevice`` provides
+	an ``Attribute`` called ``EncapsulationMode`` which can take on the 
+	values ``Dix`` or ``Llc``.  These correspond to Ethernet and LLC/SNAP
+	framing respectively.
+
+A fim de definir o modo de encapsulamento, o ``CsmaNetDevice`` fornece um atributo chamado ``EncapsulationMode`` que pode assumir os valores ``Dix`` ou ``Llc``. Estes correspondem ao enquadramento Ethernet e LLC/SNAP, respectivamente.
+
+..
+	If one leaves the ``Mtu`` at 1500 bytes and changes the encapsulation mode
+	to ``Llc``, the result will be a network that encapsulates 1500 byte PDUs
+	with LLC/SNAP framing resulting in packets of 1526 bytes, which would be 
+	illegal in many networks, since they can transmit a maximum of 1518 bytes per
+	packet.  This would most likely result in a simulation that quite subtly does
+	not reflect the reality you might be expecting.
+
+Se deixarmos o ``Mtu`` com 1500 bytes e mudarmos o encapsulamento para ``Llc``, o resultado será uma rede que encapsula PDUs de 1500 bytes com enquadramento LLC/SNAP, resultando em pacotes de 1526 bytes, o que seria ilegal em muitas redes, pois elas podem transmitir um máximo de 1518 bytes por pacote. Isto resultaria em uma simulação que, de maneira sutil, não refletiria a realidade que você possa estar esperando.
+
+..
+	Just to complicate the picture, there exist jumbo frames (1500 < MTU <= 9000 bytes)
+	and super-jumbo (MTU > 9000 bytes) frames that are not officially sanctioned
+	by IEEE but are available in some high-speed (Gigabit) networks and NICs.  One
+	could leave the encapsulation mode set to ``Dix``, and set the ``Mtu``
+	``Attribute`` on a ``CsmaNetDevice`` to 64000 bytes -- even though an 
+	associated ``CsmaChannel DataRate`` was set at 10 megabits per second.  
+	This would essentially model an Ethernet switch made out of vampire-tapped
+	1980s-style 10Base5 networks that support super-jumbo datagrams.  This is
+	certainly not something that was ever made, nor is likely to ever be made,
+	but it is quite easy for you to configure.
+
+Só para complicar o cenário, existem quadros jumbo (1500 < MTU <= 9000 bytes) e quadros super-jumbo (MTU > 9000 bytes) que não são oficialmente especificados pela IEEE, mas estão disponíveis em alguns equipamentos de redes de alta velocidade (Gigabit) e NICs. Alguém poderia deixar o encapsulamento em ``Dix``, e definir o atributo ``Mtu`` em um dispositivo ``CsmaNetDevice`` para 64000 bytes -- mesmo que o atributo ``CsmaChannel DataRate`` associado esteja fixado em 10 megabits por segundo. Isto modelaria um equipamento Ethernet 10Base5, dos anos 80, suportando quadros super-jumbo. Isto é certamente algo que nunca foi feito, nem é provável que alguma vez seja feito, mas é bastante fácil de configurar.
+
+..
+	In the previous example, you used the command line to create a simulation that
+	had 100 ``Csma`` nodes.  You could have just as easily created a simulation
+	with 500 nodes.  If you were actually modeling that 10Base5 vampire-tap network,
+	the maximum length of a full-spec Ethernet cable is 500 meters, with a minimum 
+	tap spacing of 2.5 meters.  That means there could only be 200 taps on a 
+	real network.  You could have quite easily built an illegal network in that
+	way as well.  This may or may not result in a meaningful simulation depending
+	on what you are trying to model.
+
+No exemplo anterior, usamos a linha de comando para criar uma simulação que tinha 100 nós ``CSMA``. Poderíamos ter facilmente criado uma simulação com 500 nós. Se fossemos de fato modelar uma rede com conectores de pressão `(vampire-taps)` 10Base5, o comprimento máximo do cabo Ethernet é 500 metros, com um espaçamento mínimo entre conectores de 2,5 metros. Isso significa que só poderia haver 200 máquinas em uma rede real. Poderíamos facilmente construir uma rede ilegal desta maneira também. Isto pode ou não resultar em uma simulação significativa dependendo do que você está tentando modelar.
+
+..
+	Similar situations can occur in many places in |ns3| and in any
+	simulator.  For example, you may be able to position nodes in such a way that
+	they occupy the same space at the same time, or you may be able to configure
+	amplifiers or noise levels that violate the basic laws of physics.
+
+Situações similares podem ocorrer em muitos momentos no |ns3|, assim como em qualquer simulador. Por exemplo, você pode posicionar os nós de tal forma que ocupem o mesmo espaço ao mesmo tempo ou você pode ser capaz de configurar amplificadores ou níveis de ruído que violam as leis básicas da física.
+
+..
+	|ns3| generally favors flexibility, and many models will allow freely
+	setting ``Attributes`` without trying to enforce any arbitrary consistency
+	or particular underlying spec.
+
+O |ns3| geralmente favorece a flexibilidade, e muitos modelos permitirão a configuração de atributos sem impor qualquer consistência ou especificação especial subjacente.
+
+..
+	The thing to take home from this is that |ns3| is going to provide a
+	super-flexible base for you to experiment with.  It is up to you to understand
+	what you are asking the system to do and to  make sure that the simulations you
+	create have some meaning and some connection with a reality defined by you.
+
+
+Em resumo, o importante é que o |ns3| vai fornecer uma base super flexível para experimentações. Depende de você entender o que está requisitando ao sistema e se certificar de que as simulações tem algum significado e alguma ligação com a sua realidade.
+
+.. 
+	Building a Wireless Network Topology
+
+Construindo uma rede sem fio
+************************************
+
+..
+	In this section we are going to further expand our knowledge of |ns3|
+	network devices and channels to cover an example of a wireless network.  
+	|ns3| provides a set of 802.11 models that attempt to provide an 
+	accurate MAC-level implementation of the 802.11 specification and a 
+	"not-so-slow" PHY-level model of the 802.11a specification.
+
+Nesta seção, vamos expandir ainda mais nosso conhecimento sobre dispositivos e canais do |ns3| para cobrir um exemplo de uma rede sem fio. O |ns3| fornece um conjunto de modelos 802.11 que tentam fornecer uma implementação precisa a nível MAC da especificação 802.11 e uma implementação "não-tão-lenta" a nível PHY da especificação 802.11a.
+
+..
+	Just as we have seen both point-to-point and CSMA topology helper objects when
+	constructing point-to-point topologies, we will see equivalent ``Wifi``
+	topology helpers in this section.  The appearance and operation of these 
+	helpers should look quite familiar to you.
+
+Assim como vimos assistentes de topologia (objetos) ponto-a-ponto e CSMA quando da construção destes modelos, veremos assistentes ``Wifi`` similares nesta seção. O formato e o funcionamento destes assistentes devem parecer bastante familiar ao leitor.
+
+..
+	We provide an example script in our ``examples/tutorial`` directory.  This script
+	builds on the ``second.cc`` script and adds a Wifi network.  Go ahead and
+	open ``examples/tutorial/third.cc`` in your favorite editor.  You will have already
+	seen enough |ns3| code to understand most of what is going on in 
+	this example, but there are a few new things, so we will go over the entire 
+	script and examine some of the output.
+
+Fornecemos um exemplo no diretório ``examples/tutorial``. Este arquivo baseia-se no código presente em ``second.cc`` e adiciona uma rede Wifi a ele. Vá em frente e abra ``examples/tutorial/third.cc`` em seu editor favorito. Você já deve ter visto código |ns3| suficiente para entender a maior parte do que está acontecendo neste exemplo, existem algumas coisas novas, mas vamos passar por todo o código e examinar alguns dos resultados.
+
+..
+	Just as in the ``second.cc`` example (and in all |ns3| examples)
+	the file begins with an emacs mode line and some GPL boilerplate.
+
+Assim como no exemplo ``second.cc`` (e em todos os exemplos ns-3), o arquivo
+começa com uma linha de modo emacs e algumas linhas do padrão GPL.
+
+..
+	Take a look at the ASCII art (reproduced below) that shows the default network
+	topology constructed in the example.  You can see that we are going to 
+	further extend our example by hanging a wireless network off of the left side.
+	Notice that this is a default network topology since you can actually vary the
+	number of nodes created on the wired and wireless networks.  Just as in the 
+	``second.cc`` script case, if you change ``nCsma``, it will give you a 
+	number of "extra" CSMA nodes.  Similarly, you can set ``nWifi`` to 
+	control how many ``STA`` (station) nodes are created in the simulation.
+	There will always be one ``AP`` (access point) node on the wireless 
+	network.  By default there are three "extra" CSMA nodes and three wireless 
+	``STA`` nodes.
+
+Dê uma olhada na arte ASCII (reproduzida abaixo) que mostra topologia de rede construída no exemplo. Você pode ver que estamos ampliando ainda mais nosso exemplo agregando uma rede sem fio do lado esquerdo. Observe que esta é uma topologia de rede padrão, pois você pode variar o número de nós criados nas redes com fio e sem fio. Assim como no exemplo ``second.cc``, se você mudar ``nCsma``, ele lhe dará um número "extra" de nós CSMA. Da mesma forma, você pode definir ``nWifi`` para controlar quantos nós (estações) ``STA`` serão criados na simulação. Sempre haverá um nó ``AP`` (*access point*) na rede sem fio. Por padrão, existem três nós "extra" no CSMA e três nós sem fio ``STA``.
+
+..
+	The code begins by loading module include files just as was done in the
+	``second.cc`` example.  There are a couple of new includes corresponding
+	to the Wifi module and the mobility module which we will discuss below.
+
+O código começa pelo carregamento de módulos através da inclusão dos arquivos, assim como no exemplo ``second.cc``. Há algumas novas inclusões correspondentes ao módulo Wifi e ao módulo de mobilidade que discutiremos a seguir.
+
+::
+
+#include "ns3/core-module.h"
+#include "ns3/point-to-point-module.h"
+#include "ns3/network-module.h"
+#include "ns3/applications-module.h"
+#include "ns3/wifi-module.h"
+#include "ns3/mobility-module.h"
+#include "ns3/csma-module.h"
+#include "ns3/internet-module.h"
+
+..
+	The network topology illustration follows:
+
+A ilustração da topologia da rede é a seguinte:
+
+::
+
+  // Default Network Topology
+  //
+  //   Wifi 10.1.3.0
+  //                 AP
+  //  *    *    *    *
+  //  |    |    |    |    10.1.1.0
+  // n5   n6   n7   n0 -------------- n1   n2   n3   n4
+  //                   point-to-point  |    |    |    |
+  //                                   ================
+  //                                     LAN 10.1.2.0
+
+..
+	You can see that we are adding a new network device to the node on the left 
+	side of the point-to-point link that becomes the access point for the wireless
+	network.  A number of wireless STA nodes are created to fill out the new 
+	10.1.3.0 network as shown on the left side of the illustration.
+
+Observamos que estamos acrescentando um novo dispositivo de rede ao nó à esquerda da ligação ponto-a-ponto que se torna o ponto de acesso da rede sem fios. Alguns nós STA sem fio são criados para preencher a nova rede 10.1.3.0, como mostrado no lado esquerdo da ilustração.
+
+..
+	After the illustration, the ``ns-3`` namespace is ``used`` and a logging
+	component is defined.  This should all be quite familiar by now.
+
+Após a ilustração, o namespace ns-3 é `usado` e um componente de registro é definido. 
+
+::
+
+  using namespace ns3;
+  
+  NS_LOG_COMPONENT_DEFINE ("ThirdScriptExample");
+
+..
+	The main program begins just like ``second.cc`` by adding some command line
+	parameters for enabling or disabling logging components and for changing the 
+	number of devices created.
+
+O programa principal começa exatamente como em ``second.cc``, adicionando parâmetros de linha de comando para habilitar ou desabilitar componentes de registro e para alterar o número de dispositivos criados.
+
+::
+
+  bool verbose = true;
+  uint32_t nCsma = 3;
+  uint32_t nWifi = 3;
+
+  CommandLine cmd;
+  cmd.AddValue ("nCsma", "Number of \"extra\" CSMA nodes/devices", nCsma);
+  cmd.AddValue ("nWifi", "Number of wifi STA devices", nWifi);
+  cmd.AddValue ("verbose", "Tell echo applications to log if true", verbose);
+
+  cmd.Parse (argc,argv);
+
+  if (verbose)
+    {
+      LogComponentEnable("UdpEchoClientApplication", LOG_LEVEL_INFO);
+      LogComponentEnable("UdpEchoServerApplication", LOG_LEVEL_INFO);
+    }
+
+..
+	Just as in all of the previous examples, the next step is to create two nodes
+	that we will connect via the point-to-point link.  
+
+Assim como em todos os exemplos anteriores, o próximo passo é a criação de dois nós
+que irão se ligar através da ligação ponto-a-ponto.
+
+::
+
+  NodeContainer p2pNodes;
+  p2pNodes.Create (2);
+
+..
+	Next, we see an old friend.  We instantiate a ``PointToPointHelper`` and 
+	set the associated default ``Attributes`` so that we create a five megabit 
+	per second transmitter on devices created using the helper and a two millisecond 
+	delay on channels created by the helper.  We then ``Intall`` the devices
+	on the nodes and the channel between them.
+
+Em seguida, instanciamos um ``PointToPointHelper`` e definimos os atributos padrões para criar uma transmissão de cinco megabits por segundo e dois milésimos de segundo de atraso para dispositivos que utilizam este assistente. Então ``instalamos`` os dispositivos nos nós e o canal entre eles.
+
+::
+
+  PointToPointHelper pointToPoint;
+  pointToPoint.SetDeviceAttribute ("DataRate", StringValue ("5Mbps"));
+  pointToPoint.SetChannelAttribute ("Delay", StringValue ("2ms"));
+
+  NetDeviceContainer p2pDevices;
+  p2pDevices = pointToPoint.Install (p2pNodes);
+
+..
+	Next, we declare another ``NodeContainer`` to hold the nodes that will be
+	part of the bus (CSMA) network.
+
+Em seguida, declaramos outro ``NodeContainer`` para manter os nós que serão parte da rede em barramento (CSMA).
+
+::
+
+  NodeContainer csmaNodes;
+  csmaNodes.Add (p2pNodes.Get (1));
+  csmaNodes.Create (nCsma);
+
+..
+	The next line of code ``Gets`` the first node (as in having an index of one)
+	from the point-to-point node container and adds it to the container of nodes
+	that will get CSMA devices.  The node in question is going to end up with a 
+	point-to-point device and a CSMA device.  We then create a number of "extra"
+	nodes that compose the remainder of the CSMA network.
+
+A próxima linha de código ``obtém`` o primeiro nó do contêiner ponto-a-ponto e o adiciona ao contêiner de nós
+que irão receber dispositivos CSMA. O nó em questão vai acabar com um dispositivo ponto-a-ponto e um dispositivo CSMA. Em seguida, criamos uma série de nós "extra" que compõem o restante da rede CSMA.
+
+..
+	We then instantiate a ``CsmaHelper`` and set its ``Attributes`` as we did
+	in the previous example.  We create a ``NetDeviceContainer`` to keep track of
+	the created CSMA net devices and then we ``Install`` CSMA devices on the 
+	selected nodes.
+
+Em seguida, instanciamos um ``CsmaHelper`` e definimos seus atributos assim como fizemos no exemplo anterior. Criamos um ``NetDeviceContainer`` para gerenciar os dispositivos CSMA criados e então ``instalamos`` dispositivos CSMA nos nós selecionados.
+
+::
+
+  CsmaHelper csma;
+  csma.SetChannelAttribute ("DataRate", StringValue ("100Mbps"));
+  csma.SetChannelAttribute ("Delay", TimeValue (NanoSeconds (6560)));
+
+  NetDeviceContainer csmaDevices;
+  csmaDevices = csma.Install (csmaNodes);
+
+..
+	Next, we are going to create the nodes that will be part of the Wifi network.
+	We are going to create a number of "station" nodes as specified by the 
+	command line argument, and we are going to use the "leftmost" node of the 
+	point-to-point link as the node for the access point.
+
+Em seguida, vamos criar os nós que farão parte da rede Wifi. Vamos criar alguns nós "estações", conforme especificado na linha de comando, e iremos usar o nó "mais à esquerda" da rede ponto-a-ponto como o nó para o ponto de acesso.
+
+::
+
+  NodeContainer wifiStaNodes;
+  wifiStaNodes.Create (nWifi);
+  NodeContainer wifiApNode = p2pNodes.Get (0);
+
+..
+	The next bit of code constructs the wifi devices and the interconnection
+	channel between these wifi nodes. First, we configure the PHY and channel
+	helpers:
+
+A próxima parte do código constrói os dispositivos Wifi e o canal de interligação entre esses nós. Primeiro, vamos configurar os assistentes PHY e de canal:
+
+::
+
+  YansWifiChannelHelper channel = YansWifiChannelHelper::Default ();
+  YansWifiPhyHelper phy = YansWifiPhyHelper::Default ();
+
+..
+	For simplicity, this code uses the default PHY layer configuration and
+	channel models which are documented in the API doxygen documentation for
+	the ``YansWifiChannelHelper::Default`` and ``YansWifiPhyHelper::Default``
+	methods. Once these objects are created, we create a channel object
+	and associate it to our PHY layer object manager to make sure
+	that all the PHY layer objects created by the ``YansWifiPhyHelper``
+	share the same underlying channel, that is, they share the same
+	wireless medium and can communication and interfere:
+
+Para simplificar, este código usa a configuração padrão da camada PHY e modelos de canais que estão documentados na API doxygen para os métodos ``YansWifiChannelHelper::Default`` e ``YansWifiPhyHelper::Default``. Uma vez que esses objetos são instanciados, criamos um objeto de canal e associamos ele ao nosso gerente de objetos da camada PHY para nos certificarmos de que todos os objetos da camada PHY criados pelo ``YansWifiPhyHelper`` compartilham o mesmo canal subjacente, isto é, eles compartilham o mesmo meio físico sem fio e podem comunicar-se e interferir:
+
+::
+
+  phy.SetChannel (channel.Create ());
+
+..
+	Once the PHY helper is configured, we can focus on the MAC layer. Here we choose to
+	work with non-Qos MACs so we use a NqosWifiMacHelper object to set MAC parameters. 
+
+Uma vez que o assistente PHY está configurado, podemos nos concentrar na camada MAC. Aqui escolhemos
+trabalhar com MACs não-Qos, por isso usamos um objeto ``NqosWifiMacHelper`` para definir os parâmetros MAC.
+
+::
+
+  WifiHelper wifi = WifiHelper::Default ();
+  wifi.SetRemoteStationManager ("ns3::AarfWifiManager");
+
+  NqosWifiMacHelper mac = NqosWifiMacHelper::Default ();
+
+..
+	The ``SetRemoteStationManager`` method tells the helper the type of 
+	rate control algorithm to use.  Here, it is asking the helper to use the AARF
+	algorithm --- details are, of course, available in Doxygen.
+
+O método ``SetRemoteStationManager`` diz ao assistente o tipo de algoritmo de controle de taxa a usar. Aqui, ele está pedindo ao assistente para usar o algoritmo AARF --- os detalhes estão disponíveis no Doxygen.
+
+..
+	Next, we configure the type of MAC, the SSID of the infrastructure network we
+	want to setup and make sure that our stations don't perform active probing:
+
+Em seguida, configuramos o tipo de MAC, o SSID da rede de infraestrutura, e nos certificamos que as estações não realizam sondagem ativa (active probing):
+
+::
+
+  Ssid ssid = Ssid ("ns-3-ssid");
+  mac.SetType ("ns3::StaWifiMac",
+    "Ssid", SsidValue (ssid),
+    "ActiveProbing", BooleanValue (false));
+
+..
+	This code first creates an 802.11 service set identifier (SSID) object
+	that will be used to set the value of the "Ssid" ``Attribute`` of
+	the MAC layer implementation.  The particular kind of MAC layer that
+	will be created by the helper is specified by ``Attribute`` as
+	being of the "ns3::StaWifiMac" type.  The use of
+	``NqosWifiMacHelper`` will ensure that the "QosSupported"
+	``Attribute`` for created MAC objects is set false. The combination
+	of these two configurations means that the MAC instance next created
+	will be a non-QoS non-AP station (STA) in an infrastructure BSS (i.e.,
+	a BSS with an AP).  Finally, the "ActiveProbing" ``Attribute`` is
+	set to false.  This means that probe requests will not be sent by MACs
+	created by this helper.
+
+Este código primeiro cria um objeto de um identificador de conjunto de serviços (SSID 802.11) que será utilizado para definir o valor do atributo  "Ssid" da implementação da camada MAC. O tipo particular da camada MAC que será criado pelo assistente é especificado como sendo do tipo "ns3::StaWifiMac". O uso do assistente ``NqosWifiMacHelper`` irá garantir que o atributo "QosSupported" para os objetos MAC criados será falso. A combinação destas duas configurações implica que a instância MAC criada em seguida será uma estação (STA) não-QoS e não-AP, em uma infraestrutura BSS (por exemplo, uma BSS com um AP). Finalmente, o atributo "ActiveProbing" é definido como falso. Isto significa que as solicitações de sondagem não serão enviados pelos MACs criados por este assistente.
+
+..
+	Once all the station-specific parameters are fully configured, both at the
+	MAC and PHY layers, we can invoke our now-familiar ``Install`` method to 
+	create the wifi devices of these stations:
+
+Depois que todos os parâmetros específicos das estações estão completamente configurados, tanto na camada MAC como na PHY, podemos invocar o nosso método já familiar ``Instalar`` para criar os dispositivos Wifi destas estações:
+
+::
+
+  NetDeviceContainer staDevices;
+  staDevices = wifi.Install (phy, mac, wifiStaNodes);
+
+..
+	We have configured Wifi for all of our STA nodes, and now we need to 
+	configure the AP (access point) node.  We begin this process by changing
+	the default ``Attributes`` of the ``NqosWifiMacHelper`` to reflect the 
+	requirements of the AP.
+
+Já configuramos o Wifi para todos nós STA e agora precisamos configurar o AP. Começamos esse processo mudando o atributo padrão ``NqosWifiMacHelper`` para refletir os requisitos do AP.
+
+::
+
+  mac.SetType ("ns3::ApWifiMac",
+    "Ssid", SsidValue (ssid)));
+
+..
+	In this case, the ``NqosWifiMacHelper`` is going to create MAC
+	layers of the "ns3::ApWifiMac", the latter specifying that a MAC
+	instance configured as an AP should be created, with the helper type
+	implying that the "QosSupported" ``Attribute`` should be set to
+	false - disabling 802.11e/WMM-style QoS support at created APs.
+
+Neste caso, o ``NqosWifiMacHelper`` vai criar camadas MAC do "ns3::ApWifiMac", este último especificando que uma instância MAC configurado como um AP deve ser criado, com o tipo de assistente implicando que o atributo "QosSupported" deve ser definido como falso - desativando o suporte a Qos do tipo 802.11e/WMM nos APs criados. 
+
+..
+	The next lines create the single AP which shares the same set of PHY-level
+	``Attributes`` (and channel) as the stations:
+
+As próximas linhas criam um AP que compartilha os mesmos atributos a nível PHY com as estações:
+
+::
+
+  NetDeviceContainer apDevices;
+  apDevices = wifi.Install (phy, mac, wifiApNode);
+
+..
+	Now, we are going to add mobility models.  We want the STA nodes to be mobile,
+	wandering around inside a bounding box, and we want to make the AP node 
+	stationary.  We use the ``MobilityHelper`` to make this easy for us.
+	First, we instantiate a ``MobilityHelper`` object and set some 
+	``Attributes`` controlling the "position allocator" functionality.
+
+Agora, vamos adicionar modelos de mobilidade. Queremos que os nós STA sejam móveis, vagando dentro de uma caixa delimitadora, e queremos fazer o nó AP estacionário. Usamos o ``MobilityHelper`` para facilitar a execução desta tarefa.
+Primeiro, instanciamos um objeto ``MobilityHelper`` e definimos alguns atributos controlando a funcionalidade de "alocação de posição".
+
+::
+
+  MobilityHelper mobility;
+
+  mobility.SetPositionAllocator ("ns3::GridPositionAllocator",
+    "MinX", DoubleValue (0.0),
+    "MinY", DoubleValue (0.0),
+    "DeltaX", DoubleValue (5.0),
+    "DeltaY", DoubleValue (10.0),
+    "GridWidth", UintegerValue (3),
+    "LayoutType", StringValue ("RowFirst"));
+
+..
+	This code tells the mobility helper to use a two-dimensional grid to initially
+	place the STA nodes.  Feel free to explore the Doxygen for class 
+	``ns3::GridPositionAllocator`` to see exactly what is being done.
+
+Este código diz ao assistente de mobilidade para usar uma grade bidimensional para distribuir os nós STA. Sinta-se à vontade para explorar a classe ``ns3::GridPositionAllocator`` no Doxygen para ver exatamente o que está sendo feito.
+
+..
+	We have arranged our nodes on an initial grid, but now we need to tell them
+	how to move.  We choose the ``RandomWalk2dMobilityModel`` which has the 
+	nodes move in a random direction at a random speed around inside a bounding 
+	box.
+
+Arranjamos os nós em uma grade inicial, mas agora precisamos dizer-lhes como se mover. Escolhemos o modelo ``RandomWalk2dMobilityModel`` em que os nós se movem em uma direção aleatória a uma velocidade aleatória dentro de um delimitador quadrado.
+
+::
+
+  mobility.SetMobilityModel ("ns3::RandomWalk2dMobilityModel",
+    "Bounds", RectangleValue (Rectangle (-50, 50, -50, 50)));
+
+..
+	We now tell the ``MobilityHelper`` to install the mobility models on the 
+	STA nodes.
+
+Agora dizemos ao ``MobilityHelper`` para instalar os modelos de mobilidade nos nós STA.
+
+::
+
+  mobility.Install (wifiStaNodes);
+
+..
+	We want the access point to remain in a fixed position during the simulation.
+	We accomplish this by setting the mobility model for this node to be the 
+	``ns3::ConstantPositionMobilityModel``:
+
+Queremos que o ponto de acesso permaneça em uma posição fixa durante a simulação. Conseguimos isto definindo o modelo de mobilidade para este nó como ``ns3::ConstantPositionMobilityModel``:
+
+::
+
+  mobility.SetMobilityModel ("ns3::ConstantPositionMobilityModel");
+  mobility.Install (wifiApNode);
+
+..
+	We now have our nodes, devices and channels created, and mobility models 
+	chosen for the Wifi nodes, but we have no protocol stacks present.  Just as 
+	we have done previously many times, we will use the ``InternetStackHelper``
+	to install these stacks.
+
+Agora temos os nossos nós, dispositivos e canais e modelos de mobilidade escolhidos para os nós Wifi, mas não temos pilhas de protocolo. Assim como já fizemos muitas vezes, usaremos o ``InternetStackHelper`` para instalar estas pilhas.
+
+::
+
+  InternetStackHelper stack;
+  stack.Install (csmaNodes);
+  stack.Install (wifiApNode);
+  stack.Install (wifiStaNodes);
+
+..
+	Just as in the ``second.cc`` example script, we are going to use the 
+	``Ipv4AddressHelper`` to assign IP addresses to our device interfaces.
+	First we use the network 10.1.1.0 to create the two addresses needed for our
+	two point-to-point devices.  Then we use network 10.1.2.0 to assign addresses
+	to the CSMA network and then we assign addresses from network 10.1.3.0 to
+	both the STA devices and the AP on the wireless network.
+
+Assim como no exemplo ``second.cc``, vamos usar o ``Ipv4AddressHelper`` para atribuir endereços IP para as interfaces de nossos dispositivos. Primeiro, usamos a rede 10.1.1.0 para criar os dois endereços necessários para os dois dispositivos ponto-a-ponto. Então, usamos rede 10.1.2.0 para atribuir endereços à rede CSMA e, por último, atribuir endereços da rede 10.1.3.0 para ambos os dispositivos STA e o ponto de acesso na rede sem fio.
+
+::
+
+  Ipv4AddressHelper address;
+
+  address.SetBase ("10.1.1.0", "255.255.255.0");
+  Ipv4InterfaceContainer p2pInterfaces;
+  p2pInterfaces = address.Assign (p2pDevices);
+
+  address.SetBase ("10.1.2.0", "255.255.255.0");
+  Ipv4InterfaceContainer csmaInterfaces;
+  csmaInterfaces = address.Assign (csmaDevices);
+
+  address.SetBase ("10.1.3.0", "255.255.255.0");
+  address.Assign (staDevices);
+  address.Assign (apDevices);
+
+..
+	We put the echo server on the "rightmost" node in the illustration at the
+	start of the file.  We have done this before.
+
+Vamos colocar o servidor de eco no nó "mais à direita" na ilustração no início do arquivo.
+
+::
+
+  UdpEchoServerHelper echoServer (9);
+
+  ApplicationContainer serverApps = echoServer.Install (csmaNodes.Get (nCsma));
+  serverApps.Start (Seconds (1.0));
+  serverApps.Stop (Seconds (10.0));
+
+..
+	And we put the echo client on the last STA node we created, pointing it to
+	the server on the CSMA network.  We have also seen similar operations before.
+
+E colocamos o cliente de eco no último nó STA criado, apontando-o para o servidor na rede CSMA. 
+
+::
+
+  UdpEchoClientHelper echoClient (csmaInterfaces.GetAddress (nCsma), 9);
+  echoClient.SetAttribute ("MaxPackets", UintegerValue (1));
+  echoClient.SetAttribute ("Interval", TimeValue (Seconds (1.)));
+  echoClient.SetAttribute ("PacketSize", UintegerValue (1024));
+
+  ApplicationContainer clientApps =
+    echoClient.Install (wifiStaNodes.Get (nWifi - 1));
+  clientApps.Start (Seconds (2.0));
+  clientApps.Stop (Seconds (10.0));
+
+..
+	Since we have built an internetwork here, we need to enable internetwork routing
+	just as we did in the ``second.cc`` example script.
+
+Uma vez que construímos uma inter-rede aqui, precisamos ativar o roteamento inter-redes, assim como fizemos no exemplo ``second.cc``.
+
+::
+
+  Ipv4GlobalRoutingHelper::PopulateRoutingTables ();
+
+..
+	One thing that can surprise some users is the fact that the simulation we just
+	created will never "naturally" stop.  This is because we asked the wireless
+	access point to generate beacons.  It will generate beacons forever, and this
+	will result in simulator events being scheduled into the future indefinitely,
+	so we must tell the simulator to stop even though it may have beacon generation
+	events scheduled.  The following line of code tells the simulator to stop so that 
+	we don't simulate beacons forever and enter what is essentially an endless
+	loop.
+
+Algo que pode surpreender alguns usuários é o fato de que a simulação que acabamos de criar nunca vai parar "naturalmente". Isto acontece porque pedimos para o ponto de acesso gerar *beacons*. Ele irá gerar *beacons* para sempre, e isso irá resultar em eventos sendo escalonados no futuro indefinidamente, por isso devemos dizer para o simulador parar, ainda que hajam eventos de geração de *beacons* agendados. A seguinte linha de código informa ao simulador para parar, para que não simulemos *beacons* para sempre e entremos no que é essencialmente um laço sem fim.
+
+::
+
+  Simulator::Stop (Seconds (10.0));
+
+..
+	We create just enough tracing to cover all three networks:
+
+Criamos rastreamento suficiente para cobrir todas as três redes:
+
+::
+
+  pointToPoint.EnablePcapAll ("third");
+  phy.EnablePcap ("third", apDevices.Get (0));
+  csma.EnablePcap ("third", csmaDevices.Get (0), true);
+
+..
+	These three lines of code will start pcap tracing on both of the point-to-point
+	nodes that serves as our backbone, will start a promiscuous (monitor) mode 
+	trace on the Wifi network, and will start a promiscuous trace on the CSMA 
+	network.  This will let us see all of the traffic with a minimum number of 
+	trace files.
+
+Estas três linhas de código irão iniciar o rastreamento do pcap em ambos os nós ponto-a-ponto que funcionam como nosso *backbone*, irão iniciar um modo promíscuo (monitor) de rastreamento na rede Wifi e na rede CSMA. Isto vai permitir ver todo o tráfego com um número mínimo de arquivos de rastreamento.
+
+..
+	Finally, we actually run the simulation, clean up and then exit the program.
+
+Finalmente, executamos a simulação, limpamos e, em seguida, saimos do programa.
+
+::
+
+    Simulator::Run ();
+    Simulator::Destroy ();
+    return 0;
+  }
+
+..
+	In order to run this example, you have to copy the ``third.cc`` example
+	script into the scratch directory and use Waf to build just as you did with
+	the ``second.cc`` example.  If you are in the top-level directory of the
+	repository you would type,
+
+Para executar este exemplo, você deve copiar o arquivo ``third.cc`` para o diretório ``scratch`` e usar o Waf para compilar exatamente como com o exemplo ``second.cc``. Se você está no diretório raiz do repositório você deverá digitar,
+
+::
+
+  cp examples/tutorial/third.cc scratch/mythird.cc
+  ./waf
+  ./waf --run scratch/mythird
+
+..
+	Again, since we have set up the UDP echo applications just as we did in the 
+	``second.cc`` script, you will see similar output.
+
+Novamente, uma vez que configuramos aplicações de eco UDP, assim como fizemos no arquivo ``second.cc``, você verá uma saída similar.
+
+::
+
+  Waf: Entering directory `/home/craigdo/repos/ns-3-allinone/ns-3-dev/build'
+  Waf: Leaving directory `/home/craigdo/repos/ns-3-allinone/ns-3-dev/build'
+  'build' finished successfully (0.407s)
+  Sent 1024 bytes to 10.1.2.4
+  Received 1024 bytes from 10.1.3.3
+  Received 1024 bytes from 10.1.2.4
+
+..
+	Recall that the first message, ``Sent 1024 bytes to 10.1.2.4``," is the 
+	UDP echo client sending a packet to the server.  In this case, the client
+	is on the wireless network (10.1.3.0).  The second message, 
+	"``Received 1024 bytes from 10.1.3.3``," is from the UDP echo server, 
+	generated when it receives the echo packet.  The final message, 
+	"``Received 1024 bytes from 10.1.2.4``," is from the echo client, indicating
+	that it has received its echo back from the server.
+
+Lembre-se que a primeira mensagem, ``Sent 1024 bytes to 10.1.2.4``," é o cliente de eco UDP enviando um pacote para o servidor. Neste caso, o cliente está na rede wireless (10.1.3.0). A segunda mensagem, "``Received 1024 bytes from 10.1.3.3``," é do servidor de eco UDP, gerado quando este recebe o pacote de eco. A mensagem final, "``Received 1024 bytes from 10.1.2.4``," é do cliente de eco, indicando que este recebeu o seu eco de volta do servidor.
+
+..
+	If you now go and look in the top level directory, you will find four trace 
+	files from this simulation, two from node zero and two from node one:
+
+No diretório raiz, encontraremos quatro arquivos de rastreamento desta simulação, dois do nó zero e dois do nó um:
+
+::
+
+  third-0-0.pcap  third-0-1.pcap  third-1-0.pcap  third-1-1.pcap
+
+..
+	The file "third-0-0.pcap" corresponds to the point-to-point device on node
+	zero -- the left side of the "backbone".  The file "third-1-0.pcap" 
+	corresponds to the point-to-point device on node one -- the right side of the
+	"backbone".  The file "third-0-1.pcap" will be the promiscuous (monitor
+	mode) trace from the Wifi network and the file "third-1-1.pcap" will be the
+	promiscuous trace from the CSMA network.  Can you verify this by inspecting
+	the code?
+
+O arquivo "third-0-0.pcap" corresponde ao dispositivo ponto-a-ponto no nó zero -- o lado esquerdo do *backbone*. O arquivo "third-1-0.pcap" corresponde ao dispositivo ponto-a-ponto no nó um -- o lado direito do *backbone*. O arquivo "third-0-1.pcap" corresponde o rastreamento em modo promíscuo (modo monitor) da rede Wifi e o arquivo "third-1 1.pcap" ao
+rastreamento em modo promíscuo da rede CSMA. Você consegue verificar isto inspecionando o código?
+
+..
+	Since the echo client is on the Wifi network, let's start there.  Let's take
+	a look at the promiscuous (monitor mode) trace we captured on that network.
+
+Como o cliente de eco está na rede Wifi, vamos começar por aí. Vamos dar uma olhada para a saída de rastreamento no modo promíscuo (modo monitor) capturada nessa rede.
+
+::
+
+  tcpdump -nn -tt -r third-0-1.pcap
+
+..
+	You should see some wifi-looking contents you haven't seen here before:
+
+Você deverá ver alguns conteúdos ''wifi'' que não tinham antes:
+
+::
+
+  reading from file third-0-1.pcap, link-type IEEE802_11 (802.11)
+  0.000025 Beacon (ns-3-ssid) [6.0* 9.0 12.0 18.0 24.0 36.0 48.0 54.0 Mbit] IBSS
+  0.000263 Assoc Request (ns-3-ssid) [6.0 9.0 12.0 18.0 24.0 36.0 48.0 54.0 Mbit]
+  0.000279 Acknowledgment RA:00:00:00:00:00:09 
+  0.000552 Assoc Request (ns-3-ssid) [6.0 9.0 12.0 18.0 24.0 36.0 48.0 54.0 Mbit]
+  0.000568 Acknowledgment RA:00:00:00:00:00:07 
+  0.000664 Assoc Response AID(0) :: Succesful
+  0.001001 Assoc Response AID(0) :: Succesful
+  0.001145 Acknowledgment RA:00:00:00:00:00:0a 
+  0.001233 Assoc Response AID(0) :: Succesful
+  0.001377 Acknowledgment RA:00:00:00:00:00:0a 
+  0.001597 Assoc Request (ns-3-ssid) [6.0 9.0 12.0 18.0 24.0 36.0 48.0 54.0 Mbit]
+  0.001613 Acknowledgment RA:00:00:00:00:00:08 
+  0.001691 Assoc Response AID(0) :: Succesful
+  0.001835 Acknowledgment RA:00:00:00:00:00:0a 
+  0.102400 Beacon (ns-3-ssid) [6.0* 9.0 12.0 18.0 24.0 36.0 48.0 54.0 Mbit] IBSS
+  0.204800 Beacon (ns-3-ssid) [6.0* 9.0 12.0 18.0 24.0 36.0 48.0 54.0 Mbit] IBSS
+  0.307200 Beacon (ns-3-ssid) [6.0* 9.0 12.0 18.0 24.0 36.0 48.0 54.0 Mbit] IBSS
+
+..
+	You can see that the link type is now 802.11 as you would expect.  You can 
+	probably understand what is going on and find the IP echo request and response
+	packets in this trace.  We leave it as an exercise to completely parse the 
+	trace dump.
+
+Observamos que o tipo de ligação agora é 802.11, como esperado. Você provavelmente vai entender o que está acontecendo e encontrar o pacote de pedido de eco e a resposta nesta saída de rastreamento. Vamos deixar como um exercício a análise completa da saída.
+
+..
+	Now, look at the pcap file of the right side of the point-to-point link,
+
+Agora, analisando o arquivo pcap do lado direito da ligação ponto-a-ponto,
+
+::
+
+  tcpdump -nn -tt -r third-0-0.pcap
+
+..
+	Again, you should see some familiar looking contents:
+
+Novamente, temos algumas saídas familiares:
+
+::
+
+  reading from file third-0-0.pcap, link-type PPP (PPP)
+  2.002160 IP 10.1.3.3.49153 > 10.1.2.4.9: UDP, length 1024
+  2.009767 IP 10.1.2.4.9 > 10.1.3.3.49153: UDP, length 1024
+
+..
+	This is the echo packet going from left to right (from Wifi to CSMA) and back
+	again across the point-to-point link.
+
+Este é o pacote de eco indo da esquerda para a direita (do Wifi para o CSMA) e de volta através da ligação ponto-a-ponto.
+
+..
+	Now, look at the pcap file of the right side of the point-to-point link,
+
+Agora, analisando o arquivo pcap do lado direito da ligação ponto-a-ponto,
+
+::
+
+  tcpdump -nn -tt -r third-1-0.pcap
+
+..
+	Again, you should see some familiar looking contents:
+
+Novamente, temos algumas saídas familiares:
+
+::
+
+  reading from file third-1-0.pcap, link-type PPP (PPP)
+  2.005846 IP 10.1.3.3.49153 > 10.1.2.4.9: UDP, length 1024
+  2.006081 IP 10.1.2.4.9 > 10.1.3.3.49153: UDP, length 1024
+
+..
+	This is also the echo packet going from left to right (from Wifi to CSMA) and 
+	back again across the point-to-point link with slightly different timings
+	as you might expect.
+
+Este é o pacote de eco indo da esquerda para a direita (do Wifi para o CSMA) e depois voltando através do ligação ponto-a-ponto com tempos um pouco diferentes, como esperado.
+
+..
+	The echo server is on the CSMA network, let's look at the promiscuous trace 
+	there:
+
+O servidor de eco está na rede CSMA, vamos olhar para a saída de rastreamento promíscua:
+
+::
+
+  tcpdump -nn -tt -r third-1-1.pcap
+
+..
+	You should see some familiar looking contents:
+
+Temos algumas saídas familiares:
+
+::
+
+  reading from file third-1-1.pcap, link-type EN10MB (Ethernet)
+  2.005846 ARP, Request who-has 10.1.2.4 (ff:ff:ff:ff:ff:ff) tell 10.1.2.1, length 50
+  2.005870 ARP, Reply 10.1.2.4 is-at 00:00:00:00:00:06, length 50
+  2.005870 IP 10.1.3.3.49153 > 10.1.2.4.9: UDP, length 1024
+  2.005975 ARP, Request who-has 10.1.2.1 (ff:ff:ff:ff:ff:ff) tell 10.1.2.4, length 50
+  2.005975 ARP, Reply 10.1.2.1 is-at 00:00:00:00:00:03, length 50
+  2.006081 IP 10.1.2.4.9 > 10.1.3.3.49153: UDP, length 1024
+
+..
+	This should be easily understood.  If you've forgotten, go back and look at
+	the discussion in ``second.cc``.  This is the same sequence.
+
+Isto deve ser de fácil entendimento. Se esqueceu, volte e olhe para a discussão em ``second.cc``. Este exemplo segue a mesma seqüência.
+
+..
+	Now, we spent a lot of time setting up mobility models for the wireless network
+	and so it would be a shame to finish up without even showing that the STA
+	nodes are actually moving around during the simulation.  Let's do this by hooking
+	into the ``MobilityModel`` course change trace source.  This is just a sneak
+	peek into the detailed tracing section which is coming up, but this seems a very
+	nice place to get an example in.
+
+Passamos algum tempo com a criação de modelos de mobilidade para a rede sem fio e por isso seria uma vergonha encerrar sem mostrar que os nós STA estão realmente se movendo durante a simulação. Vamos fazer isto ligando o ``MobilityModel`` à fonte de rastreamento. Isto é apenas uma visão geral da seção que detalha o rastreamento, mas é um ótimo lugar para um exemplo.
+
+..
+	As mentioned in the "Tweaking ns-3" section, the |ns3| tracing system 
+	is divided into trace sources and trace sinks, and we provide functions to 
+	connect the two.  We will use the mobility model predefined course change 
+	trace source to originate the trace events.  We will need to write a trace 
+	sink to connect to that source that will display some pretty information for 
+	us.  Despite its reputation as being difficult, it's really quite simple.
+	Just before the main program of the ``scratch/mythird.cc`` script, add the 
+	following function:
+
+Como mencionado na seção "Aperfeiçoando", o sistema de rastreamento é dividido em origem de rastreamento e destino de rastreamento, com funções para conectar um ao outro. Vamos usar a mudança de curso padrão do modelo de mobilidade para originar os eventos de rastreamento. Vamos precisar escrever um destino de rastreamento para se conectar a origem que irá exibir algumas informações importantes. Apesar de sua reputação como difícil, é de fato muito simples. Antes do programa principal do código ``scratch/mythird.cc``, adicione a seguinte função:
+
+::
+
+  void
+  CourseChange (std::string context, Ptr<const MobilityModel> model)
+  {
+    Vector position = model->GetPosition ();
+    NS_LOG_UNCOND (context << 
+      " x = " << position.x << ", y = " << position.y);
+  }
+
+..
+	This code just pulls the position information from the mobility model and 
+	unconditionally logs the x and y position of the node.  We are
+	going to arrange for this function to be called every time the wireless
+	node with the echo client changes its position.  We do this using the 
+	``Config::Connect`` function.  Add the following lines of code to the
+	script just before the ``Simulator::Run`` call.
+
+Este código obtém as informações de posição do modelo de mobilidade e registra a posição x e y do nó. Vamos criar o código para que esta função seja chamada toda vez que o nó com o cliente de eco mude de posição. Fazemos isto usando a função ``Config::Connect``. Adicione as seguintes linhas de código no código antes da chamada ``Simulator::Run``.
+
+::
+
+  std::ostringstream oss;
+  oss <<
+    "/NodeList/" << wifiStaNodes.Get (nWifi - 1)->GetId () <<
+    "/$ns3::MobilityModel/CourseChange";
+
+  Config::Connect (oss.str (), MakeCallback (&CourseChange));
+
+..
+	What we do here is to create a string containing the tracing namespace path
+	of the event to which we want to connect.  First, we have to figure out which 
+	node it is we want using the ``GetId`` method as described earlier.  In the
+	case of the default number of CSMA and wireless nodes, this turns out to be 
+	node seven and the tracing namespace path to the mobility model would look
+	like,
+
+O que fazemos aqui é criar uma `string` contendo o caminho do `namespace` de rastreamento do evento ao qual se deseja conectar. Primeiro, temos que descobrir qual nó que queremos usando o método ``GetId`` como descrito anteriormente. No caso de usar o número padrão do CSMA e dos nós de rede sem fio, este acaba sendo o nó sete e o caminho do `namespace` de rastreamento para o modelo de mobilidade seria:
+
+::
+
+  /NodeList/7/$ns3::MobilityModel/CourseChange
+
+..
+	Based on the discussion in the tracing section, you may infer that this trace 
+	path references the seventh node in the global NodeList.  It specifies
+	what is called an aggregated object of type ``ns3::MobilityModel``.  The 
+	dollar sign prefix implies that the MobilityModel is aggregated to node seven.
+	The last component of the path means that we are hooking into the 
+	"CourseChange" event of that model.
+
+Com base na discussão na seção de rastreamento, você pode inferir que este caminho referencia o sétimo nó na lista `NodeList` global. Ele especifica o que é chamado de um objeto agregado do tipo ``ns3::MobilityModel``. O prefixo cifrão implica que o `MobilityModel` é agregado ao nó sete. O último componente do caminho significa que estamos ligando ao evento "CourseChange" desse modelo.
+
+..
+	We make a connection between the trace source in node seven with our trace 
+	sink by calling ``Config::Connect`` and passing this namespace path.  Once 
+	this is done, every course change event on node seven will be hooked into our 
+	trace sink, which will in turn print out the new position.
+
+Fazemos uma conexão entre a origem de rastreamento no nó sete com o nosso destino de rastreamento chamando ``Config::Connect`` e passando o caminho do `namespace` como parâmetro. Feito isto, cada evento de mudança de curso no nó sete será capturado em nosso destino de rastreamento, que por sua vez irá imprimir a nova posição.
+
+..
+	If you now run the simulation, you will see the course changes displayed as 
+	they happen.
+
+Se você executar a simulação, verá as mudanças de curso assim que elas ocorrerem.
+
+::
+
+  Build finished successfully (00:00:01)
+  /NodeList/7/$ns3::MobilityModel/CourseChange x = 10, y = 0
+  /NodeList/7/$ns3::MobilityModel/CourseChange x = 9.41539, y = -0.811313
+  /NodeList/7/$ns3::MobilityModel/CourseChange x = 8.46199, y = -1.11303
+  /NodeList/7/$ns3::MobilityModel/CourseChange x = 7.52738, y = -1.46869
+  /NodeList/7/$ns3::MobilityModel/CourseChange x = 6.67099, y = -1.98503
+  /NodeList/7/$ns3::MobilityModel/CourseChange x = 5.6835, y = -2.14268
+  /NodeList/7/$ns3::MobilityModel/CourseChange x = 4.70932, y = -1.91689
+  Sent 1024 bytes to 10.1.2.4
+  Received 1024 bytes from 10.1.3.3
+  Received 1024 bytes from 10.1.2.4
+  /NodeList/7/$ns3::MobilityModel/CourseChange x = 5.53175, y = -2.48576
+  /NodeList/7/$ns3::MobilityModel/CourseChange x = 4.58021, y = -2.17821
+  /NodeList/7/$ns3::MobilityModel/CourseChange x = 4.18915, y = -1.25785
+  /NodeList/7/$ns3::MobilityModel/CourseChange x = 4.7572, y = -0.434856
+  /NodeList/7/$ns3::MobilityModel/CourseChange x = 4.62404, y = 0.556238
+  /NodeList/7/$ns3::MobilityModel/CourseChange x = 4.74127, y = 1.54934
+  /NodeList/7/$ns3::MobilityModel/CourseChange x = 5.73934, y = 1.48729
+  /NodeList/7/$ns3::MobilityModel/CourseChange x = 6.18521, y = 0.59219
+  /NodeList/7/$ns3::MobilityModel/CourseChange x = 6.58121, y = 1.51044
+  /NodeList/7/$ns3::MobilityModel/CourseChange x = 7.27897, y = 2.22677
+  /NodeList/7/$ns3::MobilityModel/CourseChange x = 6.42888, y = 1.70014
+  /NodeList/7/$ns3::MobilityModel/CourseChange x = 7.40519, y = 1.91654
+  /NodeList/7/$ns3::MobilityModel/CourseChange x = 6.51981, y = 1.45166
+  /NodeList/7/$ns3::MobilityModel/CourseChange x = 7.34588, y = 2.01523
+  /NodeList/7/$ns3::MobilityModel/CourseChange x = 7.81046, y = 2.90077
+  /NodeList/7/$ns3::MobilityModel/CourseChange x = 6.89186, y = 3.29596
+  /NodeList/7/$ns3::MobilityModel/CourseChange x = 7.46617, y = 2.47732
+  /NodeList/7/$ns3::MobilityModel/CourseChange x = 7.05492, y = 1.56579
+  /NodeList/7/$ns3::MobilityModel/CourseChange x = 8.00393, y = 1.25054
+  /NodeList/7/$ns3::MobilityModel/CourseChange x = 7.00968, y = 1.35768
+  /NodeList/7/$ns3::MobilityModel/CourseChange x = 7.33503, y = 2.30328
+  /NodeList/7/$ns3::MobilityModel/CourseChange x = 7.18682, y = 3.29223
+  /NodeList/7/$ns3::MobilityModel/CourseChange x = 7.96865, y = 2.66873
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/doc/tutorial-pt-br/source/conceptual-overview.rst	Wed Apr 11 13:49:33 2012 +0200
@@ -0,0 +1,1190 @@
+.. include:: replace.txt
+
+..
+	========================================================================================
+	Translated for portuguese by the students of the inter-institutional doctorate program of IME-USP/UTFPR-CM.
+	
+	Traduzido para o português pelos alunos do programa de doutorado inter institucional do Instituto de Matemática e Estatística da Universidade de São Paulo --- IME-USP em parceria com a Universidade Tecnológica Federal do Paraná - Campus Campo Mourão --- UTFPR-CM:
+	
+	* Frank Helbert (frank@ime.usp.br);
+	* Luiz Arthur Feitosa dos Santos (luizsan@ime.usp.br);
+	* Rodrigo Campiolo (campiolo@ime.usp.br).
+	========================================================================================
+
+
+.. Conceptual Overview
+
+Visão Conceitual
+----------------
+
+..
+	The first thing we need to do before actually starting to look at or write
+	|ns3| code is to explain a few core concepts and abstractions in the
+	system.  Much of this may appear transparently obvious to some, but we
+	recommend taking the time to read through this section just to ensure you
+	are starting on a firm foundation.
+
+Antes de escrever códigos no |ns3| é extremamente importante entender um pouco dos conceitos e abstrações do sistema. Muitos conceitos poderão parecer óbvios, mas a recomendação geral é que esta seção seja lida por completo para assegurar que o leitor inicie com uma base sólida. 
+
+.. Key Abstractions
+
+Principais Abstrações
+*********************
+
+..
+	In this section, we'll review some terms that are commonly used in
+	networking, but have a specific meaning in |ns3|.
+
+Nesta seção, são revistos alguns termos que são comumente usados por profissionais de redes de computadores, mas que tem um significado específico no |ns3|.
+
+Nó (`Node`)
++++++++++++
+
+.. 
+	In Internet jargon, a computing device that connects to a network is called
+	a *host* or sometimes an *end system*.  Because |ns3| is a 
+	*network* simulator, not specifically an *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 *node*.
+
+No jargão da Internet, um dispositivo computacional que conecta-se a uma rede é chamado de *host* ou em alguns casos de *terminal*. Devido ao fato do |ns3| ser um simulador de *rede*, e não um simulador da *Internet*, o termo `host` é intencionalmente não utilizado, pois está intimamente associado com a Internet e seus protocolos. Ao invés disso, é utilizado o termo *node* --- em português, *nó* --- que é um termo mais genérico e também usado por outros simuladores que tem suas origens na Teoria dos Grafos.
+
+..
+	In |ns3| the basic computing device abstraction is called the 
+	node.  This abstraction is represented in C++ by the class ``Node``.  The 
+	``Node`` class provides methods for managing the representations of 
+	computing devices in simulations.
+
+A abstração de um dispositivo computacional básico é chamado então de nó. Essa abstração é representada em C++ pela classe ``Node``. Esta classe fornece métodos para gerenciar as representações de dispositivos computacionais nas simulações.
+
+..
+	You should think of a ``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 |ns3|.
+
+O nó deve ser pensado como um computador no qual se adicionam funcionalidades, tal como aplicativos, pilhas de protocolos e periféricos com seus `drivers` associados que permitem ao computador executar tarefas úteis. No |ns3| é utilizado este mesmo conceito básico.
+
+.. Application
+
+Aplicações (`Application`)
+++++++++++++++++++++++++++
+
+..
+	Typically, computer software is divided into two broad classes.  *System
+	Software* organizes various computer resources such as memory, processor
+	cycles, disk, network, etc., according to some computing model.  System
+	software usually does not use those resources to complete tasks that directly
+	benefit a user.  A user would typically run an *application* that acquires
+	and uses the resources controlled by the system software to accomplish some
+	goal.  
+
+Normalmente, programas de computador são divididos em duas classes. *Programas de sistema* organizam recursos do computador, tais como: memória, processador, disco, rede, etc., de acordo com algum modelo computacional. Tais programas normalmente não são utilizados diretamente pelos usuários. Na maioria das vezes, os usuários fazem uso de *aplicações*, que usam os recursos controlados pelos programas de sistema para atingir seus objetivos.
+
+..
+	Often, the line of separation between system and application software is made
+	at the privilege level change that happens in operating system traps.
+	In |ns3| 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," |ns3| applications run on
+	|ns3| ``Nodes`` to drive simulations in the simulated world.
+
+Geralmente, a separação entre programas de sistema e aplicações de usuários é feita pela mudança no nível de privilégios que acontece na troca de contexto feita pelo sistema operacional. No |ns3|, não existe um conceito de sistema operacional real, não há o conceito de níveis de privilégios nem chamadas de sistema. Há apenas aplicações que são executadas nos nós para uma determinada simulação.
+
+..
+	In |ns3| 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 ``Application``.  The ``Application`` class provides 
+	methods for managing the representations of our version of user-level 
+	applications in simulations.  Developers are expected to specialize the
+	``Application`` class in the object-oriented programming sense to create new
+	applications.  In this tutorial, we will use specializations of class 
+	``Application`` called ``UdpEchoClientApplication`` and 
+	``UdpEchoServerApplication``.  As you might expect, these applications 
+	compose a client/server application set used to generate and echo simulated 
+	network packets 
+
+No |ns3|, a abstração básica para um programa de usuário que gera alguma atividade a ser simulada é a aplicação. Esta abstração é representada em C++ pela classe ``Application``, que fornece métodos para gerenciar a representação de suas versões de aplicações a serem simuladas. Os desenvolvedores devem especializar a classe ``Application`` para criar novas aplicações. Neste tutorial serão utilizadas duas especializações da classe ``Application``, chamadas  ``UdpEchoClientApplication`` e ``UdpEchoServerApplication``. Estas aplicações compõem um modelo cliente/servidor usado para gerar pacotes simulados de eco na rede.
+
+.. Channel
+
+Canal de Comunicação (`Channel`)
+++++++++++++++++++++++++++++++++
+
+..
+	In the real world, one can connect a computer to a network.  Often the media
+	over which data flows in these networks are called *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 |ns3|, one connects a ``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 ``Channel``.  
+
+No mundo real, computadores estão conectados em uma rede. Normalmente, o meio sobre o qual os dados trafegam é chamada de canal (*channel*). Quando um cabo Ethernet é ligado ao conector na parede, na verdade está se conectando a um canal de comunicação Ethernet. No mundo simulado do |ns3|, um nó é conectado a um objeto que representa um canal de comunicação. A abstração de canal de comunicação é representada em C++ pela classe ``Channel``.
+
+..
+	The ``Channel`` class provides methods for managing communication 
+	subnetwork objects and connecting nodes to them.  ``Channels`` may also be
+	specialized by developers in the object oriented programming sense.  A 
+	``Channel`` specialization may model something as simple as a wire.  The 
+	specialized  ``Channel`` can also model things as complicated as a large 
+	Ethernet switch, or three-dimensional space full of obstructions in the case 
+	of wireless networks.
+
+A classe ``Channel`` fornece métodos para gerenciar objetos de comunicação de sub-redes e nós conectados a eles. Os ``Channels`` também podem ser especializados por desenvolvedores (no sentido de programação orientada a objetos). Uma especialização de ``Channel`` pode ser algo como um simples fio. Pode também ser algo mais complexo, como um comutador Ethernet ou ainda ser uma rede sem fio (`wireless`) em um espaço tridimensional com obstáculos.
+
+..
+	We will use specialized versions of the ``Channel`` called
+	``CsmaChannel``, ``PointToPointChannel`` and ``WifiChannel`` in this
+	tutorial.  The ``CsmaChannel``, for example, models a version of a 
+	communication subnetwork that implements a *carrier sense multiple 
+	access* communication medium.  This gives us Ethernet-like functionality.  
+
+Neste tutorial, são utilizadas versões especializadas de ``Channel`` chamadas ``CsmaChannel``, ``PointToPointChannel`` e ``WifiChannel``. O ``CsmaChannel``, por exemplo, é uma versão do modelo de rede que implementa controle de acesso ao meio CSMA (*Carrier Sense Multiple Access*). Ele fornece uma funcionalidade similar a uma rede Ethernet.
+
+.. Net Device
+
+Dispositivos de Rede (`Net Device`)
++++++++++++++++++++++++++++++++++++
+
+..
+	It used to be the case that if you wanted to connect a computers to a network,
+	you had to buy a specific kind of network cable and a hardware device called
+	(in PC terminology) a *peripheral card* that needed to be installed in
+	your computer.  If the peripheral card implemented some networking function,
+	they were called Network Interface Cards, or *NICs*.  Today most 
+	computers come with the network interface hardware built in and users don't 
+	see these building blocks.
+
+No passado, para conectar computadores em uma rede, era necessário comprar o cabo específico e um dispositivo chamado (na terminologia dos PCs) de *periférico*, que precisava ser instalado no computador. Se a placa implementava funções de rede, era chamada de interface de rede (`Network Interface Card` - NIC). Atualmente, a maioria dos computadores vêm com a placa de rede integrada à placa mãe (`on-board`) e os usuários não vêem o computador como uma junção de partes.
+
+..
+	A NIC will not work without a software driver to control the hardware.  In 
+	Unix (or Linux), a piece of peripheral hardware is classified as a 
+	*device*.  Devices are controlled using *device drivers*, and network
+	devices (NICs) are controlled using *network device drivers*
+	collectively known as *net devices*.  In Unix and Linux you refer
+	to these net devices by names such as *eth0*.
+
+Uma placa de rede não funciona sem o `driver` que a controle. No Unix (ou Linux), um periférico (como a placa de rede) é classificado como um dispositivo (*device*). Dispositivos são controlados usando drivers de dispositivo (*device drivers*) e as placas de rede são controladas através de drivers de dispositivo de rede (*network device drivers*), também chamadas de dispositivos de rede (*net devices*). No Unix e Linux estes dispositivos de rede levam nomes como *eth0*.
+
+..
+	In |ns3| the *net device* abstraction covers both the software 
+	driver and the simulated hardware.  A net device is "installed" in a 
+	``Node`` in order to enable the ``Node`` to communicate with other 
+	``Nodes`` in the simulation via ``Channels``.  Just as in a real
+	computer, a ``Node`` may be connected to more than one ``Channel`` via
+	multiple ``NetDevices``.
+
+No |ns3| a abstração do *dispositivo de rede* cobre tanto o hardware quanto o software (`drive`). Um dispositivo de rede é "instalado" em um nó para permitir que este se comunique com outros na simulação, usando os canais de comunicação (`channels`). Assim como em um computador real, um nó pode ser conectado a mais que um canal via múltiplos dispositivos de rede.
+
+..
+	The net device abstraction is represented in C++ by the class ``NetDevice``.
+	The ``NetDevice`` class provides methods for managing connections to 
+	``Node`` and ``Channel`` objects; and may be specialized by developers
+	in the object-oriented programming sense.  We will use the several specialized
+	versions of the ``NetDevice`` called ``CsmaNetDevice``,
+	``PointToPointNetDevice``, and ``WifiNetDevice`` in this tutorial.
+	Just as an Ethernet NIC is designed to work with an Ethernet network, the
+	``CsmaNetDevice`` is designed to work with a ``CsmaChannel``; the
+	``PointToPointNetDevice`` is designed to work with a 
+	``PointToPointChannel`` and a ``WifiNetNevice`` is designed to work with
+	a ``WifiChannel``.
+
+A abstração do dispositivo de rede é representado em C++ pela classe ``NetDevice``, que fornece métodos para gerenciar conexões para objetos ``Node`` e ``Channel``. Os dispositivos, assim como os canais e as aplicações, também podem ser especializados. Várias versões do ``NetDevice`` são utilizadas neste tutorial, tais como: ``CsmaNetDevice``, ``PointToPointNetDevice`` e ``WifiNetDevice``. Assim como uma placa de rede Ethernet é projetada para trabalhar em uma rede Ethernet, um ``CsmaNetDevice`` é projetado para trabalhar com um ``CsmaChannel``. O ``PointToPointNetDevice`` deve trabalhar com um ``PointToPointChannel`` e o ``WifiNetNevice`` com um ``WifiChannel``.
+
+.. Topology Helpers
+
+Assistentes de Topologia (`Topology Helpers`)
++++++++++++++++++++++++++++++++++++++++++++++
+
+..
+	In a real network, you will find host computers with added (or built-in)
+	NICs.  In |ns3| we would say that you will find ``Nodes`` with 
+	attached ``NetDevices``.  In a large simulated network you will need to 
+	arrange many connections between ``Nodes``, ``NetDevices`` and 
+	``Channels``.
+
+Em redes reais, os computadores possuem placas de rede, sejam elas integradas ou não. No |ns3|, teremos nós com dispositivos de rede. Em grandes simulações, será necessário arranjar muitas conexões entre nós, dispositivos e canais de comunicação.
+
+..
+	Since connecting ``NetDevices`` to ``Nodes``, ``NetDevices``
+	to ``Channels``, assigning IP addresses,  etc., are such common tasks
+	in |ns3|, we provide what we call *topology helpers* to make 
+	this as easy as possible.  For example, it may take many distinct 
+	|ns3| core operations to create a NetDevice, add a MAC address, 
+	install that net device on a ``Node``, configure the node's protocol stack,
+	and then connect the ``NetDevice`` to a ``Channel``.  Even more
+	operations would be required to connect multiple devices onto multipoint 
+	channels and then to connect individual networks together into internetworks.
+	We provide topology helper objects that combine those many distinct operations
+	into an easy to use model for your convenience.
+
+Visto que conectar dispositivos a nós e a canais, atribuir endereços IP, etc., são todas tarefas rotineiras no |ns3|, são fornecidos os Assistentes de Topologia (*topology helpers*). Por exemplo, podem ser necessárias muitas operações distintas para criar um dispositivo, atribuir um endereço MAC a ele, instalar o dispositivo em um nó, configurar a pilha de protocolos no nó em questão e por fim, conectar o dispositivo ao canal. Ainda mais operações podem ser necessárias para conectar múltiplos dispositivos em canais multiponto e então fazer a interconexão das várias redes. Para facilitar o trabalho, são disponibilizados objetos que são Assistentes de Topologia, que combinam estas operações distintas em um modelo fácil e conveniente.
+
+.. A First ns-3 Script
+
+O primeiro código no ns-3
+*************************
+..
+	If you downloaded the system as was suggested above, you will have a release
+	of |ns3| in a directory called ``repos`` under your home 
+	directory.  Change into that release directory, and you should find a 
+	directory structure something like the following:
+
+Se o sistema foi baixado como sugerido, uma versão do |ns3| estará em um diretório chamado ``repos`` dentro do diretório `home`. Entrando no diretório dessa versão, deverá haver uma estrutura parecida com a seguinte:
+
+::
+
+  AUTHORS       examples       scratch        utils      waf.bat*
+  bindings      LICENSE        src            utils.py   waf-tools
+  build         ns3            test.py*       utils.pyc  wscript
+  CHANGES.html  README         testpy-output  VERSION    wutils.py
+  doc           RELEASE_NOTES  testpy.supp    waf*       wutils.pyc
+
+
+..
+	Change into the ``examples/tutorial`` directory.  You should see a file named 
+	``first.cc`` located there.  This is a script that will create a simple
+	point-to-point link between two nodes and echo a single packet between the
+	nodes.  Let's take a look at that script line by line, so go ahead and open
+	``first.cc`` in your favorite editor.
+
+Entrando no diretório ``examples/tutorial``, vai haver um arquivo chamado ``first.cc``. Este é um código que criará uma conexão ponto-a-ponto entre dois nós e enviará um pacote de eco entre eles. O arquivo será analisado linha a linha, para isto, o leitor pode abri-lo em seu editor de textos favorito.
+
+.. 
+	Boilerplate
+
+Padronização
+++++++++++++
+
+..
+	The first line in the file is an emacs mode line.  This tells emacs about the
+	formatting conventions (coding style) we use in our source code.  
+
+A primeira linha do arquivo é uma linha de modo emacs, que informa sobre a convenção de formatação (estilo de codificação) que será usada no código fonte.
+
+::
+
+  /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+
+..
+	This is always a somewhat controversial subject, so we might as well get it
+	out of the way immediately.  The |ns3| project, like most large 
+	projects, has adopted a coding style to which all contributed code must 
+	adhere.  If you want to contribute your code to the project, you will 
+	eventually have to conform to the |ns3| coding standard as described 
+	in the file ``doc/codingstd.txt`` or shown on the project web page
+	`here
+	<http://www.nsnam.org/codingstyle.html>`_.
+
+Este é sempre um assunto um tanto quanto controverso. O projeto |ns3|, tal como a maioria dos projetos de grande porte, adotou um estilo de codificação, para o qual todo o código deve conformar. Se o leitor quiser contribuir com o projeto, deverá estar em conformidade com a codificação que está descrita no arquivo ``doc/codingstd.txt`` ou no `sítio <http://www.nsnam.org/codingstyle.html>`_.
+
+..
+	We recommend that you, well, just get used to the look and feel of |ns3|
+	code and adopt this standard whenever you are working with our code.  All of 
+	the development team and contributors have done so with various amounts of 
+	grumbling.  The emacs mode line above makes it easier to get the formatting 
+	correct if you use the emacs editor.
+
+A equipe do |ns3| recomenda aos novos usuários que adotem o padrão quando estiverem tralhando com o código. Tanto eles, quanto todos os que contribuem, tiveram que fazer isto em algum momento. Para aqueles que utilizam o editor Emacs, a linha de modo torna mais facil seguir o padrão corretamente.
+
+..
+	The |ns3| simulator is licensed using the GNU General Public 
+	License.  You will see the appropriate GNU legalese at the head of every file 
+	in the |ns3| distribution.  Often you will see a copyright notice for
+	one of the institutions involved in the |ns3| project above the GPL
+	text and an author listed below.
+
+O |ns3| é licenciado usando a `GNU General Public License` - GPL. No cabeçalho de todo aquivo da distribuição há as questões legais associadas à licença. Frequentemente, haverá também informações sobre os direitos de cópia de uma das instituições envolvidas no projeto e o autor do arquivo.
+
+::
+
+  /*
+   * 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
+   */
+
+.. Module Includes
+
+Inclusão de Módulos
++++++++++++++++++++
+
+..
+	The code proper starts with a number of include statements.  
+
+O código realmente começa pelo carregamento de módulos através da inclusão dos arquivos:
+
+::
+
+  #include "ns3/core-module.h"
+  #include "ns3/network-module.h"
+  #include "ns3/internet-module.h"
+  #include "ns3/point-to-point-module.h"
+  #include "ns3/applications-module.h"
+
+..
+	To help our high-level script users deal with the large number of include 
+	files present in the system, we group includes according to relatively large 
+	modules.  We provide a single include file that will recursively load all of 
+	the include files used in each module.  Rather than having to look up exactly
+	what header you need, and possibly have to get a number of dependencies right,
+	we give you the ability to load a group of files at a large granularity.  This
+	is not the most efficient approach but it certainly makes writing scripts much
+	easier.
+
+Os arquivos a serem incluídos são agrupados em módulos relativamente grandes, de forma a ajudar os usuários. Também é possível fazer referência a um único arquivo que irá recursivamente carregar todas as bibliotecas de cada módulo. Ao invés de procurar pelo arquivo exato, e provavelmente, ter que resolver dependências, é possível carregar um grupo de arquivos de uma vez. Esta com certeza não é a abordagem mais eficiente, mas permite escrever códigos de forma bem mais fácil.
+
+
+..
+	Each of the |ns3| include files is placed in a directory called 
+	``ns3`` (under the build directory) during the build process to help avoid
+	include file name collisions.  The ``ns3/core-module.h`` file corresponds 
+	to the ns-3 module you will find in the directory ``src/core`` in your 
+	downloaded release distribution.  If you list this directory you will find a
+	large number of header files.  When you do a build, Waf will place public 
+	header files in an ``ns3`` directory under the appropriate 
+	``build/debug`` or ``build/optimized`` directory depending on your 
+	configuration.  Waf will also automatically generate a module include file to
+	load all of the public header files.
+
+Durante a construção, cada um dos arquivos incluídos é copiado para o diretório chamado ``ns3`` (dentro do diretório ``build``), o que ajuda a evitar conflito entre os nomes dos arquivos de bibliotecas. O arquivo ``ns3/core-module.h``, por exemplo, corresponde ao módulo que está no diretório ``src/core``. Há um grande número de arquivos neste diretório. No momento em que o Waf está construindo o projeto, copia os arquivos para o diretório ``ns3``, no subdiretório apropriado --- ``build/debug`` ou ``build/optimized`` --- dependendo da configuração utilizada.
+
+..
+	Since you are, of course, following this tutorial religiously, you will 
+	already have done a
+
+Considerando que o leitor esteja seguindo este tutorial, já terá feito:
+
+::
+
+  ./waf -d debug --enable-examples --enable-tests configure
+
+..
+	in order to configure the project to perform debug builds that include 
+	examples and tests.  You will also have done a
+
+Também já terá feito
+
+::
+
+  ./waf
+
+..
+	to build the project.  So now if you look in the directory 
+	``../../build/debug/ns3`` you will find the four module include files shown 
+	above.  You can take a look at the contents of these files and find that they
+	do include all of the public include files in their respective modules.
+
+para construir o projeto. Então, no diretório ``../../build/debug/ns3`` deverá haver os quatro módulos incluídos anteriormente. Olhando para o conteúdo destes arquivos, é possível observar que eles incluem todos os arquivos públicos dos seus respectivos módulos.
+
+
+Ns3 `Namespace`
++++++++++++++++
+
+..
+	The next line in the ``first.cc`` script is a namespace declaration.
+
+A próxima linha no código ``first.cc`` é a declaração do `namespace`.
+
+::
+
+  using namespace ns3;
+
+..
+	The |ns3| project is implemented in a C++ namespace called 
+	``ns3``.  This groups all |ns3|-related declarations in a scope
+	outside the global namespace, which we hope will help with integration with 
+	other code.  The C++ ``using`` statement introduces the |ns3|
+	namespace into the current (global) declarative region.  This is a fancy way
+	of saying that after this declaration, you will not have to type ``ns3::``
+	scope resolution operator before all of the |ns3| code in order to use
+	it.  If you are unfamiliar with namespaces, please consult almost any C++ 
+	tutorial and compare the ``ns3`` namespace and usage here with instances of
+	the ``std`` namespace and the ``using namespace std;`` statements you 
+	will often find in discussions of ``cout`` and streams.
+
+O projeto |ns3| é implementado em um `namespace` chamado `ns3`. Isto agrupa todas as declarações relacionadas ao projeto em um escopo fora do global, que ajuda na integração com outros códigos. A declaração ``using`` do C++ insere o `namespace` |ns3| no escopo global, evitando que se tenha que ficar digitando ``ns3::`` antes dos códigos |ns3|. Se o leitor não esta familiarizado com `namesapaces`, consulte algum tutorial de C++ e compare o `namespace` ``ns3`` e o `namespace` ``std``, usado com frequência em C++, principalmente com ``cout`` e ``streams``.
+
+.. Logging
+
+Registro (`Logging`)
+++++++++++++++++++++
+..
+	The next line of the script is the following,
+
+A próxima linha do código é o seguinte,
+
+::
+
+  NS_LOG_COMPONENT_DEFINE ("FirstScriptExample");
+
+..
+	We will use this statement as a convenient place to talk about our Doxygen
+	documentation system.  If you look at the project web site, 
+	`ns-3 project
+	<http://www.nsnam.org>`_, you will find a link to "Documentation" in the navigation bar.  If you select this link, you will be
+	taken to our documentation page. There 
+	is a link to "Latest Release" that will take you to the documentation
+	for the latest stable release of |ns3|.
+	If you select the "API Documentation" link, you will be
+	taken to the |ns3| API documentation page.
+
+Nós iremos utilizar esta declaração em um lugar conveniente para conversar com o sistema de documentação Doxygen. Se você procurar no `web site` do `projeto ns-3 <http://www.nsnam.org>`_, você encontrará um `link` para a documentação (`Documentation`) na barra de navegação. Se selecionarmos este `link`, veremos a página de documentação. Lá tem um `link` para as últimas `releases` (`Latest Release`) que irão apresentar a documentação da última `release` do |ns3|. Se você também pode selecionar o `link` para a documentação das APIs (`API Documentation`).
+
+.. 
+	Along the left side, you will find a graphical representation of the structure
+	of the documentation.  A good place to start is the ``NS-3 Modules``
+	"book" in the |ns3| navigation tree.  If you expand ``Modules`` 
+	you will see a list of |ns3| module documentation.  The concept of 
+	module here ties directly into the module include files discussed above.  The |ns3| logging subsystem is discussed in the ``C++ Constructs Used by All Modules`` 
+	section, so go ahead and expand that documentation node.  Now, expand the 
+	``Debugging`` book and then select the ``Logging`` page.
+
+Do lado esquerdo, você achará uma representação gráfica da estrutura da documentação. Um bom lugar para começar é com o livro de módulos do NS-3 (``NS-3 Modules``) na árvore de navegação, você pode expandir para ver a lista de documentação de módulos do |ns3|. O conceito de módulo aqui está diretamente ligado com a inclusão de bibliotecas apresentadas anteriormente. O sistema de registro (`logging`) é discutido na seção ``C++ Constructs Used by All Modules``, vá em frente e expanda a documentação. Agora expanda o livro da depuração (``Debugging``) e selecione a página de ``Logging``.
+
+..
+	You should now be looking at the Doxygen documentation for the Logging module.
+	In the list of ``#define``s at the top of the page you will see the entry
+	for ``NS_LOG_COMPONENT_DEFINE``.  Before jumping in, it would probably be 
+	good to look for the "Detailed Description" of the logging module to get a 
+	feel for the overall operation.  You can either scroll down or select the
+	"More..." link under the collaboration diagram to do this.
+
+Agora você deve procurar na documentação Doxygen pelo módulo de ``Logging``. Na lista de ``#define`` bem no topo da página você verá uma entrada para ``NS_LOG_COMPONENT_DEFINE``. Antes de ir para lá, dê uma boa olhada na descrição detalhada (`Detailed Description`) do módulo de `logging`.
+
+..
+	Once you have a general idea of what is going on, go ahead and take a look at
+	the specific ``NS_LOG_COMPONENT_DEFINE`` documentation.  I won't duplicate
+	the documentation here, but to summarize, this line declares a logging 
+	component called ``FirstScriptExample`` that allows you to enable and 
+	disable console message logging by reference to the name.
+
+Uma vez que você tem uma ideia geral, prossiga e olhe a documentação de ``NS_LOG_COMPONENT_DEFINE``. Não esperamos duplicar a documentação, mas para resumir esta linha declara o componente de `logging` chamado ``FirstScriptExample`` que permite habilitar e desabilitar mensagens de `logging` referenciando pelo nome.
+
+.. Main Function
+
+Função Principal
+++++++++++++++++
+
+..
+	The next lines of the script you will find are,
+
+As próximas linhas do código são,
+
+::
+
+  int
+  main (int argc, char *argv[])
+  {
+
+..
+	This is just the declaration of the main function of your program (script).
+	Just as in any C++ program, you need to define a main function that will be 
+	the first function run.  There is nothing at all special here.  Your 
+	|ns3| script is just a C++ program.
+
+Esta é a declaração da função principal (``main``) do programa. Assim como em qualquer programa em C++, você precisa definir uma função principal que é a primeira função que será executada no programa. Não há nada de especial e seu código |ns3| é apenas um programa C++.
+
+..
+	The next two lines of the script are used to enable two logging components that
+	are built into the Echo Client and Echo Server applications:
+
+As próximas duas linhas do código são usadas para habilitar dois componentes de registro que são construídos com as aplicações de `Echo Client` e `Echo Server`:
+
+::
+
+    LogComponentEnable("UdpEchoClientApplication", LOG_LEVEL_INFO);
+    LogComponentEnable("UdpEchoServerApplication", LOG_LEVEL_INFO);
+
+..
+	If you have read over the Logging component documentation you will have seen
+	that there are a number of levels of logging verbosity/detail that you can 
+	enable on each component.  These two lines of code enable debug logging at the
+	INFO level for echo clients and servers.  This will result in the application
+	printing out messages as packets are sent and received during the simulation.
+
+Se você leu a documentação do componente de `logging` você viu que existem vários níveis de detalhamento de `logging` e que você pode habilitá-los para cada componente. Essas duas linhas de código habilitam a depuração de `logging` com o nível ``INFO`` para o cliente e servidor. Isto ira fazer com que as aplicações mostrem as mensagens dos pacotes sendo enviados e recebidos durante a simulação.
+
+..
+	Now we will get directly to the business of creating a topology and running 
+	a simulation.  We use the topology helper objects to make this job as
+	easy as possible.
+
+
+Agora nós iremos direto ao ponto, criando uma topologia e executando uma simulação. Nós usaremos o Assistente de Topologia  para fazer isto da forma mais simples possível.
+
+.. Topology Helpers
+
+Assistentes de Topologia
+++++++++++++++++++++++++
+
+.. NodeContainer
+
+Contêineres de nós (`NodeContainer`)
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+.. 
+	The next two lines of code in our script will actually create the 
+	|ns3| ``Node`` objects that will represent the computers in the 
+	simulation.  
+
+As próximas duas linhas de código cria os objetos do tipo ``Node`` que representarão os computadores na simulação.
+
+::
+
+    NodeContainer nodes;
+    nodes.Create (2);
+
+..
+	Let's find the documentation for the ``NodeContainer`` class before we
+	continue.  Another way to get into the documentation for a given class is via 
+	the ``Classes`` tab in the Doxygen pages.  If you still have the Doxygen 
+	handy, just scroll up to the top of the page and select the ``Classes`` 
+	tab.  You should see a new set of tabs appear, one of which is 
+	``Class List``.  Under that tab you will see a list of all of the 
+	|ns3| classes.  Scroll down, looking for ``ns3::NodeContainer``.
+	When you find the class, go ahead and select it to go to the documentation for
+	the class.
+
+Antes de continuar vamos pesquisar a documentação da classe ``NodeContainer``. Outra forma de obter a documentação é através aba ``Classes`` na página do Doxygen. No Doxygen, vá até o topo da página e selecione ``Classes``. Então, você verá um novo conjunto de opções aparecendo, uma delas será a sub-aba ``Class List``. Dentro desta opção você verá uma lista com todas as classes do |ns3|. Agora procure por ``ns3::NodeContainer``. Quando você achar a classe, selecione e veja a documentação da classe.
+
+..
+	You may recall that one of our key abstractions is the ``Node``.  This
+	represents a computer to which we are going to add things like protocol stacks,
+	applications and peripheral cards.  The ``NodeContainer`` topology helper
+	provides a convenient way to create, manage and access any ``Node`` objects
+	that we create in order to run a simulation.  The first line above just 
+	declares a NodeContainer which we call ``nodes``.  The second line calls the
+	``Create`` method on the ``nodes`` object and asks the container to 
+	create two nodes.  As described in the Doxygen, the container calls down into
+	the |ns3| system proper to create two ``Node`` objects and stores
+	pointers to those objects internally.
+
+Lembre-se que uma de nossas abstrações é o nó. Este representa um computador, ao qual iremos adicionar coisas, como protocolos, aplicações e periféricos. O assistente ``NodeContainer`` fornece uma forma conveniente de criar, gerenciar e acessar qualquer objeto ``Node`` que criamos para executar a simulação. A primeira linha declara um ``NodeContainer`` que chamamos de ``nodes``. A segunda linha chama o método ``Create`` sobre o objeto ``nodes`` e pede para criar dois nós.
+
+..
+	The nodes as they stand in the script do nothing.  The next step in 
+	constructing a topology is to connect our nodes together into a network.
+	The simplest form of network we support is a single point-to-point link 
+	between two nodes.  We'll construct one of those links here.
+
+Os nós, como estão no código, não fazem nada. O próximo passo é montar uma topologia para conectá-los em uma rede. Uma forma simples de conectar dois computadores em uma rede é com um enlace ponto-a-ponto.
+
+PointToPointHelper
+~~~~~~~~~~~~~~~~~~
+..
+	We are constructing a point to point link, and, in a pattern which will become
+	quite familiar to you, we use a topology helper object to do the low-level
+	work required to put the link together.  Recall that two of our key 
+	abstractions are the ``NetDevice`` and the ``Channel``.  In the real
+	world, these terms correspond roughly to peripheral cards and network cables.  
+	Typically these two things are intimately tied together and one cannot expect
+	to interchange, for example, Ethernet devices and wireless channels.  Our 
+	Topology Helpers follow this intimate coupling and therefore you will use a
+	single ``PointToPointHelper`` to configure and connect |ns3|
+	``PointToPointNetDevice`` and ``PointToPointChannel`` objects in this 
+	script.
+
+Construiremos um enlace ponto-a-ponto e para isto usaremos um assistente para configurar o nível mais baixo da rede. Lembre-se que duas abstrações básicas são ``NetDevice`` e ``Channel``. No mundo real, estes termos correspondem, a grosso modo, à placa de rede e ao cabo. Normalmente, estes dois estão intimamente ligados e não é normal ficar trocando. Por exemplo, não é comum placas Ethernet conectadas em canais sem fio. O assistente de topologia acopla estes dois conceitos em um simples ``PointToPointHelper`` para configurar e conectar objetos ``PointToPointNetDevice`` e ``PointToPointChannel`` em nosso código.
+
+.. 
+	The next three lines in the script are,
+
+As próximas três linhas no código são,
+
+::
+
+    PointToPointHelper pointToPoint;
+    pointToPoint.SetDeviceAttribute ("DataRate", StringValue ("5Mbps"));
+    pointToPoint.SetChannelAttribute ("Delay", StringValue ("2ms"));
+
+.. 
+	The first line,
+
+A primeira linha,
+
+::
+
+    PointToPointHelper pointToPoint;
+
+..
+	instantiates a ``PointToPointHelper`` object on the stack.  From a 
+	high-level perspective the next line,
+
+instancia o objeto ``PointToPointHelper`` na pilha. De forma mais superficial a próxima linha,
+
+::
+
+    pointToPoint.SetDeviceAttribute ("DataRate", StringValue ("5Mbps"));
+
+..
+	tells the ``PointToPointHelper`` object to use the value "5Mbps"
+	(five megabits per second) as the "DataRate" when it creates a 
+	``PointToPointNetDevice`` object.
+
+diz ao objeto ``PointToPointHelper`` para usar o valor de "5Mbps" (cinco `megabits` por segundo) como "DataRate" (taxa de transferência) quando criarmos um objeto ``PointToPointNetDevice``.
+
+..
+	From a more detailed perspective, the string "DataRate" corresponds
+	to what we call an ``Attribute`` of the ``PointToPointNetDevice``.
+	If you look at the Doxygen for class ``ns3::PointToPointNetDevice`` and 
+	find the documentation for the ``GetTypeId`` method, you will find a list
+	of  ``Attributes`` defined for the device.  Among these is the "DataRate"
+	``Attribute``.  Most user-visible |ns3| objects have similar lists of 
+	``Attributes``.  We use this mechanism to easily configure simulations without
+	recompiling as you will see in a following section.
+
+De uma perspectiva mais detalhada, a palavra "DataRate" corresponde ao que nós chamamos de atributo (``Attribute``) do ``PointToPointNetDevice``. Se você olhar no Doxygen na classe ``ns3::PointToPointNetDevice`` e procurar a documentação para o método ``GetTypeId``, você achará uma lista de atributos definidos por dispositivos. Dentro desses está o atributo "DataRate". A maioria dos objetos do |ns3| tem uma lista similar de atributos. Nós usamos este mecanismo para facilitar a configuração das simulações sem precisar recompilar, veremos isto na seção seguinte.
+
+..
+	Similar to the "DataRate" on the ``PointToPointNetDevice`` you will find a
+	"Delay" ``Attribute`` associated with the ``PointToPointChannel``.  The 
+	final line,
+
+Parecido com o "DataRate" no ``PointToPointNetDevice`` você achará o atributo "Delay" (atraso) associado com o ``PointToPointChannel``. O final da linha,
+
+::
+
+    pointToPoint.SetChannelAttribute ("Delay", StringValue ("2ms"));
+
+..
+	tells the ``PointToPointHelper`` to use the value "2ms" (two milliseconds)
+	as the value of the transmission delay of every point to point channel it 
+	subsequently creates.
+
+diz ao ``PointToPointHelper`` para usar o valor de "2ms" (dois milissegundos) como valor de atraso de transmissão para o canal ponto-a-ponto criado.
+
+NetDeviceContainer
+~~~~~~~~~~~~~~~~~~
+
+.. 
+	At this point in the script, we have a ``NodeContainer`` that contains
+	two nodes.  We have a ``PointToPointHelper`` that is primed and ready to 
+	make ``PointToPointNetDevices`` and wire ``PointToPointChannel`` objects
+	between them.  Just as we used the ``NodeContainer`` topology helper object
+	to create the ``Nodes`` for our simulation, we will ask the 
+	``PointToPointHelper`` to do the work involved in creating, configuring and
+	installing our devices for us.  We will need to have a list of all of the 
+	NetDevice objects that are created, so we use a NetDeviceContainer to hold 
+	them just as we used a NodeContainer to hold the nodes we created.  The 
+	following two lines of code,
+
+Até agora no código, temos um ``NodeContainer`` que contém dois nós. Também temos ``PointToPointHelper`` que carrega e prepara os objetos ``PointToPointNetDevices`` e ``PointToPointChannel``. Depois, usamos o assistente ``NodeContainer`` para criar os nós para a simulação. Iremos pedir ao ``PointToPointHelper`` para criar, configurar e instalar nossos dispositivos. Iremos necessitar de uma lista de todos os objetos `NetDevice` que são criados, então nós usamos um `NetDeviceContainer` para agrupar os objetos criados, tal como usamos o `NodeContainer` para agrupar os nós que criamos. Nas duas linhas de código seguintes,
+
+::
+
+    NetDeviceContainer devices;
+    devices = pointToPoint.Install (nodes);
+
+..
+	will finish configuring the devices and channel.  The first line declares the 
+	device container mentioned above and the second does the heavy lifting.  The 
+	``Install`` method of the ``PointToPointHelper`` takes a 
+	``NodeContainer`` as a parameter.  Internally, a ``NetDeviceContainer`` 
+	is created.  For each node in the ``NodeContainer`` (there must be exactly 
+	two for a point-to-point link) a ``PointToPointNetDevice`` is created and 
+	saved in the device container.  A ``PointToPointChannel`` is created and 
+	the two ``PointToPointNetDevices`` are attached.  When objects are created
+	by the ``PointToPointHelper``, the ``Attributes`` previously set in the 
+	helper are used to initialize the corresponding ``Attributes`` in the 
+	created objects.
+
+vamos terminar configurando os dispositivos e o canal. A primeira linha declara o contêiner de dispositivos mencionado anteriormente e o segundo faz o trabalho pesado. O método ``Install`` do ``PointToPointHelper`` utiliza um ``NodeContainer`` como parâmetro. Internamente, um ``NetDeviceContainer`` é criado. Para cada nó no ``NodeContainer`` (devem existir dois para um enlace ponto-a-ponto) um ``PointToPointNetDevice`` é criado e salvo no contêiner do dispositivo. Um ``PointToPointChannel`` é criado e dois ``PointToPointNetDevices`` são conectados. Quando os objetos são criados pelo ``PointToPointHelper``, os atributos, passados anteriormente, são configurados pelo assistente (`Helper`).
+
+..
+	After executing the ``pointToPoint.Install (nodes)`` call we will have
+	two nodes, each with an installed point-to-point net device and a single
+	point-to-point channel between them.  Both devices will be configured to 
+	transmit data at five megabits per second over the channel which has a two 
+	millisecond transmission delay.
+
+Depois de executar a chamada ``pointToPoint.Install (nodes)`` iremos ter dois nós, cada qual instalado na rede ponto-a-ponto e um único canal ponto-a-ponto ligando os dois. Ambos os dispositivos serão configurados para ter uma taxa de transferência de dados de cinco megabits por segundo, que por sua vez tem um atraso de transmissão de dois milissegundos.
+
+InternetStackHelper
+~~~~~~~~~~~~~~~~~~~
+..
+	We now have nodes and devices configured, but we don't have any protocol stacks
+	installed on our nodes.  The next two lines of code will take care of that.
+
+Agora temos os nós e dispositivos configurados, mas não temos qualquer pilha de protocolos instalada em nossos nós. As próximas duas linhas de código irão cuidar disso.
+
+::
+
+    InternetStackHelper stack;
+    stack.Install (nodes);
+
+..
+	The ``InternetStackHelper`` is a topology helper that is to internet stacks
+	what the ``PointToPointHelper`` is to point-to-point net devices.  The
+	``Install`` method takes a ``NodeContainer`` as a parameter.  When it is
+	executed, it will install an Internet Stack (TCP, UDP, IP, etc.) on each of
+	the nodes in the node container.
+
+O ``InternetStackHelper`` é um assistente de topologia inter-rede. O método ``Install`` utiliza um ``NodeContainer`` como parâmetro. Quando isto é executado, ele irá instalar a pilha de protocolos da Internet (TCP, UDP, IP, etc) em cada nó do contêiner.
+
+Ipv4AddressHelper
+~~~~~~~~~~~~~~~~~
+
+..
+	Next we need to associate the devices on our nodes with IP addresses.  We 
+	provide a topology helper to manage the allocation of IP addresses.  The only
+	user-visible API is to set the base IP address and network mask to use when
+	performing the actual address allocation (which is done at a lower level 
+	inside the helper).
+
+Agora precisamos associar os dispositivos dos nós a endereços IP. Nós fornecemos um assistente de topologia para gerenciar a alocação de endereços IP's. A única API de usuário visível serve para configurar o endereço IP base e a máscara de rede, usado para alocação de endereços.
+
+..
+	The next two lines of code in our example script, ``first.cc``,
+
+As próximas duas linhas de código,
+
+::
+
+    Ipv4AddressHelper address;
+    address.SetBase ("10.1.1.0", "255.255.255.0");
+
+..
+	declare an address helper object and tell it that it should begin allocating IP
+	addresses from the network 10.1.1.0 using the mask 255.255.255.0 to define 
+	the allocatable bits.  By default the addresses allocated will start at one
+	and increase monotonically, so the first address allocated from this base will
+	be 10.1.1.1, followed by 10.1.1.2, etc.  The low level |ns3| system
+	actually remembers all of the IP addresses allocated and will generate a
+	fatal error if you accidentally cause the same address to be generated twice 
+	(which is a very hard to debug error, by the way).
+
+declara um assistente de endereçamento e diz para ele iniciar a alocação de IP's na rede 10.1.1.0 usando a máscara 255.255.255.0. Por padrão, os endereços alocados irão iniciar do primeiro endereço IP disponível e serão incrementados um a um. Então, o primeiro endereço IP alocado será o 10.1.1.1, seguido pelo 10.1.1.2, etc. Em um nível mais baixo, o |ns3| mantém todos os endereços IP's alocados e gera um erro fatal se você acidentalmente usar o mesmo endereço duas vezes (esse é um erro muito difícil de depurar).
+
+..
+	The next line of code,
+
+A próxima linha de código,
+
+::
+
+    Ipv4InterfaceContainer interfaces = address.Assign (devices);
+
+..
+	performs the actual address assignment.  In |ns3| we make the
+	association between an IP address and a device using an ``Ipv4Interface``
+	object.  Just as we sometimes need a list of net devices created by a helper 
+	for future reference we sometimes need a list of ``Ipv4Interface`` objects.
+	The ``Ipv4InterfaceContainer`` provides this functionality.
+
+realiza efetivamente o endereçamento. No |ns3| nós fazemos a associação entre endereços IP e dispositivos usando um objeto ``Ipv4Interface``. As vezes precisamos de uma lista dos dispositivos de rede criados pelo assistente de topologia para consultas futuras. O ``Ipv4InterfaceContainer`` fornece esta funcionalidade.
+
+..
+	Now we have a point-to-point network built, with stacks installed and IP 
+	addresses assigned.  What we need at this point are applications to generate
+	traffic.
+
+Agora que nós temos uma rede ponto-a-ponto funcionando, com pilhas de protocolos instaladas e endereços IP's configurados. O que nós precisamos são aplicações para gerar o tráfego de rede.
+
+.. 
+	Applications
+
+Aplicações
+++++++++++
+
+..
+	Another one of the core abstractions of the ns-3 system is the 
+	``Application``.  In this script we use two specializations of the core
+	|ns3| class ``Application`` called ``UdpEchoServerApplication``
+	and ``UdpEchoClientApplication``.  Just as we have in our previous 
+	explanations,  we use helper objects to help configure and manage the 
+	underlying objects.  Here, we use ``UdpEchoServerHelper`` and
+	``UdpEchoClientHelper`` objects to make our lives easier.
+
+Outra abstração do núcleo do |ns3| são as aplicações (``Application``). Neste código são utilizadas duas especializações da classe ``Application`` chamadas ``UdpEchoServerApplication`` e  ``UdpEchoClientApplication``. Assim como nas explicações anteriores que nós utilizamos assistentes para configurar e gerenciar outros objetos, nós usaremos os objetos ``UdpEchoServerHelper`` e ``UdpEchoClientHelper`` para deixar a nossa vida mais fácil.
+
+UdpEchoServerHelper
+~~~~~~~~~~~~~~~~~~~
+..
+	The following lines of code in our example script, ``first.cc``, are used
+	to set up a UDP echo server application on one of the nodes we have previously
+	created.
+
+As linhas seguintes do código do exemplo ``first.cc``, são usadas para configurar uma aplicação de eco (`echo`) UDP em um dos nós criados anteriormente.
+
+::
+
+    UdpEchoServerHelper echoServer (9);
+
+    ApplicationContainer serverApps = echoServer.Install (nodes.Get (1));
+    serverApps.Start (Seconds (1.0));
+    serverApps.Stop (Seconds (10.0));
+
+..
+	The first line of code in the above snippet declares the 
+	``UdpEchoServerHelper``.  As usual, this isn't the application itself, it
+	is an object used to help us create the actual applications.  One of our 
+	conventions is to place *required* ``Attributes`` in the helper constructor.
+	In this case, the helper can't do anything useful unless it is provided with
+	a port number that the client also knows about.  Rather than just picking one 
+	and hoping it all works out, we require the port number as a parameter to the 
+	constructor.  The constructor, in turn, simply does a ``SetAttribute``
+	with the passed value.  If you want, you can set the "Port" ``Attribute``
+	to another value later using ``SetAttribute``.
+
+Um fragmento da primeira linha do código declara o ``UdpEchoServerHelper``. Esta não é a própria aplicação, é o objeto usado para ajudar na criação da aplicação. Uma de nossas convenções é colocar os atributos *obrigatórios* no construtor do assistente de topologia. Neste caso, o assistente não pode fazer nada se não colocarmos um número de porta que o cliente conhece. O construtor, por sua vez, configura o atributo "Port" usando ``SetAttribute``.
+
+..
+	Similar to many other helper objects, the ``UdpEchoServerHelper`` object 
+	has an ``Install`` method.  It is the execution of this method that actually
+	causes the underlying echo server application to be instantiated and attached
+	to a node.  Interestingly, the ``Install`` method takes a
+	``NodeContainter`` as a parameter just as the other ``Install`` methods
+	we have seen.  This is actually what is passed to the method even though it 
+	doesn't look so in this case.  There is a C++ *implicit conversion* at
+	work here that takes the result of ``nodes.Get (1)`` (which returns a smart
+	pointer to a node object --- ``Ptr<Node>``) and uses that in a constructor
+	for an unnamed ``NodeContainer`` that is then passed to ``Install``.
+	If you are ever at a loss to find a particular method signature in C++ code
+	that compiles and runs just fine, look for these kinds of implicit conversions.  
+
+De forma semelhante aos outros assistentes, o ``UdpEchoServerHelper`` tem o método ``Install``. É este método que instancia a aplicação de servidor de eco (``echo server``) e a associa ao nó. O método ``Install`` tem como parâmetro um ``NodeContainter``, assim como o outro método ``Install`` visto. Isto é o que é passado para o método, mesmo que não seja visível. Há uma *conversão implícita* em C++, que pega o resultado de ``nodes.Get (1)`` (o qual retorna um ponteiro para o objeto `node` --- ``Ptr<Node>``) e o usa em um construtor de um ``NodeContainer`` sem nome, que então é passado para o método ``Install``.
+
+..
+	We now see that ``echoServer.Install`` is going to install a
+	``UdpEchoServerApplication`` on the node found at index number one of the
+	``NodeContainer`` we used to manage our nodes.  ``Install`` will return
+	a container that holds pointers to all of the applications (one in this case 
+	since we passed a ``NodeContainer`` containing one node) created by the 
+	helper.
+
+Agora vemos que o ``echoServer.Install`` instala um ``UdpEchoServerApplication`` no primeiro nó do ``NodeContainer``. O ``Install`` irá retornar um contêiner que armazena os ponteiros de todas as aplicações (neste caso passamos um ``NodeContainer`` contendo um nó) criadas pelo assistente de topologia.
+
+..
+	Applications require a time to "start" generating traffic and may take an
+	optional time to "stop".  We provide both.  These times are set using  the
+	``ApplicationContainer`` methods ``Start`` and ``Stop``.  These 
+	methods take ``Time`` parameters.  In this case, we use an *explicit*
+	C++ conversion sequence to take the C++ double 1.0 and convert it to an 
+	|ns3| ``Time`` object using a ``Seconds`` cast.  Be aware that
+	the conversion rules may be controlled by the model author, and C++ has its
+	own rules, so you can't always just assume that parameters will be happily 
+	converted for you.  The two lines,
+
+As aplicações requerem um tempo para "iniciar" a geração de tráfego de rede e podem ser opcionalmente "desligadas".  Estes tempos podem ser configurados usando o ``ApplicationContainer`` com os métodos ``Start`` e ``Stop``, respectivamente. Esses métodos possuem o parâmetro ``Time``. Em nosso exemplo, nós usamos uma convenção explicita do C++ para passar 1.0 e converter em um objeto ``Time`` usando segundos. Esteja ciente que as regras de conversão podem ser controladas pelo autor do modelo e o C++ tem suas próprias regras, desta forma, você não pode assumir que o parâmetro sempre vai ser convertido para você. As duas linhas, 
+
+::
+
+    serverApps.Start (Seconds (1.0));
+    serverApps.Stop (Seconds (10.0));
+
+..
+	will cause the echo server application to ``Start`` (enable itself) at one
+	second into the simulation and to ``Stop`` (disable itself) at ten seconds
+	into the simulation.  By virtue of the fact that we have declared a simulation
+	event (the application stop event) to be executed at ten seconds, the simulation
+	will last *at least* ten seconds.
+
+irão iniciar (``Start``) a aplicação de servidor de eco um segundo após o início da simulação e depois desligar (``Stop``) em dez segundos. Em virtude de termos declarado que um evento de simulação (o evento de desligamento da aplicação) deve ser executado por dez segundos, a simulação vai durar pelo menos dez segundos.
+
+UdpEchoClientHelper
+~~~~~~~~~~~~~~~~~~~
+
+..
+	The echo client application is set up in a method substantially similar to
+	that for the server.  There is an underlying ``UdpEchoClientApplication``
+	that is managed by an ``UdpEchoClientHelper``.
+
+A aplicação cliente de eco é configurada de forma muito similar ao servidor. Há o ``UdpEchoClientApplication`` que é gerenciado por um ``UdpEchoClientHelper``.
+
+::
+
+    UdpEchoClientHelper echoClient (interfaces.GetAddress (1), 9);
+    echoClient.SetAttribute ("MaxPackets", UintegerValue (1));
+    echoClient.SetAttribute ("Interval", TimeValue (Seconds (1.)));
+    echoClient.SetAttribute ("PacketSize", UintegerValue (1024));
+
+    ApplicationContainer clientApps = echoClient.Install (nodes.Get (0));
+    clientApps.Start (Seconds (2.0));
+    clientApps.Stop (Seconds (10.0));
+
+..
+	For the echo client, however, we need to set five different ``Attributes``.
+	The first two ``Attributes`` are set during construction of the 
+	``UdpEchoClientHelper``.  We pass parameters that are used (internally to
+	the helper) to set the "RemoteAddress" and "RemotePort" ``Attributes``
+	in accordance with our convention to make required ``Attributes`` parameters
+	in the helper constructors. 
+
+Para o cliente de eco, precisamos configurar cinco diferentes atributos. Os dois primeiros são configurados durante a construção do ``UdpEchoClientHelper``. Passamos os parâmetros que são usados (internamente pelo Assistente) para configurar os atributos "RemoteAddress" (endereço remoto) e "RemotePort" (porta remota).
+
+..
+	Recall that we used an ``Ipv4InterfaceContainer`` to keep track of the IP 
+	addresses we assigned to our devices.  The zeroth interface in the 
+	``interfaces`` container is going to correspond to the IP address of the 
+	zeroth node in the ``nodes`` container.  The first interface in the 
+	``interfaces`` container corresponds to the IP address of the first node 
+	in the ``nodes`` container.  So, in the first line of code (from above), we
+	are creating the helper and telling it so set the remote address of the client
+	to be  the IP address assigned to the node on which the server resides.  We 
+	also tell it to arrange to send packets to port nine.
+
+Lembre-se que usamos um ``Ipv4InterfaceContainer`` para configurar o endereço IP em nossos dispositivos. A interface zero (primeira) no contêiner corresponde ao endereço IP do nó zero no contêiner de nós. A primeira interface corresponde ao endereço IP do primeiro nó. Então, na primeira linha do código anterior, nós criamos um assistente e dizemos ao nó para configurar o endereço remoto do cliente conforme o IP do servidor. Nós dizemos também para enviar pacotes para a porta nove.
+
+..
+	The "MaxPackets" ``Attribute`` tells the client the maximum number of 
+	packets we allow it to send during the simulation.  The "Interval" 
+	``Attribute`` tells the client how long to wait between packets, and the
+	"PacketSize" ``Attribute`` tells the client how large its packet payloads
+	should be.  With this particular combination of ``Attributes``, we are 
+	telling the client to send one 1024-byte packet.
+
+O atributo "MaxPackets" diz ao cliente o número máximo de pacotes que são permitidos para envio durante a simulação. O atributo "Interval" diz ao cliente quanto tempo esperar entre os pacotes e o "PacketSize" informa ao cliente qual é o tamanho da área de dados do pacote. Com esta combinação de atributos que nós fizemos teremos clientes enviando pacotes de 1024 bytes.
+
+..
+	Just as in the case of the echo server, we tell the echo client to ``Start``
+	and ``Stop``, but here we start the client one second after the server is
+	enabled (at two seconds into the simulation).
+
+Assim como no caso do servidor de eco, nós dizemos para o cliente de eco iniciar e parar, mas aqui nós iniciamos o cliente um segundo depois que o servidor estiver funcionando (com dois segundos de simulação).
+
+.. Simulator
+
+Simulador (`Simulator`)
++++++++++++++++++++++++
+
+..
+	What we need to do at this point is to actually run the simulation.  This is 
+	done using the global function ``Simulator::Run``.
+
+O que nós precisamos agora é executar o simulador. Isto é feito usando a função global ``Simulator::Run``.
+
+::
+
+    Simulator::Run ();
+
+..
+	When we previously called the methods,
+
+Quando nós chamamos os métodos
+
+::
+
+    serverApps.Start (Seconds (1.0));
+    serverApps.Stop (Seconds (10.0));
+    ...
+    clientApps.Start (Seconds (2.0));
+    clientApps.Stop (Seconds (10.0));
+
+..
+	we actually scheduled events in the simulator at 1.0 seconds, 2.0 seconds and
+	two events at 10.0 seconds.  When ``Simulator::Run`` is called, the system 
+	will begin looking through the list of scheduled events and executing them.  
+	First it will run the event at 1.0 seconds, which will enable the echo server 
+	application (this event may, in turn, schedule many other events).  Then it 
+	will run the event scheduled for t=2.0 seconds which will start the echo client
+	application.  Again, this event may schedule many more events.  The start event
+	implementation in the echo client application will begin the data transfer phase
+	of the simulation by sending a packet to the server.
+
+agendamos os eventos no simulador em 1 segundo, 2 segundos e dois eventos em 10 segundos. Quando chamamos ``Simulator::Run``, o sistema verificará a lista de eventos agendados e os executará no momento apropriado. Primeiramente, ele vai executar o evento de 1 segundo que inicia a aplicação de servidor de eco. Depois executa o evento agendado com dois segundos (t=2,0) que iniciará a aplicação do cliente de eco. Estes eventos podem agendar muitos outros eventos. O evento `start` do cliente irá iniciar a fase de transferência de dados na simulação enviando pacotes ao servidor.
+
+..
+	The act of sending the packet to the server will trigger a chain of events
+	that will be automatically scheduled behind the scenes and which will perform 
+	the mechanics of the packet echo according to the various timing parameters 
+	that we have set in the script.
+
+O ato de enviar pacotes para o servidor vai disparar uma cadeia de eventos que serão automaticamente escalonados e executarão a mecânica do envio de pacotes de eco de acordo com os vários parâmetros de tempo que configuramos no código.
+
+..
+	Eventually, since we only send one packet (recall the ``MaxPackets`` 
+	``Attribute`` was set to one), the chain of events triggered by 
+	that single client echo request will taper off and the simulation will go 
+	idle.  Once this happens, the remaining events will be the ``Stop`` events
+	for the server and the client.  When these events are executed, there are
+	no further events to process and ``Simulator::Run`` returns.  The simulation
+	is then complete.
+
+Considerando que enviamos somente um pacote (lembre-se que o atributo ``MaxPackets`` foi definido com um), uma cadeia de eventos será disparada por este único pedido de eco do cliente até cessar e o simulador ficará ocioso. Uma vez que isto ocorra, os eventos restantes serão o ``Stop`` do servidor e do cliente. Quando estes eventos forem executados, não havendo mais eventos para processar, o ``Simulator::Run`` retorna. A simulação está completa.
+
+..
+	All that remains is to clean up.  This is done by calling the global function 
+	``Simulator::Destroy``.  As the helper functions (or low level 
+	|ns3| code) executed, they arranged it so that hooks were inserted in
+	the simulator to destroy all of the objects that were created.  You did not 
+	have to keep track of any of these objects yourself --- all you had to do 
+	was to call ``Simulator::Destroy`` and exit.  The |ns3| system
+	took care of the hard part for you.  The remaining lines of our first 
+	|ns3| script, ``first.cc``, do just that:
+
+Tudo que resta é limpar. Isto é feito chamando uma função global chamada ``Simulator::Destroy``. Uma das funções dos assistentes (ou do código de baixo nível do |ns3|) é agrupar todos os objetos que foram criados e destruí-los. Você não precisa tratar estes objetos --- tudo que precisa fazer é chamar ``Simulator::Destroy`` e sair. O |ns3| cuidará desta difícil tarefa para você. As linhas restantes do código fazem isto:
+
+::
+
+    Simulator::Destroy ();
+    return 0;
+  }
+
+.. Building Your Script
+
+Construindo o código
+++++++++++++++++++++
+
+..
+	We have made it trivial to build your simple scripts.  All you have to do is 
+	to drop your script into the scratch directory and it will automatically be 
+	built if you run Waf.  Let's try it.  Copy ``examples/tutorial/first.cc`` into 
+	the ``scratch`` directory after changing back into the top level directory.
+
+É trivial construir (criar os binários de) seu código. Tudo que tem a fazer é copiar seu código para dentro do diretório ``scratch`` e ele será construído automaticamente quando executar o Waf. Copie ``examples/tutorial/first.cc`` para o diretório ``scratch``  e depois volte ao diretório principal.
+
+::
+
+  cd ../..
+  cp examples/tutorial/first.cc scratch/myfirst.cc
+
+..
+	Now build your first example script using waf:
+
+Agora construa seu primeiro exemplo usando o Waf:
+
+::
+
+  ./waf
+
+..
+	You should see messages reporting that your ``myfirst`` example was built
+	successfully.
+
+Você deve ver mensagens reportando que o seu exemplo ``myfirst`` foi construído com sucesso.
+
+::
+
+  Waf: Entering directory `/home/craigdo/repos/ns-3-allinone/ns-3-dev/build'
+  [614/708] cxx: scratch/myfirst.cc -> build/debug/scratch/myfirst_3.o
+  [706/708] cxx_link: build/debug/scratch/myfirst_3.o -> build/debug/scratch/myfirst
+  Waf: Leaving directory `/home/craigdo/repos/ns-3-allinone/ns-3-dev/build'
+  'build' finished successfully (2.357s)
+
+..
+	You can now run the example (note that if you build your program in the scratch
+	directory you must run it out of the scratch directory):
+
+Você agora pode executar o exemplo (note que se você construiu seu programa no diretório ``scratch``, então deve executar o comando fora deste diretório):
+
+::
+
+  ./waf --run scratch/myfirst
+
+..
+	You should see some output:
+
+Você deverá ver algumas saídas:
+
+::
+
+  Waf: Entering directory `/home/craigdo/repos/ns-3-allinone/ns-3-dev/build'
+  Waf: Leaving directory `/home/craigdo/repos/ns-3-allinone/ns-3-dev/build'
+  'build' finished successfully (0.418s)
+  Sent 1024 bytes to 10.1.1.2
+  Received 1024 bytes from 10.1.1.1
+  Received 1024 bytes from 10.1.1.2
+
+..
+	Here you see that the build system checks to make sure that the file has been
+	build and then runs it.  You see the logging component on the echo client 
+	indicate that it has sent one 1024 byte packet to the Echo Server on 
+	10.1.1.2.  You also see the logging component on the echo server say that
+	it has received the 1024 bytes from 10.1.1.1.  The echo server silently 
+	echoes the packet and you see the echo client log that it has received its 
+	packet back from the server.
+
+O sistema verifica se os arquivos foram construídos e então executa-os. Através do componente de registro vemos que o cliente enviou 1024 bytes para o servidor através do IP 10.1.1.2. Também podemos ver que o servidor diz ter recebido 1024 bytes do IP 10.1.1.1 e ecoa o pacote para o cliente, que registra o seu recebimento.
+
+.. Ns-3 Source Code
+
+Código fonte do Ns-3
+********************
+
+.. 
+	Now that you have used some of the |ns3| helpers you may want to 
+	have a look at some of the source code that implements that functionality.
+	The most recent code can be browsed on our web server at the following link:
+	http://code.nsnam.org/ns-3-dev.  There, you will see the Mercurial
+	summary page for our |ns3| development tree.
+
+Agora que você já utilizou alguns assistentes do |ns3|, podemos dar uma olhada no código fonte que implementa estas funcionalidades. Pode-se navegar o código mais recente no seguinte endereço: http://code.nsnam.org/ns-3-dev. Lá você verá a página de sumário do Mercurial para a árvore de desenvolvimento do |ns3|.
+
+..
+	At the top of the page, you will see a number of links,
+
+No início da página, você verá vários `links`,
+
+::
+
+  summary | shortlog | changelog | graph | tags | files 
+
+..
+	Go ahead and select the ``files`` link.  This is what the top-level of
+	most of our *repositories* will look:
+
+selecione ``files``. Aparecerá o primeiro nível do repositório:
+
+::
+
+  drwxr-xr-x                               [up]     
+  drwxr-xr-x                               bindings python  files
+  drwxr-xr-x                               doc              files
+  drwxr-xr-x                               examples         files
+  drwxr-xr-x                               ns3              files
+  drwxr-xr-x                               scratch          files
+  drwxr-xr-x                               src              files
+  drwxr-xr-x                               utils            files
+  -rw-r--r-- 2009-07-01 12:47 +0200 560    .hgignore        file | revisions | annotate
+  -rw-r--r-- 2009-07-01 12:47 +0200 1886   .hgtags          file | revisions | annotate
+  -rw-r--r-- 2009-07-01 12:47 +0200 1276   AUTHORS          file | revisions | annotate
+  -rw-r--r-- 2009-07-01 12:47 +0200 30961  CHANGES.html     file | revisions | annotate
+  -rw-r--r-- 2009-07-01 12:47 +0200 17987  LICENSE          file | revisions | annotate
+  -rw-r--r-- 2009-07-01 12:47 +0200 3742   README           file | revisions | annotate
+  -rw-r--r-- 2009-07-01 12:47 +0200 16171  RELEASE_NOTES    file | revisions | annotate
+  -rw-r--r-- 2009-07-01 12:47 +0200 6      VERSION          file | revisions | annotate
+  -rwxr-xr-x 2009-07-01 12:47 +0200 88110  waf              file | revisions | annotate
+  -rwxr-xr-x 2009-07-01 12:47 +0200 28     waf.bat          file | revisions | annotate
+  -rw-r--r-- 2009-07-01 12:47 +0200 35395  wscript          file | revisions | annotate
+  -rw-r--r-- 2009-07-01 12:47 +0200 7673   wutils.py        file | revisions | annotate
+  
+..
+	Our example scripts are in the ``examples`` directory.  If you click on ``examples``
+	you will see a list of subdirectories.  One of the files in ``tutorial`` subdirectory is ``first.cc``.  If
+	you click on ``first.cc`` you will find the code you just walked through.
+
+Os códigos exemplo estão no diretório ``examples``. Se você clicar verá uma lista de subdiretórios. Um dos arquivos no subdiretório ``tutorial`` é o ``first.cc``. Clicando nele você encontrará o código que acabamos de analisar.
+
+..
+	The source code is mainly in the ``src`` directory.  You can view source
+	code either by clicking on the directory name or by clicking on the ``files``
+	link to the right of the directory name.  If you click on the ``src``
+	directory, you will be taken to the listing of the ``src`` subdirectories.  If you 
+	then click on ``core`` subdirectory, you will find a list of files.  The first file
+	you will find (as of this writing) is ``abort.h``.  If you click on the 
+	``abort.h`` link, you will be sent to the source file for ``abort.h`` which 
+	contains useful macros for exiting scripts if abnormal conditions are detected.
+
+
+O código fonte é mantido no diretório ``src``. Você pode vê-lo clicando sobre o nome do diretório ou clicando no item ``files`` a direita do nome. Clicando no diretório ``src``, obterá uma lista de subdiretórios. Clicando no subdiretório ``core``, encontrará um lista de arquivos. O primeiro arquivo é o ``abort.h``, que contém macros caso condições anormais sejam encontradas.
+
+..
+	The source code for the helpers we have used in this chapter can be found in the 
+	``src/applications/helper`` directory.  Feel free to poke around in the directory tree to
+	get a feel for what is there and the style of |ns3| programs.
+
+O código fonte para os assistentes utilizados neste capítulo podem ser encontrados no diretório ``src/applications/helper``. Sinta-se à vontade para explorar a árvore de diretórios e ver o estilo de código do |ns3|.
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/doc/tutorial-pt-br/source/conclusion.rst	Wed Apr 11 13:49:33 2012 +0200
@@ -0,0 +1,89 @@
+.. include:: replace.txt
+
+..
+	========================================================================================
+	Translated for portuguese by the students of the inter-institutional doctorate program of IME-USP/UTFPR-CM.
+	
+	Traduzido para o português pelos alunos do programa de doutorado inter institucional do Instituto de Matemática e Estatística da Universidade de São Paulo --- IME-USP em parceria com a Universidade Tecnológica Federal do Paraná - Campus Campo Mourão --- UTFPR-CM:
+	
+	* Frank Helbert (frank@ime.usp.br);
+	* Luiz Arthur Feitosa dos Santos (luizsan@ime.usp.br);
+	* Rodrigo Campiolo (campiolo@ime.usp.br).
+	========================================================================================
+
+
+.. Conclusion
+
+Conclusão
+---------
+
+.. Futures
+
+Para o futuro
+*************
+
+.. 
+	This document is a work in process.  We hope and expect it to grow over time
+	to cover more and more of the nuts and bolts of |ns3|.  
+
+Este documento é um trabalho em andamento. Espera-se que cresça com o tempo e cubra mais e mais funcionalidades do |ns3|.
+
+..
+	We hope to add the following chapters over the next few releases:
+
+Para as próximas versões, os seguintes capítulos são esperados:
+
+..
+	* The Callback System
+	* The Object System and Memory Management
+	* The Routing System
+	* Adding a New NetDevice and Channel
+	* Adding a New Protocol
+	* Working with Real Networks and Hosts
+
+* O sistema de `callback`
+* O sistema de objetos e o gerenciamento de memória
+* O sistema de roteamento
+* Adicionando novos dispositivos de rede e canais de comunicação
+* Adicionando novos protocolos
+* Trabalhando com redes e `hosts` reais
+
+..
+	Writing manual and tutorial chapters is not something we all get excited about,
+	but it is very important to the project.  If you are an expert in one of these
+	areas, please consider contributing to |ns3| by providing one of these
+	chapters; or any other chapter you may think is important.
+
+Escrever capítulos de manuais e tutoriais não é fácil, mas é muito importante para o projeto. Se você, leitor, é especialista em uma dessas áreas, por favor, considere contribuir com o |ns3| escrevendo um desses capítulos; ou com qualquer outro capítulo que julgue importante.
+
+.. Closing
+
+Finalizando
+***********
+
+..
+	|ns3| is a large and complicated system.  It is impossible to cover all 
+	of the things you will need to know in one small tutorial.
+
+O |ns3| é um sistema grande e muito complexo. Por isto, é impossível cobrir todos os aspectos relevantes em um tutorial.
+
+..
+	We have really just scratched the surface of |ns3| in this tutorial, 
+	but we hope to have covered enough to get you started doing useful networking 
+	research using our favorite simulator.
+
+Ao leitor foi apresentada apenas uma introdução ao |ns3|, entretanto, espera-se que tenha abordado o suficiente para o início de trabalhos e pesquisas relevantes com o simulador.
+
+..	-- The |ns3| development team.
+
+-- Atenciosamente, equipe de desenvolvimento do |ns3|.
+
+
+**Tradução**
+
+
+*Traduzido para o português pelos alunos do programa de doutorado inter institucional do Instituto de Matemática e Estatística da Universidade de São Paulo --- IME-USP em parceria com a Universidade Tecnológica Federal do Paraná - Câmpus Campo Mourão --- UTFPR-CM:*
+
+* Frank Helbert (frank@ime.usp.br);
+* Luiz Arthur Feitosa dos Santos (luizsan@ime.usp.br);
+* Rodrigo Campiolo (campiolo@ime.usp.br).
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/doc/tutorial-pt-br/source/conf.py	Wed Apr 11 13:49:33 2012 +0200
@@ -0,0 +1,218 @@
+# -*- coding: utf-8 -*-
+#
+# ns-3 documentation build configuration file, created by
+# sphinx-quickstart on Tue Dec 14 09:00:39 2010.
+#
+# This file is execfile()d with the current directory set to its containing dir.
+#
+# Note that not all possible configuration values are present in this
+# autogenerated file.
+#
+# All configuration values have a default; values that are commented out
+# serve to show the default.
+
+import sys, os
+
+# If extensions (or modules to document with autodoc) are in another directory,
+# add these directories to sys.path here. If the directory is relative to the
+# documentation root, use os.path.abspath to make it absolute, like shown here.
+#sys.path.insert(0, os.path.abspath('.'))
+
+# -- General configuration -----------------------------------------------------
+
+# If your documentation needs a minimal Sphinx version, state it here.
+#needs_sphinx = '1.0'
+
+# Add any Sphinx extension module names here, as strings. They can be extensions
+# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
+extensions = ['sphinx.ext.pngmath']
+
+# Add any paths that contain templates here, relative to this directory.
+templates_path = ['_templates']
+
+# The suffix of source filenames.
+source_suffix = '.rst'
+
+# The encoding of source files.
+#source_encoding = 'utf-8-sig'
+source_encoding = 'latin1'
+
+# The master toctree document.
+master_doc = 'index'
+
+# General information about the project.
+project = u'ns-3'
+copyright = u'2008-11, ns-3 project'
+
+
+# The version info for the project you're documenting, acts as replacement for
+# |version| and |release|, also used in various other places throughout the
+# built documents.
+#
+# The short X.Y version.
+version = 'ns-3-dev'
+# The full version, including alpha/beta/rc tags.
+release = 'ns-3-dev'
+
+# The language for content autogenerated by . Refer to babel documentation
+# for a list of supported languages.
+language = 'pt-br'
+
+# There are two options for replacing |today|: either, you set today to some
+# non-false value, then it is used:
+#today = ''
+# Else, today_fmt is used as the format for a strftime call.
+#today_fmt = '%B %d, %Y'
+
+# List of patterns, relative to source directory, that match files and
+# directories to ignore when looking for source files.
+exclude_patterns = []
+
+# The reST default role (used for this markup: `text`) to use for all documents.
+#default_role = None
+
+# If true, '()' will be appended to :func: etc. cross-reference text.
+#add_function_parentheses = True
+
+# If true, the current module name will be prepended to all description
+# unit titles (such as .. function::).
+#add_module_names = True
+
+# If true, sectionauthor and moduleauthor directives will be shown in the
+# output. They are ignored by default.
+#show_authors = False
+
+# The name of the Pygments (syntax highlighting) style to use.
+pygments_style = 'sphinx'
+
+# A list of ignored prefixes for module index sorting.
+#modindex_common_prefix = []
+
+
+# -- Options for HTML output ---------------------------------------------------
+
+# The theme to use for HTML and HTML Help pages.  See the documentation for
+# a list of builtin themes.
+html_theme = 'default'
+
+# Theme options are theme-specific and customize the look and feel of a theme
+# further.  For a list of options available for each theme, see the
+# documentation.
+#html_theme_options = {}
+
+# Add any paths that contain custom themes here, relative to this directory.
+#html_theme_path = []
+
+# The name for this set of Sphinx documents.  If None, it defaults to
+# "<project> v<release> documentation".
+#html_title = None
+
+# A shorter title for the navigation bar.  Default is the same as html_title.
+#html_short_title = None
+
+# The name of an image file (relative to this directory) to place at the top
+# of the sidebar.
+#html_logo = None
+
+# The name of an image file (within the static path) to use as favicon of the
+# docs.  This file should be a Windows icon file (.ico) being 16x16 or 32x32
+# pixels large.
+#html_favicon = None
+
+# Add any paths that contain custom static files (such as style sheets) here,
+# relative to this directory. They are copied after the builtin static files,
+# so a file named "default.css" will overwrite the builtin "default.css".
+html_static_path = ['_static']
+
+# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
+# using the given strftime format.
+#html_last_updated_fmt = '%b %d, %Y'
+
+# If true, SmartyPants will be used to convert quotes and dashes to
+# typographically correct entities.
+#html_use_smartypants = True
+
+# Custom sidebar templates, maps document names to template names.
+#html_sidebars = {}
+
+# Additional templates that should be rendered to pages, maps page names to
+# template names.
+#html_additional_pages = {}
+
+# If false, no module index is generated.
+#html_domain_indices = True
+
+# If false, no index is generated.
+#html_use_index = True
+
+# If true, the index is split into individual pages for each letter.
+#html_split_index = False
+
+# If true, links to the reST sources are added to the pages.
+#html_show_sourcelink = True
+
+# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
+#html_show_sphinx = True
+
+# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
+#html_show_copyright = True
+
+# If true, an OpenSearch description file will be output, and all pages will
+# contain a <link> tag referring to it.  The value of this option must be the
+# base URL from which the finished HTML is served.
+#html_use_opensearch = ''
+
+# This is the file name suffix for HTML files (e.g. ".xhtml").
+#html_file_suffix = None
+
+# Output file base name for HTML help builder.
+htmlhelp_basename = 'ns-3doc'
+
+
+# -- Options for LaTeX output --------------------------------------------------
+
+# The paper size ('letter' or 'a4').
+#latex_paper_size = 'letter'
+
+# The font size ('10pt', '11pt' or '12pt').
+#latex_font_size = '10pt'
+
+# Grouping the document tree into LaTeX files. List of tuples
+# (source start file, target name, title, author, documentclass [howto/manual]).
+latex_documents = [
+  ('index', 'ns-3-tutorial.tex', u'ns-3 Tutorial',
+   u'ns-3 project', 'manual'),
+]
+
+# The name of an image file (relative to this directory) to place at the top of
+# the title page.
+#latex_logo = None
+
+# For "manual" documents, if this is true, then toplevel headings are parts,
+# not chapters.
+#latex_use_parts = False
+
+# If true, show page references after internal links.
+#latex_show_pagerefs = False
+
+# If true, show URL addresses after external links.
+#latex_show_urls = False
+
+# Additional stuff for the LaTeX preamble.
+#latex_preamble = ''
+
+# Documents to append as an appendix to all manuals.
+#latex_appendices = []
+
+# If false, no module index is generated.
+#latex_domain_indices = True
+
+
+# -- Options for manual page output --------------------------------------------
+
+# One entry per manual page. List of tuples
+# (source start file, name, description, authors, manual section).
+man_pages = [
+    ('index', 'ns-3-tutorial', u'ns-3 Tutorial',
+     [u'ns-3 project'], 1)
+]
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/doc/tutorial-pt-br/source/getting-started.rst	Wed Apr 11 13:49:33 2012 +0200
@@ -0,0 +1,746 @@
+.. include:: replace.txt
+
+..
+	========================================================================================
+	Translated for portuguese by the students of the inter-institutional doctorate program of IME-USP/UTFPR-CM.
+	
+	Traduzido para o português pelos alunos do programa de doutorado inter institucional do Instituto de Matemática e Estatística da Universidade de São Paulo --- IME-USP em parceria com a Universidade Tecnológica Federal do Paraná - Campus Campo Mourão --- UTFPR-CM:
+	
+	* Frank Helbert (frank@ime.usp.br);
+	* Luiz Arthur Feitosa dos Santos (luizsan@ime.usp.br);
+	* Rodrigo Campiolo (campiolo@ime.usp.br).
+	========================================================================================
+
+
+.. Getting Started
+
+Iniciando
+---------------
+
+.. Downloading ns-3
+
+Baixando o ns-3
+****************
+
+.. 
+	The |ns3| system as a whole is a fairly complex system and has a
+	number of dependencies on other components.  Along with the systems you will
+	most likely deal with every day (the GNU toolchain, Mercurial, you programmer
+	editor) you will need to ensure that a number of additional libraries are
+	present on your system before proceeding.  |ns3| provides a wiki
+	for your reading pleasure that includes pages with many useful hints and tips.
+	One such page is the "Installation" page,
+	http://www.nsnam.org/wiki/index.php/Installation. 
+
+O |ns3|, como um todo, é bastante complexo e possui várias dependências. Isto também é verdade para as ferramentas que fornecem suporte ao |ns3| (exemplos, `"GNU toolchain"`, Mercurial e um editor para a programação), desta forma é necessário assegurar que várias bibliotecas estejam presentes no sistema. O |ns3| fornece um Wiki com várias dicas sobre o sistema. Uma das páginas do Wiki é a página de instalação (`"Installation"`) que está disponível em: http://www.nsnam.org/wiki/index.php/Installation. 
+
+..
+	The "Prerequisites" section of this wiki page explains which packages are 
+	required to support common |ns3| options, and also provides the 
+	commands used to install them for common Linux variants.  Cygwin users will
+	have to use the Cygwin installer (if you are a Cygwin user, you used it to
+	install Cygwin). 
+
+A seção de pré-requisitos (`"Prerequisites"`) do Wiki explica quais pacotes são necessários para a instalação básica do |ns3| e também fornece os comandos usados para a instalação nas variantes mais comuns do Linux. Os usuários do Cygwin devem utilizar o ``Cygwin installer``.
+
+..
+	You may want to take this opportunity to explore the |ns3| wiki 
+	a bit since there really is a wealth of information there. 
+
+Seria interessante explorar um pouco o Wiki, pois lá existe uma grande variedade de informações.
+
+
+..
+	From this point forward, we are going to assume that the reader is working in
+	Linux or a Linux emulation environment (Linux, Cygwin, etc.) and has the GNU
+	toolchain installed and verified along with the prerequisites mentioned 
+	above.  We are also going to assume that you have Mercurial and Waf installed
+	and running on the target system.
+
+A partir deste ponto considera-se que o leitor está trabalhando com Linux ou em um ambiente que o emule (Linux, Cygwin, etc), que tenha o `"GNU toolchain"` instalado, bem como os pré-requisitos mencionados anteriormente. Também assume-se que o leitor tenha o Mercurial e o Waf instalados e funcionando em seu sistema.
+
+..
+	The |ns3| code is available in Mercurial repositories on the server
+	http://code.nsnam.org.  You can also download a tarball release at
+	http://www.nsnam.org/releases/, or you can work with repositories
+	using Mercurial.  We recommend using Mercurial unless there's a good reason
+	not to.  See the end of this section for instructions on how to get a tarball
+	release.
+
+Os códigos fonte do |ns3| estão disponíveis através dos repositórios do Mercurial no servidor http://code.nsnam.org. Os fontes compactados podem ser obtidos em http://www.nsnam.org/releases/. No final desta seção há instruções de como obter uma versão compactada. No entanto, a não ser que se tenha uma boa razão, recomenda-se o uso do Mercurial para acesso ao código.
+
+..
+	The simplest way to get started using Mercurial repositories is to use the
+	``ns-3-allinone`` environment.  This is a set of scripts that manages the 
+	downloading and building of various subsystems of |ns3| for you.  We 
+	recommend that you begin your |ns3| adventures in this environment
+	as it can really simplify your life at this point.
+
+A maneira mais simples de iniciar com o Mercurial é usando o ambiente ``ns-3-allinone``. Trata-se de um conjunto de `scripts` que gerencia o baixar e o construir de vários sub-sistemas do |ns3|. Recomenda-se que os pouco experientes iniciem sua aventura neste ambiente, pois irá realmente facilitar a jornada.
+
+.. Downloading ns-3 Using Mercurial
+
+Obtendo o ns-3 usando o Mercurial
+++++++++++++++++++++++++++++++++++
+..
+	One practice is to create a directory called ``repos`` in one's home 
+	directory under which one can keep local Mercurial repositories.  
+	*Hint:  we will assume you do this later in the tutorial.*  If you adopt
+	that approach, you can get a copy of ``ns-3-allinone`` by typing the 
+	following into your Linux shell (assuming you have installed Mercurial):
+
+Para iniciar, uma boa prática é criar um diretório chamado ``repos`` no diretório `home` sobre o qual será mantido o repositório local do Mercurial. *Dica: iremos assumir que o leitor fez isto no restante deste tutorial, então é bom executar este passo!* Se o leitor adotar esta abordagem é possível obter a cópia do ``ns-3-allinone`` executando os comandos a seguir no `shell` Linux (assumindo que o Mercurial está instalado):
+
+::
+
+  cd
+  mkdir repos
+  cd repos
+  hg clone http://code.nsnam.org/ns-3-allinone
+
+..
+	As the hg (Mercurial) command executes, you should see something like the 
+	following displayed,
+
+Quando executarmos o comando `hg` (Mercurial), teremos como saída algo como:
+
+::
+
+  destination directory: ns-3-allinone
+  requesting all changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 31 changesets with 45 changes to 7 files
+  7 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+..
+	After the clone command completes, you should have a directory called 
+	``ns-3-allinone`` under your ``~/repos`` directory, the contents of which should 
+	look something like the following:
+
+Depois que o comando `clone` for executado com sucesso, teremos um diretório chamado ``ns-3-allinone`` dentro do diretório ``~/repos``. O conteúdo deste diretório deve ser algo como:
+
+::
+
+  build.py*  constants.py  dist.py*  download.py*  README  util.py
+
+..
+	Notice that you really just downloaded some Python scripts.  The next step
+	will be to use those scripts to download and build the |ns3|
+	distribution of your choice.
+
+Até agora foram baixados alguns `scripts` em Python. O próximo passo será usar estes `scripts` para baixar e construir a distribuição |ns3| de sua escolha.
+
+..
+	If you go to the following link: http://code.nsnam.org/,
+	you will see a number of repositories.  Many are the private repositories of
+	the |ns3| development team.  The repositories of interest to you will
+	be prefixed with "ns-3".  Official releases of |ns3| will be 
+	numbered as ``ns-3.<release>.<hotfix>``.  For example, a second hotfix to a
+	still hypothetical release forty two of |ns3| would be numbered as
+	``ns-3.42.2``.
+
+Acessando o endereço: http://code.nsnam.org/, observa-se vários repositórios. Alguns são privados à equipe de desenvolvimento do |ns3|. Os repositórios de interesse ao leitor estarão prefixados com "ns-3". As `releases` oficiais do |ns3| estarão enumeradas da seguinte forma: ``ns-3.<release>.<hotfix>``. Por exemplo, uma segunda atualização de pequeno porte (`hotfix`) de uma hipotética `release` 42, seria enumerada da seguinte maneira: ``ns-3.42.2``.
+
+..
+	The current development snapshot (unreleased) of |ns3| may be found 
+	at http://code.nsnam.org/ns-3-dev/.  The 
+	developers attempt to keep these repository in consistent, working states but
+	they are in a development area with unreleased code present, so you may want 
+	to consider staying with an official release if you do not need newly-
+	introduced features.
+
+A versão em desenvolvimento (que ainda não é uma `release` oficial) pode ser encontrada em http://code.nsnam.org/ns-3-dev/. Os desenvolvedores tentam manter este repositório em um estado consistente, mas podem existir códigos instáveis. Recomenda-se o uso de uma `release` oficial, a não ser que se necessite das novas funcionalidades introduzidas.
+
+..
+	Since the release numbers are going to be changing, I will stick with 
+	the more constant ns-3-dev here in the tutorial, but you can replace the 
+	string "ns-3-dev" with your choice of release (e.g., ns-3.10) in the 
+	text below.  You can find the latest version  of the
+	code either by inspection of the repository list or by going to the 
+	`"ns-3 Releases"
+	<http://www.nsnam.org/releases>`_
+	web page and clicking on the latest release link.
+
+Uma vez que o número das versões fica mudando constantemente, neste tutorial será utilizada a versão ns-3-dev, mas o leitor pode escolher outra (por exemplo, ns-3.10). A última versão pode ser encontrada inspecionando a lista de repositórios ou acessando a página `"ns-3 Releases" <http://www.nsnam.org/releases>`_ e clicando em `latest release`.
+
+..
+	Go ahead and change into the ``ns-3-allinone`` directory you created when
+	you cloned that repository.  We are now going to use the ``download.py`` 
+	script to pull down the various pieces of |ns3| you will be using.
+
+Entre no diretório ``ns-3-allinone`` criado anteriormente. O arquivo ``download.py`` será usado para baixar as várias partes do |ns3| que serão utilizadas.
+
+..
+	Go ahead and type the following into your shell (remember you can substitute
+	the name of your chosen release number instead of ``ns-3-dev`` -- like
+	``"ns-3.10"`` if you want to work with a 
+	stable release).
+
+Execute os seguintes comandos no `shell` (lembre-se de substituir o número da versão no lugar de ``ns-3-dev`` pela que escolheu, por exemplo, se você optou por usar a décima `release` estável, então deve usar o nome ``"ns-3.10"``).
+
+::
+
+  ./download.py -n ns-3-dev
+
+..
+	Note that the default for the ``-n`` option is ``ns-3-dev`` and so the
+	above is actually redundant.  We provide this example to illustrate how to
+	specify alternate repositories.  In order to download ``ns-3-dev`` you 
+	can actually use the defaults and simply type,
+
+O ``ns-3-dev`` é o padrão quando usamos a opção ``-n``, assim o comando poderia ser ``./download.py -n``. O exemplo redundante é apenas para ilustra como especificar repositórios alternativos. Um comando mais simples para obter o ``ns-3-dev`` seria:
+
+::
+
+  ./download.py
+
+..
+	As the hg (Mercurial) command executes, you should see something like the 
+	following,
+
+Com o comando `hg` (Mercurial) em execução devemos ver a seguinte saída:
+
+::
+
+      #
+      # Get NS-3
+      #
+  
+  Cloning ns-3 branch
+   =>  hg clone http://code.nsnam.org/ns-3-dev ns-3-dev
+  requesting all changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 4634 changesets with 16500 changes to 1762 files
+  870 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+..
+	This is output by the download script as it fetches the actual ``ns-3``
+	code from the repository.
+
+Esta é a saída do `script` de download obtendo o código atual do repositório ``ns-3``.
+
+..
+	The download script is smart enough to know that on some platforms various
+	pieces of ns-3 are not supported.  On your platform you may not see some
+	of these pieces come down.  However, on most platforms, the process should
+	continue with something like,
+
+O `script` de download reconhece que partes do ns-3 não são suportadas na plataforma. Dependendo do sistema, pode ser que a saída não seja exatamente como a mostrada a seguir. Porém, a maioria dos sistemas apresentarão algo como:
+
+::
+
+      #
+      # Get PyBindGen
+      #
+
+  Required pybindgen version:  0.10.0.640
+  Trying to fetch pybindgen; this will fail if no network connection is available.  
+  Hit Ctrl-C to skip.
+   =>  bzr checkout -rrevno:640 https://launchpad.net/pybindgen pybindgen
+  Fetch was successful.
+
+..
+	This was the download script getting the Python bindings generator for you.
+	Note that you will need bazaar (bzr), a version control system, to download 
+	PyBindGen. Next you should see (modulo platform variations) something along 
+	the lines of,
+
+Este é o `script` de download obtendo um gerador de `bindings` Python --- um `binding` é literalmente a ligação ou ponte entre dois sistemas, chamaremos aqui de extensões Python. Também será necessário o Bazaar (brz) para baixar o PyBindGen. O Bazaar é um sistema de controle de versões. Em seguida, o leitor deve ver (com algumas variações devido as plataformas) algo parecido com as seguintes linhas:
+
+::
+
+      #
+      # Get NSC
+      #
+
+  Required NSC version:  nsc-0.5.0
+  Retrieving nsc from https://secure.wand.net.nz/mercurial/nsc
+   =>  hg clone https://secure.wand.net.nz/mercurial/nsc nsc
+  requesting all changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 273 changesets with 17565 changes to 15175 files
+  10622 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+..
+	This part of the process is the script downloading the Network Simulation
+	Cradle for you. Note that NSC is not supported on OSX or Cygwin and works 
+	best with gcc-3.4 or gcc-4.2 or greater series.
+
+Neste momento, o `script` de download baixa o `Network Simulation Cradle` - NSC. Note que o NSC não é suportado no OSX ou Cygwin e trabalha melhor com o gcc-3.4, gcc-4.2 ou superiores.
+
+..
+	After the download.py script completes, you should have several new directories
+	under ``~/repos/ns-3-allinone``:
+
+Depois que o `script` ``download.py`` tiver completado sua tarefa, veremos vários diretórios novos dentro de ``~/repos/ns-3-allinone``:
+
+::
+
+  build.py*     constants.pyc  download.py*  nsc/        README      util.pyc
+  constants.py  dist.py*       ns-3-dev/     pybindgen/  util.py
+
+..
+	Go ahead and change into ``ns-3-dev`` under your ``~/repos/ns-3-allinone`` 
+	directory.  You should see something like the following there:
+
+Por fim, no diretório ``ns-3-dev`` que está dentro do diretório ``~/repos/ns-3-allinone`` deve existir, depois dos passos anteriores, o seguinte conteúdo:
+
+::
+
+  AUTHORS       doc       ns3            scratch   testpy.supp  VERSION   waf-tools
+  bindings      examples  README         src       utils        waf*      wscript
+  CHANGES.html  LICENSE   RELEASE_NOTES  test.py*  utils.py     waf.bat*  wutils.py
+
+..
+	You are now ready to build the |ns3| distribution.
+
+Agora está tudo pronto para a construção da distribuição do |ns3|.
+
+.. Downloading ns-3 Using a Tarball
+
+Obtendo o ns-3 compactado (`Tarball`)
++++++++++++++++++++++++++++++++++++++++
+
+..
+	The process for downloading |ns3| via tarball is simpler than the
+	Mercurial process since all of the pieces are pre-packaged for you.  You just
+	have to pick a release, download it and decompress it.
+
+O processo de download do |ns3| compactado é mais simples do que o processo usando o Mercurial, porque tudo que precisamos já vem empacotado. Basta escolher a versão, baixá-la e extraí-la.
+
+..
+	As mentioned above, one practice is to create a directory called ``repos``
+	in one's home directory under which one can keep local Mercurial repositories.
+	One could also keep a ``tarballs`` directory.  *Hint:  the tutorial
+	will assume you downloaded into a ``repos`` directory, so remember the
+	placekeeper.``*  If you adopt the ``tarballs`` directory approach, you can 
+	get a copy of a release by typing the following into your Linux shell 
+	(substitute the appropriate version numbers, of course):
+
+Como mencionado anteriormente, uma boa prática é criar um diretório chamado ``repos`` no diretório `home` para manter a cópia local dos repositórios do Mercurial. Da mesma forma, pode-se manter também um diretório chamado ``tarballs`` para manter as versões obtidas via arquivo compactado. *Dica: o tutorial irá assumir que o download foi feito dentro do diretório ``repos``*. Se a opção for pelo método do arquivo compactado, pode-se obter a cópia de uma versão digitando os seguintes comandos no `shell` Linux (obviamente, substitua os números de versões do comando para o valor apropriado):
+
+::
+
+  cd
+  mkdir tarballs
+  cd tarballs
+  wget http://www.nsnam.org/releases/ns-allinone-3.10.tar.bz2
+  tar xjf ns-allinone-3.10.tar.bz2
+
+.. 
+	If you change into the directory ``ns-allinone-3.10`` you should see a
+	number of files:
+
+Dentro do diretório ``ns-allinone-3.10`` extraído, deverá haver algo como:
+
+::
+
+  build.py      ns-3.10/      pybindgen-0.15.0/    util.py
+  constants.py  nsc-0.5.2/    README  
+
+..
+	You are now ready to build the |ns3| distribution.
+
+Agora está tudo pronto para a construção da distribuição do |ns3|.
+
+.. Building ns-3
+
+Construindo o ns-3
+******************
+
+.. Building with build.py
+
+Construindo com o ``build.py``
+++++++++++++++++++++++++++++++
+..
+	The first time you build the |ns3| project you should build using the
+	``allinone`` environment.  This will get the project configured for you
+	in the most commonly useful way.
+
+A primeira construção do |ns3| deve ser feita usando o ambiente ``allinone``. Isto fará com que o projeto seja configurado da maneira mais funcional.
+
+..
+	Change into the directory you created in the download section above.  If you
+	downloaded using Mercurial you should have a directory called 
+	``ns-3-allinone`` under your ``~/repos`` directory.  If you downloaded
+	using a tarball you should have a directory called something like 
+	``ns-allinone-3.10`` under your ``~/tarballs`` directory.  Take a deep
+	breath and type the following:
+
+Entre no diretório criado na seção "Obtendo o ns-3". Se o Mercurial foi utilizado, então haverá um diretório chamado ``ns-3-allinone`` localizado dentro de ``~/repos``. Se foi utilizado o arquivo compactado, haverá um diretório chamado ``ns-allinone-3.10`` dentro do diretório ``~/tarballs``. Lembre-se de adequar os nomes conforme os arquivos obtidos e diretórios criados. Agora, digite o seguinte comando:
+
+::
+
+  ./build.py --enable-examples --enable-tests
+
+..
+	Because we are working with examples and tests in this tutorial, and
+	because they are not built by default in |ns3|, the arguments for
+	build.py tells it to build them for us.  In the future you can build
+	|ns3| without examples and tests if you wish.
+
+Foram utilizadas as opções ``--enable-examples`` e ``--enable-tests`` pois o tutorial irá trabalhar com exemplos e testes, e, por padrão, eles não são construídos. Futuramente, o leitor poderá construir sem estas opções.
+
+..
+	You will see lots of typical compiler output messages displayed as the build
+	script builds the various pieces you downloaded.  Eventually you should see the
+	following magic words:
+
+Serão exibidas muitas saídas típicas de um compilador conforme o código é construído. Finalmente, no final do processo, deverá aparecer uma saída como esta:
+
+::
+
+  Waf: Leaving directory `/home/craigdo/repos/ns-3-allinone/ns-3-dev/build'
+  'build' finished successfully (2m30.586s)
+  
+  Modules built: 
+  aodv                      applications              bridge
+  click                     config-store              core
+  csma                      csma-layout               dsdv
+  emu                       energy                    flow-monitor
+  internet                  lte                       mesh
+  mobility                  mpi                       netanim
+  network                   nix-vector-routing        ns3tcp
+  ns3wifi                   olsr                      openflow
+  point-to-point            point-to-point-layout     propagation
+  spectrum                  stats                     tap-bridge
+  template                  test                      tools
+  topology-read             uan                       virtual-net-device
+  visualizer                wifi                      wimax
+
+..
+	Once the project has built you can say goodbye to your old friends, the 
+	``ns-3-allinone`` scripts.  You got what you needed from them and will now 
+	interact directly with Waf and we do it in the ``ns-3-dev`` directory,
+	not in the ``ns-3-allinone`` directory.  Go ahead and change into the 
+	``ns-3-dev`` directory (or the directory for the appropriate release you
+	downloaded.
+
+Uma vez que o projeto foi construído, pode-se deixar de lado os `scripts` ``ns-3-allinone``. O leitor já obteve o que precisava e agora irá interagir diretamente com o Waf no diretório ``ns-3-dev``. Mude para o diretório ``ns-3-dev`` (ou para o diretório apropriado de sua versão).
+
+::
+
+  cd ns-3-dev
+
+.. Building with Waf
+
+Construindo com o Waf
++++++++++++++++++++++
+
+..
+	We use Waf to configure and build the |ns3| project.  It's not 
+	strictly required at this point, but it will be valuable to take a slight
+	detour and look at how to make changes to the configuration of the project.
+	Probably the most useful configuration change you can make will be to 
+	build the optimized version of the code.  By default you have configured
+	your project to build the debug version.  Let's tell the project to 
+	make an optimized build.  To explain to Waf that it should do optimized
+	builds that include the examples and tests, you will need to execute the 
+	following command,
+
+O Waf é utilizado para configurar e construir o projeto do |ns3|. Não é estritamente necessário neste ponto, mas será valioso quando se forem necessárias alterações nas configurações do projeto. Provavelmente a mudança mais útil que será feita futuramente é a construção de uma versão do código otimizado. Por padrão, o projeto é construído com a opção de depuração (`debug`), para verificação de erros. Então, para construir um projeto otimizado, deve-se executar o seguinte comando (ainda com suporte a testes e exemplos):
+
+::
+
+  ./waf -d optimized --enable-examples --enable-tests configure
+
+..
+	This runs Waf out of the local directory (which is provided as a convenience
+	for you).  As the build system checks for various dependencies you should see
+	output that looks similar to the following,
+
+Isto executa o Waf fora do diretório local (o que é bem conveniente). Como o sistema em construção verifica várias dependências, deverá aparecer uma saída similar com a que segue:
+
+::
+
+  Checking for program g++                 : ok /usr/bin/g++
+  Checking for program cpp                 : ok /usr/bin/cpp
+  Checking for program ar                  : ok /usr/bin/ar
+  Checking for program ranlib              : ok /usr/bin/ranlib
+  Checking for g++                         : ok
+  Checking for program pkg-config          : ok /usr/bin/pkg-config
+  Checking for -Wno-error=deprecated-declarations support : yes
+  Checking for -Wl,--soname=foo support                   : yes
+  Checking for header stdlib.h                            : ok
+  Checking for header signal.h                            : ok
+  Checking for header pthread.h                           : ok
+  Checking for high precision time implementation         : 128-bit integer
+  Checking for header stdint.h                            : ok
+  Checking for header inttypes.h                          : ok
+  Checking for header sys/inttypes.h                      : not found
+  Checking for library rt                                 : ok
+  Checking for header netpacket/packet.h                  : ok
+  Checking for pkg-config flags for GSL                   : ok
+  Checking for header linux/if_tun.h                      : ok
+  Checking for pkg-config flags for GTK_CONFIG_STORE      : ok
+  Checking for pkg-config flags for LIBXML2               : ok
+  Checking for library sqlite3                            : ok
+  Checking for NSC location                               : ok ../nsc (guessed)
+  Checking for library dl                                 : ok
+  Checking for NSC supported architecture x86_64          : ok
+  Checking for program python                             : ok /usr/bin/python
+  Checking for Python version >= 2.3                      : ok 2.5.2
+  Checking for library python2.5                          : ok
+  Checking for program python2.5-config                   : ok /usr/bin/python2.5-config
+  Checking for header Python.h                            : ok
+  Checking for -fvisibility=hidden support                : yes
+  Checking for pybindgen location                         : ok ../pybindgen (guessed)
+  Checking for Python module pybindgen                    : ok
+  Checking for pybindgen version                          : ok 0.10.0.640
+  Checking for Python module pygccxml                     : ok
+  Checking for pygccxml version                           : ok 0.9.5
+  Checking for program gccxml                             : ok /usr/local/bin/gccxml
+  Checking for gccxml version                             : ok 0.9.0
+  Checking for program sudo                               : ok /usr/bin/sudo
+  Checking for program hg                                 : ok /usr/bin/hg
+  Checking for program valgrind                           : ok /usr/bin/valgrind
+  ---- Summary of optional NS-3 features:
+  Threading Primitives          : enabled
+  Real Time Simulator           : enabled
+  Emulated Net Device           : enabled
+  GNU Scientific Library (GSL)  : enabled
+  Tap Bridge                    : enabled
+  GtkConfigStore                : enabled
+  XmlIo                         : enabled
+  SQlite stats data output      : enabled
+  Network Simulation Cradle     : enabled
+  Python Bindings               : enabled
+  Python API Scanning Support   : enabled
+  Use sudo to set suid bit      : not enabled (option --enable-sudo not selected)
+  Build tests                   : enabled
+  Build examples                : enabled
+  Static build                  : not enabled (option --enable-static not selected)
+  'configure' finished successfully (2.870s)
+
+..
+	Note the last part of the above output.  Some ns-3 options are not enabled by
+	default or require support from the underlying system to work properly.
+	For instance, to enable XmlTo, the library libxml-2.0 must be found on the
+	system.  If this library were not found, the corresponding |ns3| feature 
+	would not be enabled and a message would be displayed.  Note further that there is 
+	a feature to use the program ``sudo`` to set the suid bit of certain programs.
+	This is not enabled by default and so this feature is reported as "not enabled."
+
+Repare a última parte da saída. Algumas opções do ns-3 não estão habilitadas por padrão ou necessitam de algum suporte do sistema para funcionar corretamente. Por exemplo, para habilitar XmlTo, a biblioteca libxml-2.0 deve estar presente no sistema. Se a biblioteca não estiver instalada esta funcionalidade não é habilitada no |ns3| e uma mensagem é apresentada. Note também que existe uma funcionalidade que utiliza o Sudo para configurar o `suid` de certos programas. Isto não está habilitado por padrão, então esta funcionalidade é reportada como não habilitada (``not enabled``). 
+
+.. 
+	Now go ahead and switch back to the debug build that includes the examples and tests.
+
+Vamos configurar uma construção do |ns3| com suporte a depuração, bem como, vamos incluir exemplos e testes. Para isto devemos executar:
+
+::
+
+  ./waf -d debug --enable-examples --enable-tests configure
+
+..
+	The build system is now configured and you can build the debug versions of 
+	the |ns3| programs by simply typing,
+
+Pronto o sistema está configurado, agora podemos construir nossa versão digitando:
+
+::
+
+  ./waf
+
+..
+	Some waf commands are meaningful during the build phase and some commands are valid
+	in the configuration phase.  For example, if you wanted to use the emulation 
+	features of |ns3|, you might want to enable setting the suid bit using
+	sudo as described above.  This turns out to be a configuration-time command, and so 
+	you could reconfigure using the following command that also includes the examples and tests
+
+Alguns comandos do Waf são válidos apenas na fase de construção e outros são válidos na fase de configuração do sistema. Por exemplo, se o leitor espera usar características de emulação do |ns3|, deve habilitar o `suid` usando o Sudo como descrito anteriormente, isto na fase de configuração. O comando utilizado, incluindo exemplos e testes, será:
+
+::
+
+  ./waf -d debug --enable-sudo --enable-examples --enable-tests configure
+
+..
+	If you do this, waf will have run sudo to change the socket creator programs of the
+	emulation code to run as root.  There are many other configure- and build-time options
+	available in waf.  To explore these options, type:
+
+Com esta configuração, o Waf executará o Sudo para alterar programas que criam soquetes para executar o código de emulação como `root`. Existem várias outras opções de configuração e construção disponíveis no Waf. Para explorar estas opções, digite:
+
+::
+
+  ./waf --help
+
+..
+	We'll use some of the testing-related commands in the next section.
+
+Alguns comandos de teste serão utilizados na próxima seção.
+
+..
+	Okay, sorry, I made you build the |ns3| part of the system twice,
+	but now you know how to change the configuration and build optimized code.
+
+Como pôde ser notado, a construção do |ns3| foi feita duas vezes. Isto para que o leitor saiba como trocar a configuração para construir código otimizado no futuro.
+
+.. Testing ns-3
+
+Testando o ns-3
+***************
+
+..
+	You can run the unit tests of the |ns3| distribution by running the 
+	"./test.py -c core" script,
+
+Para executar os testes de unidade do |ns3|, basta chamar o arquivo ``./test.py`` da seguinte forma:
+
+::
+
+  ./test.py -c core
+
+..
+	These tests are run in parallel by waf. You should eventually
+	see a report saying that,
+
+Estes testes são executados em paralelo pelo Waf. No final, uma mensagem como a que segue deve aparecer.
+
+::
+
+  47 of 47 tests passed (47 passed, 0 failed, 0 crashed, 0 valgrind errors)
+
+..
+	This is the important message.
+
+Esta é uma mensagem importante.
+
+..	
+	You will also see output from the test runner and the output will actually look something like,
+
+Também haverá saídas da execução do teste e estas geralmente são algo como:
+
+::
+
+  Waf: Entering directory `/home/craigdo/repos/ns-3-allinone/ns-3-dev/build'
+  Waf: Leaving directory `/home/craigdo/repos/ns-3-allinone/ns-3-dev/build'
+  'build' finished successfully (1.799s)
+  
+  Modules built: 
+  aodv                      applications              bridge
+  click                     config-store              core
+  csma                      csma-layout               dsdv
+  emu                       energy                    flow-monitor
+  internet                  lte                       mesh
+  mobility                  mpi                       netanim
+  network                   nix-vector-routing        ns3tcp
+  ns3wifi                   olsr                      openflow
+  point-to-point            point-to-point-layout     propagation
+  spectrum                  stats                     tap-bridge
+  template                  test                      tools
+  topology-read             uan                       virtual-net-device
+  visualizer                wifi                      wimax
+
+  PASS: TestSuite ns3-wifi-interference
+  PASS: TestSuite histogram
+  PASS: TestSuite sample
+  PASS: TestSuite ipv4-address-helper
+  PASS: TestSuite devices-wifi
+  PASS: TestSuite propagation-loss-model
+
+  ...
+
+  PASS: TestSuite attributes
+  PASS: TestSuite config
+  PASS: TestSuite global-value
+  PASS: TestSuite command-line
+  PASS: TestSuite basic-random-number
+  PASS: TestSuite object
+  PASS: TestSuite random-number-generators
+  95 of 95 tests passed (95 passed, 0 failed, 0 crashed, 0 valgrind errors)
+
+..
+	This command is typically run by ``users`` to quickly verify that an 
+	|ns3| distribution has built correctly.  
+
+Este comando é normalmente executado pelos usuários para verificar se o |ns3| foi construído corretamente. 
+
+.. Running a Script
+
+Executando um código (`Script`)
+*******************************
+
+..
+	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
+	``--run`` option in Waf.  Let's run the |ns3| equivalent of the
+	ubiquitous hello world program by typing the following:
+
+Os códigos normalmente são executados sob o controle do Waf. Isto assegura que os caminhos das bibliotecas compartilhadas estejam corretas e que estarão disponíveis em tempo de execução. Para executar um programa, basta usar a opção ``--run`` no Waf. Para executar um equivalente ao "Olá mundo" (`Hello world`) no |ns3|, utilizamos o comando:
+
+::
+
+  ./waf --run hello-simulator
+
+..
+	Waf first checks to make sure that the program is built correctly and 
+	executes a build if required.  Waf then executes the program, which 
+	produces the following output.
+
+O Waf primeiro verifica se o programa foi construído corretamente e se necessário, o constrói. Então executa o programa, que fornece a seguinte saída:
+
+::
+
+  Hello Simulator
+
+.. 
+	*Congratulations.  You are now an ns-3 user.*
+
+*Parabéns. Você agora é um usuário ns-3*
+
+..
+	*What do I do if I don't see the output?*
+
+*O que fazer se o comando não gerar uma saída?*
+
+..
+	If you see ``waf`` messages indicating that the build was 
+	completed successfully, but do not see the "Hello Simulator" output, 
+	chances are that you have switched your build mode to "optimized" in 
+	the "Building with Waf" section, but have missed the change back to 
+	"debug" mode.  All of the console output used in this tutorial uses a 
+	special |ns3| logging component that is useful for printing 
+	user messages to the console.  Output from this component is 
+	automatically disabled when you compile optimized code -- it is 
+	"optimized out."  If you don't see the "Hello Simulator" output,
+	type the following,
+
+Se a mensagem ``Hello Simulator`` não aparece, mas o Waf gera saídas indicando que a construção do sistema foi executada com sucesso, é possível que o leitor tenha trocado o sistema para o modo otimizado na seção `Construindo com o Waf`, e tenha esquecido de voltar ao modo de depuração. Todas as saídas utilizadas neste tutorial são feitas com um componente especial de registro (`logging`) do |ns3| que é muito útil para mostrar mensagens na tela. As saídas deste componente são automaticamente desabilitadas quando o código é contruído na forma otimizada. Para produzir as saídas, digite o seguinte comando,
+
+::
+
+  ./waf -d debug --enable-examples --enable-tests configure
+
+..
+	to tell ``waf`` to build the debug versions of the |ns3| 
+	programs that includes the examples and tests.  You must still build 
+	the actual debug version of the code by typing,
+
+para dizer ao Waf para construir o |ns3| com a versão de depuração e incluir exemplos e testes. Ainda é necessário digitar o seguinte comando para a construção:
+
+::
+
+  ./waf
+
+..
+	Now, if you run the ``hello-simulator`` program, you should see the 
+	expected output.
+
+Agora, ao executar o programa ``hello-simulator`` devemos ter a seguinte a saída.
+
+..
+	If you want to run programs under another tool such as gdb or valgrind,
+	see this `wiki entry
+	<http://www.nsnam.org/wiki/index.php/User_FAQ#How_to_run_NS-3_programs_under_another_tool>`_.
+
+Se o leitor for executar seus programas sob outras ferramentas, tais como Gdb ou Valgrind, é recomendável que leia a seguinte `entrada no Wiki <http://www.nsnam.org/wiki/index.php/User_FAQ#How_to_run_NS-3_programs_under_another_tool>`_.
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/doc/tutorial-pt-br/source/index.rst	Wed Apr 11 13:49:33 2012 +0200
@@ -0,0 +1,51 @@
+.. only:: html or latex
+
+..
+	========================================================================================
+	Translated for portuguese by the students of doctorate inter institutional program of IME-USP/UTFPR-CM.
+	
+	Traduzido para o português pelos alunos do programa de doutorado inter institucional do Instituto de Matemática e Estatística da Universidade de São Paulo --- IME-USP em parceria com a Universidade Tecnológica Federal do Paraná - Campus Campo Mourão --- UTFPR-CM:
+	
+	* Frank Helbert (frank@ime.usp.br);
+	* Luiz Arthur Feitosa dos Santos (luizsan@ime.usp.br);
+	* Rodrigo Campiolo (rcampiol@ime.usp.br).
+	========================================================================================
+
+ns-3 Tutorial
+===========================
+
+.. 
+	This is the *ns-3 Tutorial*. Primary documentation for the ns-3 project is
+	available in five forms:
+
+Este é o *Tutorial do ns-3* baseado no *ns-3 Tutorial* (inglês). A documentação para o projeto ns-3 esta disponível da seguinte forma:
+
+..
+	* `ns-3 Doxygen <http://www.nsnam.org/doxygen/index.html>`_: Documentation of the public APIs of the simulator
+
+* `ns-3 Doxygen <http://www.nsnam.org/doxygen/index.html>`_: Documentação das APIs públicas do simulador;
+
+..
+	* Tutorial *(this document)*, Manual, and Model Library for the `latest release <http://www.nsnam.org/documentation/latest/>`_ and `development tree <http://www.nsnam.org/ns-3-dev/documentation/>`_
+
+* Tutorial *(este documento)*, manual, modelos de bibliotecas para a `última release <http://www.nsnam.org/documentation/latest/>`_ e `árvore de desenvolvimento <http://www.nsnam.org/ns-3-dev/documentation/>`_;
+
+* `ns-3 wiki <http://www.nsnam.org/wiki/index.php/Main_Page>`_.
+
+..
+	This document is written in `reStructuredText <http://docutils.sourceforge.net/rst.html>`_ for `Sphinx <http://sphinx.pocoo.org/>`_ and is maintained in the
+	``doc/tutorial`` directory of ns-3's source code.
+
+Este documento é escrito em `reStructuredText <http://docutils.sourceforge.net/rst.html>`_ para `Sphinx <http://sphinx.pocoo.org/>`_ e é mantido no diretório ``doc/tutorial-pt-br`` do código fonte do ns-3.
+
+.. toctree::
+   :maxdepth: 2
+
+   introduction
+   resources
+   getting-started
+   conceptual-overview
+   tweaking
+   building-topologies
+   tracing
+   conclusion
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/doc/tutorial-pt-br/source/introduction.rst	Wed Apr 11 13:49:33 2012 +0200
@@ -0,0 +1,192 @@
+.. include:: replace.txt
+
+..
+	========================================================================================
+	Translated for portuguese by the students of the inter-institutional doctorate program of IME-USP/UTFPR-CM.
+	
+	Traduzido para o português pelos alunos do programa de doutorado inter institucional do Instituto de Matemática e Estatística da Universidade de São Paulo --- IME-USP em parceria com a Universidade Tecnológica Federal do Paraná - Campus Campo Mourão --- UTFPR-CM:
+	
+	* Frank Helbert (frank@ime.usp.br);
+	* Luiz Arthur Feitosa dos Santos (luizsan@ime.usp.br);
+	* Rodrigo Campiolo (campiolo@ime.usp.br).
+	========================================================================================
+
+
+Introdução 
+-----------
+
+
+..
+	The |ns3| simulator is a discrete-event network simulator targeted 
+	primarily for research and educational use.  The 
+	`ns-3 project
+	<http://www.nsnam.org>`_, 
+	started in 2006, is an open-source project developing |ns3|.
+
+O |ns3| é um simulador de redes baseado em eventos discretos desenvolvido especialmente para pesquisa e uso educacional. O `projeto ns-3 <http://www.nsnam.org>`_ iniciou em 2006 e tem seu código aberto.
+
+
+..
+	The purpose of this tutorial is to introduce new |ns3| 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.
+
+O objetivo deste tutorial é apresentar o |ns3| de forma estruturada aos usuários iniciantes. Algumas vezes torna-se difícil obter informações básicas de manuais detalhados e converter em informações úteis para as simulações. Neste tutorial são ilustrados vários exemplos de simulações, introduzindo e explicando os principais conceitos necessários ao longo do texto.
+
+..
+	As the tutorial unfolds, we will introduce the full |ns3| documentation 
+	and provide pointers to source code for those interested in delving deeper
+	into the workings of the system.
+
+A documentação completa do |ns3| e trechos do código fonte são apresentados para os interessados em aprofundar-se no funcionamento do sistema.
+
+.. 
+	A few key points are worth noting at the onset:
+
+Alguns pontos importantes para se observar:
+
+.. 
+	* Ns-3 is not an extension of `ns-2
+	<http://www.isi.edu/nsnam/ns>`_; 
+	it is a new simulator.  The two simulators are both written in C++ but 
+	|ns3| 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 |ns3|. The 
+	project will continue to maintain ns-2 while |ns3| is being built,
+	and will study transition and integration mechanisms.
+
+* O |ns3| não é uma extensão do `ns-2 <http://www.isi.edu/nsnam/ns>`_; O |ns3| é um simulador novo. Ambos são escritos em C++, mas o |ns3| é totalmente novo e não suporta as APIs da versão anterior. Algumas funcionalidades do ns-2 já foram portadas para o |ns3|. O projeto continuará mantendo o ns-2 enquanto o |ns3| estiver em fase de desenvolvimento e formas de integração e transição estão em estudo.
+
+..
+	* |ns3| is open-source, and the project strives to maintain an 
+	open  environment for researchers to contribute and share their software. 
+
+* O |ns3| é código aberto e existe um grande esforço para manter um ambiente aberto para pesquisadores que queiram contribuir e compartilhar software com o projeto.
+ 
+.. 
+	For ns-2 Users
+
+Para os usuários do ns-2
+*************************
+
+..
+	For those familiar with ns-2, the most visible outward change when moving to 
+	|ns3| is the choice of scripting language.  Ns-2 is 
+	scripted in OTcl and results of simulations can be visualized using the 
+	Network Animator nam.  It is not possible to run a simulation
+	in ns-2 purely from C++ (i.e., as a main() program without any OTcl).
+	Moreover, some components of ns-2 are written in C++ and others in OTcl.
+	In |ns3|, the simulator is written entirely in C++, with optional
+	Python bindings.  Simulation scripts can therefore be written in C++
+	or in Python.  The results of some simulations can be visualized by
+	nam, but new animators are under development.  Since |ns3|
+	generates pcap packet trace files, other utilities can be used to
+	analyze traces as well.
+	In this tutorial, we will first concentrate on scripting 
+	directly in C++ and interpreting results via trace files.  
+
+Para aqueles familiarizados com o ns-2 a mudança mais visível é a escolha da linguagem de codificação (*scripting*). O ns-2 utiliza a linguagem OTcl e os resultados das simulações podem ser visualizados utilizando o *Network Animator - nam*. Entretanto, não é possível executar uma simulação escrita inteira em C++ no ns-2 (por exemplo, com um ``main()`` sem nenhum código OTcl). Assim sendo, no ns-2 alguns componentes são escritos em C++ e outros em OTcl. No |ns3|, todo o simulador é escrito em C++ com suporte opcional a Python. Desta forma, os códigos de simulação podem ser escritos somente em C++ ou Python. Os resultados de algumas simulações podem ser visualizados pelo *nam*, mas novas formas de visualização estão sendo desenvolvidas. O |ns3| gera arquivos de rastreamento de pacotes *(packet trace)* no formato *pcap*, assim, é possível utilizar outras ferramentas para a análise de pacotes. Neste tutorial iremos nos concentrar inicialmente nos códigos de simulação escritos em C++ e na interpretação dos pacotes nos arquivos de rastreamento.
+
+..
+	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 |ns3|).
+	We will try to highlight differences between ns-2 and |ns3|
+	as we proceed in this tutorial.
+
+Também existem semelhanças entre o ns-2 e o |ns3|. Ambos, por exemplo, são orientados a objeto e parte do código do ns-2 já foi portado para o |ns3|. As diferenças entre as versões serão destacadas ao longo deste tutorial.
+
+..
+	A question that we often hear is "Should I still use ns-2 or move to
+	|ns3|?"  The answer is that it depends.  |ns3| does not have
+	all of the models that ns-2 currently has, but on the other hand, |ns3|
+	does have new capabilities (such as handling multiple interfaces on nodes 
+	correctly, use of IP addressing and more alignment with Internet
+	protocols and designs, more detailed 802.11 models, etc.).  ns-2
+	models can usually be ported to |ns3| (a porting guide is under
+	development).  There is active development on multiple fronts for 
+	|ns3|.  The |ns3| developers believe (and certain early users
+	have proven) that |ns3| is ready for active use, and should be an 
+	attractive alternative for users looking to start new simulation projects.  
+
+Uma questão que frequentemente aparece é: "Eu devo continuar usando o ns-2 ou devo migrar para o |ns3|?". A resposta é: depende. O |ns3| não tem todos os modelos do ns-2, contudo, possui novas funcionalidades (tais como: trabalha corretamente com nós de rede com múltiplas interfaces de rede (por exemplo, computadores com várias placas de rede), usa endereçamento IP, é mais consistente com arquiteturas e protocolos da Internet, detalha mais o modelo 802.11, etc.). Em todo o caso, os modelos do ns-2 podem ser portados para o |ns3| (um guia está em desenvolvimento). Atualmente existem várias frentes de trabalho para o desenvolvimento do simulador. Os desenvolvedores acreditam (e os primeiros usuários concordam) que o |ns3| está pronto para o uso e é uma ótima alternativa para usuários que querem iniciar novos projetos de simulação.
+
+.. 
+	Contributing
+
+Contribuindo
+************
+
+.. 
+	|ns3| 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 |ns3| like they have for ns-2:
+
+O |ns3| é um simulador para pesquisas e de uso educacional, feito por e para pesquisadores. Este conta com contribuições da comunidade para desenvolver novos modelos, corrigir erros ou manter códigos e compartilhar os resultados. Existem políticas de incentivo para que as pessoas contribuam com o projeto, assim como foi feito no ns-2, tais como:
+
+.. 
+	* Open source licensing based on GNU GPLv2 compatibility
+
+* Licença de código aberto compatível com GNU GPLv2;
+
+* `Wiki	<http://www.nsnam.org/wiki/index.php>`_;
+
+.. 
+	* `Contributed Code
+	<http://www.nsnam.org/wiki/index.php/Contributed_Code>`_ page, similar to ns-2's popular Contributed Code
+	`page
+	<http://nsnam.isi.edu/nsnam/index.php/Contributed_Code>`_ 
+
+* Página para `contribuição com o código <http://www.nsnam.org/wiki/index.php/Contributed_Code>`_, similar a página de contribuição do `ns-2 <http://nsnam.isi.edu/nsnam/index.php/Contributed_Code>`_;
+
+.. 
+	* Open `bug tracker
+	<http://www.nsnam.org/bugzilla>`_
+
+* `Registro de erros (bugs) <http://www.nsnam.org/bugzilla>`_ aberto.
+
+..
+	We realize that if you are reading this document, contributing back to 
+	the project is probably not your foremost concern at this point, but
+	we want you to be aware that contributing is in the spirit of the project and
+	that even the act of dropping us a note about your early experience 
+	with |ns3| (e.g. "this tutorial section was not clear..."), 
+	reports of stale documentation, etc. are much appreciated. 
+
+Se você está lendo este documento, provavelmente contribuir diretamente não seja o foco neste momento, mas esteja ciente que contribuir está no espírito do projeto, mesmo que seja deixando uma mensagem descrevendo suas experiências com o |ns3| (por exemplo, você pode relatar qual seção deste tutorial não esta clara), reportar a desatualização da documentação, etc. Toda ajuda será muita bem vinda.
+
+.. 
+	Tutorial Organization
+
+Organização do Tutorial
+***********************
+
+..
+	The tutorial assumes that new users might initially follow a path such as the
+	following:
+
+Este tutorial assume que os novos usuários podem iniciar da seguinte forma:
+
+.. 
+	* Try to download and build a copy;
+
+* Baixar e compilar uma cópia do |ns3|;
+
+.. 
+	* Try to run a few sample programs;
+
+* Executar alguns programas exemplo;
+
+.. 
+	* Look at simulation output, and try to adjust it.
+
+* Analisar as saídas de simulação e ajustá-las.
+
+.. 
+	As a result, we have tried to organize the tutorial along the above
+	broad sequences of events.
+
+Assim, tentamos organizar este tutorial nesta sequência.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/doc/tutorial-pt-br/source/replace.txt	Wed Apr 11 13:49:33 2012 +0200
@@ -0,0 +1,3 @@
+.. |ns3| replace:: *ns-3*
+
+.. |ns2| replace:: *ns-2*
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/doc/tutorial-pt-br/source/resources.rst	Wed Apr 11 13:49:33 2012 +0200
@@ -0,0 +1,227 @@
+.. include:: replace.txt
+
+..
+	========================================================================================
+	Translated for portuguese by the students of the inter-institutional doctorate program of IME-USP/UTFPR-CM.
+	
+	Traduzido para o português pelos alunos do programa de doutorado inter institucional do Instituto de Matemática e Estatística da Universidade de São Paulo --- IME-USP em parceria com a Universidade Tecnológica Federal do Paraná - Campus Campo Mourão --- UTFPR-CM:
+	
+	* Frank Helbert (frank@ime.usp.br);
+	* Luiz Arthur Feitosa dos Santos (luizsan@ime.usp.br);
+	* Rodrigo Campiolo (campiolo@ime.usp.br).
+	========================================================================================
+
+
+.. Resources
+
+Recursos
+---------
+
+.. The Web
+
+A Internet
+**********
+
+..
+	There are several important resources of which any |ns3| user must be
+	aware.  The main web site is located at http://www.nsnam.org and 
+	provides access to basic information about the |ns3| system.  Detailed 
+	documentation is available through the main web site at
+	http://www.nsnam.org/documents.html.  You can also find documents 
+	relating to the system architecture from this page.
+
+Há vários recursos importantes que um usuário do |ns3| deve conhecer. O principal está em http://www.nsnam.org e fornece acesso a informações básicas sobre o |ns3|. A documentação detalhada esta disponível no sítio principal através do endereço http://www.nsnam.org/documents.html. Nesta página, também podem ser encontrados documentos relacionados a arquitetura do sistema.
+
+..
+	There is a Wiki that complements the main |ns3| web site which you will
+	find at http://www.nsnam.org/wiki/.  You will find user and developer 
+	FAQs there, as well as troubleshooting guides, third-party contributed code, 
+	papers, etc. 
+
+Também existe um *Wiki* que completa o sítio do |ns3| e pode ser encontrado em http://www.nsnam.org/wiki/. Nesta página são encontradas perguntas freqüentes - FAQs (do inglês, *Frequently Asked Questions*) para usuários e desenvolvedores, guias para resolução de problemas, código de terceiros, artigos, etc.
+
+..
+	The source code may be found and browsed at http://code.nsnam.org/. 
+	There you will find the current development tree in the repository named
+	``ns-3-dev``. Past releases and experimental repositories of the core
+	developers may also be found there.
+
+O código fonte também pode ser encontrado e explorado em http://code.nsnam.org/. Neste encontra-se a árvore de código em desenvolvimento em um repositório chamado ``ns-3-dev``. Repositórios antigos e experimentais do núcleo de desenvolvimento podem ser encontrados neste sítio também.
+
+Mercurial
+*********
+
+..
+	Complex software systems need some way to manage the organization and 
+	changes to the underlying code and documentation.  There are many ways to
+	perform this feat, and you may have heard of some of the systems that are
+	currently used to do this.  The Concurrent Version System (CVS) is probably
+	the most well known.
+
+Sistemas complexos precisam gerenciar a organização e alterações do código, bem como a documentação. Existem várias maneiras de fazer isto e o leitor provavelmente já ouviu falar de algumas. O *Concurrent Version System (CVS)* --- em português, Sistema de Versões Concorrentes --- é provavelmente o mais conhecido.
+
+..
+	The |ns3| 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 
+	http://www.selenic.com/mercurial/,
+	from which you can get binary or source releases of this Software
+	Configuration Management (SCM) system.  Selenic (the developer of Mercurial)
+	also provides a tutorial at 
+	http://www.selenic.com/mercurial/wiki/index.cgi/Tutorial/,
+	and a QuickStart guide at
+	http://www.selenic.com/mercurial/wiki/index.cgi/QuickStart/.
+
+O |ns3| utiliza o Mercurial para isto. Embora não seja necessário conhecer muito sobre o Mercurial para entender este tutorial, recomenda-se a familiarização com o uso da ferramenta para acessar o código fonte do sistema. O Mercurial tem um sítio em http://www.selenic.com/mercurial/, no qual pode-se baixar diretamente os executáveis ou o código fonte deste sistema de *Software Configuration Management (SCM)* --- em português, Software de Gerenciamento de Configuração. Selenic (o desenvolvedor do Mercurial), também fornece tutoriais em http://www.selenic.com/mercurial/wiki/index.cgi/Tutorial/, e um guia rápido em http://www.selenic.com/mercurial/wiki/index.cgi/QuickStart/.
+
+..
+	You can also find vital information about using Mercurial and |ns3|
+	on the main |ns3| web site.
+
+Informações vitais de como usar o Mercurial e o |ns3| são encontradas no sítio principal do projeto.
+
+Waf
+***
+
+..
+	Once you have source code downloaded to your local system, you will need 
+	to compile that source to produce usable programs.  Just as in the case of
+	source code management, there are many tools available to perform this 
+	function.  Probably the most well known of these tools is ``make``.  Along
+	with being the most well known, ``make`` is probably the most difficult to
+	use in a very large and highly configurable system.  Because of this, many
+	alternatives have been developed.  Recently these systems have been developed
+	using the Python language.
+
+Uma vez baixado o código fonte para o seu sistema de arquivos local, será necessário compilar estes fontes para criar os executáveis. Para esta tarefa existem várias ferramentas disponíveis. Provavelmente a mais conhecida é o Make. Além de mais conhecido, também deve ser o mais difícil de usar em grandes sistemas e com muitas opções de configuração. Por este motivo, muitas alternativas foram desenvolvidas, utilizando principalmente a linguagem Python.
+
+..
+	The build system Waf is used on the |ns3| 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 |ns3| system, and will 
+	only have to understand a tiny and intuitively obvious subset of Python in 
+	order to extend the system in most cases.
+
+O Waf é utilizado para gerar os binários no projeto |ns3|. Ele faz parte da nova geração de sistemas de compilação e contrução baseados em Python. O leitor não precisa entender nada de Python para compilar o |ns3|, e terá que entender um pequeno e intuitivo subconjunto da linguagem se quiser estender o sistema.
+
+..
+	For those interested in the gory details of Waf, the main web site can be 
+	found at http://code.google.com/p/waf/.
+
+Para os interessados em mais detalhes sobre o Waf, basta acessar o sítio http://code.google.com/p/waf/.
+
+.. Development Environment
+
+Ambiente de Desenvolvimento
+***************************
+
+..
+	As mentioned above, scripting in |ns3| is done in C++ or Python.
+	As of ns-3.2, most of the |ns3| API is available in Python, but the 
+	models are written in C++ in either case.  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 
+	appear.  We don't want this tutorial to devolve into a C++ tutorial, though,
+	so we do expect a basic command of the language.  There are an almost 
+	unimaginable number of sources of information on C++ available on the web or
+	in print.
+
+Como mencionado anteriormente, a programação no |ns3| é feita em C++ ou Python. A partir do ns-3.2, a maioria das APIs já estão disponíveis em Python, mas os modelos continuam sendo escritos em C++. Considera-se que o leitor possui conhecimento básico de C++ e conceitos de orientação a objetos neste documento. Somente serão revistos conceitos avançados, possíveis características pouco utilizadas da linguagem, dialetos e padrões de desenvolvimento. O objetivo não é tornar este um tutorial de C++, embora seja necessário saber o básico da linguagem. Para isto, existe um número muito grande de fontes de informação na Web e em materiais impressos (livros, tutoriais, revistas, etc).
+
+..
+	If you are new to C++, you may want to find a tutorial- or cookbook-based
+	book or web site and work through at least the basic features of the language
+	before proceeding.  For instance, `this tutorial
+	<http://www.cplusplus.com/doc/tutorial/>`_.
+
+Se você é inexperiente em C++, pode encontrar tutoriais, livros e sítios Web para obter o mínimo de conhecimento sobre a linguagem antes de continuar. Por exemplo, pode utilizar `este tutorial <http://www.cplusplus.com/doc/tutorial/>`_.
+
+..
+	The |ns3| system uses several components of 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,
+	http://en.wikipedia.org/wiki/GNU_toolchain.  |ns3| uses gcc, 
+	GNU binutils, and gdb.  However, we do not use the GNU build system tools, 
+	neither make nor autotools.  We use Waf for these functions.
+
+O |ns3| utiliza vários componentes do conjunto de ferramentas GNU --- `"GNU toolchain"` --- para o desenvolvimento. Um `software toolchain` é um conjunto de ferramentas de programação para um determinado ambiente. Para uma breve visão do que consiste o `GNU toolchain` veja http://en.wikipedia.org/wiki/GNU_toolchain. O |ns3| usa o `gcc`, `GNU binutils` e `gdb`. Porém, não usa as ferramentas GNU para compilar o sistema, nem o Make e nem o Autotools. Para estas funções é utilizado o Waf.
+
+..
+	Typically an |ns3| 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 |ns3| 
+	project supports development in the Cygwin environment for 
+	these users.  See http://www.cygwin.com/ 
+	for details on downloading (MinGW is presently not officially supported,
+	although some of the project maintainers to work with it). 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.
+
+Normalmente um usuário do |ns3| irá trabalhar no Linux ou um ambiente baseado nele. Para aqueles que usam Windows, existem ambientes que simulam o Linux em vários níveis. Para estes usuários, o projeto |ns3| fornece suporte ao ambiente Cygwin. Veja o sítio http://www.cygwin.com/ para detalhes de como baixá-lo (o MinGW não é suportado oficialmente, embora alguns mantenedores do projeto trabalhem com ele). O Cygwin fornece vários comandos populares do Linux, entretanto podemos ter problemas com a emulação, às vezes a interação com outros programas do Windows pode causar problemas.
+
+..
+	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 `MinGW FAQ
+	<http://oldwiki.mingw.org/index.php/FAQ>`_.
+
+Se você usa o Cygwin ou MinGW e usa produtos da Logitech, evite dores de cabeça e dê uma olhada em `MinGW FAQ	<http://oldwiki.mingw.org/index.php/FAQ>`_.
+
+..
+	Search for "Logitech" and read the FAQ entry, "why does make often 
+	crash creating a sh.exe.stackdump file when I try to compile my source code."
+	Believe it or not, the ``Logitech Process Monitor`` insinuates itself into
+	every DLL in the system when it is running.  It can cause your Cygwin or
+	MinGW DLLs to die in mysterious ways and often prevents debuggers from 
+	running.  Beware of Logitech software when using Cygwin.
+
+Busque por "Logitech" e leia a entrada com o assunto: "why does make often crash creating a sh.exe.stackdump file when I try to compile my source code.". Acredite ou não, o ``Logitech Process Monitor`` influencia todas as DLLs do sistema. Isto pode ocasionar problemas misteriosos durante a execução do Cygwin ou do MinGW. Muita cautela quando utilizar software da Logitech junto com o Cygwin.
+
+..
+	Another alternative to Cygwin is to install a virtual machine environment
+	such as VMware server and install a Linux virtual machine.
+
+
+Uma alternativa ao Cygwin é instalar um ambiente de máquina virtual, tal como o VMware server e criar uma máquina virtual Linux.
+
+
+.. Socket Programming
+
+Programando com Soquetes (Sockets)
+**********************************
+
+..
+	We will assume a basic facility with the Berkeley Sockets API in the examples
+	used in this tutorial.  If you are new to sockets, we recommend reviewing the
+	API and some common usage cases.  For a good overview of programming TCP/IP
+	sockets we recommend `TCP/IP Sockets in C, Donahoo and Calvert
+	<http://www.elsevier.com/wps/find/bookdescription.
+	cws_home/717656/description#description>`_.
+
+
+Neste tutorial assume-se, nos exemplos utilizados, que o leitor está familiarizado com as funcionalidades básicas da API dos soquetes de Berkeley. Se este não for o caso, recomendamos a leitura das APIs e alguns casos de uso comuns. Uma API --- do Inglês, `Application Programming Interface` --- é um é um conjunto de rotinas e padrões estabelecidos por um software para a utilização das suas funcionalidades. Para uma boa visão geral sobre a programação de soquetes TCP/IP sugerimos `TCP/IP Sockets in C, Donahoo and Calvert
+<http://www.elsevier.com/wps/find/bookdescription.cws_home/717656/description#description>`_.
+
+..
+	There is an associated web site that includes source for the examples in the
+	book, which you can find at:
+	http://cs.baylor.edu/~donahoo/practical/CSockets/.
+
+O sítio http://cs.baylor.edu/~donahoo/practical/CSockets/ contém os códigos fontes dos exemplos do livro.
+
+..
+	If you understand the first four chapters of the book (or for those who do
+	not have access to a copy of the book, the echo clients and servers shown in 
+	the website above) you will be in good shape to understand the tutorial.
+	There is a similar book on Multicast Sockets,
+	`Multicast Sockets, Makofske and Almeroth
+	<http://www.elsevier.com/wps/find/bookdescription.cws_home/700736/description#description>`_.
+	that covers material you may need to understand if you look at the multicast 
+	examples in the distribution.
+
+Se o leitor entender os primeiros quatro capítulos do livro (ou para aqueles que não têm acesso ao livro, os exemplos de cliente e servidor de eco mostrado no sítio anterior) estará apto para compreender o tutorial. Existe também um livro sobre soquetes multidifusão, `Multicast Sockets, Makofske and Almeroth	<http://www.elsevier.com/wps/find/bookdescription.cws_home/700736/description#description>`_. que é um material que cobre o necessário sobre multidifusão caso o leitor se interesse.
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/doc/tutorial-pt-br/source/tracing.rst	Wed Apr 11 13:49:33 2012 +0200
@@ -0,0 +1,4438 @@
+.. include:: replace.txt
+
+..
+	========================================================================================
+	Translated for portuguese by the students of the inter-institutional doctorate program of IME-USP/UTFPR-CM.
+	
+	Traduzido para o português pelos alunos do programa de doutorado inter institucional do Instituto de Matemática e Estatística da Universidade de São Paulo --- IME-USP em parceria com a Universidade Tecnológica Federal do Paraná - Campus Campo Mourão --- UTFPR-CM:
+	
+	* Frank Helbert (frank@ime.usp.br);
+	* Luiz Arthur Feitosa dos Santos (luizsan@ime.usp.br);
+	* Rodrigo Campiolo (campiolo@ime.usp.br).
+	========================================================================================
+
+..
+	Tracing
+
+Rastreamento
+------------
+
+..
+	Background
+
+Introdução
+**********
+
+..
+	As mentioned in the Using the Tracing System section, the whole point of running
+	an |ns3| simulation is to generate output for study.  You have two basic 
+	strategies to work with in |ns3|: using generic pre-defined bulk output 
+	mechanisms and parsing their content to extract interesting information; or 
+	somehow developing an output mechanism that conveys exactly (and perhaps only) 
+	the information wanted.
+
+Como abordado na seção Usando o Sistema de Rastreamento, o objetivo principal de uma
+simulação no |ns3| é a geração de saída para estudo. Há duas estratégias básicas: 
+usar mecanismos predefinidos de saída e processar o conteúdo para extrair informações
+relevantes; ou desenvolver mecanismos de saída que resultam somente ou exatamente na
+informação pretendida.
+
+..
+	Using pre-defined bulk output mechanisms has the advantage of not requiring any
+	changes to |ns3|, but it does require programming.  Often, pcap or NS_LOG
+	output messages are gathered during simulation runs and separately run through 
+	scripts that use grep, sed or awk to parse the messages and reduce and transform
+	the data to a manageable form.  Programs must be written to do the 
+	transformation, so this does not come for free.  Of course, if the information
+	of interest in does not exist in any of the pre-defined output mechanisms,
+	this approach fails.
+
+Usar mecanismos predefinidos de saída possui a vantagem de não necessitar modificações 
+no |ns3|, mas requer programação. Geralmente, as mensagens de saída do pcap ou ``NS_LOG``
+são coletadas durante a execução da simulação e processadas separadamente por códigos (`scripts`) que usam `grep`, `sed` ou `awk` para reduzir e transformar os dados para uma forma mais simples de gerenciar. Há o custo do desenvolvimento de programas para realizar as transformações e em algumas situações a informação de interesse pode não estar contida em nenhuma das saídas, logo, a abordagem falha.
+
+..
+	If you need to add some tidbit of information to the pre-defined bulk mechanisms,
+	this can certainly be done; and if you use one of the |ns3| mechanisms, 
+	you may get your code added as a contribution.
+
+Se precisarmos adicionar o mínimo de informação para os mecanismos predefinidos de saída, isto certamente pode ser feito e se usarmos os mecanismos do |ns3|, podemos
+ter nosso código adicionado como uma contribuição.
+
+..
+	|ns3| provides another mechanism, called Tracing, that avoids some of the 
+	problems inherent in the bulk output mechanisms.  It has several important 
+	advantages.  First, you can reduce the amount of data you have to manage by only
+	tracing the events of interest to you (for large simulations, dumping everything
+	to disk for post-processing can create I/O bottlenecks).  Second, if you use this
+	method, you can control the format of the output directly so you avoid the 
+	postprocessing step with sed or awk script.  If you desire, your output can be 
+	formatted directly into a form acceptable by gnuplot, for example.  You can add 
+	hooks in the core which can then be accessed by other users, but which will 
+	produce no information unless explicitly asked to do so.  For these reasons, we 
+	believe that the |ns3| tracing system is the best way to get information 
+	out of a simulation and is also therefore one of the most important mechanisms
+	to understand in |ns3|.
+
+O |ns3| fornece outro mecanismo, chamado Rastreamento (*Tracing*), que evita alguns dos
+problemas associados com os mecanismos de saída predefinidos. Há várias vantagens. Primeiro, redução da quantidade de dados para gerenciar (em simulações grandes, armazenar toda saída no disco pode gerar gargalos de Entrada/Saída). Segundo, o formato da saída pode ser controlado diretamente evitando o pós-processamento com códigos `sed` ou `awk`. Se desejar,
+a saída pode ser processada diretamente para um formato reconhecido pelo `gnuplot`, por exemplo. Podemos adicionar ganchos ("`hooks`") no núcleo, os quais podem ser acessados por outros usuários, mas que não produzirão nenhuma informação exceto que sejam explicitamente solicitados a produzir. Por essas razões, acreditamos que o sistema de rastreamento do |ns3| é a melhor forma de obter informações fora da simulação, portanto é um dos mais importantes mecanismos para ser compreendido no |ns3|.
+
+..
+	Blunt Instruments
+
+Métodos Simples
++++++++++++++++
+
+..
+	There are many ways to get information out of a program.  The most 
+	straightforward way is to just directly print the information to the standard 
+	output, as in,
+
+Há várias formas de obter informação após a finalização de um programa. A mais direta
+é imprimir a informação na saída padrão, como no exemplo,
+
+::
+
+  #include <iostream>
+  ...
+  void
+  SomeFunction (void)
+  {
+    uint32_t x = SOME_INTERESTING_VALUE;
+    ...
+    std::cout << "The value of x is " << x << std::endl;
+    ...
+  } 
+
+..
+	Nobody is going to prevent you from going deep into the core of |ns3| and
+	adding print statements.  This is insanely easy to do and, after all, you have 
+	complete control of your own |ns3| branch.  This will probably not turn 
+	out to be very satisfactory in the long term, though.
+
+Ninguém impedirá que editemos o núcleo do |ns3| e adicionemos códigos de impressão. Isto é simples de fazer, além disso temos controle e acesso total ao código fonte do |ns3|. Entretanto, pensando no futuro, isto não é muito interessante.
+
+..
+	As the number of print statements increases in your programs, the task of 
+	dealing with the large number of outputs will become more and more complicated.  
+	Eventually, you may feel the need to control what information is being printed 
+	in some way; perhaps by turning on and off certain categories of prints, or 
+	increasing or decreasing the amount of information you want.  If you continue 
+	down this path you may discover that you have re-implemented the ``NS_LOG``
+	mechanism.  In order to avoid that, one of the first things you might consider
+	is using ``NS_LOG`` itself.
+
+Conforme aumentarmos o número de comandos de impressão em nossos programas, ficará mais difícil tratar a grande quantidade de saídas. Eventualmente, precisaremos controlar de alguma maneira qual a informação será impressa; talvez habilitando ou não determinadas categorias de saídas, ou aumentando ou diminuindo a quantidade de informação desejada. Se continuarmos com esse processo, descobriremos depois de um tempo que, reimplementamos o mecanismo ``NS_LOG``. Para evitar isso, utilize o próprio ``NS_LOG``.
+
+..
+	We mentioned above that one way to get information out of |ns3| is to 
+	parse existing NS_LOG output for interesting information.  If you discover that 
+	some tidbit of information you need is not present in existing log output, you 
+	could edit the core of |ns3| and simply add your interesting information
+	to the output stream.  Now, this is certainly better than adding your own
+	print statements since it follows |ns3| coding conventions and could 
+	potentially be useful to other people as a patch to the existing core.
+
+Como abordado anteriormente, uma maneira de obter informação de saída do |ns3| é 
+processar a saída do ``NS_LOG``, filtrando as informações relevantes. Se a informação
+não está presente nos registros existentes, pode-se editar o núcleo do |ns3| e 
+adicionar ao fluxo de saída a informação desejada. Claro, isto é muito melhor
+que adicionar comandos de impressão, desde que seguindo as convenções de codificação
+do |ns3|, além do que isto poderia ser potencialmente útil a outras pessoas.
+
+..
+	Let's pick a random example.  If you wanted to add more logging to the 
+	|ns3| TCP socket (``tcp-socket-base.cc``) you could just add a new 
+	message down in the implementation.  Notice that in TcpSocketBase::ReceivedAck()
+	there is no log message for the no ack case.  You could simply add one, 
+	changing the code from:
+
+Vamos analisar um exemplo, adicionando mais informações de registro ao `socket` TCP do arquivo ``tcp-socket-base.cc``, para isto vamos acrescentando uma nova mensagem de registro na implementação. Observe que em ``TcpSocketBase::ReceivedAck()`` não existem mensagem de registro para casos sem o *ACK*, então vamos adicionar uma da seguinte forma:
+
+::
+
+  /** Processa o mais recente ACK recebido */
+  void
+  TcpSocketBase::ReceivedAck (Ptr<Packet> packet, const TcpHeader& tcpHeader)
+  {
+    NS_LOG_FUNCTION (this << tcpHeader);
+
+    // ACK Recebido. Compara o número ACK com o mais alto seqno não confirmado
+    if (0 == (tcpHeader.GetFlags () & TcpHeader::ACK))
+      { // Ignora se não há flag ACK 
+      }
+    ...
+
+.. 
+	to add a new ``NS_LOG_LOGIC`` in the appropriate statement:
+
+para adicionar um novo ``NS_LOG_LOGIC`` na sentença apropriada:
+
+::
+
+  /** Processa o mais recente ACK recebido */
+  void
+  TcpSocketBase::ReceivedAck (Ptr<Packet> packet, const TcpHeader& tcpHeader)
+  {
+    NS_LOG_FUNCTION (this << tcpHeader);
+
+    // ACK Recebido. Compara o número ACK com o mais alto seqno não confirmado
+    if (0 == (tcpHeader.GetFlags () & TcpHeader::ACK))
+      { // Ignora se não há flag ACK 
+        NS_LOG_LOGIC ("TcpSocketBase " << this << " sem flag ACK");
+      }
+    ...
+
+..
+	This may seem fairly simple and satisfying at first glance, but something to
+	consider is that you will be writing code to add the ``NS_LOG`` statement 
+	and you will also have to write code (as in grep, sed or awk scripts) to parse
+	the log output in order to isolate your information.  This is because even 
+	though you have some control over what is output by the logging system, you 
+	only have control down to the log component level.  
+
+Isto pode parecer simples e satisfatório a primeira vista, mas lembre-se que nós escreveremos
+código para adicionar ao ``NS_LOG`` e para processar a saída com a finalidade de isolar
+a informação de interesse. Isto porque o controle é limitado ao nível do componente de registro.
+
+..
+	If you are adding code to an existing module, you will also have to live with the
+	output that every other developer has found interesting.  You may find that in 
+	order to get the small amount of information you need, you may have to wade 
+	through huge amounts of extraneous messages that are of no interest to you.  You
+	may be forced to save huge log files to disk and process them down to a few lines
+	whenever you want to do anything.
+
+Se cada desenvolvedor adicionar códigos de saída para um módulo existente, logo conviveremos com a saída que outro desenvolvedor achou interessante. É descobriremos que para obter uma pequena quantidade de informação, precisaremos produzir uma volumosa quantidade de mensagens sem nenhuma relevância (devido aos comandos de saída de vários desenvolvedores). Assim seremos forçados a gerar arquivos de registros gigantescos no disco e processá-los para obter poucas linhas de nosso interesse.
+
+..
+	Since there are no guarantees in |ns3| about the stability of ``NS_LOG``
+	output, you may also discover that pieces of log output on which you depend 
+	disappear or change between releases.  If you depend on the structure of the 
+	output, you may find other messages being added or deleted which may affect your
+	parsing code.
+
+Como não há nenhuma garantia no |ns3| sobre a estabilidade da saída do ``NS_LOG``, podemos descobrir que partes do registro de saída, que dependíamos, desapareceram ou mudaram entre versões. Se dependermos da estrutura da saída, podemos encontrar outras mensagens sendo adicionadas ou removidas que podem afetar seu código de processamento.
+
+..
+	For these reasons, we consider prints to ``std::cout`` and NS_LOG messages 
+	to be quick and dirty ways to get more information out of |ns3|.
+
+Por estas razões, devemos considerar o uso do ``std::cout`` e as mensagens ``NS_LOG`` como formas rápidas e porém sujas de obter informação da saída no |ns3|.
+
+..
+	It is desirable to have a stable facility using stable APIs that allow one to 
+	reach into the core system and only get the information required.  It is
+	desirable to be able to do this without having to change and recompile the
+	core system.  Even better would be a system that notified the user when an item
+	of interest changed or an interesting event happened so the user doesn't have 
+	to actively poke around in the system looking for things.
+
+Na grande maioria dos casos desejamos ter um mecanismo estável, usando APIs que permitam acessar o núcleo do sistema e obter somente informações interessantes. Isto deve ser possível sem que exista a necessidade de alterar e recompilar o núcleo do sistema. Melhor ainda seria se um sistema notificasse o usuário quando um item de interesse fora modificado ou um evento de interesse aconteceu, pois o usuário não teria que constantemente vasculhar o sistema procurando por coisas.
+
+..
+	The |ns3| tracing system is designed to work along those lines and is 
+	well-integrated with the Attribute and Config subsystems allowing for relatively
+	simple use scenarios.
+
+O sistema de rastreamento do |ns3| é projetado para trabalhar seguindo essas premissas e é 
+integrado com os subsistemas de Atributos (*Attribute*) e Configuração (*Config*) permitindo cenários de uso simples.
+
+.. 
+	Overview
+
+Visão Geral
+***********
+
+..
+	The ns-3 tracing system is built on the concepts of independent tracing sources
+	and tracing sinks; along with a uniform mechanism for connecting sources to sinks.
+
+O sistema de rastreamento do |ns3| é baseado no conceito independente origem do rastreamento e destino do rastreamento. O |ns3| utiliza um mecanismo uniforme para conectar origens a destinos.
+
+..
+	Trace sources are entities that can signal events that happen in a simulation and 
+	provide access to interesting underlying data.  For example, a trace source could
+	indicate when a packet is received by a net device and provide access to the 
+	packet contents for interested trace sinks.  A trace source might also indicate 
+	when an interesting state change happens in a model.  For example, the congestion
+	window of a TCP model is a prime candidate for a trace source.
+
+As origens do rastreamento (*trace source*) são entidades que podem assinalar eventos que ocorrem na simulação e fornecem acesso a dados de baixo nível. Por exemplo, uma origem do rastreamento poderia indicar quando um pacote é recebido por um dispositivo de rede e prove acesso ao conteúdo do pacote aos interessados no destino do rastreamento. Uma origem do rastreamento pode também indicar quando uma mudança de estado ocorre em um modelo. Por exemplo, a janela de congestionamento do modelo TCP é um forte candidato para uma origem do rastreamento.
+
+..
+	Trace sources are not useful by themselves; they must be connected to other pieces
+	of code that actually do something useful with the information provided by the source.
+	The entities that consume trace information are called trace sinks.  Trace sources 
+	are generators of events and trace sinks are consumers.  This explicit division 
+	allows for large numbers of trace sources to be scattered around the system in 
+	places which model authors believe might be useful.  
+
+A origem do rastreamento não são úteis sozinhas; elas devem ser conectadas a outras partes de código que fazem algo útil com a informação provida pela origem. As entidades que consomem a informação de rastreamento são chamadas de destino do rastreamento (*trace sinks*). As origens de rastreamento são geradores de eventos e destinos de rastreamento são consumidores. Esta divisão explícita permite que inúmeras origens de rastreamento estejam dispersas no sistema em locais que os autores do modelo acreditam ser úteis.
+
+..
+	There can be zero or more consumers of trace events generated by a trace source.  
+	One can think of a trace source as a kind of point-to-multipoint information link.  
+	Your code looking for trace events from a particular piece of core code could 
+	happily coexist with other code doing something entirely different from the same
+	information.
+
+Pode haver zero ou mais consumidores de eventos de rastreamento gerados por uma origem do rastreamento. Podemos pensar em uma origem do rastreamento como um tipo de ligação de informação ponto-para-multiponto. Seu código buscaria por eventos de rastreamento de uma parte específica do código do núcleo e poderia coexistir com outro código que faz algo inteiramente diferente com a mesma informação.
+
+..
+	Unless a user connects a trace sink to one of these sources, nothing is output.  By
+	using the tracing system, both you and other people at the same trace source are 
+	getting exactly what they want and only what they want out of the system.  Neither
+	of you are impacting any other user by changing what information is output by the 
+	system.  If you happen to add a trace source, your work as a good open-source 
+	citizen may allow other users to provide new utilities that are perhaps very useful
+	overall, without making any changes to the |ns3| core.  
+
+Ao menos que um usuário conecte um destino do rastreamento a uma destas origens, nenhuma saída é produzida. Usando o sistema de rastreamento, todos conectados em uma mesma origem do rastreamento estão obtendo a informação que desejam do sistema. Um usuário não afeta os outros alterando a informação provida pela origem. Se acontecer de adicionarmos uma origem do rastreamento, seu trabalho como um bom cidadão utilizador de código livre pode permitir que outros usuários forneçam novas utilidades para todos, sem fazer qualquer modificação no núcleo do |ns3|.
+	
+.. 
+	A Simple Low-Level Example
+
+Um Exemplo Simples de Baixo Nível
++++++++++++++++++++++++++++++++++
+
+..
+	Let's take a few minutes and walk through a simple tracing example.  We are going
+	to need a little background on Callbacks to understand what is happening in the
+	example, so we have to take a small detour right away.
+
+Vamos gastar alguns minutos para entender um exemplo de rastreamento simples. Primeiramente
+precisamos compreender o conceito de *callbacks* para entender o que está acontecendo
+no exemplo.
+
+*Callbacks*
+~~~~~~~~~~~
+
+..
+	The goal of the Callback system in |ns3| is to allow one piece of code to 
+	call a function (or method in C++) without any specific inter-module dependency.
+	This ultimately means you need some kind of indirection -- you treat the address
+	of the called function as a variable.  This variable is called a pointer-to-function
+	variable.  The relationship between function and pointer-to-function pointer is 
+	really no different that that of object and pointer-to-object.
+
+O objetivo do sistema de *Callback*, no |ns3|, é permitir a uma parte do código invocar
+uma função (ou método em C++) sem qualquer dependência entre módulos. Isto é utilizado para prover algum tipo de indireção -- desta forma tratamos o endereço da chamada de função como uma variável. Esta variável é denominada variável de ponteiro-para-função. O relacionamento entre função e ponteiro-para-função não é tão diferente que de um objeto e ponteiro-para-objeto.
+
+..
+	In C the canonical example of a pointer-to-function is a 
+	pointer-to-function-returning-integer (PFI).  For a PFI taking one int parameter,
+	this could be declared like,
+
+Em C, o exemplo clássico de um ponteiro-para-função é um ponteiro-para-função-retornando-inteiro (PFI). Para um PFI ter um parâmetro inteiro, poderia ser declarado como,
+
+::
+
+  int (*pfi)(int arg) = 0;
+
+..
+	What you get from this is a variable named simply "pfi" that is initialized
+	to the value 0.  If you want to initialize this pointer to something meaningful,
+	you have to have a function with a matching signature.  In this case, you could
+	provide a function that looks like,
+
+O código descreve uma variável nomeada como "pfi" que é inicializada com o valor 0. Se quisermos inicializar este ponteiro com um valor significante, temos que ter uma função com uma assinatura idêntica. Neste caso, poderíamos prover uma função como,
+
+::
+
+  int MyFunction (int arg) {}
+
+..
+	If you have this target, you can initialize the variable to point to your
+	function:
+
+Dessa forma, podemos inicializar a variável apontando para uma função:
+
+::
+
+  pfi = MyFunction;
+
+..
+	You can then call MyFunction indirectly using the more suggestive form of
+	the call,
+
+Podemos então chamar ``MyFunction`` indiretamente, usando uma forma mais clara da chamada,
+
+::
+
+  int result = (*pfi) (1234);
+
+..
+	This is suggestive since it looks like you are dereferencing the function
+	pointer just like you would dereference any pointer.  Typically, however,
+	people take advantage of the fact that the compiler knows what is going on
+	and will just use a shorter form,
+
+É uma forma mais clara, pois é como se estivéssemos dereferenciando o ponteiro da função como dereferenciamos qualquer outro ponteiro. Tipicamente, todavia, usa-se uma forma mais curta pois o compilador sabe o que está fazendo,
+
+::
+
+  int result = pfi (1234);
+
+..
+	This looks like you are calling a function named "pfi," but the compiler is
+	smart enough to know to call through the variable ``pfi`` indirectly to
+	the function ``MyFunction``.
+
+Esta forma é como se estivessemos chamando uma função nomeada "pfi", mas o compilador reconhece que é uma chamada indireta da função ``MyFunction`` por meio da variável ``pfi``.
+
+..
+	Conceptually, this is almost exactly how the tracing system will work.
+	Basically, a trace source *is* a callback.  When a trace sink expresses
+	interest in receiving trace events, it adds a Callback to a list of Callbacks
+	internally held by the trace source.  When an interesting event happens, the 
+	trace source invokes its ``operator()`` providing zero or more parameters.
+	The ``operator()`` eventually wanders down into the system and does something
+	remarkably like the indirect call you just saw.  It provides zero or more 
+	parameters (the call to "pfi" above passed one parameter to the target function
+	``MyFunction``.
+
+Conceitualmente, é quase exatamente como o sistema de rastreamento funciona. Basicamente, uma origem do rastreamento *é* um *callback*. Quando um destino do rastreamento expressa interesse em receber eventos de rastreamento, ela adiciona a *callback* para a lista de *callbacks*  mantida internamente pela origem do rastreamento. Quando um evento de interesse ocorre, a origem do rastreamento invoca seu ``operator()`` provendo zero ou mais parâmetros. O ``operator()`` eventualmente percorre o sistema e faz uma chamada indireta com zero ou mais parâmetros.
+	
+..
+	The important difference that the tracing system adds is that for each trace
+	source there is an internal list of Callbacks.  Instead of just making one 
+	indirect call, a trace source may invoke any number of Callbacks.  When a trace
+	sink expresses interest in notifications from a trace source, it basically just
+	arranges to add its own function to the callback list.
+
+Uma diferença importante é que o sistema de rastreamento adiciona para cada origem do rastreamento uma lista interna de *callbacks*. Ao invés de apenas fazer uma chamada indireta, uma origem do rastreamento pode invocar qualquer número de *callbacks*. Quando um destino do rastreamento expressa interesse em notificações de uma origem, ela adiciona sua própria função para a lista de *callback*.
+
+..
+	If you are interested in more details about how this is actually arranged in 
+	|ns3|, feel free to peruse the Callback section of the manual.
+
+Estando interessado em mais detalhes sobre como é organizado o sistema de *callback* no |ns3|, leia a seção *Callback* do manual.
+
+.. 
+	Example Code
+
+Código de Exemplo
+~~~~~~~~~~~~~~~~~
+
+..
+	We have provided some code to implement what is really the simplest example
+	of tracing that can be assembled.  You can find this code in the tutorial
+	directory as ``fourth.cc``.  Let's walk through it.
+
+Analisaremos uma implementação simples de um exemplo de rastreamento. Este código está no diretório do tutorial, no arquivo ``fourth.cc``.
+
+::
+
+  /* -*- 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/object.h"
+  #include "ns3/uinteger.h"
+  #include "ns3/traced-value.h"
+  #include "ns3/trace-source-accessor.h"
+  
+  #include <iostream>
+  
+  using namespace ns3;
+
+..
+	Most of this code should be quite familiar to you.  As mentioned above, the
+	trace system makes heavy use of the Object and Attribute systems, so you will 
+	need to include them.  The first two includes above bring in the declarations
+	for those systems explicitly.  You could use the core module header, but this
+	illustrates how simple this all really is.  
+
+A maior parte deste código deve ser familiar, pois como já abordado, o sistema de rastreamento faz uso constante dos sistemas Objeto (*Object*) e Atributos (*Attribute*), logo é necessário incluí-los. As duas primeiras inclusões (*include*) declaram explicitamente estes dois sistemas. Poderíamos usar o cabeçalho (*header*) do módulo núcleo, este exemplo é simples.
+
+..
+	The file, ``traced-value.h`` brings in the required declarations for tracing
+	of data that obeys value semantics.  In general, value semantics just means that
+	you can pass the object around, not an address.  In order to use value semantics
+	at all you have to have an object with an associated copy constructor and 
+	assignment operator available.  We extend the requirements to talk about the set
+	of operators that are pre-defined for plain-old-data (POD) types.  Operator=, 
+	operator++, operator---, operator+, operator==, etc.
+
+O arquivo ``traced-value.h`` é uma declaração obrigatória para rastreamento de dados que usam passagem por valor. Na passagem por valor é passada uma cópia do objeto e não um endereço. Com a finalidade de usar passagem por valor, precisa-se de um objeto com um construtor de cópia associado e um operador de atribuição. O conjunto de operadores predefinidos para tipos de dados primitivos (*plain-old-data*) são ++, ---, +, ==, etc.
+
+..
+	What this all really means is that you will be able to trace changes to a C++
+	object made using those operators.
+
+Isto significa que somos capazes de rastrear alterações em um objeto C++ usando estes operadores.
+
+..
+	Since the tracing system is integrated with Attributes, and Attributes work
+	with Objects, there must be an |ns3| ``Object`` for the trace source
+	to live in.  The next code snippet declares and defines a simple Object we can
+	work with.
+
+Como o sistema de rastreamento é integrado com Atributos e este trabalham com Objetos, deve obrigatoriamente existir um ``Object`` |ns3| para cada origem do rastreamento. O próximo código define e declara um Objeto.
+
+::
+
+  class MyObject : public Object
+  {
+  public:
+    static TypeId GetTypeId (void)
+    {
+      static TypeId tid = TypeId ("MyObject")
+        .SetParent (Object::GetTypeId ())
+        .AddConstructor<MyObject> ()
+        .AddTraceSource ("MyInteger",
+                         "An integer value to trace.",
+                         MakeTraceSourceAccessor (&MyObject::m_myInt))
+        ;
+      return tid;
+    }
+    
+    MyObject () {}
+    TracedValue<int32_t> m_myInt;
+  };
+
+..
+	The two important lines of code, above, with respect to tracing are the 
+	``.AddTraceSource`` and the ``TracedValue`` declaration of ``m_myInt``.
+
+As duas linhas mais importantes com relação ao rastreamento são ``.AddTraceSource`` e a declaração ``TracedValue`` do ``m_myInt``.
+
+
+..
+	The ``.AddTraceSource`` provides the "hooks" used for connecting the trace
+	source to the outside world through the config system.  The ``TracedValue`` 
+	declaration provides the infrastructure that overloads the operators mentioned 
+	above and drives the callback process.
+
+O método ``.AddTraceSource`` provê a "ligação" usada para conectar a origem do rastreamento com o mundo externo, por meio do sistema de configuração. A declaração ``TracedValue`` provê a infraestrutura que sobrecarrega os operadores abordados anteriormente e  gerencia o processo de *callback*.
+
+::
+
+  void
+  IntTrace (int32_t oldValue, int32_t newValue)
+  {
+    std::cout << "Traced " << oldValue << " to " << newValue << std::endl;
+  }
+
+..
+	This is the definition of the trace sink.  It corresponds directly to a callback
+	function.  Once it is connected, this function will be called whenever one of the
+	overloaded operators of the ``TracedValue`` is executed.
+
+Esta é a definição do destino do rastreamento. Isto corresponde diretamente a função de *callback*. Uma vez que está conectada, esta função será chamada sempre que um dos operadores sobrecarregados de ``TracedValue`` é executado.
+
+..
+	We have now seen the trace source and the trace sink.  What remains is code to
+	connect the source to the sink.
+
+Nós temos a origem e o destino do rastreamento. O restante é o código para conectar a origem ao destino.
+
+::
+
+  int
+  main (int argc, char *argv[])
+  {
+    Ptr<MyObject> myObject = CreateObject<MyObject> ();
+    myObject->TraceConnectWithoutContext ("MyInteger", MakeCallback(&IntTrace));
+  
+    myObject->m_myInt = 1234;
+  }
+
+..
+	Here we first create the Object in which the trace source lives.
+
+Criamos primeiro o Objeto no qual está a origem do rastreamento.
+
+..
+	The next step, the ``TraceConnectWithoutContext``, forms the connection
+	between the trace source and the trace sink.  Notice the ``MakeCallback``
+	template function.  This function does the magic required to create the
+	underlying |ns3| Callback object and associate it with the function
+	``IntTrace``.  TraceConnect makes the association between your provided
+	function and the overloaded ``operator()`` in the traced variable referred 
+	to by the "MyInteger" Attribute.  After this association is made, the trace
+	source will "fire" your provided callback function.
+
+No próximo passo, o ``TraceConnectWithoutContext`` conecta a origem ao destino do rastreamento. Observe que a função ``MakeCallback`` cria o objeto *callback* e associa com a função ``IntTrace``. ``TraceConnectWithoutContext`` faz a associação entre a sua função e o ``operator()``, sobrecarregado a variável rastreada referenciada pelo Atributo ``"MyInteger"``. Depois disso, a origem do rastreamento "disparará" sua função de callback.
+
+..
+	The code to make all of this happen is, of course, non-trivial, but the essence
+	is that you are arranging for something that looks just like the ``pfi()``
+	example above to be called by the trace source.  The declaration of the 
+	``TracedValue<int32_t> m_myInt;`` in the Object itself performs the magic 
+	needed to provide the overloaded operators (++, ---, etc.) that will use the
+	``operator()`` to actually invoke the Callback with the desired parameters.
+	The ``.AddTraceSource`` performs the magic to connect the Callback to the 
+	Config system, and ``TraceConnectWithoutContext`` performs the magic to
+	connect your function to the trace source, which is specified by Attribute
+	name.
+
+O código para fazer isto acontecer não é trivial, mas a essência é a mesma que se a origem do rastreamento chamasse a função ``pfi()`` do exemplo anterior. A declaração ``TracedValue<int32_t> m_myInt;`` no Objeto é responsável pela mágica dos operadores sobrecarregados que usarão o ``operator()`` para invocar o *callback*  com os parâmetros desejados. O método ``.AddTraceSource`` conecta o *callback* ao sistema de configuração, e ``TraceConnectWithoutContext`` conecta sua função a fonte de rastreamento, a qual é especificada por um nome 
+Atributo.
+
+.. 
+	Let's ignore the bit about context for now.
+
+Vamos ignorar um pouco o contexto.
+
+.. 
+	Finally, the line,
+
+Finalmente a linha,
+
+::
+
+   myObject->m_myInt = 1234;
+
+..
+	should be interpreted as an invocation of ``operator=`` on the member 
+	variable ``m_myInt`` with the integer ``1234`` passed as a parameter.
+
+deveria ser interpretada como uma invocação do operador ``=`` na variável membro ``m_myInt`` com o inteiro ``1234`` passado como parâmetro.
+
+..
+	It turns out that this operator is defined (by ``TracedValue``) to execute
+	a callback that returns void and takes two integer values as parameters --- 
+	an old value and a new value for the integer in question.  That is exactly 
+	the function signature for the callback function we provided --- ``IntTrace``.
+
+Por sua vez este operador é definido (por ``TracedValue``) para executar um *callback* que retorna ``void`` e possui dois inteiros como parâmetros --- um valor antigo e um novo valor para o inteiro em questão. Isto é exatamente a assinatura da função para a função de *callback* que nós fornecemos --- ``IntTrace``.
+
+..
+	To summarize, a trace source is, in essence, a variable that holds a list of
+	callbacks.  A trace sink is a function used as the target of a callback.  The
+	Attribute and object type information systems are used to provide a way to 
+	connect trace sources to trace sinks.  The act of "hitting" a trace source
+	is executing an operator on the trace source which fires callbacks.  This 
+	results in the trace sink callbacks registering interest in the source being 
+	called with the parameters provided by the source.
+
+Para resumir, uma origem do rastreamento é, em essência, uma variável que mantém uma lista de *callbacks*. Um destino do rastreamento é uma função usada como alvo da *callback*. O Atributo e os sistemas de informação de tipo de objeto são usados para fornecer uma maneira de conectar origens e destinos do rastreamento. O ação de "acionar" uma origem do rastreamento é executar um operador na origem, que dispara os *callbacks*. Isto resulta na execução das *callbacks* dos destinos do rastreamento registrados na origem com os parâmetros providos pela origem.
+
+.. 
+	If you now build and run this example,
+
+Se compilarmos e executarmos este exemplo,
+
+::
+
+  ./waf --run fourth
+
+..
+	you will see the output from the ``IntTrace`` function execute as soon as the
+	trace source is hit:
+
+observaremos que a saída da função ``IntTrace`` é processada logo após a execução da
+origem do rastreamento:
+
+::
+
+  Traced 0 to 1234
+
+..
+	When we executed the code, ``myObject->m_myInt = 1234;``, the trace source 
+	fired and automatically provided the before and after values to the trace sink.
+	The function ``IntTrace`` then printed this to the standard output.  No 
+	problem.
+
+Quando executamos o código,  ``myObject->m_myInt = 1234;`` a origem do rastreamento disparou e automaticamente forneceu os valores anteriores e posteriores para o destino do rastreamento. A função ``IntTrace`` então imprimiu na saída padrão, sem maiores problemas.
+
+.. 
+	Using the Config Subsystem to Connect to Trace Sources
+
+Usando o Subsistema de Configuração para Conectar as Origens de Rastreamento
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+
+..
+	The ``TraceConnectWithoutContext`` call shown above in the simple example is
+	actually very rarely used in the system.  More typically, the ``Config``
+	subsystem is used to allow selecting a trace source in the system using what is
+	called a *config path*.  We saw an example of this in the previous section
+	where we hooked the "CourseChange" event when we were playing with 
+	``third.cc``.
+
+A chamada ``TraceConnectWithoutContext`` apresentada anteriormente é raramente usada no sistema. Geralmente, o subsistema ``Config`` é usado para selecionar uma origem do rastreamento no sistema usando um caminho de configuração (*config path*). Nós estudamos um exemplo onde ligamos o evento "CourseChange", quando estávamos brincando com ``third.cc``.
+
+..
+	Recall that we defined a trace sink to print course change information from the
+	mobility models of our simulation.  It should now be a lot more clear to you 
+	what this function is doing.
+
+Nós definimos um destino do rastreamento para imprimir a informação de mudança de rota dos modelos de mobilidade de nossa simulação. Agora está mais claro o que está função realizava.
+
+::
+
+  void
+  CourseChange (std::string context, Ptr<const MobilityModel> model)
+  {
+    Vector position = model->GetPosition ();
+    NS_LOG_UNCOND (context << 
+      " x = " << position.x << ", y = " << position.y);
+  }
+
+..
+	When we connected the "CourseChange" trace source to the above trace sink,
+	we used what is called a "Config Path" to specify the source when we
+	arranged a connection between the pre-defined trace source and the new trace 
+	sink:
+
+Quando conectamos a origem do rastreamento "CourseChange" para o destino do rastreamento anteriormente, usamos o que é chamado de caminho de configuração ("`Config Path`") para especificar a origem e o novo destino do rastreamento.
+
+::
+
+  std::ostringstream oss;
+  oss <<
+    "/NodeList/" << wifiStaNodes.Get (nWifi - 1)->GetId () <<
+    "/$ns3::MobilityModel/CourseChange";
+
+  Config::Connect (oss.str (), MakeCallback (&CourseChange));
+
+..
+	Let's try and make some sense of what is sometimes considered relatively
+	mysterious code.  For the purposes of discussion, assume that the node 
+	number returned by the ``GetId()`` is "7".  In this case, the path
+	above turns out to be,
+
+Para entendermos melhor o código, suponha que o número do nó retornado por ``GetId()`` é "7". Neste caso, o caminho seria,
+
+::
+
+  "/NodeList/7/$ns3::MobilityModel/CourseChange"
+
+..
+	The last segment of a config path must be an ``Attribute`` of an 
+	``Object``.  In fact, if you had a pointer to the ``Object`` that has the
+	"CourseChange" ``Attribute`` handy, you could write this just like we did 
+	in the previous example.  You know by now that we typically store pointers to 
+	our nodes in a NodeContainer.  In the ``third.cc`` example, the Nodes of
+	interest are stored in the ``wifiStaNodes`` NodeContainer.  In fact, while
+	putting the path together, we used this container to get a Ptr<Node> which we
+	used to call GetId() on.  We could have used this Ptr<Node> directly to call
+	a connect method directly:
+
+O último segmento de um caminho de configuração deve ser um Atributo de um 
+Objeto. Na verdade, se tínhamos um ponteiro para o Objeto que tem o Atributo
+"CourseChange" ``, poderíamos escrever como no exemplo anterior.
+Nós já sabemos que guardamos tipicamente ponteiros para outros nós em um ``NodeContainer``. No exemplo ``third.cc``, os nós de rede de interesse estão armazenados no ``wifiStaNodes`` ``NodeContainer``. De fato enquanto colocamos o caminho junto usamos este contêiner para obter um ``Ptr<Node>``, usado na chamada ``GetId()``. Poderíamos usar diretamente o ``Ptr<Node>`` para chamar um método de conexão.
+
+::
+
+  Ptr<Object> theObject = wifiStaNodes.Get (nWifi - 1);
+  theObject->TraceConnectWithoutContext ("CourseChange", MakeCallback (&CourseChange));
+
+..
+	In the ``third.cc`` example, we actually want an additional "context" to 
+	be delivered along with the Callback parameters (which will be explained below) so we 
+	could actually use the following equivalent code,
+
+No exemplo ``third.cc``, queremos um "contexto" adicional para ser encaminhado com os parâmetros do *callback* (os quais são explicados a seguir) então podemos usar o código equivalente,
+
+::
+
+  Ptr<Object> theObject = wifiStaNodes.Get (nWifi - 1);
+  theObject->TraceConnect ("CourseChange", MakeCallback (&CourseChange));
+
+..
+	It turns out that the internal code for ``Config::ConnectWithoutContext`` and
+	``Config::Connect`` actually do find a Ptr<Object> and call the appropriate
+	TraceConnect method at the lowest level.
+
+Acontece que o código interno para ``Config::ConnectWithoutContext`` e ``Config::Connect`` permite localizar um Ptr<Object> e chama o método ``TraceConnect``, no nível mais baixo.
+
+..
+	The ``Config`` functions take a path that represents a chain of ``Object`` 
+	pointers.  Each segment of a path corresponds to an Object Attribute.  The last 
+	segment is the Attribute of interest, and prior segments must be typed to contain
+	or find Objects.  The ``Config`` code parses and "walks" this path until it 
+	gets to the final segment of the path.  It then interprets the last segment as
+	an ``Attribute`` on the last Object it found while walking the path.  The  
+	``Config`` functions then call the appropriate ``TraceConnect`` or 
+	``TraceConnectWithoutContext`` method on the final Object.  Let's see what 
+	happens in a bit more detail when the above path is walked.
+
+As funções ``Config`` aceitam um caminho que representa uma cadeia de ponteiros de Objetos. Cada segmento do caminho corresponde a um Atributo Objeto. O último segmento é o Atributo de interesse e os seguimentos anteriores devem ser definidos para conter ou encontrar Objetos. O  código ``Config`` processa o caminho até obter o segmento final. Então, interpreta o último segmento como um Atributo no último Objeto ele encontrou no caminho. Então as funções ``Config`` chamam o método ``TraceConnect`` ou ``TraceConnectWithoutContext`` adequado no Objeto final.
+
+Vamos analisar com mais detalhes o processo descrito.
+
+..
+	The leading "/" character in the path refers to a so-called namespace.  One 
+	of the predefined namespaces in the config system is "NodeList" which is a 
+	list of all of the nodes in the simulation.  Items in the list are referred to
+	by indices into the list, so "/NodeList/7" refers to the eighth node in the
+	list of nodes created during the simulation.  This reference is actually a 
+	``Ptr<Node>`` and so is a subclass of an ``ns3::Object``.  
+
+O primeiro caractere "/" no caminho faz referência a um *namespace*. Um dos *namespaces* predefinidos no sistema de configuração é "NodeList" que é uma lista de todos os nós na simulação. Itens na lista são referenciados por índices , logo "/NodeList/7" refere-se ao oitavo nó na lista de nós criados durante a simulação. Esta referência é um ``Ptr<Node>``, por consequência é uma subclasse de um ``ns3::Object``.
+
+..
+	As described in the Object Model section of the |ns3| manual, we support
+	Object Aggregation.  This allows us to form an association between different 
+	Objects without any programming.  Each Object in an Aggregation can be reached 
+	from the other Objects.  
+
+Como descrito na seção Modelo de Objeto do manual |ns3|, há suporte para Agregação de Objeto. Isto permite realizar associação entre diferentes Objetos sem qualquer programação. Cada Objeto em uma Agregação pode ser acessado a partir de outros Objetos.
+
+..
+	The next path segment being walked begins with the "$" character.  This 
+	indicates to the config system that a ``GetObject`` call should be made 
+	looking for the type that follows.  It turns out that the MobilityHelper used in 
+	``third.cc`` arranges to Aggregate, or associate, a mobility model to each of 
+	the wireless Nodes.  When you add the "$" you are asking for another Object that
+	has presumably been previously aggregated.  You can think of this as switching
+	pointers from the original Ptr<Node> as specified by "/NodeList/7" to its 
+	associated mobility model --- which is of type "$ns3::MobilityModel".  If you
+	are familiar with ``GetObject``, we have asked the system to do the following:
+
+O próximo segmento no caminho inicia com o carácter "$". O cifrão indica ao sistema de configuração que uma chamada ``GetObject`` deveria ser realizada procurando o tipo especificado em seguida. É diferente do que o ``MobilityHelper`` usou em ``third.cc`` gerenciar a Agregação, ou associar, um modelo de mobilidade para cada dos nós de rede sem fio. Quando adicionamos o "$", significa que estamos pedindo por outro Objeto que tinha sido presumidamente agregado anteriormente. Podemos pensar nisso como ponteiro de comutação do ``Ptr<Node>`` original como especificado por "/NodeList/7" para os modelos de mobilidade associados --- quais são do tipo "$ns3::MobilityModel". Se estivermos familiarizados com ``GetObject``, solicitamos ao sistema para fazer o 
+seguinte:
+
+::
+
+  Ptr<MobilityModel> mobilityModel = node->GetObject<MobilityModel> ()
+
+..
+	We are now at the last Object in the path, so we turn our attention to the 
+	Attributes of that Object.  The ``MobilityModel`` class defines an Attribute 
+	called "CourseChange".  You can see this by looking at the source code in
+	``src/mobility/model/mobility-model.cc`` and searching for "CourseChange" in your
+	favorite editor.  You should find,
+
+Estamos no último Objeto do caminho e neste verificamos os Atributos daquele Objeto. A classe ``MobilityModel`` define um Atributo chamado "CourseChange". Observando o código fonte em ``src/mobility/model/mobility-model.cc`` e procurando por "CourseChange", encontramos,
+
+::
+
+  .AddTraceSource ("CourseChange",
+                   "The value of the position and/or velocity vector changed",
+                   MakeTraceSourceAccessor (&MobilityModel::m_courseChangeTrace))
+
+.. 
+	which should look very familiar at this point.  
+
+o qual parece muito familiar neste momento.
+
+..
+	If you look for the corresponding declaration of the underlying traced variable 
+	in ``mobility-model.h`` you will find
+
+Se procurarmos por declarações semelhantes das variáveis rastreadas em ``mobility-model.h``
+encontraremos,
+
+::
+
+  TracedCallback<Ptr<const MobilityModel> > m_courseChangeTrace;
+
+..
+	The type declaration ``TracedCallback`` identifies ``m_courseChangeTrace``
+	as a special list of Callbacks that can be hooked using the Config functions 
+	described above.
+
+A declaração de tipo ``TracedCallback`` identifica ``m_courseChangeTrace`` como um lista especial de *callbacks* que pode ser ligada usando as funções de Configuração descritas anteriormente.
+
+..
+	The ``MobilityModel`` class is designed to be a base class providing a common
+	interface for all of the specific subclasses.  If you search down to the end of 
+	the file, you will see a method defined called ``NotifyCourseChange()``:
+
+A classe ``MobilityModel`` é projetada para ser a classe base provendo uma interface comum para todas as subclasses. No final do arquivo, encontramos um método chamado ``NotifyCourseChange()``:
+
+::
+
+  void
+  MobilityModel::NotifyCourseChange (void) const
+  {
+    m_courseChangeTrace(this);
+  }
+
+..
+	Derived classes will call into this method whenever they do a course change to
+	support tracing.  This method invokes ``operator()`` on the underlying 
+	``m_courseChangeTrace``, which will, in turn, invoke all of the registered
+	Callbacks, calling all of the trace sinks that have registered interest in the
+	trace source by calling a Config function.
+
+Classes derivadas chamarão este método toda vez que fizerem uma alteração na rota para 
+suportar rastreamento. Este método invoca ``operator()`` em ``m_courseChangeTrace``, 
+que invocará todos os *callbacks* registrados, chamando todos os *trace sinks* que tem 
+interesse registrado na origem do rastreamento usando a função de Configuração.
+
+..
+	So, in the ``third.cc`` example we looked at, whenever a course change is 
+	made in one of the ``RandomWalk2dMobilityModel`` instances installed, there
+	will be a ``NotifyCourseChange()`` call which calls up into the 
+	``MobilityModel`` base class.  As seen above, this invokes ``operator()``
+	on ``m_courseChangeTrace``, which in turn, calls any registered trace sinks.
+	In the example, the only code registering an interest was the code that provided
+	the config path.  Therefore, the ``CourseChange`` function that was hooked 
+	from Node number seven will be the only Callback called.
+
+No exemplo ``third.cc`` nós vimos que sempre que uma mudança de rota é realizada em uma das instâncias ``RandomWalk2dMobilityModel`` instaladas, haverá uma chamada ``NotifyCourseChange()`` da classe base ``MobilityModel``. Como observado, isto invoca ``operator()`` em ``m_courseChangeTrace``, que por sua vez, chama qualquer destino do rastreamento registrados. No exemplo, o único código que registrou interesse foi aquele que forneceu o caminho de configuração. Consequentemente, a função ``CourseChange`` que foi ligado no Node de número sete será a única *callback* chamada.
+
+..
+	The final piece of the puzzle is the "context".  Recall that we saw an output 
+	looking something like the following from ``third.cc``:
+
+A peça final do quebra-cabeça é o "contexto". Lembre-se da saída de ``third.cc``:
+
+::
+
+  /NodeList/7/$ns3::MobilityModel/CourseChange x = 7.27897, y = 2.22677
+
+..
+	The first part of the output is the context.  It is simply the path through
+	which the config code located the trace source.  In the case we have been looking at
+	there can be any number of trace sources in the system corresponding to any number
+	of nodes with mobility models.  There needs to be some way to identify which trace
+	source is actually the one that fired the Callback.  An easy way is to request a 
+	trace context when you ``Config::Connect``.
+
+A primeira parte da saída é o contexto. É simplesmente o caminho pelo qual o código de configuração localizou a origem do rastreamento. No caso, poderíamos ter qualquer número de origens de rastreamento no sistema correspondendo a qualquer número de nós com modelos de mobilidade. É necessário uma maneira de identificar qual origem do rastreamento disparou o *callback*. Uma forma simples é solicitar um contexto de rastreamento quando é usado o ``Config::Connect``.
+
+.. 
+	How to Find and Connect Trace Sources, and Discover Callback Signatures
+
+Como Localizar e Conectar Origens de Rastreamento, e Descobrir Assinaturas de *Callback*
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+
+..
+	The first question that inevitably comes up for new users of the Tracing system is,
+	"okay, I know that there must be trace sources in the simulation core, but how do
+	I find out what trace sources are available to me"?  
+	
+	The second question is, "okay, I found a trace source, how do I figure out the
+	config path to use when I connect to it"? 
+
+	The third question is, "okay, I found a trace source, how do I figure out what 
+	the return type and formal arguments of my callback function need to be"?
+
+	The fourth question is, "okay, I typed that all in and got this incredibly bizarre
+	error message, what in the world does it mean"?
+
+As questões que inevitavelmente os novos usuários do sistema de Rastreamento fazem, são:
+
+1. "Eu sei que existem origens do rastreamento no núcleo da simulação, mas como 
+   eu descubro quais estão disponíveis para mim?"
+2. "Eu encontrei uma origem do rastreamento, como eu defino o caminho de configuração para 
+   usar quando eu conectar a origem?"
+3. "Eu encontrei uma origem do rastreamento, como eu  defino o tipo de retorno e os 
+   argumentos formais da minha função de *callback*?"
+4. "Eu fiz tudo corretamente e obtive uma mensagem de erro bizarra, o que isso significa?"
+
+.. 
+	What Trace Sources are Available?
+
+Quais Origens de Rastreamento são Disponibilizadas
+++++++++++++++++++++++++++++++++++++++++++++++++++
+
+..
+	The answer to this question is found in the |ns3| Doxygen.  If you go to 
+	the project web site, 
+	`ns-3 project
+	<http://www.nsnam.org>`_, you will find a link to "Documentation" in the navigation bar.  If you select this link, you will be
+	taken to our documentation page. There 
+	is a link to "Latest Release" that will take you to the documentation
+	for the latest stable release of |ns3|.
+	If you select the "API Documentation" link, you will be
+	taken to the |ns3| API documentation page.
+
+A resposta é encontrada no Doxygen do |ns3|. Acesse o sítio Web do projeto, `ns-3 project <http://www.nsnam.org>`_, em seguida, "Documentation" na barra de navegação. Logo após, "Latest Release" e "API Documentation".
+
+Acesse o item "Modules" na documentação do NS-3. Agora, selecione o item "C++ Constructs Used by All Modules". Serão exibidos quatro tópicos extremamente úteis:
+
+* The list of all trace sources
+* The list of all attributes
+* The list of all global values
+* Debugging
+
+..
+	The list of interest to us here is "the list of all trace sources".  Go 
+	ahead and select that link.  You will see, perhaps not too surprisingly, a
+	list of all of the trace sources available in the |ns3| core.
+
+Estamos interessados em "*the list of all trace sources*" - a lista de todas origens do rastreamento. Selecionando este item, é exibido uma lista com todas origens disponíveis no núcleo do |ns3|.
+
+..
+	As an example, scroll down to ``ns3::MobilityModel``.  You will find
+	an entry for
+
+Como exemplo, ``ns3::MobilityModel``, terá uma entrada para
+
+::
+
+  CourseChange: The value of the position and/or velocity vector changed 
+
+..
+	You should recognize this as the trace source we used in the ``third.cc``
+	example.  Perusing this list will be helpful.
+
+No caso, esta foi a origem do rastreamento usada no exemplo ``third.cc``, esta lista será muito útil.
+
+.. 
+	What String do I use to Connect?
+
+Qual String eu uso para Conectar?
++++++++++++++++++++++++++++++++++
+
+..
+	The easiest way to do this is to grep around in the |ns3| codebase for someone
+	who has already figured it out,  You should always try to copy someone else's
+	working code before you start to write your own.  Try something like:
+
+A forma mais simples é procurar na base de código do |ns3| por alguém que já fez uso do caminho de configuração que precisamos para ligar a fonte de rastreamento. Sempre deveríamos primeiro copiar um código que funciona antes de escrever nosso próprio código. Tente usar os comandos:
+
+::
+
+  find . -name '*.cc' | xargs grep CourseChange | grep Connect
+
+..
+	and you may find your answer along with working code.  For example, in this
+	case, ``./ns-3-dev/examples/wireless/mixed-wireless.cc`` has something
+	just waiting for you to use:
+
+e poderemos encontrar um código operacional que atenda nossas necessidades. Por exemplo, neste caso, ``./ns-3-dev/examples/wireless/mixed-wireless.cc`` tem algo que podemos usar:
+
+::
+
+  Config::Connect ("/NodeList/*/$ns3::MobilityModel/CourseChange", 
+    MakeCallback (&CourseChangeCallback));
+
+..
+	If you cannot find any examples in the distribution, you can find this out
+	from the |ns3| Doxygen.  It will probably be simplest just to walk 
+	through the "CourseChanged" example.
+
+Se não localizamos nenhum exemplo na distribuição, podemos tentar o Doxygen do |ns3|. É provavelmente mais simples que percorrer o exemplo "CourseChanged".
+
+..
+	Let's assume that you have just found the "CourseChanged" trace source in 
+	"The list of all trace sources" and you want to figure out how to connect to
+	it.  You know that you are using (again, from the ``third.cc`` example) an
+	``ns3::RandomWalk2dMobilityModel``.  So open the "Class List" book in
+	the NS-3 documentation tree by clicking its "+" box.  You will now see a
+	list of all of the classes in |ns3|.  Scroll down until you see the
+	entry for ``ns3::RandomWalk2dMobilityModel`` and follow that link.
+	You should now be looking at the "ns3::RandomWalk2dMobilityModel Class 
+	Reference".
+
+Suponha que encontramos a origem do rastreamento "CourseChanged" na "The list of all trace sources" e queremos resolver como nos conectar a ela. Você sabe que está usando um ``ns3::RandomWalk2dMobilityModel``. Logo, acesse o item "Class List" na documentação do |ns3|. Será exibida a lista de todas as classes. Selecione a entrada para ``ns3::RandomWalk2dMobilityModel`` para exibir a documentação da classe.
+
+..
+	If you now scroll down to the "Member Function Documentation" section, you
+	will see documentation for the ``GetTypeId`` function.  You constructed one
+	of these in the simple tracing example above:
+
+Acesse a seção "Member Function Documentation" e obterá a documentação para a função ``GetTypeId``. Você construiu uma dessas em um exemplo anterior:
+	
+::
+
+    static TypeId GetTypeId (void)
+    {
+      static TypeId tid = TypeId ("MyObject")
+        .SetParent (Object::GetTypeId ())
+        .AddConstructor<MyObject> ()
+        .AddTraceSource ("MyInteger",
+                         "An integer value to trace.",
+                         MakeTraceSourceAccessor (&MyObject::m_myInt))
+        ;
+      return tid;
+    }
+
+..
+	As mentioned above, this is the bit of code that connected the Config 
+	and Attribute systems to the underlying trace source.  This is also the
+	place where you should start looking for information about the way to 
+	connect. 
+
+Como abordado, este código conecta os sistemas *Config* e Atributos à origem do rastreamento. É também o local onde devemos iniciar a busca por informação sobre como conectar.
+
+..
+	You are looking at the same information for the RandomWalk2dMobilityModel; and
+	the information you want is now right there in front of you in the Doxygen:
+
+Você está observando a mesma informação para ``RandomWalk2dMobilityModel``; e a informação que você precisa está explícita no Doxygen:
+	
+::
+
+  This object is accessible through the following paths with Config::Set 
+  		and Config::Connect: 
+
+  /NodeList/[i]/$ns3::MobilityModel/$ns3::RandomWalk2dMobilityModel 
+
+..
+	The documentation tells you how to get to the ``RandomWalk2dMobilityModel`` 
+	Object.  Compare the string above with the string we actually used in the 
+	example code:
+
+A documentação apresenta como obter o Objeto ``RandomWalk2dMobilityModel``. Compare o texto anterior com o texto que nós usamos no código do exemplo:
+
+::
+
+  "/NodeList/7/$ns3::MobilityModel"
+
+..
+	The difference is due to the fact that two ``GetObject`` calls are implied 
+	in the string found in the documentation.  The first, for ``$ns3::MobilityModel``
+	will query the aggregation for the base class.  The second implied 
+	``GetObject`` call, for ``$ns3::RandomWalk2dMobilityModel``, is used to "cast"
+	the base class to the concrete implementation class.  The documentation shows 
+	both of these operations for you.  It turns out that the actual Attribute you are
+	going to be looking for is found in the base class as we have seen.
+
+A diferença é que há duas chamadas ``GetObject`` inclusas no texto da documentação. A primeira, para ``$ns3::MobilityModel`` solicita a agregação para a classe base. A segunda, para ``$ns3::RandomWalk2dMobilityModel`` é usada como *cast* da classe base para a 
+implementação concreta da classe.  
+
+.. 
+	Look further down in the ``GetTypeId`` doxygen.  You will find,
+
+Analisando ainda mais o ``GetTypeId`` no Doxygen, temos
+
+::
+
+  No TraceSources defined for this type.
+  TraceSources defined in parent class ns3::MobilityModel:
+
+  CourseChange: The value of the position and/or velocity vector changed 
+  Reimplemented from ns3::MobilityModel
+
+..
+	This is exactly what you need to know.  The trace source of interest is found in
+	``ns3::MobilityModel`` (which you knew anyway).  The interesting thing this
+	bit of Doxygen tells you is that you don't need that extra cast in the config
+	path above to get to the concrete class, since the trace source is actually in
+	the base class.  Therefore the additional ``GetObject`` is not required and
+	you simply use the path:
+
+Isto é exatamente o que precisamos saber. A origem do rastreamento de interesse é encontrada em ``ns3::MobilityModel``.  O interessante é que pela documentação não é necessário o *cast* extra para obter a classe concreta, pois a origem do rastreamento está na classe base. Por consequência, o ``GetObject`` adicional não é necessário e podemos usar o caminho:
+
+::
+
+  /NodeList/[i]/$ns3::MobilityModel
+
+.. 
+	which perfectly matches the example path:
+
+que é idêntico ao caminho do exemplo:
+
+::
+
+  /NodeList/7/$ns3::MobilityModel
+
+.. 
+	What Return Value and Formal Arguments?
+
+Quais são os Argumentos Formais e o Valor de Retorno?
++++++++++++++++++++++++++++++++++++++++++++++++++++++
+
+..
+	The easiest way to do this is to grep around in the |ns3| codebase for someone
+	who has already figured it out,  You should always try to copy someone else's
+	working code.  Try something like:
+
+A forma mais simples é procurar na base de código do |ns3| por um código existente. Você sempre deveria primeiro copiar um código que funciona antes de escrever seu próprio. Tente usar os comandos:
+	
+::
+
+  find . -name '*.cc' | xargs grep CourseChange | grep Connect
+
+..
+	and you may find your answer along with working code.  For example, in this
+	case, ``./ns-3-dev/examples/wireless/mixed-wireless.cc`` has something
+	just waiting for you to use.  You will find
+
+e você poderá encontrar código operacional. Por exemplo, neste caso, ``./ns-3-dev/examples/wireless/mixed-wireless.cc`` tem código para ser reaproveitado.
+
+::
+
+  Config::Connect ("/NodeList/*/$ns3::MobilityModel/CourseChange", 
+    MakeCallback (&CourseChangeCallback));
+
+..
+	as a result of your grep.  The ``MakeCallback`` should indicate to you that
+	there is a callback function there which you can use.  Sure enough, there is:
+
+como resultado, ``MakeCallback`` indicaria que há uma função *callback* que pode ser usada.
+Para reforçar:
+
+::
+
+  static void
+  CourseChangeCallback (std::string path, Ptr<const MobilityModel> model)
+  {
+    ...
+  }
+
+.. 
+	Take my Word for It
+
+Acredite em Minha Palavra
+~~~~~~~~~~~~~~~~~~~~~~~~~
+
+..
+	If there are no examples to work from, this can be, well, challenging to 
+	actually figure out from the source code.
+
+Se não há exemplos, pode ser desafiador descobrir por meio da análise do código fonte.
+
+..
+	Before embarking on a walkthrough of the code, I'll be kind and just tell you
+	a simple way to figure this out:  The return value of your callback will always 
+	be void.  The formal parameter list for a ``TracedCallback`` can be found 
+	from the template parameter list in the declaration.  Recall that for our
+	current example, this is in ``mobility-model.h``, where we have previously
+	found:
+
+Antes de aventurar-se no código, diremos algo importante: O valor de retorno de sua *callback* sempre será *void*. A lista de parâmetros formais para uma ``TracedCallback`` pode ser encontrada no lista de parâmetro padrão na declaração. Recorde do exemplo atual, isto está em ``mobility-model.h``, onde encontramos:
+
+::
+
+  TracedCallback<Ptr<const MobilityModel> > m_courseChangeTrace;
+
+..
+	There is a one-to-one correspondence between the template parameter list in 
+	the declaration and the formal arguments of the callback function.  Here,
+	there is one template parameter, which is a ``Ptr<const MobilityModel>``.
+	This tells you that you need a function that returns void and takes a
+	a ``Ptr<const MobilityModel>``.  For example,
+
+Não há uma correspondência de um-para-um entre a lista de parâmetro padrão na declaração e os argumentos formais da função *callback*. Aqui, há um parâmetro padrão, que é um ``Ptr<const MobilityModel>``. Isto significa que precisamos de uma função que retorna *void* e possui um parâmetro ``Ptr<const MobilityModel>``. Por exemplo,
+
+::
+
+  void
+  CourseChangeCallback (Ptr<const MobilityModel> model)
+  {
+    ...
+  }
+
+..
+	That's all you need if you want to ``Config::ConnectWithoutContext``.  If
+	you want a context, you need to ``Config::Connect`` and use a Callback 
+	function that takes a string context, then the required argument.
+
+Isto é tudo que precisamos para ``Config::ConnectWithoutContext``. Se você quer um contexto, use ``Config::Connect`` e uma função *callback* que possui como um parâmetro uma `string` de contexto, seguido pelo argumento.
+
+::
+
+  void
+  CourseChangeCallback (std::string path, Ptr<const MobilityModel> model)
+  {
+    ...
+  }
+
+..
+	If you want to ensure that your ``CourseChangeCallback`` is only visible
+	in your local file, you can add the keyword ``static`` and come up with:
+
+Para garantir que ``CourseChangeCallback`` seja somente visível em seu arquivo, você pode adicionar a palavra chave ``static``, como no exemplo:
+
+::
+
+  static void
+  CourseChangeCallback (std::string path, Ptr<const MobilityModel> model)
+  {
+    ...
+  }
+
+.. 
+	which is exactly what we used in the ``third.cc`` example.
+
+exatamente o que é usado no exemplo ``third.cc``.
+
+..
+	The Hard Way
+
+A Forma Complicada
+~~~~~~~~~~~~~~~~~~
+
+..
+	This section is entirely optional.  It is going to be a bumpy ride, especially
+	for those unfamiliar with the details of templates.  However, if you get through
+	this, you will have a very good handle on a lot of the |ns3| low level
+	idioms.
+
+Esta seção é opcional. Pode ser bem penosa para aqueles que conhecem poucos detalhes de tipos parametrizados de dados (*templates*). Entretanto, se continuarmos nessa seção, mergulharemos em detalhes de baixo nível do |ns3|.
+
+..
+	So, again, let's figure out what signature of callback function is required for
+	the "CourseChange" Attribute.  This is going to be painful, but you only need
+	to do this once.  After you get through this, you will be able to just look at
+	a ``TracedCallback`` and understand it.
+
+Vamos novamente descobrir qual assinatura da função de *callback* é necessária para o Atributo "CourseChange". Isto pode ser doloroso, mas precisamos fazê-lo apenas uma vez. Depois de tudo, você será capaz de entender um ``TracedCallback``.
+
+..
+	The first thing we need to look at is the declaration of the trace source.
+	Recall that this is in ``mobility-model.h``, where we have previously
+	found:
+
+Primeiro, verificamos a declaração da origem do rastreamento. Recorde que isto está em ``mobility-model.h``:
+	
+::
+
+  TracedCallback<Ptr<const MobilityModel> > m_courseChangeTrace;
+
+..
+	This declaration is for a template.  The template parameter is inside the
+	angle-brackets, so we are really interested in finding out what that
+	``TracedCallback<>`` is.  If you have absolutely no idea where this might
+	be found, grep is your friend.	
+
+Esta declaração é para um *template*. O parâmetro do *template* está entre ``<>``, logo estamos interessados em descobrir o que é ``TracedCallback<>``. Se não tem nenhuma ideia de onde pode ser encontrado, use o utilitário *grep*.
+
+..
+	We are probably going to be interested in some kind of declaration in the 
+	|ns3| source, so first change into the ``src`` directory.  Then, 
+	we know this declaration is going to have to be in some kind of header file,
+	so just grep for it using:
+
+Estamos interessados em uma declaração similar no código fonte do |ns3|, logo buscamos no diretório ``src``. Então, sabemos que esta declaração tem um arquivo de cabeçalho, e procuramos por ele usando:
+
+::
+
+  find . -name '*.h' | xargs grep TracedCallback
+
+..
+	You'll see 124 lines fly by (I piped this through wc to see how bad it was).
+	Although that may seem like it, that's not really a lot.  Just pipe the output
+	through more and start scanning through it.  On the first page, you will see
+	some very suspiciously template-looking stuff.
+
+Obteremos 124 linhas, com este comando. Analisando a saída, encontramos alguns *templates* que podem ser úteis.
+
+::
+
+  TracedCallback<T1,T2,T3,T4,T5,T6,T7,T8>::TracedCallback ()
+  TracedCallback<T1,T2,T3,T4,T5,T6,T7,T8>::ConnectWithoutContext (c ...
+  TracedCallback<T1,T2,T3,T4,T5,T6,T7,T8>::Connect (const CallbackB ...
+  TracedCallback<T1,T2,T3,T4,T5,T6,T7,T8>::DisconnectWithoutContext ...
+  TracedCallback<T1,T2,T3,T4,T5,T6,T7,T8>::Disconnect (const Callba ...
+  TracedCallback<T1,T2,T3,T4,T5,T6,T7,T8>::operator() (void) const ...
+  TracedCallback<T1,T2,T3,T4,T5,T6,T7,T8>::operator() (T1 a1) const ...
+  TracedCallback<T1,T2,T3,T4,T5,T6,T7,T8>::operator() (T1 a1, T2 a2 ...
+  TracedCallback<T1,T2,T3,T4,T5,T6,T7,T8>::operator() (T1 a1, T2 a2 ...
+  TracedCallback<T1,T2,T3,T4,T5,T6,T7,T8>::operator() (T1 a1, T2 a2 ...
+  TracedCallback<T1,T2,T3,T4,T5,T6,T7,T8>::operator() (T1 a1, T2 a2 ...
+  TracedCallback<T1,T2,T3,T4,T5,T6,T7,T8>::operator() (T1 a1, T2 a2 ...
+  TracedCallback<T1,T2,T3,T4,T5,T6,T7,T8>::operator() (T1 a1, T2 a2 ...
+
+..
+	It turns out that all of this comes from the header file 
+	``traced-callback.h`` which sounds very promising.  You can then take a
+	look at ``mobility-model.h`` and see that there is a line which confirms
+	this hunch:
+
+Observamos que todas linhas são do arquivo de cabeçalho ``traced-callback.h``, logo ele parece muito promissor. Para confirmar, verifique o arquivo ``mobility-model.h``  e procure uma linha que corrobore esta suspeita.
+
+::
+
+  #include "ns3/traced-callback.h"
+
+..
+	Of course, you could have gone at this from the other direction and started
+	by looking at the includes in ``mobility-model.h`` and noticing the 
+	include of ``traced-callback.h`` and inferring that this must be the file
+	you want.
+
+Observando as inclusões em ``mobility-model.h``, verifica-se a inclusão do ``traced-callback.h`` e conclui-se que este deve ser o arquivo.
+
+..
+	In either case, the next step is to take a look at ``src/core/model/traced-callback.h``
+	in your favorite editor to see what is happening.
+
+O próximo passo é analisar o arquivo ``src/core/model/traced-callback.h`` e entender sua funcionalidade.
+
+.. 
+	You will see a comment at the top of the file that should be comforting:
+
+Há um comentário no topo do arquivo que deveria ser animador:
+
+::
+
+  An ns3::TracedCallback has almost exactly the same API as a normal ns3::Callback but
+  instead of forwarding calls to a single function (as an ns3::Callback normally does),
+  it forwards calls to a chain of ns3::Callback.
+
+.. 
+	This should sound very familiar and let you know you are on the right track.
+
+Isto deveria ser familiar e confirma que estamos no caminho correto.
+
+.. 
+	Just after this comment, you will find,
+
+Depois deste comentário, encontraremos
+
+::
+
+  template<typename T1 = empty, typename T2 = empty, 
+           typename T3 = empty, typename T4 = empty,
+           typename T5 = empty, typename T6 = empty,
+           typename T7 = empty, typename T8 = empty>
+  class TracedCallback 
+  {
+    ...
+
+..
+	This tells you that TracedCallback is a templated class.  It has eight possible
+	type parameters with default values.  Go back and compare this with the 
+	declaration you are trying to understand:
+
+Isto significa que TracedCallback é uma classe genérica (*templated class*). Possui oito possíveis tipos de parâmetros com valores padrões. Retorne e compare com a declaração que você está tentando entender:
+
+::
+
+  TracedCallback<Ptr<const MobilityModel> > m_courseChangeTrace;
+
+..
+	The ``typename T1`` in the templated class declaration corresponds to the 
+	``Ptr<const MobilityModel>`` in the declaration above.  All of the other
+	type parameters are left as defaults.  Looking at the constructor really
+	doesn't tell you much.  The one place where you have seen a connection made
+	between your Callback function and the tracing system is in the ``Connect``
+	and ``ConnectWithoutContext`` functions.  If you scroll down, you will see
+	a ``ConnectWithoutContext`` method here:
+
+O ``typename T1`` na declaração da classe corresponde a ``Ptr<const MobilityModel>`` da declaração anterior. Todos os outros parâmetros são padrões. Observe que o construtor não contribui com muita informação. O único lugar onde há uma conexão entre a função *callback* e o sistema de rastreamento é nas funções ``Connect`` e ``ConnectWithoutContext``. Como mostrado a seguir:
+	
+::
+
+  template<typename T1, typename T2, 
+           typename T3, typename T4,
+           typename T5, typename T6,
+           typename T7, typename T8>
+  void 
+  TracedCallback<T1,T2,T3,T4,T5,T6,T7,T8>::ConnectWithoutContext ...
+  {
+    Callback<void,T1,T2,T3,T4,T5,T6,T7,T8> cb;
+    cb.Assign (callback);
+    m_callbackList.push_back (cb);
+  }
+
+..
+	You are now in the belly of the beast.  When the template is instantiated for
+	the declaration above, the compiler will replace ``T1`` with 
+	``Ptr<const MobilityModel>``.  
+
+Você está no olho do furação. Quando o *template* é instanciado pela declaração anterior, o compilador substitui ``T1`` por ``Ptr<const MobilityModel>``.
+
+::
+
+  void 
+  TracedCallback<Ptr<const MobilityModel>::ConnectWithoutContext ... cb
+  {
+    Callback<void, Ptr<const MobilityModel> > cb;
+    cb.Assign (callback);
+    m_callbackList.push_back (cb);
+  }
+
+..
+	You can now see the implementation of everything we've been talking about.  The
+	code creates a Callback of the right type and assigns your function to it.  This
+	is the equivalent of the ``pfi = MyFunction`` we discussed at the start of
+	this section.  The code then adds the Callback to the list of Callbacks for 
+	this source.  The only thing left is to look at the definition of Callback.
+	Using the same grep trick as we used to find ``TracedCallback``, you will be
+	able to find that the file ``./core/callback.h`` is the one we need to look at.
+
+Podemos observar a implementação de tudo que foi explicado até este ponto. O código cria uma *callback* do tipo adequado e atribui sua função para ela. Isto é equivalente a ``pfi = MyFunction`` discutida anteriormente. O código então adiciona a *callback* para a lista de *callbacks* para esta origem. O que não observamos ainda é a definição da *callback*. Usando o utilitário *grep* podemos encontrar o arquivo ``./core/callback.h`` e verificar a definição.
+
+..
+	If you look down through the file, you will see a lot of probably almost
+	incomprehensible template code.  You will eventually come to some Doxygen for
+	the Callback template class, though.  Fortunately, there is some English:
+
+No arquivo há muito código incompreensível. Felizmente há algum em Inglês. 
+
+::
+
+  This class template implements the Functor Design Pattern.
+  It is used to declare the type of a Callback:
+   - the first non-optional template argument represents
+     the return type of the callback.
+   - the second optional template argument represents
+     the type of the first argument to the callback.
+   - the third optional template argument represents
+     the type of the second argument to the callback.
+   - the fourth optional template argument represents
+     the type of the third argument to the callback.
+   - the fifth optional template argument represents
+     the type of the fourth argument to the callback.
+   - the sixth optional template argument represents
+     the type of the fifth argument to the callback.
+
+.. 
+	We are trying to figure out what the
+
+Nós estamos tentando descobrir o que significa a declaração 
+
+::
+
+    Callback<void, Ptr<const MobilityModel> > cb;
+
+..
+	declaration means.  Now we are in a position to understand that the first
+	(non-optional) parameter, ``void``, represents the return type of the 
+	Callback.  The second (non-optional) parameter, ``Ptr<const MobilityModel>``
+	represents the first argument to the callback.
+
+Agora entendemos que o primeiro parâmetro, ``void``, indica o tipo de retorno da *callback*. O segundo parâmetro, ``Ptr<const MobilityModel>`` representa o primeiro argumento da *callback*.
+
+..
+	The Callback in question is your function to receive the trace events.  From
+	this you can infer that you need a function that returns ``void`` and takes
+	a ``Ptr<const MobilityModel>``.  For example,
+
+A *callback* em questão é a sua função que recebe os eventos de rastreamento. Logo, podemos deduzir que precisamos de uma função que retorna ``void`` e possui um parâmetro ``Ptr<const MobilityModel>``. Por exemplo,
+
+::
+
+  void
+  CourseChangeCallback (Ptr<const MobilityModel> model)
+  {
+    ...
+  }
+
+..
+	That's all you need if you want to ``Config::ConnectWithoutContext``.  If
+	you want a context, you need to ``Config::Connect`` and use a Callback 
+	function that takes a string context.  This is because the ``Connect``
+	function will provide the context for you.  You'll need:
+
+Isto é tudo que precisamos no ``Config::ConnectWithoutContext``. Se você quer um contexto, use ``Config::Connect`` e uma função *callback* que possui como um parâmetro uma `string` de contexto, seguido pelo argumento.
+
+::
+
+  void
+  CourseChangeCallback (std::string path, Ptr<const MobilityModel> model)
+  {
+    ...
+  }
+
+..
+	If you want to ensure that your ``CourseChangeCallback`` is only visible
+	in your local file, you can add the keyword ``static`` and come up with:
+
+Se queremos garantir que ``CourseChangeCallback`` é visível somente 
+em seu arquivo, você pode adicionar a palavra chave ``static``, como no exemplo:
+
+::
+
+  static void
+  CourseChangeCallback (std::string path, Ptr<const MobilityModel> model)
+  {
+    ...
+  }
+
+..
+	which is exactly what we used in the ``third.cc`` example.  Perhaps you
+	should now go back and reread the previous section (Take My Word for It).
+
+o que é exatamente usado no exemplo ``third.cc``. Talvez seja interessante reler a seção (Acredite em Minha Palavra).
+
+..
+	If you are interested in more details regarding the implementation of 
+	Callbacks, feel free to take a look at the |ns3| manual.  They are one
+	of the most frequently used constructs in the low-level parts of |ns3|.
+	It is, in my opinion, a quite elegant thing.
+
+Há mais detalhes sobre a implementação de *callbacks* no manual do |ns3|. Elas estão entre os mais usados construtores das partes de baixo-nível do |ns3|. Em minha opinião, algo bastante elegante.
+
+.. 
+	What About TracedValue?
+
+E quanto a TracedValue?
++++++++++++++++++++++++
+
+..
+	Earlier in this section, we presented a simple piece of code that used a
+	``TracedValue<int32_t>`` to demonstrate the basics of the tracing code.
+	We just glossed over the way to find the return type and formal arguments
+	for the ``TracedValue``.  Rather than go through the whole exercise, we
+	will just point you at the correct file, ``src/core/model/traced-value.h`` and
+	to the important piece of code:
+
+No início desta seção, nós apresentamos uma parte de código simples que usou um ``TracedValue<int32_t>`` para demonstrar o básico sobre código de rastreamento. Nós desprezamos os métodos para encontrar o tipo de retorno e os argumentos formais para o ``TracedValue``. Acelerando o processo, indicamos o arquivo ``src/core/model/traced-value.h`` e a parte relevante do código:
+
+::
+
+  template <typename T>
+  class TracedValue
+  {
+  public:
+    ...
+    void Set (const T &v) {
+      if (m_v != v)
+        {
+  	m_cb (m_v, v);
+  	m_v = v;
+        }
+    }
+    ...
+  private:
+    T m_v;
+    TracedCallback<T,T> m_cb;
+  };
+
+..
+	Here you see that the ``TracedValue`` is templated, of course.  In the simple
+	example case at the start of the section, the typename is int32_t.  This means 
+	that the member variable being traced (``m_v`` in the private section of the 
+	class) will be an ``int32_t m_v``.  The ``Set`` method will take a 
+	``const int32_t &v`` as a parameter.  You should now be able to understand 
+	that the ``Set`` code will fire the ``m_cb`` callback with two parameters:
+	the first being the current value of the ``TracedValue``; and the second 
+	being the new value being set.
+
+Verificamos que ``TracedValue`` é uma classe parametrizada. No caso simples do início da seção, o nome do tipo é int32_t. Isto significa que  a variável membro sendo rastreada (``m_v`` na seção privada da classe) será ``int32_t m_v``. O método ``Set`` possui um argumento ``const int32_t &v``. Você deveria ser capaz de entender que o código ``Set`` dispará o *callback* ``m_cb`` com dois parâmetros: o primeiro sendo o valor atual do ``TracedValue``; e o segundo sendo o novo valor.
+
+..
+	The callback, ``m_cb`` is declared as a ``TracedCallback<T, T>`` which
+	will correspond to a ``TracedCallback<int32_t, int32_t>`` when the class is 
+	instantiated.
+
+A *callback* ``m_cb`` é declarada como um ``TracedCallback<T, T>`` que corresponderá a um ``TracedCallback<int32_t, int32_t>`` quando a classe é instanciada.
+
+..
+	Recall that the callback target of a TracedCallback always returns ``void``.  
+	Further recall that there is a one-to-one correspondence between the template 
+	parameter list in the declaration and the formal arguments of the callback 
+	function.  Therefore the callback will need to have a function signature that 
+	looks like:
+
+Lembre-se que o destino da *callback* de um TracedCallback sempre retorna ``void``. Lembre também que há uma correspondência de um-para-um entre a lista de parâmetros polimórfica e os argumentos formais da função *callback*. Logo, a *callback* precisa ter uma assinatura de função similar a:
+
+::
+
+  void
+  MyCallback (int32_t oldValue, int32_t newValue)
+  {
+    ...
+  }
+
+..
+	It probably won't surprise you that this is exactly what we provided in that 
+	simple example we covered so long ago:
+
+Isto é exatamente o que nós apresentamos no exemplo simples abordado anteriormente.
+
+::
+
+  void
+  IntTrace (int32_t oldValue, int32_t newValue)
+  {
+    std::cout << "Traced " << oldValue << " to " << newValue << std::endl;
+  }
+
+.. 
+	A Real Example
+
+Um Exemplo Real
+***************
+
+..
+	Let's do an example taken from one of the best-known books on TCP around.  
+	"TCP/IP Illustrated, Volume 1: The Protocols," by W. Richard Stevens is a 
+	classic.  I just flipped the book open and ran across a nice plot of both the 
+	congestion window and sequence numbers versus time on page 366.  Stevens calls 
+	this, "Figure 21.10. Value of cwnd and send sequence number while data is being 
+	transmitted."  Let's just recreate the cwnd part of that plot in |ns3|
+	using the tracing system and ``gnuplot``.
+
+Vamos fazer um exemplo retirado do livro "TCP/IP Illustrated, Volume 1: The Protocols" escrito por W. Richard Stevens. Localizei na página 366 do livro um gráfico da janela de congestionamento e números de sequência versus tempo. Stevens denomina de "Figure 21.10. Value of cwnd and send sequence number while data is being transmitted." Vamos recriar a parte *cwnd* daquele gráfico em |ns3| usando o sistema de rastreamento e ``gnuplot``.
+
+.. 
+	Are There Trace Sources Available?
+
+Há Fontes de Rastreamento Disponibilizadas?
++++++++++++++++++++++++++++++++++++++++++++
+
+..
+	The first thing to think about is how we want to get the data out.  What is it
+	that we need to trace?  The first thing to do is to consult "The list of all
+	trace sources" to see what we have to work with.  Recall that this is found
+	in the |ns3| Doxygen in the "C++ Constructs Used by All Modules" Module section.  If you scroll
+	through the list, you will eventually find:
+
+Primeiro devemos pensar sobre como queremos obter os dados de saída. O que é que  nós precisamos rastrear? Consultamos então *"The list of all trace sources"* para sabermos o que temos para trabalhar. Essa seção encontra-se na documentação na seção *"Module"*, no item *"C++ Constructs Used by All Modules"*. Procurando na lista, encontraremos:
+
+::
+
+  ns3::TcpNewReno
+  CongestionWindow: The TCP connection's congestion window
+
+..
+	It turns out that the |ns3| TCP implementation lives (mostly) in the 
+	file ``src/internet/model/tcp-socket-base.cc`` while congestion control
+	variants are in files such as ``src/internet/model/tcp-newreno.cc``.  
+	If you don't know this a priori, you can use the recursive grep trick:
+
+A maior parte da implementação do TCP no |ns3| está no arquivo ``src/internet/model/tcp-socket-base.cc`` enquanto variantes do controle de congestionamento estão em arquivos como ``src/internet/model/tcp-newreno.cc``. Se não sabe a priori dessa informação, use:
+
+::
+
+  find . -name '*.cc' | xargs grep -i tcp
+
+.. 
+	You will find page after page of instances of tcp pointing you to that file. 
+
+Haverá páginas de respostas apontando para aquele arquivo.
+
+..
+	If you open ``src/internet/model/tcp-newreno.cc`` in your favorite 
+	editor, you will see right up at the top of the file, the following declarations:
+
+No início do arquivo ``src/internet/model/tcp-newreno.cc`` há as seguintes declarações:
+
+::
+
+  TypeId
+  TcpNewReno::GetTypeId ()
+  {
+    static TypeId tid = TypeId("ns3::TcpNewReno")
+      .SetParent<TcpSocketBase> ()
+      .AddConstructor<TcpNewReno> ()
+      .AddTraceSource ("CongestionWindow",
+                       "The TCP connection's congestion window",
+                       MakeTraceSourceAccessor (&TcpNewReno::m_cWnd))
+      ;
+    return tid;
+  }
+
+..
+	This should tell you to look for the declaration of ``m_cWnd`` in the header
+	file ``src/internet/model/tcp-newreno.h``.  If you open this file in your
+	favorite editor, you will find:
+
+Isto deveria guiá-lo para localizar a declaração de ``m_cWnd`` no arquivo de cabeçalho ``src/internet/model/tcp-newreno.h``. Temos nesse arquivo:
+
+::
+
+  TracedValue<uint32_t> m_cWnd; //Congestion window
+
+..
+	You should now understand this code completely.  If we have a pointer to the 
+	``TcpNewReno``, we can ``TraceConnect`` to the "CongestionWindow" trace 
+	source if we provide an appropriate callback target.  This is the same kind of
+	trace source that we saw in the simple example at the start of this section,
+	except that we are talking about ``uint32_t`` instead of ``int32_t``.
+
+Você deveria entender este código. Se nós temos um ponteiro para ``TcpNewReno``, podemos fazer ``TraceConnect`` para a origem do rastreamento "CongestionWindow" se fornecermos uma *callback* adequada. É o mesmo tipo de origem do rastreamento que nós abordamos no exemplo simples no início da seção, exceto que estamos usando ``uint32_t`` ao invés de ``int32_t``.
+
+..
+	We now know that we need to provide a callback that returns void and takes 
+	two ``uint32_t`` parameters, the first being the old value and the second 
+	being the new value:
+
+Precisamos prover uma *callback* que retorne ``void`` e receba dois parâmetros ``uint32_t``, o primeiro representando o valor antigo e o segundo o novo valor:
+
+::
+
+  void
+  CwndTrace (uint32_t oldValue, uint32_t newValue)
+  {
+    ...
+  }
+
+.. 
+	What Script to Use?
+
+Qual código Usar?
++++++++++++++++++
+
+..
+	It's always best to try and find working code laying around that you can 
+	modify, rather than starting from scratch.  So the first order of business now
+	is to find some code that already hooks the "CongestionWindow" trace source
+	and see if we can modify it.  As usual, grep is your friend:
+
+É sempre melhor localizar e modificar um código operacional que iniciar do zero. Portanto, vamos procurar uma origem do rastreamento da "CongestionWindow" e verificar se é possível modificar. Para tal, usamos novamente o *grep*:
+
+::
+
+  find . -name '*.cc' | xargs grep CongestionWindow
+
+..
+	This will point out a couple of promising candidates: 
+	``examples/tcp/tcp-large-transfer.cc`` and 
+	``src/test/ns3tcp/ns3tcp-cwnd-test-suite.cc``.
+
+Encontramos alguns candidatos:
+``examples/tcp/tcp-large-transfer.cc`` e
+``src/test/ns3tcp/ns3tcp-cwnd-test-suite.cc``.
+
+..
+	We haven't visited any of the test code yet, so let's take a look there.  You
+	will typically find that test code is fairly minimal, so this is probably a
+	very good bet.  Open ``src/test/ns3tcp/ns3tcp-cwnd-test-suite.cc`` in your
+	favorite editor and search for "CongestionWindow".  You will find,
+
+Nós não visitamos nenhum código de teste ainda, então vamos fazer isto agora. Código de teste é pequeno, logo é uma ótima escolha. Acesse o arquivo ``src/test/ns3tcp/ns3tcp-cwnd-test-suite.cc`` e localize "CongestionWindow". Como resultado, temos
+
+::
+
+  ns3TcpSocket->TraceConnectWithoutContext ("CongestionWindow", 
+    MakeCallback (&Ns3TcpCwndTestCase1::CwndChange, this));
+
+..
+	This should look very familiar to you.  We mentioned above that if we had a
+	"CongestionWindow" trace source.  That's exactly what we have here; so it
+	pointer to the ``TcpNewReno``, we could ``TraceConnect`` to the 
+	turns out that this line of code does exactly what we want.  Let's go ahead
+	and extract the code we need from this function 
+	(``Ns3TcpCwndTestCase1::DoRun (void)``).  If you look at this function,
+	you will find that it looks just like an |ns3| script.  It turns out that
+	is exactly what it is.  It is a script run by the test framework, so we can just
+	pull it out and wrap it in ``main`` instead of in ``DoRun``.  Rather than
+	walk through this, step, by step, we have provided the file that results from
+	porting this test back to a native |ns3| script --
+	``examples/tutorial/fifth.cc``.  
+
+Como abordado, temos uma origem do rastreamento  "CongestionWindow"; então ela aponta para ``TcpNewReno``, poderíamos alterar o ``TraceConnect`` para o que nós desejamos. Vamos extrair o código que precisamos desta função (``Ns3TcpCwndTestCase1::DoRun (void)``). Se você observar, perceberá que parece como um código |ns3|. E descobre-se exatamente que realmente é um código. É um código executado pelo `framework` de teste, logo podemos apenas colocá-lo no ``main`` ao invés de ``DoRun``.  A tradução deste teste para um código nativo do |ns3| é apresentada no arquivo ``examples/tutorial/fifth.cc``.
+
+
+.. 
+	A Common Problem and Solution
+
+Um Problema Comum e a Solução
++++++++++++++++++++++++++++++
+
+..
+	The ``fifth.cc`` example demonstrates an extremely important rule that you 
+	must understand before using any kind of ``Attribute``:  you must ensure 
+	that the target of a ``Config`` command exists before trying to use it.
+	This is no different than saying an object must be instantiated before trying
+	to call it.  Although this may seem obvious when stated this way, it does
+	trip up many people trying to use the system for the first time.
+
+O exemplo ``fifth.cc`` demonstra um importante regra que devemos entender antes de usar qualquer tipo de  Atributo: devemos garantir que o alvo de um comando ``Config`` existe antes de tentar usá-lo. É a mesma ideia que um objeto não pode ser usado sem ser primeiro instanciado. Embora pareça óbvio, muitas pessoas erram ao usar o sistema pela primeira vez.
+
+..
+	Let's return to basics for a moment.  There are three basic time periods that
+	exist in any |ns3| script.  The first time period is sometimes called 
+	"Configuration Time" or "Setup Time," and is in force during the period 
+	when the ``main`` function of your script is running, but before 
+	``Simulator::Run`` is called.  The second time period  is sometimes called
+	"Simulation Time" and is in force during the time period when 
+	``Simulator::Run`` is actively executing its events.  After it completes
+	executing the simulation,  ``Simulator::Run`` will return control back to 
+	the ``main`` function.  When this happens, the script enters what can be 
+	called "Teardown Time," which is when the structures and objects created 
+	during setup and taken apart and released.
+
+Há três fases básicas em qualquer código |ns3|. A primeira é a chamada de "Configuration Time" ou "Setup Time" e ocorre durante a execução da função ``main``, mas antes da chamada ``Simulator::Run``. O segunda fase é chamada de "Simulation Time" e é quando o ``Simulator::Run`` está executando seus eventos. Após completar a execução da simulação, ``Simulator::Run`` devolve o controle a função ``main``. Quando isto acontece, o código entra na terceira fase, o "Teardown Time", que  é quando estruturas e objetos criados durante a configuração são analisados e liberados.
+
+..
+	Perhaps the most common mistake made in trying to use the tracing system is 
+	assuming that entities constructed dynamically during simulation time are
+	available during configuration time.  In particular, an |ns3|
+	``Socket`` is a dynamic object often created by ``Applications`` to
+	communicate between ``Nodes``.  An |ns3| ``Application`` 
+	always has a "Start Time" and a "Stop Time" associated with it.  In the
+	vast majority of cases, an ``Application`` will not attempt to create 
+	a dynamic object until its ``StartApplication`` method is called at some
+	"Start Time".  This is to ensure that the simulation is completely 
+	configured before the app tries to do anything (what would happen if it tried
+	to connect to a node that didn't exist yet during configuration time). 
+	The answer to this issue is to 1) create a simulator event that is run after the 
+	dynamic object is created and hook the trace when that event is executed; or
+	2) create the dynamic object at configuration time, hook it then, and give 
+	the object to the system to use during simulation time.  We took the second 
+	approach in the ``fifth.cc`` example.  This decision required us to create
+	the ``MyApp`` ``Application``, the entire purpose of which is to take 
+	a ``Socket`` as a parameter.  
+
+Talvez o erro mais comum em tentar usar o sistema de rastreamento é supor que entidades construídas dinamicamente durante a fase de simulação estão acessíveis durante  a fase de configuração. Em particular, um ``Socket`` |ns3| é um objeto dinâmico frequentemente criado por Aplicações (``Applications``) para comunicação entre nós de redes.  Uma Aplicação |ns3| tem um "Start Time" e "Stop Time" associado a ela. Na maioria dos casos, uma Aplicação não tentar criar um objeto dinâmico até que seu método ``StartApplication`` é chamado
+em algum "Start Time". Isto é para garantir que a simulação está completamente configurada antes que a aplicação tente fazer alguma coisa (o que aconteceria se tentasse conectar a um nó que não existisse durante a fase de configuração). A resposta para esta questão é:
+	
+1. criar um evento no simulador que é executado depois que o objeto dinâmico 
+   é criado e ativar o rastreador quando aquele evento é executado; ou 
+2. criar o objeto dinâmico na fase de configuração, ativá-lo,
+   e passar o objeto para o sistema usar durante a fase de simulação. 
+
+Nós consideramos a segunda abordagem no exemplo ``fifth.cc``. A decisão implicou na criação da Aplicação ``MyApp``, com o propósito de passar um ``Socket`` como parâmetro.
+
+.. 
+	A fifth.cc Walkthrough
+
+Analisando o exemplo fifth.cc
++++++++++++++++++++++++++++++
+
+..
+	Now, let's take a look at the example program we constructed by dissecting
+	the congestion window test.  Open ``examples/tutorial/fifth.cc`` in your
+	favorite editor.  You should see some familiar looking code:
+
+Agora, vamos analisar o programa exemplo detalhando o teste da janela de congestionamento.
+Segue o código do arquivo localizado em ``examples/tutorial/fifth.cc``:
+
+::
+
+  /* -*- 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, Include., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+   */
+  
+  #include <fstream>
+  #include "ns3/core-module.h"
+  #include "ns3/network-module.h"
+  #include "ns3/internet-module.h"
+  #include "ns3/point-to-point-module.h"
+  #include "ns3/applications-module.h"
+  
+  using namespace ns3;
+  
+  NS_LOG_COMPONENT_DEFINE ("FifthScriptExample");
+
+..
+	This has all been covered, so we won't rehash it.  The next lines of source are
+	the network illustration and a comment addressing the problem described above
+	with ``Socket``.
+
+Todo o código apresentado já foi discutido. As próximas linhas são comentários apresentando
+a estrutura da rede e comentários abordando o problema descrito com o ``Socket``.
+
+::
+
+  // ===========================================================================
+  //
+  //         node 0                 node 1
+  //   +----------------+    +----------------+
+  //   |    ns-3 TCP    |    |    ns-3 TCP    |
+  //   +----------------+    +----------------+
+  //   |    10.1.1.1    |    |    10.1.1.2    |
+  //   +----------------+    +----------------+
+  //   | point-to-point |    | point-to-point |
+  //   +----------------+    +----------------+
+  //           |                     |
+  //           +---------------------+
+  //                5 Mbps, 2 ms
+  //
+  //
+  // We want to look at changes in the ns-3 TCP congestion window.  We need
+  // to crank up a flow and hook the CongestionWindow attribute on the socket
+  // of the sender.  Normally one would use an on-off application to generate a
+  // flow, but this has a couple of problems.  First, the socket of the on-off
+  // application is not created until Application Start time, so we wouldn't be
+  // able to hook the socket (now) at configuration time.  Second, even if we
+  // could arrange a call after start time, the socket is not public so we
+  // couldn't get at it.
+  //
+  // So, we can cook up a simple version of the on-off application that does what
+  // we want.  On the plus side we don't need all of the complexity of the on-off
+  // application.  On the minus side, we don't have a helper, so we have to get
+  // a little more involved in the details, but this is trivial.
+  //
+  // So first, we create a socket and do the trace connect on it; then we pass
+  // this socket into the constructor of our simple application which we then
+  // install in the source node.
+  // ===========================================================================
+  //
+
+.. 
+	This should also be self-explanatory.  
+
+..
+	The next part is the declaration of the ``MyApp`` ``Application`` that
+	we put together to allow the ``Socket`` to be created at configuration time.
+
+A próxima parte é a declaração da Aplicação ``MyApp`` que permite que o ``Socket`` seja criado na fase de configuração.
+
+::
+
+  class MyApp : public Application
+  {
+  public:
+  
+    MyApp ();
+    virtual ~MyApp();
+  
+    void Setup (Ptr<Socket> socket, Address address, uint32_t packetSize, 
+      uint32_t nPackets, DataRate dataRate);
+  
+  private:
+    virtual void StartApplication (void);
+    virtual void StopApplication (void);
+  
+    void ScheduleTx (void);
+    void SendPacket (void);
+  
+    Ptr<Socket>     m_socket;
+    Address         m_peer;
+    uint32_t        m_packetSize;
+    uint32_t        m_nPackets;
+    DataRate        m_dataRate;
+    EventId         m_sendEvent;
+    bool            m_running;
+    uint32_t        m_packetsSent;
+  };
+
+..
+	You can see that this class inherits from the |ns3| ``Application``
+	class.  Take a look at ``src/network/model/application.h`` if you are interested in 
+	what is inherited.  The ``MyApp`` class is obligated to override the 
+	``StartApplication`` and ``StopApplication`` methods.  These methods are
+	automatically called when ``MyApp`` is required to start and stop sending
+	data during the simulation.
+
+A classe ``MyApp`` herda a classe ``Application`` do |ns3|. Acesse  o arquivo ``src/network/model/application.h`` se estiver interessado sobre detalhes dessa herança. A classe ``MyApp`` é obrigada sobrescrever os métodos ``StartApplication`` e ``StopApplication``. Estes métodos são automaticamente chamado quando ``MyApp`` é solicitada iniciar e parar de enviar dados durante a simulação.
+
+.. 
+	How Applications are Started and Stopped (optional)
+
+Como Aplicações são Iniciadas e Paradas (Opcional)
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+..
+	It is worthwhile to spend a bit of time explaining how events actually get 
+	started in the system.  This is another fairly deep explanation, and can be
+	ignored if you aren't planning on venturing down into the guts of the system.
+	It is useful, however, in that the discussion touches on how some very important
+	parts of |ns3| work and exposes some important idioms.  If you are 
+	planning on implementing new models, you probably want to understand this
+	section.
+
+Nesta seção é explicado como eventos tem início no sistema. É uma explicação mais detalhada e não é necessária se não planeja entender detalhes do sistema. É interessante, por outro lado, pois aborda como partes do |ns3| trabalham e mostra alguns detalhes de implementação importantes. Se você planeja implementar novos modelos, então deve entender essa seção.
+
+..
+	The most common way to start pumping events is to start an ``Application``.
+	This is done as the result of the following (hopefully) familar lines of an 
+	|ns3| script:
+
+A maneira mais comum de iniciar eventos é iniciar uma Aplicação. Segue as linhas de um código |ns3| que faz exatamente isso:
+
+::
+
+  ApplicationContainer apps = ...
+  apps.Start (Seconds (1.0));
+  apps.Stop (Seconds (10.0));
+
+..
+	The application container code (see ``src/network/helper/application-container.h`` if
+	you are interested) loops through its contained applications and calls,
+
+O código do contêiner aplicação (``src/network/helper/application-container.h``) itera pelas aplicações no contêiner e chama,
+
+::
+
+  app->SetStartTime (startTime);
+
+.. 
+	as a result of the ``apps.Start`` call and
+
+como um resultado da chamada ``apps.Start`` e
+
+::
+
+  app->SetStopTime (stopTime);
+
+.. 
+	as a result of the ``apps.Stop`` call.
+
+como um resultado da chamada  ``apps.Stop``.
+
+..
+	The ultimate result of these calls is that we want to have the simulator 
+	automatically make calls into our ``Applications`` to tell them when to
+	start and stop.  In the case of ``MyApp``, it inherits from class
+	``Application`` and overrides ``StartApplication``, and 
+	``StopApplication``.  These are the functions that will be called by
+	the simulator at the appropriate time.  In the case of ``MyApp`` you
+	will find that ``MyApp::StartApplication`` does the initial ``Bind``,
+	and ``Connect`` on the socket, and then starts data flowing by calling
+	``MyApp::SendPacket``.  ``MyApp::StopApplication`` stops generating
+	packets by cancelling any pending send events and closing the socket.
+
+O último resultado destas chamadas queremos ter o simulador executando chamadas em nossa ``Applications`` para controlar o inicio e a parada. No caso ``MyApp``, herda da classe ``Application`` e sobrescreve ``StartApplication`` e ``StopApplication``. Estas são as funções invocadas pelo simulador no momento certo. No caso de ``MyApp``, o ``MyApp::StartApplication`` faz o ``Bind`` e ``Connect`` no `socket`, em seguida, inicia o fluxo de dados chamando ``MyApp::SendPacket``. ``MyApp::StopApplication`` interrompe a geração de pacotes cancelando qualquer evento pendente de envio e também fechando o socket.
+
+..
+	One of the nice things about |ns3| is that you can completely 
+	ignore the implementation details of how your ``Application`` is 
+	"automagically" called by the simulator at the correct time.  But since
+	we have already ventured deep into |ns3| already, let's go for it.
+
+Uma das coisas legais sobre o |ns3| é que podemos ignorar completamente os detalhes de implementação de como sua Aplicação é "automaticamente" chamada pelo simulador no momento correto. De qualquer forma, detalhamos como isso acontece a seguir.
+
+..
+	If you look at ``src/network/model/application.cc`` you will find that the
+	``SetStartTime`` method of an ``Application`` just sets the member 
+	variable ``m_startTime`` and the ``SetStopTime`` method just sets 
+	``m_stopTime``.  From there, without some hints, the trail will probably
+	end.
+
+Se observarmos em ``src/network/model/application.cc``, descobriremos que o 
+método ``SetStartTime`` de uma ``Application`` apenas altera a variável ``m_startTime`` e o método ``SetStopTime`` apenas altera a variável ``m_stopTime``.  
+
+..
+	The key to picking up the trail again is to know that there is a global 
+	list of all of the nodes in the system.  Whenever you create a node in 
+	a simulation, a pointer to that node is added to the global ``NodeList``.
+
+Para continuar e entender o processo, precisamos saber que há uma lista global de todos os nós no sistema. Sempre que você cria um nó em uma simulação, um ponteiro para aquele nó é adicionado para a lista global ``NodeList``.
+
+..
+	Take a look at ``src/network/model/node-list.cc`` and search for 
+	``NodeList::Add``.  The public static implementation calls into a private
+	implementation called ``NodeListPriv::Add``.  This is a relatively common
+	idom in |ns3|.  So, take a look at ``NodeListPriv::Add``.  There
+	you will find,
+
+Observe em ``src/network/model/node-list.cc`` e procure por ``NodeList::Add``. A implementação ``public static`` chama uma implementação privada denominada ``NodeListPriv::Add``. Isto é comum no |ns3|. Então, observe ``NodeListPriv::Add`` e encontrará,
+
+::
+
+  Simulator::ScheduleWithContext (index, TimeStep (0), &Node::Start, node);
+
+..
+	This tells you that whenever a ``Node`` is created in a simulation, as
+	a side-effect, a call to that node's ``Start`` method is scheduled for
+	you that happens at time zero.  Don't read too much into that name, yet.
+	It doesn't mean that the node is going to start doing anything, it can be
+	interpreted as an informational call into the ``Node`` telling it that 
+	the simulation has started, not a call for action telling the ``Node``
+	to start doing something.
+
+Isto significa que sempre que um ``Node`` é criado em uma simulação, como uma implicação, uma chamada para o método ``Start`` do nó é agendada para que ocorra no tempo zero. Isto não significa que o nó vai iniciar fazendo alguma coisa, pode ser interpretado como uma chamada informacional no ``Node`` dizendo a ele que a simulação teve início, não uma chamada para ação dizendo ao ``Node`` iniciar alguma coisa.
+
+..
+	So, ``NodeList::Add`` indirectly schedules a call to ``Node::Start``
+	at time zero to advise a new node that the simulation has started.  If you 
+	look in ``src/network/model/node.h`` you will, however, not find a method called
+	``Node::Start``.  It turns out that the ``Start`` method is inherited
+	from class ``Object``.  All objects in the system can be notified when
+	the simulation starts, and objects of class ``Node`` are just one kind
+	of those objects.
+
+Então, o ``NodeList::Add`` indiretamente agenda uma chamada para ``Node::Start`` no tempo zero, para informar ao novo nó que a simulação foi iniciada. Se olharmos em ``src/network/model/node.h`` não acharemos um método chamado ``Node::Start``. Acontece que o método ``Start`` é herdado da classe ``Object``. Todos objetos no sistema podem ser avisados que a simulação iniciou e objetos da classe ``Node`` são exemplos.
+
+..
+	Take a look at ``src/core/model/object.cc`` next and search for ``Object::Start``.
+	This code is not as straightforward as you might have expected since 
+	|ns3| ``Objects`` support aggregation.  The code in 
+	``Object::Start`` then loops through all of the objects that have been
+	aggregated together and calls their ``DoStart`` method.  This is another
+	idiom that is very common in |ns3|.  There is a public API method,
+	that stays constant across implementations, that calls a private implementation
+	method that is inherited and implemented by subclasses.  The names are typically
+	something like ``MethodName`` for the public API and ``DoMethodName`` for
+	the private API.
+
+Observe em seguida ``src/core/model/object.cc``. Localize por ``Object::Start``. Este código não é tão simples como você esperava desde que ``Objects`` |ns3| suportam agregação. O código em ``Object::Start`` então percorre todos os objetos que estão agregados e chama o método ``DoStart`` de cada um. Este é uma outra prática muito comum em |ns3|. Há um método pública na API, que permanece constante entre implementações, que chama um método de implementação privada que é herdado e implementado por subclasses. Os nomes são tipicamente
+algo como ``MethodName`` para os da API pública e ``DoMethodName`` para os da API privada.
+
+..
+	This tells us that we should look for a ``Node::DoStart`` method in 
+	``src/network/model/node.cc`` for the method that will continue our trail.  If you
+	locate the code, you will find a method that loops through all of the devices
+	in the node and then all of the applications in the node calling 
+	``device->Start`` and ``application->Start`` respectively.
+
+Logo, deveríamos procurar por um método ``Node::DoStart`` em  ``src/network/model/node.cc``. Ao localizar o método, descobrirá um método que percorre todos os dispositivos e aplicações no nó chamando respectivamente ``device->Start`` e ``application->Start``.
+
+..
+	You may already know that classes ``Device`` and ``Application`` both
+	inherit from class ``Object`` and so the next step will be to look at
+	what happens when ``Application::DoStart`` is called.  Take a look at
+	``src/network/model/application.cc`` and you will find:
+
+As classes ``Device`` e ``Application`` herdam da classe ``Object``, então o próximo passo é entender o que acontece quando ``Application::DoStart`` é executado. Observe o código em ``src/network/model/application.cc``:
+
+::
+
+  void
+  Application::DoStart (void)
+  {
+    m_startEvent = Simulator::Schedule (m_startTime, &Application::StartApplication, this);
+    if (m_stopTime != TimeStep (0))
+      {
+        m_stopEvent = Simulator::Schedule (m_stopTime, &Application::StopApplication, this);
+      }
+    Object::DoStart ();
+  }
+
+..
+	Here, we finally come to the end of the trail.  If you have kept it all straight,
+	when you implement an |ns3| ``Application``, your new application 
+	inherits from class ``Application``.  You override the ``StartApplication``
+	and ``StopApplication`` methods and provide mechanisms for starting and 
+	stopping the flow of data out of your new ``Application``.  When a ``Node``
+	is created in the simulation, it is added to a global ``NodeList``.  The act
+	of adding a node to this ``NodeList`` causes a simulator event to be scheduled
+	for time zero which calls the ``Node::Start`` method of the newly added 
+	``Node`` to be called when the simulation starts.  Since a ``Node`` inherits
+	from ``Object``, this calls the ``Object::Start`` method on the ``Node``
+	which, in turn, calls the ``DoStart`` methods on all of the ``Objects``
+	aggregated to the ``Node`` (think mobility models).  Since the ``Node``
+	``Object`` has overridden ``DoStart``, that method is called when the 
+	simulation starts.  The ``Node::DoStart`` method calls the ``Start`` methods
+	of all of the ``Applications`` on the node.  Since ``Applications`` are
+	also ``Objects``, this causes ``Application::DoStart`` to be called.  When
+	``Application::DoStart`` is called, it schedules events for the 
+	``StartApplication`` and ``StopApplication`` calls on the ``Application``.
+	These calls are designed to start and stop the flow of data from the 
+	``Application``
+
+Aqui finalizamos nosso detalhamento. Ao implementar uma Aplicação do |ns3|, sua nova aplicação herda da classe ``Application``. Você sobrescreve os métodos ``StartApplication`` e ``StopApplication`` e provê mecanismos para iniciar e finalizar o fluxo de dados de sua nova ``Application``. Quando um ``Node`` é criado na simulação, ele é adicionado a uma lista global ``NodeList``. A ação de adicionar um nó na lista faz com que um evento do simulador seja agendado para o tempo zero e que chama o método ``Node::Start`` do ``Node`` recentemente adicionado para ser chamado quando a simulação inicia. Como um ``Node`` herda de ``Object``,
+a chamada invoca o método ``Object::Start`` no ``Node``, o qual, por sua vez, chama os métodos ``DoStart`` em todos os ``Objects`` agregados ao ``Node`` (pense em modelos móveis).  Como o ``Node`` ``Object`` 
+tem sobrescritos ``DoStart``, o método é chamado quando a simulação inicia. O método ``Node::DoStart`` chama o método ``Start`` de todas as ``Applications`` no nó. Por sua vez, ``Applications`` são também ``Objects``, o que resulta na invocação do ``Application::DoStart``.  Quando ``Application::DoStart`` é chamada, ela agenda eventos para as chamadas ``StartApplication`` e ``StopApplication`` na ``Application``. Estas chamadas são projetadas para iniciar e parar o fluxo de dados da ``Application``.
+
+..
+	This has been another fairly long journey, but it only has to be made once, and
+	you now understand another very deep piece of |ns3|.
+
+Após essa longa jornada, você pode entende melhor outra parte do |ns3|.
+
+..
+	The MyApp Application
+
+A Aplicação MyApp
+~~~~~~~~~~~~~~~~~
+
+..
+	The ``MyApp`` ``Application`` needs a constructor and a destructor,
+	of course:
+
+A Aplicação ``MyApp`` precisa de um construtor e um destrutor,
+
+::
+
+  MyApp::MyApp ()
+    : m_socket (0),
+      m_peer (),
+      m_packetSize (0),
+      m_nPackets (0),
+      m_dataRate (0),
+      m_sendEvent (),
+      m_running (false),
+      m_packetsSent (0)
+  {
+  }
+  
+  MyApp::~MyApp()
+  {
+    m_socket = 0;
+  }
+
+..
+	The existence of the next bit of code is the whole reason why we wrote this
+	``Application`` in the first place.
+
+O código seguinte é a principal razão da existência desta Aplicação.
+
+::
+
+  void
+  MyApp::Setup (Ptr<Socket> socket, Address address, uint32_t packetSize, 
+                       uint32_t nPackets, DataRate dataRate)
+  {
+    m_socket = socket;
+    m_peer = address;
+    m_packetSize = packetSize;
+    m_nPackets = nPackets;
+    m_dataRate = dataRate;
+  }
+
+..  
+	This code should be pretty self-explanatory.  We are just initializing member
+	variables.  The important one from the perspective of tracing is the 
+	``Ptr<Socket> socket`` which we needed to provide to the application 
+	during configuration time.  Recall that we are going to create the ``Socket``
+	as a ``TcpSocket`` (which is implemented by ``TcpNewReno``) and hook 
+	its "CongestionWindow" trace source before passing it to the ``Setup``
+	method.
+
+Neste código inicializamos os atributos da classe. Do ponto de vista do rastreamento, a mais importante é ``Ptr<Socket> socket`` que deve ser passado para a aplicação durante o fase de configuração. Lembre-se que vamos criar o ``Socket`` como um ``TcpSocket`` (que é implementado por ``TcpNewReno``) e associar sua origem do rastreamento de sua *"CongestionWindow"* antes de passá-lo no método ``Setup``.
+
+::
+
+  void
+  MyApp::StartApplication (void)
+  {
+    m_running = true;
+    m_packetsSent = 0;
+    m_socket->Bind ();
+    m_socket->Connect (m_peer);
+    SendPacket ();
+  }
+
+..
+	The above code is the overridden implementation ``Application::StartApplication``
+	that will be automatically called by the simulator to start our ``Application``
+	running at the appropriate time.  You can see that it does a ``Socket`` ``Bind``
+	operation.  If you are familiar with Berkeley Sockets this shouldn't be a surprise.
+	It performs the required work on the local side of the connection just as you might 
+	expect.  The following ``Connect`` will do what is required to establish a connection 
+	with the TCP at ``Address`` m_peer.  It should now be clear why we need to defer
+	a lot of this to simulation time, since the ``Connect`` is going to need a fully
+	functioning network to complete.  After the ``Connect``, the ``Application`` 
+	then starts creating simulation events by calling ``SendPacket``.
+
+Este código sobrescreve ``Application::StartApplication`` que será chamado automaticamente pelo simulador para iniciar a  ``Application`` no momento certo. Observamos que é realizada uma operação ``Socket`` ``Bind``. Se você conhece Sockets de Berkeley isto não é uma novidade. É responsável pelo conexão no lado do cliente, ou seja, o ``Connect`` estabelece uma  conexão usando TCP no endereço ``m_peer``. Por isso, precisamos de uma infraestrutura funcional de rede antes de executar a fase de simulação. Depois do ``Connect``, a ``Application`` inicia a criação dos eventos de simulação chamando ``SendPacket``.
+
+::
+
+  void
+  MyApp::StopApplication (void)
+  {
+    m_running = false;
+  
+    if (m_sendEvent.IsRunning ())
+      {
+        Simulator::Cancel (m_sendEvent);
+      }
+  
+    if (m_socket)
+      {
+        m_socket->Close ();
+      }
+  }
+
+..
+	Every time a simulation event is scheduled, an ``Event`` is created.  If the 
+	``Event`` is pending execution or executing, its method ``IsRunning`` will
+	return ``true``.  In this code, if ``IsRunning()`` returns true, we 
+	``Cancel`` the event which removes it from the simulator event queue.  By 
+	doing this, we break the chain of events that the ``Application`` is using to
+	keep sending its ``Packets`` and the ``Application`` goes quiet.  After we 
+	quiet the ``Application`` we ``Close`` the socket which tears down the TCP 
+	connection.
+
+A todo instante um evento da simulação é agendado, isto é, um ``Event`` é criado. Se o ``Event`` é uma execução pendente ou está executando, seu método ``IsRunning`` retornará ``true``. Neste código, se ``IsRunning()`` retorna verdadeiro (`true`), nós cancelamos (``Cancel``) o evento, e por consequência, é removido da fila de eventos do simulador. Dessa forma, interrompemos a cadeia de eventos que a 
+``Application`` está usando para enviar seus ``Packets``. A Aplicação não enviará mais pacotes e em seguida fechamos (``Close``) o `socket` encerrando a conexão TCP.
+
+..
+	The socket is actually deleted in the destructor when the ``m_socket = 0`` is
+	executed.  This removes the last reference to the underlying Ptr<Socket> which 
+	causes the destructor of that Object to be called.
+
+O socket é deletado no destrutor quando ``m_socket = 0`` é executado. Isto remove a última referência para Ptr<Socket>  que ocasiona o destrutor daquele Objeto ser chamado.
+
+..
+	Recall that ``StartApplication`` called ``SendPacket`` to start the 
+	chain of events that describes the ``Application`` behavior.
+
+Lembre-se que ``StartApplication`` chamou ``SendPacket`` para iniciar a cadeia de eventos que descreve o comportamento da ``Application``.
+
+::
+
+  void
+  MyApp::SendPacket (void)
+  {
+    Ptr<Packet> packet = Create<Packet> (m_packetSize);
+    m_socket->Send (packet);
+  
+    if (++m_packetsSent < m_nPackets)
+      {
+        ScheduleTx ();
+      }
+  }
+
+..
+	Here, you see that ``SendPacket`` does just that.  It creates a ``Packet``
+	and then does a ``Send`` which, if you know Berkeley Sockets, is probably 
+	just what you expected to see.
+
+Este código apenas cria um pacote (``Packet``) e então envia (``Send``).
+
+..
+	It is the responsibility of the ``Application`` to keep scheduling the 
+	chain of events, so the next lines call ``ScheduleTx`` to schedule another
+	transmit event (a ``SendPacket``) until the ``Application`` decides it
+	has sent enough.
+
+É responsabilidade da ``Application`` gerenciar o agendamento da cadeia de eventos, então, a chamada ``ScheduleTx`` agenda outro evento de transmissão (um ``SendPacket``) até que a ``Application`` decida que enviou o suficiente.
+
+::
+
+  void
+  MyApp::ScheduleTx (void)
+  {
+    if (m_running)
+      {
+        Time tNext (Seconds (m_packetSize * 8 / static_cast<double> (m_dataRate.GetBitRate ())));
+        m_sendEvent = Simulator::Schedule (tNext, &MyApp::SendPacket, this);
+      }
+  }
+
+..
+	Here, you see that ``ScheduleTx`` does exactly that.  If the ``Application``
+	is running (if ``StopApplication`` has not been called) it will schedule a 
+	new event, which calls ``SendPacket`` again.  The alert reader will spot
+	something that also trips up new users.  The data rate of an ``Application`` is
+	just that.  It has nothing to do with the data rate of an underlying ``Channel``.
+	This is the rate at which the ``Application`` produces bits.  It does not take
+	into account any overhead for the various protocols or channels that it uses to 
+	transport the data.  If you set the data rate of an ``Application`` to the same
+	data rate as your underlying ``Channel`` you will eventually get a buffer overflow.
+
+Enquanto a ``Application`` está executando, ``ScheduleTx`` agendará um novo evento, que chama ``SendPacket`` novamente. Verifica-se que a taxa de transmissão é sempre a mesma, ou seja, é a taxa que a ``Application`` produz os bits. Não considera nenhuma sobrecarga de protocolos ou canais físicos no transporte dos dados. Se alterarmos a taxa de transmissão da ``Application`` para a mesma taxa dos canais físicos,  poderemos
+ter um estouro de *buffer*.
+
+.. 
+	The Trace Sinks
+
+Destino do Rastreamento
+~~~~~~~~~~~~~~~~~~~~~~~
+
+..
+	The whole point of this exercise is to get trace callbacks from TCP indicating the
+	congestion window has been updated.  The next piece of code implements the 
+	corresponding trace sink:
+
+O foco deste exercício é obter notificações (*callbacks*) do TCP indicando a modificação da janela de congestionamento. O código a seguir implementa o destino do rastreamento.
+
+::
+
+  static void
+  CwndChange (uint32_t oldCwnd, uint32_t newCwnd)
+  {
+    NS_LOG_UNCOND (Simulator::Now ().GetSeconds () << "\t" << newCwnd);
+  }
+
+..
+	This should be very familiar to you now, so we won't dwell on the details.  This
+	function just logs the current simulation time and the new value of the 
+	congestion window every time it is changed.  You can probably imagine that you
+	could load the resulting output into a graphics program (gnuplot or Excel) and
+	immediately see a nice graph of the congestion window behavior over time.
+
+Esta função registra o tempo de simulação atual e o novo valor da janela de congestionamento toda vez que é modificada. Poderíamos usar essa saída para construir um gráfico  do comportamento da janela de congestionamento com relação ao tempo.
+
+..
+	We added a new trace sink to show where packets are dropped.  We are going to 
+	add an error model to this code also, so we wanted to demonstrate this working.
+
+Nós adicionamos um novo destino do rastreamento para mostrar onde pacotes são perdidos. Vamos adicionar um modelo de erro.
+
+::
+
+  static void
+  RxDrop (Ptr<const Packet> p)
+  {
+    NS_LOG_UNCOND ("RxDrop at " << Simulator::Now ().GetSeconds ());
+  }
+
+..
+	This trace sink will be connected to the "PhyRxDrop" trace source of the 
+	point-to-point NetDevice.  This trace source fires when a packet is dropped
+	by the physical layer of a ``NetDevice``.  If you take a small detour to the
+	source (``src/point-to-point/model/point-to-point-net-device.cc``) you will
+	see that this trace source refers to ``PointToPointNetDevice::m_phyRxDropTrace``.
+	If you then look in ``src/point-to-point/model/point-to-point-net-device.h``
+	for this member variable, you will find that it is declared as a
+	``TracedCallback<Ptr<const Packet> >``.  This should tell you that the
+	callback target should be a function that returns void and takes a single
+	parameter which is a ``Ptr<const Packet>`` -- just what we have above.
+
+Este destino do rastreamento será conectado a origem do rastreamento "PhyRxDrop" do ``NetDevice`` ponto-a-ponto. Esta origem do rastreamento dispara quando um pacote é removido da camada física de um ``NetDevice``. Se olharmos rapidamente ``src/point-to-point/model/point-to-point-net-device.cc`` verificamos que a origem do rastreamento refere-se a ``PointToPointNetDevice::m_phyRxDropTrace``. E se procurarmos em ``src/point-to-point/model/point-to-point-net-device.h`` por essa variável, encontraremos que ela está declarada como uma ``TracedCallback<Ptr<const Packet> >``. Isto significa que nosso *callback* deve ser uma função que retorna ``void`` e tem um único parâmetro ``Ptr<const Packet>``.
+
+
+.. 
+	The Main Program
+
+O Programa Principal
+~~~~~~~~~~~~~~~~~~~~
+
+.. 
+	The following code should be very familiar to you by now:
+
+O código a seguir corresponde ao início da função principal:
+
+::
+
+  int
+  main (int argc, char *argv[])
+  {
+    NodeContainer nodes;
+    nodes.Create (2);
+  
+    PointToPointHelper pointToPoint;
+    pointToPoint.SetDeviceAttribute ("DataRate", StringValue ("5Mbps"));
+    pointToPoint.SetChannelAttribute ("Delay", StringValue ("2ms"));
+  
+    NetDeviceContainer devices;
+    devices = pointToPoint.Install (nodes);
+
+..
+	This creates two nodes with a point-to-point channel between them, just as
+	shown in the illustration at the start of the file.
+
+São criados dois nós ligados por um canal ponto-a-ponto, como mostrado na ilustração
+no início do arquivo.
+
+..
+	The next few lines of code show something new.  If we trace a connection that
+	behaves perfectly, we will end up with a monotonically increasing congestion
+	window.  To see any interesting behavior, we really want to introduce link 
+	errors which will drop packets, cause duplicate ACKs and trigger the more
+	interesting behaviors of the congestion window.
+
+
+Nas próximas linhas, temos um código com algumas informações novas. Se nós rastrearmos uma conexão que comporta-se perfeitamente, terminamos com um janela de congestionamento que aumenta monoliticamente. Para observarmos um comportamento interessante, introduzimos erros que causarão perda de pacotes, duplicação de `ACK`s e assim, introduz comportamentos mais interessantes a janela de congestionamento.
+
+
+..
+	|ns3| provides ``ErrorModel`` objects which can be attached to
+	``Channels``.  We are using the ``RateErrorModel`` which allows us
+	to introduce errors into a ``Channel`` at a given *rate*. 
+
+
+O |ns3| provê objetos de um modelo de erros (``ErrorModel``) que pode ser adicionado aos canais (``Channels``). Nós usamos o ``RateErrorModel`` que permite introduzir erros no canal dada uma *taxa*.
+
+::
+
+  Ptr<RateErrorModel> em = CreateObjectWithAttributes<RateErrorModel> (
+    "RanVar", RandomVariableValue (UniformVariable (0., 1.)),
+    "ErrorRate", DoubleValue (0.00001));
+  devices.Get (1)->SetAttribute ("ReceiveErrorModel", PointerValue (em));
+
+..
+	The above code instantiates a ``RateErrorModel`` Object.  Rather than 
+	using the two-step process of instantiating it and then setting Attributes,
+	we use the convenience function ``CreateObjectWithAttributes`` which
+	allows us to do both at the same time.  We set the "RanVar" 
+	``Attribute`` to a random variable that generates a uniform distribution
+	from 0 to 1.  We also set the "ErrorRate" ``Attribute``.
+	We then set the resulting instantiated ``RateErrorModel`` as the error
+	model used by the point-to-point ``NetDevice``.  This will give us some
+	retransmissions and make our plot a little more interesting.
+
+O código instancia um objeto ``RateErrorModel``. Para simplificar usamos a função ``CreateObjectWithAttributes`` que instancia e configura os Atributos. O Atributo "RanVar" foi configurado para uma variável randômica que gera uma distribuição uniforme entre 0 e 1. O Atributo "ErrorRate" também foi alterado. Por fim, configuramos o modelo erro no ``NetDevice`` ponto-a-ponto modificando o atributo "ReceiveErrorModel".  Isto causará retransmissões e o gráfico ficará mais interessante.
+
+::
+
+  InternetStackHelper stack;
+  stack.Install (nodes);
+
+  Ipv4AddressHelper address;
+  address.SetBase ("10.1.1.0", "255.255.255.252");
+  Ipv4InterfaceContainer interfaces = address.Assign (devices);
+
+..
+	The above code should be familiar.  It installs internet stacks on our two
+	nodes and creates interfaces and assigns IP addresses for the point-to-point
+	devices.
+
+Neste código configura a pilha de protocolos da internet nos dois nós de rede, cria interfaces e associa endereços IP para os dispositivos ponto-a-ponto.
+
+..
+	Since we are using TCP, we need something on the destination node to receive
+	TCP connections and data.  The ``PacketSink`` ``Application`` is commonly
+	used in |ns3| for that purpose.
+
+Como estamos usando TCP, precisamos de um nó de destino para receber as conexões e os dados.  O ``PacketSink`` ``Application``  é comumente usado no |ns3| para este propósito.
+
+::
+
+  uint16_t sinkPort = 8080;
+  Address sinkAddress (InetSocketAddress(interfaces.GetAddress (1), sinkPort));
+  PacketSinkHelper packetSinkHelper ("ns3::TcpSocketFactory", 
+    InetSocketAddress (Ipv4Address::GetAny (), sinkPort));
+  ApplicationContainer sinkApps = packetSinkHelper.Install (nodes.Get (1));
+  sinkApps.Start (Seconds (0.));
+  sinkApps.Stop (Seconds (20.));
+
+.. 
+	This should all be familiar, with the exception of,
+
+Este código deveria ser familiar, com exceção de,
+
+::
+
+  PacketSinkHelper packetSinkHelper ("ns3::TcpSocketFactory", 
+    InetSocketAddress (Ipv4Address::GetAny (), sinkPort));
+
+..
+	This code instantiates a ``PacketSinkHelper`` and tells it to create sockets
+	using the class ``ns3::TcpSocketFactory``.  This class implements a design 
+	pattern called "object factory" which is a commonly used mechanism for 
+	specifying a class used to create objects in an abstract way.  Here, instead of 
+	having to create the objects themselves, you provide the ``PacketSinkHelper``
+	a string that specifies a ``TypeId`` string used to create an object which 
+	can then be used, in turn, to create instances of the Objects created by the 
+	factory.
+
+Este código instancia um ``PacketSinkHelper`` e cria sockets usando a classe ``ns3::TcpSocketFactory``. Esta classe implementa o padrão de projeto "fábrica de objetos". Dessa forma, em vez de criar os objetos diretamente, fornecemos ao ``PacketSinkHelper`` um texto que especifica um ``TypeId`` usado para criar
+um objeto que, por sua vez, pode ser usado para criar instâncias de Objetos criados pela implementação da fábrica de objetos.
+
+..
+	The remaining parameter tells the ``Application`` which address and port it
+	should ``Bind`` to.
+
+O parâmetro seguinte especifica o endereço e a porta para o mapeamento.
+
+.. 
+	The next two lines of code will create the socket and connect the trace source.
+
+As próximas duas linhas do código criam o `socket` e conectam a origem do rastreamento.
+
+::
+
+  Ptr<Socket> ns3TcpSocket = Socket::CreateSocket (nodes.Get (0), 
+    TcpSocketFactory::GetTypeId ());
+  ns3TcpSocket->TraceConnectWithoutContext ("CongestionWindow", 
+    MakeCallback (&CwndChange));
+
+..
+	The first statement calls the static member function ``Socket::CreateSocket``
+	and provides a ``Node`` and an explicit ``TypeId`` for the object factory
+	used to create the socket.  This is a slightly lower level call than the 
+	``PacketSinkHelper`` call above, and uses an explicit C++ type instead of 
+	one referred to by a string.  Otherwise, it is conceptually the same thing.
+
+A primeira declaração chama a função estática ``Socket::CreateSocket`` e passa um ``Node`` e um ``TypeId`` para o objeto fábrica usado para criar o `socket`. 
+
+..
+	Once the ``TcpSocket`` is created and attached to the ``Node``, we can
+	use ``TraceConnectWithoutContext`` to connect the CongestionWindow trace 
+	source to our trace sink.
+
+Uma vez que o ``TcpSocket`` é criado e adicionado ao ``Node``, nós usamos ``TraceConnectWithoutContext`` para conectar a origem do rastreamento "CongestionWindow" para o nosso destino do rastreamento.
+
+..
+	Recall that we coded an ``Application`` so we could take that ``Socket``
+	we just made (during configuration time) and use it in simulation time.  We now 
+	have to instantiate that ``Application``.  We didn't go to any trouble to
+	create a helper to manage the ``Application`` so we are going to have to 
+	create and install it "manually".  This is actually quite easy:
+
+Codificamos uma ``Application`` então podemos obter um ``Socket`` (durante a fase de configuração) e usar na fase de simulação. Temos agora que instanciar a ``Application``. Para tal, segue os passos:
+
+::
+
+  Ptr<MyApp> app = CreateObject<MyApp> ();
+  app->Setup (ns3TcpSocket, sinkAddress, 1040, 1000, DataRate ("1Mbps"));
+  nodes.Get (0)->AddApplication (app);
+  app->Start (Seconds (1.));
+  app->Stop (Seconds (20.));
+
+..
+	The first line creates an ``Object`` of type ``MyApp`` -- our
+	``Application``.  The second line tells the ``Application`` what
+	``Socket`` to use, what address to connect to, how much data to send 
+	at each send event, how many send events to generate and the rate at which
+	to produce data from those events.
+
+A primeira linha cria um Objeto do tipo ``MyApp`` -- nossa ``Application``. A segunda linha especifica o `socket`, o endereço de conexão, a quantidade de dados a ser enviada em cada evento, a quantidade de eventos de transmissão a ser gerados e a taxa de produção de dados para estes eventos.
+
+	Next, we manually add the ``MyApp Application`` to the source node
+	and explicitly call the ``Start`` and ``Stop`` methods on the 
+	``Application`` to tell it when to start and stop doing its thing.
+
+Depois, adicionamos a ``MyApp Application`` para o nó origem e chamamos os métodos ``Start`` e ``Stop`` para dizer quando e iniciar e parar a simulação.
+
+..
+	We need to actually do the connect from the receiver point-to-point ``NetDevice``
+	to our callback now.
+
+Precisamos agora fazer a conexão entre o receptor com nossa *callback*.
+
+::
+
+  devices.Get (1)->TraceConnectWithoutContext("PhyRxDrop", MakeCallback (&RxDrop));
+
+..
+	It should now be obvious that we are getting a reference to the receiving 
+	``Node NetDevice`` from its container and connecting the trace source defined
+	by the attribute "PhyRxDrop" on that device to the trace sink ``RxDrop``.
+
+Estamos obtendo uma referência para o ``Node NetDevice`` receptor e conectando a origem do rastreamento pelo Atributo "PhyRxDrop" do dispositivo no destino do rastreamento ``RxDrop``.
+
+..
+	Finally, we tell the simulator to override any ``Applications`` and just
+	stop processing events at 20 seconds into the simulation.
+
+Finalmente, dizemos ao simulador para sobrescrever qualquer ``Applications`` e parar o processamento de eventos em 20 segundos na simulação.
+
+::
+
+    Simulator::Stop (Seconds(20));
+    Simulator::Run ();
+    Simulator::Destroy ();
+
+    return 0;
+  }
+
+..
+	Recall that as soon as ``Simulator::Run`` is called, configuration time
+	ends, and simulation time begins.  All of the work we orchestrated by 
+	creating the ``Application`` and teaching it how to connect and send
+	data actually happens during this function call.
+
+Lembre-se que quando ``Simulator::Run`` é chamado, a fase de configuração termina e a fase de simulação inicia. Todo o processo descrito anteriormente ocorre durante a chamada dessa função.
+
+..
+	As soon as ``Simulator::Run`` returns, the simulation is complete and
+	we enter the teardown phase.  In this case, ``Simulator::Destroy`` takes
+	care of the gory details and we just return a success code after it completes.
+
+Após o retorno do ``Simulator::Run``, a simulação é terminada e entramos na fase de finalização. Neste caso, ``Simulator::Destroy`` executa a tarefa pesada e nós apenas retornamos o código de sucesso.
+
+.. 
+	Running fifth.cc
+
+Executando fifth.cc
++++++++++++++++++++
+
+..
+	Since we have provided the file ``fifth.cc`` for you, if you have built
+	your distribution (in debug mode since it uses NS_LOG -- recall that optimized
+	builds optimize out NS_LOGs) it will be waiting for you to run.
+
+O arquivo ``fifth.cc`` é distribuído no código fonte, no diretório ``examples/tutorial``. Para executar:
+
+::
+
+  ./waf --run fifth
+  Waf: Entering directory `/home/craigdo/repos/ns-3-allinone-dev/ns-3-dev/build
+  Waf: Leaving directory `/home/craigdo/repos/ns-3-allinone-dev/ns-3-dev/build'
+  'build' finished successfully (0.684s)
+  1.20919 1072
+  1.21511 1608
+  1.22103 2144
+  ...
+  1.2471  8040
+  1.24895 8576
+  1.2508  9112
+  RxDrop at 1.25151
+  ...
+
+..
+	You can probably see immediately a downside of using prints of any kind in your
+	traces.  We get those extraneous waf messages printed all over our interesting
+	information along with those RxDrop messages.  We will remedy that soon, but I'm
+	sure you can't wait to see the results of all of this work.  Let's redirect that
+	output to a file called ``cwnd.dat``:
+
+Podemos observar o lado negativo de usar "prints" de qualquer tipo no rastreamento. Temos mensagens ``waf`` sendo impressas sobre a informação relevante. Vamos resolver esse problema, mas primeiro vamos verificar o resultado redirecionando a saída para um arquivo ``cwnd.dat``:
+
+::
+
+  ./waf --run fifth > cwnd.dat 2>&1
+
+..
+	Now edit up "cwnd.dat" in your favorite editor and remove the waf build status
+	and drop lines, leaving only the traced data (you could also comment out the
+	``TraceConnectWithoutContext("PhyRxDrop", MakeCallback (&RxDrop));`` in the
+	script to get rid of the drop prints just as easily. 
+
+Removemos as mensagens do ``waf`` e deixamos somente os dados rastreados.  Pode-se também comentar as mensagens de "RxDrop...".
+
+..
+	You can now run gnuplot (if you have it installed) and tell it to generate some 
+	pretty pictures:
+
+Agora podemos executar o gnuplot (se instalado) e gerar um gráfico:
+
+::
+
+  gnuplot> set terminal png size 640,480
+  gnuplot> set output "cwnd.png"
+  gnuplot> plot "cwnd.dat" using 1:2 title 'Congestion Window' with linespoints
+  gnuplot> exit
+
+..
+	You should now have a graph of the congestion window versus time sitting in the 
+	file "cwnd.png" that looks like:
+
+Devemos obter um gráfico da janela de congestionamento pelo tempo no arquivo "cwnd.png", similar ao gráfico 7.1:
+
+figure:: figures/cwnd.png
+
+   Gráfico da janela de congestionamento versus tempo.
+
+.. 
+	Using Mid-Level Helpers
+
+Usando Auxiliares Intermediários
+++++++++++++++++++++++++++++++++
+
+..
+	In the previous section, we showed how to hook a trace source and get hopefully
+	interesting information out of a simulation.  Perhaps you will recall that we 
+	called logging to the standard output using ``std::cout`` a "Blunt Instrument" 
+	much earlier in this chapter.  We also wrote about how it was a problem having
+	to parse the log output in order to isolate interesting information.  It may 
+	have occurred to you that we just spent a lot of time implementing an example
+	that exhibits all of the problems we purport to fix with the |ns3| tracing
+	system!  You would be correct.  But, bear with us.  We're not done yet.
+
+Na seção anterior, mostramos como adicionar uma origem do rastreamento e obter informações de interesse fora da simulação. Entretanto, no início do capítulo foi comentado que imprimir informações na saída padrão não é uma boa prática. Além disso, comentamos que não é interessante realizar processamento sobre a saída para isolar a informação de interesse. Podemos pensar que perdemos muito tempo em um exemplo que apresenta todos os problemas que propomos resolver usando o sistema de rastreamento do |ns3|. Você estaria correto, mas nós ainda não terminamos.
+
+..
+	One of the most important things we want to do is to is to have the ability to 
+	easily control the amount of output coming out of the simulation; and we also 
+	want to save those data to a file so we can refer back to it later.  We can use
+	the mid-level trace helpers provided in |ns3| to do just that and complete
+	the picture.
+
+Uma da coisas mais importantes que queremos fazer é controlar a quantidade de saída da simulação. Nós podemos usar assistentes de rastreamento intermediários fornecido pelo |ns3| para alcançar com sucesso esse objetivo.
+
+..
+	We provide a script that writes the cwnd change and drop events developed in 
+	the example ``fifth.cc`` to disk in separate files.  The cwnd changes are 
+	stored as a tab-separated ASCII file and the drop events are stored in a pcap
+	file.  The changes to make this happen are quite small.
+
+Fornecemos um código que separa em arquivos distintos no disco os eventos de modificação da janela e os eventos de remoção. As alterações em cwnd são armazenadas em um arquivo ASCII separadas por TAB e os eventos de remoção são armazenados em um arquivo *pcap*. As alterações para obter esse resultado são pequenas.
+
+.. 
+	A sixth.cc Walkthrough
+
+Analisando sixth.cc
+~~~~~~~~~~~~~~~~~~~
+
+..
+	Let's take a look at the changes required to go from ``fifth.cc`` to 
+	``sixth.cc``.  Open ``examples/tutorial/fifth.cc`` in your favorite 
+	editor.  You can see the first change by searching for CwndChange.  You will 
+	find that we have changed the signatures for the trace sinks and have added 
+	a single line to each sink that writes the traced information to a stream
+	representing a file.
+
+Vamos verificar as mudanças do arquivo ``fifth.cc`` para o  ``sixth.cc``. Verificamos a primeira mudança em ``CwndChange``. Notamos que as assinaturas para o destino do rastreamento foram alteradas e que foi adicionada uma linha para cada um que escreve a informação rastreada para um fluxo (*stream*) representando um arquivo
+
+::
+
+  static void
+  CwndChange (Ptr<OutputStreamWrapper> stream, uint32_t oldCwnd, uint32_t newCwnd)
+  {
+    NS_LOG_UNCOND (Simulator::Now ().GetSeconds () << "\t" << newCwnd);
+    *stream->GetStream () << Simulator::Now ().GetSeconds () << "\t" 
+    		<< oldCwnd << "\t" << newCwnd << std::endl;
+  }
+  
+  static void
+  RxDrop (Ptr<PcapFileWrapper> file, Ptr<const Packet> p)
+  {
+    NS_LOG_UNCOND ("RxDrop at " << Simulator::Now ().GetSeconds ());
+    file->Write(Simulator::Now(), p);
+  }
+
+..
+	We have added a "stream" parameter to the ``CwndChange`` trace sink.  
+	This is an object that holds (keeps safely alive) a C++ output stream.  It 
+	turns out that this is a very simple object, but one that manages lifetime 
+	issues for the stream and solves a problem that even experienced C++ users 
+	run into.  It turns out that the copy constructor for ostream is marked 
+	private.  This means that ostreams do not obey value semantics and cannot 
+	be used in any mechanism that requires the stream to be copied.  This includes
+	the |ns3| callback system, which as you may recall, requires objects
+	that obey value semantics.  Further notice that we have added the following 
+	line in the ``CwndChange`` trace sink implementation:
+
+Um parâmetro "stream" foi adicionado para o destino do rastreamento ``CwndChange``. Este é um objeto que armazena (mantém seguramente vivo) um fluxo de saída em C++. Isto resulta em um objeto muito simples, mas que gerência problemas no ciclo de vida para fluxos e resolve um problema que mesmo programadores experientes de C++ tem dificuldades. Resulta que o construtor de cópia para o fluxo de saída (*ostream*) é marcado como privado. Isto significa que fluxos de saída não seguem a semântica de passagem por valor e não podem ser usados em mecanismos que necessitam que o fluxo seja copiado. Isto inclui o sistema de *callback* do |ns3|. Além disso, adicionamos a seguinte linha:
+
+::
+
+  *stream->GetStream () << Simulator::Now ().GetSeconds () << "\t" << oldCwnd 
+  		<< "\t" << newCwnd << std::endl;
+
+..
+	This would be very familiar code if you replaced ``*stream->GetStream ()``
+	with ``std::cout``, as in:
+
+que substitui ``std::cout`` por ``*stream->GetStream ()``
+
+::
+
+  std::cout << Simulator::Now ().GetSeconds () << "\t" << oldCwnd << "\t" << 
+  		newCwnd << std::endl;
+
+..
+	This illustrates that the ``Ptr<OutputStreamWrapper>`` is really just
+	carrying around a ``std::ofstream`` for you, and you can use it here like 
+	any other output stream.
+
+Isto demostra que o ``Ptr<OutputStreamWrapper>`` está apenas encapsulando um ``std::ofstream``, logo pode ser usado como qualquer outro fluxo de saída.
+
+..
+	A similar situation happens in ``RxDrop`` except that the object being 
+	passed around (a ``Ptr<PcapFileWrapper>``) represents a pcap file.  There
+	is a one-liner in the trace sink to write a timestamp and the contents of the 
+	packet being dropped to the pcap file:
+
+Uma situação similar ocorre em ``RxDrop``, exceto que o objeto passado (``Ptr<PcapFileWrapper>``) representa um arquivo pcap. Há uma linha no *trace sink* para escrever um marcador de tempo (*timestamp*) eo conteúdo do pacote perdido para o arquivo pcap.
+
+::
+
+  file->Write(Simulator::Now(), p);
+
+..
+	Of course, if we have objects representing the two files, we need to create
+	them somewhere and also cause them to be passed to the trace sinks.  If you 
+	look in the ``main`` function, you will find new code to do just that:
+
+É claro, se nós temos objetos representando os dois arquivos, precisamos criá-los em algum lugar e também passá-los aos *trace sinks*. Se observarmos a função ``main``, temos o código:
+
+::
+
+  AsciiTraceHelper asciiTraceHelper;
+  Ptr<OutputStreamWrapper> stream = asciiTraceHelper.CreateFileStream ("sixth.cwnd");
+  ns3TcpSocket->TraceConnectWithoutContext ("CongestionWindow", 
+  		MakeBoundCallback (&CwndChange, stream));
+
+  ...
+
+  PcapHelper pcapHelper;
+  Ptr<PcapFileWrapper> file = pcapHelper.CreateFile ("sixth.pcap", 
+  		std::ios::out, PcapHelper::DLT_PPP);
+  devices.Get (1)->TraceConnectWithoutContext("PhyRxDrop", 
+  		MakeBoundCallback (&RxDrop, file));
+
+..
+	In the first section of the code snippet above, we are creating the ASCII
+	trace file, creating an object responsible for managing it and using a
+	variant of the callback creation function to arrange for the object to be 
+	passed to the sink.  Our ASCII trace helpers provide a rich set of
+	functions to make using text (ASCII) files easy.  We are just going to 
+	illustrate the use of the file stream creation function here.
+
+Na primeira seção do código, criamos o arquivo de rastreamento ASCII e o objeto responsável para gerenciá-lo. Em seguida, usando uma das formas da função para criação da *callback* permitimos o objeto ser passado para o destino do rastreamento. As classes assistentes para rastreamento ASCII fornecem um vasto conjunto de funções para facilitar a manipulação de arquivos texto. Neste exemplo, focamos apenas na criação do arquivo para o fluxo de saída.
+
+..
+	The ``CreateFileStream{}`` function is basically going to instantiate
+	a std::ofstream object and create a new file (or truncate an existing file).
+	This ofstream is packaged up in an |ns3| object for lifetime management
+	and copy constructor issue resolution.
+
+A função ``CreateFileStream()`` instancia um objeto ``std::ofstream`` e cria  um novo arquivo. O fluxo de saída ``ofstream`` é encapsulado em um objeto do |ns3| para gerenciamento do ciclo de vida e para resolver o
+problema do construtor de cópia.
+
+..
+	We then take this |ns3| object representing the file and pass it to
+	``MakeBoundCallback()``.  This function creates a callback just like
+	``MakeCallback()``, but it "binds" a new value to the callback.  This
+	value is added to the callback before it is called.
+
+Então pegamos o objeto que representa o arquivo e passamos para ``MakeBoundCallback()``. Esta função cria um *callback* como ``MakeCallback()``, mas "associa" um novo valor para o *callback*. Este valor é adicionado ao *callback* antes de sua invocação.
+
+..
+	Essentially, ``MakeBoundCallback(&CwndChange, stream)`` causes the trace 
+	source to add the additional "stream" parameter to the front of the formal
+	parameter list before invoking the callback.  This changes the required 
+	signature of the ``CwndChange`` sink to match the one shown above, which
+	includes the "extra" parameter ``Ptr<OutputStreamWrapper> stream``.
+
+Essencialmente, ``MakeBoundCallback(&CwndChange, stream)`` faz com que a origem do rastreamento adicione um parâmetro extra "fluxo" após a lista formal de parâmetros antes de invocar o *callback*. Esta mudança está de acordo com o apresentado anteriormente, a qual inclui o parâmetro ``Ptr<OutputStreamWrapper> stream``.
+
+..
+	In the second section of code in the snippet above, we instantiate a 
+	``PcapHelper`` to do the same thing for our pcap trace file that we did
+	with the ``AsciiTraceHelper``. The line of code,
+
+Na segunda seção de código, instanciamos um ``PcapHelper`` para fazer a mesma coisa para o arquivo de rastreamento pcap. A linha de código,
+
+::
+
+  Ptr<PcapFileWrapper> file = pcapHelper.CreateFile ("sixth.pcap", "w", 
+  		PcapHelper::DLT_PPP);
+
+..
+	creates a pcap file named "sixth.pcap" with file mode "w".   This means that
+	the new file is to truncated if an existing file with that name is found.  The
+	final parameter is the "data link type" of the new pcap file.  These are 
+	the same as the pcap library data link types defined in ``bpf.h`` if you are
+	familar with pcap.  In this case, ``DLT_PPP`` indicates that the pcap file
+	is going to contain packets prefixed with point to point headers.  This is true
+	since the packets are coming from our point-to-point device driver.  Other
+	common data link types are DLT_EN10MB (10 MB Ethernet) appropriate for csma
+	devices and DLT_IEEE802_11 (IEEE 802.11) appropriate for wifi devices.  These
+	are defined in ``src/network/helper/trace-helper.h"`` if you are interested in seeing
+	the list.  The entries in the list match those in ``bpf.h`` but we duplicate
+	them to avoid a pcap source dependence.
+
+cria um arquivo pcap chamado "sixth.pcap" no modo "w" (escrita). O parâmetro final é o "tipo da ligação de dados" do arquivo pcap. As opções estão definidas em ``bpf.h``. Neste caso, ``DLT_PPP`` indica que o arquivo pcap deverá conter pacotes prefixado com cabeçalhos ponto-a-ponto. Isto é verdade pois os pacotes estão chegando de nosso `driver` de dispositivo ponto-a-ponto. Outros tipos de ligação de dados comuns são DLT_EN10MB (10 MB Ethernet) apropriado para dispositivos CSMA e DLT_IEEE802_11 (IEEE 802.11) apropriado para dispositivos sem fio. O arquivo ``src/network/helper/trace-helper.h"`` define uma lista com os tipos. As entradas na lista são idênticas as definidas em ``bpf.h``, pois foram duplicadas para evitar um dependência com o pcap.
+
+..
+	A |ns3| object representing the pcap file is returned from ``CreateFile``
+	and used in a bound callback exactly as it was in the ascii case.
+
+Um objeto |ns3| representando o arquivo pcap é retornado de ``CreateFile`` e usado em uma *callback* exatamente como no caso ASCII.
+
+..
+	An important detour:  It is important to notice that even though both of these 
+	objects are declared in very similar ways,
+
+É importante observar que ambos objetos são declarados de maneiras muito similares,
+
+::
+
+  Ptr<PcapFileWrapper> file ...
+  Ptr<OutputStreamWrapper> stream ...
+
+..
+	The underlying objects are entirely different.  For example, the 
+	Ptr<PcapFileWrapper> is a smart pointer to an |ns3| Object that is a 
+	fairly heaviweight thing that supports ``Attributes`` and is integrated into
+	the config system.  The Ptr<OutputStreamWrapper>, on the other hand, is a smart 
+	pointer to a reference counted object that is a very lightweight thing.
+	Remember to always look at the object you are referencing before making any
+	assumptions about the "powers" that object may have.  
+
+Mas os objetos internos são inteiramente diferentes. Por exemplo, o Ptr<PcapFileWrapper> é um ponteiro para um objeto |ns3| que suporta ``Attributes`` e é integrado dentro do sistema de configuração. O Ptr<OutputStreamWrapper>, por outro lado, é um ponteiro para uma referência para um simples objeto contado. Lembre-se sempre de analisar o objeto que você está referenciando antes de fazer suposições sobre os "poderes" que o objeto pode ter.
+
+..
+	For example, take a look at ``src/network/model/pcap-file-object.h`` in the 
+	distribution and notice, 
+
+Por exemplo, acesse o arquivo ``src/network/model/pcap-file-object.h`` e observe,
+
+::
+
+  class PcapFileWrapper : public Object
+
+..
+	that class ``PcapFileWrapper`` is an |ns3| Object by virtue of 
+	its inheritance.  Then look at ``src/network/model/output-stream-wrapper.h`` and 
+	notice,
+
+que a classe ``PcapFileWrapper`` é um ``Object`` |ns3| por herança. Já no arquivo ``src/network/model/output-stream-wrapper.h``, observe,
+
+::
+
+  class OutputStreamWrapper : public SimpleRefCount<OutputStreamWrapper>
+
+..
+	that this object is not an |ns3| Object at all, it is "merely" a
+	C++ object that happens to support intrusive reference counting.
+
+que não é um ``Object`` |ns3|, mas um objeto C++ que suporta contagem de referência.
+
+..
+	The point here is that just because you read Ptr<something> it does not necessarily
+	mean that "something" is an |ns3| Object on which you can hang |ns3|
+	``Attributes``, for example.
+
+A questão é que se você tem um Ptr<alguma_coisa>, não necessariamente significa que "alguma_coisa" é um ``Object`` |ns3|, no qual você pode modificar ``Attributes``, por exemplo.
+
+..
+	Now, back to the example.  If you now build and run this example,
+
+Voltando ao exemplo. Se compilarmos e executarmos o exemplo,
+
+::
+
+  ./waf --run sixth
+
+..
+	you will see the same messages appear as when you ran "fifth", but two new 
+	files will appear in the top-level directory of your |ns3| distribution.
+
+Veremos as mesmas mensagens do "fifth", mas dois novos arquivos aparecerão no diretório base de sua distribuição do |ns3|.
+
+::
+
+  sixth.cwnd  sixth.pcap
+
+..
+	Since "sixth.cwnd" is an ASCII text file, you can view it with ``cat``
+	or your favorite file viewer.
+
+Como "sixth.cwnd" é um arquivo texto ASCII, você pode visualizar usando *cat* ou um editor de texto.
+
+::
+
+  1.20919 536     1072
+  1.21511 1072    1608
+  ...
+  9.30922 8893    8925
+  9.31754 8925    8957
+
+..
+	You have a tab separated file with a timestamp, an old congestion window and a
+	new congestion window suitable for directly importing into your plot program.
+	There are no extraneous prints in the file, no parsing or editing is required.
+	
+Cada linha tem um marcador de tempo, o valor da janela de congestionamento e o valor da nova janela de congestionamento separados por tabulação, para importar diretamente para seu programa de plotagem de gráficos.
+Não há nenhuma outra informação além da rastreada, logo não é necessário processamento ou edição do arquivo.
+
+..
+	Since "sixth.pcap" is a pcap file, you can view it with ``tcpdump``.
+
+Como "sixth.pcap" é um arquivo pcap, você pode visualizar usando o ``tcpdump`` ou ``wireshark``.
+
+::
+
+  reading from file ../../sixth.pcap, link-type PPP (PPP)
+  1.251507 IP 10.1.1.1.49153 > 10.1.1.2.8080: . 17689:18225(536) ack 1 win 65535
+  1.411478 IP 10.1.1.1.49153 > 10.1.1.2.8080: . 33808:34312(504) ack 1 win 65535
+  ...
+  7.393557 IP 10.1.1.1.49153 > 10.1.1.2.8080: . 781568:782072(504) ack 1 win 65535
+  8.141483 IP 10.1.1.1.49153 > 10.1.1.2.8080: . 874632:875168(536) ack 1 win 65535
+
+..
+	You have a pcap file with the packets that were dropped in the simulation.  There
+	are no other packets present in the file and there is nothing else present to
+	make life difficult.
+
+Você tem um arquivo pcap com os pacotes que foram descartados na simulação. Não há nenhum outro pacote presente no arquivo e nada mais para dificultar sua análise.
+
+..
+	It's been a long journey, but we are now at a point where we can appreciate the
+	|ns3| tracing system.  We have pulled important events out of the middle
+	of a TCP implementation and a device driver.  We stored those events directly in
+	files usable with commonly known tools.  We did this without modifying any of the
+	core code involved, and we did this in only 18 lines of code:
+
+Foi uma longa jornada, mas agora entendemos porque o sistema de rastreamento é interessante. Nós obtemos e armazenamos importantes eventos da implementação do TCP e do `driver` de dispositivo. E não modificamos nenhuma linha do código do núcleo do |ns3|, e ainda fizemos isso com apenas 18 linhas de código:
+
+::
+
+  static void
+  CwndChange (Ptr<OutputStreamWrapper> stream, uint32_t oldCwnd, uint32_t newCwnd)
+  {
+    NS_LOG_UNCOND (Simulator::Now ().GetSeconds () << "\t" << newCwnd);
+    *stream->GetStream () << Simulator::Now ().GetSeconds () << "\t" << 
+    		oldCwnd << "\t" << newCwnd << std::endl;
+  }
+
+  ...
+
+  AsciiTraceHelper asciiTraceHelper;
+  Ptr<OutputStreamWrapper> stream = asciiTraceHelper.CreateFileStream ("sixth.cwnd");
+  ns3TcpSocket->TraceConnectWithoutContext ("CongestionWindow", 
+  		MakeBoundCallback (&CwndChange, stream));
+
+  ...
+
+  static void
+  RxDrop (Ptr<PcapFileWrapper> file, Ptr<const Packet> p)
+  {
+    NS_LOG_UNCOND ("RxDrop at " << Simulator::Now ().GetSeconds ());
+    file->Write(Simulator::Now(), p);
+  }
+
+  ...
+  
+  PcapHelper pcapHelper;
+  Ptr<PcapFileWrapper> file = pcapHelper.CreateFile ("sixth.pcap", "w", 
+  		PcapHelper::DLT_PPP);
+  devices.Get (1)->TraceConnectWithoutContext("PhyRxDrop", 
+  		MakeBoundCallback (&RxDrop, file));
+
+.. 
+	Using Trace Helpers
+
+Usando Classes Assistentes para Rastreamento
+********************************************
+
+..
+	The |ns3| trace helpers provide a rich environment for configuring and
+	selecting different trace events and writing them to files.  In previous
+	sections, primarily "Building Topologies," we have seen several varieties
+	of the trace helper methods designed for use inside other (device) helpers.
+
+As classes assistentes (*trace helpers*) de rastreamento do |ns3| proveem um ambiente rico para configurar, selecionar e escrever diferentes eventos de rastreamento para arquivos. Nas seções anteriores, primeiramente em "Construindo Topologias", nós vimos diversas formas de métodos assistentes para rastreamento projetados para uso dentro de outras classes assistentes.
+
+..
+	Perhaps you will recall seeing some of these variations: 
+
+Segue alguns desses métodos já estudados:
+
+::
+
+  pointToPoint.EnablePcapAll ("second");
+  pointToPoint.EnablePcap ("second", p2pNodes.Get (0)->GetId (), 0);
+  csma.EnablePcap ("third", csmaDevices.Get (0), true);
+  pointToPoint.EnableAsciiAll (ascii.CreateFileStream ("myfirst.tr"));
+
+..
+	What may not be obvious, though, is that there is a consistent model for all of 
+	the trace-related methods found in the system.  We will now take a little time
+	and take a look at the "big picture".
+
+
+O que não parece claro é que há um modelo consistente para todos os métodos relacionados à rastreamento encontrados no sistema. Apresentaremos uma visão geral desse modelo.
+
+..
+	There are currently two primary use cases of the tracing helpers in |ns3|:
+	Device helpers and protocol helpers.  Device helpers look at the problem
+	of specifying which traces should be enabled through a node, device pair.  For 
+	example, you may want to specify that pcap tracing should be enabled on a 
+	particular device on a specific node.  This follows from the |ns3| device
+	conceptual model, and also the conceptual models of the various device helpers.
+	Following naturally from this, the files created follow a 
+	<prefix>-<node>-<device> naming convention.  
+
+Há dois casos de uso primários de classes assistentes em |ns3|: Classes assistentes de dispositivo e classes assistentes de protocolo. Classes assistentes de dispositivo tratam o problema de especificar quais rastreamentos deveriam ser habilitados no domínio do nó de rede. Por exemplo, poderíamos querer especificar que o rastreamento pcap deveria ser ativado em um dispositivo particular de um nó específico. Isto é o que define o modelo conceitual de dispositivo no |ns3| e também os modelos conceituais de várias classes assistentes de dispositivos. Baseado nisso, os arquivos criados seguem a convenção de nome `<prefixo>-<nó>-<dispositivo>`.
+
+..
+	Protocol helpers look at the problem of specifying which traces should be
+	enabled through a protocol and interface pair.  This follows from the |ns3|
+	protocol stack conceptual model, and also the conceptual models of internet
+	stack helpers.  Naturally, the trace files should follow a 
+	<prefix>-<protocol>-<interface> naming convention.
+
+As classes assistentes de protocolos tratam o problema de especificar quais rastreamentos deveriam ser ativados no protocolo e interface. Isto é definido pelo modelo conceitual de pilha de protocolo do |ns3| e também pelos modelos conceituais de classes assistentes de pilha de rede. Baseado nisso, os arquivos criados seguem a convenção de nome `<prefixo>-<protocolo>-<interface>`.
+
+..
+	The trace helpers therefore fall naturally into a two-dimensional taxonomy.
+	There are subtleties that prevent all four classes from behaving identically,
+	but we do strive to make them all work as similarly as possible; and whenever
+	possible there are analogs for all methods in all classes.
+
+As classes assistentes consequentemente encaixam-se em uma taxinomia bi-dimensional. Há pequenos detalhes que evitam todas as classes comportarem-se da mesma forma, mas fizemos parecer que trabalham tão similarmente quanto possível e quase sempre há similares para todos métodos em todas as classes.
+
+::
+
+                                                     | pcap | ascii |
+  ---------------------------------------------------+------+-------|
+  Classe Assistente de Dispositivo (*Device Helper*)   |      |       |
+  ---------------------------------------------------+------+-------|
+  Classe Assistente de Protocolo (*Protocol Helper*)   |      |       |
+  ---------------------------------------------------+------+-------|
+
+..
+	We use an approach called a ``mixin`` to add tracing functionality to our 
+	helper classes.  A ``mixin`` is a class that provides functionality to that
+	is inherited by a subclass.  Inheriting from a mixin is not considered a form 
+	of specialization but is really a way to collect functionality. 
+
+Usamos uma abordagem chamada ``mixin`` para adicionar funcionalidade de rastreamento para nossas classes assistentes. Uma ``mixin`` é uma classe que provê funcionalidade para aquela que é herdada por uma subclasse. Herdar de um ``mixin`` não é considerado uma forma de especialização mas é realmente uma maneira de colecionar funcionalidade.
+
+..
+	Let's take a quick look at all four of these cases and their respective 
+	``mixins``.
+
+Vamos verificar rapidamente os quatro casos e seus respectivos ``mixins``.
+
+.. 
+	Pcap Tracing Device Helpers
+
+Classes Assistentes de Dispositivo para Rastreamento Pcap
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+
+..
+	The goal of these helpers is to make it easy to add a consistent pcap trace
+	facility to an |ns3| device.  We want all of the various flavors of
+	pcap tracing to work the same across all devices, so the methods of these 
+	helpers are inherited by device helpers.  Take a look at 
+	``src/network/helper/trace-helper.h`` if you want to follow the discussion while 
+	looking at real code.
+
+O objetivo destes assistentes é simplificar a adição de um utilitário de rastreamento pcap consistente para um dispositivo |ns3|. Queremos que opere da mesma forma entre todos os dispositivos, logo os métodos destes assistentes são herdados por classes assistentes de dispositivo. Observe o arquivo ``src/network/helper/trace-helper.h`` para entender a discussão do código a seguir.
+
+..
+	The class ``PcapHelperForDevice`` is a ``mixin`` provides the high level 
+	functionality for using pcap tracing in an |ns3| device.  Every device 
+	must implement a single virtual method inherited from this class.
+
+A classe ``PcapHelperForDevice`` é um ``mixin`` que provê a funcionalidade de alto nível para usar rastreamento pcap em um dispositivo |ns3|. Todo dispositivo deve implementar um único método virtual herdado dessa classe.
+
+::
+
+  virtual void EnablePcapInternal (std::string prefix, Ptr<NetDevice> nd, 
+  		bool promiscuous, bool explicitFilename) = 0;
+
+..
+	The signature of this method reflects the device-centric view of the situation
+	at this level.  All of the public methods inherited from class 
+	``PcapUserHelperForDevice`` reduce to calling this single device-dependent
+	implementation method.  For example, the lowest level pcap method,
+
+A assinatura deste método reflete a visão do dispositivo da situação neste nível. Todos os métodos públicos herdados da classe ``PcapUserHelperForDevice`` são reduzidos a chamada da implementação deste simples método dependente de dispositivo. Por exemplo, o nível mais baixo do método pcap,
+
+::
+
+  void EnablePcap (std::string prefix, Ptr<NetDevice> nd, bool promiscuous = false, 
+  		bool explicitFilename = false);
+
+..
+	will call the device implementation of ``EnablePcapInternal`` directly.  All
+	other public pcap tracing methods build on this implementation to provide 
+	additional user-level functionality.  What this means to the user is that all 
+	device helpers in the system will have all of the pcap trace methods available;
+	and these methods will all work in the same way across devices if the device 
+	implements ``EnablePcapInternal`` correctly.
+
+chamaremos diretamente a implementação do dispositivo de ``EnablePcapInternal``. Todos os outros métodos de rastreamento pcap públicos desta implementação são para prover funcionalidade adicional em nível de usuário. Para o usuário, isto significa que todas as classes assistentes de dispositivo no sistema terão todos os métodos de rastreamento pcap disponíveis; e estes métodos trabalharão da mesma forma entre dispositivos se o dispositivo implementar corretamente ``EnablePcapInternal``.
+
+.. 
+	Pcap Tracing Device Helper Methods
+
+Métodos da Classe Assistente de Dispositivo para Rastreamento Pcap
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+::
+
+  void EnablePcap (std::string prefix, Ptr<NetDevice> nd, 
+  		bool promiscuous = false, bool explicitFilename = false);
+  void EnablePcap (std::string prefix, std::string ndName, 
+  		bool promiscuous = false, bool explicitFilename = false);
+  void EnablePcap (std::string prefix, NetDeviceContainer d, 
+  		bool promiscuous = false);
+  void EnablePcap (std::string prefix, NodeContainer n, 
+  		bool promiscuous = false);
+  void EnablePcap (std::string prefix, uint32_t nodeid, uint32_t deviceid, 
+  		bool promiscuous = false);
+  void EnablePcapAll (std::string prefix, bool promiscuous = false);
+
+..
+	In each of the methods shown above, there is a default parameter called 
+	``promiscuous`` that defaults to false.  This parameter indicates that the
+	trace should not be gathered in promiscuous mode.  If you do want your traces
+	to include all traffic seen by the device (and if the device supports a 
+	promiscuous mode) simply add a true parameter to any of the calls above.  For example,
+
+Em cada método apresentado existe um parâmetro padrão chamado ``promiscuous`` que é definido para o valor "false". Este parâmetro indica que o rastreamento não deveria coletar dados em modo promíscuo. Se quisermos incluir todo tráfego visto pelo dispositivo devemos modificar o valor para "true". Por exemplo,
+
+::
+
+  Ptr<NetDevice> nd;
+  ...
+  helper.EnablePcap ("prefix", nd, true);
+
+..
+	will enable promiscuous mode captures on the ``NetDevice`` specified by ``nd``.
+
+ativará o modo de captura promíscuo no ``NetDevice`` especificado por ``nd``.
+
+..
+	The first two methods also include a default parameter called ``explicitFilename``
+	that will be discussed below.
+
+Os  dois primeiros métodos também incluem um parâmetro padrão chamado ``explicitFilename`` que será abordado a seguir.
+
+..
+	You are encouraged to peruse the Doxygen for class ``PcapHelperForDevice``
+	to find the details of these methods; but to summarize ...
+
+É interessante procurar maiores detalhes dos métodos da classe ``PcapHelperForDevice`` no Doxygen; mas para resumir ...
+
+..
+	You can enable pcap tracing on a particular node/net-device pair by providing a
+	``Ptr<NetDevice>`` to an ``EnablePcap`` method.  The ``Ptr<Node>`` is 
+	implicit since the net device must belong to exactly one ``Node``.
+	For example, 
+
+Podemos ativar o rastreamento pcap em um par nó/dispositivo-rede específico provendo um ``Ptr<NetDevice>`` para um método ``EnablePcap``. O ``Ptr<Node>`` é implícito, pois o dispositivo de rede deve estar em um ``Node``. Por exemplo,
+
+::
+
+  Ptr<NetDevice> nd;
+  ...
+  helper.EnablePcap ("prefix", nd);
+
+..
+	You can enable pcap tracing on a particular node/net-device pair by providing a
+	``std::string`` representing an object name service string to an 
+	``EnablePcap`` method.  The ``Ptr<NetDevice>`` is looked up from the name
+	string.  Again, the ``<Node>`` is implicit since the named net device must 
+	belong to exactly one ``Node``.  For example, 
+
+Podemos ativar o rastreamento pcap em um par nó/dispositivo-rede passando uma ``std::string`` que representa um nome de serviço para um método ``EnablePcap``. O ``Ptr<NetDevice>`` é buscado a partir do nome da `string`.
+Novamente, o ``Ptr<Node>`` é implícito pois o dispositivo de rede deve estar em um ``Node``. 
+
+::
+
+  Names::Add ("server" ...);
+  Names::Add ("server/eth0" ...);
+  ...
+  helper.EnablePcap ("prefix", "server/eth0");
+
+..
+	You can enable pcap tracing on a collection of node/net-device pairs by 
+	providing a ``NetDeviceContainer``.  For each ``NetDevice`` in the container
+	the type is checked.  For each device of the proper type (the same type as is 
+	managed by the device helper), tracing is enabled.    Again, the ``<Node>`` is 
+	implicit since the found net device must belong to exactly one ``Node``.
+	For example, 
+
+Podemos ativar o rastreamento pcap em uma coleção de pares nós/dispositivos usando um ``NetDeviceContainer``. Para cada ``NetDevice`` no contêiner o tipo é verificado. Para cada dispositivo com o tipo adequado, o rastreamento será ativado. Por exemplo,
+
+::
+
+  NetDeviceContainer d = ...;
+  ...
+  helper.EnablePcap ("prefix", d);
+
+..
+	You can enable pcap tracing on a collection of node/net-device pairs by 
+	providing a ``NodeContainer``.  For each ``Node`` in the ``NodeContainer``
+	its attached ``NetDevices`` are iterated.  For each ``NetDevice`` attached
+	to each node in the container, the type of that device is checked.  For each 
+	device of the proper type (the same type as is managed by the device helper), 
+	tracing is enabled.
+
+Podemos ativar o rastreamento em uma coleção de pares nó/dispositivo-rede usando um ``NodeContainer``. Para cada ``Node`` no ``NodeContainer`` seus ``NetDevices`` são percorridos e verificados segundo o tipo. Para cada dispositivo com o tipo adequado, o rastreamento é ativado.
+
+::
+
+  NodeContainer n;
+  ...
+  helper.EnablePcap ("prefix", n);
+
+..
+	You can enable pcap tracing on the basis of node ID and device ID as well as
+	with explicit ``Ptr``.  Each ``Node`` in the system has an integer node ID
+	and each device connected to a node has an integer device ID.
+
+Podemos ativar o rastreamento pcap usando o número identificador (`ID`) do nó e do dispositivo. Todo ``Node`` no sistema tem um valor inteiro indicando o `ID` do nó e todo dispositivo conectado ao nó tem um valor inteiro indicando o `ID` do dispositivo.
+
+::
+
+  helper.EnablePcap ("prefix", 21, 1);
+
+..
+	Finally, you can enable pcap tracing for all devices in the system, with the
+	same type as that managed by the device helper.
+
+Por fim, podemos ativar rastreamento pcap para todos os dispositivos no sistema, desde que o tipo seja o mesmo gerenciado pela classe assistentes de dispositivo.
+
+::
+
+  helper.EnablePcapAll ("prefix");
+
+.. 
+	Pcap Tracing Device Helper Filename Selection
+
+Seleção de um Nome de Arquivo para o Rastreamento Pcap da Classe Assistente de Dispositivo
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+..
+	Implicit in the method descriptions above is the construction of a complete 
+	filename by the implementation method.  By convention, pcap traces in the 
+	|ns3| system are of the form "<prefix>-<node id>-<device id>.pcap"
+
+Implícito nas descrições de métodos anteriores é a construção do nome de arquivo por meio do método da implementação. Por convenção, rastreamento pcap no |ns3| usa a forma "<prefixo>-<id do nó>-<id do dispositivo>.pcap"
+
+..
+	As previously mentioned, every node in the system will have a system-assigned
+	node id; and every device will have an interface index (also called a device id)
+	relative to its node.  By default, then, a pcap trace file created as a result
+	of enabling tracing on the first device of node 21 using the prefix "prefix"
+	would be "prefix-21-1.pcap".
+	
+Como mencionado, todo nó no sistema terá um `id` de nó associado; e todo dispositivo terá um índice de interface (também chamado de id do dispositivo) relativo ao seu nó. Por padrão, então, um arquivo pcap criado como um resultado de ativar rastreamento no primeiro dispositivo do nó 21 usando o prefixo "prefix" seria "prefix-21-1.pcap".
+
+..
+	You can always use the |ns3| object name service to make this more clear.
+	For example, if you use the object name service to assign the name "server"
+	to node 21, the resulting pcap trace file name will automatically become,
+	"prefix-server-1.pcap" and if you also assign the name "eth0" to the 
+	device, your pcap file name will automatically pick this up and be called
+	"prefix-server-eth0.pcap".
+
+Sempre podemos usar o serviço de nome de objeto do |ns3| para tornar isso mais claro. Por exemplo, se você usa o serviço para associar o nome "server" ao nó 21, o arquivo pcap resultante automaticamente será, "prefix-server-1.pcap" e se você também associar o nome "eth0" ao dispositivo, seu nome do arquivo pcap automaticamente será denominado "prefix-server-eth0.pcap".
+
+.. 
+	Finally, two of the methods shown above,
+
+Finalmente, dois dos métodos mostrados, 
+
+::
+
+  void EnablePcap (std::string prefix, Ptr<NetDevice> nd, 
+  		bool promiscuous = false, bool explicitFilename = false);
+  void EnablePcap (std::string prefix, std::string ndName, 
+  		bool promiscuous = false, bool explicitFilename = false);
+
+..
+	have a default parameter called ``explicitFilename``.  When set to true,
+	this parameter disables the automatic filename completion mechanism and allows
+	you to create an explicit filename.  This option is only available in the 
+	methods which enable pcap tracing on a single device.  
+
+tem um parâmetro padrão ``explicitFilename``. Quando modificado para verdadeiro, este parâmetro desabilita o mecanismo automático de completar o nome do arquivo e permite criarmos um nome de arquivo abertamente. Esta opção está disponível nos métodos que ativam o rastreamento pcap em um único dispositivo.
+
+..
+	For example, in order to arrange for a device helper to create a single 
+	promiscuous pcap capture file of a specific name ("my-pcap-file.pcap") on a
+	given device, one could:
+
+Por exemplo, com a finalidade providenciar uma classe assistente de dispositivo para criar um único arquivo de captura pcap no modo promíscuo com um nome específico ("my-pcap-file.pcap") em um determinado dispositivo:
+	
+::
+
+  Ptr<NetDevice> nd;
+  ...
+  helper.EnablePcap ("my-pcap-file.pcap", nd, true, true);
+
+..
+	The first ``true`` parameter enables promiscuous mode traces and the second
+	tells the helper to interpret the ``prefix`` parameter as a complete filename.
+
+O primeiro parâmetro ``true`` habilita o modo de rastreamento promíscuo e o segundo faz com que o parâmetro ``prefix`` seja interpretado como um nome de arquivo completo.
+
+.. 
+	Ascii Tracing Device Helpers
+
+Classes Assistentes de Dispositivo para Rastreamento ASCII
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+
+..
+	The behavior of the ascii trace helper ``mixin`` is substantially similar to 
+	the pcap version.  Take a look at ``src/network/helper/trace-helper.h`` if you want to 
+	follow the discussion while looking at real code.
+
+O comportamento do assistente  de rastreamento ASCII ``mixin`` é similar a versão do pcap. Acesse o arquivo ``src/network/helper/trace-helper.h`` para compreender melhor o funcionamento dessa classe assistente.
+
+..
+	The class ``AsciiTraceHelperForDevice`` adds the high level functionality for 
+	using ascii tracing to a device helper class.  As in the pcap case, every device
+	must implement a single virtual method inherited from the ascii trace ``mixin``.
+
+A classe ``AsciiTraceHelperForDevice`` adiciona funcionalidade em alto nível para usar o rastreamento ASCII para uma classe assistente de dispositivo. Como no caso do pcap, todo dispositivo deve implementar um método herdado do rastreador ASCII ``mixin``.
+
+::
+
+  virtual void EnableAsciiInternal (Ptr<OutputStreamWrapper> stream,
+		std::string prefix, Ptr<NetDevice> nd, bool explicitFilename) = 0;
+
+..
+	The signature of this method reflects the device-centric view of the situation
+	at this level; and also the fact that the helper may be writing to a shared
+	output stream.  All of the public ascii-trace-related methods inherited from 
+	class ``AsciiTraceHelperForDevice`` reduce to calling this single device-
+	dependent implementation method.  For example, the lowest level ascii trace
+	methods,
+
+A assinatura deste método reflete a visão do dispositivo da situação neste nível; e também o fato que o assistente pode ser escrito para um fluxo de saída compartilhado. Todos os métodos públicos associados ao rastreamento ASCII herdam da classe ``AsciiTraceHelperForDevice`` resumem-se a chamada deste único método dependente de implementação. Por exemplo, os métodos de rastreamento ASCII de mais baixo nível,
+
+::
+
+  void EnableAscii (std::string prefix, Ptr<NetDevice> nd, 
+  		bool explicitFilename = false);
+  void EnableAscii (Ptr<OutputStreamWrapper> stream, Ptr<NetDevice> nd);
+
+.. 
+	will call the device implementation of ``EnableAsciiInternal`` directly,
+	providing either a valid prefix or stream.  All other public ascii tracing 
+	methods will build on these low-level functions to provide additional user-level
+	functionality.  What this means to the user is that all device helpers in the 
+	system will have all of the ascii trace methods available; and these methods
+	will all work in the same way across devices if the devices implement 
+	``EnablAsciiInternal`` correctly.
+
+chamarão uma implementação de ``EnableAsciiInternal`` diretamente, passando um prefixo ou fluxo válido. Todos os outros métodos públicos serão construídos a partir destas funções de baixo nível para fornecer funcionalidades adicionais em nível de usuário. Para o usuário, isso significa que todos os assistentes de
+dispositivo no sistema terão todos os métodos de rastreamento ASCII disponíveis e estes métodos trabalharão do mesmo modo em todos os dispositivos se estes implementarem ``EnableAsciiInternal``.
+
+.. 
+	Ascii Tracing Device Helper Methods
+
+Métodos da Classe Assistente de Dispositivo para Rastreamento  ASCII
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+::
+
+  void EnableAscii (std::string prefix, Ptr<NetDevice> nd, 
+  		bool explicitFilename = false);
+  void EnableAscii (Ptr<OutputStreamWrapper> stream, Ptr<NetDevice> nd);
+
+  void EnableAscii (std::string prefix, std::string ndName, 
+  		bool explicitFilename = false);
+  void EnableAscii (Ptr<OutputStreamWrapper> stream, std::string ndName);
+
+  void EnableAscii (std::string prefix, NetDeviceContainer d);
+  void EnableAscii (Ptr<OutputStreamWrapper> stream, NetDeviceContainer d);
+
+  void EnableAscii (std::string prefix, NodeContainer n);
+  void EnableAscii (Ptr<OutputStreamWrapper> stream, NodeContainer n);
+
+  void EnableAsciiAll (std::string prefix);
+  void EnableAsciiAll (Ptr<OutputStreamWrapper> stream);
+
+  void EnableAscii (std::string prefix, uint32_t nodeid, uint32_t deviceid, 
+  		bool explicitFilename);
+  void EnableAscii (Ptr<OutputStreamWrapper> stream, uint32_t nodeid, 
+  		uint32_t deviceid);
+
+..
+	You are encouraged to peruse the Doxygen for class ``TraceHelperForDevice``
+	to find the details of these methods; but to summarize ...
+
+Para maiores detalhes sobre os métodos é interessante consultar a documentação para a classe ``TraceHelperForDevice``; mas para resumir ...
+
+..
+	There are twice as many methods available for ascii tracing as there were for
+	pcap tracing.  This is because, in addition to the pcap-style model where traces
+	from each unique node/device pair are written to a unique file, we support a model
+	in which trace information for many node/device pairs is written to a common file.
+	This means that the <prefix>-<node>-<device> file name generation mechanism is 
+	replaced by a mechanism to refer to a common file; and the number of API methods
+	is doubled to allow all combinations.
+
+Há duas vezes mais métodos disponíveis para rastreamento ASCII que para rastreamento pcap. Isto ocorre pois para o modelo pcap os rastreamentos de cada par nó/dispositivo-rede são escritos para um único arquivo, enquanto que no ASCII todo as as informações são escritas para um arquivo comum. Isto significa que o mecanismo de geração de nomes de arquivos `<prefixo>-<nó>-<dispositivo>` é substituído por um mecanismo para referenciar um arquivo comum; e o número de métodos da API é duplicado para permitir todas as combinações.
+
+..
+	Just as in pcap tracing, you can enable ascii tracing on a particular 
+	node/net-device pair by providing a ``Ptr<NetDevice>`` to an ``EnableAscii``
+	method.  The ``Ptr<Node>`` is implicit since the net device must belong to 
+	exactly one ``Node``.  For example, 
+
+Assim como no rastreamento pcap, podemos ativar o rastreamento ASCII em um par nó/dispositivo-rede passando um ``Ptr<NetDevice>`` para  um método ``EnableAscii``. O ``Ptr<Node>`` é implícito pois o dispositivo de rede deve pertencer a exatamente um ``Node``. Por exemplo,
+
+::
+
+  Ptr<NetDevice> nd;
+  ...
+  helper.EnableAscii ("prefix", nd);
+
+..
+	The first four methods also include a default parameter called ``explicitFilename``
+	that operate similar to equivalent parameters in the pcap case.
+
+Os primeiros quatro métodos também incluem um parâmetro padrão ``explicitFilename`` que opera similar aos parâmetros no caso do pcap.
+
+..
+	In this case, no trace contexts are written to the ascii trace file since they
+	would be redundant.  The system will pick the file name to be created using
+	the same rules as described in the pcap section, except that the file will
+	have the suffix ".tr" instead of ".pcap".
+
+Neste caso, nenhum contexto de rastreamento é escrito para o arquivo ASCII pois seriam redundantes. O sistema pegará o nome do arquivo para ser criado usando as mesmas regras como descritas na seção pcap, exceto que o arquivo terá o extensão ".tr" ao invés de ".pcap".
+
+..
+	If you want to enable ascii tracing on more than one net device and have all 
+	traces sent to a single file, you can do that as well by using an object to
+	refer to a single file.  We have already seen this in the "cwnd" example
+	above:
+
+Para habilitar o rastreamento ASCII em mais de um dispositivo de rede e ter todos os dados de rastreamento enviados para um único arquivo, pode-se usar um objeto para referenciar um único arquivo. Nós já verificamos isso no exemplo "cwnd":
+
+::
+
+  Ptr<NetDevice> nd1;
+  Ptr<NetDevice> nd2;
+  ...
+  Ptr<OutputStreamWrapper> stream = asciiTraceHelper.CreateFileStream 
+  		("trace-file-name.tr");
+  ...
+  helper.EnableAscii (stream, nd1);
+  helper.EnableAscii (stream, nd2);
+
+..
+	In this case, trace contexts are written to the ascii trace file since they
+	are required to disambiguate traces from the two devices.  Note that since the
+	user is completely specifying the file name, the string should include the ",tr"
+	for consistency.
+
+Neste caso, os contextos são escritos para o arquivo ASCII quando é necessário distinguir os dados de rastreamento de dois dispositivos. É interessante usar no nome do arquivo a extensão ".tr" por motivos de consistência.
+
+..
+	You can enable ascii tracing on a particular node/net-device pair by providing a
+	``std::string`` representing an object name service string to an 
+	``EnablePcap`` method.  The ``Ptr<NetDevice>`` is looked up from the name
+	string.  Again, the ``<Node>`` is implicit since the named net device must 
+	belong to exactly one ``Node``.  For example, 
+
+Podemos habilitar o rastreamento ASCII em um par nó/dispositivo-rede específico passando ao método ``EnableAscii`` uma ``std::string`` representando um nome no serviço de nomes de objetos. O ``Ptr<NetDevice>`` é obtido a partir do nome. Novamente, o ``<Node>`` é implícito pois o dispositivo de rede deve pertencer a exatamente um ``Node``. Por exemplo,
+
+::
+
+  Names::Add ("client" ...);
+  Names::Add ("client/eth0" ...);
+  Names::Add ("server" ...);
+  Names::Add ("server/eth0" ...);
+  ...
+  helper.EnableAscii ("prefix", "client/eth0");
+  helper.EnableAscii ("prefix", "server/eth0");
+
+..
+	This would result in two files named "prefix-client-eth0.tr" and 
+	"prefix-server-eth0.tr" with traces for each device in the respective trace
+	file.  Since all of the EnableAscii functions are overloaded to take a stream wrapper,
+	you can use that form as well:
+
+Isto resultaria em dois nomes de arquivos - "prefix-client-eth0.tr" e "prefix-server-eth0.tr" - com os rastreamentos de cada dispositivo em  seu arquivo respectivo. Como todas as funções do ``EnableAscii`` são sobrecarregadas para suportar um *stream wrapper*, podemos usar da seguinte forma também:
+
+::
+
+  Names::Add ("client" ...);
+  Names::Add ("client/eth0" ...);
+  Names::Add ("server" ...);
+  Names::Add ("server/eth0" ...);
+  ...
+  Ptr<OutputStreamWrapper> stream = asciiTraceHelper.CreateFileStream 
+  		("trace-file-name.tr");
+  ...
+  helper.EnableAscii (stream, "client/eth0");
+  helper.EnableAscii (stream, "server/eth0");
+
+..
+	This would result in a single trace file called "trace-file-name.tr" that 
+	contains all of the trace events for both devices.  The events would be 
+	disambiguated by trace context strings.
+
+Isto resultaria em um único arquivo chamado "trace-file-name.tr" que contém todosos eventos rastreados para ambos os dispositivos. Os eventos seriam diferenciados por `strings` de contexto.
+
+..
+	You can enable ascii tracing on a collection of node/net-device pairs by 
+	providing a ``NetDeviceContainer``.  For each ``NetDevice`` in the container
+	the type is checked.  For each device of the proper type (the same type as is 
+	managed by the device helper), tracing is enabled.    Again, the ``<Node>`` is 
+	implicit since the found net device must belong to exactly one ``Node``.
+	For example, 
+
+Podemos habilitar o rastreamento ASCII em um coleção de pares nó/dispositivo-rede fornecendo um ``NetDeviceContainer``. Para cada ``NetDevice`` no contêiner o tipo é verificado. Para cada dispositivo de um tipo adequado (o mesmo tipo que é gerenciado por uma classe assistente de dispositivo), o rastreamento é habilitado. Novamente, o ``<Node>`` é implícito pois o dispositivo de rede encontrado deve pertencer a exatamente um ``Node``. 
+
+::
+
+  NetDeviceContainer d = ...;
+  ...
+  helper.EnableAscii ("prefix", d);
+
+..
+	This would result in a number of ascii trace files being created, each of which
+	follows the <prefix>-<node id>-<device id>.tr convention.  Combining all of the
+	traces into a single file is accomplished similarly to the examples above:
+
+Isto resultaria em vários arquivos de rastreamento ASCII sendo criados, cada um seguindo a convenção ``<prefixo>-<id do nó>-<id do dispositivo>.tr``.
+
+Para obtermos um único arquivo teríamos:
+
+::
+
+  NetDeviceContainer d = ...;
+  ...
+  Ptr<OutputStreamWrapper> stream = asciiTraceHelper.CreateFileStream 
+  		("trace-file-name.tr");
+  ...
+  helper.EnableAscii (stream, d);
+
+..
+	You can enable ascii tracing on a collection of node/net-device pairs by 
+	providing a ``NodeContainer``.  For each ``Node`` in the ``NodeContainer``
+	its attached ``NetDevices`` are iterated.  For each ``NetDevice`` attached
+	to each node in the container, the type of that device is checked.  For each 
+	device of the proper type (the same type as is managed by the device helper), 
+	tracing is enabled.
+
+Podemos habilitar o rastreamento ASCII em um coleção de pares nó/dispositivo-rede fornecendo um ``NodeContainer``. Para cada ``Node`` no ``NodeContainer``, os seus ``NetDevices`` são percorridos. Para cada ``NetDevice`` associado a cada nó no contêiner, o tipo do dispositivo é verificado. Para cada dispositivo do tipo adequado (o mesmo tipo que é gerenciado pelo assistente de dispositivo), o rastreamento é habilitado.
+
+::
+
+  NodeContainer n;
+  ...
+  helper.EnableAscii ("prefix", n);
+
+..
+	This would result in a number of ascii trace files being created, each of which
+	follows the <prefix>-<node id>-<device id>.tr convention.  Combining all of the
+	traces into a single file is accomplished similarly to the examples above:
+		
+Isto resultaria em vários arquivos ASCII sendo criados, cada um seguindo a convenção ``<prefixo>-<id do nó>-<id do dispositivo>.tr``.
+
+..
+	You can enable pcap tracing on the basis of node ID and device ID as well as
+	with explicit ``Ptr``.  Each ``Node`` in the system has an integer node ID
+	and each device connected to a node has an integer device ID.
+	
+Podemos habilitar o rastreamento pcap na base da `ID` do nó e `ID` do dispositivo tão bem como com um ``Ptr``. Cada ``Node`` no sistema possui um número identificador inteiro associado ao nó e cada dispositivo conectado possui um número identificador inteiro associado ao dispositivo.
+
+::
+
+  helper.EnableAscii ("prefix", 21, 1);
+
+..
+	Of course, the traces can be combined into a single file as shown above.
+
+Os rastreamentos podem ser combinados em um único arquivo como mostrado acima.
+
+..
+	Finally, you can enable pcap tracing for all devices in the system, with the
+	same type as that managed by the device helper.
+
+Finalmente, podemos habilitar o rastreamento ASCII para todos os dispositivos no sistema.
+
+::
+
+  helper.EnableAsciiAll ("prefix");
+
+..
+	This would result in a number of ascii trace files being created, one for
+	every device in the system of the type managed by the helper.  All of these
+	files will follow the <prefix>-<node id>-<device id>.tr convention.  Combining
+	all of the traces into a single file is accomplished similarly to the examples
+	above.
+
+Isto resultaria em vários arquivos ASCII sendo criados, um para cada dispositivo no sistema do tipo gerenciado pelo assistente. Todos estes arquivos seguiriam a convenção ``<prefixo>-<id do nó>-<id do dispositivo>.tr``.
+
+.. 
+	Ascii Tracing Device Helper Filename Selection
+
+Selecionando Nome de Arquivo para as Saídas ASCII
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+..
+	Implicit in the prefix-style method descriptions above is the construction of the
+	complete filenames by the implementation method.  By convention, ascii traces
+	in the |ns3| system are of the form "<prefix>-<node id>-<device id>.tr"
+
+Implícito nas descrições de métodos anteriores é a construção do nome de arquivo por meio do método da implementação. Por convenção, rastreamento ASCII no |ns3| usa a forma "``<prefixo>-<id do nó>-<id do dispositivo>.tr``".
+
+..
+	As previously mentioned, every node in the system will have a system-assigned
+	node id; and every device will have an interface index (also called a device id)
+	relative to its node.  By default, then, an ascii trace file created as a result
+	of enabling tracing on the first device of node 21, using the prefix "prefix",
+	would be "prefix-21-1.tr".
+
+Como mencionado, todo nó no sistema terá um `id` de nó associado; e todo dispositivo terá um índice de interface (também chamado de id do dispositivo) relativo ao seu nó. Por padrão, então, um arquivo ASCII criado como um resultado de ativar rastreamento no primeiro dispositivo do nó 21 usando o prefixo "prefix" seria "prefix-21-1.tr".
+
+..
+	You can always use the |ns3| object name service to make this more clear.
+	For example, if you use the object name service to assign the name "server"
+	to node 21, the resulting ascii trace file name will automatically become,
+	"prefix-server-1.tr" and if you also assign the name "eth0" to the 
+	device, your ascii trace file name will automatically pick this up and be called
+	"prefix-server-eth0.tr".
+
+Sempre podemos usar o serviço de nome de objeto do |ns3| para tornar isso mais claro. Por exemplo, se usarmos o serviço para associar o nome ``server`` ao nó 21, o arquivo ASCII resultante automaticamente será, ``prefix-server-1.tr`` e se também associarmos o nome ``eth0`` ao dispositivo, o nome do arquivo ASCII automaticamente será denominado ``prefix-server-eth0.tr``.
+
+..
+	Several of the methods have a default parameter called ``explicitFilename``.
+	When set to true, this parameter disables the automatic filename completion 
+	mechanism and allows you to create an explicit filename.  This option is only
+	available in the methods which take a prefix and enable tracing on a single device.  
+	
+Diversos métodos tem um parâmetro padrão ``explicitFilename``. Quando modificado para verdadeiro, este parâmetro desabilita o mecanismo automático de completar o nome do arquivo e permite criarmos um nome de arquivo abertamente. Esta opção está disponível nos métodos que possuam um prefixo e ativem o rastreamento em um único dispositivo.
+
+.. 
+	Pcap Tracing Protocol Helpers
+
+Classes Assistentes de Protocolo para Rastreamento Pcap
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+
+..
+	The goal of these ``mixins`` is to make it easy to add a consistent pcap trace
+	facility to protocols.  We want all of the various flavors of pcap tracing to 
+	work the same across all protocols, so the methods of these helpers are 
+	inherited by stack helpers.  Take a look at ``src/network/helper/trace-helper.h``
+	if you want to follow the discussion while looking at real code.
+
+O objetivo destes ``mixins`` é facilitar a adição de um mecanismo consistente para da facilidade de rastreamento para protocolos. Queremos que todos os mecanismos de rastreamento para todos os protocolos operem de mesma forma, logo os métodos dessas classe assistentes são herdados por assistentes de pilha. Acesse ``src/network/helper/trace-helper.h`` para acompanhar o conteúdo discutido nesta seção.
+
+..
+	In this section we will be illustrating the methods as applied to the protocol
+	``Ipv4``.  To specify traces in similar protocols, just substitute the
+	appropriate type.  For example, use a ``Ptr<Ipv6>`` instead of a
+	``Ptr<Ipv4>`` and call ``EnablePcapIpv6`` instead of ``EnablePcapIpv4``.
+
+Nesta seção ilustraremos os métodos aplicados ao protocolo ``Ipv4``. Para especificar rastreamentos em protocolos similares, basta substituir pelo tipo apropriado. Por exemplo, use um ``Ptr<Ipv6>`` ao invés de um ``Ptr<Ipv4>`` e chame um ``EnablePcapIpv6`` ao invés de ``EnablePcapIpv4``.
+
+..
+	The class ``PcapHelperForIpv4`` provides the high level functionality for
+	using pcap tracing in the ``Ipv4`` protocol.  Each protocol helper enabling these
+	methods must implement a single virtual method inherited from this class.  There
+	will be a separate implementation for ``Ipv6``, for example, but the only
+	difference will be in the method names and signatures.  Different method names
+	are required to disambiguate class ``Ipv4`` from ``Ipv6`` which are both 
+	derived from class ``Object``, and methods that share the same signature.
+
+A classe ``PcapHelperForIpv4`` provê funcionalidade de alto nível para usar rastreamento no protocolo ``Ipv4``. Cada classe assistente de protocolo devem implementar um método herdado desta. Haverá uma implementação separada para ``Ipv6``, por exemplo, mas a diferença será apenas nos nomes dos métodos e assinaturas. Nomes de métodos diferentes são necessário para distinguir a classe ``Ipv4`` da ``Ipv6``, pois ambas são derivadas da classe ``Object``, logo os métodos compartilham a mesma assinatura.
+
+::
+
+  virtual void EnablePcapIpv4Internal (std::string prefix, Ptr<Ipv4> ipv4, 
+  		uint32_t interface, bool explicitFilename) = 0;
+
+..
+	The signature of this method reflects the protocol and interface-centric view 
+	of the situation at this level.  All of the public methods inherited from class 
+	``PcapHelperForIpv4`` reduce to calling this single device-dependent
+	implementation method.  For example, the lowest level pcap method,
+
+A assinatura desse método reflete a visão do protocolo e interface da situação neste nível. Todos os métodos herdados da classe ``PcapHelperForIpv4`` resumem-se a chamada deste único método dependente de dispositivo. Por exemplo, o método do pcap de mais baixo nível, 
+
+::
+
+  void EnablePcapIpv4 (std::string prefix, Ptr<Ipv4> ipv4, uint32_t interface, 
+  		bool explicitFilename = false);
+
+..
+	will call the device implementation of ``EnablePcapIpv4Internal`` directly.
+	All other public pcap tracing methods build on this implementation to provide 
+	additional user-level functionality.  What this means to the user is that all 
+	protocol helpers in the system will have all of the pcap trace methods 
+	available; and these methods will all work in the same way across 
+	protocols if the helper implements ``EnablePcapIpv4Internal`` correctly.
+
+chamará a implementação de dispositivo de ``EnablePcapIpv4Internal`` diretamente. Todos os outros métodos públicos de rastreamento pcap  são construídos a partir desta implementação para prover funcionalidades adicionais em nível do usuário. Para o usuário, isto significa que todas as classes assistentes de dispositivo no sistema terão todos os métodos de rastreamento pcap disponíveis; e estes métodos trabalharão da mesma forma entre dispositivos se o dispositivo implementar corretamente ``EnablePcapIpv4Internal``.
+
+
+.. 
+	Pcap Tracing Protocol Helper Methods
+
+Métodos da Classe Assistente de Protocolo para Rastreamento Pcap
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+..
+	These methods are designed to be in one-to-one correspondence with the ``Node``-
+	and ``NetDevice``- centric versions of the device versions.  Instead of
+	``Node`` and ``NetDevice`` pair constraints, we use protocol and interface
+	constraints.
+
+Estes métodos são projetados para terem correspondência de um-para-um com o ``Node`` e ``NetDevice``. Ao invés de restrições de pares ``Node`` e ``NetDevice``, usamos restrições de protocolo e interface.
+
+.. 
+	Note that just like in the device version, there are six methods:
+
+Note que como na versão de dispositivo, há seis métodos:
+
+::
+
+  void EnablePcapIpv4 (std::string prefix, Ptr<Ipv4> ipv4, uint32_t interface, 
+  		bool explicitFilename = false);
+  void EnablePcapIpv4 (std::string prefix, std::string ipv4Name, 
+  		uint32_t interface, bool explicitFilename = false);
+  void EnablePcapIpv4 (std::string prefix, Ipv4InterfaceContainer c);
+  void EnablePcapIpv4 (std::string prefix, NodeContainer n);
+  void EnablePcapIpv4 (std::string prefix, uint32_t nodeid, uint32_t interface, 
+  		bool explicitFilename);
+  void EnablePcapIpv4All (std::string prefix);
+
+..
+	You are encouraged to peruse the Doxygen for class ``PcapHelperForIpv4``
+	to find the details of these methods; but to summarize ...
+
+Para maiores detalhes sobre estes métodos é interessante consultar na documentação da classe ``PcapHelperForIpv4``, mas para resumir ...
+
+..
+	You can enable pcap tracing on a particular protocol/interface pair by providing a
+	``Ptr<Ipv4>`` and ``interface`` to an ``EnablePcap`` method.  For example, 
+
+Podemos habilitar o rastreamento pcap em um par protocolo/interface  passando um ``Ptr<Ipv4>`` e ``interface`` para um método ``EnablePcap``. Por exemplo,
+
+::
+
+  Ptr<Ipv4> ipv4 = node->GetObject<Ipv4> ();
+  ...
+  helper.EnablePcapIpv4 ("prefix", ipv4, 0);
+
+..
+	You can enable pcap tracing on a particular node/net-device pair by providing a
+	``std::string`` representing an object name service string to an 
+	``EnablePcap`` method.  The ``Ptr<Ipv4>`` is looked up from the name
+	string.  For example, 
+
+Podemos ativar o rastreamento pcap em um par protocolo/interface passando uma ``std::string`` que representa um nome de serviço para um método ``EnablePcapIpv4``. O ``Ptr<Ipv4>`` é buscado a partir do nome da `string`.
+Por exemplo,
+
+::
+
+  Names::Add ("serverIPv4" ...);
+  ...
+  helper.EnablePcapIpv4 ("prefix", "serverIpv4", 1);
+
+..
+	You can enable pcap tracing on a collection of protocol/interface pairs by 
+	providing an ``Ipv4InterfaceContainer``.  For each ``Ipv4`` / interface
+	pair in the container the protocol type is checked.  For each protocol of the 
+	proper type (the same type as is managed by the device helper), tracing is 
+	enabled for the corresponding interface.  For example, 
+
+Podemos ativar o rastreamento pcap em uma coleção de pares protocolo/interface usando um ``Ipv4InterfaceContainer``. Para cada par``Ipv4``/interface no contêiner o tipo do protocolo é verificado. Para cada protocolo do tipo adequado, o rastreamento é ativado para a interface correspondente. Por exemplo,
+
+
+::
+
+  NodeContainer nodes;
+  ...
+  NetDeviceContainer devices = deviceHelper.Install (nodes);
+  ... 
+  Ipv4AddressHelper ipv4;
+  ipv4.SetBase ("10.1.1.0", "255.255.255.0");
+  Ipv4InterfaceContainer interfaces = ipv4.Assign (devices);
+  ...
+  helper.EnablePcapIpv4 ("prefix", interfaces);
+
+..
+	You can enable pcap tracing on a collection of protocol/interface pairs by 
+	providing a ``NodeContainer``.  For each ``Node`` in the ``NodeContainer``
+	the appropriate protocol is found.  For each protocol, its interfaces are 
+	enumerated and tracing is enabled on the resulting pairs.  For example,
+
+Podemos ativar o rastreamento em uma coleção de pares protocolo/interface usando um ``NodeContainer``. Para cada ``Node`` no ``NodeContainer`` o protocolo apropriado é encontrado. Para cada protocolo, suas interfaces são enumeradas e o rastreamento é ativado nos pares resultantes. Por exemplo,
+
+::
+
+  NodeContainer n;
+  ...
+  helper.EnablePcapIpv4 ("prefix", n);
+
+..
+	You can enable pcap tracing on the basis of node ID and interface as well.  In
+	this case, the node-id is translated to a ``Ptr<Node>`` and the appropriate
+	protocol is looked up in the node.  The resulting protocol and interface are
+	used to specify the resulting trace source.
+
+Pode ativar o rastreamento pcap usando o número identificador do nó e da interface. Neste caso, o `ID` do nó é traduzido para um ``Ptr<Node>`` e o protocolo apropriado é buscado no nó. O protocolo e interface resultante são usados para especificar a origem do rastreamento resultante.
+
+
+::
+
+  helper.EnablePcapIpv4 ("prefix", 21, 1);
+
+..
+	Finally, you can enable pcap tracing for all interfaces in the system, with
+	associated protocol being the same type as that managed by the device helper.
+
+Por fim, podemos ativar rastreamento pcap para todas as interfaces no sistema, desde que o protocolo seja do mesmo tipo gerenciado pela classe assistente.
+
+
+::
+
+  helper.EnablePcapIpv4All ("prefix");
+
+.. 
+	Pcap Tracing Protocol Helper Filename Selection
+
+Seleção de um Nome de Arquivo para o Rastreamento Pcap da Classe Assistente de Protocolo
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+..
+	Implicit in all of the method descriptions above is the construction of the
+	complete filenames by the implementation method.  By convention, pcap traces
+	taken for devices in the |ns3| system are of the form 
+	"<prefix>-<node id>-<device id>.pcap".  In the case of protocol traces,
+	there is a one-to-one correspondence between protocols and ``Nodes``.
+	This is because protocol ``Objects`` are aggregated to ``Node Objects``.
+	Since there is no global protocol id in the system, we use the corresponding
+	node id in file naming.  Therefore there is a possibility for file name 
+	collisions in automatically chosen trace file names.  For this reason, the
+	file name convention is changed for protocol traces.
+
+Implícito nas descrições de métodos anterior é a construção do nome de arquivo por meio do método da implementação. Por convenção, rastreamento pcap no |ns3| usa a forma ``<prefixo>-<id do nó>-<id do dispositivo>.pcap``. No caso de rastreamento de protocolos, há uma correspondência de um-para-um entre protocolos e ``Nodes``. Isto porque ``Objects`` de protocolo são agregados a `Node Objects``. Como não há um `id` global de protocolo no sistema, usamos o `ID` do nó na nomeação do arquivo. Consequentemente há possibilidade de colisão de nomes quando usamos o sistema automático de nomes. Por esta razão, a convenção de nome de arquivo é modificada para rastreamentos de protocolos.
+
+..
+	As previously mentioned, every node in the system will have a system-assigned
+	node id.  Since there is a one-to-one correspondence between protocol instances
+	and node instances we use the node id.  Each interface has an interface id 
+	relative to its protocol.  We use the convention 
+	"<prefix>-n<node id>-i<interface id>.pcap" for trace file naming in protocol
+	helpers.
+
+Como mencionado, todo nó no sistema terá um `id` de nó associado. Como há uma correspondência de um-para-um entre instâncias de protocolo e instâncias de nó, usamos o `id` de nó. Cada interface tem um `id` de interface relativo ao seu protocolo. Usamos a convenção "<prefixo>-n<id do nó>-i<id da interface>.pcap" para especificar o nome do arquivo de rastreamento para as classes assistentes de protocolo.
+
+..
+	Therefore, by default, a pcap trace file created as a result of enabling tracing
+	on interface 1 of the Ipv4 protocol of node 21 using the prefix "prefix"
+	would be "prefix-n21-i1.pcap".
+
+Consequentemente, por padrão, uma arquivo pcap criado como um resultado da ativação de rastreamento na interface 1 do protocolo ipv4 do nó 21 usando o prefixo ``prefix`` seria ``prefix-n21-i1.pcap``.
+
+..
+	You can always use the |ns3| object name service to make this more clear.
+	For example, if you use the object name service to assign the name "serverIpv4"
+	to the Ptr<Ipv4> on node 21, the resulting pcap trace file name will 
+	automatically become, "prefix-nserverIpv4-i1.pcap".
+
+Sempre podemos usar o serviço de nomes de objetos do |ns3| para tornar isso mais claro. Por exemplo, se usamos o serviço de nomes  para associar o nome "serverIpv4" ao Ptr<Ipv4> no nó 21, o nome de arquivo resultante seria ``prefix-nserverIpv4-i1.pcap``.
+
+..
+	Several of the methods have a default parameter called ``explicitFilename``.
+	When set to true, this parameter disables the automatic filename completion 
+	mechanism and allows you to create an explicit filename.  This option is only
+	available in the methods which take a prefix and enable tracing on a single device.  
+
+Diversos métodos tem um parâmetro padrão ``explicitFilename``. Quando modificado para verdadeiro, este parâmetro desabilita o mecanismo automático de completar o nome do arquivo e permite criarmos um nome de arquivo abertamente. Esta opção está disponível nos métodos que  ativam o rastreamento pcap em um único dispositivo.
+
+.. 
+	Ascii Tracing Protocol Helpers
+
+Classes Assistentes de Protocolo para Rastreamento ASCII
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+
+..
+	The behavior of the ascii trace helpers is substantially similar to the pcap
+	case.  Take a look at ``src/network/helper/trace-helper.h`` if you want to 
+	follow the discussion while looking at real code.
+
+O comportamento dos assistentes de rastreamento ASCII é similar ao do pcap. Acesse o arquivo ``src/network/helper/trace-helper.h`` para compreender melhor o funcionamento dessa classe assistente.
+
+..
+	In this section we will be illustrating the methods as applied to the protocol
+	``Ipv4``.  To specify traces in similar protocols, just substitute the
+	appropriate type.  For example, use a ``Ptr<Ipv6>`` instead of a
+	``Ptr<Ipv4>`` and call ``EnableAsciiIpv6`` instead of ``EnableAsciiIpv4``.
+
+Nesta seção apresentamos os métodos aplicados ao protocolo ``Ipv4``. Para protocolos similares apenas substitua para o tipo apropriado. Por exemplo, use um ``Ptr<Ipv6>`` ao invés de um  ``Ptr<Ipv4>`` e chame ``EnableAsciiIpv6`` ao invés de ``EnableAsciiIpv4``.
+
+..
+	The class ``AsciiTraceHelperForIpv4`` adds the high level functionality
+	for using ascii tracing to a protocol helper.  Each protocol that enables these
+	methods must implement a single virtual method inherited from this class.
+
+A classe ``AsciiTraceHelperForIpv4`` adiciona funcionalidade de alto nível para usar rastreamento ASCII para um assistente de protocolo. Todo protocolo que usa estes métodos deve implementar um método herdado desta classe. 
+
+::
+
+  virtual void EnableAsciiIpv4Internal (Ptr<OutputStreamWrapper> stream, 
+                                        std::string prefix, 
+                                        Ptr<Ipv4> ipv4, 
+                                        uint32_t interface,
+                                        bool explicitFilename) = 0;
+
+..
+	The signature of this method reflects the protocol- and interface-centric view 
+	of the situation at this level; and also the fact that the helper may be writing
+	to a shared output stream.  All of the public methods inherited from class 
+	``PcapAndAsciiTraceHelperForIpv4`` reduce to calling this single device-
+	dependent implementation method.  For example, the lowest level ascii trace
+	methods,
+
+A assinatura deste método reflete a visão central do protocolo e interface da situação neste nível; e também o fato que o assistente pode ser escrito para um fluxo de saída compartilhado. Todos os métodos públicos herdados desta classe ``PcapAndAsciiTraceHelperForIpv4`` resumem-se a chamada deste único método dependente de implementação. Por exemplo, os métodos de rastreamento ASCII de mais baixo nível,
+
+::
+
+  void EnableAsciiIpv4 (std::string prefix, Ptr<Ipv4> ipv4, uint32_t interface, 
+  		bool explicitFilename = false);
+  void EnableAsciiIpv4 (Ptr<OutputStreamWrapper> stream, Ptr<Ipv4> ipv4, 
+  		uint32_t interface);
+
+..
+	will call the device implementation of ``EnableAsciiIpv4Internal`` directly,
+	providing either the prefix or the stream.  All other public ascii tracing 
+	methods will build on these low-level functions to provide additional user-level
+	functionality.  What this means to the user is that all device helpers in the 
+	system will have all of the ascii trace methods available; and these methods
+	will all work in the same way across protocols if the protocols implement 
+	``EnablAsciiIpv4Internal`` correctly.
+
+chamarão uma implementação de ``EnableAsciiIpv4Internal`` diretamente, passando um prefixo ou fluxo válido. Todos os outros métodos públicos serão construídos a partir destas funções de baixo nível para fornecer funcionalidades adicionais em nível de usuário. Para o usuário, isso significa que todos os assistentes de protocolos no sistema terão todos os métodos de rastreamento ASCII disponíveis e estes métodos trabalharão do mesmo modo em todos os protocolos se estes implementarem ``EnableAsciiIpv4Internal``.
+
+
+.. 
+	Ascii Tracing Protocol Helper Methods
+
+Métodos da Classe Assistente de Protocolo para Rastreamento ASCII
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+::
+
+  void EnableAsciiIpv4 (std::string prefix, Ptr<Ipv4> ipv4, uint32_t interface, 
+                        bool explicitFilename = false);
+  void EnableAsciiIpv4 (Ptr<OutputStreamWrapper> stream, Ptr<Ipv4> ipv4,
+                        uint32_t interface);
+
+  void EnableAsciiIpv4 (std::string prefix, std::string ipv4Name, uint32_t interface,
+                        bool explicitFilename = false);
+  void EnableAsciiIpv4 (Ptr<OutputStreamWrapper> stream, std::string ipv4Name,
+                        uint32_t interface);
+
+  void EnableAsciiIpv4 (std::string prefix, Ipv4InterfaceContainer c);
+  void EnableAsciiIpv4 (Ptr<OutputStreamWrapper> stream, Ipv4InterfaceContainer c);
+
+  void EnableAsciiIpv4 (std::string prefix, NodeContainer n);
+  void EnableAsciiIpv4 (Ptr<OutputStreamWrapper> stream, NodeContainer n);
+
+  void EnableAsciiIpv4All (std::string prefix);
+  void EnableAsciiIpv4All (Ptr<OutputStreamWrapper> stream);
+
+  void EnableAsciiIpv4 (std::string prefix, uint32_t nodeid, uint32_t deviceid,
+                        bool explicitFilename);
+  void EnableAsciiIpv4 (Ptr<OutputStreamWrapper> stream, uint32_t nodeid, 
+                        uint32_t interface);
+
+..
+	You are encouraged to peruse the Doxygen for class ``PcapAndAsciiHelperForIpv4``
+	to find the details of these methods; but to summarize ...
+
+Para maiores detalhes sobre os métodos consulte na documentação a classe ``PcapAndAsciiHelperForIpv4``; mas para resumir ...
+
+..
+	There are twice as many methods available for ascii tracing as there were for
+	pcap tracing.  This is because, in addition to the pcap-style model where traces
+	from each unique protocol/interface pair are written to a unique file, we 
+	support a model in which trace information for many protocol/interface pairs is 
+	written to a common file.  This means that the <prefix>-n<node id>-<interface>
+	file name generation mechanism is replaced by a mechanism to refer to a common 
+	file; and the number of API methods is doubled to allow all combinations.
+
+Há duas vezes mais métodos disponíveis para rastreamento ASCII que para rastreamento pcap. Isto ocorre pois para o modelo pcap os rastreamentos de cada par protocolo/interface são escritos para um único arquivo, enquanto que no ASCII todo as as informações são escritas para um arquivo comum. Isto significa que o mecanismo de geração de nomes de arquivos "<prefixo>-n<id do nó>-i<interface>" é substituído por um mecanismo para referenciar um arquivo comum; e o número de métodos da API é duplicado para permitir todas as combinações.
+
+..
+	Just as in pcap tracing, you can enable ascii tracing on a particular 
+	protocol/interface pair by providing a ``Ptr<Ipv4>`` and an ``interface``
+	to an ``EnableAscii`` method.
+	For example, 
+
+Assim, como no rastreamento pcap, podemos ativar o rastreamento ASCII em um par protocolo/interface passando um ``Ptr<Ipv4>`` e uma ``interface`` para  um método ``EnableAsciiIpv4``. Por exemplo,
+
+
+::
+
+  Ptr<Ipv4> ipv4;
+  ...
+  helper.EnableAsciiIpv4 ("prefix", ipv4, 1);
+
+..
+	In this case, no trace contexts are written to the ascii trace file since they
+	would be redundant.  The system will pick the file name to be created using
+	the same rules as described in the pcap section, except that the file will
+	have the suffix ".tr" instead of ".pcap".
+
+Neste caso, nenhum contexto de rastreamento é escrito para o arquivo ASCII pois seriam redundantes. O sistema pegará o nome do arquivo para ser criado usando as mesmas regras como descritas na seção pcap, exceto que o arquivo terá o extensão ``.tr`` ao invés de ``.pcap``.
+
+..
+	If you want to enable ascii tracing on more than one interface and have all 
+	traces sent to a single file, you can do that as well by using an object to
+	refer to a single file.  We have already something similar to this in the
+	"cwnd" example above:
+
+Para habilitar o rastreamento ASCII em mais de uma interface e ter todos os dados de rastreamento enviados para um único arquivo, pode-se usar um objeto para referenciar um único arquivo. Nós já verificamos isso no exemplo "cwnd":
+
+::
+
+  Ptr<Ipv4> protocol1 = node1->GetObject<Ipv4> ();
+  Ptr<Ipv4> protocol2 = node2->GetObject<Ipv4> ();
+  ...
+  Ptr<OutputStreamWrapper> stream = asciiTraceHelper.CreateFileStream 
+  		("trace-file-name.tr");
+  ...
+  helper.EnableAsciiIpv4 (stream, protocol1, 1);
+  helper.EnableAsciiIpv4 (stream, protocol2, 1);
+
+..
+	In this case, trace contexts are written to the ascii trace file since they
+	are required to disambiguate traces from the two interfaces.  Note that since 
+	the user is completely specifying the file name, the string should include the
+	",tr" for consistency.
+
+Neste caso, os contextos são escritos para o arquivo ASCII quando é necessário distinguir os dados de rastreamento de duas interfaces. É interessante usar no nome do arquivo a extensão ``.tr`` por motivos de consistência.
+
+..
+	You can enable ascii tracing on a particular protocol by providing a 
+	``std::string`` representing an object name service string to an 
+	``EnablePcap`` method.  The ``Ptr<Ipv4>`` is looked up from the name
+	string.  The ``<Node>`` in the resulting filenames is implicit since there
+	is a one-to-one correspondence between protocol instances and nodes,
+	For example, 
+
+Pode habilitar o rastreamento ASCII em protocolo específico passando ao método ``EnableAsciiIpv4`` uma ``std::string`` representando um nome no serviço de nomes de objetos. O ``Ptr<Ipv4>`` é obtido a partir do nome. O ``<Node>`` é implícito, pois há uma correspondência de um-para-um entre instancias de protocolos e nós. Por exemplo,
+
+::
+
+  Names::Add ("node1Ipv4" ...);
+  Names::Add ("node2Ipv4" ...);
+  ...
+  helper.EnableAsciiIpv4 ("prefix", "node1Ipv4", 1);
+  helper.EnableAsciiIpv4 ("prefix", "node2Ipv4", 1);
+
+..
+	This would result in two files named "prefix-nnode1Ipv4-i1.tr" and 
+	"prefix-nnode2Ipv4-i1.tr" with traces for each interface in the respective 
+	trace file.  Since all of the EnableAscii functions are overloaded to take a 
+	stream wrapper, you can use that form as well:
+
+Isto resultaria em dois nomes de arquivos ``prefix-nnode1Ipv4-i1.tr`` e ``prefix-nnode2Ipv4-i1.tr``, com os rastreamentos de cada interface em  seu arquivo respectivo. Como todas as funções do ``EnableAsciiIpv4`` são sobrecarregadas para suportar um *stream wrapper*, podemos usar da seguinte forma também:
+
+
+::
+
+  Names::Add ("node1Ipv4" ...);
+  Names::Add ("node2Ipv4" ...);
+  ...
+  Ptr<OutputStreamWrapper> stream = asciiTraceHelper.CreateFileStream 
+  		("trace-file-name.tr");
+  ...
+  helper.EnableAsciiIpv4 (stream, "node1Ipv4", 1);
+  helper.EnableAsciiIpv4 (stream, "node2Ipv4", 1);
+
+..
+	This would result in a single trace file called "trace-file-name.tr" that 
+	contains all of the trace events for both interfaces.  The events would be 
+	disambiguated by trace context strings.
+
+Isto resultaria em um único arquivo chamado ``trace-file-name.tr`` que contém todos os eventos rastreados para ambas as interfaces. Os eventos seriam diferenciados por `strings` de contexto.
+
+.. 
+	You can enable ascii tracing on a collection of protocol/interface pairs by 
+	providing an ``Ipv4InterfaceContainer``.  For each protocol of the proper 
+	type (the same type as is managed by the device helper), tracing is enabled
+	for the corresponding interface.  Again, the ``<Node>`` is implicit since 
+	there is a one-to-one correspondence between each protocol and its node.
+	For example, 
+
+Podemos habilitar o rastreamento ASCII em um coleção de pares protocolo/interface provendo um ``Ipv4InterfaceContainer``. Para cada protocolo no contêiner o tipo é verificado. Para cada protocolo do tipo adequado (o mesmo tipo que é gerenciado por uma classe assistente de protocolo), o rastreamento é habilitado para a interface correspondente. Novamente, o ``<Node>`` é implícito, pois há uma correspondência de um-para-um entre protocolo e seu nó. Por exemplo,
+
+
+::
+
+  NodeContainer nodes;
+  ...
+  NetDeviceContainer devices = deviceHelper.Install (nodes);
+  ... 
+  Ipv4AddressHelper ipv4;
+  ipv4.SetBase ("10.1.1.0", "255.255.255.0");
+  Ipv4InterfaceContainer interfaces = ipv4.Assign (devices);
+  ...
+  ...
+  helper.EnableAsciiIpv4 ("prefix", interfaces);
+
+..
+	This would result in a number of ascii trace files being created, each of which
+	follows the <prefix>-n<node id>-i<interface>.tr convention.  Combining all of the
+	traces into a single file is accomplished similarly to the examples above:
+
+Isto resultaria em vários arquivos de rastreamento ASCII sendo criados, cada um seguindo a convenção ``<prefixo>-n<id do nó>-i<interface>.tr``. 
+
+Para obtermos um único arquivo teríamos:
+
+::
+
+  NodeContainer nodes;
+  ...
+  NetDeviceContainer devices = deviceHelper.Install (nodes);
+  ... 
+  Ipv4AddressHelper ipv4;
+  ipv4.SetBase ("10.1.1.0", "255.255.255.0");
+  Ipv4InterfaceContainer interfaces = ipv4.Assign (devices);
+  ...
+  Ptr<OutputStreamWrapper> stream = asciiTraceHelper.CreateFileStream 
+  		("trace-file-name.tr");
+  ...
+  helper.EnableAsciiIpv4 (stream, interfaces);
+
+..
+	You can enable ascii tracing on a collection of protocol/interface pairs by 
+	providing a ``NodeContainer``.  For each ``Node`` in the ``NodeContainer``
+	the appropriate protocol is found.  For each protocol, its interfaces are 
+	enumerated and tracing is enabled on the resulting pairs.  For example,
+
+Podemos habilitar o rastreamento ASCII em uma coleção de pares protocolo/interface provendo um `NodeContainer``. Para cada ``Node`` no ``NodeContainer`` os protocolos apropriados são encontrados. Para cada protocolo, sua interface é enumerada e o rastreamento é habilitado nos pares. Por exemplo,
+
+::
+
+  NodeContainer n;
+  ...
+  helper.EnableAsciiIpv4 ("prefix", n);
+
+..
+	You can enable pcap tracing on the basis of node ID and device ID as well.  In
+	this case, the node-id is translated to a ``Ptr<Node>`` and the appropriate
+	protocol is looked up in the node.  The resulting protocol and interface are
+	used to specify the resulting trace source.
+
+Podemos habilitar o rastreamento pcap usando o número identificador do nó e número identificador do dispositivo. Neste caso, o `ID` do nó é traduzido para um ``Ptr<Node>`` e o protocolo apropriado é procurado no nó de rede. O protocolo e interface resultantes são usados para especificar a origem do rastreamento.
+
+::
+
+  helper.EnableAsciiIpv4 ("prefix", 21, 1);
+
+.. 
+	Of course, the traces can be combined into a single file as shown above.
+
+Os rastreamentos podem ser combinados em um único arquivo como mostrado anteriormente.
+
+.. 
+	Finally, you can enable ascii tracing for all interfaces in the system, with
+	associated protocol being the same type as that managed by the device helper.
+
+Finalmente, podemos habilitar o rastreamento ASCII para todas as interfaces no sistema.
+
+::
+
+  helper.EnableAsciiIpv4All ("prefix");
+
+..
+	This would result in a number of ascii trace files being created, one for
+	every interface in the system related to a protocol of the type managed by the
+	helper.  All of these files will follow the <prefix>-n<node id>-i<interface.tr
+	convention.  Combining all of the traces into a single file is accomplished 
+	similarly to the examples above.
+
+Isto resultaria em vários arquivos ASCII sendo criados, um para cada interface no sistema relacionada ao protocolo do tipo gerenciado pela classe assistente.Todos estes arquivos seguiriam a convenção
+``<prefix>-n<id do node>-i<interface>.tr``.
+
+
+.. 
+	Ascii Tracing Protocol Helper Filename Selection
+
+Seleção de Nome de Arquivo para Rastreamento ASCII da Classe Assistente de Protocolo 
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+..
+	Implicit in the prefix-style method descriptions above is the construction of the
+	complete filenames by the implementation method.  By convention, ascii traces
+	in the |ns3| system are of the form "<prefix>-<node id>-<device id>.tr"
+
+Implícito nas descrições de métodos anteriores é a construção do nome do arquivo por meio do método da implementação. Por convenção, rastreamento ASCII no sistema |ns3| são da forma ``<prefix>-<id node>-<id do dispositivo>.tr``.
+
+..
+	As previously mentioned, every node in the system will have a system-assigned
+	node id.  Since there is a one-to-one correspondence between protocols and nodes
+	we use to node-id to identify the protocol identity.  Every interface on a 
+	given protocol will have an interface index (also called simply an interface) 
+	relative to its protocol.  By default, then, an ascii trace file created as a result
+	of enabling tracing on the first device of node 21, using the prefix "prefix",
+	would be "prefix-n21-i1.tr".  Use the prefix to disambiguate multiple protocols
+	per node.
+
+Como mencionado, todo nó no sistema terá um número identificador de nó associado. Como há uma correspondência de um-para-um entre instâncias de protocolo e instâncias de nó, usamos o `ID` de nó. Cada interface em um protocolo terá um índice de interface (também chamando apenas de interface) relativo ao seu protocolo. Por padrão, então, um arquivo de rastreamento ASCII criado a partir do rastreamento no primeiro dispositivo do nó 21, usando o prefixo "prefix", seria ``prefix-n21-i1.tr``. O uso de prefixo distingue múltiplos protocolos por nó.
+
+..
+	You can always use the |ns3| object name service to make this more clear.
+	For example, if you use the object name service to assign the name "serverIpv4"
+	to the protocol on node 21, and also specify interface one, the resulting ascii 
+	trace file name will automatically become, "prefix-nserverIpv4-1.tr".
+
+Sempre podemos usar o serviço de nomes de objetos do |ns3| para tornar isso mais claro. Por exemplo, se usarmos o serviço de nomes para associar o nome "serverIpv4" ao Ptr<Ipv4> no nó 21, o nome de arquivo resultante seria ``prefix-nserverIpv4-i1.tr``.
+
+..
+	Several of the methods have a default parameter called ``explicitFilename``.
+	When set to true, this parameter disables the automatic filename completion 
+	mechanism and allows you to create an explicit filename.  This option is only
+	available in the methods which take a prefix and enable tracing on a single device.  
+
+Diversos métodos tem um parâmetro padrão ``explicitFilename``. Quando modificado para verdadeiro, este parâmetro desabilita o mecanismo automático de completar o nome do arquivo e permite criarmos um nome de arquivo abertamente. Esta opção está disponível nos métodos que  ativam o rastreamento em um único dispositivo.
+
+
+.. 
+	Summary
+
+Considerações Finais
+********************
+
+..
+	|ns3| includes an extremely rich environment allowing users at several 
+	levels to customize the kinds of information that can be extracted from 
+	simulations.  
+
+O |ns3| inclui um ambiente completo para permitir usuários de diversos níveis  personalizar os tipos de informação para serem extraídas de suas simulações.
+
+..
+	There are high-level helper functions that allow users to simply control the 
+	collection of pre-defined outputs to a fine granularity.  There are mid-level
+	helper functions to allow more sophisticated users to customize how information
+	is extracted and saved; and there are low-level core functions to allow expert
+	users to alter the system to present new and previously unexported information
+	in a way that will be immediately accessible to users at higher levels.
+
+Existem funções assistentes de alto nível que permitem ao usuário o controle de um coleção de saídas predefinidas para uma granularidade mais fina. Existem funções assistentes de nível intermediário que permitem usuários mais sofisticados personalizar como as informações são extraídas e armazenadas; e existem funções de baixo nível que permitem usuários avançados alterarem o sistema para apresentar novas ou informações que não eram exportadas.
+
+..
+	This is a very comprehensive system, and we realize that it is a lot to 
+	digest, especially for new users or those not intimately familiar with C++
+	and its idioms.  We do consider the tracing system a very important part of
+	|ns3| and so recommend becoming as familiar as possible with it.  It is
+	probably the case that understanding the rest of the |ns3| system will
+	be quite simple once you have mastered the tracing system
+
+Este é um sistema muito abrangente e percebemos que é muita informação para digerir, especialmente para novos usuários ou aqueles que não estão intimamente familiarizados com C++ e suas expressões idiomáticas. Consideramos o sistema de rastreamento uma parte muito importante do |ns3|, assim recomendamos que familiarizem-se o máximo possível com ele. Compreender o restante do sistema |ns3| é bem simples, uma vez que dominamos o sistema de rastreamento.
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/doc/tutorial-pt-br/source/tweaking.rst	Wed Apr 11 13:49:33 2012 +0200
@@ -0,0 +1,1419 @@
+.. include:: replace.txt
+
+..
+	========================================================================================
+	Translated for portuguese by the students of the inter-institutional doctorate program of IME-USP/UTFPR-CM.
+	
+	Traduzido para o português pelos alunos do programa de doutorado inter institucional do Instituto de Matemática e Estatística da Universidade de São Paulo --- IME-USP em parceria com a Universidade Tecnológica Federal do Paraná - Campus Campo Mourão --- UTFPR-CM:
+	
+	* Frank Helbert (frank@ime.usp.br);
+	* Luiz Arthur Feitosa dos Santos (luizsan@ime.usp.br);
+	* Rodrigo Campiolo (campiolo@ime.usp.br).
+	========================================================================================
+
+.. Tweaking
+
+Aprofundando Conhecimentos
+----------------------------------------
+
+.. 
+	Using the Logging Module
+
+
+Usando o Módulo de Registro
+***************************
+
+..
+	We have already taken a brief look at the |ns3| logging module while
+	going over the ``first.cc`` script.  We will now take a closer look and 
+	see what kind of use-cases the logging subsystem was designed to cover.
+
+Já demos uma breve olhada no módulo de Registro (do inglês, `log` ou `logging`) do |ns3|, enquanto analisávamos o código ``first.cc``. Agora iremos aprofundar nossos conhecimento sobre este módulo para utilizá-lo de forma mais eficiente.
+
+.. 
+	Logging Overview
+
+Visão Geral Sobre o Sistema de Registro
++++++++++++++++++++++++++++++++++++++++
+
+..
+	Many large systems support some kind of message logging facility, and 
+	|ns3| is not an exception.  In some cases, only error messages are 
+	logged to the "operator console" (which is typically ``stderr`` in Unix-
+	based systems).  In other systems, warning messages may be output as well as 
+	more detailed informational messages.  In some cases, logging facilities are 
+	used to output debug messages which can quickly turn the output into a blur.
+
+A maioria dos sistemas de grande porte suportam mensagens de registros (mensagens de 'log' que informam o que esta ocorrendo no sistema) e o |ns3| não é nenhuma exceção. Em alguns casos, somente mensagens de erros são reportadas para o "operador do console" (que é geralmente o ``stderr`` dos sistemas baseados no Unix). Em outros sistemas, mensagens de avisos podem ser impressas detalhando informações do sistema. Em alguns casos, o sistema de registro fornece mensagens de depuração que podem rapidamente mostrar o que está ocorrendo de errado.
+
+..
+	|ns3| takes the view that all of these verbosity levels are useful 
+	and we provide a selectable, multi-level approach to message logging.  Logging
+	can be disabled completely, enabled on a component-by-component basis, or
+	enabled globally; and it provides selectable verbosity levels.  The 
+	|ns3| log module provides a straightforward, relatively easy to use
+	way to get useful information out of your simulation.
+
+O |ns3| permite que o usuário tenha visões de todos os níveis do sistema através das mensagens de registro. Podemos selecionar o nível de saída das mensagens de registro(`verbosty`), através de um abordagem multinível. As mensagens de registro podem ser desabilitadas completamente, habilitadas componente por componente ou habilitada globalmente. Ou seja,  permite selecionar o nível de detalhamento das mensagens de saída. O módulo de registro do |ns3| fornece uma forma correta e segura de obtermos informações sobre as simulações.
+
+..
+	You should understand that we do provide a general purpose mechanism --- 
+	tracing --- to get data out of your models which should be preferred for 
+	simulation output (see the tutorial section Using the Tracing System for
+	more details on our tracing system).  Logging should be preferred for 
+	debugging information, warnings, error messages, or any time you want to 
+	easily get a quick message out of your scripts or models.
+
+No |ns3| foi implementado um mecanismo de --- rastreamento --- de propósito geral, que permite a obtenção de saídas de dados dos modelos simulados (veja a seção Usando o Sistema de Rastreamento do tutorial para mais detalhes). O sistema de registro deve ser usado para depurar informações, alertas, mensagens de erros ou para mostrar qualquer informação dos `scripts` ou modelos.
+
+..
+	There are currently seven levels of log messages of increasing verbosity
+	defined in the system.  
+
+Atualmente existem sete níveis de mensagens de registro definidas no sistema.
+
+..
+	* NS_LOG_ERROR --- Log error messages;
+	* NS_LOG_WARN --- Log warning messages;
+	* NS_LOG_DEBUG --- Log relatively rare, ad-hoc debugging messages;
+	* NS_LOG_INFO --- Log informational messages about program progress;
+	* NS_LOG_FUNCTION --- Log a message describing each function called;
+	* NS_LOG_LOGIC -- Log messages describing logical flow within a function;
+	* NS_LOG_ALL --- Log everything.
+
+* NS_LOG_ERROR --- Registra mensagens de erro;
+* NS_LOG_WARN --- Registra mensagens de alertas;
+* NS_LOG_DEBUG --- Registra mensagens mais raras, mensagens de depuração `ad-hoc`;
+* NS_LOG_INFO ---  Registra mensagens informativas sobre o progresso do programa;
+* NS_LOG_FUNCTION --- Registra mensagens descrevendo cada função chamada;
+* NS_LOG_LOGIC --- Registra mensagens que descrevem o fluxo lógico dentro de uma função;
+* NS_LOG_ALL --- Registra tudo.
+
+..
+	We also provide an unconditional logging level that is always displayed,
+	irrespective of logging levels or component selection.
+
+Também é fornecido um nível de registro incondicional, que sempre é exibido independente do nível de registro ou do componente selecionado.
+
+..
+	*  NS_LOG_UNCOND -- Log the associated message unconditionally.
+
+*  NS_LOG_UNCOND --- Registra mensagens incondicionalmente.
+
+..
+	Each level can be requested singly or cumulatively; and logging can be set 
+	up using a shell environment variable (NS_LOG) or by logging system function 
+	call.  As was seen earlier in the tutorial, the logging system has Doxygen 
+	documentation and now would be a good time to peruse the Logging Module 
+	documentation if you have not done so.
+
+Cada nível pode ser requerido individualmente ou de forma cumulativa. O registro pode ser configurado usando uma variável de ambiente (``NS_LOG``) ou através de uma chamada ao sistema de registro. Já havíamos abordado anteriormente o sistema de registro, através da documentação Doxygen, agora é uma boa hora para ler com atenção esta documentação no Doxygen.
+
+..
+	Now that you have read the documentation in great detail, let's use some of
+	that knowledge to get some interesting information out of the 
+	``scratch/myfirst.cc`` example script you have already built.
+
+Depois de ler a documentação, vamos usar nosso conhecimento para obter algumas informações importante do código de exemplo ``scratch/myfirst.cc``.
+
+.. 
+	Enabling Logging
+
+Habilitando o Sistema de Registro
++++++++++++++++++++++++++++++++++
+
+..
+	Let's use the NS_LOG environment variable to turn on some more logging, but
+	first, just to get our bearings, go ahead and run the last script just as you 
+	did previously,
+
+Utilizaremos a variável de ambiente ``NS_LOG`` para habilitar o sistema de Registro, mas antes de prosseguir, execute o código feito na seção anterior,
+
+::
+
+  ./waf --run scratch/myfirst
+
+..
+	You should see the now familiar output of the first |ns3| example
+	program
+
+Veremos a saída do nosso primeiro programa |ns3| de exemplo, tal como visto anteriormente.
+
+::
+
+  Waf: Entering directory `/home/craigdo/repos/ns-3-allinone/ns-3-dev/build'
+  Waf: Leaving directory `/home/craigdo/repos/ns-3-allinone/ns-3-dev/build'
+  'build' finished successfully (0.413s)
+  Sent 1024 bytes to 10.1.1.2
+  Received 1024 bytes from 10.1.1.1
+  Received 1024 bytes from 10.1.1.2
+
+
+..
+	It turns out that the "Sent" and "Received" messages you see above are
+	actually logging messages from the ``UdpEchoClientApplication`` and 
+	``UdpEchoServerApplication``.  We can ask the client application, for 
+	example, to print more information by setting its logging level via the 
+	NS_LOG environment variable.  
+
+As mensagens de envio e recebimentos apresentadas anteriormente são mensagens de registro, obtidas de ``UdpEchoClientApplication`` e ``UdpEchoServerApplication``. Podemos pedir para a aplicação cliente, por exemplo, imprimir mais informações configurando o nível de registro através da variável de ambiente ``NS_LOG``.
+
+
+..
+	I am going to assume from here on that you are using an sh-like shell that uses 
+	the"VARIABLE=value" syntax.  If you are using a csh-like shell, then you 
+	will have to convert my examples to the "setenv VARIABLE value" syntax 
+	required by those shells.
+
+Aqui estamos assumindo que você está usando um `shell` parecido com o ``sh``, que usa a sintaxe "VARIABLE=value". Se você estiver usando um `shell` parecido com o ``csh``, então terá que converter os exemplos para a sintaxe "setenv VARIABLE value", requerida por este `shell`.
+
+..
+	Right now, the UDP echo client application is responding to the following line
+	of code in ``scratch/myfirst.cc``,
+
+Agora, a aplicação cliente de eco UDP irá responder a seguinte linha de código ``scratch/myfirst.cc``,
+
+::
+
+  LogComponentEnable("UdpEchoClientApplication", LOG_LEVEL_INFO);
+
+..
+	This line of code enables the ``LOG_LEVEL_INFO`` level of logging.  When 
+	we pass a logging level flag, we are actually enabling the given level and
+	all lower levels.  In this case, we have enabled ``NS_LOG_INFO``,
+	``NS_LOG_DEBUG``, ``NS_LOG_WARN`` and ``NS_LOG_ERROR``.  We can
+	increase the logging level and get more information without changing the
+	script and recompiling by setting the NS_LOG environment variable like this:
+
+Essa linha de código habilita o nível ``LOG_LEVEL_INFO`` de registro. Quando habilitamos um dado nível de registro, estamos habilitando este nível e todos os níveis inferiores a este. Neste caso, habilitamos ``NS_LOG_INFO``,	``NS_LOG_DEBUG``, ``NS_LOG_WARN`` e ``NS_LOG_ERROR``. Podemos aumentar o nível de registro e obter mais informações sem alterar o `script`, ou seja, sem ter que recompilar. Conseguimos isto através da configuração da variável de ambiente ``NS_LOG``, tal como:
+
+::
+
+  export NS_LOG=UdpEchoClientApplication=level_all
+
+.. 
+	This sets the shell environment variable ``NS_LOG`` to the string,
+
+Isto configura a variável de ambiente ``NS_LOG`` no `shell` para,
+
+::
+
+  UdpEchoClientApplication=level_all
+
+..
+	The left hand side of the assignment is the name of the logging component we
+	want to set, and the right hand side is the flag we want to use.  In this case,
+	we are going to turn on all of the debugging levels for the application.  If
+	you run the script with NS_LOG set this way, the |ns3| logging 
+	system will pick up the change and you should see the following output:
+
+Do lado esquerdo do comando temos o nome do componente de registro que nós queremos configurar, no lado direito fica o valor que estamos passando. Neste caso, estamos ligando todos os níveis de depuração para a aplicação. Se executarmos o código com o ``NS_LOG`` configurado desta forma, o sistema de registro do |NS3| observará a mudança e mostrará a seguinte saída:
+
+
+::
+
+  Waf: Entering directory `/home/craigdo/repos/ns-3-allinone/ns-3-dev/build
+  Waf: Leaving directory `/home/craigdo/repos/ns-3-allinone/ns-3-dev/build'
+  'build' finished successfully (0.404s)
+  UdpEchoClientApplication:UdpEchoClient()
+  UdpEchoClientApplication:SetDataSize(1024)
+  UdpEchoClientApplication:StartApplication()
+  UdpEchoClientApplication:ScheduleTransmit()
+  UdpEchoClientApplication:Send()
+  Sent 1024 bytes to 10.1.1.2
+  Received 1024 bytes from 10.1.1.1
+  UdpEchoClientApplication:HandleRead(0x6241e0, 0x624a20)
+  Received 1024 bytes from 10.1.1.2
+  UdpEchoClientApplication:StopApplication()
+  UdpEchoClientApplication:DoDispose()
+  UdpEchoClientApplication:~UdpEchoClient()
+
+..
+	The additional debug information provided by the application is from
+	the NS_LOG_FUNCTION level.  This shows every time a function in the application
+	is called during script execution.  Note that there are no requirements in the
+	|ns3| system that models must support any particular logging 
+	functionality.  The decision regarding how much information is logged
+	is left to the individual model developer.  In the case of the echo 
+	applications, a good deal of log output is available.
+
+As informações de depuração extras, apresentadas aqui, são fornecidas pela aplicação no nível de registros ``NS_LOG_FUNCTION``. Isto é apresentado toda vez que a aplicação chamar a função. Não é obrigatório que o modelo forneça suporte a registro, no |ns3|, esta decisão cabe ao desenvolvedor do modelo. No caso da aplicação de eco uma grande quantidade de saídas de `log` estão disponíveis.
+
+..
+	You can now see a log of the function calls that were made to the application.
+	If you look closely you will notice a single colon between the string 
+	``UdpEchoClientApplication`` and the method name where you might have 
+	expected a C++ scope operator (``::``).  This is intentional.  
+
+Podemos ver agora registros de várias funções executadas pela aplicação. Se olharmos mais de perto veremos que as informações são dadas em colunas separadas por (``::``), do lado esquerdo está o nome da aplicação (no exemplo, ``UdpEchoClientApplication``) e do outro lado o nome do método esperado pelo escopo C++. Isto é incremental.
+
+..
+	The name is not actually a class name, it is a logging component name.  When 
+	there is a one-to-one correspondence between a source file and a class, this 
+	will generally be the class name but you should understand that it is not 
+	actually a class name, and there is a single colon there instead of a double
+	colon to remind you in a relatively subtle way to conceptually separate the 
+	logging component name from the class name.
+
+O nome que está aparece no registro não é necessariamente o nome da classe, mas sim o nome do componente de registro. Quando existe uma correspondência um-para-um, entre código fonte e classe, este geralmente será o nome da classe, mas isto nem sempre é verdade. A maneira sutil de diferenciar esta situação é usar ``:`` quando for o nome do componente de registro e ``::`` quando for o nome da classe.
+
+..
+	It turns out that in some cases, it can be hard to determine which method
+	actually generates a log message.  If you look in the text above, you may
+	wonder where the string "``Received 1024 bytes from 10.1.1.2``" comes
+	from.  You can resolve this by OR'ing the ``prefix_func`` level into the
+	``NS_LOG`` environment variable.  Try doing the following, 
+
+Em alguns casos pode ser complicado determinar qual método gerou a mensagem. Se olharmos o texto anterior, veremos a mensagem "``Received 1024 bytes from 10.1.1.2``", nesta não existe certeza de onde a mensagem veio. Podemos resolver isto usando um "OU" (`OR`) entre o nível de registro e o ``prefix_func``, dentro do ``NS_LOG``. 
+
+::
+
+  export 'NS_LOG=UdpEchoClientApplication=level_all|prefix_func'
+
+..
+	Note that the quotes are required since the vertical bar we use to indicate an
+	OR operation is also a Unix pipe connector.
+
+As aspas são requeridas quando usamos o `|` (`pipe`) para indicar uma operação de OU.
+
+..
+	Now, if you run the script you will see that the logging system makes sure 
+	that every message from the given log component is prefixed with the component
+	name.
+
+Agora, se executarmos o `script` devemos ver que o sistema de registro informa de qual componente de registro vem a mensagem.
+
+::
+
+  Waf: Entering directory `/home/craigdo/repos/ns-3-allinone/ns-3-dev/build'
+  Waf: Leaving directory `/home/craigdo/repos/ns-3-allinone/ns-3-dev/build'
+  'build' finished successfully (0.417s)
+  UdpEchoClientApplication:UdpEchoClient()
+  UdpEchoClientApplication:SetDataSize(1024)
+  UdpEchoClientApplication:StartApplication()
+  UdpEchoClientApplication:ScheduleTransmit()
+  UdpEchoClientApplication:Send()
+  UdpEchoClientApplication:Send(): Sent 1024 bytes to 10.1.1.2
+  Received 1024 bytes from 10.1.1.1
+  UdpEchoClientApplication:HandleRead(0x6241e0, 0x624a20)
+  UdpEchoClientApplication:HandleRead(): Received 1024 bytes from 10.1.1.2
+  UdpEchoClientApplication:StopApplication()
+  UdpEchoClientApplication:DoDispose()
+  UdpEchoClientApplication:~UdpEchoClient()
+
+..
+	You can now see all of the messages coming from the UDP echo client application
+	are identified as such.  The message "Received 1024 bytes from 10.1.1.2" is
+	now clearly identified as coming from the echo client application.  The 
+	remaining message must be coming from the UDP echo server application.  We 
+	can enable that component by entering a colon separated list of components in
+	the NS_LOG environment variable.
+
+Podemos ver, depois da configuração, que todas as mensagens do cliente de eco UDP estão identificadas. Agora a mensagem "Received 1024 bytes from 10.1.1.2" é claramente identificada como sendo do cliente de eco. O restante das mensagens devem estar vindo do servidor de eco UDP. Podemos habilitar mais do que um componente usando ``:``, para separá-los na variável ``NS_LOG``.
+
+::
+
+  export 'NS_LOG=UdpEchoClientApplication=level_all|prefix_func:
+                 UdpEchoServerApplication=level_all|prefix_func'
+
+..
+	Warning:  You will need to remove the newline after the ``:`` in the
+	example text above which is only there for document formatting purposes.
+
+Atenção: não podemos quebrar a entrada da variável em várias linhas como foi feito no exemplo, tudo deve estar em uma única linha. O exemplo ficou assim por uma questão de formatação do documento.
+
+..
+	Now, if you run the script you will see all of the log messages from both the
+	echo client and server applications.  You may see that this can be very useful
+	in debugging problems.
+
+Agora, se executarmos o `script` veremos todas as mensagens de registro tanto do cliente quando do servidor. Isto é muito útil na depuração de problemas.
+
+::
+
+  Waf: Entering directory `/home/craigdo/repos/ns-3-allinone/ns-3-dev/build'
+  Waf: Leaving directory `/home/craigdo/repos/ns-3-allinone/ns-3-dev/build'
+  'build' finished successfully (0.406s)
+  UdpEchoServerApplication:UdpEchoServer()
+  UdpEchoClientApplication:UdpEchoClient()
+  UdpEchoClientApplication:SetDataSize(1024)
+  UdpEchoServerApplication:StartApplication()
+  UdpEchoClientApplication:StartApplication()
+  UdpEchoClientApplication:ScheduleTransmit()
+  UdpEchoClientApplication:Send()
+  UdpEchoClientApplication:Send(): Sent 1024 bytes to 10.1.1.2
+  UdpEchoServerApplication:HandleRead(): Received 1024 bytes from 10.1.1.1
+  UdpEchoServerApplication:HandleRead(): Echoing packet
+  UdpEchoClientApplication:HandleRead(0x624920, 0x625160)
+  UdpEchoClientApplication:HandleRead(): Received 1024 bytes from 10.1.1.2
+  UdpEchoServerApplication:StopApplication()
+  UdpEchoClientApplication:StopApplication()
+  UdpEchoClientApplication:DoDispose()
+  UdpEchoServerApplication:DoDispose()
+  UdpEchoClientApplication:~UdpEchoClient()
+  UdpEchoServerApplication:~UdpEchoServer()
+
+..
+	It is also sometimes useful to be able to see the simulation time at which a
+	log message is generated.  You can do this by ORing in the prefix_time bit.
+
+As vezes também é útil registrar o tempo em que uma mensagem é gerada. Podemos fazer isto através de um OU com o `prefix_time`, exemplo:
+
+
+::
+
+  export 'NS_LOG=UdpEchoClientApplication=level_all|prefix_func|prefix_time:
+                 UdpEchoServerApplication=level_all|prefix_func|prefix_time'
+
+..
+	Again, you will have to remove the newline above.  If you run the script now,
+	you should see the following output:
+
+Novamente, teremos que deixar tudo em uma única linha e não em duas como no exemplo anterior. Executando o `script`, veremos a seguinte saída:
+
+::
+
+  Waf: Entering directory `/home/craigdo/repos/ns-3-allinone/ns-3-dev/build'
+  Waf: Leaving directory `/home/craigdo/repos/ns-3-allinone/ns-3-dev/build'
+  'build' finished successfully (0.418s)
+  0s UdpEchoServerApplication:UdpEchoServer()
+  0s UdpEchoClientApplication:UdpEchoClient()
+  0s UdpEchoClientApplication:SetDataSize(1024)
+  1s UdpEchoServerApplication:StartApplication()
+  2s UdpEchoClientApplication:StartApplication()
+  2s UdpEchoClientApplication:ScheduleTransmit()
+  2s UdpEchoClientApplication:Send()
+  2s UdpEchoClientApplication:Send(): Sent 1024 bytes to 10.1.1.2
+  2.00369s UdpEchoServerApplication:HandleRead(): Received 1024 bytes from 10.1.1.1
+  2.00369s UdpEchoServerApplication:HandleRead(): Echoing packet
+  2.00737s UdpEchoClientApplication:HandleRead(0x624290, 0x624ad0)
+  2.00737s UdpEchoClientApplication:HandleRead(): Received 1024 bytes from 10.1.1.2
+  10s UdpEchoServerApplication:StopApplication()
+  10s UdpEchoClientApplication:StopApplication()
+  UdpEchoClientApplication:DoDispose()
+  UdpEchoServerApplication:DoDispose()
+  UdpEchoClientApplication:~UdpEchoClient()
+  UdpEchoServerApplication:~UdpEchoServer()
+
+.. 
+	You can see that the constructor for the UdpEchoServer was called at a 
+	simulation time of 0 seconds.  This is actually happening before the 
+	simulation starts, but the time is displayed as zero seconds.  The same is true
+	for the UdpEchoClient constructor message.
+
+Podemos ver que o construtor para o ``UdpEchoServer`` foi chamado pelo simulador no segundo 0 (zero). Isto acontece antes do simulador ser iniciado, mas o tempo é mostrado como zero, o mesmo acontece para o construtor do ``UdpEchoClient``.
+
+..
+	Recall that the ``scratch/first.cc`` script started the echo server 
+	application at one second into the simulation.  You can now see that the 
+	``StartApplication`` method of the server is, in fact, called at one second.
+	You can also see that the echo client application is started at a simulation 
+	time of two seconds as we requested in the script.
+
+Lembre-se que o `script` ``scratch/first.cc`` inicia a aplicação servidor de eco no primeiro segundo da simulação. Repare que o método ``StartApplication`` do servidor é, de fato, chamado com um segundo. Também podemos notar que a aplicação cliente de eco é iniciada com dois segundos de simulação, como nós pedimos no `script`.
+
+..
+	You can now follow the progress of the simulation from the 
+	``ScheduleTransmit`` call in the client that calls ``Send`` to the 
+	``HandleRead`` callback in the echo server application.  Note that the 
+	elapsed time for the packet to be sent across the point-to-point link is 3.69
+	milliseconds.  You see the echo server logging a message telling you that it
+	has echoed the packet and then, after another channel delay, you see the echo
+	client receive the echoed packet in its ``HandleRead`` method.
+
+.. 
+	>> rever tradução
+
+Agora podemos acompanhar o andamento da simulação: ``ScheduleTransmit`` é chamado no cliente, que invoca o ``Send`` e o ``HandleRead``, que é usado na aplicação servidor de eco. Repare que o tempo decorrido entre o envio de cada pacote é de 3.69 milissegundos. Veja que a mensagem de registro do servidor diz que o pacote foi ecoado e depois houve um atraso no canal. Podemos ver que o cliente recebeu o pacote ecoado pelo método ``HandleRead``.
+
+..
+	There is a lot that is happening under the covers in this simulation that you
+	are not seeing as well.  You can very easily follow the entire process by
+	turning on all of the logging components in the system.  Try setting the 
+	``NS_LOG`` variable to the following,
+
+Existe muita coisa acontecendo por baixo dos panos e que não estamos vendo. Podemos facilmente seguir as entradas de processo configurando todos os componentes de registro do sistema. Configure a variável de ``NS_LOG`` da seguinte forma,
+
+::
+
+  export 'NS_LOG=*=level_all|prefix_func|prefix_time'
+
+..
+	The asterisk above is the logging component wildcard.  This will turn on all 
+	of the logging in all of the components used in the simulation.  I won't 
+	reproduce the output here (as of this writing it produces 1265 lines of output
+	for the single packet echo) but you can redirect this information into a file 
+	and look through it with your favorite editor if you like,
+
+O asterisco é um componente coringa, que ira ligar todos os componentes de registro usados na simulação. Não vamos reproduzir a saída aqui (cada pacote de eco produz 1265 linhas de saída), mas podemos redirecionar esta informação para um arquivo e visualizá-lo depois em um editor de textos,
+
+::
+
+  ./waf --run scratch/myfirst > log.out 2>&1
+
+..
+	I personally use this extremely verbose version of logging when I am presented 
+	with a problem and I have no idea where things are going wrong.  I can follow the 
+	progress of the code quite easily without having to set breakpoints and step 
+	through code in a debugger.  I can just edit up the output in my favorite editor
+	and search around for things I expect, and see things happening that I don't 
+	expect.  When I have a general idea about what is going wrong, I transition into
+	a debugger for a fine-grained examination of the problem.  This kind of output 
+	can be especially useful when your script does something completely unexpected.
+	If you are stepping using a debugger you may miss an unexpected excursion 
+	completely.  Logging the excursion makes it quickly visible.
+
+
+utilizamos uma versão extremamente detalhada de registro quando surge um problema e não temos ideia do que está errado. Assim, podemos seguir o andamento do código e depurar o erro. Podemos assim visualizar a saída em um editor de texto e procurar por coisas que nós esperamos e principalmente por coisa que não esperávamos. Quando temos uma ideia geral sobre o que está acontecendo de errado, usamos um depurador de erros para examinarmos de forma mais detalhada o problema. Este tipo de saída pode ser especialmente útil quando nosso `script` faz algo completamente inesperado. Se estivermos depurando o problema passo a passo, podemos nos perder completamente. O registro pode tornar as coisas mais visíveis.
+
+.. 
+	Adding Logging to your Code
+
+Adicionando registros ao Código
++++++++++++++++++++++++++++++++
+
+..
+	You can add new logging to your simulations by making calls to the log 
+	component via several macros.  Let's do so in the ``myfirst.cc`` script we
+	have in the ``scratch`` directory.
+
+Podemos adicionar novos registros nas simulações fazendo chamadas para o componente de registro através de várias macros. Vamos fazer isto em nosso código ``myfirst.cc`` no diretório ``scratch``
+
+..
+	Recall that we have defined a logging component in that script:
+
+Lembre-se que nós temos que definir o componente de registro em nosso código:
+
+::
+
+  NS_LOG_COMPONENT_DEFINE ("FirstScriptExample");
+
+..
+	You now know that you can enable all of the logging for this component by
+	setting the ``NS_LOG`` environment variable to the various levels.  Let's
+	go ahead and add some logging to the script.  The macro used to add an 
+	informational level log message is ``NS_LOG_INFO``.  Go ahead and add one 
+	(just before we start creating the nodes) that tells you that the script is 
+	"Creating Topology."  This is done as in this code snippet,
+
+Agora que sabemos habilitar todos os registros em vários níveis configurando a variável ``NS_LOG``. Vamos adicionar alguns registros ao código. O macro usado para adicionar uma mensagem ao nível de informação é ``NS_LOG_INFO``, então vamos adicionar uma mensagem dessas (pouco antes de criar os nós de rede) que diz que a "Topologia foi Criada". Isto é feito como neste trecho do código,
+
+..
+	Open ``scratch/myfirst.cc`` in your favorite editor and add the line,
+
+Abra o arquivo ``scratch/myfirst.cc`` e adicione a linha,
+
+::
+
+  NS_LOG_INFO ("Creating Topology");
+
+..
+	right before the lines,
+
+antes das linhas,
+
+::
+
+  NodeContainer nodes;
+  nodes.Create (2);
+
+..
+	Now build the script using waf and clear the ``NS_LOG`` variable to turn 
+	off the torrent of logging we previously enabled:
+
+Agora construa o código usando o Waf e limpe a variável ``NS_LOG`` desabilite o registro que nós havíamos habilitado anteriormente: 
+
+::
+
+  ./waf
+  export NS_LOG=
+
+..
+	Now, if you run the script, 
+
+Agora, se executarmos o código,
+
+::
+
+  ./waf --run scratch/myfirst
+
+..
+	you will ``not`` see your new message since its associated logging 
+	component (``FirstScriptExample``) has not been enabled.  In order to see your
+	message you will have to enable the ``FirstScriptExample`` logging component
+	with a level greater than or equal to ``NS_LOG_INFO``.  If you just want to 
+	see this particular level of logging, you can enable it by, 
+
+veremos novas mensagens, pois o componente de registro não está habilitado. Agora para ver a mensagem devemos habilitar o componente de registro do ``FirstScriptExample`` com um nível maior ou igual a ``NS_LOG_INFO``. Se só esperamos ver um nível particular de registro, devemos habilita-lo,
+
+::
+
+  export NS_LOG=FirstScriptExample=info
+
+..
+	If you now run the script you will see your new "Creating Topology" log
+	message,
+
+Agora se executarmos o código veremos nossa mensagem de registro "Creating Topology",
+
+::
+
+  Waf: Entering directory `/home/craigdo/repos/ns-3-allinone/ns-3-dev/build'
+  Waf: Leaving directory `/home/craigdo/repos/ns-3-allinone/ns-3-dev/build'
+  'build' finished successfully (0.404s)
+  Creating Topology
+  Sent 1024 bytes to 10.1.1.2
+  Received 1024 bytes from 10.1.1.1
+  Received 1024 bytes from 10.1.1.2
+
+.. 
+	Using Command Line Arguments
+
+Usando Argumentos na Linha de Comando
+*************************************
+
+.. 
+	Overriding Default Attributes
+
+Sobrepondo Atributos Padrões
++++++++++++++++++++++++++++++
+
+..
+	Another way you can change how |ns3| scripts behave without editing
+	and building is via *command line arguments.*  We provide a mechanism to 
+	parse command line arguments and automatically set local and global variables
+	based on those arguments.
+
+Podemos alterar o comportamento dos códigos do |ns3| sem precisar editar ou construir códigos, isto é feito através de linhas de comandos. Para isto o |ns3| fornece um mecanismo de analise de argumentos de linha de comando (`parse`), que configura automaticamente variáveis locais e globais através desses argumentos.
+
+..
+	The first step in using the command line argument system is to declare the
+	command line parser.  This is done quite simply (in your main program) as
+	in the following code,
+
+O primeiro passo para usar argumentos de linha de comando é declarar o analisador de linha de comandos. Isto é feito com a seguinte linha de programação, em seu programa principal,
+
+::
+
+  int
+  main (int argc, char *argv[])
+  {
+    ...  
+
+    CommandLine cmd;
+    cmd.Parse (argc, argv);
+
+    ...
+  }
+
+..
+	This simple two line snippet is actually very useful by itself.  It opens the
+	door to the |ns3| global variable and ``Attribute`` systems.  Go 
+	ahead and add that two lines of code to the ``scratch/myfirst.cc`` script at
+	the start of ``main``.  Go ahead and build the script and run it, but ask 
+	the script for help in the following way,
+
+Estas duas linhas de programação são muito uteis. Isto abre uma porta para as variáveis globais e atributos do |ns3|. Adicione estas duas linhas no código em nosso exemplo ``scratch/myfirst.cc``, bem no inicio da função principal (``main``). Na sequencia construa o código e execute-o, mas peça para o código "ajudar" da seguinte forma,
+
+::
+
+  ./waf --run "scratch/myfirst --PrintHelp"
+
+..
+	This will ask Waf to run the ``scratch/myfirst`` script and pass the command
+	line argument ``--PrintHelp`` to the script.  The quotes are required to 
+	sort out which program gets which argument.  The command line parser will
+	now see the ``--PrintHelp`` argument and respond with,
+
+Isto pede ao Waf para executar o ``scratch/myfirst`` e passa via linha de comando o argumento ``--PrintHelp``. As aspas são necessárias para ordenar os argumentos. O analisador de linhas de comandos agora tem como argumento o ``--PrintHelp`` e responde com,
+
+::
+
+  Waf: Entering directory `/home/craigdo/repos/ns-3-allinone/ns-3-dev/build'
+  Waf: Leaving directory `/home/craigdo/repos/ns-3-allinone/ns-3-dev/build'
+  'build' finished successfully (0.413s)
+  TcpL4Protocol:TcpStateMachine()
+  CommandLine:HandleArgument(): Handle arg name=PrintHelp value=
+  --PrintHelp: Print this help message.
+  --PrintGroups: Print the list of groups.
+  --PrintTypeIds: Print all TypeIds.
+  --PrintGroup=[group]: Print all TypeIds of group.
+  --PrintAttributes=[typeid]: Print all attributes of typeid.
+  --PrintGlobals: Print the list of globals.
+
+..
+	Let's focus on the ``--PrintAttributes`` option.  We have already hinted
+	at the |ns3| ``Attribute`` system while walking through the 
+	``first.cc`` script.  We looked at the following lines of code,
+
+Vamos focar na opção ``--PrintAttributes``. Já demos a dica sobre atributos no |ns3| enquanto explorávamos o código do ``first.cc``. Nós olhamos as seguintes linhas de código,
+
+::
+
+    PointToPointHelper pointToPoint;
+    pointToPoint.SetDeviceAttribute ("DataRate", StringValue ("5Mbps"));
+    pointToPoint.SetChannelAttribute ("Delay", StringValue ("2ms"));
+
+..
+	and mentioned that ``DataRate`` was actually an ``Attribute`` of the 
+	``PointToPointNetDevice``.  Let's use the command line argument parser
+	to take a look at the ``Attributes`` of the PointToPointNetDevice.  The help
+	listing says that we should provide a ``TypeId``.  This corresponds to the
+	class name of the class to which the ``Attributes`` belong.  In this case it
+	will be ``ns3::PointToPointNetDevice``.  Let's go ahead and type in,
+
+e mencionamos que ``DataRate`` é um atributo de ``PointToPointNetDevice``. Vamos usar os argumentos de linha de comando para ver os atributos de ``PointToPointNetDevice``. A lista de ajuda diz que nós devemos fornecer um ``TypeId``, este corresponde ao nome da classe do atributo. Neste caso será ``ns3::PointToPointNetDevice``. Seguindo em frente digite,
+
+::
+
+  ./waf --run "scratch/myfirst --PrintAttributes=ns3::PointToPointNetDevice"
+
+..
+	The system will print out all of the ``Attributes`` of this kind of net device.
+	Among the ``Attributes`` you will see listed is,
+
+O sistema irá mostrar todos os atributos dos tipos de dispositivos de rede (`net device`). Entre os atributos veremos, 
+
+::
+
+  --ns3::PointToPointNetDevice::DataRate=[32768bps]:
+    The default data rate for point to point links
+
+..
+	This is the default value that will be used when a ``PointToPointNetDevice``
+	is created in the system.  We overrode this default with the ``Attribute``
+	setting in the ``PointToPointHelper`` above.  Let's use the default values 
+	for the point-to-point devices and channels by deleting the 
+	``SetDeviceAttribute`` call and the ``SetChannelAttribute`` call from 
+	the ``myfirst.cc`` we have in the scratch directory.
+
+.. 
+	>> rever revisão
+
+32768 bits por segundos é o valor padrão que será usado quando criarmos um ``PointToPointNetDevice`` no sistema. Vamos alterar este valor padrão do ``PointToPointHelper``. Para isto iremos usar os valores dos dispositivos ponto-a-ponto e dos canais, deletando a chamada ``SetDeviceAttribute`` e ``SetChannelAttribute`` do ``myfirst.cc``, que nós temos no diretório ``scratch``.
+
+..
+	Your script should now just declare the ``PointToPointHelper`` and not do 
+	any ``set`` operations as in the following example,
+
+Nosso código agora deve apenas declarar o ``PointToPointHelper`` sem configurar qualquer operação, como no exemplo a seguir,
+
+::
+
+  ...
+
+  NodeContainer nodes;
+  nodes.Create (2);
+
+  PointToPointHelper pointToPoint;
+
+  NetDeviceContainer devices;
+  devices = pointToPoint.Install (nodes);
+
+  ...
+
+..
+	Go ahead and build the new script with Waf (``./waf``) and let's go back 
+	and enable some logging from the UDP echo server application and turn on the 
+	time prefix.
+
+Agora construa o novo código com o Waf (``./waf``) e depois vamos habilitar alguns registros para o servidor de eco UDP e ligar o prefixo de informações sobre tempo de execução.
+
+::
+
+  export 'NS_LOG=UdpEchoServerApplication=level_all|prefix_time'
+
+..
+	If you run the script, you should now see the following output,
+
+Agora ao executar o código veremos a seguinte saída,
+
+::
+
+  Waf: Entering directory `/home/craigdo/repos/ns-3-allinone/ns-3-dev/build'
+  Waf: Leaving directory `/home/craigdo/repos/ns-3-allinone/ns-3-dev/build'
+  'build' finished successfully (0.405s)
+  0s UdpEchoServerApplication:UdpEchoServer()
+  1s UdpEchoServerApplication:StartApplication()
+  Sent 1024 bytes to 10.1.1.2
+  2.25732s Received 1024 bytes from 10.1.1.1
+  2.25732s Echoing packet
+  Received 1024 bytes from 10.1.1.2
+  10s UdpEchoServerApplication:StopApplication()
+  UdpEchoServerApplication:DoDispose()
+  UdpEchoServerApplication:~UdpEchoServer()
+
+..
+	Recall that the last time we looked at the simulation time at which the packet
+	was received by the echo server, it was at 2.00369 seconds.
+
+Lembre-se que o último tempo que vimos na simulação quando recebemos um pacote de eco no servidor, foi de 2.00369 segundos.
+
+::
+
+  2.00369s UdpEchoServerApplication:HandleRead(): Received 1024 bytes from 10.1.1.1
+
+..
+	Now it is receiving the packet at 2.25732 seconds.  This is because we just dropped
+	the data rate of the ``PointToPointNetDevice`` down to its default of 
+	32768 bits per second from five megabits per second.
+
+Agora o pacote é recebido em 2.25732 segundos. Isto porque retiramos a taxa de transferência do ``PointToPointNetDevice`` e portanto foi assumido o valor padrão 32768 bits por segundos ao invés de cinco megabits por segundo.
+
+..
+	If we were to provide a new ``DataRate`` using the command line, we could 
+	speed our simulation up again.  We do this in the following way, according to
+	the formula implied by the help item:
+
+Se nós passarmos uma nova taxa de dados usando a linha de comando, podemos aumentar a velocidade da rede novamente. Nós podemos fazer isto da seguinte forma, usando um `help`:
+
+::
+
+  ./waf --run "scratch/myfirst --ns3::PointToPointNetDevice::DataRate=5Mbps"
+
+..
+	This will set the default value of the ``DataRate`` ``Attribute`` back to 
+	five megabits per second.  Are you surprised by the result?  It turns out that
+	in order to get the original behavior of the script back, we will have to set 
+	the speed-of-light delay of the channel as well.  We can ask the command line 
+	system to print out the ``Attributes`` of the channel just like we did for
+	the net device:
+
+Isto ira configurar o valor do atributo ``DataRate`` para cinco megabits por segundos. Ficou surpreso com o resultado? Acontece que para obtermos o resultado do código original, teremos que configurar também o atraso do canal de comunicação. Podemos fazer isto via linha de comandos, tal como fizemos com o dispositivo de rede:
+
+::
+
+  ./waf --run "scratch/myfirst --PrintAttributes=ns3::PointToPointChannel"
+
+..
+	We discover the ``Delay`` ``Attribute`` of the channel is set in the following
+	way:
+
+Então descobrimos que o atributo ``Delay`` do canal esta configurado com o seguinte valor padrão:
+
+::
+
+  --ns3::PointToPointChannel::Delay=[0ns]:
+    Transmission delay through the channel
+
+..
+	We can then set both of these default values through the command line system,
+
+Podemos configurar ambos valores via linha de comando,
+
+::
+
+  ./waf --run "scratch/myfirst
+    --ns3::PointToPointNetDevice::DataRate=5Mbps
+    --ns3::PointToPointChannel::Delay=2ms"
+
+..
+	in which case we recover the timing we had when we explicitly set the
+	``DataRate`` and ``Delay`` in the script:
+
+neste caso voltamos com os tempos de ``DataRate`` e ``Delay`` que tínhamos inicialmente no código original:
+
+::
+
+  Waf: Entering directory `/home/craigdo/repos/ns-3-allinone/ns-3-dev/build'
+  Waf: Leaving directory `/home/craigdo/repos/ns-3-allinone/ns-3-dev/build'
+  'build' finished successfully (0.417s)
+  0s UdpEchoServerApplication:UdpEchoServer()
+  1s UdpEchoServerApplication:StartApplication()
+  Sent 1024 bytes to 10.1.1.2
+  2.00369s Received 1024 bytes from 10.1.1.1
+  2.00369s Echoing packet
+  Received 1024 bytes from 10.1.1.2
+  10s UdpEchoServerApplication:StopApplication()
+  UdpEchoServerApplication:DoDispose()
+  UdpEchoServerApplication:~UdpEchoServer()
+
+..
+	Note that the packet is again received by the server at 2.00369 seconds.  We 
+	could actually set any of the ``Attributes`` used in the script in this way.
+	In particular we could set the ``UdpEchoClient Attribute MaxPackets`` 
+	to some other value than one.
+
+Repare que o pacote é recebido novamente pelo servidor com 2.00369 segundos. Então desta forma, podemos configurar qualquer atributo usado no código. Em particular nós podemos configurar o atributo ``MaxPackets`` do ``UdpEchoClient`` para qualquer outro valor.
+
+..
+	How would you go about that?  Give it a try.  Remember you have to comment 
+	out the place we override the default ``Attribute`` and explicitly set 
+	``MaxPackets`` in the script.  Then you have to rebuild the script.  You 
+	will also have to find the syntax for actually setting the new default attribute
+	value using the command line help facility.  Once you have this figured out 
+	you should be able to control the number of packets echoed from the command 
+	line.  Since we're nice folks, we'll tell you that your command line should 
+	end up looking something like,
+
+É importante lembrar que devemos retirar todas as configurações com valores explícitos do código. Depois disto devemos re-construir o código (fazer novamente os binários). Também teremos que achar a sintaxe do atributo usando o `help` da linha de comando. Uma vez que tenhamos este cenário estaremos aptos para controlar o números de pacotes ecoados via linha de comando. No final a linha de comando deve parecer com algo como:
+
+::
+
+  ./waf --run "scratch/myfirst 
+    --ns3::PointToPointNetDevice::DataRate=5Mbps 
+    --ns3::PointToPointChannel::Delay=2ms 
+    --ns3::UdpEchoClient::MaxPackets=2"
+
+.. 
+	Hooking Your Own Values
+
+.. 
+	>> rever tradução de Hooking neste contexto
+
+Conectando Seus Próprios Valores
+++++++++++++++++++++++++++++++++
+..
+	You can also add your own hooks to the command line system.  This is done
+	quite simply by using the ``AddValue`` method to the command line parser.
+
+Podemos também adicionar conectores (opções que alteram valores de variáveis) ao sistema de linha de comando. Isto nada mais é do que criar uma opção na linha de comando, a qual permitirá a configuração de uma variável dentro do código. Isto é feito usando o método ``AddValue`` no analisador da linha de comando.
+
+..
+	Let's use this facility to specify the number of packets to echo in a 
+	completely different way.  Let's add a local variable called ``nPackets``
+	to the ``main`` function.  We'll initialize it to one to match our previous 
+	default behavior.  To allow the command line parser to change this value, we
+	need to hook the value into the parser.  We do this by adding a call to 
+	``AddValue``.  Go ahead and change the ``scratch/myfirst.cc`` script to
+	start with the following code,
+
+Vamos usar esta facilidade para especificar o número de pacotes de eco de uma forma completamente diferente. Iremos adicionar uma variável local chamada ``nPackets`` na função ``main``. Vamos iniciar com nosso valor anterior. Para permitir que a linha de comando altere este valor, precisamos fixar o valor no `parser`. Fazemos isto adicionando uma chamada para ``AddValue``. Altere o código ``scratch/myfirst.cc`` começando pelo seguinte trecho de código,
+
+::
+
+  int
+  main (int argc, char *argv[])
+  {
+    uint32_t nPackets = 1;
+
+    CommandLine cmd;
+    cmd.AddValue("nPackets", "Number of packets to echo", nPackets);
+    cmd.Parse (argc, argv);
+
+    ...
+
+..
+	Scroll down to the point in the script where we set the ``MaxPackets``
+	``Attribute`` and change it so that it is set to the variable ``nPackets``
+	instead of the constant ``1`` as is shown below.
+
+Dê uma olhada um pouco mais para baixo, no código e veja onde configuramos o atributo ``MaxPackets``, retire o ``1`` e coloque em seu lugar a variável ``nPackets``, como é mostrado a seguir:
+
+::
+
+  echoClient.SetAttribute ("MaxPackets", UintegerValue (nPackets));
+
+..
+	Now if you run the script and provide the ``--PrintHelp`` argument, you 
+	should see your new ``User Argument`` listed in the help display.
+
+Agora se executarmos o código e fornecermos o argumento ``--PrintHelp``, deveremos ver nosso argumento de usuário (`User Arguments`), listado no `help`.
+
+..
+	Try,
+
+Execute,
+
+::
+
+  ./waf --run "scratch/myfirst --PrintHelp"
+
+::
+
+  Waf: Entering directory `/home/craigdo/repos/ns-3-allinone/ns-3-dev/build'
+  Waf: Leaving directory `/home/craigdo/repos/ns-3-allinone/ns-3-dev/build'
+  'build' finished successfully (0.403s)
+  --PrintHelp: Print this help message.
+  --PrintGroups: Print the list of groups.
+  --PrintTypeIds: Print all TypeIds.
+  --PrintGroup=[group]: Print all TypeIds of group.
+  --PrintAttributes=[typeid]: Print all attributes of typeid.
+  --PrintGlobals: Print the list of globals.
+  User Arguments:
+      --nPackets: Number of packets to echo
+
+..
+	If you want to specify the number of packets to echo, you can now do so by
+	setting the ``--nPackets`` argument in the command line,
+
+Agora para especificar o número de pacotes de eco podemos utilizar o argumento ``--nPackets`` na linha de comando, 
+
+::
+
+  ./waf --run "scratch/myfirst --nPackets=2"
+
+..
+	You should now see
+
+Agora deveremos ver,
+
+::
+
+  Waf: Entering directory `/home/craigdo/repos/ns-3-allinone/ns-3-dev/build'
+  Waf: Leaving directory `/home/craigdo/repos/ns-3-allinone/ns-3-dev/build'
+  'build' finished successfully (0.404s)
+  0s UdpEchoServerApplication:UdpEchoServer()
+  1s UdpEchoServerApplication:StartApplication()
+  Sent 1024 bytes to 10.1.1.2
+  2.25732s Received 1024 bytes from 10.1.1.1
+  2.25732s Echoing packet
+  Received 1024 bytes from 10.1.1.2
+  Sent 1024 bytes to 10.1.1.2
+  3.25732s Received 1024 bytes from 10.1.1.1
+  3.25732s Echoing packet
+  Received 1024 bytes from 10.1.1.2
+  10s UdpEchoServerApplication:StopApplication()
+  UdpEchoServerApplication:DoDispose()
+  UdpEchoServerApplication:~UdpEchoServer()
+
+..
+	You have now echoed two packets.  Pretty easy, isn't it?
+
+Agora, ecoamos dois pacotes. Muito fácil, não é?
+
+..
+	You can see that if you are an |ns3| user, you can use the command 
+	line argument system to control global values and ``Attributes``.  If you are
+	a model author, you can add new ``Attributes`` to your ``Objects`` and 
+	they will automatically be available for setting by your users through the
+	command line system.  If you are a script author, you can add new variables to 
+	your scripts and hook them into the command line system quite painlessly.
+
+Usando o |ns3|, podemos usar argumentos via linha de comando para controlar valores de atributos. Ao construir modelos de simulação podemos adicionar novos atributos aos objetos e isto ficará disponível, automaticamente para ajustes através do sistema via linha de comando. Ao criarmos nossos códigos poderemos adicionar novas variáveis e conectá-las ao sistema de forma simples.
+
+.. 
+	Using the Tracing System
+
+Usando o Sistema de Rastreamento
+********************************
+
+..
+	The whole point of simulation is to generate output for further study, and 
+	the |ns3| tracing system is a primary mechanism for this.  Since 
+	|ns3| is a C++ program, standard facilities for generating output 
+	from C++ programs could be used:  
+
+O ponto principal da simulação é gerar informações de saída para estudos futuros e o sistema de rastreamento (`Tracing System`) do |ns3| é o mecanismo primário para isto. Devido ao fato do |ns3| ser um programa escrito em C++, as funcionalidades para se gerar saídas podem ser utilizadas:
+
+::
+
+  #include <iostream>
+  ...
+  int main ()
+  {
+    ...
+    std::cout << "The value of x is " << x << std::endl;
+    ...
+  } 
+
+..
+	You could even use the logging module to add a little structure to your 
+	solution.  There are many well-known problems generated by such approaches
+	and so we have provided a generic event tracing subsystem to address the 
+	issues we thought were important.
+
+Podemos usar o módulo de registro (visto anteriormente) para verificar pequenas estruturas de nossas soluções. Porém, os problemas gerados por esta abordagem já são bem conhecidos e portanto fornecemos um subsistema para rastrear eventos genéricos para localizar problemas importantes.
+
+..
+	The basic goals of the |ns3| tracing system are:
+
+Os objetivos básicos do sistema de rastreamento |ns3| são:
+
+..
+	* For basic tasks, the tracing system should allow the user to generate 
+	  standard tracing for popular tracing sources, and to customize which objects
+	  generate the tracing;
+	* Intermediate users must be able to extend the tracing system to modify
+	  the output format generated, or to insert new tracing sources, without 
+	  modifying the core of the simulator;
+	* Advanced users can modify the simulator core to add new tracing sources
+	  and sinks.
+
+* Para as tarefas básicas, o sistemas de rastreamento fornece ao usuário um rastreamento padrão através de rastreamentos conhecidos e customização dos objetos que geram o rastreamento;
+* Os usuários podem estender o sistema de rastreamento para modificar os formatos das saídas geradas ou inserir novas fontes de rastreamento, sem modificar o núcleo do simulador;
+* Usuários avançados podem modificar o núcleo do simulador para adicionar novas origens de rastreamentos e destino do rastreamento.
+
+..
+	The |ns3| tracing system is built on the concepts of independent 
+	tracing sources and tracing sinks, and a uniform mechanism for connecting
+	sources to sinks.  Trace sources are entities that can signal events that
+	happen in a simulation and provide access to interesting underlying data. 
+	For example, a trace source could indicate when a packet is received by a net
+	device and provide access to the packet contents for interested trace sinks.
+
+
+O sistema de rastreamento do |ns3| é feito através de conceitos independentes de rasteamento na origem e no destino, e um mecanismo uniforme para conectar a origem ao destino. O rastreador na origem são entidades que podem demonstrar eventos que ocorrem na simulação e fornece acesso aos dados importantes. Por exemplo, um rastreador de origem podem indicar quando um pacote é recebido por um dispositivo de rede e prove acesso aos comentários de pacote para os interessados no rastreador do destino.
+
+..
+	Trace sources are not useful by themselves, they must be "connected" to
+	other pieces of code that actually do something useful with the information 
+	provided by the sink.  Trace sinks are consumers of the events and data
+	provided by the trace sources.  For example, one could create a trace sink 
+	that would (when connected to the trace source of the previous example) print 
+	out interesting parts of the received packet.
+
+Os rastreadores de origem não são usados sozinhos, eles devem ser "conectados" a outros pedaços de código que fazem alguma coisa útil com a informação fornecida pelo destino. Rastreador de destino são consumidores dos eventos e dados fornecidos pelos rastreadores de origem. Por exemplo, pode-se criar um rastreador de destino que (quando conectado ao rastreador de origem do exemplo anterior) mostrará saídas de partes importantes de pacotes recebidos.
+
+..
+	The rationale for this explicit division is to allow users to attach new
+	types of sinks to existing tracing sources, without requiring editing and 
+	recompilation of the core of the simulator.  Thus, in the example above, 
+	a user could define a new tracing sink in her script and attach it to an 
+	existing tracing source defined in the simulation core by editing only the 
+	user script.
+
+A lógica desta divisão explicita é permitir que os usuários apliquem novos tipos de rastreadores de destinos em rastreadores de origem existentes, sem precisar editar ou recompilar o núcleo do simulador. Assim, no exemplo anterior, o usuário pode definir um novo rastreador de destino em seu código e aplicar isto a um rastreador de origem definido no núcleo da simulação editando, para isto, somente o código do usuário.
+
+..
+	In this tutorial, we will walk through some pre-defined sources and sinks and
+	show how they may be customized with little user effort.  See the ns-3 manual
+	or how-to sections for information on advanced tracing configuration including
+	extending the tracing namespace and creating new tracing sources.
+
+Neste tutorial, abordamos alguns rastreadores de origem e de destino já predefinidos e demonstramos como esses podem ser customizados, com um pouco de esforço. Veja o manual do ns-3 ou a seção de `how-to` para informações avançadas sobre configuração de rastreamento incluindo extensão do `namespace` de rastreamento e criação de novos rastreadores de origem.
+
+.. 
+	ASCII Tracing
+
+Rastreamento ASCII
+++++++++++++++++++
+
+..
+	|ns3| provides helper functionality that wraps the low-level tracing
+	system to help you with the details involved in configuring some easily 
+	understood packet traces.  If you enable this functionality, you will see
+	output in a ASCII files --- thus the name.  For those familiar with 
+	|ns2| output, this type of trace is analogous to the ``out.tr``
+	generated by many scripts.
+
+O |ns3| fornece uma funcionalidade de ajuda (`helper`) que cobre rastreamento em baixo nível e ajuda com detalhes envolvendo configuração e rastros de pacotes. Se habilitarmos essa funcionalidade, veremos as saídas em arquivos ASCII (texto puro) --- daí o nome. Isto é parecido com a saída do |ns2|. Este tipo de rastreamento é parecido com o ``out.tr`` gerado por outros códigos.
+
+..
+	Let's just jump right in and add some ASCII tracing output to our 
+	``scratch/myfirst.cc`` script.  Right before the call to 
+	``Simulator::Run ()``, add the following lines of code:
+
+Vamos adicionar algumas saídas de rastreamento ASCII em nosso código ``scratch/myfirst.cc``. Antes de chamar ``Simulator::Run ()`` adicione as seguintes linhas de código:
+
+::
+
+  AsciiTraceHelper ascii;
+  pointToPoint.EnableAsciiAll (ascii.CreateFileStream ("myfirst.tr"));
+
+..
+	Like in many other |ns3| idioms, this code uses a  helper object to 
+	help create ASCII traces.  The second line contains two nested method calls.  
+	The "inside" method, ``CreateFileStream()`` uses an unnamed object idiom
+	to create a file stream object on the stack (without an object  name) and pass
+	it down to the called method.  We'll go into this more in the future, but all
+	you have to know at this point is that you are creating an object representing
+	a file named "myfirst.tr" and passing it into ``ns-3``.  You are telling 
+	``ns-3`` to deal with the lifetime issues of the created object and also to 
+	deal with problems caused by a little-known (intentional) limitation of C++ 
+	ofstream objects relating to copy constructors. 
+
+.. 
+	>> rever tradução no final o que é ofstream?
+
+Tal como já vimos no |ns3|, este código usa o objeto Assistente para criar o rastreador ASCII. A segunda linha aninhada duas chamadas para métodos. Dentro do método ``CreateFileStream()`` é utilizado um objeto para criar um outro objeto, que trata um arquivo, que é passado para o método. Iremos detalhar isto depois, agora tudo que precisamos saber é que estamos criando um objeto que representa um arquivo chamado "myfirst.tr". Estamos dizendo para o ``ns-3`` tratar problemas de criação de objetos e também para tratar problemas causados por limitações do C++ com objetos relacionados com cópias de construtores.
+
+..
+	The outside call, to ``EnableAsciiAll()``, tells the helper that you 
+	want to enable ASCII tracing on all point-to-point devices in your simulation; 
+	and you want the (provided) trace sinks to write out information about packet 
+	movement in ASCII format.
+
+Fora da chamada, para ``EnableAsciiAll()``, dizemos para o Assistente que esperamos habilitar o rastreamento ASCII para todo dispositivo ponto-a-ponto da simulação; e esperamos rastrear destinos e escrever as informações de saída sobre o movimento de pacotes no formato ASCII.
+
+..
+	For those familiar with |ns2|, the traced events are equivalent to 
+	the popular trace points that log "+", "-", "d", and "r" events.
+
+Para queles familiarizados com |ns2|, os eventos rastreados são equivalentes aos populares pontos de rastreadores (`trace points`) que registram eventos "+", "-", "d", e "r"  
+
+..
+	You can now build the script and run it from the command line:
+
+Agora podemos construir o código e executa-lo:
+
+::
+
+  ./waf --run scratch/myfirst
+
+..
+	Just as you have seen many times before, you will see some messages from Waf and then
+	"'build' finished successfully" with some number of messages from 
+	the running program.  
+
+Veremos algumas mensagens do Waf, seguida da mensagem "'build' finished successfully", bem como algumas mensagens do programa.
+
+..
+	When it ran, the program will have created a file named ``myfirst.tr``.  
+	Because of the way that Waf works, the file is not created in the local 
+	directory, it is created at the top-level directory of the repository by 
+	default.  If you want to control where the traces are saved you can use the 
+	``--cwd`` option of Waf to specify this.  We have not done so, thus we 
+	need to change into the top level directory of our repo and take a look at 
+	the ASCII trace file ``myfirst.tr`` in your favorite editor.
+
+Quando isto for executado, o programa criará um arquivo chamado ``myfirst.tr``. Devido a forma que o Waf trabalha, o arquivo não é criado no diretório local, mas sim no diretório raiz do repositório. Se você espera controlar o que é salvo, então use a opção ``-cwd`` do Waf. Agora mude para o diretório raiz do repositório e veja o arquivo ``myfirst.tr`` com um editor de texto.
+
+.. 
+	Parsing Ascii Traces
+
+Análise de Rastros ASCII
+~~~~~~~~~~~~~~~~~~~~~~~~
+..
+	There's a lot of information there in a pretty dense form, but the first thing
+	to otice is that there are a number of distinct lines in this file.  It may
+	be difficult to see this clearly unless you widen your window considerably.
+
+Uma grande quantidade de informação é gerada pelo sistema de rastreamento e pode ser difícil analisá-las de forma clara e consistente.
+
+..
+	Each line in the file corresponds to a *trace event*.  In this case
+	we are tracing events on the *transmit queue* present in every 
+	point-to-point net device in the simulation.  The transmit queue is a queue 
+	through which every packet destined for a point-to-point channel must pass.
+	Note that each line in the trace file begins with a lone character (has a 
+	space after it).  This character will have the following meaning:
+
+Cada linha do arquivo corresponde a um evento de rastreamento (`trace event`). Neste caso são eventos rastreados da fila de transmissão (`transmit queue`). A fila de transmissão é um lugar através do qual todo pacote destinado para o canal ponto-a-ponto deve passar. Note que cada linha no arquivo inicia com um único caractere (com um espaço depois). Este caractere tem o seguinte significado:
+
+..
+	* ``+``: An enqueue operation occurred on the device queue;
+	* ``-``: A dequeue operation occurred on the device queue;
+	* ``d``: A packet was dropped, typically because the queue was full;
+	* ``r``: A packet was received by the net device.
+
+* ``+``: Uma operação de enfileiramento (bloqueio) ocorreu no dispositivo de fila;
+* ``-``: Uma operação de desenfileiramento (desbloqueio) ocorre no dispositivo de fila;
+* ``d``: Um pacote foi descartado, normalmente por que a fila está cheia;
+* ``r``: Um pacote foi recebido por um dispositivo de rede.
+
+..
+	Let's take a more detailed view of the first line in the trace file.  I'll 
+	break it down into sections (indented for clarity) with a two digit reference
+	number on the left side:
+
+Vamos detalhar mais a primeira linha do arquivo de rastreamento. Vamos dividi-la em seções com números de dois dígitos para referência:
+
+::
+
+  00 + 
+  01 2 
+  02 /NodeList/0/DeviceList/0/$ns3::PointToPointNetDevice/TxQueue/Enqueue 
+  03 ns3::PppHeader (
+  04   Point-to-Point Protocol: IP (0x0021)) 
+  05   ns3::Ipv4Header (
+  06     tos 0x0 ttl 64 id 0 protocol 17 offset 0 flags [none] 
+  07     length: 1052 10.1.1.1 > 10.1.1.2)
+  08     ns3::UdpHeader (
+  09       length: 1032 49153 > 9) 
+  10       Payload (size=1024)
+
+..
+	The first line of this expanded trace event (reference number 00) is the 
+	operation.  We have a ``+`` character, so this corresponds to an
+	*enqueue* operation on the transmit queue.  The second line (reference 01)
+	is the simulation time expressed in seconds.  You may recall that we asked the 
+	``UdpEchoClientApplication`` to start sending packets at two seconds.  Here
+	we see confirmation that this is, indeed, happening.
+
+A primeira linha do evento expandido (referência número 00) é a operação. Temos um caractere ``+``, que corresponde a uma operação de enfileiramento na fila de transmissão. A segunda linha (referência 01) é o tempo da simulação em segundos. Lembre-se que pedimos ao ``UdpEchoClientApplication`` para iniciar o envio de pacotes depois de dois segundos (aqui podemos confirmar que isto está acontecendo).
+
+..
+	The next line of the example trace (reference 02) tell us which trace source
+	originated this event (expressed in the tracing namespace).  You can think
+	of the tracing namespace somewhat like you would a filesystem namespace.  The 
+	root of the namespace is the ``NodeList``.  This corresponds to a container
+	managed in the |ns3| core code that contains all of the nodes that are
+	created in a script.  Just as a filesystem may have directories under the 
+	root, we may have node numbers in the ``NodeList``.  The string 
+	``/NodeList/0`` therefore refers to the zeroth node in the ``NodeList``
+	which we typically think of as "node 0".  In each node there is a list of 
+	devices that have been installed.  This list appears next in the namespace.
+	You can see that this trace event comes from ``DeviceList/0`` which is the 
+	zeroth device installed in the node. 
+
+A próxima linha do exemplo (referência 02) diz qual rastreador de origem iniciou este evento (expressado pelo `namespace` de rastreamento). Podemos pensar no `namespace` do rastreamento como algo parecido com um sistema de arquivos. A raiz do `namespace` é o ``NodeList``. Este corresponde a um gerenciador de `container` no núcleo |ns3| que contém todos os nós de rede que foram criados no código. Assim, como um sistema de arquivos pode ter diretórios dentro da raiz, podemos ter nós de rede no ``NodeList``. O texto ``/NodeList/0`` desta forma refere-se ao nó de rede 0 (zero) no ``NodeList``, ou seja é o "node 0". Em cada nós existe uma lista de dispositivos que estão instalados nestes nós de rede. Esta lista aparece depois do `namespace`. Podemos ver que este evento de rastreamento vem do ``DeviceList/0`` que é o dispositivo 0 instalado neste nó.
+
+..
+	The next string, ``$ns3::PointToPointNetDevice`` tells you what kind of 
+	device is in the zeroth position of the device list for node zero.
+	Recall that the operation ``+`` found at reference 00 meant that an enqueue 
+	operation happened on the transmit queue of the device.  This is reflected in 
+	the final segments of the "trace path" which are ``TxQueue/Enqueue``.
+
+O próximo texto, ``$ns3::PointToPointNetDevice`` informa qual é o tipo de dispositivo na posição zero da lista de dispositivos para o nó 0 (`node 0`). Lembre-se que a operação ``+`` significa que uma operação de enfileiramento está acontecendo na fila de transmissão do dispositivo. Isto reflete no segmento final do caminho de rastreamento, que são ``TxQueue/Enqueue``.
+
+..
+	The remaining lines in the trace should be fairly intuitive.  References 03-04
+	indicate that the packet is encapsulated in the point-to-point protocol.  
+	References 05-07 show that the packet has an IP version four header and has
+	originated from IP address 10.1.1.1 and is destined for 10.1.1.2.  References
+	08-09 show that this packet has a UDP header and, finally, reference 10 shows
+	that the payload is the expected 1024 bytes.
+
+As linhas restantes no rastreamento devem ser intuitivas. As referências 03-04 indicam que o pacote é encapsulado pelo protocolo ponto-a-ponto. Referencias 05-07 mostram que foi usado o cabeçalho do IP na versão 4, o endereço IP de origem é o 10.1.1.1 e o destino é o 10.1.1.2. As referências 08-09 mostram que o pacote tem um cabeçalho UDP e finalmente na referência 10 é apresentado que a área de dados possui 1024 bytes.
+
+..
+	The next line in the trace file shows the same packet being dequeued from the
+	transmit queue on the same node. 
+
+A próxima linha do arquivo de rastreamento mostra que o mesmo pacote inicia o desenfileiramento da fila de transmissão do mesmo nó de rede.
+
+..
+	The Third line in the trace file shows the packet being received by the net
+	device on the node with the echo server. I have reproduced that event below.
+
+A terceira linha no arquivo mostra o pacote sendo recebido pelo dispositivo de rede no nó que representa o servidor de eco. Reproduzimos o evento a seguir.
+
+::
+
+  00 r 
+  01 2.25732 
+  02 /NodeList/1/DeviceList/0/$ns3::PointToPointNetDevice/MacRx 
+  03   ns3::Ipv4Header (
+  04     tos 0x0 ttl 64 id 0 protocol 17 offset 0 flags [none]
+  05     length: 1052 10.1.1.1 > 10.1.1.2)
+  06     ns3::UdpHeader (
+  07       length: 1032 49153 > 9) 
+  08       Payload (size=1024)
+
+..
+	Notice that the trace operation is now ``r`` and the simulation time has
+	increased to 2.25732 seconds.  If you have been following the tutorial steps
+	closely this means that you have left the ``DataRate`` of the net devices
+	and the channel ``Delay`` set to their default values.  This time should 
+	be familiar as you have seen it before in a previous section.
+
+A operação agora é o ``r`` e o tempo de simulação foi incrementado para 2.25732 segundos. Se você seguiu os passos do tutorial isto significa que temos o tempo padrão tanto para ``DataRate`` quanto para o ``Delay``. Já vimos este tempo na seção anterior.
+
+..
+	The trace source namespace entry (reference 02) has changed to reflect that
+	this event is coming from node 1 (``/NodeList/1``) and the packet reception
+	trace source (``/MacRx``).  It should be quite easy for you to follow the 
+	progress of the packet through the topology by looking at the rest of the 
+	traces in the file.
+
+Na referência 02, a entrada para o `namespace` foi alterada para refletir o evento vindo do nó 1 (``/NodeList/1``) e o recebimento do pacote no rastreador de origem (``/MacRx``). Isto deve facilitar o acompanhamento dos pacotes através da topologia, pois basta olhar os rastros no arquivo.
+
+.. 
+	PCAP Tracing
+
+Rastreamento PCAP
++++++++++++++++++
+
+..
+	The |ns3| device helpers can also be used to create trace files in the
+	``.pcap`` format.  The acronym pcap (usually written in lower case) stands
+	for packet capture, and is actually an API that includes the 
+	definition of a ``.pcap`` file format.  The most popular program that can
+	read and display this format is Wireshark (formerly called Ethereal).
+	However, there are many traffic trace analyzers that use this packet format.
+	We encourage users to exploit the many tools available for analyzing pcap
+	traces.  In this tutorial, we concentrate on viewing pcap traces with tcpdump.
+
+Também podemos usar o formato ``.pcap`` para fazer rastreamento no |ns3|. O pcap (normalmente escrito em letras minúsculas) permite a captura de pacotes e é uma API que inclui a descrição de um arquivo no formato ``.pcap``. O programa mais conhecido para ler o mostrar este formato é o Wireshark (formalmente chamado de Etherreal). Entretanto, existem muitos analisadores de tráfego que usam este formato. Nós encorajamos que os usuários explorem várias ferramentas disponíveis para análise do pcap. Neste tutorial nos concentraremos em dar uma rápida olhada no tcpdump.
+
+..
+	The code used to enable pcap tracing is a one-liner.  
+
+O código usado para habilitar o rastreamento pcap consiste de uma linha.
+
+::
+
+  pointToPoint.EnablePcapAll ("myfirst");
+
+..
+	Go ahead and insert this line of code after the ASCII tracing code we just 
+	added to ``scratch/myfirst.cc``.  Notice that we only passed the string
+	"myfirst," and not "myfirst.pcap" or something similar.  This is because the 
+	parameter is a prefix, not a complete file name.  The helper will actually 
+	create a trace file for every point-to-point device in the simulation.  The 
+	file names will be built using the prefix, the node number, the device number
+	and a ".pcap" suffix.
+
+Insira esta linha depois do código do rastreamento ASCII, no arquivo ``scratch/myfirst.cc``. Repare que passamos apenas o texto "myfirst" e não "myfirst.pcap", isto ocorre por que é um prefixo e não um nome de arquivo completo. O assistente irá criar um arquivo contendo um prefixo e o número do nó de rede, o número de dispositivo e o sufixo ".pcap".
+
+..
+	In our example script, we will eventually see files named "myfirst-0-0.pcap" 
+	and "myfirst-1-0.pcap" which are the pcap traces for node 0-device 0 and 
+	node 1-device 0, respectively.
+
+Em nosso código, nós iremos ver arquivos chamados "myfirst-0-0.pcap" 
+e  "myfirst-1-0.pcap" que são rastreamentos pcap do dispositivo 0 do nó 0 e do dispositivo 0 do nó de rede 1, respectivamente.
+
+..
+	Once you have added the line of code to enable pcap tracing, you can run the
+	script in the usual way:
+
+Uma vez que adicionamos a linha de código que habilita o rastreamento pcap, podemos executar o código da forma habitual:
+
+::
+
+  ./waf --run scratch/myfirst
+
+..
+	If you look at the top level directory of your distribution, you should now
+	see three log files:  ``myfirst.tr`` is the ASCII trace file we have 
+	previously examined.  ``myfirst-0-0.pcap`` and ``myfirst-1-0.pcap``
+	are the new pcap files we just generated.  
+
+Se olharmos no diretório da distribuição, veremos agora três novos arquivos de registro: ``myfirst.tr`` que é o arquivo ASCII, que nós examinamos na seção anterior. ``myfirst-0-0.pcap`` e ``myfirst-1-0.pcap``, que são os novos arquivos pcap gerados.
+
+.. 
+	Reading output with tcpdump
+
+Lendo a saída com o tcpdump
+~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+..
+	The easiest thing to do at this point will be to use ``tcpdump`` to look
+	at the ``pcap`` files.  
+
+A forma mais confortável de olhar os arquivos pcap é usando o ``tcpdump``.
+
+::
+
+  tcpdump -nn -tt -r myfirst-0-0.pcap
+  reading from file myfirst-0-0.pcap, link-type PPP (PPP)
+  2.000000 IP 10.1.1.1.49153 > 10.1.1.2.9: UDP, length 1024
+  2.514648 IP 10.1.1.2.9 > 10.1.1.1.49153: UDP, length 1024
+
+  tcpdump -nn -tt -r myfirst-1-0.pcap
+  reading from file myfirst-1-0.pcap, link-type PPP (PPP)
+  2.257324 IP 10.1.1.1.49153 > 10.1.1.2.9: UDP, length 1024
+  2.257324 IP 10.1.1.2.9 > 10.1.1.1.49153: UDP, length 1024
+
+..
+	You can see in the dump of ``myfirst-0-0.pcap`` (the client device) that the 
+	echo packet is sent at 2 seconds into the simulation.  If you look at the
+	second dump (``myfirst-1-0.pcap``) you can see that packet being received
+	at 2.257324 seconds.  You see the packet being echoed back at 2.257324 seconds
+	in the second dump, and finally, you see the packet being received back at 
+	the client in the first dump at 2.514648 seconds.
+
+Podemos ver no primeiro `dump` do arquivo ``myfirst-0-0.pcap`` (dispositivo cliente), que o pacote de eco é enviado com dois segundos de simulação. Olhando o segundo `dump` veremos que o pacote é recebido com 2.257324 segundos. O pacote é ecoado de volta com 2.257324 segundos e finalmente é recebido de volta pelo cliente com 2.514648 segundos.
+
+.. 
+	Reading output with Wireshark
+
+
+Lendo saídas com o Wireshark
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+..
+	If you are unfamiliar with Wireshark, there is a web site available from which
+	you can download programs and documentation:  http://www.wireshark.org/.
+
+Podemos obter o Wireshark em http://www.wireshark.org/, bem como sua documentação.
+
+..
+	Wireshark is a graphical user interface which can be used for displaying these
+	trace files.  If you have Wireshark available, you can open each of the trace
+	files and display the contents as if you had captured the packets using a
+	*packet sniffer*.
+
+O Wireshark é um programa que usa interface gráfica e pode ser usado para mostrar os arquivos de rastreamento. Com o Wireshark, podemos abrir cada arquivo de rastreamento e visualizar conteúdo como se tivéssemos capturando os pacotes usando um analisador de tráfego de redes (`packet sniffer`).
--- a/doc/tutorial/source/building-topologies.rst	Wed Apr 11 11:00:27 2012 +0200
+++ b/doc/tutorial/source/building-topologies.rst	Wed Apr 11 13:49:33 2012 +0200
@@ -808,12 +808,13 @@
 ::
 
 #include "ns3/core-module.h"
+#include "ns3/point-to-point-module.h"
 #include "ns3/network-module.h"
+#include "ns3/applications-module.h"
+#include "ns3/wifi-module.h"
+#include "ns3/mobility-module.h"
 #include "ns3/csma-module.h"
 #include "ns3/internet-module.h"
-#include "ns3/point-to-point-module.h"
-#include "ns3/applications-module.h"
-#include "ns3/ipv4-global-routing-helper.h"
 
 The network topology illustration follows:
 
@@ -1006,17 +1007,13 @@
 ::
 
   mac.SetType ("ns3::ApWifiMac",
-    "Ssid", SsidValue (ssid),
-    "BeaconGeneration", BooleanValue (true),
-    "BeaconInterval", TimeValue (Seconds (2.5)));
+               "Ssid", SsidValue (ssid));
 
 In this case, the ``NqosWifiMacHelper`` is going to create MAC
 layers of the "ns3::ApWifiMac", the latter specifying that a MAC
 instance configured as an AP should be created, with the helper type
 implying that the "QosSupported" ``Attribute`` should be set to
-false - disabling 802.11e/WMM-style QoS support at created APs.  We
-set the "BeaconGeneration" ``Attribute`` to true and also set an
-interval between beacons of 2.5 seconds.
+false - disabling 802.11e/WMM-style QoS support at created APs.  
 
 The next lines create the single AP which shares the same set of PHY-level
 ``Attributes`` (and channel) as the stations:
@@ -1236,34 +1233,23 @@
 ::
 
   reading from file third-0-1.pcap, link-type IEEE802_11 (802.11)
-  0.000025 Beacon () [6.0* 9.0 12.0 18.0 24.0 36.0 48.0 54.0 Mbit] IBSS
-  0.000263 Assoc Request () [6.0 9.0 12.0 18.0 24.0 36.0 48.0 54.0 Mbit]
-  0.000279 Acknowledgment RA:00:00:00:00:00:07
-  0.000357 Assoc Response AID(0) :: Succesful
-  0.000501 Acknowledgment RA:00:00:00:00:00:0a
-  0.000748 Assoc Request () [6.0 9.0 12.0 18.0 24.0 36.0 48.0 54.0 Mbit]
-  0.000764 Acknowledgment RA:00:00:00:00:00:08
-  0.000842 Assoc Response AID(0) :: Succesful
-  0.000986 Acknowledgment RA:00:00:00:00:00:0a
-  0.001242 Assoc Request () [6.0 9.0 12.0 18.0 24.0 36.0 48.0 54.0 Mbit]
-  0.001258 Acknowledgment RA:00:00:00:00:00:09
-  0.001336 Assoc Response AID(0) :: Succesful
-  0.001480 Acknowledgment RA:00:00:00:00:00:0a
-  2.000112 arp who-has 10.1.3.4 (ff:ff:ff:ff:ff:ff) tell 10.1.3.3
-  2.000128 Acknowledgment RA:00:00:00:00:00:09
-  2.000206 arp who-has 10.1.3.4 (ff:ff:ff:ff:ff:ff) tell 10.1.3.3
-  2.000487 arp reply 10.1.3.4 is-at 00:00:00:00:00:0a
-  2.000659 Acknowledgment RA:00:00:00:00:00:0a
-  2.002169 IP 10.1.3.3.49153 > 10.1.2.4.9: UDP, length 1024
-  2.002185 Acknowledgment RA:00:00:00:00:00:09
-  2.009771 arp who-has 10.1.3.3 (ff:ff:ff:ff:ff:ff) tell 10.1.3.4
-  2.010029 arp reply 10.1.3.3 is-at 00:00:00:00:00:09
-  2.010045 Acknowledgment RA:00:00:00:00:00:09
-  2.010231 IP 10.1.2.4.9 > 10.1.3.3.49153: UDP, length 1024
-  2.011767 Acknowledgment RA:00:00:00:00:00:0a
-  2.500000 Beacon () [6.0* 9.0 12.0 18.0 24.0 36.0 48.0 54.0 Mbit] IBSS
-  5.000000 Beacon () [6.0* 9.0 12.0 18.0 24.0 36.0 48.0 54.0 Mbit] IBSS
-  7.500000 Beacon () [6.0* 9.0 12.0 18.0 24.0 36.0 48.0 54.0 Mbit] IBSS
+  0.000025 Beacon (ns-3-ssid) [6.0* 9.0 12.0 18.0 24.0 36.0 48.0 54.0 Mbit] IBSS
+  0.000263 Assoc Request (ns-3-ssid) [6.0 9.0 12.0 18.0 24.0 36.0 48.0 54.0 Mbit]
+  0.000279 Acknowledgment RA:00:00:00:00:00:09 
+  0.000552 Assoc Request (ns-3-ssid) [6.0 9.0 12.0 18.0 24.0 36.0 48.0 54.0 Mbit]
+  0.000568 Acknowledgment RA:00:00:00:00:00:07 
+  0.000664 Assoc Response AID(0) :: Succesful
+  0.001001 Assoc Response AID(0) :: Succesful
+  0.001145 Acknowledgment RA:00:00:00:00:00:0a 
+  0.001233 Assoc Response AID(0) :: Succesful
+  0.001377 Acknowledgment RA:00:00:00:00:00:0a 
+  0.001597 Assoc Request (ns-3-ssid) [6.0 9.0 12.0 18.0 24.0 36.0 48.0 54.0 Mbit]
+  0.001613 Acknowledgment RA:00:00:00:00:00:08 
+  0.001691 Assoc Response AID(0) :: Succesful
+  0.001835 Acknowledgment RA:00:00:00:00:00:0a 
+  0.102400 Beacon (ns-3-ssid) [6.0* 9.0 12.0 18.0 24.0 36.0 48.0 54.0 Mbit] IBSS
+  0.204800 Beacon (ns-3-ssid) [6.0* 9.0 12.0 18.0 24.0 36.0 48.0 54.0 Mbit] IBSS
+  0.307200 Beacon (ns-3-ssid) [6.0* 9.0 12.0 18.0 24.0 36.0 48.0 54.0 Mbit] IBSS
 
 You can see that the link type is now 802.11 as you would expect.  You can 
 probably understand what is going on and find the IP echo request and response
@@ -1281,8 +1267,8 @@
 ::
 
   reading from file third-0-0.pcap, link-type PPP (PPP)
-  2.002169 IP 10.1.3.3.49153 > 10.1.2.4.9: UDP, length 1024
-  2.009771 IP 10.1.2.4.9 > 10.1.3.3.49153: UDP, length 1024
+  2.002160 IP 10.1.3.3.49153 > 10.1.2.4.9: UDP, length 1024
+  2.009767 IP 10.1.2.4.9 > 10.1.3.3.49153: UDP, length 1024
 
 This is the echo packet going from left to right (from Wifi to CSMA) and back
 again across the point-to-point link.
@@ -1298,8 +1284,8 @@
 ::
 
   reading from file third-1-0.pcap, link-type PPP (PPP)
-  2.005855 IP 10.1.3.3.49153 > 10.1.2.4.9: UDP, length 1024
-  2.006084 IP 10.1.2.4.9 > 10.1.3.3.49153: UDP, length 1024
+  2.005846 IP 10.1.3.3.49153 > 10.1.2.4.9: UDP, length 1024
+  2.006081 IP 10.1.2.4.9 > 10.1.3.3.49153: UDP, length 1024
 
 This is also the echo packet going from left to right (from Wifi to CSMA) and 
 back again across the point-to-point link with slightly different timings
@@ -1317,12 +1303,12 @@
 ::
 
   reading from file third-1-1.pcap, link-type EN10MB (Ethernet)
-  2.005855 arp who-has 10.1.2.4 (ff:ff:ff:ff:ff:ff) tell 10.1.2.1
-  2.005877 arp reply 10.1.2.4 is-at 00:00:00:00:00:06
-  2.005877 IP 10.1.3.3.49153 > 10.1.2.4.9: UDP, length 1024
-  2.005980 arp who-has 10.1.2.1 (ff:ff:ff:ff:ff:ff) tell 10.1.2.4
-  2.005980 arp reply 10.1.2.1 is-at 00:00:00:00:00:03
-  2.006084 IP 10.1.2.4.9 > 10.1.3.3.49153: UDP, length 1024
+  2.005846 ARP, Request who-has 10.1.2.4 (ff:ff:ff:ff:ff:ff) tell 10.1.2.1, length 50
+  2.005870 ARP, Reply 10.1.2.4 is-at 00:00:00:00:00:06, length 50
+  2.005870 IP 10.1.3.3.49153 > 10.1.2.4.9: UDP, length 1024
+  2.005975 ARP, Request who-has 10.1.2.1 (ff:ff:ff:ff:ff:ff) tell 10.1.2.4, length 50
+  2.005975 ARP, Reply 10.1.2.1 is-at 00:00:00:00:00:03, length 50
+  2.006081 IP 10.1.2.4.9 > 10.1.3.3.49153: UDP, length 1024
 
 This should be easily understood.  If you've forgotten, go back and look at
 the discussion in ``second.cc``.  This is the same sequence.
--- a/examples/matrix-topology/matrix-topology.cc	Wed Apr 11 11:00:27 2012 +0200
+++ b/examples/matrix-topology/matrix-topology.cc	Wed Apr 11 13:49:33 2012 +0200
@@ -95,7 +95,7 @@
   std::string tr_name ("n-node-ppp.tr");
   std::string pcap_name ("n-node-ppp");
   std::string flow_name ("n-node-ppp.xml");
-  std::string anim_name ("n-node-ppp.anim");
+  std::string anim_name ("n-node-ppp.anim.xml");
 
   std::string adj_mat_file_name ("examples/matrix-topology/adjacency_matrix.txt");
   std::string node_coordinates_file_name ("examples/matrix-topology/node_coordinates.txt");
@@ -275,24 +275,12 @@
 
   // Configure animator with default settings
 
-  bool animEnabled = false;
-  AnimationInterface anim;
-  if (anim.SetServerPort (9) && anim.SetOutputFile (anim_name.c_str ()))
-    {
-      NS_LOG_INFO ("Animation Interface Enabled.");
-      animEnabled = true;
-      anim.StartAnimation ();
-    }
-
+  AnimationInterface anim (anim_name.c_str ());
   NS_LOG_INFO ("Run Simulation.");
 
   Simulator::Stop (Seconds (SimTime));
   Simulator::Run ();
   // flowmon->SerializeToXmlFile (flow_name.c_str(), true, true);
-  if (animEnabled)
-    {
-      anim.StopAnimation ();
-    }
   Simulator::Destroy ();
 
   // ---------- End of Simulation Monitoring ---------------------------------
--- a/examples/realtime/realtime-udp-echo.cc	Wed Apr 11 11:00:27 2012 +0200
+++ b/examples/realtime/realtime-udp-echo.cc	Wed Apr 11 13:49:33 2012 +0200
@@ -113,6 +113,7 @@
   //
   // Now, do the actual simulation.
   //
+  Simulator::Stop (Seconds (11.0));
   NS_LOG_INFO ("Run Simulation.");
   Simulator::Run ();
   Simulator::Destroy ();
--- a/src/antenna/doc/source/antenna-design.rst	Wed Apr 11 11:00:27 2012 +0200
+++ b/src/antenna/doc/source/antenna-design.rst	Wed Apr 11 13:49:33 2012 +0200
@@ -105,8 +105,7 @@
 
 
 
-References
-++++++++++
+
 
 .. [Balanis] C.A. Balanis, "Antenna Theory - Analysis and Design",  Wiley, 2nd Ed.
 
--- a/src/antenna/doc/source/antenna-testing.rst	Wed Apr 11 11:00:27 2012 +0200
+++ b/src/antenna/doc/source/antenna-testing.rst	Wed Apr 11 13:49:33 2012 +0200
@@ -55,7 +55,7 @@
 
 
 ParabolicAntennaModel
-------------------
+---------------------
 
 The unit test suite ``parabolic-antenna-model`` checks that the
 ``ParabolicAntennaModel`` class works properly. Several test cases are
--- a/src/antenna/model/angles.cc	Wed Apr 11 11:00:27 2012 +0200
+++ b/src/antenna/model/angles.cc	Wed Apr 11 13:49:33 2012 +0200
@@ -57,7 +57,7 @@
   return is;
 }
 
-  
+
 Angles::Angles ()
   : phi (0),
     theta (0)
--- a/src/antenna/model/angles.h	Wed Apr 11 11:00:27 2012 +0200
+++ b/src/antenna/model/angles.h	Wed Apr 11 13:49:33 2012 +0200
@@ -58,8 +58,8 @@
  *          ^
  *        z | 
  *          |_ theta
- *          | \   
- *          | /|  
+ *          | \
+ *          | /|
  *          |/ |   y
  *          +-------->
  *         /  \|
@@ -128,7 +128,7 @@
  * \return a reference to the output stream
  */
 std::ostream& operator<< ( std::ostream& os, const Angles& a);
-  
+
 /** 
  * initialize a struct Angles from input
  * 
--- a/src/antenna/model/antenna-model.cc	Wed Apr 11 11:00:27 2012 +0200
+++ b/src/antenna/model/antenna-model.cc	Wed Apr 11 13:49:33 2012 +0200
@@ -34,7 +34,7 @@
 AntennaModel::AntennaModel ()
 {
 }
-  
+
 AntennaModel::~AntennaModel ()
 {
 }
@@ -44,11 +44,11 @@
 {
   static TypeId tid = TypeId ("ns3::AntennaModel")
     .SetParent<Object> ()
-    ;
+  ;
   return tid;
 }
 
-  
-  
+
+
 }
 
--- a/src/antenna/model/antenna-model.h	Wed Apr 11 11:00:27 2012 +0200
+++ b/src/antenna/model/antenna-model.h	Wed Apr 11 13:49:33 2012 +0200
@@ -53,7 +53,7 @@
   static TypeId GetTypeId ();
 
 
-  /**       
+  /**
    * this method is expected to be re-implemented by each antenna model 
    * 
    * \param the spherical angles at which the radiation pattern should
--- a/src/antenna/model/cosine-antenna-model.cc	Wed Apr 11 11:00:27 2012 +0200
+++ b/src/antenna/model/cosine-antenna-model.cc	Wed Apr 11 13:49:33 2012 +0200
@@ -57,7 +57,7 @@
                    DoubleValue (0.0),
                    MakeDoubleAccessor (&CosineAntennaModel::m_maxGain),
                    MakeDoubleChecker<double> ())
-    ;
+  ;
   return tid;
 }
 
@@ -66,7 +66,7 @@
 { 
   NS_LOG_FUNCTION (this << beamwidthDegrees);
   m_beamwidthRadians = DegreesToRadians (beamwidthDegrees);
-  m_exponent = - 3.0 / (20*log10 (cos (m_beamwidthRadians / 4.0)));
+  m_exponent = -3.0 / (20*log10 (cos (m_beamwidthRadians / 4.0)));
   NS_LOG_LOGIC (this << " m_exponent = " << m_exponent);
 }
 
@@ -107,15 +107,15 @@
     }
 
   NS_LOG_LOGIC ("phi = " << phi );
-  
+
   // element factor: amplitude gain of a single antenna element in linear units
   double ef = pow (cos (phi / 2.0), m_exponent);
-  
+
   // the array factor is not considered. Note that if we did consider
   // the array factor, the actual beamwidth would change, and in
   // particular it would be different from the one specified by the
   // user. Hence it is not desirable to use the array factor, for the
-  // ease of use of this model.  
+  // ease of use of this model.
 
   double gainDb = 20*log10 (ef);
   NS_LOG_LOGIC ("gain = " << gainDb << " + " << m_maxGain << " dB");
--- a/src/antenna/model/isotropic-antenna-model.cc	Wed Apr 11 11:00:27 2012 +0200
+++ b/src/antenna/model/isotropic-antenna-model.cc	Wed Apr 11 13:49:33 2012 +0200
@@ -38,7 +38,7 @@
   static TypeId tid = TypeId ("ns3::IsotropicAntennaModel")
     .SetParent<AntennaModel> ()
     .AddConstructor<IsotropicAntennaModel> ()
-    ;
+  ;
   return tid;
 }
 
--- a/src/antenna/model/parabolic-antenna-model.cc	Wed Apr 11 11:00:27 2012 +0200
+++ b/src/antenna/model/parabolic-antenna-model.cc	Wed Apr 11 13:49:33 2012 +0200
@@ -57,7 +57,7 @@
                    DoubleValue (20.0),
                    MakeDoubleAccessor (&ParabolicAntennaModel::m_maxAttenuation),
                    MakeDoubleChecker<double> ())
-    ;
+  ;
   return tid;
 }
 
@@ -107,7 +107,7 @@
   NS_LOG_LOGIC ("phi = " << phi );
 
   double gainDb = -std::min (12 * pow (phi / m_beamwidthRadians, 2), m_maxAttenuation);
-  
+
   NS_LOG_LOGIC ("gain = " << gainDb);
   return gainDb;
 }
--- a/src/antenna/test/test-angles.cc	Wed Apr 11 11:00:27 2012 +0200
+++ b/src/antenna/test/test-angles.cc	Wed Apr 11 13:49:33 2012 +0200
@@ -44,7 +44,7 @@
 std::string OneVectorConstructorTestCase::BuildNameString (Vector v)
 {
   std::ostringstream oss;
-  oss <<  " v = " << v ;
+  oss <<  " v = " << v;
   return oss.str ();
 }
 
@@ -133,7 +133,7 @@
   AddTestCase (new OneVectorConstructorTestCase (Vector (0, -2, 0),    Angles (-M_PI_2, M_PI_2)));
   AddTestCase (new OneVectorConstructorTestCase (Vector (0, 0, 2),     Angles (0, 0)));
   AddTestCase (new OneVectorConstructorTestCase (Vector (0, 0, -2),    Angles (0, M_PI)));
-  
+
   AddTestCase (new OneVectorConstructorTestCase (Vector (1, 0, 1),     Angles (0, M_PI_4)));
   AddTestCase (new OneVectorConstructorTestCase (Vector (1, 0, -1),    Angles (0, 3*M_PI_4)));
   AddTestCase (new OneVectorConstructorTestCase (Vector (1, 1, 0),     Angles (M_PI_4, M_PI_2)));
@@ -168,7 +168,7 @@
   AddTestCase (new TwoVectorsConstructorTestCase (Vector (0, -2, 0),    Vector (0, 0, 0), Angles (-M_PI_2, M_PI_2)));
   AddTestCase (new TwoVectorsConstructorTestCase (Vector (0, 0, 2),     Vector (0, 0, 0), Angles (0, 0)));
   AddTestCase (new TwoVectorsConstructorTestCase (Vector (0, 0, -2),    Vector (0, 0, 0), Angles (0, M_PI)));
-  
+
   AddTestCase (new TwoVectorsConstructorTestCase (Vector (1, 0, 1),     Vector (0, 0, 0), Angles (0, M_PI_4)));
   AddTestCase (new TwoVectorsConstructorTestCase (Vector (1, 0, -1),    Vector (0, 0, 0), Angles (0, 3*M_PI_4)));
   AddTestCase (new TwoVectorsConstructorTestCase (Vector (1, 1, 0),     Vector (0, 0, 0), Angles (M_PI_4, M_PI_2)));
@@ -197,7 +197,7 @@
 
   AddTestCase (new TwoVectorsConstructorTestCase (Vector (-2, 2, -1),     Vector (-4, 2, -1), Angles (0, M_PI_2)));
   AddTestCase (new TwoVectorsConstructorTestCase (Vector (2, 2, 0),    Vector (4, 2, 0), Angles (M_PI, M_PI_2)));
-  
+
   AddTestCase (new TwoVectorsConstructorTestCase (Vector (-1, 4, 4),     Vector (-2, 4, 3), Angles (0, M_PI_4)));
   AddTestCase (new TwoVectorsConstructorTestCase (Vector (0, -2, -6),    Vector (-1, -2, -5), Angles (0, 3*M_PI_4)));
   AddTestCase (new TwoVectorsConstructorTestCase (Vector (77, 3, 43),    Vector (78, 2, 43), Angles (3*M_PI_4, M_PI_2)));
--- a/src/antenna/test/test-cosine-antenna.cc	Wed Apr 11 11:00:27 2012 +0200
+++ b/src/antenna/test/test-cosine-antenna.cc	Wed Apr 11 13:49:33 2012 +0200
@@ -165,7 +165,7 @@
   AddTestCase (new CosineAntennaModelTestCase (Angles (DegreesToRadians (54.677),  0),       150,        -150,        0,           -20,     EQUAL));
   AddTestCase (new CosineAntennaModelTestCase (Angles (DegreesToRadians   (30),    0),       150,        -150,        0,           -20,  LESSTHAN));
   AddTestCase (new CosineAntennaModelTestCase (Angles (DegreesToRadians   (20),    0),       150,        -150,        0,           -20,  LESSTHAN));
-  
+
   // test maxGain
   AddTestCase (new CosineAntennaModelTestCase (Angles (DegreesToRadians    (0),    0),        60,           0,       10,            10,     EQUAL));
   AddTestCase (new CosineAntennaModelTestCase (Angles (DegreesToRadians   (30),    0),        60,           0,       22,            19,     EQUAL));
@@ -200,7 +200,7 @@
   AddTestCase (new CosineAntennaModelTestCase (Angles (DegreesToRadians (-150),  9.5),       100,        -150,        2,             2,     EQUAL));
   AddTestCase (new CosineAntennaModelTestCase (Angles (DegreesToRadians (-100),  9.5),       100,        -150,        4,             1,     EQUAL));
   AddTestCase (new CosineAntennaModelTestCase (Angles (DegreesToRadians (-200),  9.5),       100,        -150,       -1,            -4,     EQUAL));
-                   
+
 };
 
 static CosineAntennaModelTestSuite staticCosineAntennaModelTestSuiteInstance;
--- a/src/antenna/test/test-degrees-radians.cc	Wed Apr 11 11:00:27 2012 +0200
+++ b/src/antenna/test/test-degrees-radians.cc	Wed Apr 11 13:49:33 2012 +0200
@@ -128,7 +128,7 @@
   AddTestCase (new RadiansToDegreesTestCase (M_PI + M_PI, 360));
   AddTestCase (new RadiansToDegreesTestCase (-M_PI_2, -90));
   AddTestCase (new RadiansToDegreesTestCase (4.5*M_PI, 810));
-  
+
 };
 
 static DegreesRadiansTestSuite staticDegreesRadiansTestSuiteInstance;
--- a/src/antenna/test/test-parabolic-antenna.cc	Wed Apr 11 11:00:27 2012 +0200
+++ b/src/antenna/test/test-parabolic-antenna.cc	Wed Apr 11 13:49:33 2012 +0200
@@ -154,7 +154,7 @@
   AddTestCase (new ParabolicAntennaModelTestCase (Angles (DegreesToRadians   (60),    0),       80,        -150,       10,           -10,     EQUAL));
   AddTestCase (new ParabolicAntennaModelTestCase (Angles (DegreesToRadians   (90),    0),       80,        -150,       10,           -10,     EQUAL));
   AddTestCase (new ParabolicAntennaModelTestCase (Angles (DegreesToRadians   (30),    0),       80,        -150,       10,           -10,     EQUAL));
-  
+
 
 
   // test elevation angle
@@ -179,7 +179,7 @@
   AddTestCase (new ParabolicAntennaModelTestCase (Angles (DegreesToRadians (-150),  9.5),       100,        -150,       30,             0,     EQUAL));
   AddTestCase (new ParabolicAntennaModelTestCase (Angles (DegreesToRadians (-100),  9.5),       100,        -150,       30,            -3,     EQUAL));
   AddTestCase (new ParabolicAntennaModelTestCase (Angles (DegreesToRadians (-200),  9.5),       100,        -150,       30,            -3,     EQUAL));
-                   
+
 };
 
 static ParabolicAntennaModelTestSuite staticParabolicAntennaModelTestSuiteInstance;
--- a/src/aodv/bindings/modulegen__gcc_ILP32.py	Wed Apr 11 11:00:27 2012 +0200
+++ b/src/aodv/bindings/modulegen__gcc_ILP32.py	Wed Apr 11 13:49:33 2012 +0200
@@ -3263,6 +3263,11 @@
                    'uint32_t', 
                    [], 
                    is_pure_virtual=True, is_const=True, is_virtual=True)
+    ## socket.h (module 'network'): bool ns3::Socket::IsRecvPktInfo() const [member function]
+    cls.add_method('IsRecvPktInfo', 
+                   'bool', 
+                   [], 
+                   is_const=True)
     ## socket.h (module 'network'): int ns3::Socket::Listen() [member function]
     cls.add_method('Listen', 
                    'int', 
--- a/src/aodv/bindings/modulegen__gcc_LP64.py	Wed Apr 11 11:00:27 2012 +0200
+++ b/src/aodv/bindings/modulegen__gcc_LP64.py	Wed Apr 11 13:49:33 2012 +0200
@@ -3263,6 +3263,11 @@
                    'uint32_t', 
                    [], 
                    is_pure_virtual=True, is_const=True, is_virtual=True)
+    ## socket.h (module 'network'): bool ns3::Socket::IsRecvPktInfo() const [member function]
+    cls.add_method('IsRecvPktInfo', 
+                   'bool', 
+                   [], 
+                   is_const=True)
     ## socket.h (module 'network'): int ns3::Socket::Listen() [member function]
     cls.add_method('Listen', 
                    'int', 
--- a/src/aodv/model/aodv-routing-protocol.cc	Wed Apr 11 11:00:27 2012 +0200
+++ b/src/aodv/model/aodv-routing-protocol.cc	Wed Apr 11 13:49:33 2012 +0200
@@ -53,16 +53,19 @@
 
 //-----------------------------------------------------------------------------
 /// Tag used by AODV implementation
-struct DeferredRouteOutputTag : public Tag
+
+class DeferredRouteOutputTag : public Tag
 {
-  /// Positive if output device is fixed in RouteOutput
-  int32_t oif;
 
-  DeferredRouteOutputTag (int32_t o = -1) : Tag (), oif (o) {}
+public:
+  DeferredRouteOutputTag (int32_t o = -1) : Tag (), m_oif (o) {}
 
   static TypeId GetTypeId ()
   {
-    static TypeId tid = TypeId ("ns3::aodv::DeferredRouteOutputTag").SetParent<Tag> ();
+    static TypeId tid = TypeId ("ns3::aodv::DeferredRouteOutputTag").SetParent<Tag> ()
+      .SetParent<Tag> ()
+      .AddConstructor<DeferredRouteOutputTag> ()
+    ;
     return tid;
   }
 
@@ -71,6 +74,16 @@
     return GetTypeId ();
   }
 
+  int32_t GetInterface() const
+  {
+    return m_oif;
+  }
+
+  void SetInterface(int32_t oif)
+  {
+    m_oif = oif;
+  }
+
   uint32_t GetSerializedSize () const
   {
     return sizeof(int32_t);
@@ -78,20 +91,27 @@
 
   void  Serialize (TagBuffer i) const
   {
-    i.WriteU32 (oif);
+    i.WriteU32 (m_oif);
   }
 
   void  Deserialize (TagBuffer i)
   {
-    oif = i.ReadU32 ();
+    m_oif = i.ReadU32 ();
   }
 
   void  Print (std::ostream &os) const
   {
-    os << "DeferredRouteOutputTag: output interface = " << oif;
+    os << "DeferredRouteOutputTag: output interface = " << m_oif;
   }
+
+private:
+  /// Positive if output device is fixed in RouteOutput
+  int32_t m_oif;
 };
 
+NS_OBJECT_ENSURE_REGISTERED (DeferredRouteOutputTag);
+
+
 //-----------------------------------------------------------------------------
 RoutingProtocol::RoutingProtocol () :
   RreqRetries (2),
@@ -1577,8 +1597,8 @@
       DeferredRouteOutputTag tag;
       Ptr<Packet> p = ConstCast<Packet> (queueEntry.GetPacket ());
       if (p->RemovePacketTag (tag) && 
-          tag.oif != -1 && 
-          tag.oif != m_ipv4->GetInterfaceForDevice (route->GetOutputDevice ()))
+          tag.GetInterface() != -1 &&
+          tag.GetInterface() != m_ipv4->GetInterfaceForDevice (route->GetOutputDevice ()))
         {
           NS_LOG_DEBUG ("Output device doesn't match. Dropped.");
           return;
Binary file src/aodv/test/tcp-chain-test-0-0.pcap has changed
Binary file src/aodv/test/tcp-chain-test-9-0.pcap has changed
--- a/src/applications/bindings/modulegen__gcc_ILP32.py	Wed Apr 11 11:00:27 2012 +0200
+++ b/src/applications/bindings/modulegen__gcc_ILP32.py	Wed Apr 11 13:49:33 2012 +0200
@@ -62,6 +62,8 @@
     module.add_class('CallbackBase', import_from_module='ns.core')
     ## channel-list.h (module 'network'): ns3::ChannelList [class]
     module.add_class('ChannelList', import_from_module='ns.network')
+    ## data-output-interface.h (module 'stats'): ns3::DataOutputCallback [class]
+    module.add_class('DataOutputCallback', allow_subclassing=True, import_from_module='ns.stats')
     ## data-rate.h (module 'network'): ns3::DataRate [class]
     module.add_class('DataRate', import_from_module='ns.network')
     ## event-id.h (module 'core'): ns3::EventId [class]
@@ -158,6 +160,8 @@
     module.add_class('SimpleRefCount', automatic_type_narrowing=True, import_from_module='ns.core', template_parameters=['ns3::Object', 'ns3::ObjectBase', 'ns3::ObjectDeleter'], parent=root_module['ns3::ObjectBase'], memory_policy=cppclass.ReferenceCountingMethodsPolicy(incref_method='Ref', decref_method='Unref', peekref_method='GetReferenceCount'))
     ## simulator.h (module 'core'): ns3::Simulator [class]
     module.add_class('Simulator', destructor_visibility='private', import_from_module='ns.core')
+    ## data-calculator.h (module 'stats'): ns3::StatisticalSummary [class]
+    module.add_class('StatisticalSummary', allow_subclassing=True, import_from_module='ns.stats')
     ## system-wall-clock-ms.h (module 'core'): ns3::SystemWallClockMs [class]
     module.add_class('SystemWallClockMs', import_from_module='ns.core')
     ## tag.h (module 'network'): ns3::Tag [class]
@@ -328,6 +332,10 @@
     module.add_class('CallbackValue', import_from_module='ns.core', parent=root_module['ns3::AttributeValue'])
     ## channel.h (module 'network'): ns3::Channel [class]
     module.add_class('Channel', import_from_module='ns.network', parent=root_module['ns3::Object'])
+    ## data-calculator.h (module 'stats'): ns3::DataCalculator [class]
+    module.add_class('DataCalculator', import_from_module='ns.stats', parent=root_module['ns3::Object'])
+    ## data-output-interface.h (module 'stats'): ns3::DataOutputInterface [class]
+    module.add_class('DataOutputInterface', import_from_module='ns.stats', parent=root_module['ns3::Object'])
     ## data-rate.h (module 'network'): ns3::DataRateChecker [class]
     module.add_class('DataRateChecker', import_from_module='ns.network', parent=root_module['ns3::AttributeChecker'])
     ## data-rate.h (module 'network'): ns3::DataRateValue [class]
@@ -368,6 +376,8 @@
     module.add_class('Mac48AddressChecker', import_from_module='ns.network', parent=root_module['ns3::AttributeChecker'])
     ## mac48-address.h (module 'network'): ns3::Mac48AddressValue [class]
     module.add_class('Mac48AddressValue', import_from_module='ns.network', parent=root_module['ns3::AttributeValue'])
+    ## basic-data-calculators.h (module 'stats'): ns3::MinMaxAvgTotalCalculator<double> [class]
+    module.add_class('MinMaxAvgTotalCalculator', import_from_module='ns.stats', template_parameters=['double'], parent=[root_module['ns3::DataCalculator'], root_module['ns3::StatisticalSummary']])
     ## net-device.h (module 'network'): ns3::NetDevice [class]
     module.add_class('NetDevice', import_from_module='ns.network', parent=root_module['ns3::Object'])
     ## net-device.h (module 'network'): ns3::NetDevice::PacketType [enumeration]
@@ -519,6 +529,7 @@
     register_Ns3ByteTagListIteratorItem_methods(root_module, root_module['ns3::ByteTagList::Iterator::Item'])
     register_Ns3CallbackBase_methods(root_module, root_module['ns3::CallbackBase'])
     register_Ns3ChannelList_methods(root_module, root_module['ns3::ChannelList'])
+    register_Ns3DataOutputCallback_methods(root_module, root_module['ns3::DataOutputCallback'])
     register_Ns3DataRate_methods(root_module, root_module['ns3::DataRate'])
     register_Ns3EventId_methods(root_module, root_module['ns3::EventId'])
     register_Ns3Inet6SocketAddress_methods(root_module, root_module['ns3::Inet6SocketAddress'])
@@ -558,6 +569,7 @@
     register_Ns3SequentialVariable_methods(root_module, root_module['ns3::SequentialVariable'])
     register_Ns3SimpleRefCount__Ns3Object_Ns3ObjectBase_Ns3ObjectDeleter_methods(root_module, root_module['ns3::SimpleRefCount< ns3::Object, ns3::ObjectBase, ns3::ObjectDeleter >'])
     register_Ns3Simulator_methods(root_module, root_module['ns3::Simulator'])
+    register_Ns3StatisticalSummary_methods(root_module, root_module['ns3::StatisticalSummary'])
     register_Ns3SystemWallClockMs_methods(root_module, root_module['ns3::SystemWallClockMs'])
     register_Ns3Tag_methods(root_module, root_module['ns3::Tag'])
     register_Ns3TagBuffer_methods(root_module, root_module['ns3::TagBuffer'])
@@ -634,6 +646,8 @@
     register_Ns3CallbackImplBase_methods(root_module, root_module['ns3::CallbackImplBase'])
     register_Ns3CallbackValue_methods(root_module, root_module['ns3::CallbackValue'])
     register_Ns3Channel_methods(root_module, root_module['ns3::Channel'])
+    register_Ns3DataCalculator_methods(root_module, root_module['ns3::DataCalculator'])
+    register_Ns3DataOutputInterface_methods(root_module, root_module['ns3::DataOutputInterface'])
     register_Ns3DataRateChecker_methods(root_module, root_module['ns3::DataRateChecker'])
     register_Ns3DataRateValue_methods(root_module, root_module['ns3::DataRateValue'])
     register_Ns3DropTailQueue_methods(root_module, root_module['ns3::DropTailQueue'])
@@ -653,6 +667,7 @@
     register_Ns3ListErrorModel_methods(root_module, root_module['ns3::ListErrorModel'])
     register_Ns3Mac48AddressChecker_methods(root_module, root_module['ns3::Mac48AddressChecker'])
     register_Ns3Mac48AddressValue_methods(root_module, root_module['ns3::Mac48AddressValue'])
+    register_Ns3MinMaxAvgTotalCalculator__Double_methods(root_module, root_module['ns3::MinMaxAvgTotalCalculator< double >'])
     register_Ns3NetDevice_methods(root_module, root_module['ns3::NetDevice'])
     register_Ns3NixVector_methods(root_module, root_module['ns3::NixVector'])
     register_Ns3Node_methods(root_module, root_module['ns3::Node'])
@@ -1468,6 +1483,43 @@
                    is_static=True)
     return
 
+def register_Ns3DataOutputCallback_methods(root_module, cls):
+    ## data-output-interface.h (module 'stats'): ns3::DataOutputCallback::DataOutputCallback() [constructor]
+    cls.add_constructor([])
+    ## data-output-interface.h (module 'stats'): ns3::DataOutputCallback::DataOutputCallback(ns3::DataOutputCallback const & arg0) [copy constructor]
+    cls.add_constructor([param('ns3::DataOutputCallback const &', 'arg0')])
+    ## data-output-interface.h (module 'stats'): void ns3::DataOutputCallback::OutputSingleton(std::string key, std::string variable, int val) [member function]
+    cls.add_method('OutputSingleton', 
+                   'void', 
+                   [param('std::string', 'key'), param('std::string', 'variable'), param('int', 'val')], 
+                   is_pure_virtual=True, is_virtual=True)
+    ## data-output-interface.h (module 'stats'): void ns3::DataOutputCallback::OutputSingleton(std::string key, std::string variable, uint32_t val) [member function]
+    cls.add_method('OutputSingleton', 
+                   'void', 
+                   [param('std::string', 'key'), param('std::string', 'variable'), param('uint32_t', 'val')], 
+                   is_pure_virtual=True, is_virtual=True)
+    ## data-output-interface.h (module 'stats'): void ns3::DataOutputCallback::OutputSingleton(std::string key, std::string variable, double val) [member function]
+    cls.add_method('OutputSingleton', 
+                   'void', 
+                   [param('std::string', 'key'), param('std::string', 'variable'), param('double', 'val')], 
+                   is_pure_virtual=True, is_virtual=True)
+    ## data-output-interface.h (module 'stats'): void ns3::DataOutputCallback::OutputSingleton(std::string key, std::string variable, std::string val) [member function]
+    cls.add_method('OutputSingleton', 
+                   'void', 
+                   [param('std::string', 'key'), param('std::string', 'variable'), param('std::string', 'val')], 
+                   is_pure_virtual=True, is_virtual=True)
+    ## data-output-interface.h (module 'stats'): void ns3::DataOutputCallback::OutputSingleton(std::string key, std::string variable, ns3::Time val) [member function]
+    cls.add_method('OutputSingleton', 
+                   'void', 
+                   [param('std::string', 'key'), param('std::string', 'variable'), param('ns3::Time', 'val')], 
+                   is_pure_virtual=True, is_virtual=True)
+    ## data-output-interface.h (module 'stats'): void ns3::DataOutputCallback::OutputStatistic(std::string key, std::string variable, ns3::StatisticalSummary const * statSum) [member function]
+    cls.add_method('OutputStatistic', 
+                   'void', 
+                   [param('std::string', 'key'), param('std::string', 'variable'), param('ns3::StatisticalSummary const *', 'statSum')], 
+                   is_pure_virtual=True, is_virtual=True)
+    return
+
 def register_Ns3DataRate_methods(root_module, cls):
     cls.add_output_stream_operator()
     cls.add_binary_comparison_operator('!=')
@@ -3267,6 +3319,53 @@
                    is_static=True)
     return
 
+def register_Ns3StatisticalSummary_methods(root_module, cls):
+    ## data-calculator.h (module 'stats'): ns3::StatisticalSummary::StatisticalSummary() [constructor]
+    cls.add_constructor([])
+    ## data-calculator.h (module 'stats'): ns3::StatisticalSummary::StatisticalSummary(ns3::StatisticalSummary const & arg0) [copy constructor]
+    cls.add_constructor([param('ns3::StatisticalSummary const &', 'arg0')])
+    ## data-calculator.h (module 'stats'): long int ns3::StatisticalSummary::getCount() const [member function]
+    cls.add_method('getCount', 
+                   'long int', 
+                   [], 
+                   is_pure_virtual=True, is_const=True, is_virtual=True)
+    ## data-calculator.h (module 'stats'): double ns3::StatisticalSummary::getMax() const [member function]
+    cls.add_method('getMax', 
+                   'double', 
+                   [], 
+                   is_pure_virtual=True, is_const=True, is_virtual=True)
+    ## data-calculator.h (module 'stats'): double ns3::StatisticalSummary::getMean() const [member function]
+    cls.add_method('getMean', 
+                   'double', 
+                   [], 
+                   is_pure_virtual=True, is_const=True, is_virtual=True)
+    ## data-calculator.h (module 'stats'): double ns3::StatisticalSummary::getMin() const [member function]
+    cls.add_method('getMin', 
+                   'double', 
+                   [], 
+                   is_pure_virtual=True, is_const=True, is_virtual=True)
+    ## data-calculator.h (module 'stats'): double ns3::StatisticalSummary::getSqrSum() const [member function]
+    cls.add_method('getSqrSum', 
+                   'double', 
+                   [], 
+                   is_pure_virtual=True, is_const=True, is_virtual=True)
+    ## data-calculator.h (module 'stats'): double ns3::StatisticalSummary::getStddev() const [member function]
+    cls.add_method('getStddev', 
+                   'double', 
+                   [], 
+                   is_pure_virtual=True, is_const=True, is_virtual=True)
+    ## data-calculator.h (module 'stats'): double ns3::StatisticalSummary::getSum() const [member function]
+    cls.add_method('getSum', 
+                   'double', 
+                   [], 
+                   is_pure_virtual=True, is_const=True, is_virtual=True)
+    ## data-calculator.h (module 'stats'): double ns3::StatisticalSummary::getVariance() const [member function]
+    cls.add_method('getVariance', 
+                   'double', 
+                   [], 
+                   is_pure_virtual=True, is_const=True, is_virtual=True)
+    return
+
 def register_Ns3SystemWallClockMs_methods(root_module, cls):
     ## system-wall-clock-ms.h (module 'core'): ns3::SystemWallClockMs::SystemWallClockMs(ns3::SystemWallClockMs const & arg0) [copy constructor]
     cls.add_constructor([param('ns3::SystemWallClockMs const &', 'arg0')])
@@ -4925,6 +5024,11 @@
                    'uint32_t', 
                    [], 
                    is_pure_virtual=True, is_const=True, is_virtual=True)
+    ## socket.h (module 'network'): bool ns3::Socket::IsRecvPktInfo() const [member function]
+    cls.add_method('IsRecvPktInfo', 
+                   'bool', 
+                   [], 
+                   is_const=True)
     ## socket.h (module 'network'): int ns3::Socket::Listen() [member function]
     cls.add_method('Listen', 
                    'int', 
@@ -5739,6 +5843,90 @@
                    is_static=True)
     return
 
+def register_Ns3DataCalculator_methods(root_module, cls):
+    ## data-calculator.h (module 'stats'): ns3::DataCalculator::DataCalculator(ns3::DataCalculator const & arg0) [copy constructor]
+    cls.add_constructor([param('ns3::DataCalculator const &', 'arg0')])
+    ## data-calculator.h (module 'stats'): ns3::DataCalculator::DataCalculator() [constructor]
+    cls.add_constructor([])
+    ## data-calculator.h (module 'stats'): void ns3::DataCalculator::Disable() [member function]
+    cls.add_method('Disable', 
+                   'void', 
+                   [])
+    ## data-calculator.h (module 'stats'): void ns3::DataCalculator::Enable() [member function]
+    cls.add_method('Enable', 
+                   'void', 
+                   [])
+    ## data-calculator.h (module 'stats'): std::string ns3::DataCalculator::GetContext() const [member function]
+    cls.add_method('GetContext', 
+                   'std::string', 
+                   [], 
+                   is_const=True)
+    ## data-calculator.h (module 'stats'): bool ns3::DataCalculator::GetEnabled() const [member function]
+    cls.add_method('GetEnabled', 
+                   'bool', 
+                   [], 
+                   is_const=True)
+    ## data-calculator.h (module 'stats'): std::string ns3::DataCalculator::GetKey() const [member function]
+    cls.add_method('GetKey', 
+                   'std::string', 
+                   [], 
+                   is_const=True)
+    ## data-calculator.h (module 'stats'): void ns3::DataCalculator::Output(ns3::DataOutputCallback & callback) const [member function]
+    cls.add_method('Output', 
+                   'void', 
+                   [param('ns3::DataOutputCallback &', 'callback')], 
+                   is_pure_virtual=True, is_const=True, is_virtual=True)
+    ## data-calculator.h (module 'stats'): void ns3::DataCalculator::SetContext(std::string const context) [member function]
+    cls.add_method('SetContext', 
+                   'void', 
+                   [param('std::string const', 'context')])
+    ## data-calculator.h (module 'stats'): void ns3::DataCalculator::SetKey(std::string const key) [member function]
+    cls.add_method('SetKey', 
+                   'void', 
+                   [param('std::string const', 'key')])
+    ## data-calculator.h (module 'stats'): void ns3::DataCalculator::Start(ns3::Time const & startTime) [member function]
+    cls.add_method('Start', 
+                   'void', 
+                   [param('ns3::Time const &', 'startTime')], 
+                   is_virtual=True)
+    ## data-calculator.h (module 'stats'): void ns3::DataCalculator::Stop(ns3::Time const & stopTime) [member function]
+    cls.add_method('Stop', 
+                   'void', 
+                   [param('ns3::Time const &', 'stopTime')], 
+                   is_virtual=True)
+    ## data-calculator.h (module 'stats'): void ns3::DataCalculator::DoDispose() [member function]
+    cls.add_method('DoDispose', 
+                   'void', 
+                   [], 
+                   visibility='protected', is_virtual=True)
+    return
+
+def register_Ns3DataOutputInterface_methods(root_module, cls):
+    ## data-output-interface.h (module 'stats'): ns3::DataOutputInterface::DataOutputInterface(ns3::DataOutputInterface const & arg0) [copy constructor]
+    cls.add_constructor([param('ns3::DataOutputInterface const &', 'arg0')])
+    ## data-output-interface.h (module 'stats'): ns3::DataOutputInterface::DataOutputInterface() [constructor]
+    cls.add_constructor([])
+    ## data-output-interface.h (module 'stats'): std::string ns3::DataOutputInterface::GetFilePrefix() const [member function]
+    cls.add_method('GetFilePrefix', 
+                   'std::string', 
+                   [], 
+                   is_const=True)
+    ## data-output-interface.h (module 'stats'): void ns3::DataOutputInterface::Output(ns3::DataCollector & dc) [member function]
+    cls.add_method('Output', 
+                   'void', 
+                   [param('ns3::DataCollector &', 'dc')], 
+                   is_pure_virtual=True, is_virtual=True)
+    ## data-output-interface.h (module 'stats'): void ns3::DataOutputInterface::SetFilePrefix(std::string const prefix) [member function]
+    cls.add_method('SetFilePrefix', 
+                   'void', 
+                   [param('std::string const', 'prefix')])
+    ## data-output-interface.h (module 'stats'): void ns3::DataOutputInterface::DoDispose() [member function]
+    cls.add_method('DoDispose', 
+                   'void', 
+                   [], 
+                   visibility='protected', is_virtual=True)
+    return
+
 def register_Ns3DataRateChecker_methods(root_module, cls):
     ## data-rate.h (module 'network'): ns3::DataRateChecker::DataRateChecker() [constructor]
     cls.add_constructor([])
@@ -6282,6 +6470,71 @@
                    [param('ns3::Mac48Address const &', 'value')])
     return
 
+def register_Ns3MinMaxAvgTotalCalculator__Double_methods(root_module, cls):
+    ## basic-data-calculators.h (module 'stats'): ns3::MinMaxAvgTotalCalculator<double>::MinMaxAvgTotalCalculator(ns3::MinMaxAvgTotalCalculator<double> const & arg0) [copy constructor]
+    cls.add_constructor([param('ns3::MinMaxAvgTotalCalculator< double > const &', 'arg0')])
+    ## basic-data-calculators.h (module 'stats'): ns3::MinMaxAvgTotalCalculator<double>::MinMaxAvgTotalCalculator() [constructor]
+    cls.add_constructor([])
+    ## basic-data-calculators.h (module 'stats'): void ns3::MinMaxAvgTotalCalculator<double>::Output(ns3::DataOutputCallback & callback) const [member function]
+    cls.add_method('Output', 
+                   'void', 
+                   [param('ns3::DataOutputCallback &', 'callback')], 
+                   is_const=True, is_virtual=True)
+    ## basic-data-calculators.h (module 'stats'): void ns3::MinMaxAvgTotalCalculator<double>::Reset() [member function]
+    cls.add_method('Reset', 
+                   'void', 
+                   [])
+    ## basic-data-calculators.h (module 'stats'): void ns3::MinMaxAvgTotalCalculator<double>::Update(double const i) [member function]
+    cls.add_method('Update', 
+                   'void', 
+                   [param('double const', 'i')])
+    ## basic-data-calculators.h (module 'stats'): long int ns3::MinMaxAvgTotalCalculator<double>::getCount() const [member function]
+    cls.add_method('getCount', 
+                   'long int', 
+                   [], 
+                   is_const=True, is_virtual=True)
+    ## basic-data-calculators.h (module 'stats'): double ns3::MinMaxAvgTotalCalculator<double>::getMax() const [member function]
+    cls.add_method('getMax', 
+                   'double', 
+                   [], 
+                   is_const=True, is_virtual=True)
+    ## basic-data-calculators.h (module 'stats'): double ns3::MinMaxAvgTotalCalculator<double>::getMean() const [member function]
+    cls.add_method('getMean', 
+                   'double', 
+                   [], 
+                   is_const=True, is_virtual=True)
+    ## basic-data-calculators.h (module 'stats'): double ns3::MinMaxAvgTotalCalculator<double>::getMin() const [member function]
+    cls.add_method('getMin', 
+                   'double', 
+                   [], 
+                   is_const=True, is_virtual=True)
+    ## basic-data-calculators.h (module 'stats'): double ns3::MinMaxAvgTotalCalculator<double>::getSqrSum() const [member function]
+    cls.add_method('getSqrSum', 
+                   'double', 
+                   [], 
+                   is_const=True, is_virtual=True)
+    ## basic-data-calculators.h (module 'stats'): double ns3::MinMaxAvgTotalCalculator<double>::getStddev() const [member function]
+    cls.add_method('getStddev', 
+                   'double', 
+                   [], 
+                   is_const=True, is_virtual=True)
+    ## basic-data-calculators.h (module 'stats'): double ns3::MinMaxAvgTotalCalculator<double>::getSum() const [member function]
+    cls.add_method('getSum', 
+                   'double', 
+                   [], 
+                   is_const=True, is_virtual=True)
+    ## basic-data-calculators.h (module 'stats'): double ns3::MinMaxAvgTotalCalculator<double>::getVariance() const [member function]
+    cls.add_method('getVariance', 
+                   'double', 
+                   [], 
+                   is_const=True, is_virtual=True)
+    ## basic-data-calculators.h (module 'stats'): void ns3::MinMaxAvgTotalCalculator<double>::DoDispose() [member function]
+    cls.add_method('DoDispose', 
+                   'void', 
+                   [], 
+                   visibility='protected', is_virtual=True)
+    return
+
 def register_Ns3NetDevice_methods(root_module, cls):
     ## net-device.h (module 'network'): ns3::NetDevice::NetDevice() [constructor]
     cls.add_constructor([])
--- a/src/applications/bindings/modulegen__gcc_LP64.py	Wed Apr 11 11:00:27 2012 +0200
+++ b/src/applications/bindings/modulegen__gcc_LP64.py	Wed Apr 11 13:49:33 2012 +0200
@@ -62,6 +62,8 @@
     module.add_class('CallbackBase', import_from_module='ns.core')
     ## channel-list.h (module 'network'): ns3::ChannelList [class]
     module.add_class('ChannelList', import_from_module='ns.network')
+    ## data-output-interface.h (module 'stats'): ns3::DataOutputCallback [class]
+    module.add_class('DataOutputCallback', allow_subclassing=True, import_from_module='ns.stats')
     ## data-rate.h (module 'network'): ns3::DataRate [class]
     module.add_class('DataRate', import_from_module='ns.network')
     ## event-id.h (module 'core'): ns3::EventId [class]
@@ -158,6 +160,8 @@
     module.add_class('SimpleRefCount', automatic_type_narrowing=True, import_from_module='ns.core', template_parameters=['ns3::Object', 'ns3::ObjectBase', 'ns3::ObjectDeleter'], parent=root_module['ns3::ObjectBase'], memory_policy=cppclass.ReferenceCountingMethodsPolicy(incref_method='Ref', decref_method='Unref', peekref_method='GetReferenceCount'))
     ## simulator.h (module 'core'): ns3::Simulator [class]
     module.add_class('Simulator', destructor_visibility='private', import_from_module='ns.core')
+    ## data-calculator.h (module 'stats'): ns3::StatisticalSummary [class]
+    module.add_class('StatisticalSummary', allow_subclassing=True, import_from_module='ns.stats')
     ## system-wall-clock-ms.h (module 'core'): ns3::SystemWallClockMs [class]
     module.add_class('SystemWallClockMs', import_from_module='ns.core')
     ## tag.h (module 'network'): ns3::Tag [class]
@@ -328,6 +332,10 @@
     module.add_class('CallbackValue', import_from_module='ns.core', parent=root_module['ns3::AttributeValue'])
     ## channel.h (module 'network'): ns3::Channel [class]
     module.add_class('Channel', import_from_module='ns.network', parent=root_module['ns3::Object'])
+    ## data-calculator.h (module 'stats'): ns3::DataCalculator [class]
+    module.add_class('DataCalculator', import_from_module='ns.stats', parent=root_module['ns3::Object'])
+    ## data-output-interface.h (module 'stats'): ns3::DataOutputInterface [class]
+    module.add_class('DataOutputInterface', import_from_module='ns.stats', parent=root_module['ns3::Object'])
     ## data-rate.h (module 'network'): ns3::DataRateChecker [class]
     module.add_class('DataRateChecker', import_from_module='ns.network', parent=root_module['ns3::AttributeChecker'])
     ## data-rate.h (module 'network'): ns3::DataRateValue [class]
@@ -368,6 +376,8 @@
     module.add_class('Mac48AddressChecker', import_from_module='ns.network', parent=root_module['ns3::AttributeChecker'])
     ## mac48-address.h (module 'network'): ns3::Mac48AddressValue [class]
     module.add_class('Mac48AddressValue', import_from_module='ns.network', parent=root_module['ns3::AttributeValue'])
+    ## basic-data-calculators.h (module 'stats'): ns3::MinMaxAvgTotalCalculator<double> [class]
+    module.add_class('MinMaxAvgTotalCalculator', import_from_module='ns.stats', template_parameters=['double'], parent=[root_module['ns3::DataCalculator'], root_module['ns3::StatisticalSummary']])
     ## net-device.h (module 'network'): ns3::NetDevice [class]
     module.add_class('NetDevice', import_from_module='ns.network', parent=root_module['ns3::Object'])
     ## net-device.h (module 'network'): ns3::NetDevice::PacketType [enumeration]
@@ -519,6 +529,7 @@
     register_Ns3ByteTagListIteratorItem_methods(root_module, root_module['ns3::ByteTagList::Iterator::Item'])
     register_Ns3CallbackBase_methods(root_module, root_module['ns3::CallbackBase'])
     register_Ns3ChannelList_methods(root_module, root_module['ns3::ChannelList'])
+    register_Ns3DataOutputCallback_methods(root_module, root_module['ns3::DataOutputCallback'])
     register_Ns3DataRate_methods(root_module, root_module['ns3::DataRate'])
     register_Ns3EventId_methods(root_module, root_module['ns3::EventId'])
     register_Ns3Inet6SocketAddress_methods(root_module, root_module['ns3::Inet6SocketAddress'])
@@ -558,6 +569,7 @@
     register_Ns3SequentialVariable_methods(root_module, root_module['ns3::SequentialVariable'])
     register_Ns3SimpleRefCount__Ns3Object_Ns3ObjectBase_Ns3ObjectDeleter_methods(root_module, root_module['ns3::SimpleRefCount< ns3::Object, ns3::ObjectBase, ns3::ObjectDeleter >'])
     register_Ns3Simulator_methods(root_module, root_module['ns3::Simulator'])
+    register_Ns3StatisticalSummary_methods(root_module, root_module['ns3::StatisticalSummary'])
     register_Ns3SystemWallClockMs_methods(root_module, root_module['ns3::SystemWallClockMs'])
     register_Ns3Tag_methods(root_module, root_module['ns3::Tag'])
     register_Ns3TagBuffer_methods(root_module, root_module['ns3::TagBuffer'])
@@ -634,6 +646,8 @@
     register_Ns3CallbackImplBase_methods(root_module, root_module['ns3::CallbackImplBase'])
     register_Ns3CallbackValue_methods(root_module, root_module['ns3::CallbackValue'])
     register_Ns3Channel_methods(root_module, root_module['ns3::Channel'])
+    register_Ns3DataCalculator_methods(root_module, root_module['ns3::DataCalculator'])
+    register_Ns3DataOutputInterface_methods(root_module, root_module['ns3::DataOutputInterface'])
     register_Ns3DataRateChecker_methods(root_module, root_module['ns3::DataRateChecker'])
     register_Ns3DataRateValue_methods(root_module, root_module['ns3::DataRateValue'])
     register_Ns3DropTailQueue_methods(root_module, root_module['ns3::DropTailQueue'])
@@ -653,6 +667,7 @@
     register_Ns3ListErrorModel_methods(root_module, root_module['ns3::ListErrorModel'])
     register_Ns3Mac48AddressChecker_methods(root_module, root_module['ns3::Mac48AddressChecker'])
     register_Ns3Mac48AddressValue_methods(root_module, root_module['ns3::Mac48AddressValue'])
+    register_Ns3MinMaxAvgTotalCalculator__Double_methods(root_module, root_module['ns3::MinMaxAvgTotalCalculator< double >'])
     register_Ns3NetDevice_methods(root_module, root_module['ns3::NetDevice'])
     register_Ns3NixVector_methods(root_module, root_module['ns3::NixVector'])
     register_Ns3Node_methods(root_module, root_module['ns3::Node'])
@@ -1468,6 +1483,43 @@
                    is_static=True)
     return
 
+def register_Ns3DataOutputCallback_methods(root_module, cls):
+    ## data-output-interface.h (module 'stats'): ns3::DataOutputCallback::DataOutputCallback() [constructor]
+    cls.add_constructor([])
+    ## data-output-interface.h (module 'stats'): ns3::DataOutputCallback::DataOutputCallback(ns3::DataOutputCallback const & arg0) [copy constructor]
+    cls.add_constructor([param('ns3::DataOutputCallback const &', 'arg0')])
+    ## data-output-interface.h (module 'stats'): void ns3::DataOutputCallback::OutputSingleton(std::string key, std::string variable, int val) [member function]
+    cls.add_method('OutputSingleton', 
+                   'void', 
+                   [param('std::string', 'key'), param('std::string', 'variable'), param('int', 'val')], 
+                   is_pure_virtual=True, is_virtual=True)
+    ## data-output-interface.h (module 'stats'): void ns3::DataOutputCallback::OutputSingleton(std::string key, std::string variable, uint32_t val) [member function]
+    cls.add_method('OutputSingleton', 
+                   'void', 
+                   [param('std::string', 'key'), param('std::string', 'variable'), param('uint32_t', 'val')], 
+                   is_pure_virtual=True, is_virtual=True)
+    ## data-output-interface.h (module 'stats'): void ns3::DataOutputCallback::OutputSingleton(std::string key, std::string variable, double val) [member function]
+    cls.add_method('OutputSingleton', 
+                   'void', 
+                   [param('std::string', 'key'), param('std::string', 'variable'), param('double', 'val')], 
+                   is_pure_virtual=True, is_virtual=True)
+    ## data-output-interface.h (module 'stats'): void ns3::DataOutputCallback::OutputSingleton(std::string key, std::string variable, std::string val) [member function]
+    cls.add_method('OutputSingleton', 
+                   'void', 
+                   [param('std::string', 'key'), param('std::string', 'variable'), param('std::string', 'val')], 
+                   is_pure_virtual=True, is_virtual=True)
+    ## data-output-interface.h (module 'stats'): void ns3::DataOutputCallback::OutputSingleton(std::string key, std::string variable, ns3::Time val) [member function]
+    cls.add_method('OutputSingleton', 
+                   'void', 
+                   [param('std::string', 'key'), param('std::string', 'variable'), param('ns3::Time', 'val')], 
+                   is_pure_virtual=True, is_virtual=True)
+    ## data-output-interface.h (module 'stats'): void ns3::DataOutputCallback::OutputStatistic(std::string key, std::string variable, ns3::StatisticalSummary const * statSum) [member function]
+    cls.add_method('OutputStatistic', 
+                   'void', 
+                   [param('std::string', 'key'), param('std::string', 'variable'), param('ns3::StatisticalSummary const *', 'statSum')], 
+                   is_pure_virtual=True, is_virtual=True)
+    return
+
 def register_Ns3DataRate_methods(root_module, cls):
     cls.add_output_stream_operator()
     cls.add_binary_comparison_operator('!=')
@@ -3267,6 +3319,53 @@
                    is_static=True)
     return
 
+def register_Ns3StatisticalSummary_methods(root_module, cls):
+    ## data-calculator.h (module 'stats'): ns3::StatisticalSummary::StatisticalSummary() [constructor]
+    cls.add_constructor([])
+    ## data-calculator.h (module 'stats'): ns3::StatisticalSummary::StatisticalSummary(ns3::StatisticalSummary const & arg0) [copy constructor]
+    cls.add_constructor([param('ns3::StatisticalSummary const &', 'arg0')])
+    ## data-calculator.h (module 'stats'): long int ns3::StatisticalSummary::getCount() const [member function]
+    cls.add_method('getCount', 
+                   'long int', 
+                   [], 
+                   is_pure_virtual=True, is_const=True, is_virtual=True)
+    ## data-calculator.h (module 'stats'): double ns3::StatisticalSummary::getMax() const [member function]
+    cls.add_method('getMax', 
+                   'double', 
+                   [], 
+                   is_pure_virtual=True, is_const=True, is_virtual=True)
+    ## data-calculator.h (module 'stats'): double ns3::StatisticalSummary::getMean() const [member function]
+    cls.add_method('getMean', 
+                   'double', 
+                   [], 
+                   is_pure_virtual=True, is_const=True, is_virtual=True)
+    ## data-calculator.h (module 'stats'): double ns3::StatisticalSummary::getMin() const [member function]
+    cls.add_method('getMin', 
+                   'double', 
+                   [], 
+                   is_pure_virtual=True, is_const=True, is_virtual=True)
+    ## data-calculator.h (module 'stats'): double ns3::StatisticalSummary::getSqrSum() const [member function]
+    cls.add_method('getSqrSum', 
+                   'double', 
+                   [], 
+                   is_pure_virtual=True, is_const=True, is_virtual=True)
+    ## data-calculator.h (module 'stats'): double ns3::StatisticalSummary::getStddev() const [member function]
+    cls.add_method('getStddev', 
+                   'double', 
+                   [], 
+                   is_pure_virtual=True, is_const=True, is_virtual=True)
+    ## data-calculator.h (module 'stats'): double ns3::StatisticalSummary::getSum() const [member function]
+    cls.add_method('getSum', 
+                   'double', 
+                   [], 
+                   is_pure_virtual=True, is_const=True, is_virtual=True)
+    ## data-calculator.h (module 'stats'): double ns3::StatisticalSummary::getVariance() const [member function]
+    cls.add_method('getVariance', 
+                   'double', 
+                   [], 
+                   is_pure_virtual=True, is_const=True, is_virtual=True)
+    return
+
 def register_Ns3SystemWallClockMs_methods(root_module, cls):
     ## system-wall-clock-ms.h (module 'core'): ns3::SystemWallClockMs::SystemWallClockMs(ns3::SystemWallClockMs const & arg0) [copy constructor]
     cls.add_constructor([param('ns3::SystemWallClockMs const &', 'arg0')])
@@ -4925,6 +5024,11 @@
                    'uint32_t', 
                    [], 
                    is_pure_virtual=True, is_const=True, is_virtual=True)
+    ## socket.h (module 'network'): bool ns3::Socket::IsRecvPktInfo() const [member function]
+    cls.add_method('IsRecvPktInfo', 
+                   'bool', 
+                   [], 
+                   is_const=True)
     ## socket.h (module 'network'): int ns3::Socket::Listen() [member function]
     cls.add_method('Listen', 
                    'int', 
@@ -5739,6 +5843,90 @@
                    is_static=True)
     return
 
+def register_Ns3DataCalculator_methods(root_module, cls):
+    ## data-calculator.h (module 'stats'): ns3::DataCalculator::DataCalculator(ns3::DataCalculator const & arg0) [copy constructor]
+    cls.add_constructor([param('ns3::DataCalculator const &', 'arg0')])
+    ## data-calculator.h (module 'stats'): ns3::DataCalculator::DataCalculator() [constructor]
+    cls.add_constructor([])
+    ## data-calculator.h (module 'stats'): void ns3::DataCalculator::Disable() [member function]
+    cls.add_method('Disable', 
+                   'void', 
+                   [])
+    ## data-calculator.h (module 'stats'): void ns3::DataCalculator::Enable() [member function]
+    cls.add_method('Enable', 
+                   'void', 
+                   [])
+    ## data-calculator.h (module 'stats'): std::string ns3::DataCalculator::GetContext() const [member function]
+    cls.add_method('GetContext', 
+                   'std::string', 
+                   [], 
+                   is_const=True)
+    ## data-calculator.h (module 'stats'): bool ns3::DataCalculator::GetEnabled() const [member function]
+    cls.add_method('GetEnabled', 
+                   'bool', 
+                   [], 
+                   is_const=True)
+    ## data-calculator.h (module 'stats'): std::string ns3::DataCalculator::GetKey() const [member function]
+    cls.add_method('GetKey', 
+                   'std::string', 
+                   [], 
+                   is_const=True)
+    ## data-calculator.h (module 'stats'): void ns3::DataCalculator::Output(ns3::DataOutputCallback & callback) const [member function]
+    cls.add_method('Output', 
+                   'void', 
+                   [param('ns3::DataOutputCallback &', 'callback')], 
+                   is_pure_virtual=True, is_const=True, is_virtual=True)
+    ## data-calculator.h (module 'stats'): void ns3::DataCalculator::SetContext(std::string const context) [member function]
+    cls.add_method('SetContext', 
+                   'void', 
+                   [param('std::string const', 'context')])
+    ## data-calculator.h (module 'stats'): void ns3::DataCalculator::SetKey(std::string const key) [member function]
+    cls.add_method('SetKey', 
+                   'void', 
+                   [param('std::string const', 'key')])
+    ## data-calculator.h (module 'stats'): void ns3::DataCalculator::Start(ns3::Time const & startTime) [member function]
+    cls.add_method('Start', 
+                   'void', 
+                   [param('ns3::Time const &', 'startTime')], 
+                   is_virtual=True)
+    ## data-calculator.h (module 'stats'): void ns3::DataCalculator::Stop(ns3::Time const & stopTime) [member function]
+    cls.add_method('Stop', 
+                   'void', 
+                   [param('ns3::Time const &', 'stopTime')], 
+                   is_virtual=True)
+    ## data-calculator.h (module 'stats'): void ns3::DataCalculator::DoDispose() [member function]
+    cls.add_method('DoDispose', 
+                   'void', 
+                   [], 
+                   visibility='protected', is_virtual=True)
+    return
+
+def register_Ns3DataOutputInterface_methods(root_module, cls):
+    ## data-output-interface.h (module 'stats'): ns3::DataOutputInterface::DataOutputInterface(ns3::DataOutputInterface const & arg0) [copy constructor]
+    cls.add_constructor([param('ns3::DataOutputInterface const &', 'arg0')])
+    ## data-output-interface.h (module 'stats'): ns3::DataOutputInterface::DataOutputInterface() [constructor]
+    cls.add_constructor([])
+    ## data-output-interface.h (module 'stats'): std::string ns3::DataOutputInterface::GetFilePrefix() const [member function]
+    cls.add_method('GetFilePrefix', 
+                   'std::string', 
+                   [], 
+                   is_const=True)
+    ## data-output-interface.h (module 'stats'): void ns3::DataOutputInterface::Output(ns3::DataCollector & dc) [member function]
+    cls.add_method('Output', 
+                   'void', 
+                   [param('ns3::DataCollector &', 'dc')], 
+                   is_pure_virtual=True, is_virtual=True)
+    ## data-output-interface.h (module 'stats'): void ns3::DataOutputInterface::SetFilePrefix(std::string const prefix) [member function]
+    cls.add_method('SetFilePrefix', 
+                   'void', 
+                   [param('std::string const', 'prefix')])
+    ## data-output-interface.h (module 'stats'): void ns3::DataOutputInterface::DoDispose() [member function]
+    cls.add_method('DoDispose', 
+                   'void', 
+                   [], 
+                   visibility='protected', is_virtual=True)
+    return
+
 def register_Ns3DataRateChecker_methods(root_module, cls):
     ## data-rate.h (module 'network'): ns3::DataRateChecker::DataRateChecker() [constructor]
     cls.add_constructor([])
@@ -6282,6 +6470,71 @@
                    [param('ns3::Mac48Address const &', 'value')])
     return
 
+def register_Ns3MinMaxAvgTotalCalculator__Double_methods(root_module, cls):
+    ## basic-data-calculators.h (module 'stats'): ns3::MinMaxAvgTotalCalculator<double>::MinMaxAvgTotalCalculator(ns3::MinMaxAvgTotalCalculator<double> const & arg0) [copy constructor]
+    cls.add_constructor([param('ns3::MinMaxAvgTotalCalculator< double > const &', 'arg0')])
+    ## basic-data-calculators.h (module 'stats'): ns3::MinMaxAvgTotalCalculator<double>::MinMaxAvgTotalCalculator() [constructor]
+    cls.add_constructor([])
+    ## basic-data-calculators.h (module 'stats'): void ns3::MinMaxAvgTotalCalculator<double>::Output(ns3::DataOutputCallback & callback) const [member function]
+    cls.add_method('Output', 
+                   'void', 
+                   [param('ns3::DataOutputCallback &', 'callback')], 
+                   is_const=True, is_virtual=True)
+    ## basic-data-calculators.h (module 'stats'): void ns3::MinMaxAvgTotalCalculator<double>::Reset() [member function]
+    cls.add_method('Reset', 
+                   'void', 
+                   [])
+    ## basic-data-calculators.h (module 'stats'): void ns3::MinMaxAvgTotalCalculator<double>::Update(double const i) [member function]
+    cls.add_method('Update', 
+                   'void', 
+                   [param('double const', 'i')])
+    ## basic-data-calculators.h (module 'stats'): long int ns3::MinMaxAvgTotalCalculator<double>::getCount() const [member function]
+    cls.add_method('getCount', 
+                   'long int', 
+                   [], 
+                   is_const=True, is_virtual=True)
+    ## basic-data-calculators.h (module 'stats'): double ns3::MinMaxAvgTotalCalculator<double>::getMax() const [member function]
+    cls.add_method('getMax', 
+                   'double', 
+                   [], 
+                   is_const=True, is_virtual=True)
+    ## basic-data-calculators.h (module 'stats'): double ns3::MinMaxAvgTotalCalculator<double>::getMean() const [member function]
+    cls.add_method('getMean', 
+                   'double', 
+                   [], 
+                   is_const=True, is_virtual=True)
+    ## basic-data-calculators.h (module 'stats'): double ns3::MinMaxAvgTotalCalculator<double>::getMin() const [member function]
+    cls.add_method('getMin', 
+                   'double', 
+                   [], 
+                   is_const=True, is_virtual=True)
+    ## basic-data-calculators.h (module 'stats'): double ns3::MinMaxAvgTotalCalculator<double>::getSqrSum() const [member function]
+    cls.add_method('getSqrSum', 
+                   'double', 
+                   [], 
+                   is_const=True, is_virtual=True)
+    ## basic-data-calculators.h (module 'stats'): double ns3::MinMaxAvgTotalCalculator<double>::getStddev() const [member function]
+    cls.add_method('getStddev', 
+                   'double', 
+                   [], 
+                   is_const=True, is_virtual=True)
+    ## basic-data-calculators.h (module 'stats'): double ns3::MinMaxAvgTotalCalculator<double>::getSum() const [member function]
+    cls.add_method('getSum', 
+                   'double', 
+                   [], 
+                   is_const=True, is_virtual=True)
+    ## basic-data-calculators.h (module 'stats'): double ns3::MinMaxAvgTotalCalculator<double>::getVariance() const [member function]
+    cls.add_method('getVariance', 
+                   'double', 
+                   [], 
+                   is_const=True, is_virtual=True)
+    ## basic-data-calculators.h (module 'stats'): void ns3::MinMaxAvgTotalCalculator<double>::DoDispose() [member function]
+    cls.add_method('DoDispose', 
+                   'void', 
+                   [], 
+                   visibility='protected', is_virtual=True)
+    return
+
 def register_Ns3NetDevice_methods(root_module, cls):
     ## net-device.h (module 'network'): ns3::NetDevice::NetDevice() [constructor]
     cls.add_constructor([])
--- a/src/applications/model/packet-sink.cc	Wed Apr 11 11:00:27 2012 +0200
+++ b/src/applications/model/packet-sink.cc	Wed Apr 11 13:49:33 2012 +0200
@@ -168,7 +168,7 @@
   NS_LOG_FUNCTION (this << socket);
   Ptr<Packet> packet;
   Address from;
-  while (packet = socket->RecvFrom (from))
+  while ((packet = socket->RecvFrom (from)))
     {
       if (packet->GetSize () == 0)
         { //EOF
--- a/src/applications/model/ping6.cc	Wed Apr 11 11:00:27 2012 +0200
+++ b/src/applications/model/ping6.cc	Wed Apr 11 13:49:33 2012 +0200
@@ -231,7 +231,7 @@
 
   Ptr<Packet> packet=0;
   Address from;
-  while (packet = socket->RecvFrom (from))
+  while ((packet = socket->RecvFrom (from)))
     {
       if (Inet6SocketAddress::IsMatchingType (from))
         {
--- a/src/applications/model/radvd.cc	Wed Apr 11 11:00:27 2012 +0200
+++ b/src/applications/model/radvd.cc	Wed Apr 11 13:49:33 2012 +0200
@@ -235,7 +235,7 @@
   Ptr<Packet> packet = 0;
   Address from;
 
-  while (packet = socket->RecvFrom (from))
+  while ((packet = socket->RecvFrom (from)))
     {
       if (Inet6SocketAddress::IsMatchingType (from))
         {
--- a/src/applications/model/udp-echo-client.cc	Wed Apr 11 11:00:27 2012 +0200
+++ b/src/applications/model/udp-echo-client.cc	Wed Apr 11 13:49:33 2012 +0200
@@ -306,15 +306,15 @@
 
   ++m_sent;
 
-  if (InetSocketAddress::IsMatchingType (m_peerAddress))
+  if (Ipv4Address::IsMatchingType (m_peerAddress))
     {
-      NS_LOG_INFO ("Sent " << m_size << " bytes to " <<
-                   InetSocketAddress::ConvertFrom (m_peerAddress));
+      NS_LOG_INFO ("At time " << Simulator::Now ().GetSeconds () << "s client sent " << m_size << " bytes to " <<
+                   Ipv4Address::ConvertFrom (m_peerAddress) << " port " << m_peerPort);
     }
-  else if (Inet6SocketAddress::IsMatchingType (m_peerAddress))
+  else if (Ipv6Address::IsMatchingType (m_peerAddress))
     {
-      NS_LOG_INFO ("Sent " << m_size << " bytes to " <<
-                   Inet6SocketAddress::ConvertFrom (m_peerAddress));
+      NS_LOG_INFO ("At time " << Simulator::Now ().GetSeconds () << "s client sent " << m_size << " bytes to " <<
+                   Ipv6Address::ConvertFrom (m_peerAddress) << " port " << m_peerPort);
     }
 
   if (m_sent < m_count) 
@@ -329,17 +329,19 @@
   NS_LOG_FUNCTION (this << socket);
   Ptr<Packet> packet;
   Address from;
-  while (packet = socket->RecvFrom (from))
+  while ((packet = socket->RecvFrom (from)))
     {
       if (InetSocketAddress::IsMatchingType (from))
         {
-          NS_LOG_INFO ("Received " << packet->GetSize () << " bytes from " <<
-                       InetSocketAddress::ConvertFrom (from).GetIpv4 ());
+          NS_LOG_INFO ("At time " << Simulator::Now ().GetSeconds () << "s client received " << packet->GetSize () << " bytes from " <<
+                       InetSocketAddress::ConvertFrom (from).GetIpv4 () << " port " <<
+                       InetSocketAddress::ConvertFrom (from).GetPort ());
         }
       else if (Inet6SocketAddress::IsMatchingType (from))
         {
-          NS_LOG_INFO ("Received " << packet->GetSize () << " bytes from " <<
-                       Inet6SocketAddress::ConvertFrom (from).GetIpv6 ());
+          NS_LOG_INFO ("At time " << Simulator::Now ().GetSeconds () << "s client received " << packet->GetSize () << " bytes from " <<
+                       Inet6SocketAddress::ConvertFrom (from).GetIpv6 () << " port " <<
+                       Inet6SocketAddress::ConvertFrom (from).GetPort ());
         }
     }
 }
--- a/src/applications/model/udp-echo-server.cc	Wed Apr 11 11:00:27 2012 +0200
+++ b/src/applications/model/udp-echo-server.cc	Wed Apr 11 13:49:33 2012 +0200
@@ -143,29 +143,38 @@
 {
   Ptr<Packet> packet;
   Address from;
-  while (packet = socket->RecvFrom (from))
+  while ((packet = socket->RecvFrom (from)))
     {
       if (InetSocketAddress::IsMatchingType (from))
         {
-          NS_LOG_INFO ("Received " << packet->GetSize () << " bytes from " <<
-                       InetSocketAddress::ConvertFrom (from).GetIpv4 ());
-
-          packet->RemoveAllPacketTags ();
-          packet->RemoveAllByteTags ();
-
-          NS_LOG_LOGIC ("Echoing packet");
-          socket->SendTo (packet, 0, from);
+          NS_LOG_INFO ("At time " << Simulator::Now ().GetSeconds () << "s server received " << packet->GetSize () << " bytes from " <<
+                       InetSocketAddress::ConvertFrom (from).GetIpv4 () << " port " <<
+                       InetSocketAddress::ConvertFrom (from).GetPort ());
         }
       else if (Inet6SocketAddress::IsMatchingType (from))
         {
-          NS_LOG_INFO ("Received " << packet->GetSize () << " bytes from " <<
-                       Inet6SocketAddress::ConvertFrom (from).GetIpv6 ());
+          NS_LOG_INFO ("At time " << Simulator::Now ().GetSeconds () << "s server received " << packet->GetSize () << " bytes from " <<
+                       Inet6SocketAddress::ConvertFrom (from).GetIpv6 () << " port " <<
+                       InetSocketAddress::ConvertFrom (from).GetPort ());
+        }
+
+      packet->RemoveAllPacketTags ();
+      packet->RemoveAllByteTags ();
+
+      NS_LOG_LOGIC ("Echoing packet");
+      socket->SendTo (packet, 0, from);
 
-          packet->RemoveAllPacketTags ();
-          packet->RemoveAllByteTags ();
-
-          NS_LOG_LOGIC ("Echoing packet");
-          socket->SendTo (packet, 0, from);
+      if (InetSocketAddress::IsMatchingType (from))
+        {
+          NS_LOG_INFO ("At time " << Simulator::Now ().GetSeconds () << "s server sent " << packet->GetSize () << " bytes to " <<
+                       InetSocketAddress::ConvertFrom (from).GetIpv4 () << " port " <<
+                       InetSocketAddress::ConvertFrom (from).GetPort ());
+        }
+      else if (Inet6SocketAddress::IsMatchingType (from))
+        {
+          NS_LOG_INFO ("At time " << Simulator::Now ().GetSeconds () << "s server sent " << packet->GetSize () << " bytes to " <<
+                       Inet6SocketAddress::ConvertFrom (from).GetIpv6 () << " port " <<
+                       InetSocketAddress::ConvertFrom (from).GetPort ());
         }
     }
 }
--- a/src/applications/model/udp-server.cc	Wed Apr 11 11:00:27 2012 +0200
+++ b/src/applications/model/udp-server.cc	Wed Apr 11 13:49:33 2012 +0200
@@ -152,7 +152,7 @@
   NS_LOG_FUNCTION (this << socket);
   Ptr<Packet> packet;
   Address from;
-  while (packet = socket->RecvFrom (from))
+  while ((packet = socket->RecvFrom (from)))
     {
       if (packet->GetSize () > 0)
         {
--- a/src/config-store/wscript	Wed Apr 11 11:00:27 2012 +0200
+++ b/src/config-store/wscript	Wed Apr 11 13:49:33 2012 +0200
@@ -1,13 +1,27 @@
 ## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
 
 import wutils
+from waflib import Options
+
+
+def options(opt):
+    opt.add_option('--disable-gtk',
+                   help=('Disable GTK+ support'),
+                   dest='disable_gtk', default=False, action="store_true")
 
 def configure(conf):
-    have_gtk = conf.pkg_check_modules('GTK_CONFIG_STORE', 'gtk+-2.0 >= 2.12', mandatory=False)
-    conf.env['ENABLE_GTK_CONFIG_STORE'] = have_gtk
-    conf.report_optional_feature("GtkConfigStore", "GtkConfigStore",
-                                 conf.env['ENABLE_GTK_CONFIG_STORE'],
-                                 "library 'gtk+-2.0 >= 2.12' not found")
+    if Options.options.disable_gtk:
+        conf.env['ENABLE_GTK_CONFIG_STORE'] = False
+        conf.report_optional_feature("GtkConfigStore", "GtkConfigStore",
+                                     conf.env['ENABLE_GTK_CONFIG_STORE'],
+                                     "--disable-gtk option given")
+    else:
+        have_gtk = conf.pkg_check_modules('GTK_CONFIG_STORE', 'gtk+-2.0 >= 2.12', mandatory=False)
+        conf.env['ENABLE_GTK_CONFIG_STORE'] = have_gtk
+        conf.report_optional_feature("GtkConfigStore", "GtkConfigStore",
+                                     conf.env['ENABLE_GTK_CONFIG_STORE'],
+                                     "library 'gtk+-2.0 >= 2.12' not found")
+
     have_libxml2 = conf.pkg_check_modules('LIBXML2', 'libxml-2.0 >= 2.6', mandatory=False)
     if have_libxml2:
         conf.define('HAVE_LIBXML2', 1)
--- a/src/core/bindings/callbacks_list.py	Wed Apr 11 11:00:27 2012 +0200
+++ b/src/core/bindings/callbacks_list.py	Wed Apr 11 13:49:33 2012 +0200
@@ -1,4 +1,5 @@
 callback_classes = [
     ['void', 'unsigned char*', 'long', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty'],
+    ['void', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty'],
     ['bool', 'std::string', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty'],
 ]
--- a/src/core/bindings/module_helpers.cc	Wed Apr 11 11:00:27 2012 +0200
+++ b/src/core/bindings/module_helpers.cc	Wed Apr 11 13:49:33 2012 +0200
@@ -1,5 +1,6 @@
 #include "ns3module.h"
 #include "ns3/ref-count-base.h"
+#include <unistd.h>
 
 
 namespace {
@@ -72,7 +73,6 @@
 
 } // closes: namespace {
 
-
 PyObject *
 _wrap_Simulator_Schedule (PyNs3Simulator *PYBINDGEN_UNUSED (dummy), PyObject *args, PyObject *kwargs,
                           PyObject **return_exception)
@@ -349,58 +349,104 @@
   return Py_None;
 }
 
+class PythonSimulator
+{
+public:
+  PythonSimulator();
+  void Run(void);
+  bool IsFailed(void) const;
+
+private:
+  void DoCheckSignals(void);
+  void DoRun(void);
+  volatile bool m_stopped;
+  bool m_failed;
+  volatile bool m_isCheckPending;
+  ns3::Ptr<ns3::SystemThread> m_thread;
+  PyThreadState *m_py_thread_state;
+};
+
+PythonSimulator::PythonSimulator()
+  : m_stopped(false),
+    m_failed(false),
+    m_isCheckPending(false)
+{
+  m_thread = ns3::Create<ns3::SystemThread>(ns3::MakeCallback(&PythonSimulator::DoRun, this));
+  m_py_thread_state = NULL;
+}
+
+void
+PythonSimulator::Run(void)
+{
+  m_failed = false;
+  m_stopped = false;
+  m_isCheckPending = false;
+  m_thread->Start();
+  if (PyEval_ThreadsInitialized ())
+    {
+      m_py_thread_state = PyEval_SaveThread ();
+    }
+  ns3::Simulator::Run ();
+  m_stopped = true;
+  m_thread->Join();
+  if (m_py_thread_state)
+    {
+      PyEval_RestoreThread (m_py_thread_state);
+    }
+}
+
+bool 
+PythonSimulator::IsFailed(void) const
+{
+  return m_failed;
+}
+
+void
+PythonSimulator::DoCheckSignals(void)
+{
+  if (m_py_thread_state)
+    {
+      PyEval_RestoreThread (m_py_thread_state);
+    }
+  PyErr_CheckSignals ();
+  if (PyErr_Occurred ())
+    {
+      m_failed = true;
+      ns3::Simulator::Stop();
+    }
+  if (PyEval_ThreadsInitialized ())
+    {
+      m_py_thread_state = PyEval_SaveThread ();
+    }
+
+  m_isCheckPending = false;
+}
+
+void 
+PythonSimulator::DoRun(void)
+{
+  while (!m_stopped)
+    {
+      if (!m_isCheckPending)
+        {
+          m_isCheckPending = true;
+          ns3::Simulator::ScheduleWithContext(0xffffffff, ns3::Seconds(0.0),
+					  &PythonSimulator::DoCheckSignals, this);
+        }
+      usleep(200000);
+    }
+}
 
 PyObject *
 _wrap_Simulator_Run (PyNs3Simulator *PYBINDGEN_UNUSED (dummy), PyObject *args, PyObject *kwargs,
                      PyObject **return_exception)
 {
-  const char *keywords[] = { "signal_check_frequency", NULL};
-  int signal_check_frequency;
-
-  ns3::Ptr<ns3::DefaultSimulatorImpl> defaultSim =
-    ns3::DynamicCast<ns3::DefaultSimulatorImpl> (ns3::Simulator::GetImplementation ());
-  if (defaultSim) {
-      signal_check_frequency = 100;
-    } else {
-      signal_check_frequency = -1;
-    }
-
-  if (!PyArg_ParseTupleAndKeywords (args, kwargs, (char *) "|i", (char **) keywords, &signal_check_frequency)) {
-      PyObject *exc_type, *traceback;
-      PyErr_Fetch (&exc_type, return_exception, &traceback);
-      Py_XDECREF (exc_type);
-      Py_XDECREF (traceback);
-      return NULL;
-    }
-
-  PyThreadState *py_thread_state = NULL;
-
-  if (signal_check_frequency == -1)
+  PythonSimulator simulator;
+  simulator.Run();
+  if (simulator.IsFailed())
     {
-      if (PyEval_ThreadsInitialized ())
-        py_thread_state = PyEval_SaveThread ();
-      ns3::Simulator::Run ();
-      if (py_thread_state)
-        PyEval_RestoreThread (py_thread_state);
-    } else {
-      while (!ns3::Simulator::IsFinished ())
-        {
-          if (PyEval_ThreadsInitialized ())
-            py_thread_state = PyEval_SaveThread ();
-
-          for (int n = signal_check_frequency; n > 0 && !ns3::Simulator::IsFinished (); --n)
-            {
-              ns3::Simulator::RunOneEvent ();
-            }
-
-          if (py_thread_state)
-            PyEval_RestoreThread (py_thread_state);
-          PyErr_CheckSignals ();
-          if (PyErr_Occurred ())
-            return NULL;
-        }
+      return NULL;
     }
   Py_INCREF (Py_None);
   return Py_None;
 }
-
--- a/src/core/bindings/modulegen__gcc_ILP32.py	Wed Apr 11 11:00:27 2012 +0200
+++ b/src/core/bindings/modulegen__gcc_ILP32.py	Wed Apr 11 13:49:33 2012 +0200
@@ -1113,11 +1113,6 @@
                    'bool', 
                    [], 
                    is_static=True)
-    ## simulator.h (module 'core'): static ns3::Time ns3::Simulator::Next() [member function]
-    cls.add_method('Next', 
-                   'ns3::Time', 
-                   [], 
-                   is_static=True, deprecated=True)
     ## simulator.h (module 'core'): static ns3::Time ns3::Simulator::Now() [member function]
     cls.add_method('Now', 
                    'ns3::Time', 
@@ -1128,11 +1123,6 @@
                    'void', 
                    [param('ns3::EventId const &', 'id')], 
                    is_static=True)
-    ## simulator.h (module 'core'): static void ns3::Simulator::RunOneEvent() [member function]
-    cls.add_method('RunOneEvent', 
-                   'void', 
-                   [], 
-                   is_static=True, deprecated=True)
     ## simulator.h (module 'core'): static void ns3::Simulator::SetImplementation(ns3::Ptr<ns3::SimulatorImpl> impl) [member function]
     cls.add_method('SetImplementation', 
                    'void', 
@@ -2122,11 +2112,6 @@
                    'bool', 
                    [], 
                    is_pure_virtual=True, is_const=True, is_virtual=True)
-    ## simulator-impl.h (module 'core'): ns3::Time ns3::SimulatorImpl::Next() const [member function]
-    cls.add_method('Next', 
-                   'ns3::Time', 
-                   [], 
-                   is_pure_virtual=True, is_const=True, is_virtual=True)
     ## simulator-impl.h (module 'core'): ns3::Time ns3::SimulatorImpl::Now() const [member function]
     cls.add_method('Now', 
                    'ns3::Time', 
@@ -2142,11 +2127,6 @@
                    'void', 
                    [], 
                    is_pure_virtual=True, is_virtual=True)
-    ## simulator-impl.h (module 'core'): void ns3::SimulatorImpl::RunOneEvent() [member function]
-    cls.add_method('RunOneEvent', 
-                   'void', 
-                   [], 
-                   is_pure_virtual=True, is_virtual=True)
     ## simulator-impl.h (module 'core'): ns3::EventId ns3::SimulatorImpl::Schedule(ns3::Time const & time, ns3::EventImpl * event) [member function]
     cls.add_method('Schedule', 
                    'ns3::EventId', 
@@ -2284,20 +2264,22 @@
 def register_Ns3SystemThread_methods(root_module, cls):
     ## system-thread.h (module 'core'): ns3::SystemThread::SystemThread(ns3::SystemThread const & arg0) [copy constructor]
     cls.add_constructor([param('ns3::SystemThread const &', 'arg0')])
-    ## system-thread.h (module 'core'): ns3::SystemThread::SystemThread(ns3::Callback<void,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty> callback) [constructor]
+    ## system-thread.h (module 'core'): ns3::SystemThread::SystemThread(ns3::Callback<void, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> callback) [constructor]
     cls.add_constructor([param('ns3::Callback< void, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'callback')])
-    ## system-thread.h (module 'core'): bool ns3::SystemThread::Break() [member function]
-    cls.add_method('Break', 
+    ## system-thread.h (module 'core'): static bool ns3::SystemThread::Equals(pthread_t id) [member function]
+    cls.add_method('Equals', 
                    'bool', 
-                   [])
+                   [param('pthread_t', 'id')], 
+                   is_static=True)
     ## system-thread.h (module 'core'): void ns3::SystemThread::Join() [member function]
     cls.add_method('Join', 
                    'void', 
                    [])
-    ## system-thread.h (module 'core'): void ns3::SystemThread::Shutdown() [member function]
-    cls.add_method('Shutdown', 
-                   'void', 
-                   [])
+    ## system-thread.h (module 'core'): static pthread_t ns3::SystemThread::Self() [member function]
+    cls.add_method('Self', 
+                   'pthread_t', 
+                   [], 
+                   is_static=True)
     ## system-thread.h (module 'core'): void ns3::SystemThread::Start() [member function]
     cls.add_method('Start', 
                    'void', 
@@ -2851,11 +2833,6 @@
                    'bool', 
                    [], 
                    is_const=True, is_virtual=True)
-    ## default-simulator-impl.h (module 'core'): ns3::Time ns3::DefaultSimulatorImpl::Next() const [member function]
-    cls.add_method('Next', 
-                   'ns3::Time', 
-                   [], 
-                   is_const=True, is_virtual=True)
     ## default-simulator-impl.h (module 'core'): ns3::Time ns3::DefaultSimulatorImpl::Now() const [member function]
     cls.add_method('Now', 
                    'ns3::Time', 
@@ -2871,11 +2848,6 @@
                    'void', 
                    [], 
                    is_virtual=True)
-    ## default-simulator-impl.h (module 'core'): void ns3::DefaultSimulatorImpl::RunOneEvent() [member function]
-    cls.add_method('RunOneEvent', 
-                   'void', 
-                   [], 
-                   is_virtual=True)
     ## default-simulator-impl.h (module 'core'): ns3::EventId ns3::DefaultSimulatorImpl::Schedule(ns3::Time const & time, ns3::EventImpl * event) [member function]
     cls.add_method('Schedule', 
                    'ns3::EventId', 
@@ -3552,11 +3524,6 @@
                    'bool', 
                    [], 
                    is_const=True, is_virtual=True)
-    ## realtime-simulator-impl.h (module 'core'): ns3::Time ns3::RealtimeSimulatorImpl::Next() const [member function]
-    cls.add_method('Next', 
-                   'ns3::Time', 
-                   [], 
-                   is_const=True, is_virtual=True)
     ## realtime-simulator-impl.h (module 'core'): ns3::Time ns3::RealtimeSimulatorImpl::Now() const [member function]
     cls.add_method('Now', 
                    'ns3::Time', 
@@ -3577,11 +3544,6 @@
                    'void', 
                    [], 
                    is_virtual=True)
-    ## realtime-simulator-impl.h (module 'core'): void ns3::RealtimeSimulatorImpl::RunOneEvent() [member function]
-    cls.add_method('RunOneEvent', 
-                   'void', 
-                   [], 
-                   is_virtual=True)
     ## realtime-simulator-impl.h (module 'core'): ns3::EventId ns3::RealtimeSimulatorImpl::Schedule(ns3::Time const & time, ns3::EventImpl * event) [member function]
     cls.add_method('Schedule', 
                    'ns3::EventId', 
--- a/src/core/bindings/modulegen__gcc_LP64.py	Wed Apr 11 11:00:27 2012 +0200
+++ b/src/core/bindings/modulegen__gcc_LP64.py	Wed Apr 11 13:49:33 2012 +0200
@@ -1113,11 +1113,6 @@
                    'bool', 
                    [], 
                    is_static=True)
-    ## simulator.h (module 'core'): static ns3::Time ns3::Simulator::Next() [member function]
-    cls.add_method('Next', 
-                   'ns3::Time', 
-                   [], 
-                   is_static=True, deprecated=True)
     ## simulator.h (module 'core'): static ns3::Time ns3::Simulator::Now() [member function]
     cls.add_method('Now', 
                    'ns3::Time', 
@@ -1128,11 +1123,6 @@
                    'void', 
                    [param('ns3::EventId const &', 'id')], 
                    is_static=True)
-    ## simulator.h (module 'core'): static void ns3::Simulator::RunOneEvent() [member function]
-    cls.add_method('RunOneEvent', 
-                   'void', 
-                   [], 
-                   is_static=True, deprecated=True)
     ## simulator.h (module 'core'): static void ns3::Simulator::SetImplementation(ns3::Ptr<ns3::SimulatorImpl> impl) [member function]
     cls.add_method('SetImplementation', 
                    'void', 
@@ -2122,11 +2112,6 @@
                    'bool', 
                    [], 
                    is_pure_virtual=True, is_const=True, is_virtual=True)
-    ## simulator-impl.h (module 'core'): ns3::Time ns3::SimulatorImpl::Next() const [member function]
-    cls.add_method('Next', 
-                   'ns3::Time', 
-                   [], 
-                   is_pure_virtual=True, is_const=True, is_virtual=True)
     ## simulator-impl.h (module 'core'): ns3::Time ns3::SimulatorImpl::Now() const [member function]
     cls.add_method('Now', 
                    'ns3::Time', 
@@ -2142,11 +2127,6 @@
                    'void', 
                    [], 
                    is_pure_virtual=True, is_virtual=True)
-    ## simulator-impl.h (module 'core'): void ns3::SimulatorImpl::RunOneEvent() [member function]
-    cls.add_method('RunOneEvent', 
-                   'void', 
-                   [], 
-                   is_pure_virtual=True, is_virtual=True)
     ## simulator-impl.h (module 'core'): ns3::EventId ns3::SimulatorImpl::Schedule(ns3::Time const & time, ns3::EventImpl * event) [member function]
     cls.add_method('Schedule', 
                    'ns3::EventId', 
@@ -2284,20 +2264,22 @@
 def register_Ns3SystemThread_methods(root_module, cls):
     ## system-thread.h (module 'core'): ns3::SystemThread::SystemThread(ns3::SystemThread const & arg0) [copy constructor]
     cls.add_constructor([param('ns3::SystemThread const &', 'arg0')])
-    ## system-thread.h (module 'core'): ns3::SystemThread::SystemThread(ns3::Callback<void,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty> callback) [constructor]
+    ## system-thread.h (module 'core'): ns3::SystemThread::SystemThread(ns3::Callback<void, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> callback) [constructor]
     cls.add_constructor([param('ns3::Callback< void, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'callback')])
-    ## system-thread.h (module 'core'): bool ns3::SystemThread::Break() [member function]
-    cls.add_method('Break', 
+    ## system-thread.h (module 'core'): static bool ns3::SystemThread::Equals(pthread_t id) [member function]
+    cls.add_method('Equals', 
                    'bool', 
-                   [])
+                   [param('pthread_t', 'id')], 
+                   is_static=True)
     ## system-thread.h (module 'core'): void ns3::SystemThread::Join() [member function]
     cls.add_method('Join', 
                    'void', 
                    [])
-    ## system-thread.h (module 'core'): void ns3::SystemThread::Shutdown() [member function]
-    cls.add_method('Shutdown', 
-                   'void', 
-                   [])
+    ## system-thread.h (module 'core'): static pthread_t ns3::SystemThread::Self() [member function]
+    cls.add_method('Self', 
+                   'pthread_t', 
+                   [], 
+                   is_static=True)
     ## system-thread.h (module 'core'): void ns3::SystemThread::Start() [member function]
     cls.add_method('Start', 
                    'void', 
@@ -2851,11 +2833,6 @@
                    'bool', 
                    [], 
                    is_const=True, is_virtual=True)
-    ## default-simulator-impl.h (module 'core'): ns3::Time ns3::DefaultSimulatorImpl::Next() const [member function]
-    cls.add_method('Next', 
-                   'ns3::Time', 
-                   [], 
-                   is_const=True, is_virtual=True)
     ## default-simulator-impl.h (module 'core'): ns3::Time ns3::DefaultSimulatorImpl::Now() const [member function]
     cls.add_method('Now', 
                    'ns3::Time', 
@@ -2871,11 +2848,6 @@
                    'void', 
                    [], 
                    is_virtual=True)
-    ## default-simulator-impl.h (module 'core'): void ns3::DefaultSimulatorImpl::RunOneEvent() [member function]
-    cls.add_method('RunOneEvent', 
-                   'void', 
-                   [], 
-                   is_virtual=True)
     ## default-simulator-impl.h (module 'core'): ns3::EventId ns3::DefaultSimulatorImpl::Schedule(ns3::Time const & time, ns3::EventImpl * event) [member function]
     cls.add_method('Schedule', 
                    'ns3::EventId', 
@@ -3552,11 +3524,6 @@
                    'bool', 
                    [], 
                    is_const=True, is_virtual=True)
-    ## realtime-simulator-impl.h (module 'core'): ns3::Time ns3::RealtimeSimulatorImpl::Next() const [member function]
-    cls.add_method('Next', 
-                   'ns3::Time', 
-                   [], 
-                   is_const=True, is_virtual=True)
     ## realtime-simulator-impl.h (module 'core'): ns3::Time ns3::RealtimeSimulatorImpl::Now() const [member function]
     cls.add_method('Now', 
                    'ns3::Time', 
@@ -3577,11 +3544,6 @@
                    'void', 
                    [], 
                    is_virtual=True)
-    ## realtime-simulator-impl.h (module 'core'): void ns3::RealtimeSimulatorImpl::RunOneEvent() [member function]
-    cls.add_method('RunOneEvent', 
-                   'void', 
-                   [], 
-                   is_virtual=True)
     ## realtime-simulator-impl.h (module 'core'): ns3::EventId ns3::RealtimeSimulatorImpl::Schedule(ns3::Time const & time, ns3::EventImpl * event) [member function]
     cls.add_method('Schedule', 
                    'ns3::EventId', 
--- a/src/core/examples/main-test-sync.cc	Wed Apr 11 11:00:27 2012 +0200
+++ b/src/core/examples/main-test-sync.cc	Wed Apr 11 13:49:33 2012 +0200
@@ -48,7 +48,6 @@
 public:
   FakeNetDevice ();
   void Doit3 (void);
-  void Doit4 (void);
 };
 
 FakeNetDevice::FakeNetDevice ()
@@ -66,25 +65,11 @@
       //
       // Exercise the realtime relative now path
       //
-      DynamicCast<RealtimeSimulatorImpl> (Simulator::GetImplementation ())->ScheduleRealtimeNow (MakeEvent (&inserted_function));
+      Simulator::ScheduleWithContext(0xffffffff, Seconds(0.0), MakeEvent (&inserted_function));
       usleep (1000);
     }
 }
 
-void
-FakeNetDevice::Doit4 (void)
-{
-  NS_LOG_FUNCTION_NOARGS ();
-  sleep (1);
-  for (uint32_t i = 0; i < 10000; ++i)
-    {
-      //
-      // Exercise the realtime relative schedule path
-      //
-      DynamicCast<RealtimeSimulatorImpl> (Simulator::GetImplementation ())->ScheduleRealtime (Seconds (0), MakeEvent (&inserted_function));
-      usleep (1000);
-    }
-}
 
 void 
 test (void)
@@ -97,7 +82,7 @@
   // 
   // Make sure ScheduleNow works when the system isn't running
   //
-  DynamicCast<RealtimeSimulatorImpl> (Simulator::GetImplementation ())->ScheduleRealtimeNow (MakeEvent (&first_function));
+  Simulator::ScheduleWithContext(0xffffffff, Seconds(0.0), MakeEvent (&first_function));
 
   // 
   // drive the progression of m_currentTs at a ten millisecond rate from the main thread
@@ -111,14 +96,9 @@
       MakeCallback (&FakeNetDevice::Doit3, &fnd));
   st3->Start ();
 
-  Ptr<SystemThread> st4 = Create<SystemThread> (
-      MakeCallback (&FakeNetDevice::Doit4, &fnd));
-  st4->Start ();
-
   Simulator::Stop (Seconds (15.0));
   Simulator::Run ();
   st3->Join ();
-  st4->Join ();
   Simulator::Destroy ();
 }
 
--- a/src/core/model/calendar-scheduler.cc	Wed Apr 11 11:00:27 2012 +0200
+++ b/src/core/model/calendar-scheduler.cc	Wed Apr 11 13:49:33 2012 +0200
@@ -125,7 +125,7 @@
   NS_ASSERT (!IsEmpty ());
   uint32_t i = m_lastBucket;
   uint64_t bucketTop = m_bucketTop;
-  Scheduler::Event minEvent = { 0, { ~0, ~0}};
+  Scheduler::Event minEvent = { static_cast<uint64_t>(0), { static_cast<uint32_t>(~0), static_cast<uint32_t>(~0)}};
   do
     {
       if (!m_buckets[i].empty ())
@@ -154,7 +154,12 @@
 {
   uint32_t i = m_lastBucket;
   uint64_t bucketTop = m_bucketTop;
-  Scheduler::Event minEvent = { 0, { ~0, ~0}};
+  int32_t minBucket = -1;
+  Scheduler::EventKey minKey;
+  NS_ASSERT(!IsEmpty());
+  minKey.m_ts = uint64_t(-int64_t(1));
+  minKey.m_uid = 0;
+  minKey.m_context = 0xffffffff;
   do
     {
       if (!m_buckets[i].empty ())
@@ -168,9 +173,10 @@
               m_buckets[i].pop_front ();
               return next;
             }
-          if (next.key < minEvent.key)
+          if (next.key < minKey)
             {
-              minEvent = next;
+              minKey = next.key;
+              minBucket = i;
             }
         }
       i++;
@@ -179,12 +185,13 @@
     }
   while (i != m_lastBucket);
 
-  m_lastPrio = minEvent.key.m_ts;
-  m_lastBucket = Hash (minEvent.key.m_ts);
-  m_bucketTop = (minEvent.key.m_ts / m_width + 1) * m_width;
-  m_buckets[m_lastBucket].pop_front ();
+  m_lastPrio = minKey.m_ts;
+  m_lastBucket = Hash (minKey.m_ts);
+  m_bucketTop = (minKey.m_ts / m_width + 1) * m_width;
+  Scheduler::Event next = m_buckets[minBucket].front();
+  m_buckets[minBucket].pop_front ();
 
-  return minEvent;
+  return next;
 }
 
 Scheduler::Event
--- a/src/core/model/config.cc	Wed Apr 11 11:00:27 2012 +0200
+++ b/src/core/model/config.cc	Wed Apr 11 13:49:33 2012 +0200
@@ -379,42 +379,49 @@
     {
       // this is a normal attribute.
       TypeId tid = root->GetInstanceTypeId ();
-      struct TypeId::AttributeInformation info;
-      if (!tid.LookupAttributeByName (item, &info))
+      bool foundMatch = false;
+      for (uint32_t i = 0; i < tid.GetAttributeN(); i++)
         {
-          NS_LOG_DEBUG ("Requested item="<<item<<" does not exist on path="<<GetResolvedPath ());
-          return;
-        }
-      // attempt to cast to a pointer checker.
-      const PointerChecker *ptr = dynamic_cast<const PointerChecker *> (PeekPointer (info.checker));
-      if (ptr != 0)
-        {
-          NS_LOG_DEBUG ("GetAttribute(ptr)="<<item<<" on path="<<GetResolvedPath ());
-          PointerValue ptr;
-          root->GetAttribute (item, ptr);
-          Ptr<Object> object = ptr.Get<Object> ();
-          if (object == 0)
+          struct TypeId::AttributeInformation info;
+          info = tid.GetAttribute(i);
+          if (info.name != item && item != "*")
+            {
+              continue;
+            }
+          // attempt to cast to a pointer checker.
+          const PointerChecker *ptr = dynamic_cast<const PointerChecker *> (PeekPointer (info.checker));
+          if (ptr != 0)
             {
-              NS_LOG_ERROR ("Requested object name=\""<<item<<
-                            "\" exists on path=\""<<GetResolvedPath ()<<"\""
-                            " but is null.");
-              return;
+              NS_LOG_DEBUG ("GetAttribute(ptr)="<<info.name<<" on path="<<GetResolvedPath ());
+              PointerValue ptr;
+              root->GetAttribute (info.name, ptr);
+              Ptr<Object> object = ptr.Get<Object> ();
+              if (object == 0)
+                {
+                  NS_LOG_ERROR ("Requested object name=\""<<item<<
+                                "\" exists on path=\""<<GetResolvedPath ()<<"\""
+                                " but is null.");
+                  continue;
+                }
+              foundMatch = true;
+              m_workStack.push_back (info.name);
+              DoResolve (pathLeft, object);
+              m_workStack.pop_back ();
             }
-          m_workStack.push_back (item);
-          DoResolve (pathLeft, object);
-          m_workStack.pop_back ();
-        }
-      // attempt to cast to an object vector.
-      const ObjectPtrVectorChecker *vectorChecker = dynamic_cast<const ObjectPtrVectorChecker *> (PeekPointer (info.checker));
-      if (vectorChecker != 0)
-        {
-          NS_LOG_DEBUG ("GetAttribute(vector)="<<item<<" on path="<<GetResolvedPath ());
-          ObjectPtrVectorValue vector;
-          root->GetAttribute (item, vector);
-          m_workStack.push_back (item);
-          DoArrayResolve (pathLeft, vector);
-          m_workStack.pop_back ();
-        }
+          // attempt to cast to an object vector.
+          const ObjectPtrVectorChecker *vectorChecker =
+            dynamic_cast<const ObjectPtrVectorChecker *> (PeekPointer (info.checker));
+          
+          if (vectorChecker != 0)
+            {
+              NS_LOG_DEBUG ("GetAttribute(vector)="<<info.name<<" on path="<<GetResolvedPath () << pathLeft);
+              foundMatch = true;
+              ObjectPtrVectorValue vector;
+              root->GetAttribute (info.name, vector);
+              m_workStack.push_back (info.name);
+              DoArrayResolve (pathLeft, vector);
+              m_workStack.pop_back ();
+            }
       // attempt to cast to an object map.
       const ObjectPtrMapChecker *mapChecker = dynamic_cast<const ObjectPtrMapChecker *> (PeekPointer (info.checker));
       if (mapChecker != 0)
@@ -426,20 +433,27 @@
           DoMapResolve (pathLeft, map);
           m_workStack.pop_back ();
         }
-      // this could be anything else and we don't know what to do with it.
-      // So, we just ignore it.
+          // this could be anything else and we don't know what to do with it.
+          // So, we just ignore it.
+        }
+      if (!foundMatch)
+        {
+          NS_LOG_DEBUG ("Requested item="<<item<<" does not exist on path="<<GetResolvedPath ());
+          return;
+        }
     }
 }
 
 void 
 Resolver::DoArrayResolve (std::string path, const ObjectPtrVectorValue &vector)
 {
+  NS_LOG_FUNCTION(this << path);
   NS_ASSERT (path != "");
   NS_ASSERT ((path.find ("/")) == 0);
   std::string::size_type next = path.find ("/", 1);
   if (next == std::string::npos)
     {
-      NS_FATAL_ERROR ("vector path includes no index data on path=\""<<path<<"\"");
+      return;
     }
   std::string item = path.substr (1, next-1);
   std::string pathLeft = path.substr (next, path.size ()-next);
@@ -566,7 +580,7 @@
   NS_LOG_FUNCTION (path);
   class LookupMatchesResolver : public Resolver 
   {
-public:
+  public:
     LookupMatchesResolver (std::string path)
       : Resolver (path)
     {}
--- a/src/core/model/default-simulator-impl.cc	Wed Apr 11 11:00:27 2012 +0200
+++ b/src/core/model/default-simulator-impl.cc	Wed Apr 11 13:49:33 2012 +0200
@@ -59,6 +59,8 @@
   m_currentTs = 0;
   m_currentContext = 0xffffffff;
   m_unscheduledEvents = 0;
+  m_eventsWithContextEmpty = true;
+  m_main = SystemThread::Self();
 }
 
 DefaultSimulatorImpl::~DefaultSimulatorImpl ()
@@ -128,6 +130,8 @@
   m_currentUid = next.key.m_uid;
   next.impl->Invoke ();
   next.impl->Unref ();
+
+  ProcessEventsWithContext ();
 }
 
 bool 
@@ -136,24 +140,44 @@
   return m_events->IsEmpty () || m_stop;
 }
 
-uint64_t
-DefaultSimulatorImpl::NextTs (void) const
+void
+DefaultSimulatorImpl::ProcessEventsWithContext (void)
 {
-  NS_ASSERT (!m_events->IsEmpty ());
-  Scheduler::Event ev = m_events->PeekNext ();
-  return ev.key.m_ts;
-}
+  if (m_eventsWithContextEmpty)
+    {
+      return;
+    }
 
-Time
-DefaultSimulatorImpl::Next (void) const
-{
-  return TimeStep (NextTs ());
+  // swap queues
+  EventsWithContext eventsWithContext;
+  {
+    CriticalSection cs (m_eventsWithContextMutex);
+    m_eventsWithContext.swap(eventsWithContext);
+    m_eventsWithContextEmpty = true;
+  }
+  while (!eventsWithContext.empty ())
+    {
+       EventWithContext event = eventsWithContext.front ();
+       eventsWithContext.pop_front ();
+       Scheduler::Event ev;
+       ev.impl = event.event;
+       ev.key.m_ts = m_currentTs + event.timestamp;
+       ev.key.m_context = event.context;
+       ev.key.m_uid = m_uid;
+       m_uid++;
+       m_unscheduledEvents++;
+       m_events->Insert (ev);
+    }
 }
 
 void
 DefaultSimulatorImpl::Run (void)
 {
+  // Set the current threadId as the main threadId
+  m_main = SystemThread::Self();
+  ProcessEventsWithContext ();
   m_stop = false;
+
   while (!m_events->IsEmpty () && !m_stop) 
     {
       ProcessOneEvent ();
@@ -164,12 +188,6 @@
   NS_ASSERT (!m_events->IsEmpty () || m_unscheduledEvents == 0);
 }
 
-void
-DefaultSimulatorImpl::RunOneEvent (void)
-{
-  ProcessOneEvent ();
-}
-
 void 
 DefaultSimulatorImpl::Stop (void)
 {
@@ -188,6 +206,8 @@
 EventId
 DefaultSimulatorImpl::Schedule (Time const &time, EventImpl *event)
 {
+  NS_ASSERT_MSG (SystemThread::Equals (m_main), "Simulator::Schedule Thread-unsafe invocation!");
+
   Time tAbsolute = time + TimeStep (m_currentTs);
 
   NS_ASSERT (tAbsolute.IsPositive ());
@@ -208,19 +228,37 @@
 {
   NS_LOG_FUNCTION (this << context << time.GetTimeStep () << m_currentTs << event);
 
-  Scheduler::Event ev;
-  ev.impl = event;
-  ev.key.m_ts = m_currentTs + time.GetTimeStep ();
-  ev.key.m_context = context;
-  ev.key.m_uid = m_uid;
-  m_uid++;
-  m_unscheduledEvents++;
-  m_events->Insert (ev);
+  if (SystemThread::Equals (m_main))
+    {
+      Time tAbsolute = time + TimeStep (m_currentTs);
+      Scheduler::Event ev;
+      ev.impl = event;
+      ev.key.m_ts = (uint64_t) tAbsolute.GetTimeStep ();
+      ev.key.m_context = context;
+      ev.key.m_uid = m_uid;
+      m_uid++;
+      m_unscheduledEvents++;
+      m_events->Insert (ev);
+    }
+  else
+    {
+      EventWithContext ev;
+      ev.context = context;
+      ev.timestamp = time.GetTimeStep ();
+      ev.event = event;
+      {
+        CriticalSection cs (m_eventsWithContextMutex);
+        m_eventsWithContext.push_back(ev);
+        m_eventsWithContextEmpty = false;
+      }
+    }
 }
 
 EventId
 DefaultSimulatorImpl::ScheduleNow (EventImpl *event)
 {
+  NS_ASSERT_MSG (SystemThread::Equals (m_main), "Simulator::ScheduleNow Thread-unsafe invocation!");
+
   Scheduler::Event ev;
   ev.impl = event;
   ev.key.m_ts = m_currentTs;
@@ -235,6 +273,8 @@
 EventId
 DefaultSimulatorImpl::ScheduleDestroy (EventImpl *event)
 {
+  NS_ASSERT_MSG (SystemThread::Equals (m_main), "Simulator::ScheduleDestroy Thread-unsafe invocation!");
+
   EventId id (Ptr<EventImpl> (event, false), m_currentTs, 0xffffffff, 2);
   m_destroyEvents.push_back (id);
   m_uid++;
--- a/src/core/model/default-simulator-impl.h	Wed Apr 11 11:00:27 2012 +0200
+++ b/src/core/model/default-simulator-impl.h	Wed Apr 11 13:49:33 2012 +0200
@@ -24,6 +24,8 @@
 #include "simulator-impl.h"
 #include "scheduler.h"
 #include "event-impl.h"
+#include "system-thread.h"
+#include "ns3/system-mutex.h"
 
 #include "ptr.h"
 
@@ -41,7 +43,6 @@
 
   virtual void Destroy ();
   virtual bool IsFinished (void) const;
-  virtual Time Next (void) const;
   virtual void Stop (void);
   virtual void Stop (Time const &time);
   virtual EventId Schedule (Time const &time, EventImpl *event);
@@ -52,7 +53,6 @@
   virtual void Cancel (const EventId &ev);
   virtual bool IsExpired (const EventId &ev) const;
   virtual void Run (void);
-  virtual void RunOneEvent (void);
   virtual Time Now (void) const;
   virtual Time GetDelayLeft (const EventId &id) const;
   virtual Time GetMaximumSimulationTime (void) const;
@@ -63,12 +63,23 @@
 private:
   virtual void DoDispose (void);
   void ProcessOneEvent (void);
-  uint64_t NextTs (void) const;
+  void ProcessEventsWithContext (void);
+ 
+  struct EventWithContext {
+    uint32_t context;
+    uint64_t timestamp;
+    EventImpl *event;
+  };
+  typedef std::list<struct EventWithContext> EventsWithContext;
+  EventsWithContext m_eventsWithContext;
+  bool m_eventsWithContextEmpty;
+  SystemMutex m_eventsWithContextMutex;
+
   typedef std::list<EventId> DestroyEvents;
-
   DestroyEvents m_destroyEvents;
   bool m_stop;
   Ptr<Scheduler> m_events;
+
   uint32_t m_uid;
   uint32_t m_currentUid;
   uint64_t m_currentTs;
@@ -76,6 +87,8 @@
   // number of events that have been inserted but not yet scheduled,
   // not counting the "destroy" events; this is used for validation
   int m_unscheduledEvents;
+
+  SystemThread::ThreadId m_main;
 };
 
 } // namespace ns3
--- a/src/core/model/fatal-impl.cc	Wed Apr 11 11:00:27 2012 +0200
+++ b/src/core/model/fatal-impl.cc	Wed Apr 11 13:49:33 2012 +0200
@@ -107,7 +107,7 @@
 FlushStreams (void)
 {
   std::list<std::ostream*> **pl = PeekStreamList ();
-  if (pl == 0)
+  if (*pl == 0)
     {
       return;
     }
--- a/src/core/model/realtime-simulator-impl.cc	Wed Apr 11 11:00:27 2012 +0200
+++ b/src/core/model/realtime-simulator-impl.cc	Wed Apr 11 13:49:33 2012 +0200
@@ -80,6 +80,8 @@
   m_currentContext = 0xffffffff;
   m_unscheduledEvents = 0;
 
+  m_main = SystemThread::Self();
+
   // Be very careful not to do anything that would cause a change or assignment
   // of the underlying reference counts of m_synchronizer or you will be sorry.
   m_synchronizer = CreateObject<WallClockSynchronizer> ();
@@ -93,7 +95,7 @@
 RealtimeSimulatorImpl::DoDispose (void)
 {
   NS_LOG_FUNCTION_NOARGS ();
-  while (m_events->IsEmpty () == false)
+  while (!m_events->IsEmpty ())
     {
       Scheduler::Event next = m_events->RemoveNext ();
       next.impl->Unref ();
@@ -406,16 +408,6 @@
   return ev.key.m_ts;
 }
 
-//
-// Calls NextTs().  Should be called with critical section locked.
-//
-Time
-RealtimeSimulatorImpl::Next (void) const
-{
-  NS_LOG_FUNCTION_NOARGS ();
-  return TimeStep (NextTs ());
-}
-
 void
 RealtimeSimulatorImpl::Run (void)
 {
@@ -424,31 +416,41 @@
   NS_ASSERT_MSG (m_running == false, 
                  "RealtimeSimulatorImpl::Run(): Simulator already running");
 
+  // Set the current threadId as the main threadId
+  m_main = SystemThread::Self();
+
   m_stop = false;
   m_running = true;
   m_synchronizer->SetOrigin (m_currentTs);
 
-  for (;;) 
+  // Sleep until signalled
+  uint64_t tsNow;
+  uint64_t tsDelay = 1000000000; // wait time of 1 second (in nanoseconds)
+ 
+  while (!m_stop) 
     {
-      bool done = false;
-
+      bool process = false;
       {
         CriticalSection cs (m_mutex);
-        //
-        // In all cases we stop when the event list is empty.  If you are doing a 
-        // realtime simulation and you want it to extend out for some time, you must
-        // call StopAt.  In the realtime case, this will stick a placeholder event out
-        // at the end of time.
-        //
-        if (m_stop || m_events->IsEmpty ())
+
+        if (!m_events->IsEmpty ())
           {
-            done = true;
+            process = true;
+          }
+        else
+          {
+            // Get current timestamp while holding the critical section
+            tsNow = m_synchronizer->GetCurrentRealtime ();
           }
       }
+ 
+      if (!process)
+        {
+          // Sleep until signalled
+          tsNow = m_synchronizer->Synchronize (tsNow, tsDelay);
 
-      if (done)
-        {
-          break;
+          // Re-check event queue
+          continue;
         }
 
       ProcessOneEvent ();
@@ -482,50 +484,6 @@
   return m_synchronizer->Realtime ();
 }
 
-//
-// This will run the first event on the queue without considering any realtime
-// synchronization.  It's mainly implemented to allow simulations requiring
-// the multithreaded ScheduleRealtimeNow() functions the possibility of driving
-// the simulation from their own event loop.
-//
-// It is expected that if there are any realtime requirements, the responsibility
-// for synchronizing with real time in an external event loop will be picked up
-// by that loop.  For example, they may call Simulator::Next() to find the 
-// execution time of the next event and wait for that time somehow -- then call
-// RunOneEvent to fire the event.
-// 
-void
-RealtimeSimulatorImpl::RunOneEvent (void)
-{
-  NS_LOG_FUNCTION_NOARGS ();
-
-  NS_ASSERT_MSG (m_running == false, 
-                 "RealtimeSimulatorImpl::RunOneEvent(): An internal simulator event loop is running");
-
-  EventImpl *event = 0;
-
-  //
-  // Run this in a critical section in case there's another thread around that
-  // may be inserting things onto the event list.
-  //
-  {
-    CriticalSection cs (m_mutex);
-
-    Scheduler::Event next = m_events->RemoveNext ();
-
-    NS_ASSERT (next.key.m_ts >= m_currentTs);
-    m_unscheduledEvents--;
-
-    NS_LOG_LOGIC ("handle " << next.key.m_ts);
-    m_currentTs = next.key.m_ts;
-    m_currentContext = next.key.m_context;
-    m_currentUid = next.key.m_uid;
-    event = next.impl;
-  }
-  event->Invoke ();
-  event->Unref ();
-}
-
 void 
 RealtimeSimulatorImpl::Stop (void)
 {
@@ -581,7 +539,20 @@
     CriticalSection cs (m_mutex);
     uint64_t ts;
 
-    ts = m_currentTs + time.GetTimeStep ();
+    if (SystemThread::Equals (m_main))
+      {
+        ts = m_currentTs + time.GetTimeStep ();
+      }
+    else
+      {
+        //
+        // If the simulator is running, we're pacing and have a meaningful 
+        // realtime clock.  If we're not, then m_currentTs is where we stopped.
+        // 
+        ts = m_running ? m_synchronizer->GetCurrentRealtime () : m_currentTs;
+        ts += time.GetTimeStep ();
+      }
+
     NS_ASSERT_MSG (ts >= m_currentTs, "RealtimeSimulatorImpl::ScheduleRealtime(): schedule for time < m_currentTs");
     Scheduler::Event ev;
     ev.impl = impl;
--- a/src/core/model/realtime-simulator-impl.h	Wed Apr 11 11:00:27 2012 +0200
+++ b/src/core/model/realtime-simulator-impl.h	Wed Apr 11 13:49:33 2012 +0200
@@ -20,6 +20,7 @@
 #define REALTIME_SIMULATOR_IMPL_H
 
 #include "simulator-impl.h"
+#include "system-thread.h"
 
 #include "scheduler.h"
 #include "synchronizer.h"
@@ -53,7 +54,6 @@
 
   virtual void Destroy ();
   virtual bool IsFinished (void) const;
-  virtual Time Next (void) const;
   virtual void Stop (void);
   virtual void Stop (Time const &time);
   virtual EventId Schedule (Time const &time, EventImpl *event);
@@ -64,7 +64,6 @@
   virtual void Cancel (const EventId &ev);
   virtual bool IsExpired (const EventId &ev) const;
   virtual void Run (void);
-  virtual void RunOneEvent (void);
   virtual Time Now (void) const;
   virtual Time GetDelayLeft (const EventId &id) const;
   virtual Time GetMaximumSimulationTime (void) const;
@@ -87,9 +86,8 @@
 private:
   bool Running (void) const;
   bool Realtime (void) const;
-
+  uint64_t NextTs (void) const;
   void ProcessOneEvent (void);
-  uint64_t NextTs (void) const;
   virtual void DoDispose (void);
 
   typedef std::list<EventId> DestroyEvents;
@@ -118,6 +116,8 @@
    * The maximum allowable drift from real-time in SYNC_HARD_LIMIT mode.
    */
   Time m_hardLimit;
+
+  SystemThread::ThreadId m_main;
 };
 
 } // namespace ns3
--- a/src/core/model/simulator-impl.h	Wed Apr 11 11:00:27 2012 +0200
+++ b/src/core/model/simulator-impl.h	Wed Apr 11 13:49:33 2012 +0200
@@ -55,12 +55,6 @@
    */
   virtual bool IsFinished (void) const = 0;
   /**
-   * If Simulator::IsFinished returns true, the behavior of this
-   * method is undefined. Otherwise, it returns the microsecond-based
-   * time of the next event expected to be scheduled.
-   */
-  virtual Time Next (void) const = 0;
-  /**
    * If an event invokes this method, it will be the last
    * event scheduled by the Simulator::run method before
    * returning to the caller.
@@ -157,10 +151,6 @@
    */
   virtual void Run (void) = 0;
   /**
-   * Process only the next simulation event, then return immediately.
-   */
-  virtual void RunOneEvent (void) = 0;
-  /**
    * Return the "current simulation time".
    */
   virtual Time Now (void) const = 0;
--- a/src/core/model/simulator.cc	Wed Apr 11 11:00:27 2012 +0200
+++ b/src/core/model/simulator.cc	Wed Apr 11 13:49:33 2012 +0200
@@ -149,13 +149,6 @@
   return GetImpl ()->IsFinished ();
 }
 
-Time
-Simulator::Next (void)
-{
-  NS_LOG_FUNCTION_NOARGS ();
-  return GetImpl ()->Next ();
-}
-
 void 
 Simulator::Run (void)
 {
@@ -164,13 +157,6 @@
 }
 
 void 
-Simulator::RunOneEvent (void)
-{
-  NS_LOG_FUNCTION_NOARGS ();
-  GetImpl ()->RunOneEvent ();
-}
-
-void 
 Simulator::Stop (void)
 {
   NS_LOG_LOGIC ("stop");
--- a/src/core/model/simulator.h	Wed Apr 11 11:00:27 2012 +0200
+++ b/src/core/model/simulator.h	Wed Apr 11 13:49:33 2012 +0200
@@ -101,12 +101,6 @@
    * return true. Return false otherwise.
    */
   static bool IsFinished (void);
-  /**
-   * If Simulator::IsFinished returns true, the behavior of this
-   * method is undefined. Otherwise, it returns the microsecond-based
-   * time of the next event expected to be scheduled.
-   */
-  static Time Next (void) NS_DEPRECATED;
 
   /**
    * Run the simulation until one of:
@@ -119,11 +113,6 @@
   static void Run (void);
 
   /**
-   * Process only the next simulation event, then return immediately.
-   */
-  static void RunOneEvent (void) NS_DEPRECATED;
-
-  /**
    * If an event invokes this method, it will be the last
    * event scheduled by the Simulator::run method before
    * returning to the caller.
@@ -286,6 +275,7 @@
   /**
    * Schedule an event with the given context.
    * A context of 0xffffffff means no context is specified.
+   * This method is thread-safe: it can be called from any thread.
    *
    * @param time the relative expiration time of the event.
    * @param context user-specified context parameter
@@ -296,6 +286,8 @@
   static void ScheduleWithContext (uint32_t context, Time const &time, MEM mem_ptr, OBJ obj);
 
   /**
+   * This method is thread-safe: it can be called from any thread.
+   *
    * @param time the relative expiration time of the event.
    * @param context user-specified context parameter
    * @param mem_ptr member method pointer to invoke
@@ -306,6 +298,8 @@
   static void ScheduleWithContext (uint32_t context, Time const &time, MEM mem_ptr, OBJ obj, T1 a1);
 
   /**
+   * This method is thread-safe: it can be called from any thread.
+   *
    * @param time the relative expiration time of the event.
    * @param context user-specified context parameter
    * @param mem_ptr member method pointer to invoke
@@ -317,6 +311,8 @@
   static void ScheduleWithContext (uint32_t context, Time const &time, MEM mem_ptr, OBJ obj, T1 a1, T2 a2);
 
   /**
+   * This method is thread-safe: it can be called from any thread.
+   *
    * @param time the relative expiration time of the event.
    * @param context user-specified context parameter
    * @param mem_ptr member method pointer to invoke
@@ -330,6 +326,8 @@
   static void ScheduleWithContext (uint32_t context, Time const &time, MEM mem_ptr, OBJ obj, T1 a1, T2 a2, T3 a3);
 
   /**
+   * This method is thread-safe: it can be called from any thread.
+   *
    * @param time the relative expiration time of the event.
    * @param context user-specified context parameter
    * @param mem_ptr member method pointer to invoke
@@ -344,6 +342,8 @@
   static void ScheduleWithContext (uint32_t context, Time const &time, MEM mem_ptr, OBJ obj, T1 a1, T2 a2, T3 a3, T4 a4);
 
   /**
+   * This method is thread-safe: it can be called from any thread.
+   *
    * @param time the relative expiration time of the event.
    * @param context user-specified context parameter
    * @param mem_ptr member method pointer to invoke
@@ -359,6 +359,8 @@
   static void ScheduleWithContext (uint32_t context, Time const &time, MEM mem_ptr, OBJ obj, 
                                    T1 a1, T2 a2, T3 a3, T4 a4, T5 a5);
   /**
+   * This method is thread-safe: it can be called from any thread.
+   *
    * @param time the relative expiration time of the event.
    * @param context user-specified context parameter
    * @param f the function to invoke
@@ -366,6 +368,8 @@
   static void ScheduleWithContext (uint32_t context, Time const &time, void (*f)(void));
 
   /**
+   * This method is thread-safe: it can be called from any thread.
+   *
    * @param time the relative expiration time of the event.
    * @param context user-specified context parameter
    * @param f the function to invoke
@@ -375,6 +379,8 @@
   static void ScheduleWithContext (uint32_t context, Time const &time, void (*f)(U1), T1 a1);
 
   /**
+   * This method is thread-safe: it can be called from any thread.
+   *
    * @param time the relative expiration time of the event.
    * @param context user-specified context parameter
    * @param f the function to invoke
@@ -385,6 +391,8 @@
   static void ScheduleWithContext (uint32_t context, Time const &time, void (*f)(U1,U2), T1 a1, T2 a2);
 
   /**
+   * This method is thread-safe: it can be called from any thread.
+   *
    * @param time the relative expiration time of the event.
    * @param context user-specified context parameter
    * @param f the function to invoke
@@ -396,6 +404,8 @@
   static void ScheduleWithContext (uint32_t context, Time const &time, void (*f)(U1,U2,U3), T1 a1, T2 a2, T3 a3);
 
   /**
+   * This method is thread-safe: it can be called from any thread.
+   *
    * @param time the relative expiration time of the event.
    * @param context user-specified context parameter
    * @param f the function to invoke
@@ -409,6 +419,8 @@
   static void ScheduleWithContext (uint32_t context, Time const &time, void (*f)(U1,U2,U3,U4), T1 a1, T2 a2, T3 a3, T4 a4);
 
   /**
+   * This method is thread-safe: it can be called from any thread.
+   *
    * @param time the relative expiration time of the event.
    * @param context user-specified context parameter
    * @param f the function to invoke
@@ -743,6 +755,8 @@
   static EventId Schedule (Time const &time, const Ptr<EventImpl> &event);
 
   /**
+   * This method is thread-safe: it can be called from any thread.
+   *
    * \param time delay until the event expires
    * \param context event context
    * \param event the event to schedule
--- a/src/core/model/system-path.cc	Wed Apr 11 11:00:27 2012 +0200
+++ b/src/core/model/system-path.cc	Wed Apr 11 13:49:33 2012 +0200
@@ -44,6 +44,9 @@
 #include <sys/sysctl.h>
 #endif
 
+#ifdef __linux__
+#include <unistd.h>
+#endif
 
 #if defined (__win32__)
 #define SYSTEM_PATH_SEP "\\"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/core/model/system-thread.cc	Wed Apr 11 13:49:33 2012 +0200
@@ -0,0 +1,96 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/*
+ * Copyright (c) 2008 INRIA
+ *
+ * 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
+ *
+ * Author: Mathieu Lacage <mathieu.lacage.inria.fr>
+ */
+
+#include "fatal-error.h"
+#include "system-thread.h"
+#include "log.h"
+#include <string.h>
+
+NS_LOG_COMPONENT_DEFINE ("SystemThread");
+
+namespace ns3 {
+
+#ifdef HAVE_PTHREAD_H
+
+SystemThread::SystemThread (Callback<void> callback)
+  : m_callback (callback)
+{
+  NS_LOG_FUNCTION (this);
+}
+
+SystemThread::~SystemThread()
+{
+  NS_LOG_FUNCTION (this);
+}
+
+void
+SystemThread::Start (void)
+{
+  NS_LOG_FUNCTION (this);
+
+  int rc = pthread_create (&m_thread, NULL, &SystemThread::DoRun,
+                           (void *)this);
+
+  if (rc) 
+    {
+      NS_FATAL_ERROR ("pthread_create failed: " << rc << "=\"" << 
+                      strerror (rc) << "\".");
+    }
+}
+
+void
+SystemThread::Join (void)
+{
+  NS_LOG_FUNCTION (this);
+
+  void *thread_return;
+  int rc = pthread_join (m_thread, &thread_return);
+  if (rc) 
+    {
+      NS_FATAL_ERROR ("pthread_join failed: " << rc << "=\"" << 
+                      strerror (rc) << "\".");
+    }
+}
+
+void *
+SystemThread::DoRun (void *arg)
+{
+  NS_LOG_FUNCTION (arg);
+
+  SystemThread *self = static_cast<SystemThread *> (arg);
+  self->m_callback ();
+
+  return 0;
+}
+SystemThread::ThreadId 
+SystemThread::Self (void)
+{
+  return pthread_self ();
+}
+
+bool 
+SystemThread::Equals (SystemThread::ThreadId id)
+{
+  return (pthread_equal (pthread_self (), id) != 0);
+}
+
+#endif /* HAVE_PTHREAD_H */
+
+} // namespace ns3
--- a/src/core/model/system-thread.h	Wed Apr 11 11:00:27 2012 +0200
+++ b/src/core/model/system-thread.h	Wed Apr 11 13:49:33 2012 +0200
@@ -21,12 +21,14 @@
 #ifndef SYSTEM_THREAD_H
 #define SYSTEM_THREAD_H
 
+#include "ns3/core-config.h"
 #include "callback.h"
+#ifdef HAVE_PTHREAD_H
+#include <pthread.h>
+#endif /* HAVE_PTHREAD_H */
 
 namespace ns3 { 
 
-class SystemThreadImpl;
-
 /**
  * @brief A class which provides a relatively platform-independent thread
  * primitive.
@@ -45,6 +47,11 @@
 class SystemThread : public SimpleRefCount<SystemThread>
 {
 public:
+
+#ifdef HAVE_PTHREAD_H
+  typedef pthread_t ThreadId;
+#endif
+
   /**
    * @brief Create a SystemThread object.
    *
@@ -94,10 +101,6 @@
    *
    * @param callback entry point of the thread
    * 
-   * @warning The SystemThread uses SIGALRM to wake threads that are possibly
-   * blocked on IO.
-   * @see Shutdown
-   *
    * @warning I've made the system thread class look like a normal ns3 object
    * with smart pointers, and living in the heap.  This makes it very easy to
    * manage threads from a single master thread context.  You should be very
@@ -125,47 +128,28 @@
    * provided callback, finishes.
    */
   void Join (void);
+  /**
+   * @brief Returns the current thread Id.
+   *
+   * @returns current thread Id. 
+   */
+  static ThreadId Self(void);
 
   /**
-   * @brief Indicates to a managed thread doing cooperative multithreading that
-   * its managing thread wants it to exit.
-   *
-   * It is often the case that we want a thread to be off doing work until such
-   * time as its job is done (typically when the simulation is done).  We then 
-   * want the thread to exit itself.  This method provides a consistent way for
-   * the managing thread to communicate with the managed thread.  After the
-   * manager thread calls this method, the Break() method will begin returning
-   * true, telling the managed thread to exit.
-   *
-   * This alone isn't really enough to merit these events, but in Unix, if a
-   * worker thread is doing blocking IO, it will need to be woken up from that
-   * read somehow.  This method also provides that functionality, by sending a
-   * SIGALRM signal to the possibly blocked thread.
+   * @brief Compares an TharedId with the current ThreadId .
    *
-   * @warning Uses SIGALRM to notify threads possibly blocked on IO.  Beware
-   * if you are using signals.
-   * @see Break
+   * @returns true if Id matches the current ThreadId.
    */
-  void Shutdown (void);
-
-  /**
-   * @brief Indicates to a thread doing cooperative multithreading that
-   * its managing thread wants it to exit.
-   *
-   * It is often the case that we want a thread to be off doing work until such
-   * time as its job is done.  We then want the thread to exit itself.  This
-   * method allows a thread to query whether or not it should be running.
-   * Typically, the worker thread is running in a forever-loop, and will need to
-   * "break" out of that loop to exit -- thus the name.
-   *
-   * @see Shutdown
-   * @returns true if thread is expected to exit (break out of the forever-loop)
-   */
-  bool Break (void);
+  static bool Equals(ThreadId id);
 
 private:
-  SystemThreadImpl * m_impl;
-  bool m_break;
+#ifdef HAVE_PTHREAD_H
+  static void *DoRun (void *arg);
+
+  Callback<void> m_callback;
+  pthread_t m_thread;
+  void *    m_ret;
+#endif 
 };
 
 } // namespace ns3
--- a/src/core/model/unix-system-thread.cc	Wed Apr 11 11:00:27 2012 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,183 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/*
- * Copyright (c) 2008 INRIA
- *
- * 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
- *
- * Author: Mathieu Lacage <mathieu.lacage.inria.fr>
- */
-
-#include <pthread.h>
-#include <string.h>
-#include <signal.h>
-#include "fatal-error.h"
-#include "system-thread.h"
-#include "log.h"
-
-NS_LOG_COMPONENT_DEFINE ("SystemThread");
-
-namespace ns3 {
-
-//
-// Private implementation class for the SystemThread class.  The deal is
-// that we export the SystemThread class to the user.  The header just 
-// declares a class and its members.  There is a forward declaration for
-// a private implementation class there and a member declaration.  Thus
-// there is no knowledge of the implementation in the exported header.
-//
-// We provide an implementation class for each operating system.  This is
-// the Unix implementation of the SystemThread.
-//
-// In order to use the SystemThread, you will include "system-thread.h" and
-// get the implementation by linking unix-system-thread.cc (if you are running
-// a Posix system).
-//
-class SystemThreadImpl
-{
-public:
-  SystemThreadImpl (Callback<void> callback);
-
-  void Start (void);
-  void Join (void);
-  void Shutdown (void);
-  bool Break (void);
-
-private:
-  static void *DoRun (void *arg);
-  Callback<void> m_callback;
-  pthread_t m_thread;
-  bool m_break;
-  void *    m_ret;
-};
-
-SystemThreadImpl::SystemThreadImpl (Callback<void> callback)
-  : m_callback (callback), m_break (false)
-{
-  NS_LOG_FUNCTION_NOARGS ();
-  // Make sure we have a SIGALRM handler which does not terminate
-  // our process.
-  struct sigaction act;
-  act.sa_flags = 0;
-  sigemptyset (&act.sa_mask);
-  act.sa_handler = SIG_IGN;
-  sigaction (SIGALRM, &act, 0);
-}
-
-void
-SystemThreadImpl::Start (void)
-{
-  NS_LOG_FUNCTION_NOARGS ();
-
-  int rc = pthread_create (&m_thread, NULL, &SystemThreadImpl::DoRun,
-                           (void *)this);
-
-  if (rc) 
-    {
-      NS_FATAL_ERROR ("pthread_create failed: " << rc << "=\"" << 
-                      strerror (rc) << "\".");
-    }
-}
-
-void
-SystemThreadImpl::Join (void)
-{
-  NS_LOG_FUNCTION_NOARGS ();
-
-  void *thread_return;
-  int rc = pthread_join (m_thread, &thread_return);
-  if (rc) 
-    {
-      NS_FATAL_ERROR ("pthread_join failed: " << rc << "=\"" << 
-                      strerror (rc) << "\".");
-    }
-}
-
-void
-SystemThreadImpl::Shutdown (void)
-{
-  NS_LOG_FUNCTION_NOARGS ();
-
-  m_break = true;
-
-  // send a SIGALRM signal on the target thread to make sure that it
-  // will unblock.
-  pthread_kill (m_thread, SIGALRM);
-}
-
-bool
-SystemThreadImpl::Break (void)
-{
-  NS_LOG_FUNCTION_NOARGS ();
-
-  return m_break;
-}
-
-void *
-SystemThreadImpl::DoRun (void *arg)
-{
-  NS_LOG_FUNCTION_NOARGS ();
-
-  SystemThreadImpl *self = static_cast<SystemThreadImpl *> (arg);
-  self->m_callback ();
-
-  return 0;
-}
-
-//
-// Remember that we just export the delcaration of the SystemThread class to
-// the user.  There is no code to implement the SystemThread methods.  We
-// have to do that here.  We just vector the calls to our implementation 
-// class above.
-//
-SystemThread::SystemThread (Callback<void> callback) 
-  : m_impl (new SystemThreadImpl (callback)), m_break (false)
-{
-  NS_LOG_FUNCTION_NOARGS ();
-}
-
-SystemThread::~SystemThread() 
-{
-  NS_LOG_FUNCTION_NOARGS ();
-  delete m_impl;
-}
-
-void
-SystemThread::Start (void)
-{
-  NS_LOG_FUNCTION_NOARGS ();
-  m_impl->Start ();
-}
-
-void
-SystemThread::Join (void) 
-{
-  NS_LOG_FUNCTION_NOARGS ();
-  m_impl->Join ();
-}
-
-void
-SystemThread::Shutdown (void) 
-{
-  NS_LOG_FUNCTION_NOARGS ();
-  m_impl->Shutdown ();
-}
-
-bool
-SystemThread::Break (void) 
-{
-  NS_LOG_FUNCTION_NOARGS ();
-  return m_impl->Break ();
-}
-
-} // namespace ns3
--- a/src/core/model/unix-system-wall-clock-ms.cc	Wed Apr 11 11:00:27 2012 +0200
+++ b/src/core/model/unix-system-wall-clock-ms.cc	Wed Apr 11 13:49:33 2012 +0200
@@ -21,6 +21,7 @@
 #include "system-wall-clock-ms.h"
 #include "abort.h"
 #include <sys/times.h>
+#include <unistd.h>
 
 namespace ns3 {
 
--- a/src/core/test/config-test-suite.cc	Wed Apr 11 11:00:27 2012 +0200
+++ b/src/core/test/config-test-suite.cc	Wed Apr 11 13:49:33 2012 +0200
@@ -242,6 +242,7 @@
   a->GetAttribute ("A", iv);
   NS_TEST_ASSERT_MSG_EQ (iv.Get (), 1, "Object Attribute \"A\" not set correctly");
 
+
   //
   // We should find the default values of "B" too.
   //
@@ -292,6 +293,16 @@
   NS_TEST_ASSERT_MSG_EQ (iv.Get (), 4, "Object Attribute \"A\" not set as expected");
   b->GetAttribute ("B", iv);
   NS_TEST_ASSERT_MSG_EQ (iv.Get (), -4, "Object Attribute \"B\" not set as expected");
+
+
+  //
+  // Try '*' for attributes
+  //
+  Config::Set ("/*/A", IntegerValue (2));
+  a->GetAttribute ("A", iv);
+  NS_TEST_ASSERT_MSG_EQ (iv.Get (), 2, "Object Attribute \"A\" not set correctly");
+  b->GetAttribute ("A", iv);
+  NS_TEST_ASSERT_MSG_EQ (iv.Get (), 4, "Object Attribute \"A\" not set correctly");
 }
 
 // ===========================================================================
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/core/test/threaded-test-suite.cc	Wed Apr 11 13:49:33 2012 +0200
@@ -0,0 +1,268 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/*
+ * Copyright (c) 2011 INRIA
+ *
+ * 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
+ *
+ * Author: Claudio Freire <claudio-daniel.freire@inria.fr>
+ */
+#include "ns3/test.h"
+#include "ns3/simulator.h"
+#include "ns3/list-scheduler.h"
+#include "ns3/heap-scheduler.h"
+#include "ns3/map-scheduler.h"
+#include "ns3/calendar-scheduler.h"
+#include "ns3/config.h"
+#include "ns3/string.h"
+#include "ns3/system-thread.h"
+
+#include <time.h>
+#include <list>
+#include <utility>
+
+namespace ns3 {
+
+#define MAXTHREADS 64
+
+class ThreadedSimulatorEventsTestCase : public TestCase
+{
+public:
+  ThreadedSimulatorEventsTestCase (ObjectFactory schedulerFactory, const std::string &simulatorType, unsigned int threads);
+  void A (int a);
+  void B (int b);
+  void C (int c);
+  void D (int d);
+  void DoNothing (unsigned int threadno);
+  static void SchedulingThread (std::pair<ThreadedSimulatorEventsTestCase *, unsigned int> context);
+  void End (void);
+  uint64_t m_b;
+  uint64_t m_a;
+  uint64_t m_c;
+  uint64_t m_d;
+  unsigned int m_threads;
+  bool m_threadWaiting[MAXTHREADS];
+  bool m_stop;
+  ObjectFactory m_schedulerFactory;
+  std::string m_simulatorType;
+  std::string m_error;
+  std::list<Ptr<SystemThread> > m_threadlist;
+
+private:
+  virtual void DoSetup (void);
+  virtual void DoRun (void);
+  virtual void DoTeardown (void);
+};
+
+ThreadedSimulatorEventsTestCase::ThreadedSimulatorEventsTestCase (ObjectFactory schedulerFactory, const std::string &simulatorType, unsigned int threads)
+  : TestCase ("Check that threaded event handling is working with " + 
+              schedulerFactory.GetTypeId ().GetName () + " in " + simulatorType),
+    m_threads (threads),
+    m_schedulerFactory (schedulerFactory),
+    m_simulatorType (simulatorType)
+{
+}
+
+void
+ThreadedSimulatorEventsTestCase::End (void)
+{
+  m_stop = true;
+  for (std::list<Ptr<SystemThread> >::iterator it2 = m_threadlist.begin(); it2 != m_threadlist.end(); ++it2)
+    {
+      (*it2)->Join();
+    }
+}
+void
+ThreadedSimulatorEventsTestCase::SchedulingThread (std::pair<ThreadedSimulatorEventsTestCase *, unsigned int> context)
+{
+  ThreadedSimulatorEventsTestCase *me = context.first;
+  unsigned int threadno = context.second;
+  
+  while (!me->m_stop)
+    {
+      me->m_threadWaiting[threadno] = true;
+      Simulator::ScheduleWithContext (uint32_t (-1), 
+                                      MicroSeconds (1),
+                                      &ThreadedSimulatorEventsTestCase::DoNothing, me, threadno);
+      while (!me->m_stop && me->m_threadWaiting[threadno])
+        {
+          struct timespec ts;
+          ts.tv_sec = 0;
+          ts.tv_nsec = 500;
+          nanosleep(&ts, NULL);
+        }
+    }
+}
+void
+ThreadedSimulatorEventsTestCase::DoNothing (unsigned int threadno)
+{
+  if (!m_error.empty())
+    {
+      m_error = "Bad threaded scheduling";
+    }
+  m_threadWaiting[threadno] = false;
+}
+void
+ThreadedSimulatorEventsTestCase::A (int a)
+{
+  if (m_a != m_b || m_a != m_c || m_a != m_d)
+    {
+      m_error = "Bad scheduling";
+      Simulator::Stop();
+    };
+  ++m_a;
+  Simulator::Schedule (MicroSeconds (10),
+                       &ThreadedSimulatorEventsTestCase::B, this, a+1);
+}
+
+void
+ThreadedSimulatorEventsTestCase::B (int b)
+{
+  if (m_a != (m_b+1) || m_a != (m_c+1) || m_a != (m_d+1))
+    {
+      m_error = "Bad scheduling";
+      Simulator::Stop();
+    };
+  ++m_b;
+  Simulator::Schedule (MicroSeconds (10),
+                       &ThreadedSimulatorEventsTestCase::C, this, b+1);
+}
+
+void
+ThreadedSimulatorEventsTestCase::C (int c)
+{
+  if (m_a != m_b || m_a != (m_c+1) || m_a != (m_d+1))
+    {
+      m_error = "Bad scheduling";
+      Simulator::Stop();
+    };
+  ++m_c;
+  Simulator::Schedule (MicroSeconds (10),
+                       &ThreadedSimulatorEventsTestCase::D, this, c+1);
+}
+
+void
+ThreadedSimulatorEventsTestCase::D (int d)
+{
+  if (m_a != m_b || m_a != m_c || m_a != (m_d+1))
+    {
+      m_error = "Bad scheduling";
+      Simulator::Stop();
+    };
+  ++m_d;
+  if (m_stop)
+    {
+      Simulator::Stop();
+    }
+  else
+    {
+      Simulator::Schedule (MicroSeconds (10),
+                           &ThreadedSimulatorEventsTestCase::A, this, d+1);
+    }
+}
+
+void 
+ThreadedSimulatorEventsTestCase::DoSetup (void)
+{
+  if (!m_simulatorType.empty())
+    {
+      Config::SetGlobal ("SimulatorImplementationType", StringValue (m_simulatorType));
+    }
+  
+  m_error = "";
+  
+  m_a = 
+  m_b = 
+  m_c = 
+  m_d = 0;
+
+  for (unsigned int i=0; i < m_threads; ++i)
+    {
+      m_threadlist.push_back(
+        Create<SystemThread> (MakeBoundCallback (
+            &ThreadedSimulatorEventsTestCase::SchedulingThread, 
+                std::pair<ThreadedSimulatorEventsTestCase *, unsigned int>(this,i) )) );
+    }
+}
+void 
+ThreadedSimulatorEventsTestCase::DoTeardown (void)
+{
+  m_threadlist.clear();
+ 
+  Config::SetGlobal ("SimulatorImplementationType", StringValue ("ns3::DefaultSimulatorImpl"));
+}
+void 
+ThreadedSimulatorEventsTestCase::DoRun (void)
+{
+  m_stop = false;
+  Simulator::SetScheduler (m_schedulerFactory);
+
+  Simulator::Schedule (MicroSeconds (10), &ThreadedSimulatorEventsTestCase::A, this, 1);
+  Simulator::Schedule (Seconds (1), &ThreadedSimulatorEventsTestCase::End, this);
+
+  
+  for (std::list<Ptr<SystemThread> >::iterator it = m_threadlist.begin(); it != m_threadlist.end(); ++it)
+    {
+      (*it)->Start();
+    }
+  
+  Simulator::Run ();
+  Simulator::Destroy ();
+
+  NS_TEST_EXPECT_MSG_EQ (m_error.empty(), true, m_error.c_str());
+  NS_TEST_EXPECT_MSG_EQ (m_a, m_b, "Bad scheduling");
+  NS_TEST_EXPECT_MSG_EQ (m_a, m_c, "Bad scheduling");
+  NS_TEST_EXPECT_MSG_EQ (m_a, m_d, "Bad scheduling");
+}
+
+class ThreadedSimulatorTestSuite : public TestSuite
+{
+public:
+  ThreadedSimulatorTestSuite ()
+    : TestSuite ("threaded-simulator")
+  {
+    std::string simulatorTypes[] = {
+#ifdef HAVE_RT
+      "ns3::RealtimeSimulatorImpl",
+#endif
+      "ns3::DefaultSimulatorImpl"
+    };
+    std::string schedulerTypes[] = {
+      "ns3::ListScheduler",
+      "ns3::HeapScheduler",
+      "ns3::MapScheduler",
+      "ns3::CalendarScheduler"
+    };
+    unsigned int threadcounts[] = {
+      0,
+      2,
+      10, 
+      20
+    };
+    ObjectFactory factory;
+    
+    for (unsigned int i=0; i < (sizeof(simulatorTypes) / sizeof(simulatorTypes[0])); ++i) 
+      {
+        for (unsigned int j=0; j < (sizeof(threadcounts) / sizeof(threadcounts[0])); ++j)
+          {
+            for (unsigned int k=0; k < (sizeof(schedulerTypes) / sizeof(schedulerTypes[0])); ++k) 
+              {
+                factory.SetTypeId(schedulerTypes[k]);
+                AddTestCase (new ThreadedSimulatorEventsTestCase (factory, simulatorTypes[i], threadcounts[j]));
+              }
+          }
+      }
+  }
+} g_threadedSimulatorTestSuite;
+
+} // namespace ns3
--- a/src/core/wscript	Wed Apr 11 11:00:27 2012 +0200
+++ b/src/core/wscript	Wed Apr 11 13:49:33 2012 +0200
@@ -285,13 +285,14 @@
 
     if env['ENABLE_THREADING']:
         core.source.extend([
+            'model/system-thread.cc',
             'model/unix-fd-reader.cc',
-            'model/unix-system-thread.cc',
             'model/unix-system-mutex.cc',
             'model/unix-system-condition.cc',
             ])
         core.use.append('PTHREAD')
         core_test.use.append('PTHREAD')
+        core_test.source.extend(['test/threaded-test-suite.cc'])
         headers.source.extend([
                 'model/unix-fd-reader.h',
                 'model/system-mutex.h',
--- a/src/csma-layout/model/csma-star-helper.cc	Wed Apr 11 11:00:27 2012 +0200
+++ b/src/csma-layout/model/csma-star-helper.cc	Wed Apr 11 13:49:33 2012 +0200
@@ -18,11 +18,11 @@
 #include <sstream>
 
 // ns3 includes
-#include "ns3/animation-interface.h"
 #include "ns3/csma-star-helper.h"
 #include "ns3/node-list.h"
 #include "ns3/point-to-point-net-device.h"
 #include "ns3/vector.h"
+#include "ns3/log.h"
 
 NS_LOG_COMPONENT_DEFINE ("CsmaStarHelper");
 
--- a/src/dsdv/bindings/modulegen__gcc_ILP32.py	Wed Apr 11 11:00:27 2012 +0200
+++ b/src/dsdv/bindings/modulegen__gcc_ILP32.py	Wed Apr 11 13:49:33 2012 +0200
@@ -3131,6 +3131,11 @@
                    'uint32_t', 
                    [], 
                    is_pure_virtual=True, is_const=True, is_virtual=True)
+    ## socket.h (module 'network'): bool ns3::Socket::IsRecvPktInfo() const [member function]
+    cls.add_method('IsRecvPktInfo', 
+                   'bool', 
+                   [], 
+                   is_const=True)
     ## socket.h (module 'network'): int ns3::Socket::Listen() [member function]
     cls.add_method('Listen', 
                    'int', 
--- a/src/dsdv/bindings/modulegen__gcc_LP64.py	Wed Apr 11 11:00:27 2012 +0200
+++ b/src/dsdv/bindings/modulegen__gcc_LP64.py	Wed Apr 11 13:49:33 2012 +0200
@@ -3131,6 +3131,11 @@
                    'uint32_t', 
                    [], 
                    is_pure_virtual=True, is_const=True, is_virtual=True)
+    ## socket.h (module 'network'): bool ns3::Socket::IsRecvPktInfo() const [member function]
+    cls.add_method('IsRecvPktInfo', 
+                   'bool', 
+                   [], 
+                   is_const=True)
     ## socket.h (module 'network'): int ns3::Socket::Listen() [member function]
     cls.add_method('Listen', 
                    'int', 
--- a/src/dsdv/model/dsdv-routing-protocol.cc	Wed Apr 11 11:00:27 2012 +0200
+++ b/src/dsdv/model/dsdv-routing-protocol.cc	Wed Apr 11 13:49:33 2012 +0200
@@ -840,7 +840,7 @@
   m_routingTable.Purge (removedAddresses);
   MergeTriggerPeriodicUpdates ();
   m_routingTable.GetListOfAllRoutes (allRoutes);
-  if (allRoutes.size () < 0)
+  if (allRoutes.empty ())
     {
       return;
     }
--- a/src/emu/bindings/callbacks_list.py	Wed Apr 11 11:00:27 2012 +0200
+++ b/src/emu/bindings/callbacks_list.py	Wed Apr 11 13:49:33 2012 +0200
@@ -1,4 +1,5 @@
 callback_classes = [
+    ['void', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty'],
     ['bool', 'ns3::Ptr<ns3::NetDevice>', 'ns3::Ptr<ns3::Packet const>', 'unsigned short', 'ns3::Address const&', 'ns3::Address const&', 'ns3::NetDevice::PacketType', 'ns3::empty', 'ns3::empty', 'ns3::empty'],
     ['bool', 'ns3::Ptr<ns3::NetDevice>', 'ns3::Ptr<ns3::Packet const>', 'unsigned short', 'ns3::Address const&', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty'],
     ['void', 'ns3::Ptr<ns3::NetDevice>', 'ns3::Ptr<ns3::Packet const>', 'unsigned short', 'ns3::Address const&', 'ns3::Address const&', 'ns3::NetDevice::PacketType', 'ns3::empty', 'ns3::empty', 'ns3::empty'],
--- a/src/emu/bindings/modulegen__gcc_ILP32.py	Wed Apr 11 11:00:27 2012 +0200
+++ b/src/emu/bindings/modulegen__gcc_ILP32.py	Wed Apr 11 13:49:33 2012 +0200
@@ -20,8 +20,6 @@
 def register_types(module):
     root_module = module.get_root()
     
-    ## log.h (module 'core'): ns3::LogLevel [enumeration]
-    module.add_enum('LogLevel', ['LOG_NONE', 'LOG_ERROR', 'LOG_LEVEL_ERROR', 'LOG_WARN', 'LOG_LEVEL_WARN', 'LOG_DEBUG', 'LOG_LEVEL_DEBUG', 'LOG_INFO', 'LOG_LEVEL_INFO', 'LOG_FUNCTION', 'LOG_LEVEL_FUNCTION', 'LOG_LOGIC', 'LOG_LEVEL_LOGIC', 'LOG_ALL', 'LOG_LEVEL_ALL', 'LOG_PREFIX_FUNC', 'LOG_PREFIX_TIME', 'LOG_PREFIX_NODE'], import_from_module='ns.core')
     ## address.h (module 'network'): ns3::Address [class]
     module.add_class('Address', import_from_module='ns.network')
     ## address.h (module 'network'): ns3::Address::MaxSize_e [enumeration]
@@ -68,8 +66,6 @@
     root_module['ns3::Ipv6Address'].implicitly_converts_to(root_module['ns3::Address'])
     ## ipv6-address.h (module 'network'): ns3::Ipv6Prefix [class]
     module.add_class('Ipv6Prefix', import_from_module='ns.network')
-    ## log.h (module 'core'): ns3::LogComponent [class]
-    module.add_class('LogComponent', import_from_module='ns.core')
     ## mac48-address.h (module 'network'): ns3::Mac48Address [class]
     module.add_class('Mac48Address', import_from_module='ns.network')
     ## mac48-address.h (module 'network'): ns3::Mac48Address [class]
@@ -142,12 +138,6 @@
     module.add_class('AggregateIterator', import_from_module='ns.core', outer_class=root_module['ns3::Object'])
     ## pcap-file-wrapper.h (module 'network'): ns3::PcapFileWrapper [class]
     module.add_class('PcapFileWrapper', import_from_module='ns.network', parent=root_module['ns3::Object'])
-    ## scheduler.h (module 'core'): ns3::Scheduler [class]
-    module.add_class('Scheduler', import_from_module='ns.core', parent=root_module['ns3::Object'])
-    ## scheduler.h (module 'core'): ns3::Scheduler::Event [struct]
-    module.add_class('Event', import_from_module='ns.core', outer_class=root_module['ns3::Scheduler'])
-    ## scheduler.h (module 'core'): ns3::Scheduler::EventKey [struct]
-    module.add_class('EventKey', import_from_module='ns.core', outer_class=root_module['ns3::Scheduler'])
     ## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::AttributeAccessor, ns3::empty, ns3::DefaultDeleter<ns3::AttributeAccessor> > [class]
     module.add_class('SimpleRefCount', automatic_type_narrowing=True, import_from_module='ns.core', template_parameters=['ns3::AttributeAccessor', 'ns3::empty', 'ns3::DefaultDeleter<ns3::AttributeAccessor>'], parent=root_module['ns3::empty'], memory_policy=cppclass.ReferenceCountingMethodsPolicy(incref_method='Ref', decref_method='Unref', peekref_method='GetReferenceCount'))
     ## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::AttributeChecker, ns3::empty, ns3::DefaultDeleter<ns3::AttributeChecker> > [class]
@@ -168,10 +158,6 @@
     module.add_class('SimpleRefCount', automatic_type_narrowing=True, import_from_module='ns.core', template_parameters=['ns3::SystemThread', 'ns3::empty', 'ns3::DefaultDeleter<ns3::SystemThread>'], parent=root_module['ns3::empty'], memory_policy=cppclass.ReferenceCountingMethodsPolicy(incref_method='Ref', decref_method='Unref', peekref_method='GetReferenceCount'))
     ## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::TraceSourceAccessor, ns3::empty, ns3::DefaultDeleter<ns3::TraceSourceAccessor> > [class]
     module.add_class('SimpleRefCount', automatic_type_narrowing=True, import_from_module='ns.core', template_parameters=['ns3::TraceSourceAccessor', 'ns3::empty', 'ns3::DefaultDeleter<ns3::TraceSourceAccessor>'], parent=root_module['ns3::empty'], memory_policy=cppclass.ReferenceCountingMethodsPolicy(incref_method='Ref', decref_method='Unref', peekref_method='GetReferenceCount'))
-    ## simulator-impl.h (module 'core'): ns3::SimulatorImpl [class]
-    module.add_class('SimulatorImpl', import_from_module='ns.core', parent=root_module['ns3::Object'])
-    ## synchronizer.h (module 'core'): ns3::Synchronizer [class]
-    module.add_class('Synchronizer', import_from_module='ns.core', parent=root_module['ns3::Object'])
     ## system-thread.h (module 'core'): ns3::SystemThread [class]
     module.add_class('SystemThread', import_from_module='ns.core', parent=root_module['ns3::SimpleRefCount< ns3::SystemThread, ns3::empty, ns3::DefaultDeleter<ns3::SystemThread> >'])
     ## nstime.h (module 'core'): ns3::Time [class]
@@ -240,10 +226,6 @@
     module.add_class('OutputStreamWrapper', import_from_module='ns.network', parent=root_module['ns3::SimpleRefCount< ns3::OutputStreamWrapper, ns3::empty, ns3::DefaultDeleter<ns3::OutputStreamWrapper> >'])
     ## packet.h (module 'network'): ns3::Packet [class]
     module.add_class('Packet', import_from_module='ns.network', parent=root_module['ns3::SimpleRefCount< ns3::Packet, ns3::empty, ns3::DefaultDeleter<ns3::Packet> >'])
-    ## realtime-simulator-impl.h (module 'core'): ns3::RealtimeSimulatorImpl [class]
-    module.add_class('RealtimeSimulatorImpl', import_from_module='ns.core', parent=root_module['ns3::SimulatorImpl'])
-    ## realtime-simulator-impl.h (module 'core'): ns3::RealtimeSimulatorImpl::SynchronizationMode [enumeration]
-    module.add_enum('SynchronizationMode', ['SYNC_BEST_EFFORT', 'SYNC_HARD_LIMIT'], outer_class=root_module['ns3::RealtimeSimulatorImpl'], import_from_module='ns.core')
     ## nstime.h (module 'core'): ns3::TimeChecker [class]
     module.add_class('TimeChecker', import_from_module='ns.core', parent=root_module['ns3::AttributeChecker'])
     ## nstime.h (module 'core'): ns3::TimeValue [class]
@@ -260,12 +242,6 @@
     module.add_class('EmuNetDevice', parent=root_module['ns3::NetDevice'])
     ## emu-net-device.h (module 'emu'): ns3::EmuNetDevice::EncapsulationMode [enumeration]
     module.add_enum('EncapsulationMode', ['ILLEGAL', 'DIX', 'LLC'], outer_class=root_module['ns3::EmuNetDevice'])
-    typehandlers.add_type_alias('void ( * ) ( std::ostream & ) *', 'ns3::LogTimePrinter')
-    typehandlers.add_type_alias('void ( * ) ( std::ostream & ) **', 'ns3::LogTimePrinter*')
-    typehandlers.add_type_alias('void ( * ) ( std::ostream & ) *&', 'ns3::LogTimePrinter&')
-    typehandlers.add_type_alias('void ( * ) ( std::ostream & ) *', 'ns3::LogNodePrinter')
-    typehandlers.add_type_alias('void ( * ) ( std::ostream & ) **', 'ns3::LogNodePrinter*')
-    typehandlers.add_type_alias('void ( * ) ( std::ostream & ) *&', 'ns3::LogNodePrinter&')
     
     ## Register a nested module for the namespace FatalImpl
     
@@ -298,7 +274,6 @@
     register_Ns3Ipv4Mask_methods(root_module, root_module['ns3::Ipv4Mask'])
     register_Ns3Ipv6Address_methods(root_module, root_module['ns3::Ipv6Address'])
     register_Ns3Ipv6Prefix_methods(root_module, root_module['ns3::Ipv6Prefix'])
-    register_Ns3LogComponent_methods(root_module, root_module['ns3::LogComponent'])
     register_Ns3Mac48Address_methods(root_module, root_module['ns3::Mac48Address'])
     register_Ns3NetDeviceContainer_methods(root_module, root_module['ns3::NetDeviceContainer'])
     register_Ns3NodeContainer_methods(root_module, root_module['ns3::NodeContainer'])
@@ -331,9 +306,6 @@
     register_Ns3Object_methods(root_module, root_module['ns3::Object'])
     register_Ns3ObjectAggregateIterator_methods(root_module, root_module['ns3::Object::AggregateIterator'])
     register_Ns3PcapFileWrapper_methods(root_module, root_module['ns3::PcapFileWrapper'])
-    register_Ns3Scheduler_methods(root_module, root_module['ns3::Scheduler'])
-    register_Ns3SchedulerEvent_methods(root_module, root_module['ns3::Scheduler::Event'])
-    register_Ns3SchedulerEventKey_methods(root_module, root_module['ns3::Scheduler::EventKey'])
     register_Ns3SimpleRefCount__Ns3AttributeAccessor_Ns3Empty_Ns3DefaultDeleter__lt__ns3AttributeAccessor__gt___methods(root_module, root_module['ns3::SimpleRefCount< ns3::AttributeAccessor, ns3::empty, ns3::DefaultDeleter<ns3::AttributeAccessor> >'])
     register_Ns3SimpleRefCount__Ns3AttributeChecker_Ns3Empty_Ns3DefaultDeleter__lt__ns3AttributeChecker__gt___methods(root_module, root_module['ns3::SimpleRefCount< ns3::AttributeChecker, ns3::empty, ns3::DefaultDeleter<ns3::AttributeChecker> >'])
     register_Ns3SimpleRefCount__Ns3AttributeValue_Ns3Empty_Ns3DefaultDeleter__lt__ns3AttributeValue__gt___methods(root_module, root_module['ns3::SimpleRefCount< ns3::AttributeValue, ns3::empty, ns3::DefaultDeleter<ns3::AttributeValue> >'])
@@ -344,8 +316,6 @@
     register_Ns3SimpleRefCount__Ns3Packet_Ns3Empty_Ns3DefaultDeleter__lt__ns3Packet__gt___methods(root_module, root_module['ns3::SimpleRefCount< ns3::Packet, ns3::empty, ns3::DefaultDeleter<ns3::Packet> >'])
     register_Ns3SimpleRefCount__Ns3SystemThread_Ns3Empty_Ns3DefaultDeleter__lt__ns3SystemThread__gt___methods(root_module, root_module['ns3::SimpleRefCount< ns3::SystemThread, ns3::empty, ns3::DefaultDeleter<ns3::SystemThread> >'])
     register_Ns3SimpleRefCount__Ns3TraceSourceAccessor_Ns3Empty_Ns3DefaultDeleter__lt__ns3TraceSourceAccessor__gt___methods(root_module, root_module['ns3::SimpleRefCount< ns3::TraceSourceAccessor, ns3::empty, ns3::DefaultDeleter<ns3::TraceSourceAccessor> >'])
-    register_Ns3SimulatorImpl_methods(root_module, root_module['ns3::SimulatorImpl'])
-    register_Ns3Synchronizer_methods(root_module, root_module['ns3::Synchronizer'])
     register_Ns3SystemThread_methods(root_module, root_module['ns3::SystemThread'])
     register_Ns3Time_methods(root_module, root_module['ns3::Time'])
     register_Ns3TraceSourceAccessor_methods(root_module, root_module['ns3::TraceSourceAccessor'])
@@ -377,7 +347,6 @@
     register_Ns3ObjectFactoryValue_methods(root_module, root_module['ns3::ObjectFactoryValue'])
     register_Ns3OutputStreamWrapper_methods(root_module, root_module['ns3::OutputStreamWrapper'])
     register_Ns3Packet_methods(root_module, root_module['ns3::Packet'])
-    register_Ns3RealtimeSimulatorImpl_methods(root_module, root_module['ns3::RealtimeSimulatorImpl'])
     register_Ns3TimeChecker_methods(root_module, root_module['ns3::TimeChecker'])
     register_Ns3TimeValue_methods(root_module, root_module['ns3::TimeValue'])
     register_Ns3TypeIdChecker_methods(root_module, root_module['ns3::TypeIdChecker'])
@@ -1466,40 +1435,6 @@
                    is_const=True)
     return
 
-def register_Ns3LogComponent_methods(root_module, cls):
-    ## log.h (module 'core'): ns3::LogComponent::LogComponent(ns3::LogComponent const & arg0) [copy constructor]
-    cls.add_constructor([param('ns3::LogComponent const &', 'arg0')])
-    ## log.h (module 'core'): ns3::LogComponent::LogComponent(char const * name) [constructor]
-    cls.add_constructor([param('char const *', 'name')])
-    ## log.h (module 'core'): void ns3::LogComponent::Disable(ns3::LogLevel level) [member function]
-    cls.add_method('Disable', 
-                   'void', 
-                   [param('ns3::LogLevel', 'level')])
-    ## log.h (module 'core'): void ns3::LogComponent::Enable(ns3::LogLevel level) [member function]
-    cls.add_method('Enable', 
-                   'void', 
-                   [param('ns3::LogLevel', 'level')])
-    ## log.h (module 'core'): void ns3::LogComponent::EnvVarCheck(char const * name) [member function]
-    cls.add_method('EnvVarCheck', 
-                   'void', 
-                   [param('char const *', 'name')])
-    ## log.h (module 'core'): bool ns3::LogComponent::IsEnabled(ns3::LogLevel level) const [member function]
-    cls.add_method('IsEnabled', 
-                   'bool', 
-                   [param('ns3::LogLevel', 'level')], 
-                   is_const=True)
-    ## log.h (module 'core'): bool ns3::LogComponent::IsNoneEnabled() const [member function]
-    cls.add_method('IsNoneEnabled', 
-                   'bool', 
-                   [], 
-                   is_const=True)
-    ## log.h (module 'core'): char const * ns3::LogComponent::Name() const [member function]
-    cls.add_method('Name', 
-                   'char const *', 
-                   [], 
-                   is_const=True)
-    return
-
 def register_Ns3Mac48Address_methods(root_module, cls):
     cls.add_binary_comparison_operator('<')
     cls.add_binary_comparison_operator('!=')
@@ -2857,71 +2792,6 @@
                    [])
     return
 
-def register_Ns3Scheduler_methods(root_module, cls):
-    ## scheduler.h (module 'core'): ns3::Scheduler::Scheduler() [constructor]
-    cls.add_constructor([])
-    ## scheduler.h (module 'core'): ns3::Scheduler::Scheduler(ns3::Scheduler const & arg0) [copy constructor]
-    cls.add_constructor([param('ns3::Scheduler const &', 'arg0')])
-    ## scheduler.h (module 'core'): static ns3::TypeId ns3::Scheduler::GetTypeId() [member function]
-    cls.add_method('GetTypeId', 
-                   'ns3::TypeId', 
-                   [], 
-                   is_static=True)
-    ## scheduler.h (module 'core'): void ns3::Scheduler::Insert(ns3::Scheduler::Event const & ev) [member function]
-    cls.add_method('Insert', 
-                   'void', 
-                   [param('ns3::Scheduler::Event const &', 'ev')], 
-                   is_pure_virtual=True, is_virtual=True)
-    ## scheduler.h (module 'core'): bool ns3::Scheduler::IsEmpty() const [member function]
-    cls.add_method('IsEmpty', 
-                   'bool', 
-                   [], 
-                   is_pure_virtual=True, is_const=True, is_virtual=True)
-    ## scheduler.h (module 'core'): ns3::Scheduler::Event ns3::Scheduler::PeekNext() const [member function]
-    cls.add_method('PeekNext', 
-                   'ns3::Scheduler::Event', 
-                   [], 
-                   is_pure_virtual=True, is_const=True, is_virtual=True)
-    ## scheduler.h (module 'core'): void ns3::Scheduler::Remove(ns3::Scheduler::Event const & ev) [member function]
-    cls.add_method('Remove', 
-                   'void', 
-                   [param('ns3::Scheduler::Event const &', 'ev')], 
-                   is_pure_virtual=True, is_virtual=True)
-    ## scheduler.h (module 'core'): ns3::Scheduler::Event ns3::Scheduler::RemoveNext() [member function]
-    cls.add_method('RemoveNext', 
-                   'ns3::Scheduler::Event', 
-                   [], 
-                   is_pure_virtual=True, is_virtual=True)
-    return
-
-def register_Ns3SchedulerEvent_methods(root_module, cls):
-    cls.add_binary_comparison_operator('<')
-    ## scheduler.h (module 'core'): ns3::Scheduler::Event::Event() [constructor]
-    cls.add_constructor([])
-    ## scheduler.h (module 'core'): ns3::Scheduler::Event::Event(ns3::Scheduler::Event const & arg0) [copy constructor]
-    cls.add_constructor([param('ns3::Scheduler::Event const &', 'arg0')])
-    ## scheduler.h (module 'core'): ns3::Scheduler::Event::impl [variable]
-    cls.add_instance_attribute('impl', 'ns3::EventImpl *', is_const=False)
-    ## scheduler.h (module 'core'): ns3::Scheduler::Event::key [variable]
-    cls.add_instance_attribute('key', 'ns3::Scheduler::EventKey', is_const=False)
-    return
-
-def register_Ns3SchedulerEventKey_methods(root_module, cls):
-    cls.add_binary_comparison_operator('<')
-    cls.add_binary_comparison_operator('>')
-    cls.add_binary_comparison_operator('!=')
-    ## scheduler.h (module 'core'): ns3::Scheduler::EventKey::EventKey() [constructor]
-    cls.add_constructor([])
-    ## scheduler.h (module 'core'): ns3::Scheduler::EventKey::EventKey(ns3::Scheduler::EventKey const & arg0) [copy constructor]
-    cls.add_constructor([param('ns3::Scheduler::EventKey const &', 'arg0')])
-    ## scheduler.h (module 'core'): ns3::Scheduler::EventKey::m_context [variable]
-    cls.add_instance_attribute('m_context', 'uint32_t', is_const=False)
-    ## scheduler.h (module 'core'): ns3::Scheduler::EventKey::m_ts [variable]
-    cls.add_instance_attribute('m_ts', 'uint64_t', is_const=False)
-    ## scheduler.h (module 'core'): ns3::Scheduler::EventKey::m_uid [variable]
-    cls.add_instance_attribute('m_uid', 'uint32_t', is_const=False)
-    return
-
 def register_Ns3SimpleRefCount__Ns3AttributeAccessor_Ns3Empty_Ns3DefaultDeleter__lt__ns3AttributeAccessor__gt___methods(root_module, cls):
     ## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::AttributeAccessor, ns3::empty, ns3::DefaultDeleter<ns3::AttributeAccessor> >::SimpleRefCount() [constructor]
     cls.add_constructor([])
@@ -3042,232 +2912,25 @@
                    is_static=True)
     return
 
-def register_Ns3SimulatorImpl_methods(root_module, cls):
-    ## simulator-impl.h (module 'core'): ns3::SimulatorImpl::SimulatorImpl() [constructor]
-    cls.add_constructor([])
-    ## simulator-impl.h (module 'core'): ns3::SimulatorImpl::SimulatorImpl(ns3::SimulatorImpl const & arg0) [copy constructor]
-    cls.add_constructor([param('ns3::SimulatorImpl const &', 'arg0')])
-    ## simulator-impl.h (module 'core'): void ns3::SimulatorImpl::Cancel(ns3::EventId const & ev) [member function]
-    cls.add_method('Cancel', 
-                   'void', 
-                   [param('ns3::EventId const &', 'ev')], 
-                   is_pure_virtual=True, is_virtual=True)
-    ## simulator-impl.h (module 'core'): void ns3::SimulatorImpl::Destroy() [member function]
-    cls.add_method('Destroy', 
-                   'void', 
-                   [], 
-                   is_pure_virtual=True, is_virtual=True)
-    ## simulator-impl.h (module 'core'): uint32_t ns3::SimulatorImpl::GetContext() const [member function]
-    cls.add_method('GetContext', 
-                   'uint32_t', 
-                   [], 
-                   is_pure_virtual=True, is_const=True, is_virtual=True)
-    ## simulator-impl.h (module 'core'): ns3::Time ns3::SimulatorImpl::GetDelayLeft(ns3::EventId const & id) const [member function]
-    cls.add_method('GetDelayLeft', 
-                   'ns3::Time', 
-                   [param('ns3::EventId const &', 'id')], 
-                   is_pure_virtual=True, is_const=True, is_virtual=True)
-    ## simulator-impl.h (module 'core'): ns3::Time ns3::SimulatorImpl::GetMaximumSimulationTime() const [member function]
-    cls.add_method('GetMaximumSimulationTime', 
-                   'ns3::Time', 
-                   [], 
-                   is_pure_virtual=True, is_const=True, is_virtual=True)
-    ## simulator-impl.h (module 'core'): uint32_t ns3::SimulatorImpl::GetSystemId() const [member function]
-    cls.add_method('GetSystemId', 
-                   'uint32_t', 
-                   [], 
-                   is_pure_virtual=True, is_const=True, is_virtual=True)
-    ## simulator-impl.h (module 'core'): static ns3::TypeId ns3::SimulatorImpl::GetTypeId() [member function]
-    cls.add_method('GetTypeId', 
-                   'ns3::TypeId', 
-                   [], 
-                   is_static=True)
-    ## simulator-impl.h (module 'core'): bool ns3::SimulatorImpl::IsExpired(ns3::EventId const & ev) const [member function]
-    cls.add_method('IsExpired', 
-                   'bool', 
-                   [param('ns3::EventId const &', 'ev')], 
-                   is_pure_virtual=True, is_const=True, is_virtual=True)
-    ## simulator-impl.h (module 'core'): bool ns3::SimulatorImpl::IsFinished() const [member function]
-    cls.add_method('IsFinished', 
-                   'bool', 
-                   [], 
-                   is_pure_virtual=True, is_const=True, is_virtual=True)
-    ## simulator-impl.h (module 'core'): ns3::Time ns3::SimulatorImpl::Next() const [member function]
-    cls.add_method('Next', 
-                   'ns3::Time', 
-                   [], 
-                   is_pure_virtual=True, is_const=True, is_virtual=True)
-    ## simulator-impl.h (module 'core'): ns3::Time ns3::SimulatorImpl::Now() const [member function]
-    cls.add_method('Now', 
-                   'ns3::Time', 
-                   [], 
-                   is_pure_virtual=True, is_const=True, is_virtual=True)
-    ## simulator-impl.h (module 'core'): void ns3::SimulatorImpl::Remove(ns3::EventId const & ev) [member function]
-    cls.add_method('Remove', 
-                   'void', 
-                   [param('ns3::EventId const &', 'ev')], 
-                   is_pure_virtual=True, is_virtual=True)
-    ## simulator-impl.h (module 'core'): void ns3::SimulatorImpl::Run() [member function]
-    cls.add_method('Run', 
-                   'void', 
-                   [], 
-                   is_pure_virtual=True, is_virtual=True)
-    ## simulator-impl.h (module 'core'): void ns3::SimulatorImpl::RunOneEvent() [member function]
-    cls.add_method('RunOneEvent', 
-                   'void', 
-                   [], 
-                   is_pure_virtual=True, is_virtual=True)
-    ## simulator-impl.h (module 'core'): ns3::EventId ns3::SimulatorImpl::Schedule(ns3::Time const & time, ns3::EventImpl * event) [member function]
-    cls.add_method('Schedule', 
-                   'ns3::EventId', 
-                   [param('ns3::Time const &', 'time'), param('ns3::EventImpl *', 'event')], 
-                   is_pure_virtual=True, is_virtual=True)
-    ## simulator-impl.h (module 'core'): ns3::EventId ns3::SimulatorImpl::ScheduleDestroy(ns3::EventImpl * event) [member function]
-    cls.add_method('ScheduleDestroy', 
-                   'ns3::EventId', 
-                   [param('ns3::EventImpl *', 'event')], 
-                   is_pure_virtual=True, is_virtual=True)
-    ## simulator-impl.h (module 'core'): ns3::EventId ns3::SimulatorImpl::ScheduleNow(ns3::EventImpl * event) [member function]
-    cls.add_method('ScheduleNow', 
-                   'ns3::EventId', 
-                   [param('ns3::EventImpl *', 'event')], 
-                   is_pure_virtual=True, is_virtual=True)
-    ## simulator-impl.h (module 'core'): void ns3::SimulatorImpl::ScheduleWithContext(uint32_t context, ns3::Time const & time, ns3::EventImpl * event) [member function]
-    cls.add_method('ScheduleWithContext', 
-                   'void', 
-                   [param('uint32_t', 'context'), param('ns3::Time const &', 'time'), param('ns3::EventImpl *', 'event')], 
-                   is_pure_virtual=True, is_virtual=True)
-    ## simulator-impl.h (module 'core'): void ns3::SimulatorImpl::SetScheduler(ns3::ObjectFactory schedulerFactory) [member function]
-    cls.add_method('SetScheduler', 
-                   'void', 
-                   [param('ns3::ObjectFactory', 'schedulerFactory')], 
-                   is_pure_virtual=True, is_virtual=True)
-    ## simulator-impl.h (module 'core'): void ns3::SimulatorImpl::Stop() [member function]
-    cls.add_method('Stop', 
-                   'void', 
-                   [], 
-                   is_pure_virtual=True, is_virtual=True)
-    ## simulator-impl.h (module 'core'): void ns3::SimulatorImpl::Stop(ns3::Time const & time) [member function]
-    cls.add_method('Stop', 
-                   'void', 
-                   [param('ns3::Time const &', 'time')], 
-                   is_pure_virtual=True, is_virtual=True)
-    return
-
-def register_Ns3Synchronizer_methods(root_module, cls):
-    ## synchronizer.h (module 'core'): ns3::Synchronizer::Synchronizer(ns3::Synchronizer const & arg0) [copy constructor]
-    cls.add_constructor([param('ns3::Synchronizer const &', 'arg0')])
-    ## synchronizer.h (module 'core'): ns3::Synchronizer::Synchronizer() [constructor]
-    cls.add_constructor([])
-    ## synchronizer.h (module 'core'): uint64_t ns3::Synchronizer::EventEnd() [member function]
-    cls.add_method('EventEnd', 
-                   'uint64_t', 
-                   [])
-    ## synchronizer.h (module 'core'): void ns3::Synchronizer::EventStart() [member function]
-    cls.add_method('EventStart', 
-                   'void', 
-                   [])
-    ## synchronizer.h (module 'core'): uint64_t ns3::Synchronizer::GetCurrentRealtime() [member function]
-    cls.add_method('GetCurrentRealtime', 
-                   'uint64_t', 
-                   [])
-    ## synchronizer.h (module 'core'): int64_t ns3::Synchronizer::GetDrift(uint64_t ts) [member function]
-    cls.add_method('GetDrift', 
-                   'int64_t', 
-                   [param('uint64_t', 'ts')])
-    ## synchronizer.h (module 'core'): uint64_t ns3::Synchronizer::GetOrigin() [member function]
-    cls.add_method('GetOrigin', 
-                   'uint64_t', 
-                   [])
-    ## synchronizer.h (module 'core'): static ns3::TypeId ns3::Synchronizer::GetTypeId() [member function]
-    cls.add_method('GetTypeId', 
-                   'ns3::TypeId', 
-                   [], 
-                   is_static=True)
-    ## synchronizer.h (module 'core'): bool ns3::Synchronizer::Realtime() [member function]
-    cls.add_method('Realtime', 
-                   'bool', 
-                   [])
-    ## synchronizer.h (module 'core'): void ns3::Synchronizer::SetCondition(bool arg0) [member function]
-    cls.add_method('SetCondition', 
-                   'void', 
-                   [param('bool', 'arg0')])
-    ## synchronizer.h (module 'core'): void ns3::Synchronizer::SetOrigin(uint64_t ts) [member function]
-    cls.add_method('SetOrigin', 
-                   'void', 
-                   [param('uint64_t', 'ts')])
-    ## synchronizer.h (module 'core'): void ns3::Synchronizer::Signal() [member function]
-    cls.add_method('Signal', 
-                   'void', 
-                   [])
-    ## synchronizer.h (module 'core'): bool ns3::Synchronizer::Synchronize(uint64_t tsCurrent, uint64_t tsDelay) [member function]
-    cls.add_method('Synchronize', 
-                   'bool', 
-                   [param('uint64_t', 'tsCurrent'), param('uint64_t', 'tsDelay')])
-    ## synchronizer.h (module 'core'): uint64_t ns3::Synchronizer::DoEventEnd() [member function]
-    cls.add_method('DoEventEnd', 
-                   'uint64_t', 
-                   [], 
-                   is_pure_virtual=True, visibility='protected', is_virtual=True)
-    ## synchronizer.h (module 'core'): void ns3::Synchronizer::DoEventStart() [member function]
-    cls.add_method('DoEventStart', 
-                   'void', 
-                   [], 
-                   is_pure_virtual=True, visibility='protected', is_virtual=True)
-    ## synchronizer.h (module 'core'): uint64_t ns3::Synchronizer::DoGetCurrentRealtime() [member function]
-    cls.add_method('DoGetCurrentRealtime', 
-                   'uint64_t', 
-                   [], 
-                   is_pure_virtual=True, visibility='protected', is_virtual=True)
-    ## synchronizer.h (module 'core'): int64_t ns3::Synchronizer::DoGetDrift(uint64_t ns) [member function]
-    cls.add_method('DoGetDrift', 
-                   'int64_t', 
-                   [param('uint64_t', 'ns')], 
-                   is_pure_virtual=True, visibility='protected', is_virtual=True)
-    ## synchronizer.h (module 'core'): bool ns3::Synchronizer::DoRealtime() [member function]
-    cls.add_method('DoRealtime', 
-                   'bool', 
-                   [], 
-                   is_pure_virtual=True, visibility='protected', is_virtual=True)
-    ## synchronizer.h (module 'core'): void ns3::Synchronizer::DoSetCondition(bool arg0) [member function]
-    cls.add_method('DoSetCondition', 
-                   'void', 
-                   [param('bool', 'arg0')], 
-                   is_pure_virtual=True, visibility='protected', is_virtual=True)
-    ## synchronizer.h (module 'core'): void ns3::Synchronizer::DoSetOrigin(uint64_t ns) [member function]
-    cls.add_method('DoSetOrigin', 
-                   'void', 
-                   [param('uint64_t', 'ns')], 
-                   is_pure_virtual=True, visibility='protected', is_virtual=True)
-    ## synchronizer.h (module 'core'): void ns3::Synchronizer::DoSignal() [member function]
-    cls.add_method('DoSignal', 
-                   'void', 
-                   [], 
-                   is_pure_virtual=True, visibility='protected', is_virtual=True)
-    ## synchronizer.h (module 'core'): bool ns3::Synchronizer::DoSynchronize(uint64_t nsCurrent, uint64_t nsDelay) [member function]
-    cls.add_method('DoSynchronize', 
-                   'bool', 
-                   [param('uint64_t', 'nsCurrent'), param('uint64_t', 'nsDelay')], 
-                   is_pure_virtual=True, visibility='protected', is_virtual=True)
-    return
-
 def register_Ns3SystemThread_methods(root_module, cls):
     ## system-thread.h (module 'core'): ns3::SystemThread::SystemThread(ns3::SystemThread const & arg0) [copy constructor]
     cls.add_constructor([param('ns3::SystemThread const &', 'arg0')])
-    ## system-thread.h (module 'core'): ns3::SystemThread::SystemThread(ns3::Callback<void,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty> callback) [constructor]
+    ## system-thread.h (module 'core'): ns3::SystemThread::SystemThread(ns3::Callback<void, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> callback) [constructor]
     cls.add_constructor([param('ns3::Callback< void, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'callback')])
-    ## system-thread.h (module 'core'): bool ns3::SystemThread::Break() [member function]
-    cls.add_method('Break', 
+    ## system-thread.h (module 'core'): static bool ns3::SystemThread::Equals(pthread_t id) [member function]
+    cls.add_method('Equals', 
                    'bool', 
-                   [])
+                   [param('pthread_t', 'id')], 
+                   is_static=True)
     ## system-thread.h (module 'core'): void ns3::SystemThread::Join() [member function]
     cls.add_method('Join', 
                    'void', 
                    [])
-    ## system-thread.h (module 'core'): void ns3::SystemThread::Shutdown() [member function]
-    cls.add_method('Shutdown', 
-                   'void', 
-                   [])
+    ## system-thread.h (module 'core'): static pthread_t ns3::SystemThread::Self() [member function]
+    cls.add_method('Self', 
+                   'pthread_t', 
+                   [], 
+                   is_static=True)
     ## system-thread.h (module 'core'): void ns3::SystemThread::Start() [member function]
     cls.add_method('Start', 
                    'void', 
@@ -3919,7 +3582,7 @@
     cls.add_constructor([])
     ## net-device.h (module 'network'): ns3::NetDevice::NetDevice(ns3::NetDevice const & arg0) [copy constructor]
     cls.add_constructor([param('ns3::NetDevice const &', 'arg0')])
-    ## net-device.h (module 'network'): void ns3::NetDevice::AddLinkChangeCallback(ns3::Callback<void,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty> callback) [member function]
+    ## net-device.h (module 'network'): void ns3::NetDevice::AddLinkChangeCallback(ns3::Callback<void, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> callback) [member function]
     cls.add_method('AddLinkChangeCallback', 
                    'void', 
                    [param('ns3::Callback< void, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'callback')], 
@@ -4407,162 +4070,6 @@
                    [param('ns3::Ptr< ns3::NixVector >', 'arg0')])
     return
 
-def register_Ns3RealtimeSimulatorImpl_methods(root_module, cls):
-    ## realtime-simulator-impl.h (module 'core'): ns3::RealtimeSimulatorImpl::RealtimeSimulatorImpl(ns3::RealtimeSimulatorImpl const & arg0) [copy constructor]
-    cls.add_constructor([param('ns3::RealtimeSimulatorImpl const &', 'arg0')])
-    ## realtime-simulator-impl.h (module 'core'): ns3::RealtimeSimulatorImpl::RealtimeSimulatorImpl() [constructor]
-    cls.add_constructor([])
-    ## realtime-simulator-impl.h (module 'core'): void ns3::RealtimeSimulatorImpl::Cancel(ns3::EventId const & ev) [member function]
-    cls.add_method('Cancel', 
-                   'void', 
-                   [param('ns3::EventId const &', 'ev')], 
-                   is_virtual=True)
-    ## realtime-simulator-impl.h (module 'core'): void ns3::RealtimeSimulatorImpl::Destroy() [member function]
-    cls.add_method('Destroy', 
-                   'void', 
-                   [], 
-                   is_virtual=True)
-    ## realtime-simulator-impl.h (module 'core'): uint32_t ns3::RealtimeSimulatorImpl::GetContext() const [member function]
-    cls.add_method('GetContext', 
-                   'uint32_t', 
-                   [], 
-                   is_const=True, is_virtual=True)
-    ## realtime-simulator-impl.h (module 'core'): ns3::Time ns3::RealtimeSimulatorImpl::GetDelayLeft(ns3::EventId const & id) const [member function]
-    cls.add_method('GetDelayLeft', 
-                   'ns3::Time', 
-                   [param('ns3::EventId const &', 'id')], 
-                   is_const=True, is_virtual=True)
-    ## realtime-simulator-impl.h (module 'core'): ns3::Time ns3::RealtimeSimulatorImpl::GetHardLimit() const [member function]
-    cls.add_method('GetHardLimit', 
-                   'ns3::Time', 
-                   [], 
-                   is_const=True)
-    ## realtime-simulator-impl.h (module 'core'): ns3::Time ns3::RealtimeSimulatorImpl::GetMaximumSimulationTime() const [member function]
-    cls.add_method('GetMaximumSimulationTime', 
-                   'ns3::Time', 
-                   [], 
-                   is_const=True, is_virtual=True)
-    ## realtime-simulator-impl.h (module 'core'): ns3::RealtimeSimulatorImpl::SynchronizationMode ns3::RealtimeSimulatorImpl::GetSynchronizationMode() const [member function]
-    cls.add_method('GetSynchronizationMode', 
-                   'ns3::RealtimeSimulatorImpl::SynchronizationMode', 
-                   [], 
-                   is_const=True)
-    ## realtime-simulator-impl.h (module 'core'): uint32_t ns3::RealtimeSimulatorImpl::GetSystemId() const [member function]
-    cls.add_method('GetSystemId', 
-                   'uint32_t', 
-                   [], 
-                   is_const=True, is_virtual=True)
-    ## realtime-simulator-impl.h (module 'core'): static ns3::TypeId ns3::RealtimeSimulatorImpl::GetTypeId() [member function]
-    cls.add_method('GetTypeId', 
-                   'ns3::TypeId', 
-                   [], 
-                   is_static=True)
-    ## realtime-simulator-impl.h (module 'core'): bool ns3::RealtimeSimulatorImpl::IsExpired(ns3::EventId const & ev) const [member function]
-    cls.add_method('IsExpired', 
-                   'bool', 
-                   [param('ns3::EventId const &', 'ev')], 
-                   is_const=True, is_virtual=True)
-    ## realtime-simulator-impl.h (module 'core'): bool ns3::RealtimeSimulatorImpl::IsFinished() const [member function]
-    cls.add_method('IsFinished', 
-                   'bool', 
-                   [], 
-                   is_const=True, is_virtual=True)
-    ## realtime-simulator-impl.h (module 'core'): ns3::Time ns3::RealtimeSimulatorImpl::Next() const [member function]
-    cls.add_method('Next', 
-                   'ns3::Time', 
-                   [], 
-                   is_const=True, is_virtual=True)
-    ## realtime-simulator-impl.h (module 'core'): ns3::Time ns3::RealtimeSimulatorImpl::Now() const [member function]
-    cls.add_method('Now', 
-                   'ns3::Time', 
-                   [], 
-                   is_const=True, is_virtual=True)
-    ## realtime-simulator-impl.h (module 'core'): ns3::Time ns3::RealtimeSimulatorImpl::RealtimeNow() const [member function]
-    cls.add_method('RealtimeNow', 
-                   'ns3::Time', 
-                   [], 
-                   is_const=True)
-    ## realtime-simulator-impl.h (module 'core'): void ns3::RealtimeSimulatorImpl::Remove(ns3::EventId const & ev) [member function]
-    cls.add_method('Remove', 
-                   'void', 
-                   [param('ns3::EventId const &', 'ev')], 
-                   is_virtual=True)
-    ## realtime-simulator-impl.h (module 'core'): void ns3::RealtimeSimulatorImpl::Run() [member function]
-    cls.add_method('Run', 
-                   'void', 
-                   [], 
-                   is_virtual=True)
-    ## realtime-simulator-impl.h (module 'core'): void ns3::RealtimeSimulatorImpl::RunOneEvent() [member function]
-    cls.add_method('RunOneEvent', 
-                   'void', 
-                   [], 
-                   is_virtual=True)
-    ## realtime-simulator-impl.h (module 'core'): ns3::EventId ns3::RealtimeSimulatorImpl::Schedule(ns3::Time const & time, ns3::EventImpl * event) [member function]
-    cls.add_method('Schedule', 
-                   'ns3::EventId', 
-                   [param('ns3::Time const &', 'time'), param('ns3::EventImpl *', 'event')], 
-                   is_virtual=True)
-    ## realtime-simulator-impl.h (module 'core'): ns3::EventId ns3::RealtimeSimulatorImpl::ScheduleDestroy(ns3::EventImpl * event) [member function]
-    cls.add_method('ScheduleDestroy', 
-                   'ns3::EventId', 
-                   [param('ns3::EventImpl *', 'event')], 
-                   is_virtual=True)
-    ## realtime-simulator-impl.h (module 'core'): ns3::EventId ns3::RealtimeSimulatorImpl::ScheduleNow(ns3::EventImpl * event) [member function]
-    cls.add_method('ScheduleNow', 
-                   'ns3::EventId', 
-                   [param('ns3::EventImpl *', 'event')], 
-                   is_virtual=True)
-    ## realtime-simulator-impl.h (module 'core'): void ns3::RealtimeSimulatorImpl::ScheduleRealtime(ns3::Time const & time, ns3::EventImpl * event) [member function]
-    cls.add_method('ScheduleRealtime', 
-                   'void', 
-                   [param('ns3::Time const &', 'time'), param('ns3::EventImpl *', 'event')])
-    ## realtime-simulator-impl.h (module 'core'): void ns3::RealtimeSimulatorImpl::ScheduleRealtimeNow(ns3::EventImpl * event) [member function]
-    cls.add_method('ScheduleRealtimeNow', 
-                   'void', 
-                   [param('ns3::EventImpl *', 'event')])
-    ## realtime-simulator-impl.h (module 'core'): void ns3::RealtimeSimulatorImpl::ScheduleRealtimeNowWithContext(uint32_t context, ns3::EventImpl * event) [member function]
-    cls.add_method('ScheduleRealtimeNowWithContext', 
-                   'void', 
-                   [param('uint32_t', 'context'), param('ns3::EventImpl *', 'event')])
-    ## realtime-simulator-impl.h (module 'core'): void ns3::RealtimeSimulatorImpl::ScheduleRealtimeWithContext(uint32_t context, ns3::Time const & time, ns3::EventImpl * event) [member function]
-    cls.add_method('ScheduleRealtimeWithContext', 
-                   'void', 
-                   [param('uint32_t', 'context'), param('ns3::Time const &', 'time'), param('ns3::EventImpl *', 'event')])
-    ## realtime-simulator-impl.h (module 'core'): void ns3::RealtimeSimulatorImpl::ScheduleWithContext(uint32_t context, ns3::Time const & time, ns3::EventImpl * event) [member function]
-    cls.add_method('ScheduleWithContext', 
-                   'void', 
-                   [param('uint32_t', 'context'), param('ns3::Time const &', 'time'), param('ns3::EventImpl *', 'event')], 
-                   is_virtual=True)
-    ## realtime-simulator-impl.h (module 'core'): void ns3::RealtimeSimulatorImpl::SetHardLimit(ns3::Time limit) [member function]
-    cls.add_method('SetHardLimit', 
-                   'void', 
-                   [param('ns3::Time', 'limit')])
-    ## realtime-simulator-impl.h (module 'core'): void ns3::RealtimeSimulatorImpl::SetScheduler(ns3::ObjectFactory schedulerFactory) [member function]
-    cls.add_method('SetScheduler', 
-                   'void', 
-                   [param('ns3::ObjectFactory', 'schedulerFactory')], 
-                   is_virtual=True)
-    ## realtime-simulator-impl.h (module 'core'): void ns3::RealtimeSimulatorImpl::SetSynchronizationMode(ns3::RealtimeSimulatorImpl::SynchronizationMode mode) [member function]
-    cls.add_method('SetSynchronizationMode', 
-                   'void', 
-                   [param('ns3::RealtimeSimulatorImpl::SynchronizationMode', 'mode')])
-    ## realtime-simulator-impl.h (module 'core'): void ns3::RealtimeSimulatorImpl::Stop() [member function]
-    cls.add_method('Stop', 
-                   'void', 
-                   [], 
-                   is_virtual=True)
-    ## realtime-simulator-impl.h (module 'core'): void ns3::RealtimeSimulatorImpl::Stop(ns3::Time const & time) [member function]
-    cls.add_method('Stop', 
-                   'void', 
-                   [param('ns3::Time const &', 'time')], 
-                   is_virtual=True)
-    ## realtime-simulator-impl.h (module 'core'): void ns3::RealtimeSimulatorImpl::DoDispose() [member function]
-    cls.add_method('DoDispose', 
-                   'void', 
-                   [], 
-                   visibility='private', is_virtual=True)
-    return
-
 def register_Ns3TimeChecker_methods(root_module, cls):
     ## nstime.h (module 'core'): ns3::TimeChecker::TimeChecker() [constructor]
     cls.add_constructor([])
@@ -4752,7 +4259,7 @@
                    'bool', 
                    [], 
                    is_const=True, is_virtual=True)
-    ## emu-net-device.h (module 'emu'): void ns3::EmuNetDevice::AddLinkChangeCallback(ns3::Callback<void,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty> callback) [member function]
+    ## emu-net-device.h (module 'emu'): void ns3::EmuNetDevice::AddLinkChangeCallback(ns3::Callback<void, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> callback) [member function]
     cls.add_method('AddLinkChangeCallback', 
                    'void', 
                    [param('ns3::Callback< void, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'callback')], 
--- a/src/emu/bindings/modulegen__gcc_LP64.py	Wed Apr 11 11:00:27 2012 +0200
+++ b/src/emu/bindings/modulegen__gcc_LP64.py	Wed Apr 11 13:49:33 2012 +0200
@@ -20,8 +20,6 @@
 def register_types(module):
     root_module = module.get_root()
     
-    ## log.h (module 'core'): ns3::LogLevel [enumeration]
-    module.add_enum('LogLevel', ['LOG_NONE', 'LOG_ERROR', 'LOG_LEVEL_ERROR', 'LOG_WARN', 'LOG_LEVEL_WARN', 'LOG_DEBUG', 'LOG_LEVEL_DEBUG', 'LOG_INFO', 'LOG_LEVEL_INFO', 'LOG_FUNCTION', 'LOG_LEVEL_FUNCTION', 'LOG_LOGIC', 'LOG_LEVEL_LOGIC', 'LOG_ALL', 'LOG_LEVEL_ALL', 'LOG_PREFIX_FUNC', 'LOG_PREFIX_TIME', 'LOG_PREFIX_NODE'], import_from_module='ns.core')
     ## address.h (module 'network'): ns3::Address [class]
     module.add_class('Address', import_from_module='ns.network')
     ## address.h (module 'network'): ns3::Address::MaxSize_e [enumeration]
@@ -68,8 +66,6 @@
     root_module['ns3::Ipv6Address'].implicitly_converts_to(root_module['ns3::Address'])
     ## ipv6-address.h (module 'network'): ns3::Ipv6Prefix [class]
     module.add_class('Ipv6Prefix', import_from_module='ns.network')
-    ## log.h (module 'core'): ns3::LogComponent [class]
-    module.add_class('LogComponent', import_from_module='ns.core')
     ## mac48-address.h (module 'network'): ns3::Mac48Address [class]
     module.add_class('Mac48Address', import_from_module='ns.network')
     ## mac48-address.h (module 'network'): ns3::Mac48Address [class]
@@ -142,12 +138,6 @@
     module.add_class('AggregateIterator', import_from_module='ns.core', outer_class=root_module['ns3::Object'])
     ## pcap-file-wrapper.h (module 'network'): ns3::PcapFileWrapper [class]
     module.add_class('PcapFileWrapper', import_from_module='ns.network', parent=root_module['ns3::Object'])
-    ## scheduler.h (module 'core'): ns3::Scheduler [class]
-    module.add_class('Scheduler', import_from_module='ns.core', parent=root_module['ns3::Object'])
-    ## scheduler.h (module 'core'): ns3::Scheduler::Event [struct]
-    module.add_class('Event', import_from_module='ns.core', outer_class=root_module['ns3::Scheduler'])
-    ## scheduler.h (module 'core'): ns3::Scheduler::EventKey [struct]
-    module.add_class('EventKey', import_from_module='ns.core', outer_class=root_module['ns3::Scheduler'])
     ## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::AttributeAccessor, ns3::empty, ns3::DefaultDeleter<ns3::AttributeAccessor> > [class]
     module.add_class('SimpleRefCount', automatic_type_narrowing=True, import_from_module='ns.core', template_parameters=['ns3::AttributeAccessor', 'ns3::empty', 'ns3::DefaultDeleter<ns3::AttributeAccessor>'], parent=root_module['ns3::empty'], memory_policy=cppclass.ReferenceCountingMethodsPolicy(incref_method='Ref', decref_method='Unref', peekref_method='GetReferenceCount'))
     ## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::AttributeChecker, ns3::empty, ns3::DefaultDeleter<ns3::AttributeChecker> > [class]
@@ -168,10 +158,6 @@
     module.add_class('SimpleRefCount', automatic_type_narrowing=True, import_from_module='ns.core', template_parameters=['ns3::SystemThread', 'ns3::empty', 'ns3::DefaultDeleter<ns3::SystemThread>'], parent=root_module['ns3::empty'], memory_policy=cppclass.ReferenceCountingMethodsPolicy(incref_method='Ref', decref_method='Unref', peekref_method='GetReferenceCount'))
     ## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::TraceSourceAccessor, ns3::empty, ns3::DefaultDeleter<ns3::TraceSourceAccessor> > [class]
     module.add_class('SimpleRefCount', automatic_type_narrowing=True, import_from_module='ns.core', template_parameters=['ns3::TraceSourceAccessor', 'ns3::empty', 'ns3::DefaultDeleter<ns3::TraceSourceAccessor>'], parent=root_module['ns3::empty'], memory_policy=cppclass.ReferenceCountingMethodsPolicy(incref_method='Ref', decref_method='Unref', peekref_method='GetReferenceCount'))
-    ## simulator-impl.h (module 'core'): ns3::SimulatorImpl [class]
-    module.add_class('SimulatorImpl', import_from_module='ns.core', parent=root_module['ns3::Object'])
-    ## synchronizer.h (module 'core'): ns3::Synchronizer [class]
-    module.add_class('Synchronizer', import_from_module='ns.core', parent=root_module['ns3::Object'])
     ## system-thread.h (module 'core'): ns3::SystemThread [class]
     module.add_class('SystemThread', import_from_module='ns.core', parent=root_module['ns3::SimpleRefCount< ns3::SystemThread, ns3::empty, ns3::DefaultDeleter<ns3::SystemThread> >'])
     ## nstime.h (module 'core'): ns3::Time [class]
@@ -240,10 +226,6 @@
     module.add_class('OutputStreamWrapper', import_from_module='ns.network', parent=root_module['ns3::SimpleRefCount< ns3::OutputStreamWrapper, ns3::empty, ns3::DefaultDeleter<ns3::OutputStreamWrapper> >'])
     ## packet.h (module 'network'): ns3::Packet [class]
     module.add_class('Packet', import_from_module='ns.network', parent=root_module['ns3::SimpleRefCount< ns3::Packet, ns3::empty, ns3::DefaultDeleter<ns3::Packet> >'])
-    ## realtime-simulator-impl.h (module 'core'): ns3::RealtimeSimulatorImpl [class]
-    module.add_class('RealtimeSimulatorImpl', import_from_module='ns.core', parent=root_module['ns3::SimulatorImpl'])
-    ## realtime-simulator-impl.h (module 'core'): ns3::RealtimeSimulatorImpl::SynchronizationMode [enumeration]
-    module.add_enum('SynchronizationMode', ['SYNC_BEST_EFFORT', 'SYNC_HARD_LIMIT'], outer_class=root_module['ns3::RealtimeSimulatorImpl'], import_from_module='ns.core')
     ## nstime.h (module 'core'): ns3::TimeChecker [class]
     module.add_class('TimeChecker', import_from_module='ns.core', parent=root_module['ns3::AttributeChecker'])
     ## nstime.h (module 'core'): ns3::TimeValue [class]
@@ -260,12 +242,6 @@
     module.add_class('EmuNetDevice', parent=root_module['ns3::NetDevice'])
     ## emu-net-device.h (module 'emu'): ns3::EmuNetDevice::EncapsulationMode [enumeration]
     module.add_enum('EncapsulationMode', ['ILLEGAL', 'DIX', 'LLC'], outer_class=root_module['ns3::EmuNetDevice'])
-    typehandlers.add_type_alias('void ( * ) ( std::ostream & ) *', 'ns3::LogTimePrinter')
-    typehandlers.add_type_alias('void ( * ) ( std::ostream & ) **', 'ns3::LogTimePrinter*')
-    typehandlers.add_type_alias('void ( * ) ( std::ostream & ) *&', 'ns3::LogTimePrinter&')
-    typehandlers.add_type_alias('void ( * ) ( std::ostream & ) *', 'ns3::LogNodePrinter')
-    typehandlers.add_type_alias('void ( * ) ( std::ostream & ) **', 'ns3::LogNodePrinter*')
-    typehandlers.add_type_alias('void ( * ) ( std::ostream & ) *&', 'ns3::LogNodePrinter&')
     
     ## Register a nested module for the namespace FatalImpl
     
@@ -298,7 +274,6 @@
     register_Ns3Ipv4Mask_methods(root_module, root_module['ns3::Ipv4Mask'])
     register_Ns3Ipv6Address_methods(root_module, root_module['ns3::Ipv6Address'])
     register_Ns3Ipv6Prefix_methods(root_module, root_module['ns3::Ipv6Prefix'])
-    register_Ns3LogComponent_methods(root_module, root_module['ns3::LogComponent'])
     register_Ns3Mac48Address_methods(root_module, root_module['ns3::Mac48Address'])
     register_Ns3NetDeviceContainer_methods(root_module, root_module['ns3::NetDeviceContainer'])
     register_Ns3NodeContainer_methods(root_module, root_module['ns3::NodeContainer'])
@@ -331,9 +306,6 @@
     register_Ns3Object_methods(root_module, root_module['ns3::Object'])
     register_Ns3ObjectAggregateIterator_methods(root_module, root_module['ns3::Object::AggregateIterator'])
     register_Ns3PcapFileWrapper_methods(root_module, root_module['ns3::PcapFileWrapper'])
-    register_Ns3Scheduler_methods(root_module, root_module['ns3::Scheduler'])
-    register_Ns3SchedulerEvent_methods(root_module, root_module['ns3::Scheduler::Event'])
-    register_Ns3SchedulerEventKey_methods(root_module, root_module['ns3::Scheduler::EventKey'])
     register_Ns3SimpleRefCount__Ns3AttributeAccessor_Ns3Empty_Ns3DefaultDeleter__lt__ns3AttributeAccessor__gt___methods(root_module, root_module['ns3::SimpleRefCount< ns3::AttributeAccessor, ns3::empty, ns3::DefaultDeleter<ns3::AttributeAccessor> >'])
     register_Ns3SimpleRefCount__Ns3AttributeChecker_Ns3Empty_Ns3DefaultDeleter__lt__ns3AttributeChecker__gt___methods(root_module, root_module['ns3::SimpleRefCount< ns3::AttributeChecker, ns3::empty, ns3::DefaultDeleter<ns3::AttributeChecker> >'])
     register_Ns3SimpleRefCount__Ns3AttributeValue_Ns3Empty_Ns3DefaultDeleter__lt__ns3AttributeValue__gt___methods(root_module, root_module['ns3::SimpleRefCount< ns3::AttributeValue, ns3::empty, ns3::DefaultDeleter<ns3::AttributeValue> >'])
@@ -344,8 +316,6 @@
     register_Ns3SimpleRefCount__Ns3Packet_Ns3Empty_Ns3DefaultDeleter__lt__ns3Packet__gt___methods(root_module, root_module['ns3::SimpleRefCount< ns3::Packet, ns3::empty, ns3::DefaultDeleter<ns3::Packet> >'])
     register_Ns3SimpleRefCount__Ns3SystemThread_Ns3Empty_Ns3DefaultDeleter__lt__ns3SystemThread__gt___methods(root_module, root_module['ns3::SimpleRefCount< ns3::SystemThread, ns3::empty, ns3::DefaultDeleter<ns3::SystemThread> >'])
     register_Ns3SimpleRefCount__Ns3TraceSourceAccessor_Ns3Empty_Ns3DefaultDeleter__lt__ns3TraceSourceAccessor__gt___methods(root_module, root_module['ns3::SimpleRefCount< ns3::TraceSourceAccessor, ns3::empty, ns3::DefaultDeleter<ns3::TraceSourceAccessor> >'])
-    register_Ns3SimulatorImpl_methods(root_module, root_module['ns3::SimulatorImpl'])
-    register_Ns3Synchronizer_methods(root_module, root_module['ns3::Synchronizer'])
     register_Ns3SystemThread_methods(root_module, root_module['ns3::SystemThread'])
     register_Ns3Time_methods(root_module, root_module['ns3::Time'])
     register_Ns3TraceSourceAccessor_methods(root_module, root_module['ns3::TraceSourceAccessor'])
@@ -377,7 +347,6 @@
     register_Ns3ObjectFactoryValue_methods(root_module, root_module['ns3::ObjectFactoryValue'])
     register_Ns3OutputStreamWrapper_methods(root_module, root_module['ns3::OutputStreamWrapper'])
     register_Ns3Packet_methods(root_module, root_module['ns3::Packet'])
-    register_Ns3RealtimeSimulatorImpl_methods(root_module, root_module['ns3::RealtimeSimulatorImpl'])
     register_Ns3TimeChecker_methods(root_module, root_module['ns3::TimeChecker'])
     register_Ns3TimeValue_methods(root_module, root_module['ns3::TimeValue'])
     register_Ns3TypeIdChecker_methods(root_module, root_module['ns3::TypeIdChecker'])
@@ -1466,40 +1435,6 @@
                    is_const=True)
     return
 
-def register_Ns3LogComponent_methods(root_module, cls):
-    ## log.h (module 'core'): ns3::LogComponent::LogComponent(ns3::LogComponent const & arg0) [copy constructor]
-    cls.add_constructor([param('ns3::LogComponent const &', 'arg0')])
-    ## log.h (module 'core'): ns3::LogComponent::LogComponent(char const * name) [constructor]
-    cls.add_constructor([param('char const *', 'name')])
-    ## log.h (module 'core'): void ns3::LogComponent::Disable(ns3::LogLevel level) [member function]
-    cls.add_method('Disable', 
-                   'void', 
-                   [param('ns3::LogLevel', 'level')])
-    ## log.h (module 'core'): void ns3::LogComponent::Enable(ns3::LogLevel level) [member function]
-    cls.add_method('Enable', 
-                   'void', 
-                   [param('ns3::LogLevel', 'level')])
-    ## log.h (module 'core'): void ns3::LogComponent::EnvVarCheck(char const * name) [member function]
-    cls.add_method('EnvVarCheck', 
-                   'void', 
-                   [param('char const *', 'name')])
-    ## log.h (module 'core'): bool ns3::LogComponent::IsEnabled(ns3::LogLevel level) const [member function]
-    cls.add_method('IsEnabled', 
-                   'bool', 
-                   [param('ns3::LogLevel', 'level')], 
-                   is_const=True)
-    ## log.h (module 'core'): bool ns3::LogComponent::IsNoneEnabled() const [member function]
-    cls.add_method('IsNoneEnabled', 
-                   'bool', 
-                   [], 
-                   is_const=True)
-    ## log.h (module 'core'): char const * ns3::LogComponent::Name() const [member function]
-    cls.add_method('Name', 
-                   'char const *', 
-                   [], 
-                   is_const=True)
-    return
-
 def register_Ns3Mac48Address_methods(root_module, cls):
     cls.add_binary_comparison_operator('<')
     cls.add_binary_comparison_operator('!=')
@@ -2857,71 +2792,6 @@
                    [])
     return
 
-def register_Ns3Scheduler_methods(root_module, cls):
-    ## scheduler.h (module 'core'): ns3::Scheduler::Scheduler() [constructor]
-    cls.add_constructor([])
-    ## scheduler.h (module 'core'): ns3::Scheduler::Scheduler(ns3::Scheduler const & arg0) [copy constructor]
-    cls.add_constructor([param('ns3::Scheduler const &', 'arg0')])
-    ## scheduler.h (module 'core'): static ns3::TypeId ns3::Scheduler::GetTypeId() [member function]
-    cls.add_method('GetTypeId', 
-                   'ns3::TypeId', 
-                   [], 
-                   is_static=True)
-    ## scheduler.h (module 'core'): void ns3::Scheduler::Insert(ns3::Scheduler::Event const & ev) [member function]
-    cls.add_method('Insert', 
-                   'void', 
-                   [param('ns3::Scheduler::Event const &', 'ev')], 
-                   is_pure_virtual=True, is_virtual=True)
-    ## scheduler.h (module 'core'): bool ns3::Scheduler::IsEmpty() const [member function]
-    cls.add_method('IsEmpty', 
-                   'bool', 
-                   [], 
-                   is_pure_virtual=True, is_const=True, is_virtual=True)
-    ## scheduler.h (module 'core'): ns3::Scheduler::Event ns3::Scheduler::PeekNext() const [member function]
-    cls.add_method('PeekNext', 
-                   'ns3::Scheduler::Event', 
-                   [], 
-                   is_pure_virtual=True, is_const=True, is_virtual=True)
-    ## scheduler.h (module 'core'): void ns3::Scheduler::Remove(ns3::Scheduler::Event const & ev) [member function]
-    cls.add_method('Remove', 
-                   'void', 
-                   [param('ns3::Scheduler::Event const &', 'ev')], 
-                   is_pure_virtual=True, is_virtual=True)
-    ## scheduler.h (module 'core'): ns3::Scheduler::Event ns3::Scheduler::RemoveNext() [member function]
-    cls.add_method('RemoveNext', 
-                   'ns3::Scheduler::Event', 
-                   [], 
-                   is_pure_virtual=True, is_virtual=True)
-    return
-
-def register_Ns3SchedulerEvent_methods(root_module, cls):
-    cls.add_binary_comparison_operator('<')
-    ## scheduler.h (module 'core'): ns3::Scheduler::Event::Event() [constructor]
-    cls.add_constructor([])
-    ## scheduler.h (module 'core'): ns3::Scheduler::Event::Event(ns3::Scheduler::Event const & arg0) [copy constructor]
-    cls.add_constructor([param('ns3::Scheduler::Event const &', 'arg0')])
-    ## scheduler.h (module 'core'): ns3::Scheduler::Event::impl [variable]
-    cls.add_instance_attribute('impl', 'ns3::EventImpl *', is_const=False)
-    ## scheduler.h (module 'core'): ns3::Scheduler::Event::key [variable]
-    cls.add_instance_attribute('key', 'ns3::Scheduler::EventKey', is_const=False)
-    return
-
-def register_Ns3SchedulerEventKey_methods(root_module, cls):
-    cls.add_binary_comparison_operator('<')
-    cls.add_binary_comparison_operator('>')
-    cls.add_binary_comparison_operator('!=')
-    ## scheduler.h (module 'core'): ns3::Scheduler::EventKey::EventKey() [constructor]
-    cls.add_constructor([])
-    ## scheduler.h (module 'core'): ns3::Scheduler::EventKey::EventKey(ns3::Scheduler::EventKey const & arg0) [copy constructor]
-    cls.add_constructor([param('ns3::Scheduler::EventKey const &', 'arg0')])
-    ## scheduler.h (module 'core'): ns3::Scheduler::EventKey::m_context [variable]
-    cls.add_instance_attribute('m_context', 'uint32_t', is_const=False)
-    ## scheduler.h (module 'core'): ns3::Scheduler::EventKey::m_ts [variable]
-    cls.add_instance_attribute('m_ts', 'uint64_t', is_const=False)
-    ## scheduler.h (module 'core'): ns3::Scheduler::EventKey::m_uid [variable]
-    cls.add_instance_attribute('m_uid', 'uint32_t', is_const=False)
-    return
-
 def register_Ns3SimpleRefCount__Ns3AttributeAccessor_Ns3Empty_Ns3DefaultDeleter__lt__ns3AttributeAccessor__gt___methods(root_module, cls):
     ## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::AttributeAccessor, ns3::empty, ns3::DefaultDeleter<ns3::AttributeAccessor> >::SimpleRefCount() [constructor]
     cls.add_constructor([])
@@ -3042,232 +2912,25 @@
                    is_static=True)
     return
 
-def register_Ns3SimulatorImpl_methods(root_module, cls):
-    ## simulator-impl.h (module 'core'): ns3::SimulatorImpl::SimulatorImpl() [constructor]
-    cls.add_constructor([])
-    ## simulator-impl.h (module 'core'): ns3::SimulatorImpl::SimulatorImpl(ns3::SimulatorImpl const & arg0) [copy constructor]
-    cls.add_constructor([param('ns3::SimulatorImpl const &', 'arg0')])
-    ## simulator-impl.h (module 'core'): void ns3::SimulatorImpl::Cancel(ns3::EventId const & ev) [member function]
-    cls.add_method('Cancel', 
-                   'void', 
-                   [param('ns3::EventId const &', 'ev')], 
-                   is_pure_virtual=True, is_virtual=True)
-    ## simulator-impl.h (module 'core'): void ns3::SimulatorImpl::Destroy() [member function]
-    cls.add_method('Destroy', 
-                   'void', 
-                   [], 
-                   is_pure_virtual=True, is_virtual=True)
-    ## simulator-impl.h (module 'core'): uint32_t ns3::SimulatorImpl::GetContext() const [member function]
-    cls.add_method('GetContext', 
-                   'uint32_t', 
-                   [], 
-                   is_pure_virtual=True, is_const=True, is_virtual=True)
-    ## simulator-impl.h (module 'core'): ns3::Time ns3::SimulatorImpl::GetDelayLeft(ns3::EventId const & id) const [member function]
-    cls.add_method('GetDelayLeft', 
-                   'ns3::Time', 
-                   [param('ns3::EventId const &', 'id')], 
-                   is_pure_virtual=True, is_const=True, is_virtual=True)
-    ## simulator-impl.h (module 'core'): ns3::Time ns3::SimulatorImpl::GetMaximumSimulationTime() const [member function]
-    cls.add_method('GetMaximumSimulationTime', 
-                   'ns3::Time', 
-                   [], 
-                   is_pure_virtual=True, is_const=True, is_virtual=True)
-    ## simulator-impl.h (module 'core'): uint32_t ns3::SimulatorImpl::GetSystemId() const [member function]
-    cls.add_method('GetSystemId', 
-                   'uint32_t', 
-                   [], 
-                   is_pure_virtual=True, is_const=True, is_virtual=True)
-    ## simulator-impl.h (module 'core'): static ns3::TypeId ns3::SimulatorImpl::GetTypeId() [member function]
-    cls.add_method('GetTypeId', 
-                   'ns3::TypeId', 
-                   [], 
-                   is_static=True)
-    ## simulator-impl.h (module 'core'): bool ns3::SimulatorImpl::IsExpired(ns3::EventId const & ev) const [member function]
-    cls.add_method('IsExpired', 
-                   'bool', 
-                   [param('ns3::EventId const &', 'ev')], 
-                   is_pure_virtual=True, is_const=True, is_virtual=True)
-    ## simulator-impl.h (module 'core'): bool ns3::SimulatorImpl::IsFinished() const [member function]
-    cls.add_method('IsFinished', 
-                   'bool', 
-                   [], 
-                   is_pure_virtual=True, is_const=True, is_virtual=True)
-    ## simulator-impl.h (module 'core'): ns3::Time ns3::SimulatorImpl::Next() const [member function]
-    cls.add_method('Next', 
-                   'ns3::Time', 
-                   [], 
-                   is_pure_virtual=True, is_const=True, is_virtual=True)
-    ## simulator-impl.h (module 'core'): ns3::Time ns3::SimulatorImpl::Now() const [member function]
-    cls.add_method('Now', 
-                   'ns3::Time', 
-                   [], 
-                   is_pure_virtual=True, is_const=True, is_virtual=True)
-    ## simulator-impl.h (module 'core'): void ns3::SimulatorImpl::Remove(ns3::EventId const & ev) [member function]
-    cls.add_method('Remove', 
-                   'void', 
-                   [param('ns3::EventId const &', 'ev')], 
-                   is_pure_virtual=True, is_virtual=True)
-    ## simulator-impl.h (module 'core'): void ns3::SimulatorImpl::Run() [member function]
-    cls.add_method('Run', 
-                   'void', 
-                   [], 
-                   is_pure_virtual=True, is_virtual=True)
-    ## simulator-impl.h (module 'core'): void ns3::SimulatorImpl::RunOneEvent() [member function]
-    cls.add_method('RunOneEvent', 
-                   'void', 
-                   [], 
-                   is_pure_virtual=True, is_virtual=True)
-    ## simulator-impl.h (module 'core'): ns3::EventId ns3::SimulatorImpl::Schedule(ns3::Time const & time, ns3::EventImpl * event) [member function]
-    cls.add_method('Schedule', 
-                   'ns3::EventId', 
-                   [param('ns3::Time const &', 'time'), param('ns3::EventImpl *', 'event')], 
-                   is_pure_virtual=True, is_virtual=True)
-    ## simulator-impl.h (module 'core'): ns3::EventId ns3::SimulatorImpl::ScheduleDestroy(ns3::EventImpl * event) [member function]
-    cls.add_method('ScheduleDestroy', 
-                   'ns3::EventId', 
-                   [param('ns3::EventImpl *', 'event')], 
-                   is_pure_virtual=True, is_virtual=True)
-    ## simulator-impl.h (module 'core'): ns3::EventId ns3::SimulatorImpl::ScheduleNow(ns3::EventImpl * event) [member function]
-    cls.add_method('ScheduleNow', 
-                   'ns3::EventId', 
-                   [param('ns3::EventImpl *', 'event')], 
-                   is_pure_virtual=True, is_virtual=True)
-    ## simulator-impl.h (module 'core'): void ns3::SimulatorImpl::ScheduleWithContext(uint32_t context, ns3::Time const & time, ns3::EventImpl * event) [member function]
-    cls.add_method('ScheduleWithContext', 
-                   'void', 
-                   [param('uint32_t', 'context'), param('ns3::Time const &', 'time'), param('ns3::EventImpl *', 'event')], 
-                   is_pure_virtual=True, is_virtual=True)
-    ## simulator-impl.h (module 'core'): void ns3::SimulatorImpl::SetScheduler(ns3::ObjectFactory schedulerFactory) [member function]
-    cls.add_method('SetScheduler', 
-                   'void', 
-                   [param('ns3::ObjectFactory', 'schedulerFactory')], 
-                   is_pure_virtual=True, is_virtual=True)
-    ## simulator-impl.h (module 'core'): void ns3::SimulatorImpl::Stop() [member function]
-    cls.add_method('Stop', 
-                   'void', 
-                   [], 
-                   is_pure_virtual=True, is_virtual=True)
-    ## simulator-impl.h (module 'core'): void ns3::SimulatorImpl::Stop(ns3::Time const & time) [member function]
-    cls.add_method('Stop', 
-                   'void', 
-                   [param('ns3::Time const &', 'time')], 
-                   is_pure_virtual=True, is_virtual=True)
-    return
-
-def register_Ns3Synchronizer_methods(root_module, cls):
-    ## synchronizer.h (module 'core'): ns3::Synchronizer::Synchronizer(ns3::Synchronizer const & arg0) [copy constructor]
-    cls.add_constructor([param('ns3::Synchronizer const &', 'arg0')])
-    ## synchronizer.h (module 'core'): ns3::Synchronizer::Synchronizer() [constructor]
-    cls.add_constructor([])
-    ## synchronizer.h (module 'core'): uint64_t ns3::Synchronizer::EventEnd() [member function]
-    cls.add_method('EventEnd', 
-                   'uint64_t', 
-                   [])
-    ## synchronizer.h (module 'core'): void ns3::Synchronizer::EventStart() [member function]
-    cls.add_method('EventStart', 
-                   'void', 
-                   [])
-    ## synchronizer.h (module 'core'): uint64_t ns3::Synchronizer::GetCurrentRealtime() [member function]
-    cls.add_method('GetCurrentRealtime', 
-                   'uint64_t', 
-                   [])
-    ## synchronizer.h (module 'core'): int64_t ns3::Synchronizer::GetDrift(uint64_t ts) [member function]
-    cls.add_method('GetDrift', 
-                   'int64_t', 
-                   [param('uint64_t', 'ts')])
-    ## synchronizer.h (module 'core'): uint64_t ns3::Synchronizer::GetOrigin() [member function]
-    cls.add_method('GetOrigin', 
-                   'uint64_t', 
-                   [])
-    ## synchronizer.h (module 'core'): static ns3::TypeId ns3::Synchronizer::GetTypeId() [member function]
-    cls.add_method('GetTypeId', 
-                   'ns3::TypeId', 
-                   [], 
-                   is_static=True)
-    ## synchronizer.h (module 'core'): bool ns3::Synchronizer::Realtime() [member function]
-    cls.add_method('Realtime', 
-                   'bool', 
-                   [])
-    ## synchronizer.h (module 'core'): void ns3::Synchronizer::SetCondition(bool arg0) [member function]
-    cls.add_method('SetCondition', 
-                   'void', 
-                   [param('bool', 'arg0')])
-    ## synchronizer.h (module 'core'): void ns3::Synchronizer::SetOrigin(uint64_t ts) [member function]
-    cls.add_method('SetOrigin', 
-                   'void', 
-                   [param('uint64_t', 'ts')])
-    ## synchronizer.h (module 'core'): void ns3::Synchronizer::Signal() [member function]
-    cls.add_method('Signal', 
-                   'void', 
-                   [])
-    ## synchronizer.h (module 'core'): bool ns3::Synchronizer::Synchronize(uint64_t tsCurrent, uint64_t tsDelay) [member function]
-    cls.add_method('Synchronize', 
-                   'bool', 
-                   [param('uint64_t', 'tsCurrent'), param('uint64_t', 'tsDelay')])
-    ## synchronizer.h (module 'core'): uint64_t ns3::Synchronizer::DoEventEnd() [member function]
-    cls.add_method('DoEventEnd', 
-                   'uint64_t', 
-                   [], 
-                   is_pure_virtual=True, visibility='protected', is_virtual=True)
-    ## synchronizer.h (module 'core'): void ns3::Synchronizer::DoEventStart() [member function]
-    cls.add_method('DoEventStart', 
-                   'void', 
-                   [], 
-                   is_pure_virtual=True, visibility='protected', is_virtual=True)
-    ## synchronizer.h (module 'core'): uint64_t ns3::Synchronizer::DoGetCurrentRealtime() [member function]
-    cls.add_method('DoGetCurrentRealtime', 
-                   'uint64_t', 
-                   [], 
-                   is_pure_virtual=True, visibility='protected', is_virtual=True)
-    ## synchronizer.h (module 'core'): int64_t ns3::Synchronizer::DoGetDrift(uint64_t ns) [member function]
-    cls.add_method('DoGetDrift', 
-                   'int64_t', 
-                   [param('uint64_t', 'ns')], 
-                   is_pure_virtual=True, visibility='protected', is_virtual=True)
-    ## synchronizer.h (module 'core'): bool ns3::Synchronizer::DoRealtime() [member function]
-    cls.add_method('DoRealtime', 
-                   'bool', 
-                   [], 
-                   is_pure_virtual=True, visibility='protected', is_virtual=True)
-    ## synchronizer.h (module 'core'): void ns3::Synchronizer::DoSetCondition(bool arg0) [member function]
-    cls.add_method('DoSetCondition', 
-                   'void', 
-                   [param('bool', 'arg0')], 
-                   is_pure_virtual=True, visibility='protected', is_virtual=True)
-    ## synchronizer.h (module 'core'): void ns3::Synchronizer::DoSetOrigin(uint64_t ns) [member function]
-    cls.add_method('DoSetOrigin', 
-                   'void', 
-                   [param('uint64_t', 'ns')], 
-                   is_pure_virtual=True, visibility='protected', is_virtual=True)
-    ## synchronizer.h (module 'core'): void ns3::Synchronizer::DoSignal() [member function]
-    cls.add_method('DoSignal', 
-                   'void', 
-                   [], 
-                   is_pure_virtual=True, visibility='protected', is_virtual=True)
-    ## synchronizer.h (module 'core'): bool ns3::Synchronizer::DoSynchronize(uint64_t nsCurrent, uint64_t nsDelay) [member function]
-    cls.add_method('DoSynchronize', 
-                   'bool', 
-                   [param('uint64_t', 'nsCurrent'), param('uint64_t', 'nsDelay')], 
-                   is_pure_virtual=True, visibility='protected', is_virtual=True)
-    return
-
 def register_Ns3SystemThread_methods(root_module, cls):
     ## system-thread.h (module 'core'): ns3::SystemThread::SystemThread(ns3::SystemThread const & arg0) [copy constructor]
     cls.add_constructor([param('ns3::SystemThread const &', 'arg0')])
-    ## system-thread.h (module 'core'): ns3::SystemThread::SystemThread(ns3::Callback<void,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty> callback) [constructor]
+    ## system-thread.h (module 'core'): ns3::SystemThread::SystemThread(ns3::Callback<void, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> callback) [constructor]
     cls.add_constructor([param('ns3::Callback< void, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'callback')])
-    ## system-thread.h (module 'core'): bool ns3::SystemThread::Break() [member function]
-    cls.add_method('Break', 
+    ## system-thread.h (module 'core'): static bool ns3::SystemThread::Equals(pthread_t id) [member function]
+    cls.add_method('Equals', 
                    'bool', 
-                   [])
+                   [param('pthread_t', 'id')], 
+                   is_static=True)
     ## system-thread.h (module 'core'): void ns3::SystemThread::Join() [member function]
     cls.add_method('Join', 
                    'void', 
                    [])
-    ## system-thread.h (module 'core'): void ns3::SystemThread::Shutdown() [member function]
-    cls.add_method('Shutdown', 
-                   'void', 
-                   [])
+    ## system-thread.h (module 'core'): static pthread_t ns3::SystemThread::Self() [member function]
+    cls.add_method('Self', 
+                   'pthread_t', 
+                   [], 
+                   is_static=True)
     ## system-thread.h (module 'core'): void ns3::SystemThread::Start() [member function]
     cls.add_method('Start', 
                    'void', 
@@ -3919,7 +3582,7 @@
     cls.add_constructor([])
     ## net-device.h (module 'network'): ns3::NetDevice::NetDevice(ns3::NetDevice const & arg0) [copy constructor]
     cls.add_constructor([param('ns3::NetDevice const &', 'arg0')])
-    ## net-device.h (module 'network'): void ns3::NetDevice::AddLinkChangeCallback(ns3::Callback<void,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty> callback) [member function]
+    ## net-device.h (module 'network'): void ns3::NetDevice::AddLinkChangeCallback(ns3::Callback<void, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> callback) [member function]
     cls.add_method('AddLinkChangeCallback', 
                    'void', 
                    [param('ns3::Callback< void, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'callback')], 
@@ -4407,162 +4070,6 @@
                    [param('ns3::Ptr< ns3::NixVector >', 'arg0')])
     return
 
-def register_Ns3RealtimeSimulatorImpl_methods(root_module, cls):
-    ## realtime-simulator-impl.h (module 'core'): ns3::RealtimeSimulatorImpl::RealtimeSimulatorImpl(ns3::RealtimeSimulatorImpl const & arg0) [copy constructor]
-    cls.add_constructor([param('ns3::RealtimeSimulatorImpl const &', 'arg0')])
-    ## realtime-simulator-impl.h (module 'core'): ns3::RealtimeSimulatorImpl::RealtimeSimulatorImpl() [constructor]
-    cls.add_constructor([])
-    ## realtime-simulator-impl.h (module 'core'): void ns3::RealtimeSimulatorImpl::Cancel(ns3::EventId const & ev) [member function]
-    cls.add_method('Cancel', 
-                   'void', 
-                   [param('ns3::EventId const &', 'ev')], 
-                   is_virtual=True)
-    ## realtime-simulator-impl.h (module 'core'): void ns3::RealtimeSimulatorImpl::Destroy() [member function]
-    cls.add_method('Destroy', 
-                   'void', 
-                   [], 
-                   is_virtual=True)
-    ## realtime-simulator-impl.h (module 'core'): uint32_t ns3::RealtimeSimulatorImpl::GetContext() const [member function]
-    cls.add_method('GetContext', 
-                   'uint32_t', 
-                   [], 
-                   is_const=True, is_virtual=True)
-    ## realtime-simulator-impl.h (module 'core'): ns3::Time ns3::RealtimeSimulatorImpl::GetDelayLeft(ns3::EventId const & id) const [member function]
-    cls.add_method('GetDelayLeft', 
-                   'ns3::Time', 
-                   [param('ns3::EventId const &', 'id')], 
-                   is_const=True, is_virtual=True)
-    ## realtime-simulator-impl.h (module 'core'): ns3::Time ns3::RealtimeSimulatorImpl::GetHardLimit() const [member function]
-    cls.add_method('GetHardLimit', 
-                   'ns3::Time', 
-                   [], 
-                   is_const=True)
-    ## realtime-simulator-impl.h (module 'core'): ns3::Time ns3::RealtimeSimulatorImpl::GetMaximumSimulationTime() const [member function]
-    cls.add_method('GetMaximumSimulationTime', 
-                   'ns3::Time', 
-                   [], 
-                   is_const=True, is_virtual=True)
-    ## realtime-simulator-impl.h (module 'core'): ns3::RealtimeSimulatorImpl::SynchronizationMode ns3::RealtimeSimulatorImpl::GetSynchronizationMode() const [member function]
-    cls.add_method('GetSynchronizationMode', 
-                   'ns3::RealtimeSimulatorImpl::SynchronizationMode', 
-                   [], 
-                   is_const=True)
-    ## realtime-simulator-impl.h (module 'core'): uint32_t ns3::RealtimeSimulatorImpl::GetSystemId() const [member function]
-    cls.add_method('GetSystemId', 
-                   'uint32_t', 
-                   [], 
-                   is_const=True, is_virtual=True)
-    ## realtime-simulator-impl.h (module 'core'): static ns3::TypeId ns3::RealtimeSimulatorImpl::GetTypeId() [member function]
-    cls.add_method('GetTypeId', 
-                   'ns3::TypeId', 
-                   [], 
-                   is_static=True)
-    ## realtime-simulator-impl.h (module 'core'): bool ns3::RealtimeSimulatorImpl::IsExpired(ns3::EventId const & ev) const [member function]
-    cls.add_method('IsExpired', 
-                   'bool', 
-                   [param('ns3::EventId const &', 'ev')], 
-                   is_const=True, is_virtual=True)
-    ## realtime-simulator-impl.h (module 'core'): bool ns3::RealtimeSimulatorImpl::IsFinished() const [member function]
-    cls.add_method('IsFinished', 
-                   'bool', 
-                   [], 
-                   is_const=True, is_virtual=True)
-    ## realtime-simulator-impl.h (module 'core'): ns3::Time ns3::RealtimeSimulatorImpl::Next() const [member function]
-    cls.add_method('Next', 
-                   'ns3::Time', 
-                   [], 
-                   is_const=True, is_virtual=True)
-    ## realtime-simulator-impl.h (module 'core'): ns3::Time ns3::RealtimeSimulatorImpl::Now() const [member function]
-    cls.add_method('Now', 
-                   'ns3::Time', 
-                   [], 
-                   is_const=True, is_virtual=True)
-    ## realtime-simulator-impl.h (module 'core'): ns3::Time ns3::RealtimeSimulatorImpl::RealtimeNow() const [member function]
-    cls.add_method('RealtimeNow', 
-                   'ns3::Time', 
-                   [], 
-                   is_const=True)
-    ## realtime-simulator-impl.h (module 'core'): void ns3::RealtimeSimulatorImpl::Remove(ns3::EventId const & ev) [member function]
-    cls.add_method('Remove', 
-                   'void', 
-                   [param('ns3::EventId const &', 'ev')], 
-                   is_virtual=True)
-    ## realtime-simulator-impl.h (module 'core'): void ns3::RealtimeSimulatorImpl::Run() [member function]
-    cls.add_method('Run', 
-                   'void', 
-                   [], 
-                   is_virtual=True)
-    ## realtime-simulator-impl.h (module 'core'): void ns3::RealtimeSimulatorImpl::RunOneEvent() [member function]
-    cls.add_method('RunOneEvent', 
-                   'void', 
-                   [], 
-                   is_virtual=True)
-    ## realtime-simulator-impl.h (module 'core'): ns3::EventId ns3::RealtimeSimulatorImpl::Schedule(ns3::Time const & time, ns3::EventImpl * event) [member function]
-    cls.add_method('Schedule', 
-                   'ns3::EventId', 
-                   [param('ns3::Time const &', 'time'), param('ns3::EventImpl *', 'event')], 
-                   is_virtual=True)
-    ## realtime-simulator-impl.h (module 'core'): ns3::EventId ns3::RealtimeSimulatorImpl::ScheduleDestroy(ns3::EventImpl * event) [member function]
-    cls.add_method('ScheduleDestroy', 
-                   'ns3::EventId', 
-                   [param('ns3::EventImpl *', 'event')], 
-                   is_virtual=True)
-    ## realtime-simulator-impl.h (module 'core'): ns3::EventId ns3::RealtimeSimulatorImpl::ScheduleNow(ns3::EventImpl * event) [member function]
-    cls.add_method('ScheduleNow', 
-                   'ns3::EventId', 
-                   [param('ns3::EventImpl *', 'event')], 
-                   is_virtual=True)
-    ## realtime-simulator-impl.h (module 'core'): void ns3::RealtimeSimulatorImpl::ScheduleRealtime(ns3::Time const & time, ns3::EventImpl * event) [member function]
-    cls.add_method('ScheduleRealtime', 
-                   'void', 
-                   [param('ns3::Time const &', 'time'), param('ns3::EventImpl *', 'event')])
-    ## realtime-simulator-impl.h (module 'core'): void ns3::RealtimeSimulatorImpl::ScheduleRealtimeNow(ns3::EventImpl * event) [member function]
-    cls.add_method('ScheduleRealtimeNow', 
-                   'void', 
-                   [param('ns3::EventImpl *', 'event')])
-    ## realtime-simulator-impl.h (module 'core'): void ns3::RealtimeSimulatorImpl::ScheduleRealtimeNowWithContext(uint32_t context, ns3::EventImpl * event) [member function]
-    cls.add_method('ScheduleRealtimeNowWithContext', 
-                   'void', 
-                   [param('uint32_t', 'context'), param('ns3::EventImpl *', 'event')])
-    ## realtime-simulator-impl.h (module 'core'): void ns3::RealtimeSimulatorImpl::ScheduleRealtimeWithContext(uint32_t context, ns3::Time const & time, ns3::EventImpl * event) [member function]
-    cls.add_method('ScheduleRealtimeWithContext', 
-                   'void', 
-                   [param('uint32_t', 'context'), param('ns3::Time const &', 'time'), param('ns3::EventImpl *', 'event')])
-    ## realtime-simulator-impl.h (module 'core'): void ns3::RealtimeSimulatorImpl::ScheduleWithContext(uint32_t context, ns3::Time const & time, ns3::EventImpl * event) [member function]
-    cls.add_method('ScheduleWithContext', 
-                   'void', 
-                   [param('uint32_t', 'context'), param('ns3::Time const &', 'time'), param('ns3::EventImpl *', 'event')], 
-                   is_virtual=True)
-    ## realtime-simulator-impl.h (module 'core'): void ns3::RealtimeSimulatorImpl::SetHardLimit(ns3::Time limit) [member function]
-    cls.add_method('SetHardLimit', 
-                   'void', 
-                   [param('ns3::Time', 'limit')])
-    ## realtime-simulator-impl.h (module 'core'): void ns3::RealtimeSimulatorImpl::SetScheduler(ns3::ObjectFactory schedulerFactory) [member function]
-    cls.add_method('SetScheduler', 
-                   'void', 
-                   [param('ns3::ObjectFactory', 'schedulerFactory')], 
-                   is_virtual=True)
-    ## realtime-simulator-impl.h (module 'core'): void ns3::RealtimeSimulatorImpl::SetSynchronizationMode(ns3::RealtimeSimulatorImpl::SynchronizationMode mode) [member function]
-    cls.add_method('SetSynchronizationMode', 
-                   'void', 
-                   [param('ns3::RealtimeSimulatorImpl::SynchronizationMode', 'mode')])
-    ## realtime-simulator-impl.h (module 'core'): void ns3::RealtimeSimulatorImpl::Stop() [member function]
-    cls.add_method('Stop', 
-                   'void', 
-                   [], 
-                   is_virtual=True)
-    ## realtime-simulator-impl.h (module 'core'): void ns3::RealtimeSimulatorImpl::Stop(ns3::Time const & time) [member function]
-    cls.add_method('Stop', 
-                   'void', 
-                   [param('ns3::Time const &', 'time')], 
-                   is_virtual=True)
-    ## realtime-simulator-impl.h (module 'core'): void ns3::RealtimeSimulatorImpl::DoDispose() [member function]
-    cls.add_method('DoDispose', 
-                   'void', 
-                   [], 
-                   visibility='private', is_virtual=True)
-    return
-
 def register_Ns3TimeChecker_methods(root_module, cls):
     ## nstime.h (module 'core'): ns3::TimeChecker::TimeChecker() [constructor]
     cls.add_constructor([])
@@ -4752,7 +4259,7 @@
                    'bool', 
                    [], 
                    is_const=True, is_virtual=True)
-    ## emu-net-device.h (module 'emu'): void ns3::EmuNetDevice::AddLinkChangeCallback(ns3::Callback<void,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty> callback) [member function]
+    ## emu-net-device.h (module 'emu'): void ns3::EmuNetDevice::AddLinkChangeCallback(ns3::Callback<void, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> callback) [member function]
     cls.add_method('AddLinkChangeCallback', 
                    'void', 
                    [param('ns3::Callback< void, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'callback')], 
--- a/src/emu/model/emu-net-device.cc	Wed Apr 11 11:00:27 2012 +0200
+++ b/src/emu/model/emu-net-device.cc	Wed Apr 11 13:49:33 2012 +0200
@@ -49,6 +49,7 @@
 #include <limits>
 #include <stdlib.h>
 #include <time.h>
+#include <unistd.h>
 
 NS_LOG_COMPONENT_DEFINE ("EmuNetDevice");
 
@@ -271,26 +272,6 @@
     }
 
   //
-  // We're going to need a pointer to the realtime simulator implementation.
-  // It's important to remember that access to that implementation may happen 
-  // in a completely different thread than the simulator is running in (we're 
-  // going to spin up that thread below).  We are talking about multiple threads
-  // here, so it is very, very dangerous to do any kind of reference couning on
-  // a shared object that is unaware of what is happening.  What we are going to 
-  // do to address that is to get a reference to the realtime simulator here 
-  // where we are running in the context of a running simulator scheduler --
-  // recall we did a Simulator::Schedule of this method above.  We get the
-  // simulator implementation pointer in a single-threaded way and save the
-  // underlying raw pointer for use by the (other) read thread.  We must not
-  // free this pointer or we may delete the simulator out from under us an 
-  // everyone else.  We assume that the simulator implementation cannot be 
-  // replaced while the emu device is running and so will remain valid through
-  // the time during which the read thread is running.
-  //
-  Ptr<RealtimeSimulatorImpl> impl = DynamicCast<RealtimeSimulatorImpl> (Simulator::GetImplementation ());
-  m_rtImpl = GetPointer (impl);
-
-  //
   // A similar story exists for the node ID.  We can't just naively do a
   // GetNode ()->GetId () since GetNode is going to give us a Ptr<Node> which
   // is reference counted.  We need to stash away the node ID for use in the
@@ -822,8 +803,8 @@
 
       NS_LOG_INFO ("EmuNetDevice::EmuNetDevice(): Received packet on node " << m_nodeId);
       NS_LOG_INFO ("EmuNetDevice::ReadThread(): Scheduling handler");
-      NS_ASSERT_MSG (m_rtImpl, "EmuNetDevice::ReadThread(): Realtime simulator implementation pointer not set");
-      m_rtImpl->ScheduleRealtimeNowWithContext (m_nodeId, MakeEvent (&EmuNetDevice::ForwardUp, this, buf, len));
+      Simulator::ScheduleWithContext (m_nodeId, Seconds (0.0),
+                                      MakeEvent (&EmuNetDevice::ForwardUp, this, buf, len));
       buf = 0;
     }
 }
--- a/src/emu/model/emu-net-device.h	Wed Apr 11 11:00:27 2012 +0200
+++ b/src/emu/model/emu-net-device.h	Wed Apr 11 13:49:33 2012 +0200
@@ -33,7 +33,6 @@
 #include "ns3/mac48-address.h"
 #include "ns3/system-thread.h"
 #include "ns3/system-mutex.h"
-#include "ns3/realtime-simulator-impl.h"
 
 namespace ns3 {
 
@@ -517,12 +516,6 @@
    */
   uint8_t *m_packetBuffer;
 
-  /**
-   * A copy of a raw pointer to the required real-time simulator implementation.
-   * Never free this pointer!
-   */
-  RealtimeSimulatorImpl *m_rtImpl;
-
   /*
    * a copy of the node id so the read thread doesn't have to GetNode() in
    * in order to find the node ID.  Thread unsafe reference counting in 
--- a/src/flow-monitor/bindings/modulegen__gcc_ILP32.py	Wed Apr 11 11:00:27 2012 +0200
+++ b/src/flow-monitor/bindings/modulegen__gcc_ILP32.py	Wed Apr 11 13:49:33 2012 +0200
@@ -3181,6 +3181,11 @@
                    'uint32_t', 
                    [], 
                    is_pure_virtual=True, is_const=True, is_virtual=True)
+    ## socket.h (module 'network'): bool ns3::Socket::IsRecvPktInfo() const [member function]
+    cls.add_method('IsRecvPktInfo', 
+                   'bool', 
+                   [], 
+                   is_const=True)
     ## socket.h (module 'network'): int ns3::Socket::Listen() [member function]
     cls.add_method('Listen', 
                    'int', 
--- a/src/flow-monitor/bindings/modulegen__gcc_LP64.py	Wed Apr 11 11:00:27 2012 +0200
+++ b/src/flow-monitor/bindings/modulegen__gcc_LP64.py	Wed Apr 11 13:49:33 2012 +0200
@@ -3181,6 +3181,11 @@
                    'uint32_t', 
                    [], 
                    is_pure_virtual=True, is_const=True, is_virtual=True)
+    ## socket.h (module 'network'): bool ns3::Socket::IsRecvPktInfo() const [member function]
+    cls.add_method('IsRecvPktInfo', 
+                   'bool', 
+                   [], 
+                   is_const=True)
     ## socket.h (module 'network'): int ns3::Socket::Listen() [member function]
     cls.add_method('Listen', 
                    'int', 
--- a/src/internet/bindings/modulegen__gcc_ILP32.py	Wed Apr 11 11:00:27 2012 +0200
+++ b/src/internet/bindings/modulegen__gcc_ILP32.py	Wed Apr 11 13:49:33 2012 +0200
@@ -7397,6 +7397,11 @@
                    'uint32_t', 
                    [], 
                    is_pure_virtual=True, is_const=True, is_virtual=True)
+    ## socket.h (module 'network'): bool ns3::Socket::IsRecvPktInfo() const [member function]
+    cls.add_method('IsRecvPktInfo', 
+                   'bool', 
+                   [], 
+                   is_const=True)
     ## socket.h (module 'network'): int ns3::Socket::Listen() [member function]
     cls.add_method('Listen', 
                    'int', 
@@ -9904,10 +9909,11 @@
     cls.add_method('GetDefaultRoute', 
                    'ns3::Ipv4RoutingTableEntry', 
                    [])
-    ## ipv4-static-routing.h (module 'internet'): uint32_t ns3::Ipv4StaticRouting::GetMetric(uint32_t index) [member function]
+    ## ipv4-static-routing.h (module 'internet'): uint32_t ns3::Ipv4StaticRouting::GetMetric(uint32_t index) const [member function]
     cls.add_method('GetMetric', 
                    'uint32_t', 
-                   [param('uint32_t', 'index')])
+                   [param('uint32_t', 'index')], 
+                   is_const=True)
     ## ipv4-static-routing.h (module 'internet'): ns3::Ipv4MulticastRoutingTableEntry ns3::Ipv4StaticRouting::GetMulticastRoute(uint32_t i) const [member function]
     cls.add_method('GetMulticastRoute', 
                    'ns3::Ipv4MulticastRoutingTableEntry', 
--- a/src/internet/bindings/modulegen__gcc_LP64.py	Wed Apr 11 11:00:27 2012 +0200
+++ b/src/internet/bindings/modulegen__gcc_LP64.py	Wed Apr 11 13:49:33 2012 +0200
@@ -7397,6 +7397,11 @@
                    'uint32_t', 
                    [], 
                    is_pure_virtual=True, is_const=True, is_virtual=True)
+    ## socket.h (module 'network'): bool ns3::Socket::IsRecvPktInfo() const [member function]
+    cls.add_method('IsRecvPktInfo', 
+                   'bool', 
+                   [], 
+                   is_const=True)
     ## socket.h (module 'network'): int ns3::Socket::Listen() [member function]
     cls.add_method('Listen', 
                    'int', 
@@ -9904,10 +9909,11 @@
     cls.add_method('GetDefaultRoute', 
                    'ns3::Ipv4RoutingTableEntry', 
                    [])
-    ## ipv4-static-routing.h (module 'internet'): uint32_t ns3::Ipv4StaticRouting::GetMetric(uint32_t index) [member function]
+    ## ipv4-static-routing.h (module 'internet'): uint32_t ns3::Ipv4StaticRouting::GetMetric(uint32_t index) const [member function]
     cls.add_method('GetMetric', 
                    'uint32_t', 
-                   [param('uint32_t', 'index')])
+                   [param('uint32_t', 'index')], 
+                   is_const=True)
     ## ipv4-static-routing.h (module 'internet'): ns3::Ipv4MulticastRoutingTableEntry ns3::Ipv4StaticRouting::GetMulticastRoute(uint32_t i) const [member function]
     cls.add_method('GetMulticastRoute', 
                    'ns3::Ipv4MulticastRoutingTableEntry', 
--- a/src/internet/helper/ipv6-routing-helper.cc	Wed Apr 11 11:00:27 2012 +0200
+++ b/src/internet/helper/ipv6-routing-helper.cc	Wed Apr 11 13:49:33 2012 +0200
@@ -18,6 +18,10 @@
  * Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
  */
 
+#include "ns3/node.h"
+#include "ns3/node-list.h"
+#include "ns3/simulator.h"
+#include "ns3/ipv6-routing-protocol.h"
 #include "ipv6-routing-helper.h"
 
 namespace ns3 {
@@ -26,4 +30,55 @@
 {
 }
 
+void
+Ipv6RoutingHelper::PrintRoutingTableAllAt (Time printTime, Ptr<OutputStreamWrapper> stream) const
+{
+  for (uint32_t i = 0; i < NodeList::GetNNodes (); i++)
+    {
+      Ptr<Node> node = NodeList::GetNode (i);
+      Simulator::Schedule (printTime, &Ipv6RoutingHelper::Print, this, node, stream);
+    }
+}
+
+void
+Ipv6RoutingHelper::PrintRoutingTableAllEvery (Time printInterval, Ptr<OutputStreamWrapper> stream) const
+{
+  for (uint32_t i = 0; i < NodeList::GetNNodes (); i++)
+    {
+      Ptr<Node> node = NodeList::GetNode (i);
+      Simulator::Schedule (printInterval, &Ipv6RoutingHelper::PrintEvery, this, printInterval, node, stream);
+    }
+}
+
+void
+Ipv6RoutingHelper::PrintRoutingTableAt (Time printTime, Ptr<Node> node, Ptr<OutputStreamWrapper> stream) const
+{
+  Simulator::Schedule (printTime, &Ipv6RoutingHelper::Print, this, node, stream);
+}
+
+void
+Ipv6RoutingHelper::PrintRoutingTableEvery (Time printInterval,Ptr<Node> node, Ptr<OutputStreamWrapper> stream) const
+{
+  Simulator::Schedule (printInterval, &Ipv6RoutingHelper::PrintEvery, this, printInterval, node, stream);
+}
+
+void
+Ipv6RoutingHelper::Print (Ptr<Node> node, Ptr<OutputStreamWrapper> stream) const
+{
+  Ptr<Ipv6> ipv6 = node->GetObject<Ipv6> ();
+  Ptr<Ipv6RoutingProtocol> rp = ipv6->GetRoutingProtocol ();
+  NS_ASSERT (rp);
+  rp->PrintRoutingTable (stream);
+}
+
+void
+Ipv6RoutingHelper::PrintEvery (Time printInterval, Ptr<Node> node, Ptr<OutputStreamWrapper> stream) const
+{
+  Ptr<Ipv6> ipv6 = node->GetObject<Ipv6> ();
+  Ptr<Ipv6RoutingProtocol> rp = ipv6->GetRoutingProtocol ();
+  NS_ASSERT (rp);
+  rp->PrintRoutingTable (stream);
+  Simulator::Schedule (printInterval, &Ipv6RoutingHelper::PrintEvery, this, printInterval, node, stream);
+}
+
 } // namespace ns3
--- a/src/internet/helper/ipv6-routing-helper.h	Wed Apr 11 11:00:27 2012 +0200
+++ b/src/internet/helper/ipv6-routing-helper.h	Wed Apr 11 13:49:33 2012 +0200
@@ -22,6 +22,8 @@
 #define IPV6_ROUTING_HELPER_H
 
 #include "ns3/ptr.h"
+#include "ns3/nstime.h"
+#include "ns3/output-stream-wrapper.h"
 
 namespace ns3 {
 
@@ -61,6 +63,56 @@
    * \returns a newly-created routing protocol
    */
   virtual Ptr<Ipv6RoutingProtocol> Create (Ptr<Node> node) const = 0;
+
+  /**
+   * \brief prints the routing tables of all nodes at a particular time.
+   * \param printTime the time at which the routing table is supposed to be printed.
+   * \param stream The output stream object to use
+   *
+   * This method calls the PrintRoutingTable() method of the
+   * Ipv6RoutingProtocol stored in the Ipv6 object, for all nodes at the
+   * specified time; the output format is routing protocol-specific.
+   */
+  void PrintRoutingTableAllAt (Time printTime, Ptr<OutputStreamWrapper> stream) const;
+
+  /**
+   * \brief prints the routing tables of all nodes at regular intervals specified by user.
+   * \param printInterval the time interval for which the routing table is supposed to be printed.
+   * \param stream The output stream object to use
+   *
+   * This method calls the PrintRoutingTable() method of the
+   * Ipv6RoutingProtocol stored in the Ipv6 object, for all nodes at the
+   * specified time interval; the output format is routing protocol-specific.
+   */
+  void PrintRoutingTableAllEvery (Time printInterval, Ptr<OutputStreamWrapper> stream) const;
+
+  /**
+   * \brief prints the routing tables of a node at a particular time.
+   * \param printTime the time at which the routing table is supposed to be printed.
+   * \param node The node ptr for which we need the routing table to be printed
+   * \param stream The output stream object to use
+   *
+   * This method calls the PrintRoutingTable() method of the
+   * Ipv6RoutingProtocol stored in the Ipv6 object, for the selected node
+   * at the specified time; the output format is routing protocol-specific.
+   */
+  void PrintRoutingTableAt (Time printTime, Ptr<Node> node, Ptr<OutputStreamWrapper> stream) const;
+
+  /**
+   * \brief prints the routing tables of a node at regular intervals specified by user.
+   * \param printInterval the time interval for which the routing table is supposed to be printed.
+   * \param node The node ptr for which we need the routing table to be printed
+   * \param stream The output stream object to use
+   *
+   * This method calls the PrintRoutingTable() method of the
+   * Ipv6RoutingProtocol stored in the Ipv6 object, for the selected node
+   * at the specified interval; the output format is routing protocol-specific.
+   */
+  void PrintRoutingTableEvery (Time printInterval, Ptr<Node> node, Ptr<OutputStreamWrapper> stream) const;
+
+private:
+  void Print (Ptr<Node> node, Ptr<OutputStreamWrapper> stream) const;
+  void PrintEvery (Time printInterval, Ptr<Node> node, Ptr<OutputStreamWrapper> stream) const;
 };
 
 } // namespace ns3
--- a/src/internet/model/icmpv6-l4-protocol.cc	Wed Apr 11 11:00:27 2012 +0200
+++ b/src/internet/model/icmpv6-l4-protocol.cc	Wed Apr 11 13:49:33 2012 +0200
@@ -18,6 +18,7 @@
  * Author: Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
  *         David Gross <gdavid.devel@gmail.com>
  *         Mehdi Benamor <benamor.mehdi@ensi.rnu.tn>
+ *         Tommaso Pecorella <tommaso.pecorella@unifi.it>
  */
 
 #include "ns3/log.h"
@@ -34,8 +35,7 @@
 #include "icmpv6-l4-protocol.h"
 #include "ndisc-cache.h"
 
-namespace ns3
-{
+namespace ns3 {
 
 NS_OBJECT_ENSURE_REGISTERED (Icmpv6L4Protocol);
 
@@ -97,7 +97,7 @@
       cache = 0;
     }
   m_cacheList.clear ();
-  m_downTarget.Nullify();
+  m_downTarget.Nullify ();
 
   m_node = 0;
   IpL4Protocol::DoDispose ();
@@ -114,11 +114,11 @@
           Ptr<Ipv6L3Protocol> ipv6 = this->GetObject<Ipv6L3Protocol> ();
           if (ipv6 != 0)
             {
-              this->SetNode (node);
+              SetNode (node);
               ipv6->Insert (this);
               Ptr<Ipv6RawSocketFactoryImpl> rawFactory = CreateObject<Ipv6RawSocketFactoryImpl> ();
               ipv6->AggregateObject (rawFactory);
-              this->SetDownTarget6 (MakeCallback (&Ipv6L3Protocol::Send, ipv6));
+              SetDownTarget6 (MakeCallback (&Ipv6L3Protocol::Send, ipv6));
             }
         }
     }
@@ -162,9 +162,9 @@
 
   NS_ASSERT (ipv6);
 
-  if(!m_alwaysDad)
+  if (!m_alwaysDad)
     {
-      return; 
+      return;
     }
 
   /* TODO : disable multicast loopback to prevent NS probing to be received by the sender */
@@ -192,7 +192,7 @@
   uint8_t type;
   p->CopyData (&type, sizeof(type));
 
-  switch (type) 
+  switch (type)
     {
     case Icmpv6Header::ICMPV6_ND_ROUTER_SOLICITATION:
       if (ipv6->IsForwarding (ipv6->GetInterfaceForDevice (interface->GetDevice ())))
@@ -219,14 +219,21 @@
       HandleEchoRequest (p, src, dst, interface);
       break;
     case Icmpv6Header::ICMPV6_ECHO_REPLY:
+      // EchoReply does not contain any info about L4
+      // so we can not forward it up.
+      // TODO: implement request / reply consistency check.
       break;
     case Icmpv6Header::ICMPV6_ERROR_DESTINATION_UNREACHABLE:
+      HandleDestinationUnreachable (p, src, dst, interface);
       break;
     case Icmpv6Header::ICMPV6_ERROR_PACKET_TOO_BIG:
+      HandlePacketTooBig (p, src, dst, interface);
       break;
     case Icmpv6Header::ICMPV6_ERROR_TIME_EXCEEDED:
+      HandleTimeExceeded (p, src, dst, interface);
       break;
     case Icmpv6Header::ICMPV6_ERROR_PARAMETER_ERROR:
+      HandleParameterError (p, src, dst, interface);
       break;
     default:
       NS_LOG_LOGIC ("Unknown ICMPv6 message type=" << type);
@@ -236,6 +243,24 @@
   return IpL4Protocol::RX_OK;
 }
 
+void Icmpv6L4Protocol::Forward (Ipv6Address source, Icmpv6Header icmp,
+                                uint32_t info, Ipv6Header ipHeader,
+                                const uint8_t payload[8])
+{
+  Ptr<Ipv6L3Protocol> ipv6 = m_node->GetObject<Ipv6L3Protocol> ();
+
+  // TODO assuming the ICMP is carrying a extensionless IP packet
+
+  uint8_t nextHeader = ipHeader.GetNextHeader ();
+
+  Ptr<IpL4Protocol> l4 = ipv6->GetProtocol (nextHeader);
+  if (l4 != 0)
+    {
+      l4->ReceiveIcmp (source, ipHeader.GetHopLimit (), icmp.GetType (), icmp.GetCode (),
+                       info, ipHeader.GetSourceAddress (), ipHeader.GetDestinationAddress (), payload);
+    }
+}
+
 void Icmpv6L4Protocol::HandleEchoRequest (Ptr<Packet> packet, Ipv6Address const &src, Ipv6Address const &dst, Ptr<Ipv6Interface> interface)
 {
   NS_LOG_FUNCTION (this << packet << src << dst << interface);
@@ -253,7 +278,7 @@
 }
 
 void Icmpv6L4Protocol::HandleRA (Ptr<Packet> packet, Ipv6Address const &src, Ipv6Address const &dst, Ptr<Ipv6Interface> interface)
-{ 
+{
   NS_LOG_FUNCTION (this << packet << src << dst << interface);
   Ptr<Packet> p = packet->Copy ();
   Icmpv6RA raHeader;
@@ -276,7 +301,7 @@
         {
         case Icmpv6Header::ICMPV6_OPT_PREFIX:
           p->RemoveHeader (prefixHdr);
-          ipv6->AddAutoconfiguredAddress (ipv6->GetInterfaceForDevice (interface->GetDevice ()), prefixHdr.GetPrefix (), prefixHdr.GetPrefixLength (), 
+          ipv6->AddAutoconfiguredAddress (ipv6->GetInterfaceForDevice (interface->GetDevice ()), prefixHdr.GetPrefix (), prefixHdr.GetPrefixLength (),
                                           prefixHdr.GetFlags (), prefixHdr.GetValidTime (), prefixHdr.GetPreferredTime (), src);
           break;
         case Icmpv6Header::ICMPV6_OPT_MTU:
@@ -312,7 +337,7 @@
   NdiscCache::Entry* entry = 0;
   Ptr<NdiscCache> cache = FindCache (interface->GetDevice ());
 
-  /* check if we have this address in our cache */ 
+  /* check if we have this address in our cache */
   entry = cache->Lookup (src);
 
   if (!entry)
@@ -329,11 +354,11 @@
       if (entry->IsIncomplete ())
         {
           entry->StopRetransmitTimer ();
-          // mark it to reachable 
+          // mark it to reachable
           waiting = entry->MarkReachable (lla.GetAddress ());
           entry->StopReachableTimer ();
           entry->StartReachableTimer ();
-          // send out waiting packet 
+          // send out waiting packet
           for (std::list<Ptr<Packet> >::const_iterator it = waiting.begin (); it != waiting.end (); it++)
             {
               cache->GetInterface ()->Send (*it, src);
@@ -342,7 +367,7 @@
         }
       else
         {
-          if (entry->GetMacAddress ()!=lla.GetAddress ())
+          if (entry->GetMacAddress () != lla.GetAddress ())
             {
               entry->SetMacAddress (lla.GetAddress ());
               entry->MarkStale ();
@@ -497,7 +522,7 @@
 
   hardwareAddress = interface->GetDevice ()->GetAddress ();
   Ptr<Packet> p = ForgeNA (target.IsLinkLocal () ? interface->GetLinkLocalAddress ().GetAddress () : ifaddr.GetAddress (), src.IsAny () ? Ipv6Address::GetAllNodesMulticast () : src, &hardwareAddress, flags );
-  interface->Send (p,  src.IsAny () ? Ipv6Address::GetAllNodesMulticast () : src); 
+  interface->Send (p,  src.IsAny () ? Ipv6Address::GetAllNodesMulticast () : src);
 
   /* not a NS for us discard it */
 }
@@ -633,7 +658,7 @@
       entry->StopDelayTimer ();
 
       /* if the Flag O is clear and mac address differs from the cache */
-      if (!naHeader.GetFlagO () && lla.GetAddress ()!=entry->GetMacAddress ())
+      if (!naHeader.GetFlagO () && lla.GetAddress () != entry->GetMacAddress ())
         {
           if (entry->IsReachable ())
             {
@@ -656,7 +681,7 @@
                           waiting = entry->MarkReachable (lla.GetAddress ());
                           for (std::list<Ptr<Packet> >::const_iterator it = waiting.begin (); it != waiting.end (); it++)
                             {
-                              cache->GetInterface ()->Send (*it, src); 
+                              cache->GetInterface ()->Send (*it, src);
                             }
                           entry->ClearWaitingPacket ();
                         }
@@ -668,7 +693,7 @@
                   entry->StopReachableTimer ();
                   entry->StartReachableTimer ();
                 }
-              else if (lla.GetAddress ()!=entry->GetMacAddress ())
+              else if (lla.GetAddress () != entry->GetMacAddress ())
                 {
                   entry->MarkStale ();
                 }
@@ -723,7 +748,7 @@
           if (entry->IsIncomplete () || entry->GetMacAddress () != llOptionHeader.GetAddress ())
             {
               /* update entry to STALE */
-              if (entry->GetMacAddress ()!=llOptionHeader.GetAddress ())
+              if (entry->GetMacAddress () != llOptionHeader.GetAddress ())
                 {
                   entry->SetMacAddress (llOptionHeader.GetAddress ());
                   entry->MarkStale ();
@@ -750,6 +775,73 @@
     }
 }
 
+void Icmpv6L4Protocol::HandleDestinationUnreachable (Ptr<Packet> p, Ipv6Address const &src, Ipv6Address const &dst, Ptr<Ipv6Interface> interface)
+{
+  NS_LOG_FUNCTION (this << *p << src << dst);
+  Ptr<Packet> pkt = p->Copy ();
+
+  Icmpv6DestinationUnreachable unreach;
+  pkt->RemoveHeader (unreach);
+  Ptr<Packet> origPkt = unreach.GetPacket ();
+
+  Ipv6Header ipHeader;
+  if ( origPkt->GetSerializedSize () > ipHeader.GetSerializedSize () )
+    {
+      origPkt->RemoveHeader (ipHeader);
+      uint8_t payload[8];
+      origPkt->CopyData (payload, 8);
+      Forward (src, unreach, unreach.GetCode (), ipHeader, payload);
+    }
+}
+
+void Icmpv6L4Protocol::HandleTimeExceeded (Ptr<Packet> p, Ipv6Address const &src, Ipv6Address const &dst, Ptr<Ipv6Interface> interface)
+{
+  NS_LOG_FUNCTION (this << *p << src << dst);
+  Ptr<Packet> pkt = p->Copy ();
+
+  Icmpv6TimeExceeded timeexceeded;
+  pkt->RemoveHeader (timeexceeded);
+  Ptr<Packet> origPkt = timeexceeded.GetPacket ();
+  Ipv6Header ipHeader;
+  uint8_t payload[8];
+  origPkt->RemoveHeader (ipHeader);
+  origPkt->CopyData (payload, 8);
+
+  Forward (src, timeexceeded, timeexceeded.GetCode (), ipHeader, payload);
+}
+
+void Icmpv6L4Protocol::HandlePacketTooBig (Ptr<Packet> p, Ipv6Address const &src, Ipv6Address const &dst, Ptr<Ipv6Interface> interface)
+{
+  NS_LOG_FUNCTION (this << *p << src << dst);
+  Ptr<Packet> pkt = p->Copy ();
+
+  Icmpv6TooBig tooBig;
+  pkt->RemoveHeader (tooBig);
+  Ptr<Packet> origPkt = tooBig.GetPacket ();
+
+  Ipv6Header ipHeader;
+  origPkt->RemoveHeader (ipHeader);
+  uint8_t payload[8];
+  origPkt->CopyData (payload, 8);
+  Forward (src, tooBig, tooBig.GetMtu (), ipHeader, payload);
+}
+
+void Icmpv6L4Protocol::HandleParameterError (Ptr<Packet> p, Ipv6Address const &src, Ipv6Address const &dst, Ptr<Ipv6Interface> interface)
+{
+  NS_LOG_FUNCTION (this << *p << src << dst);
+  Ptr<Packet> pkt = p->Copy ();
+
+  Icmpv6ParameterError paramErr;
+  pkt->RemoveHeader (paramErr);
+  Ptr<Packet> origPkt = paramErr.GetPacket ();
+
+  Ipv6Header ipHeader;
+  origPkt->RemoveHeader (ipHeader);
+  uint8_t payload[8];
+  origPkt->CopyData (payload, 8);
+  Forward (src, paramErr, paramErr.GetCode (), ipHeader, payload);
+}
+
 void Icmpv6L4Protocol::SendMessage (Ptr<Packet> packet, Ipv6Address src, Ipv6Address dst, uint8_t ttl)
 {
   NS_LOG_FUNCTION (this << packet << src << dst << (uint32_t)ttl);
@@ -851,7 +943,7 @@
       dst = Ipv6Address::GetAllNodesMulticast ();
     }
 
-  NS_LOG_LOGIC ("Send NS ( from " << src << " to " << dst << " target " << target <<")");
+  NS_LOG_LOGIC ("Send NS ( from " << src << " to " << dst << " target " << target << ")");
 
   p->AddHeader (llOption);
   ns.CalculatePseudoHeaderChecksum (src, dst, p->GetSize () + ns.GetSerializedSize (), PROT_NUMBER);
@@ -930,7 +1022,7 @@
 
 void Icmpv6L4Protocol::SendErrorTimeExceeded (Ptr<Packet> malformedPacket, Ipv6Address dst, uint8_t code)
 {
-  NS_LOG_FUNCTION (this<< malformedPacket << dst << code);
+  NS_LOG_FUNCTION (this << malformedPacket << dst << code);
   Ptr<Packet> p = Create<Packet> ();
   uint32_t malformedPacketSize = malformedPacket->GetSize ();
   Icmpv6TimeExceeded header;
@@ -938,7 +1030,7 @@
   NS_LOG_LOGIC ("Send Time Exceeded ( to " << dst << " code " << (uint32_t)code << " )");
 
   /* 48 = sizeof IPv6 header + sizeof ICMPv6 error header */
-  if (malformedPacketSize <= 1280 - 48) 
+  if (malformedPacketSize <= 1280 - 48)
     {
       header.SetPacket (malformedPacket);
     }
@@ -962,7 +1054,7 @@
   NS_LOG_LOGIC ("Send Parameter Error ( to " << dst << " code " << (uint32_t)code << " )");
 
   /* 48 = sizeof IPv6 header + sizeof ICMPv6 error header */
-  if (malformedPacketSize <= 1280 -48 )
+  if (malformedPacketSize <= 1280 - 48 )
     {
       header.SetPacket (malformedPacket);
     }
@@ -992,7 +1084,7 @@
   if ((redirectedPacketSize % 8) != 0)
     {
       Ptr<Packet> pad = Create<Packet> (8 - (redirectedPacketSize % 8));
-      redirectedPacket->AddAtEnd (pad); 
+      redirectedPacket->AddAtEnd (pad);
     }
 
   if (redirHardwareTarget.GetLength ())
@@ -1081,7 +1173,7 @@
       dst = Ipv6Address::GetAllNodesMulticast ();
     }
 
-  NS_LOG_LOGIC ("Send NS ( from " << src << " to " << dst << " target " << target <<")");
+  NS_LOG_LOGIC ("Send NS ( from " << src << " to " << dst << " target " << target << ")");
 
   p->AddHeader (llOption);
   ns.CalculatePseudoHeaderChecksum (src, dst, p->GetSize () + ns.GetSerializedSize (), PROT_NUMBER);
@@ -1196,7 +1288,7 @@
       else
         {
           /* find source address that match destination */
-          addr = cache->GetInterface ()->GetAddressMatchingDestination (dst).GetAddress (); 
+          addr = cache->GetInterface ()->GetAddressMatchingDestination (dst).GetAddress ();
         }
 
       SendNS (addr, Ipv6Address::MakeSolicitedAddress (dst), dst, cache->GetDevice ()->GetAddress ());
@@ -1229,7 +1321,7 @@
         }
     }
 
-  /* for the moment, this function is always called, if we was victim of a DAD the address is INVALID 
+  /* for the moment, this function is always called, if we was victim of a DAD the address is INVALID
    * and we do not set it to PREFERRED
    */
   if (found && ifaddr.GetState () != Ipv6InterfaceAddress::INVALID)
@@ -1242,9 +1334,9 @@
        */
       Ptr<Ipv6> ipv6 = icmpv6->m_node->GetObject<Ipv6> ();
 
-      if (!ipv6->IsForwarding (ipv6->GetInterfaceForDevice (interface->GetDevice ())) && addr.IsLinkLocal ()) 
+      if (!ipv6->IsForwarding (ipv6->GetInterfaceForDevice (interface->GetDevice ())) && addr.IsLinkLocal ())
         {
-          /* XXX because all nodes start at the same time, there will be many of RS arround 1 second of simulation time 
+          /* XXX because all nodes start at the same time, there will be many of RS arround 1 second of simulation time
            * TODO Add random delays before sending RS
            */
           Simulator::Schedule (Seconds (0.0), &Icmpv6L4Protocol::SendRS, PeekPointer (icmpv6), ifaddr.GetAddress (), Ipv6Address::GetAllRoutersMulticast (), interface->GetDevice ()->GetAddress ());
--- a/src/internet/model/icmpv6-l4-protocol.h	Wed Apr 11 11:00:27 2012 +0200
+++ b/src/internet/model/icmpv6-l4-protocol.h	Wed Apr 11 13:49:33 2012 +0200
@@ -29,8 +29,7 @@
 #include "icmpv6-header.h"
 #include "ip-l4-protocol.h"
 
-namespace ns3
-{
+namespace ns3 {
 
 class NetDevice;
 class Node;
@@ -194,7 +193,7 @@
    * \brief Send a packet via ICMPv6.
    * \param packet the packet to send
    * \param dst destination address
-   * \param icmpv6Hdr ICMPv6 header (needed to calculate checksum 
+   * \param icmpv6Hdr ICMPv6 header (needed to calculate checksum
    * after source address is determined by routing stuff
    * \param ttl next hop limit
    */
@@ -202,8 +201,8 @@
 
   /**
    * \brief Do the Duplication Address Detection (DAD).
-   * It consists in sending a NS with our IPv6 as target. If 
-   * we received a NA with matched target address, we could not use 
+   * It consists in sending a NS with our IPv6 as target. If
+   * we received a NA with matched target address, we could not use
    * the address, else the address pass from TENTATIVE to PERMANENT.
    *
    * \param target target address
@@ -325,13 +324,20 @@
   /**
    * \brief Receive method.
    * \param p the packet
-   * \param src source address
-   * \param dst destination address
+   * \param header the IPv4 header
    * \param interface the interface from which the packet is coming
    */
   virtual enum IpL4Protocol::RxStatus Receive (Ptr<Packet> p,
                                                Ipv4Header const &header,
                                                Ptr<Ipv4Interface> interface);
+
+  /**
+   * \brief Receive method.
+   * \param p the packet
+   * \param src source address
+   * \param dst destination address
+   * \param interface the interface from which the packet is coming
+   */
   virtual enum IpL4Protocol::RxStatus Receive (Ptr<Packet> p,
                                                Ipv6Address &src, Ipv6Address &dst,
                                                Ptr<Ipv6Interface> interface);
@@ -396,7 +402,6 @@
   virtual void DoDispose ();
 
 private:
-
   typedef std::list<Ptr<NdiscCache> > CacheList;
 
   /**
@@ -415,6 +420,18 @@
   bool m_alwaysDad;
 
   /**
+   * \brief Notify an ICMPv6 reception to upper layers (if requested).
+   * \param source the ICMP source
+   * \param icmp the ICMP header
+   * \param info information about the ICMP
+   * \param ipHeader the IP header carried by the ICMP
+   * \param payload the data carried by the ICMP
+   */
+  void Forward (Ipv6Address source, Icmpv6Header icmp,
+                uint32_t info, Ipv6Header ipHeader,
+                const uint8_t payload[8]);
+
+  /**
    * \brief Receive Neighbor Solicitation method.
    * \param p the packet
    * \param src source address
@@ -469,6 +486,42 @@
   void HandleRedirection (Ptr<Packet> p, Ipv6Address const &src, Ipv6Address const &dst, Ptr<Ipv6Interface> interface);
 
   /**
+   * \brief Receive Destination Unreachable method.
+   * \param p the packet
+   * \param src source address
+   * \param dst destination address
+   * \param interface the interface from which the packet is coming
+   */
+  void HandleDestinationUnreachable (Ptr<Packet> p, Ipv6Address const &src, Ipv6Address const &dst, Ptr<Ipv6Interface> interface);
+
+  /**
+   * \brief Receive Time Exceeded method.
+   * \param p the packet
+   * \param src source address
+   * \param dst destination address
+   * \param interface the interface from which the packet is coming
+   */
+  void HandleTimeExceeded (Ptr<Packet> p, Ipv6Address const &src, Ipv6Address const &dst, Ptr<Ipv6Interface> interface);
+
+  /**
+   * \brief Receive Packet Too Big method.
+   * \param p the packet
+   * \param src source address
+   * \param dst destination address
+   * \param interface the interface from which the packet is coming
+   */
+  void HandlePacketTooBig (Ptr<Packet> p, Ipv6Address const &src, Ipv6Address const &dst, Ptr<Ipv6Interface> interface);
+
+  /**
+   * \brief Receive Parameter Error method.
+   * \param p the packet
+   * \param src source address
+   * \param dst destination address
+   * \param interface the interface from which the packet is coming
+   */
+  void HandleParameterError (Ptr<Packet> p, Ipv6Address const &src, Ipv6Address const &dst, Ptr<Ipv6Interface> interface);
+
+  /**
    * \brief Link layer address option processing.
    * \param lla LLA option
    * \param src source address
--- a/src/internet/model/ipv4-l3-protocol.cc	Wed Apr 11 11:00:27 2012 +0200
+++ b/src/internet/model/ipv4-l3-protocol.cc	Wed Apr 11 13:49:33 2012 +0200
@@ -504,8 +504,6 @@
       NS_LOG_WARN ("No route found for forwarding packet.  Drop.");
       m_dropTrace (ipHeader, packet, DROP_NO_ROUTE, m_node->GetObject<Ipv4> (), interface);
     }
-
-
 }
 
 Ptr<Icmpv4L4Protocol> 
--- a/src/internet/model/ipv4-packet-info-tag.cc	Wed Apr 11 11:00:27 2012 +0200
+++ b/src/internet/model/ipv4-packet-info-tag.cc	Wed Apr 11 13:49:33 2012 +0200
@@ -121,9 +121,9 @@
 { 
   uint8_t buf[4];
   i.Read (buf, 4);
-  m_addr.Deserialize (buf);
+  m_addr = Ipv4Address::Deserialize (buf);
   i.Read (buf, 4);
-  m_spec_dst.Deserialize (buf);
+  m_spec_dst = Ipv4Address::Deserialize (buf);
   m_ifindex = i.ReadU32 ();
   m_ttl = i.ReadU8 ();
 }
--- a/src/internet/model/ipv4-raw-socket-impl.cc	Wed Apr 11 11:00:27 2012 +0200
+++ b/src/internet/model/ipv4-raw-socket-impl.cc	Wed Apr 11 13:49:33 2012 +0200
@@ -318,7 +318,7 @@
     {
       Ptr<Packet> copy = p->Copy ();
       // Should check via getsockopt ()..
-      if (this->m_recvpktinfo)
+      if (IsRecvPktInfo ())
         {
           Ipv4PacketInfoTag tag;
           copy->RemovePacketTag (tag);
--- a/src/internet/model/ipv4-routing-protocol.h	Wed Apr 11 11:00:27 2012 +0200
+++ b/src/internet/model/ipv4-routing-protocol.h	Wed Apr 11 13:49:33 2012 +0200
@@ -142,6 +142,11 @@
    */
   virtual void SetIpv4 (Ptr<Ipv4> ipv4) = 0;
 
+  /**
+   * \brief Print the Routing Table entries
+   *
+   * \param stream the ostream the Routing table is printed to
+   */
   virtual void PrintRoutingTable (Ptr<OutputStreamWrapper> stream) const = 0;
 };
 
--- a/src/internet/model/ipv4-static-routing.cc	Wed Apr 11 11:00:27 2012 +0200
+++ b/src/internet/model/ipv4-static-routing.cc	Wed Apr 11 13:49:33 2012 +0200
@@ -413,11 +413,11 @@
 }
 
 uint32_t
-Ipv4StaticRouting::GetMetric (uint32_t index)
+Ipv4StaticRouting::GetMetric (uint32_t index) const
 {
   NS_LOG_FUNCTION (this << index);
   uint32_t tmp = 0;
-  for (NetworkRoutesI j = m_networkRoutes.begin (); 
+  for (NetworkRoutesCI j = m_networkRoutes.begin ();
        j != m_networkRoutes.end (); 
        j++) 
     {
@@ -700,7 +700,6 @@
         }
     }
 }
-
 // Formatted like output of "route -n" command
 void
 Ipv4StaticRouting::PrintRoutingTable (Ptr<OutputStreamWrapper> stream) const
@@ -713,11 +712,11 @@
         {
           std::ostringstream dest, gw, mask, flags;
           Ipv4RoutingTableEntry route = GetRoute (j);
-          dest << route.GetDest (); 
+          dest << route.GetDest ();
           *os << std::setiosflags (std::ios::left) << std::setw (16) << dest.str ();
-          gw << route.GetGateway (); 
+          gw << route.GetGateway ();
           *os << std::setiosflags (std::ios::left) << std::setw (16) << gw.str ();
-          mask << route.GetDestNetworkMask (); 
+          mask << route.GetDestNetworkMask ();
           *os << std::setiosflags (std::ios::left) << std::setw (16) << mask.str ();
           flags << "U";
           if (route.IsHost ())
@@ -729,8 +728,7 @@
               flags << "GS";
             }
           *os << std::setiosflags (std::ios::left) << std::setw (6) << flags.str ();
-          // Metric not implemented
-          *os << "-" << "      ";
+          *os << std::setiosflags (std::ios::left) << std::setw (7) << GetMetric (j);
           // Ref ct not implemented
           *os << "-" << "      ";
           // Use not implemented
@@ -747,7 +745,6 @@
         }
     }
 }
-
 Ipv4Address
 Ipv4StaticRouting::SourceAddressSelection (uint32_t interfaceIdx, Ipv4Address dest)
 {
--- a/src/internet/model/ipv4-static-routing.h	Wed Apr 11 11:00:27 2012 +0200
+++ b/src/internet/model/ipv4-static-routing.h	Wed Apr 11 13:49:33 2012 +0200
@@ -213,7 +213,7 @@
  * \return If route is set, the metric is returned. If not, an infinity metric (0xffffffff) is returned
  *
  */
-  uint32_t GetMetric (uint32_t index);
+  uint32_t GetMetric (uint32_t index) const;
 
 /**
  * \brief Remove a route from the static unicast routing table.
--- a/src/internet/model/ipv6-end-point-demux.cc	Wed Apr 11 11:00:27 2012 +0200
+++ b/src/internet/model/ipv6-end-point-demux.cc	Wed Apr 11 13:49:33 2012 +0200
@@ -22,13 +22,14 @@
 #include "ipv6-end-point.h"
 #include "ns3/log.h"
 
-namespace ns3
-{
+namespace ns3 {
 
 NS_LOG_COMPONENT_DEFINE ("Ipv6EndPointDemux");
 
 Ipv6EndPointDemux::Ipv6EndPointDemux ()
-  : m_ephemeral (49152)
+  : m_ephemeral (49152),
+    m_portFirst (49152),
+    m_portLast (65535)
 {
   NS_LOG_FUNCTION_NOARGS ();
 }
@@ -36,7 +37,7 @@
 Ipv6EndPointDemux::~Ipv6EndPointDemux ()
 {
   NS_LOG_FUNCTION_NOARGS ();
-  for (EndPointsI i = m_endPoints.begin (); i != m_endPoints.end (); i++) 
+  for (EndPointsI i = m_endPoints.begin (); i != m_endPoints.end (); i++)
     {
       Ipv6EndPoint *endPoint = *i;
       delete endPoint;
@@ -47,9 +48,9 @@
 bool Ipv6EndPointDemux::LookupPortLocal (uint16_t port)
 {
   NS_LOG_FUNCTION (this << port);
-  for (EndPointsI i = m_endPoints.begin (); i != m_endPoints.end (); i++) 
+  for (EndPointsI i = m_endPoints.begin (); i != m_endPoints.end (); i++)
     {
-      if ((*i)->GetLocalPort  () == port) 
+      if ((*i)->GetLocalPort  () == port)
         {
           return true;
         }
@@ -60,10 +61,10 @@
 bool Ipv6EndPointDemux::LookupLocal (Ipv6Address addr, uint16_t port)
 {
   NS_LOG_FUNCTION (this << addr << port);
-  for (EndPointsI i = m_endPoints.begin (); i != m_endPoints.end (); i++) 
+  for (EndPointsI i = m_endPoints.begin (); i != m_endPoints.end (); i++)
     {
-      if ((*i)->GetLocalPort () == port &&
-          (*i)->GetLocalAddress () == addr) 
+      if ((*i)->GetLocalPort () == port
+          && (*i)->GetLocalAddress () == addr)
         {
           return true;
         }
@@ -75,7 +76,7 @@
 {
   NS_LOG_FUNCTION_NOARGS ();
   uint16_t port = AllocateEphemeralPort ();
-  if (port == 0) 
+  if (port == 0)
     {
       NS_LOG_WARN ("Ephemeral port allocation failed.");
       return 0;
@@ -90,7 +91,7 @@
 {
   NS_LOG_FUNCTION (this << address);
   uint16_t port = AllocateEphemeralPort ();
-  if (port == 0) 
+  if (port == 0)
     {
       NS_LOG_WARN ("Ephemeral port allocation failed.");
       return 0;
@@ -111,7 +112,7 @@
 Ipv6EndPoint* Ipv6EndPointDemux::Allocate (Ipv6Address address, uint16_t port)
 {
   NS_LOG_FUNCTION (this << address << port);
-  if (LookupLocal (address, port)) 
+  if (LookupLocal (address, port))
     {
       NS_LOG_WARN ("Duplicate address/port; failing.");
       return 0;
@@ -126,12 +127,12 @@
                                            Ipv6Address peerAddress, uint16_t peerPort)
 {
   NS_LOG_FUNCTION (this << localAddress << localPort << peerAddress << peerPort);
-  for (EndPointsI i = m_endPoints.begin (); i != m_endPoints.end (); i++) 
+  for (EndPointsI i = m_endPoints.begin (); i != m_endPoints.end (); i++)
     {
-      if ((*i)->GetLocalPort () == localPort &&
-          (*i)->GetLocalAddress () == localAddress &&
-          (*i)->GetPeerPort () == peerPort &&
-          (*i)->GetPeerAddress () == peerAddress) 
+      if ((*i)->GetLocalPort () == localPort
+          && (*i)->GetLocalAddress () == localAddress
+          && (*i)->GetPeerPort () == peerPort
+          && (*i)->GetPeerAddress () == peerAddress)
         {
           NS_LOG_WARN ("No way we can allocate this end-point.");
           /* no way we can allocate this end-point. */
@@ -150,7 +151,7 @@
 void Ipv6EndPointDemux::DeAllocate (Ipv6EndPoint *endPoint)
 {
   NS_LOG_FUNCTION_NOARGS ();
-  for (EndPointsI i = m_endPoints.begin (); i != m_endPoints.end (); i++) 
+  for (EndPointsI i = m_endPoints.begin (); i != m_endPoints.end (); i++)
     {
       if (*i == endPoint)
         {
@@ -166,7 +167,7 @@
  * Otherwise, if we find a generic match, we return it.
  * Otherwise, we return 0.
  */
-Ipv6EndPointDemux::EndPoints Ipv6EndPointDemux::Lookup (Ipv6Address daddr, uint16_t dport, 
+Ipv6EndPointDemux::EndPoints Ipv6EndPointDemux::Lookup (Ipv6Address daddr, uint16_t dport,
                                                         Ipv6Address saddr, uint16_t sport,
                                                         Ptr<Ipv6Interface> incomingInterface)
 {
@@ -178,14 +179,14 @@
   EndPoints retval4; /* Exact match on all 4 */
 
   NS_LOG_DEBUG ("Looking up endpoint for destination address " << daddr);
-  for (EndPointsI i = m_endPoints.begin (); i != m_endPoints.end (); i++) 
+  for (EndPointsI i = m_endPoints.begin (); i != m_endPoints.end (); i++)
     {
       Ipv6EndPoint* endP = *i;
       NS_LOG_DEBUG ("Looking at endpoint dport=" << endP->GetLocalPort ()
                                                  << " daddr=" << endP->GetLocalAddress ()
                                                  << " sport=" << endP->GetPeerPort ()
                                                  << " saddr=" << endP->GetPeerAddress ());
-      if (endP->GetLocalPort () != dport) 
+      if (endP->GetLocalPort () != dport)
         {
           NS_LOG_LOGIC ("Skipping endpoint " << &endP
                                              << " because endpoint dport "
@@ -203,7 +204,9 @@
 
       /* if no match here, keep looking */
       if (!(localAddressMatchesExact || localAddressMatchesWildCard))
-        continue; 
+        {
+          continue;
+        }
       bool remotePeerMatchesExact = endP->GetPeerPort () == sport;
       bool remotePeerMatchesWildCard = endP->GetPeerPort () == 0;
       bool remoteAddressMatchesExact = endP->GetPeerAddress () == saddr;
@@ -212,41 +215,54 @@
       /* If remote does not match either with exact or wildcard,i
          skip this one */
       if (!(remotePeerMatchesExact || remotePeerMatchesWildCard))
-        continue;
+        {
+          continue;
+        }
       if (!(remoteAddressMatchesExact || remoteAddressMatchesWildCard))
-        continue;
+        {
+          continue;
+        }
 
       /* Now figure out which return list to add this one to */
-      if (localAddressMatchesWildCard &&
-          remotePeerMatchesWildCard && 
-          remoteAddressMatchesWildCard)
+      if (localAddressMatchesWildCard
+          && remotePeerMatchesWildCard
+          && remoteAddressMatchesWildCard)
         { /* Only local port matches exactly */
           retval1.push_back (endP);
         }
-      if ((localAddressMatchesExact || (localAddressMatchesAllRouters))&&
-          remotePeerMatchesWildCard &&
-          remoteAddressMatchesWildCard)
+      if ((localAddressMatchesExact || (localAddressMatchesAllRouters))
+          && remotePeerMatchesWildCard
+          && remoteAddressMatchesWildCard)
         { /* Only local port and local address matches exactly */
           retval2.push_back (endP);
         }
-      if (localAddressMatchesWildCard &&
-          remotePeerMatchesExact &&
-          remoteAddressMatchesExact)
+      if (localAddressMatchesWildCard
+          && remotePeerMatchesExact
+          && remoteAddressMatchesExact)
         { /* All but local address */
           retval3.push_back (endP);
         }
-      if (localAddressMatchesExact &&
-          remotePeerMatchesExact &&
-          remoteAddressMatchesExact)
+      if (localAddressMatchesExact
+          && remotePeerMatchesExact
+          && remoteAddressMatchesExact)
         { /* All 4 match */
           retval4.push_back (endP);
         }
     }
 
   /* Here we find the most exact match */
-  if (!retval4.empty ()) return retval4;
-  if (!retval3.empty ()) return retval3;
-  if (!retval2.empty ()) return retval2;
+  if (!retval4.empty ())
+    {
+      return retval4;
+    }
+  if (!retval3.empty ())
+    {
+      return retval3;
+    }
+  if (!retval2.empty ())
+    {
+      return retval2;
+    }
   return retval1;  /* might be empty if no matches */
 }
 
@@ -264,8 +280,8 @@
           continue;
         }
 
-      if ((*i)->GetLocalAddress () == dst && (*i)->GetPeerPort () == sport &&
-          (*i)->GetPeerAddress () == src)
+      if ((*i)->GetLocalAddress () == dst && (*i)->GetPeerPort () == sport
+          && (*i)->GetPeerAddress () == src)
         {
           /* this is an exact match. */
           return *i;
@@ -294,19 +310,22 @@
 {
   NS_LOG_FUNCTION_NOARGS ();
   uint16_t port = m_ephemeral;
-  do 
+  int count = m_portLast - m_portFirst;
+  do
     {
-      port++;
-      if (port == 65535) 
+      if (count-- < 0)
         {
-          port = 49152;
+          return 0;
         }
-      if (!LookupPortLocal (port)) 
+      ++port;
+      if (port < m_portFirst || port > m_portLast)
         {
-          return port;
+          port = m_portFirst;
         }
-    } while (port != m_ephemeral);
-  return 0;
+    }
+  while (LookupPortLocal (port));
+  m_ephemeral = port;
+  return port;
 }
 
 Ipv6EndPointDemux::EndPoints Ipv6EndPointDemux::GetEndPoints () const
--- a/src/internet/model/ipv6-end-point-demux.h	Wed Apr 11 11:00:27 2012 +0200
+++ b/src/internet/model/ipv6-end-point-demux.h	Wed Apr 11 13:49:33 2012 +0200
@@ -26,8 +26,7 @@
 #include "ns3/ipv6-address.h"
 #include "ipv6-interface.h"
 
-namespace ns3
-{
+namespace ns3 {
 
 class Ipv6EndPoint;
 
@@ -91,21 +90,21 @@
    * \brief Allocate a Ipv6EndPoint.
    * \return an empty Ipv6EndPoint instance
    */
-  Ipv6EndPoint *Allocate (void);
+  Ipv6EndPoint * Allocate (void);
 
   /**
    * \brief Allocate a Ipv6EndPoint.
    * \param address IPv6 address
    * \return an Ipv6EndPoint instance
    */
-  Ipv6EndPoint *Allocate (Ipv6Address address);
+  Ipv6EndPoint * Allocate (Ipv6Address address);
 
   /**
    * \brief Allocate a Ipv6EndPoint.
    * \param port local port
    * \return an Ipv6EndPoint instance
    */
-  Ipv6EndPoint *Allocate (uint16_t port);
+  Ipv6EndPoint * Allocate (uint16_t port);
 
   /**
    * \brief Allocate a Ipv6EndPoint.
@@ -113,7 +112,7 @@
    * \param port local port
    * \return an Ipv6EndPoint instance
    */
-  Ipv6EndPoint *Allocate (Ipv6Address address, uint16_t port);
+  Ipv6EndPoint * Allocate (Ipv6Address address, uint16_t port);
 
   /**
    * \brief Allocate a Ipv6EndPoint.
@@ -123,7 +122,7 @@
    * \param peerPort peer port
    * \return an Ipv6EndPoint instance
    */
-  Ipv6EndPoint *Allocate (Ipv6Address localAddress, uint16_t localPort, Ipv6Address peerAddress, uint16_t peerPort);
+  Ipv6EndPoint * Allocate (Ipv6Address localAddress, uint16_t localPort, Ipv6Address peerAddress, uint16_t peerPort);
 
   /**
    * \brief Remove a end point.
@@ -150,6 +149,16 @@
   uint16_t m_ephemeral;
 
   /**
+   * \brief The first ephemeral port.
+   */
+  uint16_t m_portFirst;
+
+  /**
+   * \brief The last ephemeral port.
+   */
+  uint16_t m_portLast;
+
+  /**
    * \brief A list of IPv6 end points.
    */
   EndPoints m_endPoints;
--- a/src/internet/model/ipv6-extension.cc	Wed Apr 11 11:00:27 2012 +0200
+++ b/src/internet/model/ipv6-extension.cc	Wed Apr 11 13:49:33 2012 +0200
@@ -43,8 +43,7 @@
 
 NS_LOG_COMPONENT_DEFINE ("Ipv6Extension");
 
-namespace ns3
-{
+namespace ns3 {
 
 NS_OBJECT_ENSURE_REGISTERED (Ipv6Extension);
 
@@ -338,14 +337,17 @@
   std::pair<Ipv6Address, uint32_t> fragmentsId = std::make_pair<Ipv6Address, uint32_t> (src, identification);
   Ptr<Fragments> fragments;
 
+  Ipv6Header ipHeader = ipv6Header;
+  ipHeader.SetNextHeader (fragmentHeader.GetNextHeader ());
+
   MapFragments_t::iterator it = m_fragments.find (fragmentsId);
   if (it == m_fragments.end ())
     {
       fragments = Create<Fragments> ();
       m_fragments.insert (std::make_pair (fragmentsId, fragments));
-      EventId timeout = Simulator::Schedule (Seconds(60),
+      EventId timeout = Simulator::Schedule (Seconds (60),
                                              &Ipv6ExtensionFragment::HandleFragmentsTimeout, this,
-                                             fragmentsId, fragments, ipv6Header);
+                                             fragmentsId, fragments, ipHeader);
       fragments->SetTimeoutEventId (timeout);
     }
   else
@@ -365,11 +367,11 @@
   if (fragments->IsEntire ())
     {
       packet = fragments->GetPacket ();
-      fragments->CancelTimeout();
-      m_fragments.erase(fragmentsId);
+      fragments->CancelTimeout ();
+      m_fragments.erase (fragmentsId);
       isDropped = false;
     }
-  else 
+  else
     {
       // the fragment is not "dropped", but Ipv6L3Protocol::LocalDeliver must stop processing it.
       isDropped = true;
@@ -406,9 +408,9 @@
   Ptr<Ipv6Extension> extension = extensionDemux->GetExtension (nextHeader);
   uint8_t extensionHeaderLength;
 
-  while (moreHeader) 
+  while (moreHeader)
     {
-      if (nextHeader == Ipv6Header::IPV6_EXT_HOP_BY_HOP) 
+      if (nextHeader == Ipv6Header::IPV6_EXT_HOP_BY_HOP)
         {
           Ipv6ExtensionHopByHopHeader *hopbyhopHeader = new Ipv6ExtensionHopByHopHeader ();
           p->RemoveHeader (*hopbyhopHeader);
@@ -429,7 +431,7 @@
           unfragmentablePart.push_back (std::make_pair<Ipv6ExtensionHeader *, uint8_t> (hopbyhopHeader, Ipv6Header::IPV6_EXT_HOP_BY_HOP));
           unfragmentablePartSize += extensionHeaderLength;
         }
-      else if (nextHeader == Ipv6Header::IPV6_EXT_ROUTING) 
+      else if (nextHeader == Ipv6Header::IPV6_EXT_ROUTING)
         {
           uint8_t buf[2];
           p->CopyData (buf, sizeof(buf));
@@ -453,7 +455,7 @@
           unfragmentablePart.push_back (std::make_pair<Ipv6ExtensionHeader *, uint8_t> (routingHeader, Ipv6Header::IPV6_EXT_ROUTING));
           unfragmentablePartSize += extensionHeaderLength;
         }
-      else if (nextHeader == Ipv6Header::IPV6_EXT_DESTINATION) 
+      else if (nextHeader == Ipv6Header::IPV6_EXT_DESTINATION)
         {
           Ipv6ExtensionDestinationHeader *destinationHeader = new Ipv6ExtensionDestinationHeader ();
           p->RemoveHeader (*destinationHeader);
@@ -463,7 +465,7 @@
 
           uint8_t type;
           p->CopyData (&type, sizeof(type));
-          if (!(nextHeader == Ipv6Header::IPV6_EXT_HOP_BY_HOP || nextHeader == Ipv6Header::IPV6_EXT_ROUTING 
+          if (!(nextHeader == Ipv6Header::IPV6_EXT_HOP_BY_HOP || nextHeader == Ipv6Header::IPV6_EXT_ROUTING
                 || (nextHeader == Ipv6Header::IPV6_EXT_DESTINATION && type == Ipv6Header::IPV6_EXT_ROUTING)))
             {
               moreHeader = false;
@@ -486,14 +488,14 @@
   uint32_t identification = (uint32_t) uvar.GetValue (0, (uint32_t)-1);
   uint16_t offset = 0;
 
-  do 
+  do
     {
       if (p->GetSize () > offset + maxFragmentablePartSize)
         {
           moreFragment = true;
           currentFragmentablePartSize = maxFragmentablePartSize;
         }
-      else 
+      else
         {
           moreFragment = false;
           currentFragmentablePartSize = p->GetSize () - offset;
@@ -516,15 +518,15 @@
         {
           if (it->second == Ipv6Header::IPV6_EXT_HOP_BY_HOP)
             {
-              fragment->AddHeader (*dynamic_cast<Ipv6ExtensionHopByHopHeader *>(it->first));
+              fragment->AddHeader (*dynamic_cast<Ipv6ExtensionHopByHopHeader *> (it->first));
             }
           else if (it->second == Ipv6Header::IPV6_EXT_ROUTING)
             {
-              fragment->AddHeader (*dynamic_cast<Ipv6ExtensionLooseRoutingHeader *>(it->first));
+              fragment->AddHeader (*dynamic_cast<Ipv6ExtensionLooseRoutingHeader *> (it->first));
             }
           else if (it->second == Ipv6Header::IPV6_EXT_DESTINATION)
             {
-              fragment->AddHeader (*dynamic_cast<Ipv6ExtensionDestinationHeader *>(it->first));
+              fragment->AddHeader (*dynamic_cast<Ipv6ExtensionDestinationHeader *> (it->first));
             }
         }
 
@@ -534,7 +536,8 @@
       std::ostringstream oss;
       fragment->Print (oss);
       listFragments.push_back (fragment);
-    } while (moreFragment);
+    }
+  while (moreFragment);
 
   for (std::list<std::pair<Ipv6ExtensionHeader *, uint8_t> >::iterator it = unfragmentablePart.begin (); it != unfragmentablePart.end (); it++)
     {
@@ -549,17 +552,19 @@
 {
   Ptr<Packet> packet = fragments->GetPartialPacket ();
 
+  packet->AddHeader (ipHeader);
+
   // if we have at least 8 bytes, we can send an ICMP.
   if ( packet->GetSize () > 8 )
     {
 
-      Ptr<Icmpv6L4Protocol> icmp = GetNode()->GetObject<Icmpv6L4Protocol> ();
+      Ptr<Icmpv6L4Protocol> icmp = GetNode ()->GetObject<Icmpv6L4Protocol> ();
       icmp->SendErrorTimeExceeded (packet, ipHeader.GetSourceAddress (), Icmpv6Header::ICMPV6_FRAGTIME);
     }
   m_dropTrace (packet);
 
   // clear the buffers
-  m_fragments.erase(fragmentsId);
+  m_fragments.erase (fragmentsId);
 }
 
 Ipv6ExtensionFragment::Fragments::Fragments ()
@@ -591,7 +596,7 @@
   m_fragments.insert (it, std::make_pair<Ptr<Packet>, uint16_t> (fragment, fragmentOffset));
 }
 
-void Ipv6ExtensionFragment::Fragments::SetUnfragmentablePart (Ptr<Packet> unfragmentablePart) 
+void Ipv6ExtensionFragment::Fragments::SetUnfragmentablePart (Ptr<Packet> unfragmentablePart)
 {
   m_unfragmentable = unfragmentablePart;
 }
@@ -661,14 +666,14 @@
 
 void Ipv6ExtensionFragment::Fragments::SetTimeoutEventId (EventId event)
 {
-    m_timeoutEventId = event;
-    return;
+  m_timeoutEventId = event;
+  return;
 }
 
-void Ipv6ExtensionFragment::Fragments::CancelTimeout()
+void Ipv6ExtensionFragment::Fragments::CancelTimeout ()
 {
-    m_timeoutEventId.Cancel ();
-    return;
+  m_timeoutEventId.Cancel ();
+  return;
 }
 
 
@@ -727,7 +732,7 @@
 
   if (nextHeader)
     {
-      *nextHeader = routingNextHeader; 
+      *nextHeader = routingNextHeader;
     }
 
   Ptr<Icmpv6L4Protocol> icmpv6 = GetNode ()->GetObject<Ipv6L3Protocol> ()->GetIcmpv6 ();
@@ -918,7 +923,7 @@
   nextAddressIndex = nbAddress - segmentsLeft;
   nextAddress = routingHeader.GetRouterAddress (nextAddressIndex);
 
-  if (nextAddress.IsMulticast () || destAddress.IsMulticast ()) 
+  if (nextAddress.IsMulticast () || destAddress.IsMulticast ())
     {
       m_dropTrace (packet);
       isDropped = true;
@@ -941,10 +946,10 @@
   ipv6header.SetHopLimit (hopLimit - 1);
   p->AddHeader (routingHeader);
 
-  /* short-circuiting routing stuff 
-   * 
+  /* short-circuiting routing stuff
+   *
    * If we process this option,
-   * the packet was for us so we resend it to 
+   * the packet was for us so we resend it to
    * the new destination (modified in the header above).
    */
 
@@ -966,7 +971,7 @@
     }
 
   /* as we directly send packet, mark it as dropped */
-  isDropped = true; 
+  isDropped = true;
 
   return routingHeader.GetSerializedSize ();
 }
--- a/src/internet/model/ipv6-extension.h	Wed Apr 11 11:00:27 2012 +0200
+++ b/src/internet/model/ipv6-extension.h	Wed Apr 11 13:49:33 2012 +0200
@@ -35,8 +35,7 @@
 #include "ns3/traced-callback.h"
 
 
-namespace ns3
-{
+namespace ns3 {
 
 /**
  * \class Ipv6Extension
@@ -309,7 +308,7 @@
 
     /**
      * \brief If all fragments have been added.
-     * \returns true if the packet is entire 
+     * \returns true if the packet is entire
      */
     bool IsEntire () const;
 
--- a/src/internet/model/ipv6-l3-protocol.cc	Wed Apr 11 11:00:27 2012 +0200
+++ b/src/internet/model/ipv6-l3-protocol.cc	Wed Apr 11 13:49:33 2012 +0200
@@ -22,6 +22,7 @@
 #include "ns3/node.h"
 #include "ns3/uinteger.h"
 #include "ns3/vector.h"
+#include "ns3/boolean.h"
 #include "ns3/callback.h"
 #include "ns3/trace-source-accessor.h"
 #include "ns3/object-vector.h"
@@ -41,8 +42,7 @@
 #include "icmpv6-l4-protocol.h"
 #include "ndisc-cache.h"
 
-namespace ns3
-{
+namespace ns3 {
 
 NS_OBJECT_ENSURE_REGISTERED (Ipv6L3Protocol);
 
@@ -63,6 +63,11 @@
                    ObjectVectorValue (),
                    MakeObjectVectorAccessor (&Ipv6L3Protocol::m_interfaces),
                    MakeObjectVectorChecker<Ipv6Interface> ())
+    .AddAttribute ("SendIcmpv6Redirect", "Send the ICMPv6 Redirect when appropriate.",
+                   BooleanValue (true),
+                   MakeBooleanAccessor (&Ipv6L3Protocol::SetSendIcmpv6Redirect,
+                                        &Ipv6L3Protocol::GetSendIcmpv6Redirect),
+                   MakeBooleanChecker ())
     .AddTraceSource ("Tx", "Send IPv6 packet to outgoing interface.",
                      MakeTraceSourceAccessor (&Ipv6L3Protocol::m_txTrace))
     .AddTraceSource ("Rx", "Receive IPv6 packet from incoming interface.",
@@ -130,7 +135,7 @@
   m_routingProtocol->SetIpv6 (this);
 }
 
-Ptr<Ipv6RoutingProtocol> Ipv6L3Protocol::GetRoutingProtocol () const 
+Ptr<Ipv6RoutingProtocol> Ipv6L3Protocol::GetRoutingProtocol () const
 {
   NS_LOG_FUNCTION_NOARGS ();
   return m_routingProtocol;
@@ -175,7 +180,7 @@
   return 0;
 }
 
-uint32_t Ipv6L3Protocol::GetNInterfaces () const 
+uint32_t Ipv6L3Protocol::GetNInterfaces () const
 {
   NS_LOG_FUNCTION_NOARGS ();
   return m_nInterfaces;
@@ -183,7 +188,7 @@
 
 int32_t Ipv6L3Protocol::GetInterfaceForAddress (Ipv6Address address) const
 {
-  NS_LOG_FUNCTION (this << address); 
+  NS_LOG_FUNCTION (this << address);
   int32_t index = 0;
 
   for (Ipv6InterfaceList::const_iterator it = m_interfaces.begin (); it != m_interfaces.end (); it++)
@@ -193,7 +198,7 @@
 
       for (j = 0; j < max; j++)
         {
-          if ((*it)->GetAddress (j).GetAddress () == address) 
+          if ((*it)->GetAddress (j).GetAddress () == address)
             {
               return index;
             }
@@ -252,7 +257,7 @@
 
   Address addr = GetInterface (interface)->GetDevice ()->GetAddress ();
 
-  if (flags & (1<< 6)) /* auto flag */
+  if (flags & (1 << 6)) /* auto flag */
     {
       /* XXX : add other L2 address case */
       if (Mac48Address::IsMatchingType (addr))
@@ -282,7 +287,7 @@
       AddAddress (interface, address);
 
       /* add default router
-       * if a previous default route exists, the new ones is simply added 
+       * if a previous default route exists, the new ones is simply added
        */
       GetRoutingProtocol ()->NotifyAddRoute (Ipv6Address::GetAny (), Ipv6Prefix ((uint8_t)0), defaultRouter, interface, network);
 
@@ -304,7 +309,7 @@
 
   for (i = 0; i < max; i++)
     {
-      if (iface->GetAddress (i).GetAddress () == toFound) 
+      if (iface->GetAddress (i).GetAddress () == toFound)
         {
           RemoveAddress (interface, i);
           break;
@@ -369,14 +374,14 @@
   return false;
 }
 
-void Ipv6L3Protocol::SetMetric (uint32_t i, uint16_t metric) 
+void Ipv6L3Protocol::SetMetric (uint32_t i, uint16_t metric)
 {
   NS_LOG_FUNCTION (this << i << metric);
   Ptr<Ipv6Interface> interface = GetInterface (i);
   interface->SetMetric (metric);
 }
 
-uint16_t Ipv6L3Protocol::GetMetric (uint32_t i) const 
+uint16_t Ipv6L3Protocol::GetMetric (uint32_t i) const
 {
   NS_LOG_FUNCTION (this << i);
   Ptr<Ipv6Interface> interface = GetInterface (i);
@@ -493,6 +498,18 @@
   return m_ipForward;
 }
 
+void Ipv6L3Protocol::SetSendIcmpv6Redirect (bool sendIcmpv6Redirect)
+{
+  NS_LOG_FUNCTION (this << sendIcmpv6Redirect);
+  m_sendIcmpv6Redirect = sendIcmpv6Redirect;
+}
+
+bool Ipv6L3Protocol::GetSendIcmpv6Redirect () const
+{
+  NS_LOG_FUNCTION_NOARGS ();
+  return m_sendIcmpv6Redirect;
+}
+
 void Ipv6L3Protocol::NotifyNewAggregate ()
 {
   NS_LOG_FUNCTION_NOARGS ();
@@ -635,12 +652,12 @@
   hdr = BuildHeader (source, destination, protocol, packet->GetSize (), ttl);
 
   //for link-local traffic, we need to determine the interface
-  if (source.IsLinkLocal () ||
-      destination.IsLinkLocal () ||
-      destination.IsAllNodesMulticast () ||
-      destination.IsAllRoutersMulticast () ||
-      destination.IsAllHostsMulticast () ||
-      destination.IsSolicitedMulticast ())
+  if (source.IsLinkLocal ()
+      || destination.IsLinkLocal ()
+      || destination.IsAllNodesMulticast ()
+      || destination.IsAllRoutersMulticast ()
+      || destination.IsAllHostsMulticast ()
+      || destination.IsSolicitedMulticast ())
     {
       int32_t index = GetInterfaceForAddress (source);
       NS_ASSERT (index >= 0);
@@ -707,7 +724,7 @@
       socket->ForwardUp (packet, hdr, device);
     }
 
-  Ptr<Ipv6ExtensionDemux> ipv6ExtensionDemux = m_node->GetObject<Ipv6ExtensionDemux>();
+  Ptr<Ipv6ExtensionDemux> ipv6ExtensionDemux = m_node->GetObject<Ipv6ExtensionDemux> ();
   Ptr<Ipv6Extension> ipv6Extension = 0;
   uint8_t nextHeader = hdr.GetNextHeader ();
   bool isDropped = false;
@@ -763,6 +780,12 @@
       // Router => drop
       if (m_ipForward)
         {
+          Ptr<Icmpv6L4Protocol> icmpv6 = GetIcmpv6 ();
+          if ( icmpv6 )
+            {
+              packet->AddHeader(ipHeader);
+              icmpv6->SendErrorTooBig (packet, ipHeader.GetSourceAddress (), dev->GetMtu ());
+            }
           return;
         }
 
@@ -771,7 +794,7 @@
       packet->AddHeader (ipHeader);
 
       // To get specific method GetFragments from Ipv6ExtensionFragmentation
-      Ipv6ExtensionFragment *ipv6Fragment = dynamic_cast<Ipv6ExtensionFragment *>(PeekPointer (ipv6ExtensionDemux->GetExtension (Ipv6Header::IPV6_EXT_FRAGMENTATION)));
+      Ipv6ExtensionFragment *ipv6Fragment = dynamic_cast<Ipv6ExtensionFragment *> (PeekPointer (ipv6ExtensionDemux->GetExtension (Ipv6Header::IPV6_EXT_FRAGMENTATION)));
       ipv6Fragment->GetFragments (packet, outInterface->GetDevice ()->GetMtu (), fragments);
     }
 
@@ -858,8 +881,8 @@
       NS_LOG_WARN ("TTL exceeded.  Drop.");
       m_dropTrace (ipHeader, packet, DROP_TTL_EXPIRED, m_node->GetObject<Ipv6> (), 0);
       // Do not reply to ICMPv6 or to multicast IPv6 address
-      if (ipHeader.GetNextHeader () != Icmpv6L4Protocol::PROT_NUMBER &&
-          ipHeader.GetDestinationAddress ().IsMulticast () == false)
+      if (ipHeader.GetNextHeader () != Icmpv6L4Protocol::PROT_NUMBER
+          && ipHeader.GetDestinationAddress ().IsMulticast () == false)
         {
           packet->AddHeader (ipHeader);
           GetIcmpv6 ()->SendErrorTimeExceeded (packet, ipHeader.GetSourceAddress (), Icmpv6Header::ICMPV6_HOPLIMIT);
@@ -869,12 +892,14 @@
 
   /* ICMPv6 Redirect */
 
-  /* if we forward to a machine on the same network as the source, 
-   * we send him an ICMPv6 redirect message to notify him that a short route 
+  /* if we forward to a machine on the same network as the source,
+   * we send him an ICMPv6 redirect message to notify him that a short route
    * exists.
    */
-  if ((!rtentry->GetGateway ().IsAny () && rtentry->GetGateway ().CombinePrefix (Ipv6Prefix (64)) == header.GetSourceAddress ().CombinePrefix (Ipv6Prefix (64))) ||
-      (rtentry->GetDestination ().CombinePrefix (Ipv6Prefix (64)) == header.GetSourceAddress ().CombinePrefix (Ipv6Prefix (64))))
+
+  if (m_sendIcmpv6Redirect &&
+      ((!rtentry->GetGateway ().IsAny () && rtentry->GetGateway ().CombinePrefix (Ipv6Prefix (64)) == header.GetSourceAddress ().CombinePrefix (Ipv6Prefix (64)))
+      || (rtentry->GetDestination ().CombinePrefix (Ipv6Prefix (64)) == header.GetSourceAddress ().CombinePrefix (Ipv6Prefix (64)))))
     {
       NS_LOG_LOGIC ("ICMPv6 redirect!");
       Ptr<Icmpv6L4Protocol> icmpv6 = GetIcmpv6 ();
@@ -940,8 +965,8 @@
 {
   NS_LOG_FUNCTION (this << packet << ip << iif);
   Ptr<Packet> p = packet->Copy ();
-  Ptr<IpL4Protocol> protocol = 0; 
-  Ptr<Ipv6ExtensionDemux> ipv6ExtensionDemux = m_node->GetObject<Ipv6ExtensionDemux>();
+  Ptr<IpL4Protocol> protocol = 0;
+  Ptr<Ipv6ExtensionDemux> ipv6ExtensionDemux = m_node->GetObject<Ipv6ExtensionDemux> ();
   Ptr<Ipv6Extension> ipv6Extension = 0;
   Ipv6Address src = ip.GetSourceAddress ();
   Ipv6Address dst = ip.GetDestinationAddress ();
@@ -961,7 +986,8 @@
     }
 
   /* process all the extensions found and the layer 4 protocol */
-  do {
+  do
+    {
       /* it return 0 for non-extension (i.e. layer 4 protocol) */
       ipv6Extension = ipv6ExtensionDemux->GetExtension (nextHeader);
 
@@ -1030,7 +1056,8 @@
                 }
             }
         }
-    } while (ipv6Extension);
+    }
+  while (ipv6Extension);
 }
 
 void Ipv6L3Protocol::RouteInputError (Ptr<const Packet> p, const Ipv6Header& ipHeader, Socket::SocketErrno sockErrno)
--- a/src/internet/model/ipv6-l3-protocol.h	Wed Apr 11 11:00:27 2012 +0200
+++ b/src/internet/model/ipv6-l3-protocol.h	Wed Apr 11 13:49:33 2012 +0200
@@ -469,6 +469,18 @@
   virtual bool GetIpForward () const;
 
   /**
+   * \brief Set the ICMPv6 Redirect sending state.
+   * \param sendIcmpv6Redirect ICMPv6 Redirect sending enabled or not
+   */
+  virtual void SetSendIcmpv6Redirect (bool sendIcmpv6Redirect);
+
+  /**
+   * \brief Get the ICMPv6 Redirect sending state.
+   * \return ICMPv6 Redirect sending state (enabled or not)
+   */
+  virtual bool GetSendIcmpv6Redirect () const;
+
+  /**
    * \brief Node attached to stack.
    */
   Ptr<Node> m_node;
@@ -512,6 +524,11 @@
    * \brief List of IPv6 prefix received from RA.
    */
   Ipv6AutoconfiguredPrefixList m_prefixes;
+
+  /**
+   * \brief Allow ICMPv6 Redirect sending state
+   */
+  bool m_sendIcmpv6Redirect;
 };
 
 } /* namespace ns3 */
--- a/src/internet/model/ipv6-list-routing.cc	Wed Apr 11 11:00:27 2012 +0200
+++ b/src/internet/model/ipv6-list-routing.cc	Wed Apr 11 13:49:33 2012 +0200
@@ -23,6 +23,7 @@
 #include "ns3/node.h"
 #include "ns3/ipv6-static-routing.h"
 #include "ipv6-list-routing.h"
+#include "ns3/simulator.h"
 
 NS_LOG_COMPONENT_DEFINE ("Ipv6ListRouting");
 
@@ -41,13 +42,13 @@
 }
 
 
-Ipv6ListRouting::Ipv6ListRouting () 
+Ipv6ListRouting::Ipv6ListRouting ()
   : m_ipv6 (0)
 {
   NS_LOG_FUNCTION_NOARGS ();
 }
 
-Ipv6ListRouting::~Ipv6ListRouting () 
+Ipv6ListRouting::~Ipv6ListRouting ()
 {
   NS_LOG_FUNCTION_NOARGS ();
 }
@@ -94,9 +95,9 @@
 }
 
 // Patterned after Linux ip_route_input and ip_route_input_slow
-bool 
-Ipv6ListRouting::RouteInput (Ptr<const Packet> p, const Ipv6Header &header, Ptr<const NetDevice> idev, 
-                             UnicastForwardCallback ucb, MulticastForwardCallback mcb, 
+bool
+Ipv6ListRouting::RouteInput (Ptr<const Packet> p, const Ipv6Header &header, Ptr<const NetDevice> idev,
+                             UnicastForwardCallback ucb, MulticastForwardCallback mcb,
                              LocalDeliverCallback lcb, ErrorCallback ecb)
 {
   bool retVal = false;
@@ -104,9 +105,9 @@
   NS_LOG_LOGIC ("RouteInput logic for node: " << m_ipv6->GetObject<Node> ()->GetId ());
 
   NS_ASSERT (m_ipv6 != 0);
-  // Check if input device supports IP 
+  // Check if input device supports IP
   NS_ASSERT (m_ipv6->GetInterfaceForDevice (idev) >= 0);
-  uint32_t iif = m_ipv6->GetInterfaceForDevice (idev); 
+  uint32_t iif = m_ipv6->GetInterfaceForDevice (idev);
   Ipv6Address dst = header.GetDestinationAddress ();
 
   // Multicast recognition; handle local delivery here
@@ -171,7 +172,7 @@
               lcb (p, header, iif);
               return true;
             }
-          NS_LOG_LOGIC ("Address "<< addr << " not a match");
+          NS_LOG_LOGIC ("Address " << addr << " not a match");
         }
     }
   // Check if input device supports IP forwarding
@@ -196,7 +197,7 @@
   return retVal;
 }
 
-void 
+void
 Ipv6ListRouting::NotifyInterfaceUp (uint32_t interface)
 {
   NS_LOG_FUNCTION (this << interface);
@@ -208,7 +209,7 @@
       (*rprotoIter).second->NotifyInterfaceUp (interface);
     }
 }
-void 
+void
 Ipv6ListRouting::NotifyInterfaceDown (uint32_t interface)
 {
   NS_LOG_FUNCTION (this << interface);
@@ -220,7 +221,7 @@
       (*rprotoIter).second->NotifyInterfaceDown (interface);
     }
 }
-void 
+void
 Ipv6ListRouting::NotifyAddAddress (uint32_t interface, Ipv6InterfaceAddress address)
 {
   NS_LOG_FUNCTION (this << interface << address);
@@ -232,7 +233,7 @@
       (*rprotoIter).second->NotifyAddAddress (interface, address);
     }
 }
-void 
+void
 Ipv6ListRouting::NotifyRemoveAddress (uint32_t interface, Ipv6InterfaceAddress address)
 {
   NS_LOG_FUNCTION (this << interface << address);
@@ -269,7 +270,24 @@
     }
 }
 
-void 
+void
+Ipv6ListRouting::PrintRoutingTable (Ptr<OutputStreamWrapper> stream) const
+{
+  NS_LOG_FUNCTION (this);
+
+  *stream->GetStream () << "Node: " << m_ipv6->GetObject<Node> ()->GetId ()
+                        << " Time: " << Simulator::Now ().GetSeconds () << "s "
+                        << "Ipv6ListRouting table" << std::endl;
+  for (Ipv6RoutingProtocolList::const_iterator i = m_routingProtocols.begin ();
+       i != m_routingProtocols.end (); i++)
+    {
+      *stream->GetStream () << "  Priority: " << (*i).first << " Protocol: " << (*i).second->GetInstanceTypeId () << std::endl;
+      (*i).second->PrintRoutingTable (stream);
+    }
+  *stream->GetStream () << std::endl;
+}
+
+void
 Ipv6ListRouting::SetIpv6 (Ptr<Ipv6> ipv6)
 {
   NS_LOG_FUNCTION (this << ipv6);
@@ -296,14 +314,14 @@
     }
 }
 
-uint32_t 
+uint32_t
 Ipv6ListRouting::GetNRoutingProtocols (void) const
 {
   NS_LOG_FUNCTION (this);
-  return m_routingProtocols.size (); 
+  return m_routingProtocols.size ();
 }
 
-Ptr<Ipv6RoutingProtocol> 
+Ptr<Ipv6RoutingProtocol>
 Ipv6ListRouting::GetRoutingProtocol (uint32_t index, int16_t& priority) const
 {
   NS_LOG_FUNCTION (index);
@@ -324,7 +342,7 @@
   return 0;
 }
 
-bool 
+bool
 Ipv6ListRouting::Compare (const Ipv6RoutingProtocolEntry& a, const Ipv6RoutingProtocolEntry& b)
 {
   return a.first > b.first;
--- a/src/internet/model/ipv6-list-routing.h	Wed Apr 11 11:00:27 2012 +0200
+++ b/src/internet/model/ipv6-list-routing.h	Wed Apr 11 13:49:33 2012 +0200
@@ -25,7 +25,7 @@
 namespace ns3 {
 
 /**
- * \ingroup internet 
+ * \ingroup internet
  * \defgroup ipv6ListRouting Ipv6 List Routing
  */
 
@@ -34,15 +34,15 @@
  * \class Ipv6ListRouting
  * \brief Hold list of Ipv6RoutingProtocol objects.
  *
- * This class is a specialization of Ipv6RoutingProtocol that allows 
- * other instances of Ipv6RoutingProtocol to be inserted in a 
+ * This class is a specialization of Ipv6RoutingProtocol that allows
+ * other instances of Ipv6RoutingProtocol to be inserted in a
  * prioritized list.  Routing protocols in the list are consulted one
  * by one, from highest to lowest priority, until a routing protocol
  * is found that will take the packet (this corresponds to a non-zero
  * return value to RouteOutput, or a return value of true to RouteInput).
- * The order by which routing protocols with the same priority value 
+ * The order by which routing protocols with the same priority value
  * are consulted is undefined.
- * 
+ *
  */
 class Ipv6ListRouting : public Ipv6RoutingProtocol
 {
@@ -78,7 +78,7 @@
   virtual uint32_t GetNRoutingProtocols (void) const;
 
   /**
-   * \brief Get pointer to routing protocol stored at index, 
+   * \brief Get pointer to routing protocol stored at index,
    *
    * The first protocol (index 0) the highest priority, the next one (index 1)
    * the second highest priority, and so on.  The priority parameter is an
@@ -86,7 +86,7 @@
    * \param index index of protocol to return
    * \param priority output parameter, set to the priority of the protocol
    * being returned
-   * \return pointer to routing protocol indexed by 
+   * \return pointer to routing protocol indexed by
    */
   virtual Ptr<Ipv6RoutingProtocol> GetRoutingProtocol (uint32_t index, int16_t& priority) const;
 
@@ -104,11 +104,18 @@
   virtual void NotifyRemoveRoute (Ipv6Address dst, Ipv6Prefix mask, Ipv6Address nextHop, uint32_t interface, Ipv6Address prefixToUse = Ipv6Address::GetZero ());
   virtual void SetIpv6 (Ptr<Ipv6> ipv6);
 
+  /**
+   * \brief Print the Routing Table entries
+   *
+   * \param stream the ostream the Routing table is printed to
+   */
+  virtual void PrintRoutingTable (Ptr<OutputStreamWrapper> stream) const;
+
 protected:
   /**
    * \brief Dispose this object.
    */
-  void DoDispose (void);
+  virtual void DoDispose (void);
 
 private:
   typedef std::pair<int16_t, Ptr<Ipv6RoutingProtocol> > Ipv6RoutingProtocolEntry;
--- a/src/internet/model/ipv6-packet-info-tag.cc	Wed Apr 11 11:00:27 2012 +0200
+++ b/src/internet/model/ipv6-packet-info-tag.cc	Wed Apr 11 13:49:33 2012 +0200
@@ -120,7 +120,7 @@
 { 
   uint8_t buf[16];
   i.Read (buf, 16);
-  m_addr.Deserialize (buf);
+  m_addr = Ipv6Address::Deserialize (buf);
   m_ifindex = i.ReadU8 ();
   m_hoplimit = i.ReadU8 ();
   m_tclass = i.ReadU8 ();
--- a/src/internet/model/ipv6-raw-socket-impl.cc	Wed Apr 11 11:00:27 2012 +0200
+++ b/src/internet/model/ipv6-raw-socket-impl.cc	Wed Apr 11 13:49:33 2012 +0200
@@ -338,7 +338,7 @@
         }
 
       // Should check via getsockopt ()..
-      if (this->m_recvpktinfo)
+      if (IsRecvPktInfo ())
         {
           Ipv6PacketInfoTag tag;
           copy->RemovePacketTag (tag);
--- a/src/internet/model/ipv6-routing-protocol.h	Wed Apr 11 11:00:27 2012 +0200
+++ b/src/internet/model/ipv6-routing-protocol.h	Wed Apr 11 13:49:33 2012 +0200
@@ -29,6 +29,7 @@
 #include "ipv6-header.h"
 #include "ipv6-interface-address.h"
 #include "ipv6.h"
+#include "ns3/output-stream-wrapper.h"
 
 namespace ns3 {
 
@@ -171,6 +172,13 @@
    * \param ipv6 the ipv6 object this routing protocol is being associated with
    */
   virtual void SetIpv6 (Ptr<Ipv6> ipv6) = 0;
+
+  /**
+   * \brief Print the Routing Table entries
+   *
+   * \param stream the ostream the Routing table is printed to
+   */
+  virtual void PrintRoutingTable (Ptr<OutputStreamWrapper> stream) const = 0;
 };
 
 } // namespace ns3
--- a/src/internet/model/ipv6-static-routing.cc	Wed Apr 11 11:00:27 2012 +0200
+++ b/src/internet/model/ipv6-static-routing.cc	Wed Apr 11 13:49:33 2012 +0200
@@ -18,16 +18,18 @@
  * Author: Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
  */
 
+#include <iomanip>
 #include "ns3/log.h"
+#include "ns3/node.h"
 #include "ns3/packet.h"
+#include "ns3/simulator.h"
 #include "ns3/ipv6-route.h"
 #include "ns3/net-device.h"
 
 #include "ipv6-static-routing.h"
 #include "ipv6-routing-table-entry.h"
 
-namespace ns3
-{
+namespace ns3 {
 
 NS_LOG_COMPONENT_DEFINE ("Ipv6StaticRouting");
 NS_OBJECT_ENSURE_REGISTERED (Ipv6StaticRouting);
@@ -56,7 +58,7 @@
 {
   NS_LOG_FUNCTION (this << ipv6);
   NS_ASSERT (m_ipv6 == 0 && ipv6 != 0);
-  uint32_t i = 0; 
+  uint32_t i = 0;
   m_ipv6 = ipv6;
 
   for (i = 0; i < m_ipv6->GetNInterfaces (); i++)
@@ -72,6 +74,26 @@
     }
 }
 
+// Formatted like output of "route -n" command
+void
+Ipv6StaticRouting::PrintRoutingTable (Ptr<OutputStreamWrapper> stream) const
+{
+  NS_LOG_FUNCTION (this);
+  std::ostream* os = stream->GetStream ();
+  if (GetNRoutes () > 0)
+    {
+      *os << "Node: " << m_ipv6->GetObject<Node> ()->GetId ()
+          << " Time: " << Simulator::Now ().GetSeconds () << "s "
+          << "Ipv6StaticRouting table" << std::endl;
+
+      for (uint32_t j = 0; j < GetNRoutes (); j++)
+        {
+          Ipv6RoutingTableEntry route = GetRoute (j);
+          *os << route << std::endl;
+        }
+    }
+}
+
 void Ipv6StaticRouting::AddHostRouteTo (Ipv6Address dst, Ipv6Address nextHop, uint32_t interface, Ipv6Address prefixToUse, uint32_t metric)
 {
   NS_LOG_FUNCTION (this << dst << nextHop << interface << prefixToUse << metric);
@@ -164,9 +186,9 @@
   for (MulticastRoutesI i = m_multicastRoutes.begin (); i != m_multicastRoutes.end (); i++)
     {
       Ipv6MulticastRoutingTableEntry *route = *i;
-      if (origin == route->GetOrigin () &&
-          group == route->GetGroup () &&
-          inputInterface == route->GetInputInterface ())
+      if (origin == route->GetOrigin ()
+          && group == route->GetGroup ()
+          && inputInterface == route->GetInputInterface ())
         {
           delete *i;
           m_multicastRoutes.erase (i);
@@ -222,8 +244,8 @@
   uint32_t shortestMetric = 0xffffffff;
 
   /* when sending on link-local multicast, there have to be interface specified */
-  if (dst == Ipv6Address::GetAllNodesMulticast () || dst.IsSolicitedMulticast () || 
-      dst == Ipv6Address::GetAllRoutersMulticast () || dst == Ipv6Address::GetAllHostsMulticast ())
+  if (dst == Ipv6Address::GetAllNodesMulticast () || dst.IsSolicitedMulticast ()
+      || dst == Ipv6Address::GetAllRoutersMulticast () || dst == Ipv6Address::GetAllHostsMulticast ())
     {
       NS_ASSERT_MSG (interface, "Try to send on link-local multicast address, and no interface index is given!");
       rtentry = Create<Ipv6Route> ();
@@ -294,7 +316,7 @@
         }
     }
 
-  if(rtentry)
+  if (rtentry)
     {
       NS_LOG_LOGIC ("Matching route via " << rtentry->GetDestination () << " (throught " << rtentry->GetGateway () << ") at the end");
     }
@@ -364,13 +386,13 @@
                     }
                 }
               return mrtentry;
-            } 
+            }
         }
     }
   return mrtentry;
 }
 
-uint32_t Ipv6StaticRouting::GetNRoutes ()
+uint32_t Ipv6StaticRouting::GetNRoutes () const
 {
   return m_networkRoutes.size ();
 }
@@ -413,12 +435,12 @@
     }
 }
 
-Ipv6RoutingTableEntry Ipv6StaticRouting::GetRoute (uint32_t index)
+Ipv6RoutingTableEntry Ipv6StaticRouting::GetRoute (uint32_t index) const
 {
   NS_LOG_FUNCTION (this << index);
   uint32_t tmp = 0;
 
-  for (NetworkRoutesI it = m_networkRoutes.begin (); it != m_networkRoutes.end (); it++)
+  for (NetworkRoutesCI it = m_networkRoutes.begin (); it != m_networkRoutes.end (); it++)
     {
       if (tmp == index)
         {
@@ -431,12 +453,12 @@
   return 0;
 }
 
-uint32_t Ipv6StaticRouting::GetMetric (uint32_t index)
+uint32_t Ipv6StaticRouting::GetMetric (uint32_t index) const
 {
   NS_LOG_FUNCTION_NOARGS ();
   uint32_t tmp = 0;
 
-  for (NetworkRoutesI it = m_networkRoutes.begin (); it != m_networkRoutes.end (); it++)
+  for (NetworkRoutesCI it = m_networkRoutes.begin (); it != m_networkRoutes.end (); it++)
     {
       if (tmp == index)
         {
@@ -474,8 +496,8 @@
   for (NetworkRoutesI it = m_networkRoutes.begin (); it != m_networkRoutes.end (); it++)
     {
       Ipv6RoutingTableEntry* rtentry = it->first;
-      if (network == rtentry->GetDest () && rtentry->GetInterface () == ifIndex && 
-          rtentry->GetPrefixToUse () == prefixToUse)
+      if (network == rtentry->GetDest () && rtentry->GetInterface () == ifIndex
+          && rtentry->GetPrefixToUse () == prefixToUse)
         {
           delete it->first;
           m_networkRoutes.erase (it);
@@ -568,7 +590,7 @@
               lcb (p, header, iif);
               return true;
             }
-          NS_LOG_LOGIC ("Address "<< addr << " not a match");
+          NS_LOG_LOGIC ("Address " << addr << " not a match");
         }
     }
   // Check if input device supports IP forwarding
@@ -599,8 +621,8 @@
 {
   for (uint32_t j = 0; j < m_ipv6->GetNAddresses (i); j++)
     {
-      if (m_ipv6->GetAddress (i, j).GetAddress () != Ipv6Address () &&
-          m_ipv6->GetAddress (i, j).GetPrefix () != Ipv6Prefix ())
+      if (m_ipv6->GetAddress (i, j).GetAddress () != Ipv6Address ()
+          && m_ipv6->GetAddress (i, j).GetPrefix () != Ipv6Prefix ())
         {
           if (m_ipv6->GetAddress (i, j).GetPrefix () == Ipv6Prefix (128))
             {
@@ -670,10 +692,10 @@
     {
       Ipv6RoutingTableEntry route = GetRoute (j);
 
-      if (route.GetInterface () == interface &&
-          route.IsNetwork () &&
-          route.GetDestNetwork () == networkAddress &&
-          route.GetDestNetworkPrefix () == networkMask)
+      if (route.GetInterface () == interface
+          && route.IsNetwork ()
+          && route.GetDestNetwork () == networkAddress
+          && route.GetDestNetworkPrefix () == networkMask)
         {
           RemoveRoute (j);
         }
@@ -716,7 +738,7 @@
             {
               delete j->first;
               m_networkRoutes.erase (j);
-            } 
+            }
         }
     }
   else
@@ -736,7 +758,7 @@
 
   if (dest == Ipv6Address::GetAllNodesMulticast () || dest == Ipv6Address::GetAllRoutersMulticast () || dest == Ipv6Address::GetAllHostsMulticast ())
     {
-      return ret; 
+      return ret;
     }
 
   /* useally IPv6 interfaces have one link-local address and one global address */
--- a/src/internet/model/ipv6-static-routing.h	Wed Apr 11 11:00:27 2012 +0200
+++ b/src/internet/model/ipv6-static-routing.h	Wed Apr 11 13:49:33 2012 +0200
@@ -31,8 +31,7 @@
 #include "ns3/ipv6-header.h"
 #include "ns3/ipv6-routing-protocol.h"
 
-namespace ns3
-{
+namespace ns3 {
 
 class Packet;
 class NetDevice;
@@ -133,7 +132,7 @@
    * \brief Get the number or entries in the routing table.
    * \return number of entries
    */
-  uint32_t GetNRoutes ();
+  uint32_t GetNRoutes () const;
 
   /**
    * \brief Get the default route.
@@ -148,14 +147,14 @@
    * \param i index
    * \return the route whose index is i
    */
-  Ipv6RoutingTableEntry GetRoute (uint32_t i);
+  Ipv6RoutingTableEntry GetRoute (uint32_t i) const;
 
   /**
    * \brief Get a metric for route from the static unicast routing table.
    * \param index The index (into the routing table) of the route to retrieve.
    * \return If route is set, the metric is returned. If not, an infinity metric (0xffffffff) is returned
    */
-  uint32_t GetMetric (uint32_t index);
+  uint32_t GetMetric (uint32_t index) const;
 
   /**
    * \brief Remove a route from the routing table.
@@ -237,11 +236,18 @@
   virtual void NotifyRemoveRoute (Ipv6Address dst, Ipv6Prefix mask, Ipv6Address nextHop, uint32_t interface, Ipv6Address prefixToUse = Ipv6Address::GetZero ());
   virtual void SetIpv6 (Ptr<Ipv6> ipv6);
 
+  /**
+   * \brief Print the Routing Table entries
+   *
+   * \param stream the ostream the Routing table is printed to
+   */
+  virtual void PrintRoutingTable (Ptr<OutputStreamWrapper> stream) const;
+
 protected:
   /**
    * \brief Dispose this object.
    */
-  void DoDispose ();
+  virtual void DoDispose ();
 
 private:
   typedef std::list<std::pair <Ipv6RoutingTableEntry *, uint32_t> > NetworkRoutes;
--- a/src/internet/model/nsc-tcp-l4-protocol.cc	Wed Apr 11 11:00:27 2012 +0200
+++ b/src/internet/model/nsc-tcp-l4-protocol.cc	Wed Apr 11 13:49:33 2012 +0200
@@ -440,23 +440,17 @@
 
       if (i == 1)
         {
-          // We need to come up with a default gateway here. Can't guarantee this to be
-          // correct really...
-
-          uint8_t addrBytes[4];
-          addr.Serialize (addrBytes);
-
-          // XXX: this is all a bit of a horrible hack
+          // The NSC stack requires a default gateway and only supports
+          // single-interface nodes.  The below is a hack, but
+          // it turns out that we can pass the interface address to nsc as
+          // a default gateway.  Bug 1398 has been opened to track this
+          // issue (NSC's limitation to single-interface nodes)
           //
-          // Just increment the last octet, this gives a decent chance of this being
-          // 'enough'.
-          //
-          // All we need is another address on the same network as the interface. This
-          // will force the stack to output the packet out of the network interface.
-          addrBytes[3]++;
-          addr.Deserialize (addrBytes);
-          addrOss.str ("");
-          addr.Print (addrOss);
+          // Previous versions of this code tried to assign the "next"
+          // IP address of the subnet but this was found to fail for
+          // some use cases in /30 subnets.
+
+          // XXX
           m_nscStack->add_default_gateway (addrOss.str ().c_str ());
         }
     }
--- a/src/internet/model/nsc-tcp-socket-impl.cc	Wed Apr 11 11:00:27 2012 +0200
+++ b/src/internet/model/nsc-tcp-socket-impl.cc	Wed Apr 11 13:49:33 2012 +0200
@@ -497,7 +497,7 @@
 
   if (0 == m_nscTcpSocket->getpeername ((struct sockaddr*) &sin, &sin_len)) {
       m_remotePort = ntohs (sin.sin_port);
-      m_remoteAddress = m_remoteAddress.Deserialize ((const uint8_t*) &sin.sin_addr);
+      m_remoteAddress = Ipv4Address::Deserialize ((const uint8_t*) &sin.sin_addr);
       m_peerAddress = InetSocketAddress (m_remoteAddress, m_remotePort);
     }
 
@@ -510,7 +510,7 @@
   sin_len = sizeof(sin);
 
   if (0 == m_nscTcpSocket->getsockname ((struct sockaddr *) &sin, &sin_len))
-    m_localAddress = m_localAddress.Deserialize ((const uint8_t*) &sin.sin_addr);
+    m_localAddress = Ipv4Address::Deserialize ((const uint8_t*) &sin.sin_addr);
 
   NS_LOG_LOGIC ("NscTcpSocketImpl " << this << " accepted connection from " 
                                     << m_remoteAddress << ":" << m_remotePort
@@ -529,7 +529,7 @@
   struct sockaddr_in sin;
   size_t sin_len = sizeof(sin);
   if (0 == m_nscTcpSocket->getsockname ((struct sockaddr *) &sin, &sin_len)) {
-      m_localAddress = m_localAddress.Deserialize ((const uint8_t*)&sin.sin_addr);
+      m_localAddress = Ipv4Address::Deserialize ((const uint8_t*)&sin.sin_addr);
       m_localPort = ntohs (sin.sin_port);
     }
 
--- a/src/internet/model/rtt-estimator.cc	Wed Apr 11 11:00:27 2012 +0200
+++ b/src/internet/model/rtt-estimator.cc	Wed Apr 11 13:49:33 2012 +0200
@@ -30,27 +30,30 @@
 #include "rtt-estimator.h"
 #include "ns3/simulator.h"
 #include "ns3/double.h"
+#include "ns3/integer.h"
+#include "ns3/uinteger.h"
+#include "ns3/log.h"
+
+NS_LOG_COMPONENT_DEFINE ("RttEstimator");
 
 namespace ns3 {
 
 NS_OBJECT_ENSURE_REGISTERED (RttEstimator);
 
-//RttEstimator iid
 TypeId 
 RttEstimator::GetTypeId (void)
 {
   static TypeId tid = TypeId ("ns3::RttEstimator")
     .SetParent<Object> ()
     .AddAttribute ("MaxMultiplier", 
-                   "XXX",
-                   DoubleValue (64.0),
-                   MakeDoubleAccessor (&RttEstimator::m_maxMultiplier),
-                   MakeDoubleChecker<double> ())
+                   "Maximum RTO Multiplier",
+                   UintegerValue (64),
+                   MakeUintegerAccessor (&RttEstimator::m_maxMultiplier),
+                   MakeUintegerChecker<uint16_t> ())
     .AddAttribute ("InitialEstimation", 
-                   "XXX",
+                   "Initial RTT estimation",
                    TimeValue (Seconds (1.0)),
-                   MakeTimeAccessor (&RttEstimator::SetEstimate,
-                                     &RttEstimator::GetEstimate),
+                   MakeTimeAccessor (&RttEstimator::m_initialEstimatedRtt),
                    MakeTimeChecker ())
     .AddAttribute ("MinRTO", 
                    "Minimum retransmit timeout value",
@@ -65,22 +68,24 @@
 void 
 RttEstimator::SetMinRto (Time minRto)
 {
-  minrto = minRto;
+  NS_LOG_FUNCTION (this << minRto);
+  m_minRto = minRto;
 }
 Time 
 RttEstimator::GetMinRto (void) const
 {
-  return Time (minrto);
+  return m_minRto;
 }
 void 
-RttEstimator::SetEstimate (Time estimate)
+RttEstimator::SetCurrentEstimate (Time estimate)
 {
-  est = estimate;
+  NS_LOG_FUNCTION (this << estimate);
+  m_currentEstimatedRtt = estimate;
 }
 Time 
-RttEstimator::GetEstimate (void) const
+RttEstimator::GetCurrentEstimate (void) const
 {
-  return Time (est);
+  return m_currentEstimatedRtt;
 }
 
 
@@ -88,52 +93,68 @@
 RttHistory::RttHistory (SequenceNumber32 s, uint32_t c, Time t)
   : seq (s), count (c), time (t), retx (false)
 {
+  NS_LOG_FUNCTION (this);
 }
 
 RttHistory::RttHistory (const RttHistory& h)
   : seq (h.seq), count (h.count), time (h.time), retx (h.retx)
 {
+  NS_LOG_FUNCTION (this);
 }
 
 // Base class methods
 
-RttEstimator::RttEstimator () : next (1), history (),
-                                nSamples (0), multiplier (1.0)
+RttEstimator::RttEstimator ()
+  : m_next (1), m_history (),
+    m_nSamples (0),
+    m_multiplier (1)
 { 
+  NS_LOG_FUNCTION (this);
   //note next=1 everywhere since first segment will have sequence 1
+  
+  // We need attributes initialized here, not later, so use the 
+  // ConstructSelf() technique documented in the manual
+  ObjectBase::ConstructSelf (AttributeConstructionList ());
+  m_currentEstimatedRtt = m_initialEstimatedRtt;
+  NS_LOG_DEBUG ("Initialize m_currentEstimatedRtt to " << m_currentEstimatedRtt.GetSeconds () << " sec.");
 }
 
-RttEstimator::RttEstimator(const RttEstimator& c)
-  : Object (c), next (c.next), history (c.history),
-    m_maxMultiplier (c.m_maxMultiplier), est (c.est),
-    minrto (c.minrto), nSamples (c.nSamples),
-    multiplier (c.multiplier)
+RttEstimator::RttEstimator (const RttEstimator& c)
+  : Object (c), m_next (c.m_next), m_history (c.m_history), 
+    m_maxMultiplier (c.m_maxMultiplier), 
+    m_initialEstimatedRtt (c.m_initialEstimatedRtt),
+    m_currentEstimatedRtt (c.m_currentEstimatedRtt), m_minRto (c.m_minRto),
+    m_nSamples (c.m_nSamples), m_multiplier (c.m_multiplier)
 {
+  NS_LOG_FUNCTION (this);
 }
 
 RttEstimator::~RttEstimator ()
 {
+  NS_LOG_FUNCTION (this);
 }
 
-void RttEstimator::SentSeq (SequenceNumber32 s, uint32_t c)
-{ // Note that a particular sequence has been sent
-  if (s == next)
+void RttEstimator::SentSeq (SequenceNumber32 seq, uint32_t size)
+{ 
+  NS_LOG_FUNCTION (this << seq << size);
+  // Note that a particular sequence has been sent
+  if (seq == m_next)
     { // This is the next expected one, just log at end
-      history.push_back (RttHistory (s, c, Simulator::Now () ));
-      next = s + SequenceNumber32 (c); // Update next expected
+      m_history.push_back (RttHistory (seq, size, Simulator::Now () ));
+      m_next = seq + SequenceNumber32 (size); // Update next expected
     }
   else
     { // This is a retransmit, find in list and mark as re-tx
-      for (RttHistory_t::iterator i = history.begin (); i != history.end (); ++i)
+      for (RttHistory_t::iterator i = m_history.begin (); i != m_history.end (); ++i)
         {
-          if ((s >= i->seq) && (s < (i->seq + SequenceNumber32 (i->count))))
+          if ((seq >= i->seq) && (seq < (i->seq + SequenceNumber32 (i->count))))
             { // Found it
               i->retx = true;
               // One final test..be sure this re-tx does not extend "next"
-              if ((s + SequenceNumber32 (c)) > next)
+              if ((seq + SequenceNumber32 (size)) > m_next)
                 {
-                  next = s + SequenceNumber32 (c);
-                  i->count = ((s + SequenceNumber32 (c)) - i->seq); // And update count in hist
+                  m_next = seq + SequenceNumber32 (size);
+                  i->count = ((seq + SequenceNumber32 (size)) - i->seq); // And update count in hist
                 }
               break;
             }
@@ -141,51 +162,60 @@
     }
 }
 
-Time RttEstimator::AckSeq (SequenceNumber32 a)
-{ // An ack has been received, calculate rtt and log this measurement
+Time RttEstimator::AckSeq (SequenceNumber32 ackSeq)
+{ 
+  NS_LOG_FUNCTION (this << ackSeq);
+  // An ack has been received, calculate rtt and log this measurement
   // Note we use a linear search (O(n)) for this since for the common
   // case the ack'ed packet will be at the head of the list
   Time m = Seconds (0.0);
-  if (history.size () == 0) return (m);    // No pending history, just exit
-  RttHistory& h = history.front ();
-  if (!h.retx && a >= (h.seq + SequenceNumber32 (h.count)))
+  if (m_history.size () == 0) return (m);    // No pending history, just exit
+  RttHistory& h = m_history.front ();
+  if (!h.retx && ackSeq >= (h.seq + SequenceNumber32 (h.count)))
     { // Ok to use this sample
       m = Simulator::Now () - h.time; // Elapsed time
       Measurement (m);                // Log the measurement
       ResetMultiplier ();             // Reset multiplier on valid measurement
     }
   // Now delete all ack history with seq <= ack
-  while(history.size () > 0)
+  while(m_history.size () > 0)
     {
-      RttHistory& h = history.front ();
-      if ((h.seq + SequenceNumber32 (h.count)) > a) break;               // Done removing
-      history.pop_front (); // Remove
+      RttHistory& h = m_history.front ();
+      if ((h.seq + SequenceNumber32 (h.count)) > ackSeq) break;               // Done removing
+      m_history.pop_front (); // Remove
     }
   return m;
 }
 
 void RttEstimator::ClearSent ()
-{ // Clear all history entries
-  next = 1;
-  history.clear ();
+{ 
+  NS_LOG_FUNCTION (this);
+  // Clear all history entries
+  m_next = 1;
+  m_history.clear ();
 }
 
 void RttEstimator::IncreaseMultiplier ()
 {
-  multiplier = std::min (multiplier * 2.0, m_maxMultiplier);
+  NS_LOG_FUNCTION (this);
+  m_multiplier = (m_multiplier*2 < m_maxMultiplier) ? m_multiplier*2 : m_maxMultiplier;
+  NS_LOG_DEBUG ("Multiplier increased to " << m_multiplier);
 }
 
 void RttEstimator::ResetMultiplier ()
 {
-  multiplier = 1.0;
+  NS_LOG_FUNCTION (this);
+  m_multiplier = 1;
 }
 
 void RttEstimator::Reset ()
-{ // Reset to initial state
-  next = 1;
-  est = 1; // XXX: we should go back to the 'initial value' here. Need to add support in Object for this.
-  history.clear ();         // Remove all info from the history
-  nSamples = 0;
+{ 
+  NS_LOG_FUNCTION (this);
+  // Reset to initial state
+  m_next = 1;
+  m_currentEstimatedRtt = m_initialEstimatedRtt;
+  m_history.clear ();         // Remove all info from the history
+  m_nSamples = 0;
   ResetMultiplier ();
 }
 
@@ -204,66 +234,90 @@
     .SetParent<RttEstimator> ()
     .AddConstructor<RttMeanDeviation> ()
     .AddAttribute ("Gain",
-                   "XXX",
+                   "Gain used in estimating the RTT, must be 0 < Gain < 1",
                    DoubleValue (0.1),
-                   MakeDoubleAccessor (&RttMeanDeviation::gain),
+                   MakeDoubleAccessor (&RttMeanDeviation::m_gain),
                    MakeDoubleChecker<double> ())
   ;
   return tid;
 }
 
 RttMeanDeviation::RttMeanDeviation() :
-  variance (0) 
+  m_variance (0) 
 { 
+  NS_LOG_FUNCTION (this);
 }
 
 RttMeanDeviation::RttMeanDeviation (const RttMeanDeviation& c)
-  : RttEstimator (c), gain (c.gain), variance (c.variance)
+  : RttEstimator (c), m_gain (c.m_gain), m_variance (c.m_variance)
 {
+  NS_LOG_FUNCTION (this);
 }
 
 void RttMeanDeviation::Measurement (Time m)
 {
-  if (nSamples)
+  NS_LOG_FUNCTION (this << m);
+  if (m_nSamples)
     { // Not first
-      int64x64_t err = m - est;
-      est = est + gain * err;         // estimated rtt
-      variance = variance + gain * (Abs (err) - variance); // variance of rtt
+      Time err (m - m_currentEstimatedRtt);
+      double gErr = err.ToDouble (Time::S) * m_gain;
+      m_currentEstimatedRtt += Time::FromDouble (gErr, Time::S);
+      Time difference = Abs (err) - m_variance;
+      NS_LOG_DEBUG ("m_variance += " << Time::FromDouble (difference.ToDouble (Time::S) * m_gain, Time::S));
+      m_variance += Time::FromDouble (difference.ToDouble (Time::S) * m_gain, Time::S);
     }
   else
     { // First sample
-      est = m;                        // Set estimate to current
+      m_currentEstimatedRtt = m;             // Set estimate to current
       //variance = sample / 2;               // And variance to current / 2
-      variance = m; // try this
+      m_variance = m; // try this
+      NS_LOG_DEBUG ("(first sample) m_variance += " << m);
     }
-  nSamples++;
+  m_nSamples++;
 }
 
 Time RttMeanDeviation::RetransmitTimeout ()
 {
-  // If not enough samples, justjust return 2 times estimate
+  NS_LOG_FUNCTION (this);
+  // If not enough samples, just return 2 times estimate
   //if (nSamples < 2) return est * 2;
-  int64x64_t retval;
-  if (variance < est / 4.0)
+  Time retval (Seconds (0));
+  double var = m_variance.ToDouble (Time::S);
+  NS_LOG_DEBUG ("RetransmitTimeout:  var " << var << " est " << m_currentEstimatedRtt.ToDouble (Time::S) << " multiplier " << m_multiplier);
+  if (var < (m_currentEstimatedRtt.ToDouble (Time::S) / 4.0) )
     {
-      retval = est * 2 * multiplier;            // At least twice current est
+      for (uint16_t i = 0; i < 2* m_multiplier; i++)
+        {
+          retval += m_currentEstimatedRtt;
+        }
     }
   else
     {
-      retval = (est + 4 * variance) * multiplier; // As suggested by Jacobson
+      int64_t temp = m_currentEstimatedRtt.ToInteger (Time::S) + 4 * m_variance.ToInteger (Time::S);
+      retval = Time::FromInteger (temp, Time::S);
     }
-  retval = Max (retval, minrto);
-  return Time (retval);
+  NS_LOG_DEBUG ("RetransmitTimeout:  return " << (retval > m_minRto ? retval.GetSeconds () : m_minRto.GetSeconds ()));
+  return (retval > m_minRto ? retval : m_minRto);  // return maximum
 }
 
 Ptr<RttEstimator> RttMeanDeviation::Copy () const
 {
+  NS_LOG_FUNCTION (this);
   return CopyObject<RttMeanDeviation> (this);
 }
 
 void RttMeanDeviation::Reset ()
-{ // Reset to initial state
-  variance = 0;
+{ 
+  NS_LOG_FUNCTION (this);
+  // Reset to initial state
+  m_variance = Seconds (0);
   RttEstimator::Reset ();
 }
-} //namepsace ns3
+void RttMeanDeviation::Gain (double g)
+{
+  NS_LOG_FUNCTION (this);
+  NS_ASSERT_MSG( (g > 0) && (g < 1), "RttMeanDeviation: Gain must be less than 1 and greater than 0" );
+  m_gain = g;
+}
+
+} //namespace ns3
--- a/src/internet/model/rtt-estimator.h	Wed Apr 11 11:00:27 2012 +0200
+++ b/src/internet/model/rtt-estimator.h	Wed Apr 11 13:49:33 2012 +0200
@@ -35,14 +35,14 @@
 /**
  * \ingroup tcp
  *
- * \brief Implements several variations of round trip time estimators
+ * \brief Helper class to store RTT measurements
  */
 class RttHistory {
 public:
   RttHistory (SequenceNumber32 s, uint32_t c, Time t);
   RttHistory (const RttHistory& h); // Copy constructor
 public:
-  SequenceNumber32  seq;    // First sequence number in packet sent
+  SequenceNumber32  seq;  // First sequence number in packet sent
   uint32_t        count;  // Number of bytes sent
   Time            time;   // Time this one was sent
   bool            retx;   // True if this has been retransmitted
@@ -50,68 +50,151 @@
 
 typedef std::deque<RttHistory> RttHistory_t;
 
-class RttEstimator : public Object {  //  Base class for all RTT Estimators
+/**
+ * \ingroup tcp
+ *
+ * \brief Base class for all RTT Estimators
+ */
+class RttEstimator : public Object {
 public:
   static TypeId GetTypeId (void);
 
   RttEstimator();
-  RttEstimator(const RttEstimator&); // Copy constructor
+  RttEstimator (const RttEstimator&); 
+
   virtual ~RttEstimator();
 
-  virtual void SentSeq (SequenceNumber32, uint32_t);
-  virtual Time AckSeq (SequenceNumber32);
+  /**
+   * \brief Note that a particular sequence has been sent
+   * \param seq the packet sequence number.
+   * \param size the packet size.
+   */
+  virtual void SentSeq (SequenceNumber32 seq, uint32_t size);
+
+  /**
+   * \brief Note that a particular ack sequence has been received
+   * \param ackSeq the ack sequence number.
+   * \return The measured RTT for this ack.
+   */
+  virtual Time AckSeq (SequenceNumber32 ackSeq);
+
+  /**
+   * \brief Clear all history entries
+   */
   virtual void ClearSent ();
-  virtual void   Measurement (Time t) = 0;
+
+  /**
+   * \brief Add a new measurement to the estimator. Pure virtual function.
+   * \param t the new RTT measure.
+   */
+  virtual void  Measurement (Time t) = 0;
+
+  /**
+   * \brief Returns the estimated RTO. Pure virtual function.
+   * \return the estimated RTO.
+   */
   virtual Time RetransmitTimeout () = 0;
-  void Init (SequenceNumber32 s) { next = s; }
+
   virtual Ptr<RttEstimator> Copy () const = 0;
+
+  /**
+   * \brief Increase the estimation multiplier up to MaxMultiplier.
+   */
   virtual void IncreaseMultiplier ();
+
+  /**
+   * \brief Resets the estimation multiplier to 1.
+   */
   virtual void ResetMultiplier ();
+
+  /**
+   * \brief Resets the estimation to its initial state.
+   */
   virtual void Reset ();
 
+  /**
+   * \brief Sets the Minimum RTO.
+   * \param minRto The minimum RTO returned by the estimator.
+   */
   void SetMinRto (Time minRto);
+
+  /**
+   * \brief Get the Minimum RTO.
+   * \return The minimum RTO returned by the estimator.
+   */
   Time GetMinRto (void) const;
-  void SetEstimate (Time estimate);
-  Time GetEstimate (void) const;
+
+  /**
+   * \brief Sets the current RTT estimate (forcefully).
+   * \param estimate The current RTT estimate.
+   */
+  void SetCurrentEstimate (Time estimate);
+
+  /**
+   * \brief gets the current RTT estimate.
+   * \return The current RTT estimate.
+   */
+  Time GetCurrentEstimate (void) const;
 
 private:
-  SequenceNumber32        next;    // Next expected sequence to be sent
-  RttHistory_t history; // List of sent packet
-  double m_maxMultiplier;
-public:
-  int64x64_t       est;     // Current estimate
-  int64x64_t       minrto; // minimum value of the timeout
-  uint32_t      nSamples; // Number of samples
-  double       multiplier;   // RTO Multiplier
+  SequenceNumber32 m_next;    // Next expected sequence to be sent
+  RttHistory_t m_history;     // List of sent packet
+  uint16_t m_maxMultiplier;
+  Time m_initialEstimatedRtt;
+
+protected:
+  Time         m_currentEstimatedRtt;     // Current estimate
+  Time         m_minRto;                  // minimum value of the timeout
+  uint32_t     m_nSamples;                // Number of samples
+  uint16_t     m_multiplier;              // RTO Multiplier
 };
 
-// The "Mean-Deviation" estimator, as discussed by Van Jacobson
-// "Congestion Avoidance and Control", SIGCOMM 88, Appendix A
-
-//Doc:Class Class {\tt RttMeanDeviation} implements the "Mean--Deviation" estimator
-//Doc:Class as described by Van Jacobson
-//Doc:Class "Congestion Avoidance and Control", SIGCOMM 88, Appendix A
+/**
+ * \ingroup tcp
+ *
+ * \brief The "Mean--Deviation" RTT estimator, as discussed by Van Jacobson
+ *
+ * This class implements the "Mean--Deviation" RTT estimator, as discussed
+ * by Van Jacobson and Michael J. Karels, in
+ * "Congestion Avoidance and Control", SIGCOMM 88, Appendix A
+ *
+ */
 class RttMeanDeviation : public RttEstimator {
 public:
   static TypeId GetTypeId (void);
 
   RttMeanDeviation ();
 
+  RttMeanDeviation (const RttMeanDeviation&);
 
-  //Doc:Method
-  RttMeanDeviation (const RttMeanDeviation&); // Copy constructor
-  //Doc:Desc Copy constructor.
-  //Doc:Arg1 {\tt RttMeanDeviation} object to copy.
+  /**
+   * \brief Add a new measurement to the estimator.
+   * \param measure the new RTT measure.
+   */
+  void Measurement (Time measure);
 
-  void Measurement (Time);
+  /**
+   * \brief Returns the estimated RTO.
+   * \return the estimated RTO.
+   */
   Time RetransmitTimeout ();
+
   Ptr<RttEstimator> Copy () const;
+
+  /**
+   * \brief Resets sthe estimator.
+   */
   void Reset ();
-  void Gain (double g) { gain = g; }
 
-public:
-  double       gain;       // Filter gain
-  int64x64_t   variance;   // Current variance
+  /**
+   * \brief Sets the estimator Gain.
+   * \param g the gain, where 0 < g < 1.
+   */
+  void Gain (double g);
+
+private:
+  double       m_gain;       // Filter gain
+  Time         m_variance;   // Current variance
 };
 } // namespace ns3
 
--- a/src/internet/model/tcp-socket-base.cc	Wed Apr 11 11:00:27 2012 +0200
+++ b/src/internet/model/tcp-socket-base.cc	Wed Apr 11 13:49:33 2012 +0200
@@ -105,7 +105,8 @@
     m_node (0),
     m_tcp (0),
     m_rtt (0),
-    m_nextTxSequence (0),       // Change this for non-zero initial sequence number
+    m_nextTxSequence (0),
+    // Change this for non-zero initial sequence number
     m_highTxMark (0),
     m_rxBuffer (0),
     m_txBuffer (0),
@@ -116,14 +117,16 @@
     m_shutdownSend (false),
     m_shutdownRecv (false),
     m_connected (false),
-    m_segmentSize (0),          // For attribute initialization consistency (quiet valgrind)
+    m_segmentSize (0),
+    // For attribute initialization consistency (quiet valgrind)
     m_rWnd (0)
 {
   NS_LOG_FUNCTION (this);
 }
 
 TcpSocketBase::TcpSocketBase (const TcpSocketBase& sock)
-  : TcpSocket (sock), //copy object::m_tid and socket::callbacks
+  : TcpSocket (sock),
+    //copy object::m_tid and socket::callbacks
     m_dupAckCount (sock.m_dupAckCount),
     m_delAckCount (0),
     m_delAckMaxCount (sock.m_delAckMaxCount),
@@ -246,10 +249,9 @@
 int
 TcpSocketBase::Bind (void)
 {
-  NS_LOG_FUNCTION_NOARGS ();
+  NS_LOG_FUNCTION (this);
   m_endPoint = m_tcp->Allocate ();
-  m_endPoint6 = m_tcp->Allocate6 ();
-  if (0 == m_endPoint || 0 == m_endPoint6)
+  if (0 == m_endPoint)
     {
       m_errno = ERROR_ADDRNOTAVAIL;
       return -1;
@@ -261,7 +263,15 @@
 int
 TcpSocketBase::Bind6 (void)
 {
-  return Bind ();
+  NS_LOG_FUNCTION (this);
+  m_endPoint6 = m_tcp->Allocate6 ();
+  if (0 == m_endPoint6)
+    {
+      m_errno = ERROR_ADDRNOTAVAIL;
+      return -1;
+    }
+  m_tcp->m_sockets.push_back (this);
+  return SetupCallback ();
 }
 
 /** Inherit from Socket class: Bind socket (with specific address) to an end-point in TcpL4Protocol */
@@ -341,7 +351,7 @@
   NS_LOG_FUNCTION (this << address);
 
   // If haven't do so, Bind() this socket first
-  if (InetSocketAddress::IsMatchingType (address))
+  if (InetSocketAddress::IsMatchingType (address) && m_endPoint6 == 0)
     {
       if (m_endPoint == 0)
         {
@@ -362,7 +372,7 @@
           return -1;
         }
     }
-  else if (Inet6SocketAddress::IsMatchingType (address) )
+  else if (Inet6SocketAddress::IsMatchingType (address)  && m_endPoint == 0)
     {
       // If we are operating on a v4-mapped address, translate the address to
       // a v4 address and re-call this function
@@ -371,7 +381,7 @@
       if (v6Addr.IsIpv4MappedAddress () == true)
         {
           Ipv4Address v4Addr = v6Addr.GetIpv4MappedAddress ();
-          return Connect(InetSocketAddress(v4Addr, transport.GetPort ()));
+          return Connect (InetSocketAddress (v4Addr, transport.GetPort ()));
         }
 
       if (m_endPoint6 == 0)
@@ -629,7 +639,7 @@
     }
   if (m_endPoint != 0)
     {
-      m_endPoint->SetRxCallback (MakeCallback (&TcpSocketBase::ForwardUp, Ptr<TcpSocketBase> (this))); 
+      m_endPoint->SetRxCallback (MakeCallback (&TcpSocketBase::ForwardUp, Ptr<TcpSocketBase> (this)));
       m_endPoint->SetDestroyCallback (MakeCallback (&TcpSocketBase::Destroy, Ptr<TcpSocketBase> (this)));
     }
   if (m_endPoint6 != 0)
@@ -712,8 +722,14 @@
 {
   NS_LOG_FUNCTION (this);
 
-  if (!m_closeNotified) NotifyNormalClose ();
-  if (m_state != TIME_WAIT) DeallocateEndPoint ();
+  if (!m_closeNotified)
+    {
+      NotifyNormalClose ();
+    }
+  if (m_state != TIME_WAIT)
+    {
+      DeallocateEndPoint ();
+    }
   m_closeNotified = true;
   NS_LOG_INFO (TcpStateName[m_state] << " -> CLOSED");
   CancelAllTimers ();
@@ -734,7 +750,7 @@
     { // In LAST_ACK and CLOSING states, it only wait for an ACK and the
       // sequence number must equals to m_rxBuffer.NextRxSequence ()
       return (m_rxBuffer.NextRxSequence () != head);
-    };
+    }
 
   // In all other cases, check if the sequence number is in range
   return (tail < m_rxBuffer.NextRxSequence () || m_rxBuffer.MaxRxSequence () <= head);
@@ -775,7 +791,7 @@
   TcpHeader tcpHeader;
   packet->RemoveHeader (tcpHeader);
   if (tcpHeader.GetFlags () & TcpHeader::ACK)
-    { 
+    {
       EstimateRtt (tcpHeader);
     }
   ReadOptions (tcpHeader);
@@ -789,12 +805,12 @@
   m_rWnd = tcpHeader.GetWindowSize ();
 
   // Discard fully out of range data packets
-  if (packet->GetSize () &&
-      OutOfRange (tcpHeader.GetSequenceNumber (), tcpHeader.GetSequenceNumber () + packet->GetSize ()))
+  if (packet->GetSize ()
+      && OutOfRange (tcpHeader.GetSequenceNumber (), tcpHeader.GetSequenceNumber () + packet->GetSize ()))
     {
       NS_LOG_LOGIC ("At state " << TcpStateName[m_state] <<
                     " received packet of seq [" << tcpHeader.GetSequenceNumber () <<
-                    ":" << tcpHeader.GetSequenceNumber () + packet->GetSize() <<
+                    ":" << tcpHeader.GetSequenceNumber () + packet->GetSize () <<
                     ") out of range [" << m_rxBuffer.NextRxSequence () << ":" <<
                     m_rxBuffer.MaxRxSequence () << ")");
       // Acknowledgement should be sent for all unacceptable packets (RFC793, p.69)
@@ -884,12 +900,12 @@
   m_rWnd = tcpHeader.GetWindowSize ();
 
   // Discard fully out of range packets
-  if (packet->GetSize () &&
-      OutOfRange (tcpHeader.GetSequenceNumber (), tcpHeader.GetSequenceNumber () + packet->GetSize ()))
+  if (packet->GetSize ()
+      && OutOfRange (tcpHeader.GetSequenceNumber (), tcpHeader.GetSequenceNumber () + packet->GetSize ()))
     {
       NS_LOG_LOGIC ("At state " << TcpStateName[m_state] <<
                     " received packet of seq [" << tcpHeader.GetSequenceNumber () <<
-                    ":" << tcpHeader.GetSequenceNumber () + packet->GetSize() <<
+                    ":" << tcpHeader.GetSequenceNumber () + packet->GetSize () <<
                     ") out of range [" << m_rxBuffer.NextRxSequence () << ":" <<
                     m_rxBuffer.MaxRxSequence () << ")");
       // Acknowledgement should be sent for all unacceptable packets (RFC793, p.69)
@@ -1045,11 +1061,17 @@
 
   // Fork a socket if received a SYN. Do nothing otherwise.
   // C.f.: the LISTEN part in tcp_v4_do_rcv() in tcp_ipv4.c in Linux kernel
-  if (tcpflags != TcpHeader::SYN) return;
+  if (tcpflags != TcpHeader::SYN)
+    {
+      return;
+    }
 
   // Call socket's notify function to let the server app know we got a SYN
   // If the server app refuses the connection, do nothing
-  if (!NotifyConnectionRequest (fromAddress)) return;
+  if (!NotifyConnectionRequest (fromAddress))
+    {
+      return;
+    }
   // Clone the socket, simulate fork
   Ptr<TcpSocketBase> newSock = Fork ();
   NS_LOG_LOGIC ("Cloned a TcpSocketBase " << newSock);
@@ -1108,7 +1130,7 @@
     { // Other in-sequence input
       if (tcpflags != TcpHeader::RST)
         { // When (1) rx of FIN+ACK; (2) rx of FIN; (3) rx of bad flags
-          NS_LOG_LOGIC ("Illegal flag " << std::hex << static_cast<uint32_t>(tcpflags) << std::dec << " received. Reset packet is sent.");
+          NS_LOG_LOGIC ("Illegal flag " << std::hex << static_cast<uint32_t> (tcpflags) << std::dec << " received. Reset packet is sent.");
           SendRST ();
         }
       CloseAndNotify ();
@@ -1125,9 +1147,9 @@
   // Extract the flags. PSH and URG are not honoured.
   uint8_t tcpflags = tcpHeader.GetFlags () & ~(TcpHeader::PSH | TcpHeader::URG);
 
-  if (tcpflags == 0 ||
-      (tcpflags == TcpHeader::ACK
-       && m_nextTxSequence + SequenceNumber32 (1) == tcpHeader.GetAckNumber ()))
+  if (tcpflags == 0
+      || (tcpflags == TcpHeader::ACK
+          && m_nextTxSequence + SequenceNumber32 (1) == tcpHeader.GetAckNumber ()))
     { // If it is bare data, accept it and move to ESTABLISHED state. This is
       // possibly due to ACK lost in 3WHS. If in-sequence ACK is received, the
       // handshake is completed nicely.
@@ -1221,8 +1243,8 @@
   else if (tcpflags == TcpHeader::ACK)
     { // Process the ACK, and if in FIN_WAIT_1, conditionally move to FIN_WAIT_2
       ReceivedAck (packet, tcpHeader);
-      if (m_state == FIN_WAIT_1 && m_txBuffer.Size () == 0 &&
-          tcpHeader.GetAckNumber () == m_highTxMark + SequenceNumber32 (1))
+      if (m_state == FIN_WAIT_1 && m_txBuffer.Size () == 0
+          && tcpHeader.GetAckNumber () == m_highTxMark + SequenceNumber32 (1))
         { // This ACK corresponds to the FIN sent
           NS_LOG_INFO ("FIN_WAIT_1 -> FIN_WAIT_2");
           m_state = FIN_WAIT_2;
@@ -1258,8 +1280,8 @@
         {
           NS_LOG_INFO ("FIN_WAIT_1 -> CLOSING");
           m_state = CLOSING;
-          if (m_txBuffer.Size () == 0 &&
-              tcpHeader.GetAckNumber () == m_highTxMark + SequenceNumber32 (1))
+          if (m_txBuffer.Size () == 0
+              && tcpHeader.GetAckNumber () == m_highTxMark + SequenceNumber32 (1))
             { // This ACK corresponds to the FIN sent
               TimeWait ();
             }
@@ -1267,9 +1289,12 @@
       else if (m_state == FIN_WAIT_2)
         {
           TimeWait ();
-        };
+        }
       SendEmptyPacket (TcpHeader::ACK);
-      if (!m_shutdownRecv) NotifyDataRecv ();
+      if (!m_shutdownRecv)
+        {
+          NotifyDataRecv ();
+        }
     }
 }
 
@@ -1348,11 +1373,11 @@
   NS_LOG_FUNCTION (this << tcpHeader);
 
   // Ignore all out of range packets
-  if (tcpHeader.GetSequenceNumber () < m_rxBuffer.NextRxSequence () ||
-      tcpHeader.GetSequenceNumber () > m_rxBuffer.MaxRxSequence ())
+  if (tcpHeader.GetSequenceNumber () < m_rxBuffer.NextRxSequence ()
+      || tcpHeader.GetSequenceNumber () > m_rxBuffer.MaxRxSequence ())
     {
       return;
-    };
+    }
   // For any case, remember the FIN position in rx buffer first
   m_rxBuffer.SetFinSequence (tcpHeader.GetSequenceNumber () + SequenceNumber32 (p->GetSize ()));
   NS_LOG_LOGIC ("Accepted FIN at seq " << tcpHeader.GetSequenceNumber () + SequenceNumber32 (p->GetSize ()));
@@ -1365,7 +1390,7 @@
   if (!m_rxBuffer.Finished ())
     {
       return;
-    };
+    }
 
   // Simultaneous close: Application invoked Close() when we are processing this FIN packet
   if (m_state == FIN_WAIT_1)
@@ -1770,8 +1795,11 @@
 TcpSocketBase::SendPendingData (bool withAck)
 {
   NS_LOG_FUNCTION (this << withAck);
-  if (m_txBuffer.Size () == 0) return false;  // Nothing to send
+  if (m_txBuffer.Size () == 0)
+    {
+      return false;                           // Nothing to send
 
+    }
   if (m_endPoint == 0 && m_endPoint6 == 0)
     {
       NS_LOG_INFO ("TcpSocketBase::SendPendingData: No endpoint; m_shutdownSend=" << m_shutdownSend);
@@ -1802,8 +1830,8 @@
         }
       // Nagle's algorithm (RFC896): Hold off sending if there is unacked data
       // in the buffer and the amount of data to send is less than one segment
-      if (!m_noDelay && UnAckDataCount () > 0 &&
-          m_txBuffer.SizeFromSequence (m_nextTxSequence) < m_segmentSize)
+      if (!m_noDelay && UnAckDataCount () > 0
+          && m_txBuffer.SizeFromSequence (m_nextTxSequence) < m_segmentSize)
         {
           NS_LOG_LOGIC ("Invoking Nagle's algorithm. Wait to send.");
           break;
@@ -1893,7 +1921,10 @@
   // Notify app to receive if necessary
   if (expectedSeq < m_rxBuffer.NextRxSequence ())
     { // NextRxSeq advanced, we have something to send to the app
-      if (!m_shutdownRecv) NotifyDataRecv ();
+      if (!m_shutdownRecv)
+        {
+          NotifyDataRecv ();
+        }
       // Handle exceptions
       if (m_closeNotified)
         {
@@ -1916,7 +1947,7 @@
   // (which should be ignored) is handled by m_rtt. Once timestamp option
   // is implemented, this function would be more elaborated.
   m_lastRtt = m_rtt->AckSeq (tcpHeader.GetAckNumber () );
-};
+}
 
 // Called by the ReceivedAck() when new ACK received and by ProcessSynRcvd()
 // when the three-way handshake completed. This cancels retransmission timer
@@ -1979,9 +2010,15 @@
   NS_LOG_FUNCTION (this);
   NS_LOG_LOGIC (this << " ReTxTimeout Expired at time " << Simulator::Now ().GetSeconds ());
   // If erroneous timeout in closed/timed-wait state, just return
-  if (m_state == CLOSED || m_state == TIME_WAIT) return;
+  if (m_state == CLOSED || m_state == TIME_WAIT)
+    {
+      return;
+    }
   // If all data are received (non-closing socket and nothing to send), just return
-  if (m_state <= ESTABLISHED && m_txBuffer.HeadSequence () >= m_highTxMark) return;
+  if (m_state <= ESTABLISHED && m_txBuffer.HeadSequence () >= m_highTxMark)
+    {
+      return;
+    }
 
   Retransmit ();
 }
@@ -2112,7 +2149,7 @@
   CancelAllTimers ();
   // Move from TIME_WAIT to CLOSED after 2*MSL. Max segment lifetime is 2 min
   // according to RFC793, p.28
-  m_timewaitEvent = Simulator::Schedule (Seconds (2*m_msl),
+  m_timewaitEvent = Simulator::Schedule (Seconds (2 * m_msl),
                                          &TcpSocketBase::CloseAndNotify, this);
 }
 
--- a/src/internet/model/udp-socket-impl.cc	Wed Apr 11 11:00:27 2012 +0200
+++ b/src/internet/model/udp-socket-impl.cc	Wed Apr 11 13:49:33 2012 +0200
@@ -872,7 +872,7 @@
     }
 
   // Should check via getsockopt ()..
-  if (this->m_recvpktinfo)
+  if (IsRecvPktInfo ())
     {
       Ipv4PacketInfoTag tag;
       packet->RemovePacketTag (tag);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/internet/test/ipv6-fragmentation-test.cc	Wed Apr 11 13:49:33 2012 +0200
@@ -0,0 +1,430 @@
+/* -*-  Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
+/*
+ * Copyright (c) 2011 Universita' di Firenze, Italy
+ *
+ * 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
+ *
+ * Author: Tommaso Pecorella <tommaso.pecorella@unifi.it>
+ */
+/**
+ * This is the test code for ipv6-l3protocol.cc (only the fragmentation and reassembly part).
+ */
+#define NS3_LOG_ENABLE 1
+
+#include "ns3/test.h"
+#include "ns3/config.h"
+#include "ns3/uinteger.h"
+#include "ns3/socket-factory.h"
+#include "ns3/ipv4-raw-socket-factory.h"
+#include "ns3/ipv6-raw-socket-factory.h"
+#include "ns3/udp-socket-factory.h"
+#include "ns3/simulator.h"
+#include "error-channel.h"
+#include "error-net-device.h"
+#include "ns3/drop-tail-queue.h"
+#include "ns3/socket.h"
+#include "ns3/udp-socket.h"
+
+#include "ns3/log.h"
+#include "ns3/node.h"
+#include "ns3/inet-socket-address.h"
+#include "ns3/boolean.h"
+
+#include "ns3/ipv6-static-routing.h"
+#include "ns3/ipv6-list-routing.h"
+#include "ns3/inet6-socket-address.h"
+#
+#include "ns3/arp-l3-protocol.h"
+#include "ns3/ipv4-l3-protocol.h"
+#include "ns3/icmpv4-l4-protocol.h"
+#include "ns3/ipv4-list-routing.h"
+#include "ns3/ipv4-static-routing.h"
+#include "ns3/udp-l4-protocol.h"
+
+#include "ns3/ipv6-l3-protocol.h"
+#include "ns3/icmpv6-l4-protocol.h"
+
+#include <string>
+#include <limits>
+#include <netinet/in.h>
+
+namespace ns3 {
+
+class UdpSocketImpl;
+
+static void
+AddInternetStack (Ptr<Node> node)
+{
+  //IPV6
+  Ptr<Ipv6L3Protocol> ipv6 = CreateObject<Ipv6L3Protocol> ();
+
+  //Routing for Ipv6
+  Ptr<Ipv6ListRouting> ipv6Routing = CreateObject<Ipv6ListRouting> ();
+  ipv6->SetRoutingProtocol (ipv6Routing);
+  Ptr<Ipv6StaticRouting> ipv6staticRouting = CreateObject<Ipv6StaticRouting> ();
+  ipv6Routing->AddRoutingProtocol (ipv6staticRouting, 0);
+  node->AggregateObject (ipv6);
+
+  //ICMPv6
+  Ptr<Icmpv6L4Protocol> icmp6 = CreateObject<Icmpv6L4Protocol> ();
+  node->AggregateObject (icmp6);
+
+  //Ipv6 Extensions
+  ipv6->RegisterExtensions ();
+  ipv6->RegisterOptions ();
+
+  //UDP
+  Ptr<UdpL4Protocol> udp = CreateObject<UdpL4Protocol> ();
+  node->AggregateObject (udp);
+}
+
+
+class Ipv6FragmentationTest : public TestCase
+{
+  Ptr<Packet> m_sentPacketClient;
+  Ptr<Packet> m_receivedPacketClient;
+  Ptr<Packet> m_receivedPacketServer;
+
+
+  Ptr<Socket> m_socketServer;
+  Ptr<Socket> m_socketClient;
+  uint32_t m_dataSize;
+  uint8_t *m_data;
+  uint32_t m_size;
+  uint8_t m_icmpType;
+  uint8_t m_icmpCode;
+
+public:
+  virtual void DoRun (void);
+  Ipv6FragmentationTest ();
+  ~Ipv6FragmentationTest ();
+
+  // server part
+  void StartServer (Ptr<Node> ServerNode);
+  void HandleReadServer (Ptr<Socket> socket);
+
+  // client part
+  void StartClient (Ptr<Node> ClientNode);
+  void HandleReadClient (Ptr<Socket> socket);
+  void HandleReadIcmpClient (Ipv6Address icmpSource, uint8_t icmpTtl, uint8_t icmpType,
+                             uint8_t icmpCode,uint32_t icmpInfo);
+
+  void SetFill (uint8_t *fill, uint32_t fillSize, uint32_t dataSize);
+  Ptr<Packet> SendClient (void);
+
+};
+
+
+Ipv6FragmentationTest::Ipv6FragmentationTest ()
+  : TestCase ("Verify the IPv6 layer 3 protocol fragmentation and reassembly")
+{
+  m_socketServer = 0;
+  m_data = 0;
+  m_dataSize = 0;
+}
+
+Ipv6FragmentationTest::~Ipv6FragmentationTest ()
+{
+  if ( m_data )
+    {
+      delete[] m_data;
+    }
+  m_data = 0;
+  m_dataSize = 0;
+}
+
+
+void
+Ipv6FragmentationTest::StartServer (Ptr<Node> ServerNode)
+{
+
+  if (m_socketServer == 0)
+    {
+      TypeId tid = TypeId::LookupByName ("ns3::UdpSocketFactory");
+      m_socketServer = Socket::CreateSocket (ServerNode, tid);
+      Inet6SocketAddress local = Inet6SocketAddress (Ipv6Address ("2001::1"), 9);
+      m_socketServer->Bind (local);
+      Ptr<UdpSocket> udpSocket = DynamicCast<UdpSocket> (m_socketServer);
+    }
+
+  m_socketServer->SetRecvCallback (MakeCallback (&Ipv6FragmentationTest::HandleReadServer, this));
+}
+
+void
+Ipv6FragmentationTest::HandleReadServer (Ptr<Socket> socket)
+{
+  Ptr<Packet> packet;
+  Address from;
+  while ((packet = socket->RecvFrom (from)))
+    {
+      if (Inet6SocketAddress::IsMatchingType (from))
+        {
+          packet->RemoveAllPacketTags ();
+          packet->RemoveAllByteTags ();
+
+          m_receivedPacketServer = packet->Copy ();
+        }
+    }
+}
+
+void
+Ipv6FragmentationTest::StartClient (Ptr<Node> ClientNode)
+{
+
+  if (m_socketClient == 0)
+    {
+      TypeId tid = TypeId::LookupByName ("ns3::UdpSocketFactory");
+      m_socketClient = Socket::CreateSocket (ClientNode, tid);
+      m_socketClient->Bind (Inet6SocketAddress (Ipv6Address::GetAny (), 9));
+      m_socketClient->Connect (Inet6SocketAddress (Ipv6Address ("2001::1"), 9));
+      CallbackValue cbValue = MakeCallback (&Ipv6FragmentationTest::HandleReadIcmpClient, this);
+      m_socketClient->SetAttribute ("IcmpCallback6", cbValue);
+    }
+
+  m_socketClient->SetRecvCallback (MakeCallback (&Ipv6FragmentationTest::HandleReadClient, this));
+}
+
+void
+Ipv6FragmentationTest::HandleReadClient (Ptr<Socket> socket)
+{
+  Ptr<Packet> packet;
+  Address from;
+  while ((packet = socket->RecvFrom (from)))
+    {
+      if (Inet6SocketAddress::IsMatchingType (from))
+        {
+          m_receivedPacketClient = packet->Copy ();
+        }
+    }
+}
+
+void
+Ipv6FragmentationTest::HandleReadIcmpClient (Ipv6Address icmpSource,
+                                             uint8_t icmpTtl, uint8_t icmpType,
+                                             uint8_t icmpCode, uint32_t icmpInfo)
+{
+  m_icmpType = icmpType;
+  m_icmpCode = icmpCode;
+}
+
+void
+Ipv6FragmentationTest::SetFill (uint8_t *fill, uint32_t fillSize, uint32_t dataSize)
+{
+  if (dataSize != m_dataSize)
+    {
+      delete [] m_data;
+      m_data = new uint8_t [dataSize];
+      m_dataSize = dataSize;
+    }
+
+  if (fillSize >= dataSize)
+    {
+      memcpy (m_data, fill, dataSize);
+      return;
+    }
+
+  uint32_t filled = 0;
+  while (filled + fillSize < dataSize)
+    {
+      memcpy (&m_data[filled], fill, fillSize);
+      filled += fillSize;
+    }
+
+  memcpy (&m_data[filled], fill, dataSize - filled);
+
+  m_size = dataSize;
+}
+
+Ptr<Packet> Ipv6FragmentationTest::SendClient (void)
+{
+  Ptr<Packet> p;
+  if (m_dataSize)
+    {
+      p = Create<Packet> (m_data, m_dataSize);
+    }
+  else
+    {
+      p = Create<Packet> (m_size);
+    }
+  m_socketClient->Send (p);
+
+  return p;
+}
+
+void
+Ipv6FragmentationTest::DoRun (void)
+{
+  // set the arp cache to something quite high
+  // we shouldn't need because the NetDevice used doesn't need arp, but still
+  // Config::SetDefault ("ns3::ArpCache::PendingQueueSize", UintegerValue (100));
+//  LogComponentEnable ("ErrorNetDevice", LOG_LEVEL_ALL);
+// LogComponentEnableAll(LOG_LEVEL_ALL);
+// Create topology
+
+  // Receiver Node
+  Ptr<Node> serverNode = CreateObject<Node> ();
+  AddInternetStack (serverNode);
+  Ptr<ErrorNetDevice> serverDev;
+  Ptr<BinaryErrorModel> serverDevErrorModel = CreateObject<BinaryErrorModel> ();
+  {
+    serverDev = CreateObject<ErrorNetDevice> ();
+    serverDev->SetAddress (Mac48Address::ConvertFrom (Mac48Address::Allocate ()));
+    serverDev->SetMtu (1500);
+    serverDev->SetReceiveErrorModel (serverDevErrorModel);
+    serverDevErrorModel->Disable ();
+    serverNode->AddDevice (serverDev);
+    Ptr<Ipv6> ipv6 = serverNode->GetObject<Ipv6> ();
+    uint32_t netdev_idx = ipv6->AddInterface (serverDev);
+    Ipv6InterfaceAddress ipv6Addr = Ipv6InterfaceAddress (Ipv6Address ("2001::1"), Ipv6Prefix (32));
+    ipv6->AddAddress (netdev_idx, ipv6Addr);
+    ipv6->SetUp (netdev_idx);
+  }
+  StartServer (serverNode);
+
+  // Sender Node
+  Ptr<Node> clientNode = CreateObject<Node> ();
+  AddInternetStack (clientNode);
+  Ptr<ErrorNetDevice> clientDev;
+  Ptr<BinaryErrorModel> clientDevErrorModel = CreateObject<BinaryErrorModel> ();
+  {
+    clientDev = CreateObject<ErrorNetDevice> ();
+    clientDev->SetAddress (Mac48Address::ConvertFrom (Mac48Address::Allocate ()));
+    clientDev->SetMtu (1000);
+    clientDev->SetReceiveErrorModel (clientDevErrorModel);
+    clientDevErrorModel->Disable ();
+    clientNode->AddDevice (clientDev);
+    Ptr<Ipv6> ipv6 = clientNode->GetObject<Ipv6> ();
+    uint32_t netdev_idx = ipv6->AddInterface (clientDev);
+    Ipv6InterfaceAddress ipv6Addr = Ipv6InterfaceAddress (Ipv6Address ("2001::2"), Ipv6Prefix (32));
+    ipv6->AddAddress (netdev_idx, ipv6Addr);
+    ipv6->SetUp (netdev_idx);
+  }
+  StartClient (clientNode);
+
+  // link the two nodes
+  Ptr<ErrorChannel> channel = CreateObject<ErrorChannel> ();
+  serverDev->SetChannel (channel);
+  clientDev->SetChannel (channel);
+  channel->SetJumpingTime (Seconds (0.5));
+
+
+  // some small packets, some rather big ones
+  uint32_t packetSizes[5] = {1000, 2000, 5000, 10000, 65000};
+
+  // using the alphabet
+  uint8_t fillData[78];
+  for ( uint32_t k = 48; k <= 125; k++ )
+    {
+      fillData[k - 48] = k;
+    }
+
+  // First test: normal channel, no errors, no delays
+  for ( int i = 0; i < 5; i++)
+    {
+      uint32_t packetSize = packetSizes[i];
+
+      SetFill (fillData, 78, packetSize);
+
+      m_receivedPacketServer = Create<Packet> ();
+      Simulator::ScheduleWithContext (m_socketClient->GetNode ()->GetId (), Seconds (0),
+                                      &Ipv6FragmentationTest::SendClient, this);
+      Simulator::Run ();
+
+      uint8_t recvBuffer[65000];
+
+      uint16_t recvSize = m_receivedPacketServer->GetSize ();
+
+      NS_TEST_EXPECT_MSG_EQ (recvSize, packetSizes[i],
+                             "Packet size not correct: recvSize: " << recvSize << " packetSizes[" << i << "]: " << packetSizes[i] );
+
+      m_receivedPacketServer->CopyData (recvBuffer, 65000);
+      NS_TEST_EXPECT_MSG_EQ (memcmp (m_data, recvBuffer, m_receivedPacketServer->GetSize ()),
+                             0, "Packet content differs");
+    }
+
+  // Second test: normal channel, no errors, delays each 2 packets.
+  // Each other fragment will arrive out-of-order.
+  // The packets should be received correctly since reassembly will reorder the fragments.
+  channel->SetJumpingMode (true);
+  for ( int i = 0; i < 5; i++)
+    {
+      uint32_t packetSize = packetSizes[i];
+
+      SetFill (fillData, 78, packetSize);
+
+      m_receivedPacketServer = Create<Packet> ();
+      Simulator::ScheduleWithContext (m_socketClient->GetNode ()->GetId (), Seconds (0),
+                                      &Ipv6FragmentationTest::SendClient, this);
+      Simulator::Run ();
+
+      uint8_t recvBuffer[65000];
+
+      uint16_t recvSize = m_receivedPacketServer->GetSize ();
+
+      NS_TEST_EXPECT_MSG_EQ (recvSize, packetSizes[i],
+                             "Packet size not correct: recvSize: " << recvSize << " packetSizes[" << i << "]: " << packetSizes[i] );
+
+      m_receivedPacketServer->CopyData (recvBuffer, 65000);
+      NS_TEST_EXPECT_MSG_EQ (memcmp (m_data, recvBuffer, m_receivedPacketServer->GetSize ()),
+                             0, "Packet content differs");
+    }
+  channel->SetJumpingMode (false);
+
+  // Third test: normal channel, some errors, no delays.
+  // The reassembly procedure should fire a timeout after 30 seconds (as specified in the RFCs).
+  // Upon the timeout, the fragments received so far are discarded and an ICMP should be sent back
+  // to the sender (if the first fragment has been received).
+  // In this test case the first fragment is received, so we do expect an ICMP.
+  // Client -> Server : errors enabled
+  // Server -> Client : errors disabled (we want to have back the ICMP)
+  clientDevErrorModel->Disable ();
+  serverDevErrorModel->Enable ();
+  for ( int i = 1; i < 5; i++)
+    {
+      uint32_t packetSize = packetSizes[i];
+
+      SetFill (fillData, 78, packetSize);
+
+      // reset the model, we want to receive the very first fragment.
+      serverDevErrorModel->Reset ();
+
+      m_receivedPacketServer = Create<Packet> ();
+      m_icmpType = 0;
+      m_icmpCode = 0;
+      Simulator::ScheduleWithContext (m_socketClient->GetNode ()->GetId (), Seconds (0),
+                                      &Ipv6FragmentationTest::SendClient, this);
+      Simulator::Run ();
+
+      uint16_t recvSize = m_receivedPacketServer->GetSize ();
+
+      NS_TEST_EXPECT_MSG_EQ ((recvSize == 0), true, "Server got a packet, something wrong");
+      NS_TEST_EXPECT_MSG_EQ ((m_icmpType == Icmpv6Header::ICMPV6_ERROR_TIME_EXCEEDED)
+                             && (m_icmpCode == Icmpv6Header::ICMPV6_FRAGTIME),
+                             true, "Client did not receive ICMPv6::TIME_EXCEEDED " << int(m_icmpType) << int(m_icmpCode) );
+    }
+
+
+  Simulator::Destroy ();
+}
+//-----------------------------------------------------------------------------
+class Ipv6FragmentationTestSuite : public TestSuite
+{
+public:
+  Ipv6FragmentationTestSuite () : TestSuite ("ipv6-fragmentation", UNIT)
+  {
+    AddTestCase (new Ipv6FragmentationTest);
+  }
+} g_ipv6fragmentationTestSuite;
+
+}; // namespace ns3
--- a/src/internet/test/ipv6-list-routing-test-suite.cc	Wed Apr 11 11:00:27 2012 +0200
+++ b/src/internet/test/ipv6-list-routing-test-suite.cc	Wed Apr 11 13:49:33 2012 +0200
@@ -38,6 +38,7 @@
                          GetZero ()) {}
   void NotifyRemoveRoute (Ipv6Address dst, Ipv6Prefix mask, Ipv6Address nextHop, uint32_t interface, Ipv6Address prefixToUse) {}
   void SetIpv6 (Ptr<Ipv6> ipv6) {}
+  virtual void PrintRoutingTable (Ptr<OutputStreamWrapper> stream) const {};
 };
 
 class Ipv6BRouting : public Ipv6RoutingProtocol {
@@ -54,6 +55,7 @@
                          GetZero ()) {}
   void NotifyRemoveRoute (Ipv6Address dst, Ipv6Prefix mask, Ipv6Address nextHop, uint32_t interface, Ipv6Address prefixToUse) {}
   void SetIpv6 (Ptr<Ipv6> ipv6) {}
+  virtual void PrintRoutingTable (Ptr<OutputStreamWrapper> stream) const {};
 };
 
 class Ipv6ListRoutingNegativeTestCase : public TestCase
--- a/src/internet/wscript	Wed Apr 11 11:00:27 2012 +0200
+++ b/src/internet/wscript	Wed Apr 11 13:49:33 2012 +0200
@@ -206,6 +206,7 @@
         'test/udp-test.cc',
         'test/ipv6-address-generator-test-suite.cc',
         'test/ipv6-dual-stack-test-suite.cc',
+        'test/ipv6-fragmentation-test.cc',
         ]
 
     headers = bld.new_task_gen(features=['ns3header'])
--- a/src/mpi/bindings/modulegen__gcc_ILP32.py	Wed Apr 11 11:00:27 2012 +0200
+++ b/src/mpi/bindings/modulegen__gcc_ILP32.py	Wed Apr 11 13:49:33 2012 +0200
@@ -1831,11 +1831,6 @@
                    'bool', 
                    [], 
                    is_pure_virtual=True, is_const=True, is_virtual=True)
-    ## simulator-impl.h (module 'core'): ns3::Time ns3::SimulatorImpl::Next() const [member function]
-    cls.add_method('Next', 
-                   'ns3::Time', 
-                   [], 
-                   is_pure_virtual=True, is_const=True, is_virtual=True)
     ## simulator-impl.h (module 'core'): ns3::Time ns3::SimulatorImpl::Now() const [member function]
     cls.add_method('Now', 
                    'ns3::Time', 
@@ -1851,11 +1846,6 @@
                    'void', 
                    [], 
                    is_pure_virtual=True, is_virtual=True)
-    ## simulator-impl.h (module 'core'): void ns3::SimulatorImpl::RunOneEvent() [member function]
-    cls.add_method('RunOneEvent', 
-                   'void', 
-                   [], 
-                   is_pure_virtual=True, is_virtual=True)
     ## simulator-impl.h (module 'core'): ns3::EventId ns3::SimulatorImpl::Schedule(ns3::Time const & time, ns3::EventImpl * event) [member function]
     cls.add_method('Schedule', 
                    'ns3::EventId', 
@@ -2297,11 +2287,6 @@
                    'bool', 
                    [], 
                    is_const=True, is_virtual=True)
-    ## distributed-simulator-impl.h (module 'mpi'): ns3::Time ns3::DistributedSimulatorImpl::Next() const [member function]
-    cls.add_method('Next', 
-                   'ns3::Time', 
-                   [], 
-                   is_const=True, is_virtual=True)
     ## distributed-simulator-impl.h (module 'mpi'): ns3::Time ns3::DistributedSimulatorImpl::Now() const [member function]
     cls.add_method('Now', 
                    'ns3::Time', 
@@ -2317,11 +2302,6 @@
                    'void', 
                    [], 
                    is_virtual=True)
-    ## distributed-simulator-impl.h (module 'mpi'): void ns3::DistributedSimulatorImpl::RunOneEvent() [member function]
-    cls.add_method('RunOneEvent', 
-                   'void', 
-                   [], 
-                   is_virtual=True)
     ## distributed-simulator-impl.h (module 'mpi'): ns3::EventId ns3::DistributedSimulatorImpl::Schedule(ns3::Time const & time, ns3::EventImpl * event) [member function]
     cls.add_method('Schedule', 
                    'ns3::EventId', 
--- a/src/mpi/bindings/modulegen__gcc_LP64.py	Wed Apr 11 11:00:27 2012 +0200
+++ b/src/mpi/bindings/modulegen__gcc_LP64.py	Wed Apr 11 13:49:33 2012 +0200
@@ -1831,11 +1831,6 @@
                    'bool', 
                    [], 
                    is_pure_virtual=True, is_const=True, is_virtual=True)
-    ## simulator-impl.h (module 'core'): ns3::Time ns3::SimulatorImpl::Next() const [member function]
-    cls.add_method('Next', 
-                   'ns3::Time', 
-                   [], 
-                   is_pure_virtual=True, is_const=True, is_virtual=True)
     ## simulator-impl.h (module 'core'): ns3::Time ns3::SimulatorImpl::Now() const [member function]
     cls.add_method('Now', 
                    'ns3::Time', 
@@ -1851,11 +1846,6 @@
                    'void', 
                    [], 
                    is_pure_virtual=True, is_virtual=True)
-    ## simulator-impl.h (module 'core'): void ns3::SimulatorImpl::RunOneEvent() [member function]
-    cls.add_method('RunOneEvent', 
-                   'void', 
-                   [], 
-                   is_pure_virtual=True, is_virtual=True)
     ## simulator-impl.h (module 'core'): ns3::EventId ns3::SimulatorImpl::Schedule(ns3::Time const & time, ns3::EventImpl * event) [member function]
     cls.add_method('Schedule', 
                    'ns3::EventId', 
@@ -2297,11 +2287,6 @@
                    'bool', 
                    [], 
                    is_const=True, is_virtual=True)
-    ## distributed-simulator-impl.h (module 'mpi'): ns3::Time ns3::DistributedSimulatorImpl::Next() const [member function]
-    cls.add_method('Next', 
-                   'ns3::Time', 
-                   [], 
-                   is_const=True, is_virtual=True)
     ## distributed-simulator-impl.h (module 'mpi'): ns3::Time ns3::DistributedSimulatorImpl::Now() const [member function]
     cls.add_method('Now', 
                    'ns3::Time', 
@@ -2317,11 +2302,6 @@
                    'void', 
                    [], 
                    is_virtual=True)
-    ## distributed-simulator-impl.h (module 'mpi'): void ns3::DistributedSimulatorImpl::RunOneEvent() [member function]
-    cls.add_method('RunOneEvent', 
-                   'void', 
-                   [], 
-                   is_virtual=True)
     ## distributed-simulator-impl.h (module 'mpi'): ns3::EventId ns3::DistributedSimulatorImpl::Schedule(ns3::Time const & time, ns3::EventImpl * event) [member function]
     cls.add_method('Schedule', 
                    'ns3::EventId', 
--- a/src/mpi/model/distributed-simulator-impl.cc	Wed Apr 11 11:00:27 2012 +0200
+++ b/src/mpi/model/distributed-simulator-impl.cc	Wed Apr 11 13:49:33 2012 +0200
@@ -331,12 +331,6 @@
 }
 
 void
-DistributedSimulatorImpl::RunOneEvent (void)
-{
-  ProcessOneEvent ();
-}
-
-void
 DistributedSimulatorImpl::Stop (void)
 {
   m_stop = true;
--- a/src/mpi/model/distributed-simulator-impl.h	Wed Apr 11 11:00:27 2012 +0200
+++ b/src/mpi/model/distributed-simulator-impl.h	Wed Apr 11 13:49:33 2012 +0200
@@ -99,7 +99,6 @@
   // virtual from SimulatorImpl
   virtual void Destroy ();
   virtual bool IsFinished (void) const;
-  virtual Time Next (void) const;
   virtual void Stop (void);
   virtual void Stop (Time const &time);
   virtual EventId Schedule (Time const &time, EventImpl *event);
@@ -110,7 +109,6 @@
   virtual void Cancel (const EventId &ev);
   virtual bool IsExpired (const EventId &ev) const;
   virtual void Run (void);
-  virtual void RunOneEvent (void);
   virtual Time Now (void) const;
   virtual Time GetDelayLeft (const EventId &id) const;
   virtual Time GetMaximumSimulationTime (void) const;
@@ -124,6 +122,7 @@
 
   void ProcessOneEvent (void);
   uint64_t NextTs (void) const;
+  Time Next (void) const;
   typedef std::list<EventId> DestroyEvents;
 
   DestroyEvents m_destroyEvents;
--- a/src/netanim/bindings/modulegen__gcc_ILP32.py	Wed Apr 11 11:00:27 2012 +0200
+++ b/src/netanim/bindings/modulegen__gcc_ILP32.py	Wed Apr 11 13:49:33 2012 +0200
@@ -515,6 +515,10 @@
     cls.add_constructor([param('std::string const', 'filename'), param('bool', 'usingXML', default_value='true')])
     ## animation-interface.h (module 'netanim'): ns3::AnimationInterface::AnimationInterface(uint16_t port, bool usingXML=true) [constructor]
     cls.add_constructor([param('uint16_t', 'port'), param('bool', 'usingXML', default_value='true')])
+    ## animation-interface.h (module 'netanim'): void ns3::AnimationInterface::EnablePacketMetadata(bool enable) [member function]
+    cls.add_method('EnablePacketMetadata', 
+                   'void', 
+                   [param('bool', 'enable')])
     ## animation-interface.h (module 'netanim'): static bool ns3::AnimationInterface::IsInitialized() [member function]
     cls.add_method('IsInitialized', 
                    'bool', 
@@ -532,10 +536,11 @@
     cls.add_method('SetAnimWriteCallback', 
                    'void', 
                    [param('void ( * ) ( char const * ) *', 'cb')])
-    ## animation-interface.h (module 'netanim'): void ns3::AnimationInterface::SetConstantPosition(ns3::Ptr<ns3::Node> n, double x, double y, double z=0) [member function]
+    ## animation-interface.h (module 'netanim'): static void ns3::AnimationInterface::SetConstantPosition(ns3::Ptr<ns3::Node> n, double x, double y, double z=0) [member function]
     cls.add_method('SetConstantPosition', 
                    'void', 
-                   [param('ns3::Ptr< ns3::Node >', 'n'), param('double', 'x'), param('double', 'y'), param('double', 'z', default_value='0')])
+                   [param('ns3::Ptr< ns3::Node >', 'n'), param('double', 'x'), param('double', 'y'), param('double', 'z', default_value='0')], 
+                   is_static=True)
     ## animation-interface.h (module 'netanim'): void ns3::AnimationInterface::SetMobilityPollInterval(ns3::Time t) [member function]
     cls.add_method('SetMobilityPollInterval', 
                    'void', 
@@ -556,6 +561,10 @@
     cls.add_method('SetXMLOutput', 
                    'void', 
                    [])
+    ## animation-interface.h (module 'netanim'): void ns3::AnimationInterface::ShowAll802_11(bool showAll) [member function]
+    cls.add_method('ShowAll802_11', 
+                   'void', 
+                   [param('bool', 'showAll')])
     ## animation-interface.h (module 'netanim'): void ns3::AnimationInterface::StartAnimation() [member function]
     cls.add_method('StartAnimation', 
                    'void', 
--- a/src/netanim/bindings/modulegen__gcc_LP64.py	Wed Apr 11 11:00:27 2012 +0200
+++ b/src/netanim/bindings/modulegen__gcc_LP64.py	Wed Apr 11 13:49:33 2012 +0200
@@ -515,6 +515,10 @@
     cls.add_constructor([param('std::string const', 'filename'), param('bool', 'usingXML', default_value='true')])
     ## animation-interface.h (module 'netanim'): ns3::AnimationInterface::AnimationInterface(uint16_t port, bool usingXML=true) [constructor]
     cls.add_constructor([param('uint16_t', 'port'), param('bool', 'usingXML', default_value='true')])
+    ## animation-interface.h (module 'netanim'): void ns3::AnimationInterface::EnablePacketMetadata(bool enable) [member function]
+    cls.add_method('EnablePacketMetadata', 
+                   'void', 
+                   [param('bool', 'enable')])
     ## animation-interface.h (module 'netanim'): static bool ns3::AnimationInterface::IsInitialized() [member function]
     cls.add_method('IsInitialized', 
                    'bool', 
@@ -532,10 +536,11 @@
     cls.add_method('SetAnimWriteCallback', 
                    'void', 
                    [param('void ( * ) ( char const * ) *', 'cb')])
-    ## animation-interface.h (module 'netanim'): void ns3::AnimationInterface::SetConstantPosition(ns3::Ptr<ns3::Node> n, double x, double y, double z=0) [member function]
+    ## animation-interface.h (module 'netanim'): static void ns3::AnimationInterface::SetConstantPosition(ns3::Ptr<ns3::Node> n, double x, double y, double z=0) [member function]
     cls.add_method('SetConstantPosition', 
                    'void', 
-                   [param('ns3::Ptr< ns3::Node >', 'n'), param('double', 'x'), param('double', 'y'), param('double', 'z', default_value='0')])
+                   [param('ns3::Ptr< ns3::Node >', 'n'), param('double', 'x'), param('double', 'y'), param('double', 'z', default_value='0')], 
+                   is_static=True)
     ## animation-interface.h (module 'netanim'): void ns3::AnimationInterface::SetMobilityPollInterval(ns3::Time t) [member function]
     cls.add_method('SetMobilityPollInterval', 
                    'void', 
@@ -556,6 +561,10 @@
     cls.add_method('SetXMLOutput', 
                    'void', 
                    [])
+    ## animation-interface.h (module 'netanim'): void ns3::AnimationInterface::ShowAll802_11(bool showAll) [member function]
+    cls.add_method('ShowAll802_11', 
+                   'void', 
+                   [param('bool', 'showAll')])
     ## animation-interface.h (module 'netanim'): void ns3::AnimationInterface::StartAnimation() [member function]
     cls.add_method('StartAnimation', 
                    'void', 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/netanim/examples/wireless-animation.cc	Wed Apr 11 13:49:33 2012 +0200
@@ -0,0 +1,162 @@
+/* -*- 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
+ *
+ * Author: Vikas Pushkar (Adapted from third.cc)
+ */
+
+
+#include "ns3/core-module.h"
+#include "ns3/point-to-point-module.h"
+#include "ns3/csma-module.h"
+#include "ns3/network-module.h"
+#include "ns3/applications-module.h"
+#include "ns3/wifi-module.h"
+#include "ns3/mobility-module.h"
+#include "ns3/internet-module.h"
+#include "ns3/netanim-module.h"
+
+
+
+using namespace ns3;
+
+NS_LOG_COMPONENT_DEFINE ("WirelessAnimationExample");
+
+int 
+main (int argc, char *argv[])
+{
+  uint32_t nWifi = 20;
+  CommandLine cmd;
+  cmd.AddValue ("nWifi", "Number of wifi STA devices", nWifi);
+  
+
+  cmd.Parse (argc,argv);
+  NodeContainer allNodes;
+  NodeContainer wifiStaNodes;
+  wifiStaNodes.Create (nWifi);
+  allNodes.Add (wifiStaNodes);
+  NodeContainer wifiApNode ;
+  wifiApNode.Create (1);
+  allNodes.Add (wifiApNode);
+
+  YansWifiChannelHelper channel = YansWifiChannelHelper::Default ();
+  YansWifiPhyHelper phy = YansWifiPhyHelper::Default ();
+  phy.SetChannel (channel.Create ());
+
+  WifiHelper wifi = WifiHelper::Default ();
+  wifi.SetRemoteStationManager ("ns3::AarfWifiManager");
+
+  NqosWifiMacHelper mac = NqosWifiMacHelper::Default ();
+
+  Ssid ssid = Ssid ("ns-3-ssid");
+  mac.SetType ("ns3::StaWifiMac",
+               "Ssid", SsidValue (ssid),
+               "ActiveProbing", BooleanValue (false));
+
+  NetDeviceContainer staDevices;
+  staDevices = wifi.Install (phy, mac, wifiStaNodes);
+  mac.SetType ("ns3::ApWifiMac",
+               "Ssid", SsidValue (ssid));
+
+  NetDeviceContainer apDevices;
+  apDevices = wifi.Install (phy, mac, wifiApNode);
+
+
+  NodeContainer p2pNodes;
+  p2pNodes.Add (wifiApNode);
+  p2pNodes.Create (1);
+  allNodes.Add (p2pNodes.Get (1));
+
+  PointToPointHelper pointToPoint;
+  pointToPoint.SetDeviceAttribute ("DataRate", StringValue ("5Mbps"));
+  pointToPoint.SetChannelAttribute ("Delay", StringValue ("2ms"));
+
+  NetDeviceContainer p2pDevices;
+  p2pDevices = pointToPoint.Install (p2pNodes);
+
+  NodeContainer csmaNodes;
+  csmaNodes.Add (p2pNodes.Get (1));
+  csmaNodes.Create (1);
+  allNodes.Add (csmaNodes.Get (1));
+
+  CsmaHelper csma;
+  csma.SetChannelAttribute ("DataRate", StringValue ("100Mbps"));
+  csma.SetChannelAttribute ("Delay", TimeValue (NanoSeconds (6560)));
+
+  NetDeviceContainer csmaDevices;
+  csmaDevices = csma.Install (csmaNodes);
+
+  // Mobility
+
+  MobilityHelper mobility;
+  mobility.SetPositionAllocator ("ns3::GridPositionAllocator",
+                                 "MinX", DoubleValue (10.0),
+                                 "MinY", DoubleValue (10.0),
+                                 "DeltaX", DoubleValue (5.0),
+                                 "DeltaY", DoubleValue (2.0),
+                                 "GridWidth", UintegerValue (5),
+                                 "LayoutType", StringValue ("RowFirst"));
+  mobility.SetMobilityModel ("ns3::RandomWalk2dMobilityModel",
+                             "Bounds", RectangleValue (Rectangle (-50, 50, -25, 50)));
+  mobility.Install (wifiStaNodes);
+  mobility.SetMobilityModel ("ns3::ConstantPositionMobilityModel");
+  mobility.Install (wifiApNode);
+  AnimationInterface::SetConstantPosition (p2pNodes.Get (1), 10, 30); 
+  AnimationInterface::SetConstantPosition (csmaNodes.Get (1), 10, 33); 
+
+  // Install internet stack
+
+  InternetStackHelper stack;
+  stack.Install (allNodes);
+
+  // Install Ipv4 addresses
+
+  Ipv4AddressHelper address;
+  address.SetBase ("10.1.1.0", "255.255.255.0");
+  Ipv4InterfaceContainer p2pInterfaces;
+  p2pInterfaces = address.Assign (p2pDevices);
+  address.SetBase ("10.1.2.0", "255.255.255.0");
+  Ipv4InterfaceContainer csmaInterfaces;
+  csmaInterfaces = address.Assign (csmaDevices);
+  address.SetBase ("10.1.3.0", "255.255.255.0");
+  Ipv4InterfaceContainer staInterfaces;
+  staInterfaces = address.Assign (staDevices);
+  Ipv4InterfaceContainer apInterface;
+  apInterface = address.Assign (apDevices);
+
+  // Install applications
+
+  UdpEchoServerHelper echoServer (9);
+  ApplicationContainer serverApps = echoServer.Install (csmaNodes.Get (1));
+  serverApps.Start (Seconds (1.0));
+  serverApps.Stop (Seconds (15.0));
+  UdpEchoClientHelper echoClient (csmaInterfaces.GetAddress (1), 9);
+  echoClient.SetAttribute ("MaxPackets", UintegerValue (10));
+  echoClient.SetAttribute ("Interval", TimeValue (Seconds (1.)));
+  echoClient.SetAttribute ("PacketSize", UintegerValue (1024));
+  ApplicationContainer clientApps = echoClient.Install (wifiStaNodes);
+  clientApps.Start (Seconds (2.0));
+  clientApps.Stop (Seconds (15.0));
+
+  Ipv4GlobalRoutingHelper::PopulateRoutingTables ();
+  Simulator::Stop (Seconds (15.0));
+  AnimationInterface::SetNodeDescription (wifiApNode, "AP");
+  AnimationInterface::SetNodeDescription (wifiStaNodes, "STA");
+  AnimationInterface::SetNodeDescription (csmaNodes, "CSMA");
+  AnimationInterface anim ("wireless-animation.xml");
+  anim.EnablePacketMetadata (true);
+  Simulator::Run ();
+  Simulator::Destroy ();
+  return 0;
+}
--- a/src/netanim/examples/wscript	Wed Apr 11 11:00:27 2012 +0200
+++ b/src/netanim/examples/wscript	Wed Apr 11 13:49:33 2012 +0200
@@ -12,3 +12,7 @@
     obj = bld.create_ns3_program('star-animation',
                                  ['netanim', 'applications', 'point-to-point-layout'])
     obj.source = 'star-animation.cc'
+
+    obj = bld.create_ns3_program('wireless-animation',
+                                 ['netanim', 'applications', 'point-to-point', 'csma', 'wifi', 'mobility', 'network'])
+    obj.source = 'wireless-animation.cc'
--- a/src/netanim/helper/animation-interface-helper.cc	Wed Apr 11 11:00:27 2012 +0200
+++ b/src/netanim/helper/animation-interface-helper.cc	Wed Apr 11 13:49:33 2012 +0200
@@ -33,10 +33,12 @@
 }
 
 AnimPacketInfo::AnimPacketInfo(Ptr <const NetDevice> txnd, const Time& fbTx, 
-  const Time& lbTx, Vector txLoc)
+  const Time& lbTx, Vector txLoc, uint32_t txNodeId)
   : m_txnd (txnd), m_fbTx (fbTx.GetSeconds ()), m_lbTx (lbTx.GetSeconds ()), 
     m_txLoc (txLoc)
 {
+  if (!m_txnd)
+    m_txNodeId = txNodeId;
 }
 
 void AnimPacketInfo::ProcessRxBegin (Ptr<const NetDevice> nd, const Time& fbRx)
--- a/src/netanim/helper/animation-interface-helper.h	Wed Apr 11 11:00:27 2012 +0200
+++ b/src/netanim/helper/animation-interface-helper.h	Wed Apr 11 13:49:33 2012 +0200
@@ -144,7 +144,7 @@
    * \param txLoc Transmitter Location
    *
    */
-  AnimPacketInfo(Ptr <const NetDevice> tx_nd, const Time& fbTx, const Time& lbTx,Vector txLoc);
+  AnimPacketInfo(Ptr <const NetDevice> tx_nd, const Time& fbTx, const Time& lbTx,Vector txLoc, uint32_t txNodeId = 0);
   
   /**
    * \brief Ptr to NetDevice that is transmitting
@@ -153,6 +153,13 @@
    */ 
   Ptr <const NetDevice> m_txnd;
 
+  /**
+   * \brief Tx Node Id if NetDevice is unknown
+   * \param m_txNodeId Tx Node Id if NetDevice is unknown
+   *
+   */
+  uint32_t m_txNodeId;
+
   /** 
    * \brief First bit transmission time
    * \param m_fbTx First bit transmission time
--- a/src/netanim/model/animation-interface.cc	Wed Apr 11 11:00:27 2012 +0200
+++ b/src/netanim/model/animation-interface.cc	Wed Apr 11 13:49:33 2012 +0200
@@ -32,9 +32,12 @@
 #include "ns3/animation-interface-helper.h"
 #include "ns3/wifi-mac-header.h"
 #include "ns3/wimax-mac-header.h"
+#include "ns3/wifi-net-device.h"
+#include "ns3/wifi-mac.h"
 #include "ns3/constant-position-mobility-model.h"
 
 #include <stdio.h>
+#include <unistd.h>
 #include <sstream>
 #include <fstream>
 #include <string>
@@ -51,16 +54,20 @@
 
 NS_LOG_COMPONENT_DEFINE ("AnimationInterface");
 
+
+
+namespace ns3 {
+
 #define PURGE_INTERVAL 5
 static bool initialized = false;
-
-namespace ns3 {
+std::map <uint32_t, std::string> AnimationInterface::nodeDescriptions;
 
 AnimationInterface::AnimationInterface ()
   : m_fHandle (STDOUT_FILENO), m_xml (false), mobilitypollinterval (Seconds(0.25)),
     usingSockets (false), mport (0), outputfilename (""),
     OutputFileSet (false), ServerPortSet (false), gAnimUid (0),randomPosition (true),
-    m_writeCallback (0), m_started (false)
+    m_writeCallback (0), m_started (false), 
+    m_enablePacketMetadata (false), m_startTime (Seconds(0)), m_stopTime (Seconds(3600 * 1000))
 {
   initialized = true;
   StartAnimation ();
@@ -70,7 +77,8 @@
   : m_fHandle (STDOUT_FILENO), m_xml (usingXML), mobilitypollinterval (Seconds(0.25)), 
     usingSockets (false), mport (0), outputfilename (fn),
     OutputFileSet (false), ServerPortSet (false), gAnimUid (0), randomPosition (true),
-    m_writeCallback (0), m_started (false)
+    m_writeCallback (0), m_started (false), 
+    m_enablePacketMetadata (false), m_startTime (Seconds(0)), m_stopTime (Seconds(3600 * 1000))
 {
   initialized = true;
   StartAnimation ();
@@ -80,7 +88,8 @@
   : m_fHandle (STDOUT_FILENO), m_xml (usingXML), mobilitypollinterval (Seconds(0.25)), 
     usingSockets (true), mport (port), outputfilename (""),
     OutputFileSet (false), ServerPortSet (false), gAnimUid (0), randomPosition (true),
-    m_writeCallback (0), m_started (false)
+    m_writeCallback (0), m_started (false), 
+    m_enablePacketMetadata (false), m_startTime (Seconds(0)), m_stopTime (Seconds(3600 * 1000))
 {
   initialized = true;
   StartAnimation ();
@@ -97,6 +106,17 @@
   m_xml = true;
 }
 
+
+void AnimationInterface::SetStartTime (Time t)
+{
+  m_startTime = t;
+}
+
+void AnimationInterface::SetStopTime (Time t)
+{
+  m_stopTime = t;
+}
+
 bool AnimationInterface::SetOutputFile (const std::string& fn)
 {
   if (OutputFileSet)
@@ -122,6 +142,13 @@
   return true;
 }
 
+void AnimationInterface::EnablePacketMetadata (bool enable)
+{
+   m_enablePacketMetadata = enable;
+   if (enable)
+     Packet::EnablePrinting ();
+}
+
 bool AnimationInterface::IsInitialized ()
 {
   return initialized;
@@ -143,6 +170,15 @@
   m_writeCallback = 0;
 }
 
+bool AnimationInterface::IsInTimeWindow ()
+{
+  if ((Simulator::Now () >= m_startTime) && 
+      (Simulator::Now () <= m_stopTime))
+    return true;
+  else
+    return false;
+}
+
 bool AnimationInterface::SetServerPort (uint16_t port)
 {
 #if defined(HAVE_SYS_SOCKET_H) && defined(HAVE_NETINET_IN_H)
@@ -192,6 +228,11 @@
   return (pendingWimaxPackets.find (AnimUid) != pendingWimaxPackets.end ());
 }
 
+bool AnimationInterface::LtePacketIsPending (uint64_t AnimUid)
+{
+  return (pendingLtePackets.find (AnimUid) != pendingLtePackets.end ());
+}
+
 void AnimationInterface::SetMobilityPollInterval (Time t)
 {
   mobilitypollinterval = t;
@@ -211,7 +252,7 @@
     }
   else
    {
-     NS_LOG_WARN ( "Node:" << n->GetId () << " Does not have a mobility model");
+     NS_LOG_UNCOND ( "AnimationInterface WARNING:Node:" << n->GetId () << " Does not have a mobility model. Use SetConstantPosition if it is stationary");
      Vector deterministicVector (100,100,0);
      Vector randomVector (UniformVariable (0, topo_maxX-topo_minX).GetValue (), UniformVariable (0, topo_maxY-topo_minY).GetValue (), 0);
      if (randomPosition)
@@ -297,6 +338,33 @@
 
 }
 
+
+void AnimationInterface::PurgePendingLte ()
+{
+  if (pendingLtePackets.empty ())
+    return;
+  std::vector <uint64_t> purgeList;
+  for (std::map<uint64_t, AnimPacketInfo>::iterator i = pendingLtePackets.begin ();
+       i != pendingLtePackets.end ();
+       ++i)
+    {
+
+      AnimPacketInfo pktInfo = i->second;
+      double delta = (Simulator::Now ().GetSeconds () - pktInfo.m_fbTx);
+      if (delta > PURGE_INTERVAL)
+        {
+          purgeList.push_back (i->first);
+        }
+    }
+
+  for (std::vector <uint64_t>::iterator i = purgeList.begin ();
+       i != purgeList.end ();
+       ++i)
+    {
+      pendingLtePackets.erase (*i);
+    }
+}
+
 void AnimationInterface::PurgePendingCsma ()
 {
   if (pendingCsmaPackets.empty ())
@@ -445,20 +513,18 @@
                    MakeCallback (&AnimationInterface::DevTxTrace, this));
   Config::Connect ("NodeList/*/DeviceList/*/$ns3::WifiNetDevice/Phy/PhyTxBegin",
                    MakeCallback (&AnimationInterface::WifiPhyTxBeginTrace, this));
-  Config::Connect ("NodeList/*/DeviceList/*/$ns3::WifiNetDevice/Phy/PhyTxEnd",
-                   MakeCallback (&AnimationInterface::WifiPhyTxEndTrace, this));
   Config::Connect ("NodeList/*/DeviceList/*/$ns3::WifiNetDevice/Phy/PhyRxBegin",
                    MakeCallback (&AnimationInterface::WifiPhyRxBeginTrace, this));
-  Config::Connect ("NodeList/*/DeviceList/*/$ns3::WifiNetDevice/Phy/PhyRxEnd",
-                   MakeCallback (&AnimationInterface::WifiPhyRxEndTrace, this));
-  Config::Connect ("NodeList/*/DeviceList/*/$ns3::WifiNetDevice/Mac/MacRx",
-                   MakeCallback (&AnimationInterface::WifiMacRxTrace, this));
   Config::ConnectWithoutContext ("/NodeList/*/$ns3::MobilityModel/CourseChange",
                    MakeCallback (&AnimationInterface::MobilityCourseChangeTrace, this));
   Config::Connect ("/NodeList/*/DeviceList/*/$ns3::WimaxNetDevice/Tx",
                    MakeCallback (&AnimationInterface::WimaxTxTrace, this));
   Config::Connect ("/NodeList/*/DeviceList/*/$ns3::WimaxNetDevice/Rx",
                    MakeCallback (&AnimationInterface::WimaxRxTrace, this));
+  Config::Connect ("/NodeList/*/DeviceList/*/$ns3::LteNetDevice/Tx",
+                   MakeCallback (&AnimationInterface::LteTxTrace, this));
+  Config::Connect ("/NodeList/*/DeviceList/*/$ns3::LteNetDevice/Rx",
+                   MakeCallback (&AnimationInterface::LteRxTrace, this));
   Config::Connect ("/NodeList/*/DeviceList/*/$ns3::CsmaNetDevice/PhyTxBegin",
                    MakeCallback (&AnimationInterface::CsmaPhyTxBeginTrace, this));
   Config::Connect ("/NodeList/*/DeviceList/*/$ns3::CsmaNetDevice/PhyTxEnd",
@@ -505,7 +571,6 @@
   return WriteN (h, st.c_str (), st.length ());
 }
 
-
 // Private methods
 void AnimationInterface::AddMargin ()
 {
@@ -603,8 +668,8 @@
   double lbRx = now.GetSeconds ();
   if (m_xml)
     {
-      oss << GetXMLOpen_packet (0,0,fbTx,lbTx,"DummyPktIgnoreThis");
-      oss << GetXMLOpenClose_rx (0,0,fbRx,lbRx);
+      oss << GetXMLOpen_packet (0, 0, fbTx, lbTx, "DummyPktIgnoreThis");
+      oss << GetXMLOpenClose_rx (0, 0, fbRx, lbRx);
       oss << GetXMLClose ("packet");
     }
   WriteN (m_fHandle, oss.str ());
@@ -627,8 +692,10 @@
   double lbRx = (now + rxTime).GetSeconds ();
   if (m_xml)
     {
-      oss << GetXMLOpen_packet (0,tx->GetNode ()->GetId (),fbTx,lbTx);
-      oss << GetXMLOpenClose_rx (0,rx->GetNode ()->GetId (),fbRx,lbRx); 
+      oss << GetXMLOpen_packet (0, tx->GetNode ()->GetId (), fbTx, lbTx);
+      oss << GetXMLOpenClose_rx (0, rx->GetNode ()->GetId (), fbRx, lbRx); 
+      if (m_enablePacketMetadata)
+        oss << GetXMLOpenClose_meta (GetPacketMetadata (p));
       oss << GetXMLClose ("packet");
     }
   else
@@ -660,7 +727,6 @@
                                   
 void AnimationInterface::AddPendingWifiPacket (uint64_t AnimUid, AnimPacketInfo &pktinfo)
 {
-  NS_ASSERT (pktinfo.m_txnd);
   pendingWifiPackets[AnimUid] = pktinfo;
 }
 
@@ -670,6 +736,11 @@
   pendingWimaxPackets[AnimUid] = pktinfo;
 }
 
+void AnimationInterface::AddPendingLtePacket (uint64_t AnimUid, AnimPacketInfo &pktinfo)
+{
+  NS_ASSERT (pktinfo.m_txnd);
+  pendingLtePackets[AnimUid] = pktinfo;
+}
 
 void AnimationInterface::AddPendingCsmaPacket (uint64_t AnimUid, AnimPacketInfo &pktinfo)
 {
@@ -680,7 +751,19 @@
 uint64_t AnimationInterface::GetAnimUidFromPacket (Ptr <const Packet> p)
 {
   AnimByteTag tag;
-  if (p->FindFirstMatchingByteTag (tag))
+  TypeId tid = tag.GetInstanceTypeId ();
+  ByteTagIterator i = p->GetByteTagIterator ();
+  bool found = false;
+  while (i.HasNext ())
+    {
+      ByteTagIterator::Item item = i.Next ();
+      if (tid == item.GetTypeId ())
+        {
+          item.GetTag (tag);
+          found = true;
+        }
+    }
+  if (found)
     {
       return tag.Get ();
     }
@@ -693,7 +776,7 @@
 void AnimationInterface::WifiPhyTxBeginTrace (std::string context,
                                           Ptr<const Packet> p)
 {
-  if (!m_started)
+  if (!m_started || !IsInTimeWindow ())
     return;
   Ptr <NetDevice> ndev = GetNetDeviceFromContext (context); 
   NS_ASSERT (ndev);
@@ -707,6 +790,12 @@
   p->AddByteTag (tag);
   AnimPacketInfo pktinfo (ndev, Simulator::Now (), Simulator::Now (), UpdatePosition (n));
   AddPendingWifiPacket (gAnimUid, pktinfo);
+  Ptr<WifiNetDevice> netDevice = DynamicCast<WifiNetDevice> (ndev);
+  Mac48Address nodeAddr = netDevice->GetMac()->GetAddress();
+  std::ostringstream oss; 
+  oss << nodeAddr;
+  m_macToNodeIdMap[oss.str ()] = n->GetId ();
+  NS_LOG_INFO ("Added Mac" << oss.str () << " node:" <<m_macToNodeIdMap[oss.str ()]);
 }
 
 void AnimationInterface::WifiPhyTxEndTrace (std::string context,
@@ -717,7 +806,7 @@
 void AnimationInterface::WifiPhyTxDropTrace (std::string context,
                                              Ptr<const Packet> p)
 {
-  if (!m_started)
+  if (!m_started || !IsInTimeWindow ())
     return;
   Ptr <NetDevice> ndev = GetNetDeviceFromContext (context);
   NS_ASSERT (ndev);
@@ -732,26 +821,46 @@
 void AnimationInterface::WifiPhyRxBeginTrace (std::string context,
                                               Ptr<const Packet> p)
 {
-  if (!m_started)
+  if (!m_started || !IsInTimeWindow ())
     return;
   Ptr <NetDevice> ndev = GetNetDeviceFromContext (context);
   NS_ASSERT (ndev);
+  Ptr <Node> n = ndev->GetNode ();
+  NS_ASSERT (n);
   uint64_t AnimUid = GetAnimUidFromPacket (p);
   NS_LOG_INFO ("RxBeginTrace for packet:" << AnimUid);
   if (!WifiPacketIsPending (AnimUid))
     {
       NS_LOG_WARN ("WifiPhyRxBeginTrace: unknown Uid");
-      return;
+      std::ostringstream oss;
+      WifiMacHeader hdr;
+      if(!p->PeekHeader (hdr))
+      { 
+        NS_LOG_WARN ("WifiMacHeader not present");
+        return;
+      }
+      oss << hdr.GetAddr2 ();
+      if (m_macToNodeIdMap.find (oss.str ()) == m_macToNodeIdMap.end ()) 
+      {
+        NS_LOG_UNCOND (oss.str ());
+        return;
+      }
+      Ptr <Node> txNode = NodeList::GetNode (m_macToNodeIdMap[oss.str ()]);
+      AnimPacketInfo pktinfo (0, Simulator::Now (), Simulator::Now (), UpdatePosition (txNode), m_macToNodeIdMap[oss.str ()]);
+      AddPendingWifiPacket (AnimUid, pktinfo);
+      NS_LOG_WARN ("WifiPhyRxBegin: unknown Uid, but we are adding a wifi packet");
     }
   // TODO: NS_ASSERT (WifiPacketIsPending (AnimUid) == true);
   pendingWifiPackets[AnimUid].ProcessRxBegin (ndev, Simulator::Now ());
+  pendingWifiPackets[AnimUid].ProcessRxEnd (ndev, Simulator::Now (), UpdatePosition (n));
+  OutputWirelessPacket (p, pendingWifiPackets[AnimUid], pendingWifiPackets[AnimUid].GetRxInfo (ndev));
 }
 
 
 void AnimationInterface::WifiPhyRxEndTrace (std::string context,
                                             Ptr<const Packet> p)
 {
-  if (!m_started)
+  if (!m_started || !IsInTimeWindow ())
     return;
   Ptr <NetDevice> ndev = GetNetDeviceFromContext (context);
   NS_ASSERT (ndev);
@@ -761,17 +870,24 @@
   if (!WifiPacketIsPending (AnimUid))
     {
       NS_LOG_WARN ("WifiPhyRxEndTrace: unknown Uid");
-      return;
+      AnimPacketInfo pktinfo (ndev, Simulator::Now (), Simulator::Now (), UpdatePosition (n));
+      AddPendingWifiPacket (AnimUid, pktinfo);
     }
   // TODO: NS_ASSERT (WifiPacketIsPending (AnimUid) == true);
   AnimPacketInfo& pktInfo = pendingWifiPackets[AnimUid];
   pktInfo.ProcessRxEnd (ndev, Simulator::Now (), UpdatePosition (n));
+  AnimRxInfo pktrxInfo = pktInfo.GetRxInfo (ndev);
+  if (pktrxInfo.IsPhyRxComplete ())
+    {
+      NS_LOG_INFO ("MacRxTrace for packet:" << AnimUid << " complete");
+      OutputWirelessPacket (p, pktInfo, pktrxInfo);
+    }
 }
 
 void AnimationInterface::WifiMacRxTrace (std::string context,
                                          Ptr<const Packet> p)
 {
-  if (!m_started)
+  if (!m_started || !IsInTimeWindow ())
     return;
   Ptr <NetDevice> ndev = GetNetDeviceFromContext (context);
   NS_ASSERT (ndev);
@@ -789,7 +905,7 @@
   if (pktrxInfo.IsPhyRxComplete ())
     {
       NS_LOG_INFO ("MacRxTrace for packet:" << AnimUid << " complete");
-      OutputWirelessPacket (pktInfo, pktrxInfo);
+      OutputWirelessPacket (p, pktInfo, pktrxInfo);
     }
 
 }
@@ -800,7 +916,7 @@
 
 void AnimationInterface::WimaxTxTrace (std::string context, Ptr<const Packet> p, const Mac48Address & m)
 {
-  if (!m_started)
+  if (!m_started || !IsInTimeWindow ())
     return;
   Ptr <NetDevice> ndev = GetNetDeviceFromContext (context);
   NS_ASSERT (ndev);
@@ -819,25 +935,69 @@
 
 void AnimationInterface::WimaxRxTrace (std::string context, Ptr<const Packet> p, const Mac48Address & m)
 {
-  if (!m_started)
+  if (!m_started || !IsInTimeWindow ())
     return;
   Ptr <NetDevice> ndev = GetNetDeviceFromContext (context);
   NS_ASSERT (ndev);
   Ptr <Node> n = ndev->GetNode ();
   NS_ASSERT (n);
   uint64_t AnimUid = GetAnimUidFromPacket (p);
+  NS_LOG_INFO ("WimaxRxTrace for packet:" << AnimUid);
   NS_ASSERT (WimaxPacketIsPending (AnimUid) == true);
   AnimPacketInfo& pktInfo = pendingWimaxPackets[AnimUid];
   pktInfo.ProcessRxBegin (ndev, Simulator::Now ());
   pktInfo.ProcessRxEnd (ndev, Simulator::Now () + Seconds (0.001), UpdatePosition (n));
   //TODO 0.001 is used until Wimax implements RxBegin and RxEnd traces
   AnimRxInfo pktrxInfo = pktInfo.GetRxInfo (ndev);
-  OutputWirelessPacket (pktInfo, pktrxInfo);
+  OutputWirelessPacket (p, pktInfo, pktrxInfo);
+}
+
+void AnimationInterface::LteTxTrace (std::string context, Ptr<const Packet> p, const Mac48Address & m)
+{
+  if (!m_started || !IsInTimeWindow ())
+    return;
+  Ptr <NetDevice> ndev = GetNetDeviceFromContext (context);
+  NS_ASSERT (ndev);
+  Ptr <Node> n = ndev->GetNode ();
+  NS_ASSERT (n);
+  gAnimUid++;
+  NS_LOG_INFO ("LteTxTrace for packet:" << gAnimUid);
+  AnimPacketInfo pktinfo (ndev, Simulator::Now (), Simulator::Now () + Seconds (0.001), UpdatePosition (n));
+  //TODO 0.0001 is used until Lte implements TxBegin and TxEnd traces
+  AnimByteTag tag;
+  tag.Set (gAnimUid);
+  p->AddByteTag (tag);
+  AddPendingLtePacket (gAnimUid, pktinfo);
 }
 
+
+void AnimationInterface::LteRxTrace (std::string context, Ptr<const Packet> p, const Mac48Address & m)
+{
+  if (!m_started || !IsInTimeWindow ())
+    return;
+  Ptr <NetDevice> ndev = GetNetDeviceFromContext (context);
+  NS_ASSERT (ndev);
+  Ptr <Node> n = ndev->GetNode ();
+  NS_ASSERT (n);
+  uint64_t AnimUid = GetAnimUidFromPacket (p);
+  NS_LOG_INFO ("LteRxTrace for packet:" << gAnimUid);
+  if (!LtePacketIsPending (AnimUid))
+    {
+      NS_LOG_WARN ("LteRxTrace: unknown Uid");
+      return;
+    }
+  AnimPacketInfo& pktInfo = pendingLtePackets[AnimUid];
+  pktInfo.ProcessRxBegin (ndev, Simulator::Now ());
+  pktInfo.ProcessRxEnd (ndev, Simulator::Now () + Seconds (0.001), UpdatePosition (n));
+  //TODO 0.001 is used until Lte implements RxBegin and RxEnd traces
+  AnimRxInfo pktrxInfo = pktInfo.GetRxInfo (ndev);
+  OutputWirelessPacket (p, pktInfo, pktrxInfo);
+}
+
+
 void AnimationInterface::CsmaPhyTxBeginTrace (std::string context, Ptr<const Packet> p)
 {
-  if (!m_started)
+  if (!m_started || !IsInTimeWindow ())
     return;
   Ptr <NetDevice> ndev = GetNetDeviceFromContext (context);
   NS_ASSERT (ndev);
@@ -855,16 +1015,20 @@
 
 void AnimationInterface::CsmaPhyTxEndTrace (std::string context, Ptr<const Packet> p)
 {
-  if (!m_started)
+  if (!m_started || !IsInTimeWindow ())
     return;
   Ptr <NetDevice> ndev = GetNetDeviceFromContext (context);
   NS_ASSERT (ndev);
+  Ptr <Node> n = ndev->GetNode ();
+  NS_ASSERT (n);
   uint64_t AnimUid = GetAnimUidFromPacket (p);
   NS_LOG_INFO ("CsmaPhyTxEndTrace for packet:" << AnimUid);
   if (!CsmaPacketIsPending (AnimUid))
     {
       NS_LOG_WARN ("CsmaPhyTxEndTrace: unknown Uid"); 
-      return;
+      AnimPacketInfo pktinfo (ndev, Simulator::Now (), Simulator::Now (), UpdatePosition (n));
+      AddPendingCsmaPacket (AnimUid, pktinfo);
+      NS_LOG_WARN ("Unknown Uid, but adding Csma Packet anyway");
     }
   // TODO: NS_ASSERT (CsmaPacketIsPending (AnimUid) == true);
   AnimPacketInfo& pktInfo = pendingCsmaPackets[AnimUid];
@@ -873,7 +1037,7 @@
 
 void AnimationInterface::CsmaPhyRxEndTrace (std::string context, Ptr<const Packet> p)
 {
-  if (!m_started)
+  if (!m_started || !IsInTimeWindow ())
     return;
   Ptr <NetDevice> ndev = GetNetDeviceFromContext (context);
   NS_ASSERT (ndev);
@@ -896,7 +1060,7 @@
 void AnimationInterface::CsmaMacRxTrace (std::string context,
                                          Ptr<const Packet> p)
 {
-  if (!m_started)
+  if (!m_started || !IsInTimeWindow ())
     return;
   NS_LOG_FUNCTION (this);
   Ptr <NetDevice> ndev = GetNetDeviceFromContext (context);
@@ -915,7 +1079,7 @@
   if (pktrxInfo.IsPhyRxComplete ())
     {
       NS_LOG_INFO ("MacRxTrace for packet:" << AnimUid << " complete");
-      OutputCsmaPacket (pktInfo, pktrxInfo);
+      OutputCsmaPacket (p, pktInfo, pktrxInfo);
     }
 }
 
@@ -923,7 +1087,7 @@
 void AnimationInterface::MobilityCourseChangeTrace (Ptr <const MobilityModel> mobility)
 
 {
-  if (!m_started)
+  if (!m_started || !IsInTimeWindow ())
     return;
   Ptr <Node> n = mobility->GetObject <Node> ();
   NS_ASSERT (n);
@@ -963,6 +1127,8 @@
 
 void AnimationInterface::MobilityAutoCheck ()
 {
+  if (!m_started || !IsInTimeWindow ())
+    return;
   std::vector <Ptr <Node> > MovedNodes = RecalcTopoBounds ();
   std::ostringstream oss;
   oss << GetXMLOpen_topology (topo_minX, topo_minY, topo_maxX, topo_maxY);
@@ -980,11 +1146,18 @@
     {
       PurgePendingWifi ();
       PurgePendingWimax ();
+      PurgePendingLte ();
       PurgePendingCsma ();
       Simulator::Schedule (mobilitypollinterval, &AnimationInterface::MobilityAutoCheck, this);
     }
 }
 
+std::string AnimationInterface::GetPacketMetadata (Ptr<const Packet> p)
+{
+  std::ostringstream oss;
+  p->Print (oss);
+  return oss.str ();
+}
 
 // Helper to output a wireless packet.
 // For now, only the XML interface is supported
@@ -997,39 +1170,31 @@
     Description of attributes:\n\
     =========================\n\
     anim\n\
-    * lp = Logical Processor Id\n\
     topology\n\
     * minX = minimum X coordinate of the canvas\n\
     * minY = minimum Y coordinate of the canvas\n\
     * maxX = maximum X coordinate of the canvas\n\
     * maxY = maximum Y coordinate of the canvas\n\
     node\n\
-    * lp = Logical Processor Id\n\
     * id = Node Id\n\
     * locX = X coordinate\n\
     * locY = Y coordinate\n\
     link\n\
-    * fromLp = From logical processor Id\n\
     * fromId = From Node Id\n\
-    * toLp   = To logical processor Id\n\
     * toId   = To Node Id\n\
     packet\n\
-    * fromLp = From logical processor Id\n\
     * fbTx = First bit transmit time\n\
     * lbTx = Last bit transmit time\n\
     rx\n\
-    * toLp = To logical processor Id\n\
     * toId = To Node Id\n\
     * fbRx = First bit Rx Time\n\
     * lbRx = Last bit Rx\n\
     wpacket\n\
-    * fromLp = From logical processor Id\n\
     * fromId = From Node Id\n\
     * fbTx = First bit transmit time\n\
     * lbTx = Last bit transmit time\n\
     * range = Reception range\n\
     rx\n\
-    * toLp = To logical processor Id\n\
     * toId = To Node Id\n\
     * fbRx = First bit Rx time\n\
     * lbRx = Last bit Rx time-->\n\
@@ -1037,24 +1202,29 @@
 return s;
 }
 
-void AnimationInterface::OutputWirelessPacket (AnimPacketInfo &pktInfo, AnimRxInfo pktrxInfo)
+void AnimationInterface::OutputWirelessPacket (Ptr<const Packet> p, AnimPacketInfo &pktInfo, AnimRxInfo pktrxInfo)
 {
   NS_ASSERT (m_xml);
   std::ostringstream oss;
-  NS_ASSERT (pktInfo.m_txnd);
-  uint32_t nodeId = pktInfo.m_txnd->GetNode ()->GetId ();
+  uint32_t nodeId =  0;
+  if (pktInfo.m_txnd)
+    nodeId = pktInfo.m_txnd->GetNode ()->GetId ();
+  else
+    nodeId = pktInfo.m_txNodeId;
 
   double lbTx = pktInfo.firstlastbitDelta + pktInfo.m_fbTx;
   oss << GetXMLOpen_wpacket (0, nodeId, pktInfo.m_fbTx, lbTx, pktrxInfo.rxRange);
 
   uint32_t rxId = pktrxInfo.m_rxnd->GetNode ()->GetId ();
   oss << GetXMLOpenClose_rx (0, rxId, pktrxInfo.m_fbRx, pktrxInfo.m_lbRx);
+  if (m_enablePacketMetadata)
+    oss << GetXMLOpenClose_meta (GetPacketMetadata (p));
 
   oss << GetXMLClose ("wpacket");
   WriteN (m_fHandle, oss.str ());
 }
 
-void AnimationInterface::OutputCsmaPacket (AnimPacketInfo &pktInfo, AnimRxInfo pktrxInfo)
+void AnimationInterface::OutputCsmaPacket (Ptr<const Packet> p, AnimPacketInfo &pktInfo, AnimRxInfo pktrxInfo)
 {
   NS_ASSERT (m_xml);
   std::ostringstream oss;
@@ -1064,6 +1234,8 @@
   oss << GetXMLOpen_packet (0, nodeId, pktInfo.m_fbTx, pktInfo.m_lbTx);
   uint32_t rxId = pktrxInfo.m_rxnd->GetNode ()->GetId ();
   oss << GetXMLOpenClose_rx (0, rxId, pktrxInfo.m_fbRx, pktrxInfo.m_lbRx);
+  if (m_enablePacketMetadata)
+    oss << GetXMLOpenClose_meta (GetPacketMetadata (p));
   oss << GetXMLClose ("packet");
   WriteN (m_fHandle, oss.str ());
 }
@@ -1083,6 +1255,22 @@
 
 }
 
+void AnimationInterface::SetNodeDescription (Ptr <Node> n, std::string descr) 
+{
+  NS_ASSERT (n);
+  nodeDescriptions[n->GetId ()] = descr;
+}
+
+void AnimationInterface::SetNodeDescription (NodeContainer nc, std::string descr)
+{
+  for (uint32_t i = 0; i < nc.GetN (); ++i)
+    {
+      Ptr <Node> n = nc.Get (i);
+      NS_ASSERT (n);
+      nodeDescriptions[n->GetId ()] = descr;
+    }
+}
+
 
 // XML Private Helpers
 
@@ -1105,14 +1293,22 @@
 std::string AnimationInterface::GetXMLOpenClose_node (uint32_t lp,uint32_t id,double locX,double locY)
 {
   std::ostringstream oss;
-  oss <<"<node lp = \"" << lp << "\" id = \"" << id << "\"" << " locX = \"" 
-      << locX << "\" " << "locY = \"" << locY << "\" />\n";
+  oss <<"<node id = \"" << id << "\""; 
+  if (nodeDescriptions.find (id) != nodeDescriptions.end ())
+    {
+      oss << " descr=\""<< nodeDescriptions[id] << "\"";
+    }
+  else
+    {
+      oss << " descr=\"\"";
+    }
+  oss << " locX = \"" << locX << "\" " << "locY = \"" << locY << "\" />\n";
   return oss.str ();
 }
 std::string AnimationInterface::GetXMLOpenClose_link (uint32_t fromLp,uint32_t fromId, uint32_t toLp, uint32_t toId)
 {
   std::ostringstream oss;
-  oss << "<link fromLp=\"0\" fromId=\"" << fromId
+  oss << "<link fromId=\"" << fromId
       << "\" toLp=\"0\" toId=\"" << toId
       << "\"/>" << std::endl;
   return oss.str ();
@@ -1123,7 +1319,7 @@
 {
   std::ostringstream oss;
   oss << std::setprecision (10);
-  oss << "<packet fromLp=\"" << fromLp << "\" fromId=\"" << fromId
+  oss << "<packet fromId=\"" << fromId
       << "\" fbTx=\"" << fbTx
       << "\" lbTx=\"" << lbTx
       << (auxInfo.empty()?"":"\" aux=\"") << auxInfo.c_str ()
@@ -1135,10 +1331,10 @@
 {
   std::ostringstream oss;
   oss << std::setprecision (10);
-  oss << "<wpacket fromLp = \"" << fromLp << "\" fromId = \"" << fromId
-      << "\" fbTx = \"" << fbTx
-      << "\" lbTx = \"" << lbTx
-      << "\" range = \"" << range << "\">" << std::endl;
+  oss << "<wpacket fromId=\"" << fromId
+      << "\" fbTx=\"" << fbTx
+      << "\" lbTx=\"" << lbTx
+      << "\" range=\"" << range << "\">" << std::endl;
   return oss.str ();
 
 }
@@ -1147,13 +1343,21 @@
 {
   std::ostringstream oss;
   oss << std::setprecision (10);
-  oss << "<rx toLp=\"" << toLp <<"\" toId=\"" << toId
+  oss << "<rx toId=\"" << toId
       << "\" fbRx=\"" << fbRx
       << "\" lbRx=\"" << lbRx
       << "\"/>" << std::endl;
   return oss.str ();
 }
 
+std::string AnimationInterface::GetXMLOpenClose_meta (std::string metaInfo)
+{
+  std::ostringstream oss;
+  oss << "<meta info=\""
+      << metaInfo << "\" />" << std::endl;
+  return oss.str ();      
+}
+
 std::vector<std::string> AnimationInterface::GetElementsFromContext (std::string context)
 {
   std::vector <std::string> elements;
--- a/src/netanim/model/animation-interface.h	Wed Apr 11 11:00:27 2012 +0200
+++ b/src/netanim/model/animation-interface.h	Wed Apr 11 13:49:33 2012 +0200
@@ -26,6 +26,7 @@
 #include <map>
 #include "ns3/ptr.h"
 #include "ns3/net-device.h"
+#include "ns3/node-container.h"
 #include "ns3/nstime.h"
 #include "ns3/log.h"
 #include "ns3/node-list.h"
@@ -128,6 +129,24 @@
   void SetXMLOutput ();
 
   /**
+   * \brief Specify the time at which capture should start
+   * 
+   * \param t The time at which AnimationInterface should begin capture of traffic info
+   *
+   * \returns none
+   */
+  void SetStartTime (Time t);
+
+  /**
+   * \brief Specify the time at which capture should stop
+   * 
+   * \param t The time at which AnimationInterface should stop capture of traffic info
+   *
+   * \returns none
+   */
+  void SetStopTime (Time t);
+
+  /**
    * \brief (Deprecated) Specify that animation commands are to be written to
    * a socket.
    *
@@ -208,7 +227,23 @@
    * \param z Z co-ordinate of the node
    *
    */
-  void SetConstantPosition (Ptr <Node> n, double x, double y, double z=0);
+  static void SetConstantPosition (Ptr <Node> n, double x, double y, double z=0);
+
+  /**
+   * \brief Helper function to set a brief description for a given node
+   * \param n Ptr to the node
+   * \param descr A string to briefly describe the node
+   *
+   */
+  static void SetNodeDescription (Ptr <Node> n, std::string descr);
+
+  /**
+   * \brief Helper function to set a brief description for nodes in a Node Container
+   * \param nc NodeContainer containing the nodes
+   * \param descr A string to briefly describe the nodes
+   *
+   */
+  static void SetNodeDescription (NodeContainer nc, std::string descr);
 
   /**
    * \brief Is AnimationInterface started
@@ -217,6 +252,24 @@
    */
   bool IsStarted (void);
 
+  /**
+   * \brief Show all 802.11 frames. Default: show only frames accepted by mac layer
+   * \param showAll if true shows all 802.11 frames including beacons, association
+   *  request and acks (very chatty). if false only frames accepted by mac layer
+   *
+   */
+  void ShowAll802_11 (bool showAll); 
+
+  /**
+   *
+   * \brief Enable Packet metadata
+   * \param enable if true enables writing the packet metadata to the XML trace file
+   *        if false disables writing the packet metadata
+   */
+  void EnablePacketMetadata (bool enable);
+
+
+
 private:
 #ifndef WIN32
   int m_fHandle;  // File handle for output (-1 if none)
@@ -233,6 +286,7 @@
   std::string outputfilename;
   bool OutputFileSet;
   bool ServerPortSet;
+
   void DevTxTrace (std::string context,
                    Ptr<const Packet> p,
                    Ptr<NetDevice> tx,
@@ -267,13 +321,22 @@
                           Ptr<const Packet> p);
   void CsmaMacRxTrace (std::string context,
                        Ptr<const Packet> p);
+
+  void LteTxTrace (std::string context,
+                      Ptr<const Packet> p,
+                      const Mac48Address &);
+
+  void LteRxTrace (std::string context,
+                      Ptr<const Packet> p,
+                      const Mac48Address &);
+
   void MobilityCourseChangeTrace (Ptr <const MobilityModel> mob);
 
   // Write a string to the specified handle;
   int  WriteN (int, const std::string&);
 
-  void OutputWirelessPacket (AnimPacketInfo& pktInfo, AnimRxInfo pktrxInfo);
-  void OutputCsmaPacket (AnimPacketInfo& pktInfo, AnimRxInfo pktrxInfo);
+  void OutputWirelessPacket (Ptr<const Packet> p, AnimPacketInfo& pktInfo, AnimRxInfo pktrxInfo);
+  void OutputCsmaPacket (Ptr<const Packet> p, AnimPacketInfo& pktInfo, AnimRxInfo pktrxInfo);
   void MobilityAutoCheck ();
   
   uint64_t gAnimUid ;    // Packet unique identifier used by Animtion
@@ -286,6 +349,10 @@
   void AddPendingWimaxPacket (uint64_t AnimUid, AnimPacketInfo&);
   bool WimaxPacketIsPending (uint64_t AnimUid); 
 
+  std::map<uint64_t, AnimPacketInfo> pendingLtePackets;
+  void AddPendingLtePacket (uint64_t AnimUid, AnimPacketInfo&);
+  bool LtePacketIsPending (uint64_t AnimUid);
+
   std::map<uint64_t, AnimPacketInfo> pendingCsmaPackets;
   void AddPendingCsmaPacket (uint64_t AnimUid, AnimPacketInfo&);
   bool CsmaPacketIsPending (uint64_t AnimUid);
@@ -302,6 +369,7 @@
 
   void PurgePendingWifi ();
   void PurgePendingWimax ();
+  void PurgePendingLte ();
   void PurgePendingCsma ();
 
   // Recalculate topology bounds
@@ -313,11 +381,19 @@
   void ConnectCallbacks ();
 
   bool m_started;
+  bool m_enablePacketMetadata; 
+  Time m_startTime;
+  Time m_stopTime;
+  
+  std::map <std::string, uint32_t> m_macToNodeIdMap;
+  bool IsInTimeWindow ();
 
   // Path helper
   std::vector<std::string> GetElementsFromContext (std::string context);
   Ptr <NetDevice> GetNetDeviceFromContext (std::string context);
 
+  static std::map <uint32_t, std::string> nodeDescriptions;
+
   // XML helpers
   std::string GetPreamble (void);
   // Topology element dimensions
@@ -326,6 +402,8 @@
   double topo_maxX;
   double topo_maxY;
 
+  std::string GetPacketMetadata (Ptr<const Packet> p);
+
   std::string GetXMLOpen_anim (uint32_t lp);
   std::string GetXMLOpen_topology (double minX,double minY,double maxX,double maxY);
   std::string GetXMLOpenClose_node (uint32_t lp,uint32_t id,double locX,double locY);
@@ -334,6 +412,7 @@
   std::string GetXMLOpenClose_rx (uint32_t toLp, uint32_t toId, double fbRx, double lbRx);
   std::string GetXMLOpen_wpacket (uint32_t fromLp,uint32_t fromId, double fbTx, double lbTx, double range);
   std::string GetXMLClose (std::string name) {return "</" + name + ">\n"; }
+  std::string GetXMLOpenClose_meta (std::string metaInfo);
 
 };
 
--- a/src/netanim/wscript	Wed Apr 11 11:00:27 2012 +0200
+++ b/src/netanim/wscript	Wed Apr 11 13:49:33 2012 +0200
@@ -2,9 +2,13 @@
 
 import wutils
 
+# Required NetAnim version
+NETANIM_RELEASE_NAME = "netanim-3.100"
+
+
 def build (bld) :
         bld.install_files('${INCLUDEDIR}/%s%s/ns3' % (wutils.APPNAME, wutils.VERSION), '../../ns3/netanim-config.h')
-	module = bld.create_ns3_module ('netanim', ['internet', 'mobility', 'wimax', 'wifi', 'csma'])
+	module = bld.create_ns3_module ('netanim', ['internet', 'mobility', 'wimax', 'wifi', 'csma', 'lte'])
 	module.includes = '.'
 	module.source = [
 			  'model/animation-interface.cc',
--- a/src/network/bindings/modulegen__gcc_ILP32.py	Wed Apr 11 11:00:27 2012 +0200
+++ b/src/network/bindings/modulegen__gcc_ILP32.py	Wed Apr 11 13:49:33 2012 +0200
@@ -4463,6 +4463,11 @@
                    'uint32_t', 
                    [], 
                    is_pure_virtual=True, is_const=True, is_virtual=True)
+    ## socket.h (module 'network'): bool ns3::Socket::IsRecvPktInfo() const [member function]
+    cls.add_method('IsRecvPktInfo', 
+                   'bool', 
+                   [], 
+                   is_const=True)
     ## socket.h (module 'network'): int ns3::Socket::Listen() [member function]
     cls.add_method('Listen', 
                    'int', 
--- a/src/network/bindings/modulegen__gcc_LP64.py	Wed Apr 11 11:00:27 2012 +0200
+++ b/src/network/bindings/modulegen__gcc_LP64.py	Wed Apr 11 13:49:33 2012 +0200
@@ -4463,6 +4463,11 @@
                    'uint32_t', 
                    [], 
                    is_pure_virtual=True, is_const=True, is_virtual=True)
+    ## socket.h (module 'network'): bool ns3::Socket::IsRecvPktInfo() const [member function]
+    cls.add_method('IsRecvPktInfo', 
+                   'bool', 
+                   [], 
+                   is_const=True)
     ## socket.h (module 'network'): int ns3::Socket::Listen() [member function]
     cls.add_method('Listen', 
                    'int', 
--- a/src/network/model/socket.cc	Wed Apr 11 11:00:27 2012 +0200
+++ b/src/network/model/socket.cc	Wed Apr 11 13:49:33 2012 +0200
@@ -34,7 +34,7 @@
 Socket::Socket (void)
 {
   m_boundnetdevice = 0;
-  m_recvpktinfo = false;
+  m_recvPktInfo = false;
   NS_LOG_FUNCTION_NOARGS ();
 }
 
@@ -331,7 +331,13 @@
 Socket::SetRecvPktInfo (bool flag)
 {
   NS_LOG_FUNCTION_NOARGS ();
-  m_recvpktinfo = flag;
+  m_recvPktInfo = flag;
+}
+
+bool Socket::IsRecvPktInfo () const
+{
+  NS_LOG_FUNCTION_NOARGS ();
+  return m_recvPktInfo;
 }
 
 /***************************************************************
--- a/src/network/model/socket.h	Wed Apr 11 11:00:27 2012 +0200
+++ b/src/network/model/socket.h	Wed Apr 11 13:49:33 2012 +0200
@@ -595,10 +595,20 @@
    * For IP_PKTINFO/IP6_PKTINFO. This method is only usable for 
    * Raw socket and Datagram Socket. Not supported for Stream socket.
    *
+   * Method doesn't make distinction between IPv4 and IPv6. If it is enabled,
+   * it is enabled for all types of sockets that supports packet information
+   *
    * \param flag Enable/Disable receive information
    * \returns nothing
    */
   void SetRecvPktInfo (bool flag);
+
+  /**
+   * \brief Get status indicating whether enable/disable packet information to socket
+   *
+   * \returns True if packet information should be sent to socket
+   */
+  bool IsRecvPktInfo () const;
  
 protected:
   void NotifyConnectionSucceeded (void);
@@ -612,7 +622,7 @@
   void NotifyDataRecv (void);
   virtual void DoDispose (void);
   Ptr<NetDevice> m_boundnetdevice;
-  bool m_recvpktinfo;
+  bool m_recvPktInfo;
 private:
   Callback<void, Ptr<Socket> >                   m_connectionSucceeded;
   Callback<void, Ptr<Socket> >                   m_connectionFailed;
--- a/src/nix-vector-routing/bindings/modulegen__gcc_ILP32.py	Wed Apr 11 11:00:27 2012 +0200
+++ b/src/nix-vector-routing/bindings/modulegen__gcc_ILP32.py	Wed Apr 11 13:49:33 2012 +0200
@@ -3272,6 +3272,11 @@
                    'uint32_t', 
                    [], 
                    is_pure_virtual=True, is_const=True, is_virtual=True)
+    ## socket.h (module 'network'): bool ns3::Socket::IsRecvPktInfo() const [member function]
+    cls.add_method('IsRecvPktInfo', 
+                   'bool', 
+                   [], 
+                   is_const=True)
     ## socket.h (module 'network'): int ns3::Socket::Listen() [member function]
     cls.add_method('Listen', 
                    'int', 
--- a/src/nix-vector-routing/bindings/modulegen__gcc_LP64.py	Wed Apr 11 11:00:27 2012 +0200
+++ b/src/nix-vector-routing/bindings/modulegen__gcc_LP64.py	Wed Apr 11 13:49:33 2012 +0200
@@ -3272,6 +3272,11 @@
                    'uint32_t', 
                    [], 
                    is_pure_virtual=True, is_const=True, is_virtual=True)
+    ## socket.h (module 'network'): bool ns3::Socket::IsRecvPktInfo() const [member function]
+    cls.add_method('IsRecvPktInfo', 
+                   'bool', 
+                   [], 
+                   is_const=True)
     ## socket.h (module 'network'): int ns3::Socket::Listen() [member function]
     cls.add_method('Listen', 
                    'int', 
--- a/src/olsr/bindings/modulegen__gcc_ILP32.py	Wed Apr 11 11:00:27 2012 +0200
+++ b/src/olsr/bindings/modulegen__gcc_ILP32.py	Wed Apr 11 13:49:33 2012 +0200
@@ -3496,6 +3496,11 @@
                    'uint32_t', 
                    [], 
                    is_pure_virtual=True, is_const=True, is_virtual=True)
+    ## socket.h (module 'network'): bool ns3::Socket::IsRecvPktInfo() const [member function]
+    cls.add_method('IsRecvPktInfo', 
+                   'bool', 
+                   [], 
+                   is_const=True)
     ## socket.h (module 'network'): int ns3::Socket::Listen() [member function]
     cls.add_method('Listen', 
                    'int', 
@@ -4654,10 +4659,11 @@
     cls.add_method('GetDefaultRoute', 
                    'ns3::Ipv4RoutingTableEntry', 
                    [])
-    ## ipv4-static-routing.h (module 'internet'): uint32_t ns3::Ipv4StaticRouting::GetMetric(uint32_t index) [member function]
+    ## ipv4-static-routing.h (module 'internet'): uint32_t ns3::Ipv4StaticRouting::GetMetric(uint32_t index) const [member function]
     cls.add_method('GetMetric', 
                    'uint32_t', 
-                   [param('uint32_t', 'index')])
+                   [param('uint32_t', 'index')], 
+                   is_const=True)
     ## ipv4-static-routing.h (module 'internet'): ns3::Ipv4MulticastRoutingTableEntry ns3::Ipv4StaticRouting::GetMulticastRoute(uint32_t i) const [member function]
     cls.add_method('GetMulticastRoute', 
                    'ns3::Ipv4MulticastRoutingTableEntry', 
--- a/src/olsr/bindings/modulegen__gcc_LP64.py	Wed Apr 11 11:00:27 2012 +0200
+++ b/src/olsr/bindings/modulegen__gcc_LP64.py	Wed Apr 11 13:49:33 2012 +0200
@@ -3496,6 +3496,11 @@
                    'uint32_t', 
                    [], 
                    is_pure_virtual=True, is_const=True, is_virtual=True)
+    ## socket.h (module 'network'): bool ns3::Socket::IsRecvPktInfo() const [member function]
+    cls.add_method('IsRecvPktInfo', 
+                   'bool', 
+                   [], 
+                   is_const=True)
     ## socket.h (module 'network'): int ns3::Socket::Listen() [member function]
     cls.add_method('Listen', 
                    'int', 
@@ -4654,10 +4659,11 @@
     cls.add_method('GetDefaultRoute', 
                    'ns3::Ipv4RoutingTableEntry', 
                    [])
-    ## ipv4-static-routing.h (module 'internet'): uint32_t ns3::Ipv4StaticRouting::GetMetric(uint32_t index) [member function]
+    ## ipv4-static-routing.h (module 'internet'): uint32_t ns3::Ipv4StaticRouting::GetMetric(uint32_t index) const [member function]
     cls.add_method('GetMetric', 
                    'uint32_t', 
-                   [param('uint32_t', 'index')])
+                   [param('uint32_t', 'index')], 
+                   is_const=True)
     ## ipv4-static-routing.h (module 'internet'): ns3::Ipv4MulticastRoutingTableEntry ns3::Ipv4StaticRouting::GetMulticastRoute(uint32_t i) const [member function]
     cls.add_method('GetMulticastRoute', 
                    'ns3::Ipv4MulticastRoutingTableEntry', 
--- a/src/point-to-point-layout/bindings/modulegen__gcc_ILP32.py	Wed Apr 11 11:00:27 2012 +0200
+++ b/src/point-to-point-layout/bindings/modulegen__gcc_ILP32.py	Wed Apr 11 13:49:33 2012 +0200
@@ -4125,6 +4125,11 @@
                    'uint32_t', 
                    [], 
                    is_pure_virtual=True, is_const=True, is_virtual=True)
+    ## socket.h (module 'network'): bool ns3::Socket::IsRecvPktInfo() const [member function]
+    cls.add_method('IsRecvPktInfo', 
+                   'bool', 
+                   [], 
+                   is_const=True)
     ## socket.h (module 'network'): int ns3::Socket::Listen() [member function]
     cls.add_method('Listen', 
                    'int', 
--- a/src/point-to-point-layout/bindings/modulegen__gcc_LP64.py	Wed Apr 11 11:00:27 2012 +0200
+++ b/src/point-to-point-layout/bindings/modulegen__gcc_LP64.py	Wed Apr 11 13:49:33 2012 +0200
@@ -4125,6 +4125,11 @@
                    'uint32_t', 
                    [], 
                    is_pure_virtual=True, is_const=True, is_virtual=True)
+    ## socket.h (module 'network'): bool ns3::Socket::IsRecvPktInfo() const [member function]
+    cls.add_method('IsRecvPktInfo', 
+                   'bool', 
+                   [], 
+                   is_const=True)
     ## socket.h (module 'network'): int ns3::Socket::Listen() [member function]
     cls.add_method('Listen', 
                    'int', 
--- a/src/point-to-point-layout/model/point-to-point-dumbbell.cc	Wed Apr 11 11:00:27 2012 +0200
+++ b/src/point-to-point-layout/model/point-to-point-dumbbell.cc	Wed Apr 11 13:49:33 2012 +0200
@@ -22,7 +22,7 @@
 #include <sstream>
 
 // ns3 includes
-#include "ns3/animation-interface.h"
+#include "ns3/log.h"
 #include "ns3/point-to-point-dumbbell.h"
 #include "ns3/constant-position-mobility-model.h"
 
--- a/src/point-to-point-layout/model/point-to-point-grid.cc	Wed Apr 11 11:00:27 2012 +0200
+++ b/src/point-to-point-layout/model/point-to-point-grid.cc	Wed Apr 11 13:49:33 2012 +0200
@@ -17,7 +17,6 @@
  */
 
 #include "ns3/point-to-point-grid.h"
-#include "ns3/animation-interface.h"
 #include "ns3/internet-stack-helper.h"
 #include "ns3/point-to-point-helper.h"
 #include "ns3/constant-position-mobility-model.h"
--- a/src/point-to-point-layout/model/point-to-point-star.cc	Wed Apr 11 11:00:27 2012 +0200
+++ b/src/point-to-point-layout/model/point-to-point-star.cc	Wed Apr 11 13:49:33 2012 +0200
@@ -18,7 +18,7 @@
 #include <sstream>
 
 // ns3 includes
-#include "ns3/animation-interface.h"
+#include "ns3/log.h"
 #include "ns3/point-to-point-star.h"
 #include "ns3/constant-position-mobility-model.h"
 
--- a/src/spectrum/bindings/modulegen__gcc_ILP32.py	Wed Apr 11 11:00:27 2012 +0200
+++ b/src/spectrum/bindings/modulegen__gcc_ILP32.py	Wed Apr 11 13:49:33 2012 +0200
@@ -264,6 +264,8 @@
     module.add_class('CallbackValue', import_from_module='ns.core', parent=root_module['ns3::AttributeValue'])
     ## channel.h (module 'network'): ns3::Channel [class]
     module.add_class('Channel', import_from_module='ns.network', parent=root_module['ns3::Object'])
+    ## constant-spectrum-propagation-loss.h (module 'spectrum'): ns3::ConstantSpectrumPropagationLossModel [class]
+    module.add_class('ConstantSpectrumPropagationLossModel', parent=root_module['ns3::SpectrumPropagationLossModel'])
     ## propagation-delay-model.h (module 'propagation'): ns3::ConstantSpeedPropagationDelayModel [class]
     module.add_class('ConstantSpeedPropagationDelayModel', import_from_module='ns.propagation', parent=root_module['ns3::PropagationDelayModel'])
     ## data-rate.h (module 'network'): ns3::DataRateChecker [class]
@@ -554,6 +556,7 @@
     register_Ns3CallbackImplBase_methods(root_module, root_module['ns3::CallbackImplBase'])
     register_Ns3CallbackValue_methods(root_module, root_module['ns3::CallbackValue'])
     register_Ns3Channel_methods(root_module, root_module['ns3::Channel'])
+    register_Ns3ConstantSpectrumPropagationLossModel_methods(root_module, root_module['ns3::ConstantSpectrumPropagationLossModel'])
     register_Ns3ConstantSpeedPropagationDelayModel_methods(root_module, root_module['ns3::ConstantSpeedPropagationDelayModel'])
     register_Ns3DataRateChecker_methods(root_module, root_module['ns3::DataRateChecker'])
     register_Ns3DataRateValue_methods(root_module, root_module['ns3::DataRateValue'])
@@ -4331,6 +4334,32 @@
                    is_static=True)
     return
 
+def register_Ns3ConstantSpectrumPropagationLossModel_methods(root_module, cls):
+    ## constant-spectrum-propagation-loss.h (module 'spectrum'): ns3::ConstantSpectrumPropagationLossModel::ConstantSpectrumPropagationLossModel(ns3::ConstantSpectrumPropagationLossModel const & arg0) [copy constructor]
+    cls.add_constructor([param('ns3::ConstantSpectrumPropagationLossModel const &', 'arg0')])
+    ## constant-spectrum-propagation-loss.h (module 'spectrum'): ns3::ConstantSpectrumPropagationLossModel::ConstantSpectrumPropagationLossModel() [constructor]
+    cls.add_constructor([])
+    ## constant-spectrum-propagation-loss.h (module 'spectrum'): ns3::Ptr<ns3::SpectrumValue> ns3::ConstantSpectrumPropagationLossModel::DoCalcRxPowerSpectralDensity(ns3::Ptr<ns3::SpectrumValue const> txPsd, ns3::Ptr<const ns3::MobilityModel> a, ns3::Ptr<const ns3::MobilityModel> b) const [member function]
+    cls.add_method('DoCalcRxPowerSpectralDensity', 
+                   'ns3::Ptr< ns3::SpectrumValue >', 
+                   [param('ns3::Ptr< ns3::SpectrumValue const >', 'txPsd'), param('ns3::Ptr< ns3::MobilityModel const >', 'a'), param('ns3::Ptr< ns3::MobilityModel const >', 'b')], 
+                   is_const=True, is_virtual=True)
+    ## constant-spectrum-propagation-loss.h (module 'spectrum'): double ns3::ConstantSpectrumPropagationLossModel::GetLossDb() const [member function]
+    cls.add_method('GetLossDb', 
+                   'double', 
+                   [], 
+                   is_const=True)
+    ## constant-spectrum-propagation-loss.h (module 'spectrum'): static ns3::TypeId ns3::ConstantSpectrumPropagationLossModel::GetTypeId() [member function]
+    cls.add_method('GetTypeId', 
+                   'ns3::TypeId', 
+                   [], 
+                   is_static=True)
+    ## constant-spectrum-propagation-loss.h (module 'spectrum'): void ns3::ConstantSpectrumPropagationLossModel::SetLossDb(double lossDb) [member function]
+    cls.add_method('SetLossDb', 
+                   'void', 
+                   [param('double', 'lossDb')])
+    return
+
 def register_Ns3ConstantSpeedPropagationDelayModel_methods(root_module, cls):
     ## propagation-delay-model.h (module 'propagation'): ns3::ConstantSpeedPropagationDelayModel::ConstantSpeedPropagationDelayModel(ns3::ConstantSpeedPropagationDelayModel const & arg0) [copy constructor]
     cls.add_constructor([param('ns3::ConstantSpeedPropagationDelayModel const &', 'arg0')])
--- a/src/spectrum/bindings/modulegen__gcc_LP64.py	Wed Apr 11 11:00:27 2012 +0200
+++ b/src/spectrum/bindings/modulegen__gcc_LP64.py	Wed Apr 11 13:49:33 2012 +0200
@@ -264,6 +264,8 @@
     module.add_class('CallbackValue', import_from_module='ns.core', parent=root_module['ns3::AttributeValue'])
     ## channel.h (module 'network'): ns3::Channel [class]
     module.add_class('Channel', import_from_module='ns.network', parent=root_module['ns3::Object'])
+    ## constant-spectrum-propagation-loss.h (module 'spectrum'): ns3::ConstantSpectrumPropagationLossModel [class]
+    module.add_class('ConstantSpectrumPropagationLossModel', parent=root_module['ns3::SpectrumPropagationLossModel'])
     ## propagation-delay-model.h (module 'propagation'): ns3::ConstantSpeedPropagationDelayModel [class]
     module.add_class('ConstantSpeedPropagationDelayModel', import_from_module='ns.propagation', parent=root_module['ns3::PropagationDelayModel'])
     ## data-rate.h (module 'network'): ns3::DataRateChecker [class]
@@ -554,6 +556,7 @@
     register_Ns3CallbackImplBase_methods(root_module, root_module['ns3::CallbackImplBase'])
     register_Ns3CallbackValue_methods(root_module, root_module['ns3::CallbackValue'])
     register_Ns3Channel_methods(root_module, root_module['ns3::Channel'])
+    register_Ns3ConstantSpectrumPropagationLossModel_methods(root_module, root_module['ns3::ConstantSpectrumPropagationLossModel'])
     register_Ns3ConstantSpeedPropagationDelayModel_methods(root_module, root_module['ns3::ConstantSpeedPropagationDelayModel'])
     register_Ns3DataRateChecker_methods(root_module, root_module['ns3::DataRateChecker'])
     register_Ns3DataRateValue_methods(root_module, root_module['ns3::DataRateValue'])
@@ -4331,6 +4334,32 @@
                    is_static=True)
     return
 
+def register_Ns3ConstantSpectrumPropagationLossModel_methods(root_module, cls):
+    ## constant-spectrum-propagation-loss.h (module 'spectrum'): ns3::ConstantSpectrumPropagationLossModel::ConstantSpectrumPropagationLossModel(ns3::ConstantSpectrumPropagationLossModel const & arg0) [copy constructor]
+    cls.add_constructor([param('ns3::ConstantSpectrumPropagationLossModel const &', 'arg0')])
+    ## constant-spectrum-propagation-loss.h (module 'spectrum'): ns3::ConstantSpectrumPropagationLossModel::ConstantSpectrumPropagationLossModel() [constructor]
+    cls.add_constructor([])
+    ## constant-spectrum-propagation-loss.h (module 'spectrum'): ns3::Ptr<ns3::SpectrumValue> ns3::ConstantSpectrumPropagationLossModel::DoCalcRxPowerSpectralDensity(ns3::Ptr<ns3::SpectrumValue const> txPsd, ns3::Ptr<const ns3::MobilityModel> a, ns3::Ptr<const ns3::MobilityModel> b) const [member function]
+    cls.add_method('DoCalcRxPowerSpectralDensity', 
+                   'ns3::Ptr< ns3::SpectrumValue >', 
+                   [param('ns3::Ptr< ns3::SpectrumValue const >', 'txPsd'), param('ns3::Ptr< ns3::MobilityModel const >', 'a'), param('ns3::Ptr< ns3::MobilityModel const >', 'b')], 
+                   is_const=True, is_virtual=True)
+    ## constant-spectrum-propagation-loss.h (module 'spectrum'): double ns3::ConstantSpectrumPropagationLossModel::GetLossDb() const [member function]
+    cls.add_method('GetLossDb', 
+                   'double', 
+                   [], 
+                   is_const=True)
+    ## constant-spectrum-propagation-loss.h (module 'spectrum'): static ns3::TypeId ns3::ConstantSpectrumPropagationLossModel::GetTypeId() [member function]
+    cls.add_method('GetTypeId', 
+                   'ns3::TypeId', 
+                   [], 
+                   is_static=True)
+    ## constant-spectrum-propagation-loss.h (module 'spectrum'): void ns3::ConstantSpectrumPropagationLossModel::SetLossDb(double lossDb) [member function]
+    cls.add_method('SetLossDb', 
+                   'void', 
+                   [param('double', 'lossDb')])
+    return
+
 def register_Ns3ConstantSpeedPropagationDelayModel_methods(root_module, cls):
     ## propagation-delay-model.h (module 'propagation'): ns3::ConstantSpeedPropagationDelayModel::ConstantSpeedPropagationDelayModel(ns3::ConstantSpeedPropagationDelayModel const & arg0) [copy constructor]
     cls.add_constructor([param('ns3::ConstantSpeedPropagationDelayModel const &', 'arg0')])
--- a/src/spectrum/model/constant-spectrum-propagation-loss.cc	Wed Apr 11 11:00:27 2012 +0200
+++ b/src/spectrum/model/constant-spectrum-propagation-loss.cc	Wed Apr 11 13:49:33 2012 +0200
@@ -88,13 +88,12 @@
   Values::iterator vit = rxPsd->ValuesBegin ();
   Bands::const_iterator fit = rxPsd->ConstBandsBegin ();
 
-//   NS_LOG_INFO ("Loss = " << m_loss);
   while (vit != rxPsd->ValuesEnd ())
     {
       NS_ASSERT (fit != rxPsd->ConstBandsEnd ());
-//       NS_LOG_INFO ("Ptx = " << *vit);
+      NS_LOG_LOGIC ("Ptx = " << *vit);
       *vit /= m_lossLinear; // Prx = Ptx / loss
-//       NS_LOG_INFO ("Prx = " << *vit);
+      NS_LOG_LOGIC ("Prx = " << *vit);
       ++vit;
       ++fit;
     }
--- a/src/spectrum/model/spectrum-type.cc	Wed Apr 11 11:00:27 2012 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,95 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/*
- * Copyright (c) 2010 CTTC
- *
- * 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
- *
- * Author: Nicola Baldo <nbaldo@cttc.es>
- */
-
-#include "spectrum-type.h"
-#include <ns3/assert.h>
-
-
-namespace ns3 {
-
-
-
-std::vector<std::string> SpectrumTypeFactory::m_names;
-
-
-SpectrumType
-SpectrumTypeFactory::Create (std::string name)
-{
-  std::vector<std::string>::iterator it;
-  for (it = m_names.begin (); it != m_names.end (); ++it)
-    {
-      NS_ASSERT_MSG (name != *it, "name \"" << name << "\" already registered!");
-    }
-  m_names.push_back (name);
-  return SpectrumType (m_names.size () - 1);
-}
-
-
-
-std::string
-SpectrumTypeFactory::GetNameByUid (uint32_t uid)
-{
-  return m_names.at (uid);
-}
-
-
-
-SpectrumType::SpectrumType (uint32_t uid)
-  : m_uid (uid)
-{
-}
-
-uint32_t
-SpectrumType::GetUid () const
-{
-  return m_uid;
-}
-
-
-std::string
-SpectrumType::GetName () const
-{
-  return SpectrumTypeFactory::GetNameByUid (m_uid);
-}
-
-
-bool
-operator== (const SpectrumType& lhs, const SpectrumType& rhs)
-{
-  return (lhs.GetUid () == rhs.GetUid ());
-}
-
-
-bool
-operator!= (const SpectrumType& lhs, const SpectrumType& rhs)
-{
-  return (lhs.GetUid () != rhs.GetUid ());
-}
-
-std::ostream&
-operator<<  (std::ostream& os, const SpectrumType& rhs)
-{
-  os << rhs.GetName ();
-  return os;
-}
-
-
-} // namespace ns3
-
--- a/src/spectrum/model/spectrum-type.h	Wed Apr 11 11:00:27 2012 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,85 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/*
- * Copyright (c) 2009 CTTC
- *
- * 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
- *
- * Author: Nicola Baldo <nbaldo@cttc.es>
- */
-
-#ifndef SPECTRUM_TYPE_H
-#define SPECTRUM_TYPE_H
-
-#include <iostream>
-#include <vector>
-#include <string>
-#include <stdint.h>
-
-namespace ns3 {
-
-
-/**
- * \ingroup spectrum
- *
- * This class represent a type of signal that can be transmitted by
- * SpectrumPhy instances over a SpectrumChannel. By means of this
- * class a SpectrumPhy is able to recognize which type of signals it
- * is able to decode (i.e., receive) and which are to be considered
- * only as a source of interference. Note that this distinction of
- * signal types is an abstraction which is introduced only for
- * simulation purposes: in the real world a device needs to infer
- * whether a signal is of a known type by examining at properties of the
- * signal, such as preamble, CRC fields, etc.
- *
- */
-class SpectrumType
-{
-  friend class SpectrumTypeFactory;
-
-public:
-  uint32_t GetUid () const;
-  std::string GetName () const;
-
-private:
-  SpectrumType (uint32_t m_uid);
-  uint32_t m_uid;
-};
-
-
-bool operator== (const SpectrumType& lhs, const SpectrumType& rhs);
-bool operator!= (const SpectrumType& lhs, const SpectrumType& rhs);
-std::ostream& operator<< (std::ostream& os, const SpectrumType& rhs);
-
-
-
-/**
- * \ingroup spectrum
- *
- */
-class SpectrumTypeFactory
-{
-
-public:
-  static SpectrumType Create (std::string name);
-  static std::string GetNameByUid (uint32_t uid);
-
-private:
-  static std::vector<std::string> m_names;
-};
-
-
-} // namespace ns3
-
-
-#endif /*  SPECTRUM_TYPE_H */
--- a/src/stats/bindings/modulegen__gcc_ILP32.py	Wed Apr 11 11:00:27 2012 +0200
+++ b/src/stats/bindings/modulegen__gcc_ILP32.py	Wed Apr 11 13:49:33 2012 +0200
@@ -3175,6 +3175,10 @@
                    'void', 
                    [param('ns3::DataOutputCallback &', 'callback')], 
                    is_const=True, is_virtual=True)
+    ## basic-data-calculators.h (module 'stats'): void ns3::MinMaxAvgTotalCalculator<unsigned int>::Reset() [member function]
+    cls.add_method('Reset', 
+                   'void', 
+                   [])
     ## basic-data-calculators.h (module 'stats'): void ns3::MinMaxAvgTotalCalculator<unsigned int>::Update(unsigned int const i) [member function]
     cls.add_method('Update', 
                    'void', 
--- a/src/stats/bindings/modulegen__gcc_LP64.py	Wed Apr 11 11:00:27 2012 +0200
+++ b/src/stats/bindings/modulegen__gcc_LP64.py	Wed Apr 11 13:49:33 2012 +0200
@@ -3175,6 +3175,10 @@
                    'void', 
                    [param('ns3::DataOutputCallback &', 'callback')], 
                    is_const=True, is_virtual=True)
+    ## basic-data-calculators.h (module 'stats'): void ns3::MinMaxAvgTotalCalculator<unsigned int>::Reset() [member function]
+    cls.add_method('Reset', 
+                   'void', 
+                   [])
     ## basic-data-calculators.h (module 'stats'): void ns3::MinMaxAvgTotalCalculator<unsigned int>::Update(unsigned int const i) [member function]
     cls.add_method('Update', 
                    'void', 
--- a/src/stats/model/basic-data-calculators.h	Wed Apr 11 11:00:27 2012 +0200
+++ b/src/stats/model/basic-data-calculators.h	Wed Apr 11 13:49:33 2012 +0200
@@ -41,6 +41,7 @@
   virtual ~MinMaxAvgTotalCalculator();
 
   void Update (const T i);
+  void Reset ();
 
   virtual void Output (DataOutputCallback &callback) const;
 
@@ -170,6 +171,24 @@
 
 template <typename T>
 void
+MinMaxAvgTotalCalculator<T>::Reset ()
+{
+  m_count = 0;
+
+  m_total       = 0;
+  m_squareTotal = 0;
+
+  m_meanCurr     = NaN;
+  m_sCurr        = NaN;
+  m_varianceCurr = NaN;
+
+  m_meanPrev     = NaN;
+  m_sPrev        = NaN;
+  // end MinMaxAvgTotalCalculator::Reset
+}
+
+template <typename T>
+void
 MinMaxAvgTotalCalculator<T>::Output (DataOutputCallback &callback) const
 {
   callback.OutputStatistic (m_context, m_key, this);
--- a/src/tap-bridge/bindings/callbacks_list.py	Wed Apr 11 11:00:27 2012 +0200
+++ b/src/tap-bridge/bindings/callbacks_list.py	Wed Apr 11 13:49:33 2012 +0200
@@ -1,6 +1,7 @@
 callback_classes = [
     ['bool', 'ns3::Ptr<ns3::NetDevice>', 'ns3::Ptr<ns3::Packet const>', 'unsigned short', 'ns3::Address const&', 'ns3::Address const&', 'ns3::NetDevice::PacketType', 'ns3::empty', 'ns3::empty', 'ns3::empty'],
     ['bool', 'ns3::Ptr<ns3::NetDevice>', 'ns3::Ptr<ns3::Packet const>', 'unsigned short', 'ns3::Address const&', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty'],
+    ['void', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty'],
     ['void', 'unsigned char*', 'long', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty'],
     ['void', 'ns3::Ptr<ns3::NetDevice>', 'ns3::Ptr<ns3::Packet const>', 'unsigned short', 'ns3::Address const&', 'ns3::Address const&', 'ns3::NetDevice::PacketType', 'ns3::empty', 'ns3::empty', 'ns3::empty'],
 ]
--- a/src/tap-bridge/bindings/modulegen__gcc_ILP32.py	Wed Apr 11 11:00:27 2012 +0200
+++ b/src/tap-bridge/bindings/modulegen__gcc_ILP32.py	Wed Apr 11 13:49:33 2012 +0200
@@ -20,8 +20,6 @@
 def register_types(module):
     root_module = module.get_root()
     
-    ## log.h (module 'core'): ns3::LogLevel [enumeration]
-    module.add_enum('LogLevel', ['LOG_NONE', 'LOG_ERROR', 'LOG_LEVEL_ERROR', 'LOG_WARN', 'LOG_LEVEL_WARN', 'LOG_DEBUG', 'LOG_LEVEL_DEBUG', 'LOG_INFO', 'LOG_LEVEL_INFO', 'LOG_FUNCTION', 'LOG_LEVEL_FUNCTION', 'LOG_LOGIC', 'LOG_LEVEL_LOGIC', 'LOG_ALL', 'LOG_LEVEL_ALL', 'LOG_PREFIX_FUNC', 'LOG_PREFIX_TIME', 'LOG_PREFIX_NODE'], import_from_module='ns.core')
     ## address.h (module 'network'): ns3::Address [class]
     module.add_class('Address', import_from_module='ns.network')
     ## address.h (module 'network'): ns3::Address::MaxSize_e [enumeration]
@@ -46,8 +44,6 @@
     module.add_class('Item', import_from_module='ns.network', outer_class=root_module['ns3::ByteTagList::Iterator'])
     ## callback.h (module 'core'): ns3::CallbackBase [class]
     module.add_class('CallbackBase', import_from_module='ns.core')
-    ## system-mutex.h (module 'core'): ns3::CriticalSection [class]
-    module.add_class('CriticalSection', import_from_module='ns.core')
     ## data-rate.h (module 'network'): ns3::DataRate [class]
     module.add_class('DataRate', import_from_module='ns.network')
     ## event-id.h (module 'core'): ns3::EventId [class]
@@ -64,8 +60,6 @@
     root_module['ns3::Ipv6Address'].implicitly_converts_to(root_module['ns3::Address'])
     ## ipv6-address.h (module 'network'): ns3::Ipv6Prefix [class]
     module.add_class('Ipv6Prefix', import_from_module='ns.network')
-    ## log.h (module 'core'): ns3::LogComponent [class]
-    module.add_class('LogComponent', import_from_module='ns.core')
     ## mac48-address.h (module 'network'): ns3::Mac48Address [class]
     module.add_class('Mac48Address', import_from_module='ns.network')
     ## mac48-address.h (module 'network'): ns3::Mac48Address [class]
@@ -96,8 +90,6 @@
     module.add_class('TagData', import_from_module='ns.network', outer_class=root_module['ns3::PacketTagList'])
     ## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::Object, ns3::ObjectBase, ns3::ObjectDeleter> [class]
     module.add_class('SimpleRefCount', automatic_type_narrowing=True, import_from_module='ns.core', template_parameters=['ns3::Object', 'ns3::ObjectBase', 'ns3::ObjectDeleter'], parent=root_module['ns3::ObjectBase'], memory_policy=cppclass.ReferenceCountingMethodsPolicy(incref_method='Ref', decref_method='Unref', peekref_method='GetReferenceCount'))
-    ## system-mutex.h (module 'core'): ns3::SystemMutex [class]
-    module.add_class('SystemMutex', import_from_module='ns.core')
     ## tag.h (module 'network'): ns3::Tag [class]
     module.add_class('Tag', import_from_module='ns.network', parent=root_module['ns3::ObjectBase'])
     ## tag-buffer.h (module 'network'): ns3::TagBuffer [class]
@@ -124,12 +116,6 @@
     module.add_class('Object', import_from_module='ns.core', parent=root_module['ns3::SimpleRefCount< ns3::Object, ns3::ObjectBase, ns3::ObjectDeleter >'])
     ## object.h (module 'core'): ns3::Object::AggregateIterator [class]
     module.add_class('AggregateIterator', import_from_module='ns.core', outer_class=root_module['ns3::Object'])
-    ## scheduler.h (module 'core'): ns3::Scheduler [class]
-    module.add_class('Scheduler', import_from_module='ns.core', parent=root_module['ns3::Object'])
-    ## scheduler.h (module 'core'): ns3::Scheduler::Event [struct]
-    module.add_class('Event', import_from_module='ns.core', outer_class=root_module['ns3::Scheduler'])
-    ## scheduler.h (module 'core'): ns3::Scheduler::EventKey [struct]
-    module.add_class('EventKey', import_from_module='ns.core', outer_class=root_module['ns3::Scheduler'])
     ## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::AttributeAccessor, ns3::empty, ns3::DefaultDeleter<ns3::AttributeAccessor> > [class]
     module.add_class('SimpleRefCount', automatic_type_narrowing=True, import_from_module='ns.core', template_parameters=['ns3::AttributeAccessor', 'ns3::empty', 'ns3::DefaultDeleter<ns3::AttributeAccessor>'], parent=root_module['ns3::empty'], memory_policy=cppclass.ReferenceCountingMethodsPolicy(incref_method='Ref', decref_method='Unref', peekref_method='GetReferenceCount'))
     ## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::AttributeChecker, ns3::empty, ns3::DefaultDeleter<ns3::AttributeChecker> > [class]
@@ -150,10 +136,6 @@
     module.add_class('SimpleRefCount', automatic_type_narrowing=True, import_from_module='ns.core', template_parameters=['ns3::SystemThread', 'ns3::empty', 'ns3::DefaultDeleter<ns3::SystemThread>'], parent=root_module['ns3::empty'], memory_policy=cppclass.ReferenceCountingMethodsPolicy(incref_method='Ref', decref_method='Unref', peekref_method='GetReferenceCount'))
     ## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::TraceSourceAccessor, ns3::empty, ns3::DefaultDeleter<ns3::TraceSourceAccessor> > [class]
     module.add_class('SimpleRefCount', automatic_type_narrowing=True, import_from_module='ns.core', template_parameters=['ns3::TraceSourceAccessor', 'ns3::empty', 'ns3::DefaultDeleter<ns3::TraceSourceAccessor>'], parent=root_module['ns3::empty'], memory_policy=cppclass.ReferenceCountingMethodsPolicy(incref_method='Ref', decref_method='Unref', peekref_method='GetReferenceCount'))
-    ## simulator-impl.h (module 'core'): ns3::SimulatorImpl [class]
-    module.add_class('SimulatorImpl', import_from_module='ns.core', parent=root_module['ns3::Object'])
-    ## synchronizer.h (module 'core'): ns3::Synchronizer [class]
-    module.add_class('Synchronizer', import_from_module='ns.core', parent=root_module['ns3::Object'])
     ## system-thread.h (module 'core'): ns3::SystemThread [class]
     module.add_class('SystemThread', import_from_module='ns.core', parent=root_module['ns3::SimpleRefCount< ns3::SystemThread, ns3::empty, ns3::DefaultDeleter<ns3::SystemThread> >'])
     ## nstime.h (module 'core'): ns3::Time [class]
@@ -222,10 +204,6 @@
     module.add_class('ObjectFactoryValue', import_from_module='ns.core', parent=root_module['ns3::AttributeValue'])
     ## packet.h (module 'network'): ns3::Packet [class]
     module.add_class('Packet', import_from_module='ns.network', parent=root_module['ns3::SimpleRefCount< ns3::Packet, ns3::empty, ns3::DefaultDeleter<ns3::Packet> >'])
-    ## realtime-simulator-impl.h (module 'core'): ns3::RealtimeSimulatorImpl [class]
-    module.add_class('RealtimeSimulatorImpl', import_from_module='ns.core', parent=root_module['ns3::SimulatorImpl'])
-    ## realtime-simulator-impl.h (module 'core'): ns3::RealtimeSimulatorImpl::SynchronizationMode [enumeration]
-    module.add_enum('SynchronizationMode', ['SYNC_BEST_EFFORT', 'SYNC_HARD_LIMIT'], outer_class=root_module['ns3::RealtimeSimulatorImpl'], import_from_module='ns.core')
     ## tap-bridge.h (module 'tap-bridge'): ns3::TapBridge [class]
     module.add_class('TapBridge', parent=root_module['ns3::NetDevice'])
     ## tap-bridge.h (module 'tap-bridge'): ns3::TapBridge::Mode [enumeration]
@@ -244,12 +222,6 @@
     module.add_class('AddressChecker', import_from_module='ns.network', parent=root_module['ns3::AttributeChecker'])
     ## address.h (module 'network'): ns3::AddressValue [class]
     module.add_class('AddressValue', import_from_module='ns.network', parent=root_module['ns3::AttributeValue'])
-    typehandlers.add_type_alias('void ( * ) ( std::ostream & ) *', 'ns3::LogTimePrinter')
-    typehandlers.add_type_alias('void ( * ) ( std::ostream & ) **', 'ns3::LogTimePrinter*')
-    typehandlers.add_type_alias('void ( * ) ( std::ostream & ) *&', 'ns3::LogTimePrinter&')
-    typehandlers.add_type_alias('void ( * ) ( std::ostream & ) *', 'ns3::LogNodePrinter')
-    typehandlers.add_type_alias('void ( * ) ( std::ostream & ) **', 'ns3::LogNodePrinter*')
-    typehandlers.add_type_alias('void ( * ) ( std::ostream & ) *&', 'ns3::LogNodePrinter&')
     
     ## Register a nested module for the namespace FatalImpl
     
@@ -273,14 +245,12 @@
     register_Ns3ByteTagListIterator_methods(root_module, root_module['ns3::ByteTagList::Iterator'])
     register_Ns3ByteTagListIteratorItem_methods(root_module, root_module['ns3::ByteTagList::Iterator::Item'])
     register_Ns3CallbackBase_methods(root_module, root_module['ns3::CallbackBase'])
-    register_Ns3CriticalSection_methods(root_module, root_module['ns3::CriticalSection'])
     register_Ns3DataRate_methods(root_module, root_module['ns3::DataRate'])
     register_Ns3EventId_methods(root_module, root_module['ns3::EventId'])
     register_Ns3Ipv4Address_methods(root_module, root_module['ns3::Ipv4Address'])
     register_Ns3Ipv4Mask_methods(root_module, root_module['ns3::Ipv4Mask'])
     register_Ns3Ipv6Address_methods(root_module, root_module['ns3::Ipv6Address'])
     register_Ns3Ipv6Prefix_methods(root_module, root_module['ns3::Ipv6Prefix'])
-    register_Ns3LogComponent_methods(root_module, root_module['ns3::LogComponent'])
     register_Ns3Mac48Address_methods(root_module, root_module['ns3::Mac48Address'])
     register_Ns3NetDeviceContainer_methods(root_module, root_module['ns3::NetDeviceContainer'])
     register_Ns3ObjectBase_methods(root_module, root_module['ns3::ObjectBase'])
@@ -294,7 +264,6 @@
     register_Ns3PacketTagList_methods(root_module, root_module['ns3::PacketTagList'])
     register_Ns3PacketTagListTagData_methods(root_module, root_module['ns3::PacketTagList::TagData'])
     register_Ns3SimpleRefCount__Ns3Object_Ns3ObjectBase_Ns3ObjectDeleter_methods(root_module, root_module['ns3::SimpleRefCount< ns3::Object, ns3::ObjectBase, ns3::ObjectDeleter >'])
-    register_Ns3SystemMutex_methods(root_module, root_module['ns3::SystemMutex'])
     register_Ns3Tag_methods(root_module, root_module['ns3::Tag'])
     register_Ns3TagBuffer_methods(root_module, root_module['ns3::TagBuffer'])
     register_Ns3TapBridgeHelper_methods(root_module, root_module['ns3::TapBridgeHelper'])
@@ -307,9 +276,6 @@
     register_Ns3Header_methods(root_module, root_module['ns3::Header'])
     register_Ns3Object_methods(root_module, root_module['ns3::Object'])
     register_Ns3ObjectAggregateIterator_methods(root_module, root_module['ns3::Object::AggregateIterator'])
-    register_Ns3Scheduler_methods(root_module, root_module['ns3::Scheduler'])
-    register_Ns3SchedulerEvent_methods(root_module, root_module['ns3::Scheduler::Event'])
-    register_Ns3SchedulerEventKey_methods(root_module, root_module['ns3::Scheduler::EventKey'])
     register_Ns3SimpleRefCount__Ns3AttributeAccessor_Ns3Empty_Ns3DefaultDeleter__lt__ns3AttributeAccessor__gt___methods(root_module, root_module['ns3::SimpleRefCount< ns3::AttributeAccessor, ns3::empty, ns3::DefaultDeleter<ns3::AttributeAccessor> >'])
     register_Ns3SimpleRefCount__Ns3AttributeChecker_Ns3Empty_Ns3DefaultDeleter__lt__ns3AttributeChecker__gt___methods(root_module, root_module['ns3::SimpleRefCount< ns3::AttributeChecker, ns3::empty, ns3::DefaultDeleter<ns3::AttributeChecker> >'])
     register_Ns3SimpleRefCount__Ns3AttributeValue_Ns3Empty_Ns3DefaultDeleter__lt__ns3AttributeValue__gt___methods(root_module, root_module['ns3::SimpleRefCount< ns3::AttributeValue, ns3::empty, ns3::DefaultDeleter<ns3::AttributeValue> >'])
@@ -320,8 +286,6 @@
     register_Ns3SimpleRefCount__Ns3Packet_Ns3Empty_Ns3DefaultDeleter__lt__ns3Packet__gt___methods(root_module, root_module['ns3::SimpleRefCount< ns3::Packet, ns3::empty, ns3::DefaultDeleter<ns3::Packet> >'])
     register_Ns3SimpleRefCount__Ns3SystemThread_Ns3Empty_Ns3DefaultDeleter__lt__ns3SystemThread__gt___methods(root_module, root_module['ns3::SimpleRefCount< ns3::SystemThread, ns3::empty, ns3::DefaultDeleter<ns3::SystemThread> >'])
     register_Ns3SimpleRefCount__Ns3TraceSourceAccessor_Ns3Empty_Ns3DefaultDeleter__lt__ns3TraceSourceAccessor__gt___methods(root_module, root_module['ns3::SimpleRefCount< ns3::TraceSourceAccessor, ns3::empty, ns3::DefaultDeleter<ns3::TraceSourceAccessor> >'])
-    register_Ns3SimulatorImpl_methods(root_module, root_module['ns3::SimulatorImpl'])
-    register_Ns3Synchronizer_methods(root_module, root_module['ns3::Synchronizer'])
     register_Ns3SystemThread_methods(root_module, root_module['ns3::SystemThread'])
     register_Ns3Time_methods(root_module, root_module['ns3::Time'])
     register_Ns3TraceSourceAccessor_methods(root_module, root_module['ns3::TraceSourceAccessor'])
@@ -353,7 +317,6 @@
     register_Ns3ObjectFactoryChecker_methods(root_module, root_module['ns3::ObjectFactoryChecker'])
     register_Ns3ObjectFactoryValue_methods(root_module, root_module['ns3::ObjectFactoryValue'])
     register_Ns3Packet_methods(root_module, root_module['ns3::Packet'])
-    register_Ns3RealtimeSimulatorImpl_methods(root_module, root_module['ns3::RealtimeSimulatorImpl'])
     register_Ns3TapBridge_methods(root_module, root_module['ns3::TapBridge'])
     register_Ns3TapBridgeFdReader_methods(root_module, root_module['ns3::TapBridgeFdReader'])
     register_Ns3TimeChecker_methods(root_module, root_module['ns3::TimeChecker'])
@@ -842,13 +805,6 @@
                    is_static=True, visibility='protected')
     return
 
-def register_Ns3CriticalSection_methods(root_module, cls):
-    ## system-mutex.h (module 'core'): ns3::CriticalSection::CriticalSection(ns3::CriticalSection const & arg0) [copy constructor]
-    cls.add_constructor([param('ns3::CriticalSection const &', 'arg0')])
-    ## system-mutex.h (module 'core'): ns3::CriticalSection::CriticalSection(ns3::SystemMutex & mutex) [constructor]
-    cls.add_constructor([param('ns3::SystemMutex &', 'mutex')])
-    return
-
 def register_Ns3DataRate_methods(root_module, cls):
     cls.add_output_stream_operator()
     cls.add_binary_comparison_operator('!=')
@@ -1324,40 +1280,6 @@
                    is_const=True)
     return
 
-def register_Ns3LogComponent_methods(root_module, cls):
-    ## log.h (module 'core'): ns3::LogComponent::LogComponent(ns3::LogComponent const & arg0) [copy constructor]
-    cls.add_constructor([param('ns3::LogComponent const &', 'arg0')])
-    ## log.h (module 'core'): ns3::LogComponent::LogComponent(char const * name) [constructor]
-    cls.add_constructor([param('char const *', 'name')])
-    ## log.h (module 'core'): void ns3::LogComponent::Disable(ns3::LogLevel level) [member function]
-    cls.add_method('Disable', 
-                   'void', 
-                   [param('ns3::LogLevel', 'level')])
-    ## log.h (module 'core'): void ns3::LogComponent::Enable(ns3::LogLevel level) [member function]
-    cls.add_method('Enable', 
-                   'void', 
-                   [param('ns3::LogLevel', 'level')])
-    ## log.h (module 'core'): void ns3::LogComponent::EnvVarCheck(char const * name) [member function]
-    cls.add_method('EnvVarCheck', 
-                   'void', 
-                   [param('char const *', 'name')])
-    ## log.h (module 'core'): bool ns3::LogComponent::IsEnabled(ns3::LogLevel level) const [member function]
-    cls.add_method('IsEnabled', 
-                   'bool', 
-                   [param('ns3::LogLevel', 'level')], 
-                   is_const=True)
-    ## log.h (module 'core'): bool ns3::LogComponent::IsNoneEnabled() const [member function]
-    cls.add_method('IsNoneEnabled', 
-                   'bool', 
-                   [], 
-                   is_const=True)
-    ## log.h (module 'core'): char const * ns3::LogComponent::Name() const [member function]
-    cls.add_method('Name', 
-                   'char const *', 
-                   [], 
-                   is_const=True)
-    return
-
 def register_Ns3Mac48Address_methods(root_module, cls):
     cls.add_binary_comparison_operator('<')
     cls.add_binary_comparison_operator('!=')
@@ -1783,21 +1705,6 @@
                    is_static=True)
     return
 
-def register_Ns3SystemMutex_methods(root_module, cls):
-    ## system-mutex.h (module 'core'): ns3::SystemMutex::SystemMutex(ns3::SystemMutex const & arg0) [copy constructor]
-    cls.add_constructor([param('ns3::SystemMutex const &', 'arg0')])
-    ## system-mutex.h (module 'core'): ns3::SystemMutex::SystemMutex() [constructor]
-    cls.add_constructor([])
-    ## system-mutex.h (module 'core'): void ns3::SystemMutex::Lock() [member function]
-    cls.add_method('Lock', 
-                   'void', 
-                   [])
-    ## system-mutex.h (module 'core'): void ns3::SystemMutex::Unlock() [member function]
-    cls.add_method('Unlock', 
-                   'void', 
-                   [])
-    return
-
 def register_Ns3Tag_methods(root_module, cls):
     ## tag.h (module 'network'): ns3::Tag::Tag() [constructor]
     cls.add_constructor([])
@@ -2335,71 +2242,6 @@
                    [])
     return
 
-def register_Ns3Scheduler_methods(root_module, cls):
-    ## scheduler.h (module 'core'): ns3::Scheduler::Scheduler() [constructor]
-    cls.add_constructor([])
-    ## scheduler.h (module 'core'): ns3::Scheduler::Scheduler(ns3::Scheduler const & arg0) [copy constructor]
-    cls.add_constructor([param('ns3::Scheduler const &', 'arg0')])
-    ## scheduler.h (module 'core'): static ns3::TypeId ns3::Scheduler::GetTypeId() [member function]
-    cls.add_method('GetTypeId', 
-                   'ns3::TypeId', 
-                   [], 
-                   is_static=True)
-    ## scheduler.h (module 'core'): void ns3::Scheduler::Insert(ns3::Scheduler::Event const & ev) [member function]
-    cls.add_method('Insert', 
-                   'void', 
-                   [param('ns3::Scheduler::Event const &', 'ev')], 
-                   is_pure_virtual=True, is_virtual=True)
-    ## scheduler.h (module 'core'): bool ns3::Scheduler::IsEmpty() const [member function]
-    cls.add_method('IsEmpty', 
-                   'bool', 
-                   [], 
-                   is_pure_virtual=True, is_const=True, is_virtual=True)
-    ## scheduler.h (module 'core'): ns3::Scheduler::Event ns3::Scheduler::PeekNext() const [member function]
-    cls.add_method('PeekNext', 
-                   'ns3::Scheduler::Event', 
-                   [], 
-                   is_pure_virtual=True, is_const=True, is_virtual=True)
-    ## scheduler.h (module 'core'): void ns3::Scheduler::Remove(ns3::Scheduler::Event const & ev) [member function]
-    cls.add_method('Remove', 
-                   'void', 
-                   [param('ns3::Scheduler::Event const &', 'ev')], 
-                   is_pure_virtual=True, is_virtual=True)
-    ## scheduler.h (module 'core'): ns3::Scheduler::Event ns3::Scheduler::RemoveNext() [member function]
-    cls.add_method('RemoveNext', 
-                   'ns3::Scheduler::Event', 
-                   [], 
-                   is_pure_virtual=True, is_virtual=True)
-    return
-
-def register_Ns3SchedulerEvent_methods(root_module, cls):
-    cls.add_binary_comparison_operator('<')
-    ## scheduler.h (module 'core'): ns3::Scheduler::Event::Event() [constructor]
-    cls.add_constructor([])
-    ## scheduler.h (module 'core'): ns3::Scheduler::Event::Event(ns3::Scheduler::Event const & arg0) [copy constructor]
-    cls.add_constructor([param('ns3::Scheduler::Event const &', 'arg0')])
-    ## scheduler.h (module 'core'): ns3::Scheduler::Event::impl [variable]
-    cls.add_instance_attribute('impl', 'ns3::EventImpl *', is_const=False)
-    ## scheduler.h (module 'core'): ns3::Scheduler::Event::key [variable]
-    cls.add_instance_attribute('key', 'ns3::Scheduler::EventKey', is_const=False)
-    return
-
-def register_Ns3SchedulerEventKey_methods(root_module, cls):
-    cls.add_binary_comparison_operator('<')
-    cls.add_binary_comparison_operator('>')
-    cls.add_binary_comparison_operator('!=')
-    ## scheduler.h (module 'core'): ns3::Scheduler::EventKey::EventKey() [constructor]
-    cls.add_constructor([])
-    ## scheduler.h (module 'core'): ns3::Scheduler::EventKey::EventKey(ns3::Scheduler::EventKey const & arg0) [copy constructor]
-    cls.add_constructor([param('ns3::Scheduler::EventKey const &', 'arg0')])
-    ## scheduler.h (module 'core'): ns3::Scheduler::EventKey::m_context [variable]
-    cls.add_instance_attribute('m_context', 'uint32_t', is_const=False)
-    ## scheduler.h (module 'core'): ns3::Scheduler::EventKey::m_ts [variable]
-    cls.add_instance_attribute('m_ts', 'uint64_t', is_const=False)
-    ## scheduler.h (module 'core'): ns3::Scheduler::EventKey::m_uid [variable]
-    cls.add_instance_attribute('m_uid', 'uint32_t', is_const=False)
-    return
-
 def register_Ns3SimpleRefCount__Ns3AttributeAccessor_Ns3Empty_Ns3DefaultDeleter__lt__ns3AttributeAccessor__gt___methods(root_module, cls):
     ## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::AttributeAccessor, ns3::empty, ns3::DefaultDeleter<ns3::AttributeAccessor> >::SimpleRefCount() [constructor]
     cls.add_constructor([])
@@ -2520,232 +2362,25 @@
                    is_static=True)
     return
 
-def register_Ns3SimulatorImpl_methods(root_module, cls):
-    ## simulator-impl.h (module 'core'): ns3::SimulatorImpl::SimulatorImpl() [constructor]
-    cls.add_constructor([])
-    ## simulator-impl.h (module 'core'): ns3::SimulatorImpl::SimulatorImpl(ns3::SimulatorImpl const & arg0) [copy constructor]
-    cls.add_constructor([param('ns3::SimulatorImpl const &', 'arg0')])
-    ## simulator-impl.h (module 'core'): void ns3::SimulatorImpl::Cancel(ns3::EventId const & ev) [member function]
-    cls.add_method('Cancel', 
-                   'void', 
-                   [param('ns3::EventId const &', 'ev')], 
-                   is_pure_virtual=True, is_virtual=True)
-    ## simulator-impl.h (module 'core'): void ns3::SimulatorImpl::Destroy() [member function]
-    cls.add_method('Destroy', 
-                   'void', 
-                   [], 
-                   is_pure_virtual=True, is_virtual=True)
-    ## simulator-impl.h (module 'core'): uint32_t ns3::SimulatorImpl::GetContext() const [member function]
-    cls.add_method('GetContext', 
-                   'uint32_t', 
-                   [], 
-                   is_pure_virtual=True, is_const=True, is_virtual=True)
-    ## simulator-impl.h (module 'core'): ns3::Time ns3::SimulatorImpl::GetDelayLeft(ns3::EventId const & id) const [member function]
-    cls.add_method('GetDelayLeft', 
-                   'ns3::Time', 
-                   [param('ns3::EventId const &', 'id')], 
-                   is_pure_virtual=True, is_const=True, is_virtual=True)
-    ## simulator-impl.h (module 'core'): ns3::Time ns3::SimulatorImpl::GetMaximumSimulationTime() const [member function]
-    cls.add_method('GetMaximumSimulationTime', 
-                   'ns3::Time', 
-                   [], 
-                   is_pure_virtual=True, is_const=True, is_virtual=True)
-    ## simulator-impl.h (module 'core'): uint32_t ns3::SimulatorImpl::GetSystemId() const [member function]
-    cls.add_method('GetSystemId', 
-                   'uint32_t', 
-                   [], 
-                   is_pure_virtual=True, is_const=True, is_virtual=True)
-    ## simulator-impl.h (module 'core'): static ns3::TypeId ns3::SimulatorImpl::GetTypeId() [member function]
-    cls.add_method('GetTypeId', 
-                   'ns3::TypeId', 
-                   [], 
-                   is_static=True)
-    ## simulator-impl.h (module 'core'): bool ns3::SimulatorImpl::IsExpired(ns3::EventId const & ev) const [member function]
-    cls.add_method('IsExpired', 
-                   'bool', 
-                   [param('ns3::EventId const &', 'ev')], 
-                   is_pure_virtual=True, is_const=True, is_virtual=True)
-    ## simulator-impl.h (module 'core'): bool ns3::SimulatorImpl::IsFinished() const [member function]
-    cls.add_method('IsFinished', 
-                   'bool', 
-                   [], 
-                   is_pure_virtual=True, is_const=True, is_virtual=True)
-    ## simulator-impl.h (module 'core'): ns3::Time ns3::SimulatorImpl::Next() const [member function]
-    cls.add_method('Next', 
-                   'ns3::Time', 
-                   [], 
-                   is_pure_virtual=True, is_const=True, is_virtual=True)
-    ## simulator-impl.h (module 'core'): ns3::Time ns3::SimulatorImpl::Now() const [member function]
-    cls.add_method('Now', 
-                   'ns3::Time', 
-                   [], 
-                   is_pure_virtual=True, is_const=True, is_virtual=True)
-    ## simulator-impl.h (module 'core'): void ns3::SimulatorImpl::Remove(ns3::EventId const & ev) [member function]
-    cls.add_method('Remove', 
-                   'void', 
-                   [param('ns3::EventId const &', 'ev')], 
-                   is_pure_virtual=True, is_virtual=True)
-    ## simulator-impl.h (module 'core'): void ns3::SimulatorImpl::Run() [member function]
-    cls.add_method('Run', 
-                   'void', 
-                   [], 
-                   is_pure_virtual=True, is_virtual=True)
-    ## simulator-impl.h (module 'core'): void ns3::SimulatorImpl::RunOneEvent() [member function]
-    cls.add_method('RunOneEvent', 
-                   'void', 
-                   [], 
-                   is_pure_virtual=True, is_virtual=True)
-    ## simulator-impl.h (module 'core'): ns3::EventId ns3::SimulatorImpl::Schedule(ns3::Time const & time, ns3::EventImpl * event) [member function]
-    cls.add_method('Schedule', 
-                   'ns3::EventId', 
-                   [param('ns3::Time const &', 'time'), param('ns3::EventImpl *', 'event')], 
-                   is_pure_virtual=True, is_virtual=True)
-    ## simulator-impl.h (module 'core'): ns3::EventId ns3::SimulatorImpl::ScheduleDestroy(ns3::EventImpl * event) [member function]
-    cls.add_method('ScheduleDestroy', 
-                   'ns3::EventId', 
-                   [param('ns3::EventImpl *', 'event')], 
-                   is_pure_virtual=True, is_virtual=True)
-    ## simulator-impl.h (module 'core'): ns3::EventId ns3::SimulatorImpl::ScheduleNow(ns3::EventImpl * event) [member function]
-    cls.add_method('ScheduleNow', 
-                   'ns3::EventId', 
-                   [param('ns3::EventImpl *', 'event')], 
-                   is_pure_virtual=True, is_virtual=True)
-    ## simulator-impl.h (module 'core'): void ns3::SimulatorImpl::ScheduleWithContext(uint32_t context, ns3::Time const & time, ns3::EventImpl * event) [member function]
-    cls.add_method('ScheduleWithContext', 
-                   'void', 
-                   [param('uint32_t', 'context'), param('ns3::Time const &', 'time'), param('ns3::EventImpl *', 'event')], 
-                   is_pure_virtual=True, is_virtual=True)
-    ## simulator-impl.h (module 'core'): void ns3::SimulatorImpl::SetScheduler(ns3::ObjectFactory schedulerFactory) [member function]
-    cls.add_method('SetScheduler', 
-                   'void', 
-                   [param('ns3::ObjectFactory', 'schedulerFactory')], 
-                   is_pure_virtual=True, is_virtual=True)
-    ## simulator-impl.h (module 'core'): void ns3::SimulatorImpl::Stop() [member function]
-    cls.add_method('Stop', 
-                   'void', 
-                   [], 
-                   is_pure_virtual=True, is_virtual=True)
-    ## simulator-impl.h (module 'core'): void ns3::SimulatorImpl::Stop(ns3::Time const & time) [member function]
-    cls.add_method('Stop', 
-                   'void', 
-                   [param('ns3::Time const &', 'time')], 
-                   is_pure_virtual=True, is_virtual=True)
-    return
-
-def register_Ns3Synchronizer_methods(root_module, cls):
-    ## synchronizer.h (module 'core'): ns3::Synchronizer::Synchronizer(ns3::Synchronizer const & arg0) [copy constructor]
-    cls.add_constructor([param('ns3::Synchronizer const &', 'arg0')])
-    ## synchronizer.h (module 'core'): ns3::Synchronizer::Synchronizer() [constructor]
-    cls.add_constructor([])
-    ## synchronizer.h (module 'core'): uint64_t ns3::Synchronizer::EventEnd() [member function]
-    cls.add_method('EventEnd', 
-                   'uint64_t', 
-                   [])
-    ## synchronizer.h (module 'core'): void ns3::Synchronizer::EventStart() [member function]
-    cls.add_method('EventStart', 
-                   'void', 
-                   [])
-    ## synchronizer.h (module 'core'): uint64_t ns3::Synchronizer::GetCurrentRealtime() [member function]
-    cls.add_method('GetCurrentRealtime', 
-                   'uint64_t', 
-                   [])
-    ## synchronizer.h (module 'core'): int64_t ns3::Synchronizer::GetDrift(uint64_t ts) [member function]
-    cls.add_method('GetDrift', 
-                   'int64_t', 
-                   [param('uint64_t', 'ts')])
-    ## synchronizer.h (module 'core'): uint64_t ns3::Synchronizer::GetOrigin() [member function]
-    cls.add_method('GetOrigin', 
-                   'uint64_t', 
-                   [])
-    ## synchronizer.h (module 'core'): static ns3::TypeId ns3::Synchronizer::GetTypeId() [member function]
-    cls.add_method('GetTypeId', 
-                   'ns3::TypeId', 
-                   [], 
-                   is_static=True)
-    ## synchronizer.h (module 'core'): bool ns3::Synchronizer::Realtime() [member function]
-    cls.add_method('Realtime', 
-                   'bool', 
-                   [])
-    ## synchronizer.h (module 'core'): void ns3::Synchronizer::SetCondition(bool arg0) [member function]
-    cls.add_method('SetCondition', 
-                   'void', 
-                   [param('bool', 'arg0')])
-    ## synchronizer.h (module 'core'): void ns3::Synchronizer::SetOrigin(uint64_t ts) [member function]
-    cls.add_method('SetOrigin', 
-                   'void', 
-                   [param('uint64_t', 'ts')])
-    ## synchronizer.h (module 'core'): void ns3::Synchronizer::Signal() [member function]
-    cls.add_method('Signal', 
-                   'void', 
-                   [])
-    ## synchronizer.h (module 'core'): bool ns3::Synchronizer::Synchronize(uint64_t tsCurrent, uint64_t tsDelay) [member function]
-    cls.add_method('Synchronize', 
-                   'bool', 
-                   [param('uint64_t', 'tsCurrent'), param('uint64_t', 'tsDelay')])
-    ## synchronizer.h (module 'core'): uint64_t ns3::Synchronizer::DoEventEnd() [member function]
-    cls.add_method('DoEventEnd', 
-                   'uint64_t', 
-                   [], 
-                   is_pure_virtual=True, visibility='protected', is_virtual=True)
-    ## synchronizer.h (module 'core'): void ns3::Synchronizer::DoEventStart() [member function]
-    cls.add_method('DoEventStart', 
-                   'void', 
-                   [], 
-                   is_pure_virtual=True, visibility='protected', is_virtual=True)
-    ## synchronizer.h (module 'core'): uint64_t ns3::Synchronizer::DoGetCurrentRealtime() [member function]
-    cls.add_method('DoGetCurrentRealtime', 
-                   'uint64_t', 
-                   [], 
-                   is_pure_virtual=True, visibility='protected', is_virtual=True)
-    ## synchronizer.h (module 'core'): int64_t ns3::Synchronizer::DoGetDrift(uint64_t ns) [member function]
-    cls.add_method('DoGetDrift', 
-                   'int64_t', 
-                   [param('uint64_t', 'ns')], 
-                   is_pure_virtual=True, visibility='protected', is_virtual=True)
-    ## synchronizer.h (module 'core'): bool ns3::Synchronizer::DoRealtime() [member function]
-    cls.add_method('DoRealtime', 
-                   'bool', 
-                   [], 
-                   is_pure_virtual=True, visibility='protected', is_virtual=True)
-    ## synchronizer.h (module 'core'): void ns3::Synchronizer::DoSetCondition(bool arg0) [member function]
-    cls.add_method('DoSetCondition', 
-                   'void', 
-                   [param('bool', 'arg0')], 
-                   is_pure_virtual=True, visibility='protected', is_virtual=True)
-    ## synchronizer.h (module 'core'): void ns3::Synchronizer::DoSetOrigin(uint64_t ns) [member function]
-    cls.add_method('DoSetOrigin', 
-                   'void', 
-                   [param('uint64_t', 'ns')], 
-                   is_pure_virtual=True, visibility='protected', is_virtual=True)
-    ## synchronizer.h (module 'core'): void ns3::Synchronizer::DoSignal() [member function]
-    cls.add_method('DoSignal', 
-                   'void', 
-                   [], 
-                   is_pure_virtual=True, visibility='protected', is_virtual=True)
-    ## synchronizer.h (module 'core'): bool ns3::Synchronizer::DoSynchronize(uint64_t nsCurrent, uint64_t nsDelay) [member function]
-    cls.add_method('DoSynchronize', 
-                   'bool', 
-                   [param('uint64_t', 'nsCurrent'), param('uint64_t', 'nsDelay')], 
-                   is_pure_virtual=True, visibility='protected', is_virtual=True)
-    return
-
 def register_Ns3SystemThread_methods(root_module, cls):
     ## system-thread.h (module 'core'): ns3::SystemThread::SystemThread(ns3::SystemThread const & arg0) [copy constructor]
     cls.add_constructor([param('ns3::SystemThread const &', 'arg0')])
-    ## system-thread.h (module 'core'): ns3::SystemThread::SystemThread(ns3::Callback<void,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty> callback) [constructor]
+    ## system-thread.h (module 'core'): ns3::SystemThread::SystemThread(ns3::Callback<void, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> callback) [constructor]
     cls.add_constructor([param('ns3::Callback< void, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'callback')])
-    ## system-thread.h (module 'core'): bool ns3::SystemThread::Break() [member function]
-    cls.add_method('Break', 
+    ## system-thread.h (module 'core'): static bool ns3::SystemThread::Equals(pthread_t id) [member function]
+    cls.add_method('Equals', 
                    'bool', 
-                   [])
+                   [param('pthread_t', 'id')], 
+                   is_static=True)
     ## system-thread.h (module 'core'): void ns3::SystemThread::Join() [member function]
     cls.add_method('Join', 
                    'void', 
                    [])
-    ## system-thread.h (module 'core'): void ns3::SystemThread::Shutdown() [member function]
-    cls.add_method('Shutdown', 
-                   'void', 
-                   [])
+    ## system-thread.h (module 'core'): static pthread_t ns3::SystemThread::Self() [member function]
+    cls.add_method('Self', 
+                   'pthread_t', 
+                   [], 
+                   is_static=True)
     ## system-thread.h (module 'core'): void ns3::SystemThread::Start() [member function]
     cls.add_method('Start', 
                    'void', 
@@ -3417,7 +3052,7 @@
     cls.add_constructor([])
     ## net-device.h (module 'network'): ns3::NetDevice::NetDevice(ns3::NetDevice const & arg0) [copy constructor]
     cls.add_constructor([param('ns3::NetDevice const &', 'arg0')])
-    ## net-device.h (module 'network'): void ns3::NetDevice::AddLinkChangeCallback(ns3::Callback<void,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty> callback) [member function]
+    ## net-device.h (module 'network'): void ns3::NetDevice::AddLinkChangeCallback(ns3::Callback<void, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> callback) [member function]
     cls.add_method('AddLinkChangeCallback', 
                    'void', 
                    [param('ns3::Callback< void, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'callback')], 
@@ -3892,168 +3527,12 @@
                    [param('ns3::Ptr< ns3::NixVector >', 'arg0')])
     return
 
-def register_Ns3RealtimeSimulatorImpl_methods(root_module, cls):
-    ## realtime-simulator-impl.h (module 'core'): ns3::RealtimeSimulatorImpl::RealtimeSimulatorImpl(ns3::RealtimeSimulatorImpl const & arg0) [copy constructor]
-    cls.add_constructor([param('ns3::RealtimeSimulatorImpl const &', 'arg0')])
-    ## realtime-simulator-impl.h (module 'core'): ns3::RealtimeSimulatorImpl::RealtimeSimulatorImpl() [constructor]
-    cls.add_constructor([])
-    ## realtime-simulator-impl.h (module 'core'): void ns3::RealtimeSimulatorImpl::Cancel(ns3::EventId const & ev) [member function]
-    cls.add_method('Cancel', 
-                   'void', 
-                   [param('ns3::EventId const &', 'ev')], 
-                   is_virtual=True)
-    ## realtime-simulator-impl.h (module 'core'): void ns3::RealtimeSimulatorImpl::Destroy() [member function]
-    cls.add_method('Destroy', 
-                   'void', 
-                   [], 
-                   is_virtual=True)
-    ## realtime-simulator-impl.h (module 'core'): uint32_t ns3::RealtimeSimulatorImpl::GetContext() const [member function]
-    cls.add_method('GetContext', 
-                   'uint32_t', 
-                   [], 
-                   is_const=True, is_virtual=True)
-    ## realtime-simulator-impl.h (module 'core'): ns3::Time ns3::RealtimeSimulatorImpl::GetDelayLeft(ns3::EventId const & id) const [member function]
-    cls.add_method('GetDelayLeft', 
-                   'ns3::Time', 
-                   [param('ns3::EventId const &', 'id')], 
-                   is_const=True, is_virtual=True)
-    ## realtime-simulator-impl.h (module 'core'): ns3::Time ns3::RealtimeSimulatorImpl::GetHardLimit() const [member function]
-    cls.add_method('GetHardLimit', 
-                   'ns3::Time', 
-                   [], 
-                   is_const=True)
-    ## realtime-simulator-impl.h (module 'core'): ns3::Time ns3::RealtimeSimulatorImpl::GetMaximumSimulationTime() const [member function]
-    cls.add_method('GetMaximumSimulationTime', 
-                   'ns3::Time', 
-                   [], 
-                   is_const=True, is_virtual=True)
-    ## realtime-simulator-impl.h (module 'core'): ns3::RealtimeSimulatorImpl::SynchronizationMode ns3::RealtimeSimulatorImpl::GetSynchronizationMode() const [member function]
-    cls.add_method('GetSynchronizationMode', 
-                   'ns3::RealtimeSimulatorImpl::SynchronizationMode', 
-                   [], 
-                   is_const=True)
-    ## realtime-simulator-impl.h (module 'core'): uint32_t ns3::RealtimeSimulatorImpl::GetSystemId() const [member function]
-    cls.add_method('GetSystemId', 
-                   'uint32_t', 
-                   [], 
-                   is_const=True, is_virtual=True)
-    ## realtime-simulator-impl.h (module 'core'): static ns3::TypeId ns3::RealtimeSimulatorImpl::GetTypeId() [member function]
-    cls.add_method('GetTypeId', 
-                   'ns3::TypeId', 
-                   [], 
-                   is_static=True)
-    ## realtime-simulator-impl.h (module 'core'): bool ns3::RealtimeSimulatorImpl::IsExpired(ns3::EventId const & ev) const [member function]
-    cls.add_method('IsExpired', 
-                   'bool', 
-                   [param('ns3::EventId const &', 'ev')], 
-                   is_const=True, is_virtual=True)
-    ## realtime-simulator-impl.h (module 'core'): bool ns3::RealtimeSimulatorImpl::IsFinished() const [member function]
-    cls.add_method('IsFinished', 
-                   'bool', 
-                   [], 
-                   is_const=True, is_virtual=True)
-    ## realtime-simulator-impl.h (module 'core'): ns3::Time ns3::RealtimeSimulatorImpl::Next() const [member function]
-    cls.add_method('Next', 
-                   'ns3::Time', 
-                   [], 
-                   is_const=True, is_virtual=True)
-    ## realtime-simulator-impl.h (module 'core'): ns3::Time ns3::RealtimeSimulatorImpl::Now() const [member function]
-    cls.add_method('Now', 
-                   'ns3::Time', 
-                   [], 
-                   is_const=True, is_virtual=True)
-    ## realtime-simulator-impl.h (module 'core'): ns3::Time ns3::RealtimeSimulatorImpl::RealtimeNow() const [member function]
-    cls.add_method('RealtimeNow', 
-                   'ns3::Time', 
-                   [], 
-                   is_const=True)
-    ## realtime-simulator-impl.h (module 'core'): void ns3::RealtimeSimulatorImpl::Remove(ns3::EventId const & ev) [member function]
-    cls.add_method('Remove', 
-                   'void', 
-                   [param('ns3::EventId const &', 'ev')], 
-                   is_virtual=True)
-    ## realtime-simulator-impl.h (module 'core'): void ns3::RealtimeSimulatorImpl::Run() [member function]
-    cls.add_method('Run', 
-                   'void', 
-                   [], 
-                   is_virtual=True)
-    ## realtime-simulator-impl.h (module 'core'): void ns3::RealtimeSimulatorImpl::RunOneEvent() [member function]
-    cls.add_method('RunOneEvent', 
-                   'void', 
-                   [], 
-                   is_virtual=True)
-    ## realtime-simulator-impl.h (module 'core'): ns3::EventId ns3::RealtimeSimulatorImpl::Schedule(ns3::Time const & time, ns3::EventImpl * event) [member function]
-    cls.add_method('Schedule', 
-                   'ns3::EventId', 
-                   [param('ns3::Time const &', 'time'), param('ns3::EventImpl *', 'event')], 
-                   is_virtual=True)
-    ## realtime-simulator-impl.h (module 'core'): ns3::EventId ns3::RealtimeSimulatorImpl::ScheduleDestroy(ns3::EventImpl * event) [member function]
-    cls.add_method('ScheduleDestroy', 
-                   'ns3::EventId', 
-                   [param('ns3::EventImpl *', 'event')], 
-                   is_virtual=True)
-    ## realtime-simulator-impl.h (module 'core'): ns3::EventId ns3::RealtimeSimulatorImpl::ScheduleNow(ns3::EventImpl * event) [member function]
-    cls.add_method('ScheduleNow', 
-                   'ns3::EventId', 
-                   [param('ns3::EventImpl *', 'event')], 
-                   is_virtual=True)
-    ## realtime-simulator-impl.h (module 'core'): void ns3::RealtimeSimulatorImpl::ScheduleRealtime(ns3::Time const & time, ns3::EventImpl * event) [member function]
-    cls.add_method('ScheduleRealtime', 
-                   'void', 
-                   [param('ns3::Time const &', 'time'), param('ns3::EventImpl *', 'event')])
-    ## realtime-simulator-impl.h (module 'core'): void ns3::RealtimeSimulatorImpl::ScheduleRealtimeNow(ns3::EventImpl * event) [member function]
-    cls.add_method('ScheduleRealtimeNow', 
-                   'void', 
-                   [param('ns3::EventImpl *', 'event')])
-    ## realtime-simulator-impl.h (module 'core'): void ns3::RealtimeSimulatorImpl::ScheduleRealtimeNowWithContext(uint32_t context, ns3::EventImpl * event) [member function]
-    cls.add_method('ScheduleRealtimeNowWithContext', 
-                   'void', 
-                   [param('uint32_t', 'context'), param('ns3::EventImpl *', 'event')])
-    ## realtime-simulator-impl.h (module 'core'): void ns3::RealtimeSimulatorImpl::ScheduleRealtimeWithContext(uint32_t context, ns3::Time const & time, ns3::EventImpl * event) [member function]
-    cls.add_method('ScheduleRealtimeWithContext', 
-                   'void', 
-                   [param('uint32_t', 'context'), param('ns3::Time const &', 'time'), param('ns3::EventImpl *', 'event')])
-    ## realtime-simulator-impl.h (module 'core'): void ns3::RealtimeSimulatorImpl::ScheduleWithContext(uint32_t context, ns3::Time const & time, ns3::EventImpl * event) [member function]
-    cls.add_method('ScheduleWithContext', 
-                   'void', 
-                   [param('uint32_t', 'context'), param('ns3::Time const &', 'time'), param('ns3::EventImpl *', 'event')], 
-                   is_virtual=True)
-    ## realtime-simulator-impl.h (module 'core'): void ns3::RealtimeSimulatorImpl::SetHardLimit(ns3::Time limit) [member function]
-    cls.add_method('SetHardLimit', 
-                   'void', 
-                   [param('ns3::Time', 'limit')])
-    ## realtime-simulator-impl.h (module 'core'): void ns3::RealtimeSimulatorImpl::SetScheduler(ns3::ObjectFactory schedulerFactory) [member function]
-    cls.add_method('SetScheduler', 
-                   'void', 
-                   [param('ns3::ObjectFactory', 'schedulerFactory')], 
-                   is_virtual=True)
-    ## realtime-simulator-impl.h (module 'core'): void ns3::RealtimeSimulatorImpl::SetSynchronizationMode(ns3::RealtimeSimulatorImpl::SynchronizationMode mode) [member function]
-    cls.add_method('SetSynchronizationMode', 
-                   'void', 
-                   [param('ns3::RealtimeSimulatorImpl::SynchronizationMode', 'mode')])
-    ## realtime-simulator-impl.h (module 'core'): void ns3::RealtimeSimulatorImpl::Stop() [member function]
-    cls.add_method('Stop', 
-                   'void', 
-                   [], 
-                   is_virtual=True)
-    ## realtime-simulator-impl.h (module 'core'): void ns3::RealtimeSimulatorImpl::Stop(ns3::Time const & time) [member function]
-    cls.add_method('Stop', 
-                   'void', 
-                   [param('ns3::Time const &', 'time')], 
-                   is_virtual=True)
-    ## realtime-simulator-impl.h (module 'core'): void ns3::RealtimeSimulatorImpl::DoDispose() [member function]
-    cls.add_method('DoDispose', 
-                   'void', 
-                   [], 
-                   visibility='private', is_virtual=True)
-    return
-
 def register_Ns3TapBridge_methods(root_module, cls):
     ## tap-bridge.h (module 'tap-bridge'): ns3::TapBridge::TapBridge(ns3::TapBridge const & arg0) [copy constructor]
     cls.add_constructor([param('ns3::TapBridge const &', 'arg0')])
     ## tap-bridge.h (module 'tap-bridge'): ns3::TapBridge::TapBridge() [constructor]
     cls.add_constructor([])
-    ## tap-bridge.h (module 'tap-bridge'): void ns3::TapBridge::AddLinkChangeCallback(ns3::Callback<void,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty> callback) [member function]
+    ## tap-bridge.h (module 'tap-bridge'): void ns3::TapBridge::AddLinkChangeCallback(ns3::Callback<void, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> callback) [member function]
     cls.add_method('AddLinkChangeCallback', 
                    'void', 
                    [param('ns3::Callback< void, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'callback')], 
--- a/src/tap-bridge/bindings/modulegen__gcc_LP64.py	Wed Apr 11 11:00:27 2012 +0200
+++ b/src/tap-bridge/bindings/modulegen__gcc_LP64.py	Wed Apr 11 13:49:33 2012 +0200
@@ -20,8 +20,6 @@
 def register_types(module):
     root_module = module.get_root()
     
-    ## log.h (module 'core'): ns3::LogLevel [enumeration]
-    module.add_enum('LogLevel', ['LOG_NONE', 'LOG_ERROR', 'LOG_LEVEL_ERROR', 'LOG_WARN', 'LOG_LEVEL_WARN', 'LOG_DEBUG', 'LOG_LEVEL_DEBUG', 'LOG_INFO', 'LOG_LEVEL_INFO', 'LOG_FUNCTION', 'LOG_LEVEL_FUNCTION', 'LOG_LOGIC', 'LOG_LEVEL_LOGIC', 'LOG_ALL', 'LOG_LEVEL_ALL', 'LOG_PREFIX_FUNC', 'LOG_PREFIX_TIME', 'LOG_PREFIX_NODE'], import_from_module='ns.core')
     ## address.h (module 'network'): ns3::Address [class]
     module.add_class('Address', import_from_module='ns.network')
     ## address.h (module 'network'): ns3::Address::MaxSize_e [enumeration]
@@ -46,8 +44,6 @@
     module.add_class('Item', import_from_module='ns.network', outer_class=root_module['ns3::ByteTagList::Iterator'])
     ## callback.h (module 'core'): ns3::CallbackBase [class]
     module.add_class('CallbackBase', import_from_module='ns.core')
-    ## system-mutex.h (module 'core'): ns3::CriticalSection [class]
-    module.add_class('CriticalSection', import_from_module='ns.core')
     ## data-rate.h (module 'network'): ns3::DataRate [class]
     module.add_class('DataRate', import_from_module='ns.network')
     ## event-id.h (module 'core'): ns3::EventId [class]
@@ -64,8 +60,6 @@
     root_module['ns3::Ipv6Address'].implicitly_converts_to(root_module['ns3::Address'])
     ## ipv6-address.h (module 'network'): ns3::Ipv6Prefix [class]
     module.add_class('Ipv6Prefix', import_from_module='ns.network')
-    ## log.h (module 'core'): ns3::LogComponent [class]
-    module.add_class('LogComponent', import_from_module='ns.core')
     ## mac48-address.h (module 'network'): ns3::Mac48Address [class]
     module.add_class('Mac48Address', import_from_module='ns.network')
     ## mac48-address.h (module 'network'): ns3::Mac48Address [class]
@@ -96,8 +90,6 @@
     module.add_class('TagData', import_from_module='ns.network', outer_class=root_module['ns3::PacketTagList'])
     ## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::Object, ns3::ObjectBase, ns3::ObjectDeleter> [class]
     module.add_class('SimpleRefCount', automatic_type_narrowing=True, import_from_module='ns.core', template_parameters=['ns3::Object', 'ns3::ObjectBase', 'ns3::ObjectDeleter'], parent=root_module['ns3::ObjectBase'], memory_policy=cppclass.ReferenceCountingMethodsPolicy(incref_method='Ref', decref_method='Unref', peekref_method='GetReferenceCount'))
-    ## system-mutex.h (module 'core'): ns3::SystemMutex [class]
-    module.add_class('SystemMutex', import_from_module='ns.core')
     ## tag.h (module 'network'): ns3::Tag [class]
     module.add_class('Tag', import_from_module='ns.network', parent=root_module['ns3::ObjectBase'])
     ## tag-buffer.h (module 'network'): ns3::TagBuffer [class]
@@ -124,12 +116,6 @@
     module.add_class('Object', import_from_module='ns.core', parent=root_module['ns3::SimpleRefCount< ns3::Object, ns3::ObjectBase, ns3::ObjectDeleter >'])
     ## object.h (module 'core'): ns3::Object::AggregateIterator [class]
     module.add_class('AggregateIterator', import_from_module='ns.core', outer_class=root_module['ns3::Object'])
-    ## scheduler.h (module 'core'): ns3::Scheduler [class]
-    module.add_class('Scheduler', import_from_module='ns.core', parent=root_module['ns3::Object'])
-    ## scheduler.h (module 'core'): ns3::Scheduler::Event [struct]
-    module.add_class('Event', import_from_module='ns.core', outer_class=root_module['ns3::Scheduler'])
-    ## scheduler.h (module 'core'): ns3::Scheduler::EventKey [struct]
-    module.add_class('EventKey', import_from_module='ns.core', outer_class=root_module['ns3::Scheduler'])
     ## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::AttributeAccessor, ns3::empty, ns3::DefaultDeleter<ns3::AttributeAccessor> > [class]
     module.add_class('SimpleRefCount', automatic_type_narrowing=True, import_from_module='ns.core', template_parameters=['ns3::AttributeAccessor', 'ns3::empty', 'ns3::DefaultDeleter<ns3::AttributeAccessor>'], parent=root_module['ns3::empty'], memory_policy=cppclass.ReferenceCountingMethodsPolicy(incref_method='Ref', decref_method='Unref', peekref_method='GetReferenceCount'))
     ## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::AttributeChecker, ns3::empty, ns3::DefaultDeleter<ns3::AttributeChecker> > [class]
@@ -150,10 +136,6 @@
     module.add_class('SimpleRefCount', automatic_type_narrowing=True, import_from_module='ns.core', template_parameters=['ns3::SystemThread', 'ns3::empty', 'ns3::DefaultDeleter<ns3::SystemThread>'], parent=root_module['ns3::empty'], memory_policy=cppclass.ReferenceCountingMethodsPolicy(incref_method='Ref', decref_method='Unref', peekref_method='GetReferenceCount'))
     ## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::TraceSourceAccessor, ns3::empty, ns3::DefaultDeleter<ns3::TraceSourceAccessor> > [class]
     module.add_class('SimpleRefCount', automatic_type_narrowing=True, import_from_module='ns.core', template_parameters=['ns3::TraceSourceAccessor', 'ns3::empty', 'ns3::DefaultDeleter<ns3::TraceSourceAccessor>'], parent=root_module['ns3::empty'], memory_policy=cppclass.ReferenceCountingMethodsPolicy(incref_method='Ref', decref_method='Unref', peekref_method='GetReferenceCount'))
-    ## simulator-impl.h (module 'core'): ns3::SimulatorImpl [class]
-    module.add_class('SimulatorImpl', import_from_module='ns.core', parent=root_module['ns3::Object'])
-    ## synchronizer.h (module 'core'): ns3::Synchronizer [class]
-    module.add_class('Synchronizer', import_from_module='ns.core', parent=root_module['ns3::Object'])
     ## system-thread.h (module 'core'): ns3::SystemThread [class]
     module.add_class('SystemThread', import_from_module='ns.core', parent=root_module['ns3::SimpleRefCount< ns3::SystemThread, ns3::empty, ns3::DefaultDeleter<ns3::SystemThread> >'])
     ## nstime.h (module 'core'): ns3::Time [class]
@@ -222,10 +204,6 @@
     module.add_class('ObjectFactoryValue', import_from_module='ns.core', parent=root_module['ns3::AttributeValue'])
     ## packet.h (module 'network'): ns3::Packet [class]
     module.add_class('Packet', import_from_module='ns.network', parent=root_module['ns3::SimpleRefCount< ns3::Packet, ns3::empty, ns3::DefaultDeleter<ns3::Packet> >'])
-    ## realtime-simulator-impl.h (module 'core'): ns3::RealtimeSimulatorImpl [class]
-    module.add_class('RealtimeSimulatorImpl', import_from_module='ns.core', parent=root_module['ns3::SimulatorImpl'])
-    ## realtime-simulator-impl.h (module 'core'): ns3::RealtimeSimulatorImpl::SynchronizationMode [enumeration]
-    module.add_enum('SynchronizationMode', ['SYNC_BEST_EFFORT', 'SYNC_HARD_LIMIT'], outer_class=root_module['ns3::RealtimeSimulatorImpl'], import_from_module='ns.core')
     ## tap-bridge.h (module 'tap-bridge'): ns3::TapBridge [class]
     module.add_class('TapBridge', parent=root_module['ns3::NetDevice'])
     ## tap-bridge.h (module 'tap-bridge'): ns3::TapBridge::Mode [enumeration]
@@ -244,12 +222,6 @@
     module.add_class('AddressChecker', import_from_module='ns.network', parent=root_module['ns3::AttributeChecker'])
     ## address.h (module 'network'): ns3::AddressValue [class]
     module.add_class('AddressValue', import_from_module='ns.network', parent=root_module['ns3::AttributeValue'])
-    typehandlers.add_type_alias('void ( * ) ( std::ostream & ) *', 'ns3::LogTimePrinter')
-    typehandlers.add_type_alias('void ( * ) ( std::ostream & ) **', 'ns3::LogTimePrinter*')
-    typehandlers.add_type_alias('void ( * ) ( std::ostream & ) *&', 'ns3::LogTimePrinter&')
-    typehandlers.add_type_alias('void ( * ) ( std::ostream & ) *', 'ns3::LogNodePrinter')
-    typehandlers.add_type_alias('void ( * ) ( std::ostream & ) **', 'ns3::LogNodePrinter*')
-    typehandlers.add_type_alias('void ( * ) ( std::ostream & ) *&', 'ns3::LogNodePrinter&')
     
     ## Register a nested module for the namespace FatalImpl
     
@@ -273,14 +245,12 @@
     register_Ns3ByteTagListIterator_methods(root_module, root_module['ns3::ByteTagList::Iterator'])
     register_Ns3ByteTagListIteratorItem_methods(root_module, root_module['ns3::ByteTagList::Iterator::Item'])
     register_Ns3CallbackBase_methods(root_module, root_module['ns3::CallbackBase'])
-    register_Ns3CriticalSection_methods(root_module, root_module['ns3::CriticalSection'])
     register_Ns3DataRate_methods(root_module, root_module['ns3::DataRate'])
     register_Ns3EventId_methods(root_module, root_module['ns3::EventId'])
     register_Ns3Ipv4Address_methods(root_module, root_module['ns3::Ipv4Address'])
     register_Ns3Ipv4Mask_methods(root_module, root_module['ns3::Ipv4Mask'])
     register_Ns3Ipv6Address_methods(root_module, root_module['ns3::Ipv6Address'])
     register_Ns3Ipv6Prefix_methods(root_module, root_module['ns3::Ipv6Prefix'])
-    register_Ns3LogComponent_methods(root_module, root_module['ns3::LogComponent'])
     register_Ns3Mac48Address_methods(root_module, root_module['ns3::Mac48Address'])
     register_Ns3NetDeviceContainer_methods(root_module, root_module['ns3::NetDeviceContainer'])
     register_Ns3ObjectBase_methods(root_module, root_module['ns3::ObjectBase'])
@@ -294,7 +264,6 @@
     register_Ns3PacketTagList_methods(root_module, root_module['ns3::PacketTagList'])
     register_Ns3PacketTagListTagData_methods(root_module, root_module['ns3::PacketTagList::TagData'])
     register_Ns3SimpleRefCount__Ns3Object_Ns3ObjectBase_Ns3ObjectDeleter_methods(root_module, root_module['ns3::SimpleRefCount< ns3::Object, ns3::ObjectBase, ns3::ObjectDeleter >'])
-    register_Ns3SystemMutex_methods(root_module, root_module['ns3::SystemMutex'])
     register_Ns3Tag_methods(root_module, root_module['ns3::Tag'])
     register_Ns3TagBuffer_methods(root_module, root_module['ns3::TagBuffer'])
     register_Ns3TapBridgeHelper_methods(root_module, root_module['ns3::TapBridgeHelper'])
@@ -307,9 +276,6 @@
     register_Ns3Header_methods(root_module, root_module['ns3::Header'])
     register_Ns3Object_methods(root_module, root_module['ns3::Object'])
     register_Ns3ObjectAggregateIterator_methods(root_module, root_module['ns3::Object::AggregateIterator'])
-    register_Ns3Scheduler_methods(root_module, root_module['ns3::Scheduler'])
-    register_Ns3SchedulerEvent_methods(root_module, root_module['ns3::Scheduler::Event'])
-    register_Ns3SchedulerEventKey_methods(root_module, root_module['ns3::Scheduler::EventKey'])
     register_Ns3SimpleRefCount__Ns3AttributeAccessor_Ns3Empty_Ns3DefaultDeleter__lt__ns3AttributeAccessor__gt___methods(root_module, root_module['ns3::SimpleRefCount< ns3::AttributeAccessor, ns3::empty, ns3::DefaultDeleter<ns3::AttributeAccessor> >'])
     register_Ns3SimpleRefCount__Ns3AttributeChecker_Ns3Empty_Ns3DefaultDeleter__lt__ns3AttributeChecker__gt___methods(root_module, root_module['ns3::SimpleRefCount< ns3::AttributeChecker, ns3::empty, ns3::DefaultDeleter<ns3::AttributeChecker> >'])
     register_Ns3SimpleRefCount__Ns3AttributeValue_Ns3Empty_Ns3DefaultDeleter__lt__ns3AttributeValue__gt___methods(root_module, root_module['ns3::SimpleRefCount< ns3::AttributeValue, ns3::empty, ns3::DefaultDeleter<ns3::AttributeValue> >'])
@@ -320,8 +286,6 @@
     register_Ns3SimpleRefCount__Ns3Packet_Ns3Empty_Ns3DefaultDeleter__lt__ns3Packet__gt___methods(root_module, root_module['ns3::SimpleRefCount< ns3::Packet, ns3::empty, ns3::DefaultDeleter<ns3::Packet> >'])
     register_Ns3SimpleRefCount__Ns3SystemThread_Ns3Empty_Ns3DefaultDeleter__lt__ns3SystemThread__gt___methods(root_module, root_module['ns3::SimpleRefCount< ns3::SystemThread, ns3::empty, ns3::DefaultDeleter<ns3::SystemThread> >'])
     register_Ns3SimpleRefCount__Ns3TraceSourceAccessor_Ns3Empty_Ns3DefaultDeleter__lt__ns3TraceSourceAccessor__gt___methods(root_module, root_module['ns3::SimpleRefCount< ns3::TraceSourceAccessor, ns3::empty, ns3::DefaultDeleter<ns3::TraceSourceAccessor> >'])
-    register_Ns3SimulatorImpl_methods(root_module, root_module['ns3::SimulatorImpl'])
-    register_Ns3Synchronizer_methods(root_module, root_module['ns3::Synchronizer'])
     register_Ns3SystemThread_methods(root_module, root_module['ns3::SystemThread'])
     register_Ns3Time_methods(root_module, root_module['ns3::Time'])
     register_Ns3TraceSourceAccessor_methods(root_module, root_module['ns3::TraceSourceAccessor'])
@@ -353,7 +317,6 @@
     register_Ns3ObjectFactoryChecker_methods(root_module, root_module['ns3::ObjectFactoryChecker'])
     register_Ns3ObjectFactoryValue_methods(root_module, root_module['ns3::ObjectFactoryValue'])
     register_Ns3Packet_methods(root_module, root_module['ns3::Packet'])
-    register_Ns3RealtimeSimulatorImpl_methods(root_module, root_module['ns3::RealtimeSimulatorImpl'])
     register_Ns3TapBridge_methods(root_module, root_module['ns3::TapBridge'])
     register_Ns3TapBridgeFdReader_methods(root_module, root_module['ns3::TapBridgeFdReader'])
     register_Ns3TimeChecker_methods(root_module, root_module['ns3::TimeChecker'])
@@ -842,13 +805,6 @@
                    is_static=True, visibility='protected')
     return
 
-def register_Ns3CriticalSection_methods(root_module, cls):
-    ## system-mutex.h (module 'core'): ns3::CriticalSection::CriticalSection(ns3::CriticalSection const & arg0) [copy constructor]
-    cls.add_constructor([param('ns3::CriticalSection const &', 'arg0')])
-    ## system-mutex.h (module 'core'): ns3::CriticalSection::CriticalSection(ns3::SystemMutex & mutex) [constructor]
-    cls.add_constructor([param('ns3::SystemMutex &', 'mutex')])
-    return
-
 def register_Ns3DataRate_methods(root_module, cls):
     cls.add_output_stream_operator()
     cls.add_binary_comparison_operator('!=')
@@ -1324,40 +1280,6 @@
                    is_const=True)
     return
 
-def register_Ns3LogComponent_methods(root_module, cls):
-    ## log.h (module 'core'): ns3::LogComponent::LogComponent(ns3::LogComponent const & arg0) [copy constructor]
-    cls.add_constructor([param('ns3::LogComponent const &', 'arg0')])
-    ## log.h (module 'core'): ns3::LogComponent::LogComponent(char const * name) [constructor]
-    cls.add_constructor([param('char const *', 'name')])
-    ## log.h (module 'core'): void ns3::LogComponent::Disable(ns3::LogLevel level) [member function]
-    cls.add_method('Disable', 
-                   'void', 
-                   [param('ns3::LogLevel', 'level')])
-    ## log.h (module 'core'): void ns3::LogComponent::Enable(ns3::LogLevel level) [member function]
-    cls.add_method('Enable', 
-                   'void', 
-                   [param('ns3::LogLevel', 'level')])
-    ## log.h (module 'core'): void ns3::LogComponent::EnvVarCheck(char const * name) [member function]
-    cls.add_method('EnvVarCheck', 
-                   'void', 
-                   [param('char const *', 'name')])
-    ## log.h (module 'core'): bool ns3::LogComponent::IsEnabled(ns3::LogLevel level) const [member function]
-    cls.add_method('IsEnabled', 
-                   'bool', 
-                   [param('ns3::LogLevel', 'level')], 
-                   is_const=True)
-    ## log.h (module 'core'): bool ns3::LogComponent::IsNoneEnabled() const [member function]
-    cls.add_method('IsNoneEnabled', 
-                   'bool', 
-                   [], 
-                   is_const=True)
-    ## log.h (module 'core'): char const * ns3::LogComponent::Name() const [member function]
-    cls.add_method('Name', 
-                   'char const *', 
-                   [], 
-                   is_const=True)
-    return
-
 def register_Ns3Mac48Address_methods(root_module, cls):
     cls.add_binary_comparison_operator('<')
     cls.add_binary_comparison_operator('!=')
@@ -1783,21 +1705,6 @@
                    is_static=True)
     return
 
-def register_Ns3SystemMutex_methods(root_module, cls):
-    ## system-mutex.h (module 'core'): ns3::SystemMutex::SystemMutex(ns3::SystemMutex const & arg0) [copy constructor]
-    cls.add_constructor([param('ns3::SystemMutex const &', 'arg0')])
-    ## system-mutex.h (module 'core'): ns3::SystemMutex::SystemMutex() [constructor]
-    cls.add_constructor([])
-    ## system-mutex.h (module 'core'): void ns3::SystemMutex::Lock() [member function]
-    cls.add_method('Lock', 
-                   'void', 
-                   [])
-    ## system-mutex.h (module 'core'): void ns3::SystemMutex::Unlock() [member function]
-    cls.add_method('Unlock', 
-                   'void', 
-                   [])
-    return
-
 def register_Ns3Tag_methods(root_module, cls):
     ## tag.h (module 'network'): ns3::Tag::Tag() [constructor]
     cls.add_constructor([])
@@ -2335,71 +2242,6 @@
                    [])
     return
 
-def register_Ns3Scheduler_methods(root_module, cls):
-    ## scheduler.h (module 'core'): ns3::Scheduler::Scheduler() [constructor]
-    cls.add_constructor([])
-    ## scheduler.h (module 'core'): ns3::Scheduler::Scheduler(ns3::Scheduler const & arg0) [copy constructor]
-    cls.add_constructor([param('ns3::Scheduler const &', 'arg0')])
-    ## scheduler.h (module 'core'): static ns3::TypeId ns3::Scheduler::GetTypeId() [member function]
-    cls.add_method('GetTypeId', 
-                   'ns3::TypeId', 
-                   [], 
-                   is_static=True)
-    ## scheduler.h (module 'core'): void ns3::Scheduler::Insert(ns3::Scheduler::Event const & ev) [member function]
-    cls.add_method('Insert', 
-                   'void', 
-                   [param('ns3::Scheduler::Event const &', 'ev')], 
-                   is_pure_virtual=True, is_virtual=True)
-    ## scheduler.h (module 'core'): bool ns3::Scheduler::IsEmpty() const [member function]
-    cls.add_method('IsEmpty', 
-                   'bool', 
-                   [], 
-                   is_pure_virtual=True, is_const=True, is_virtual=True)
-    ## scheduler.h (module 'core'): ns3::Scheduler::Event ns3::Scheduler::PeekNext() const [member function]
-    cls.add_method('PeekNext', 
-                   'ns3::Scheduler::Event', 
-                   [], 
-                   is_pure_virtual=True, is_const=True, is_virtual=True)
-    ## scheduler.h (module 'core'): void ns3::Scheduler::Remove(ns3::Scheduler::Event const & ev) [member function]
-    cls.add_method('Remove', 
-                   'void', 
-                   [param('ns3::Scheduler::Event const &', 'ev')], 
-                   is_pure_virtual=True, is_virtual=True)
-    ## scheduler.h (module 'core'): ns3::Scheduler::Event ns3::Scheduler::RemoveNext() [member function]
-    cls.add_method('RemoveNext', 
-                   'ns3::Scheduler::Event', 
-                   [], 
-                   is_pure_virtual=True, is_virtual=True)
-    return
-
-def register_Ns3SchedulerEvent_methods(root_module, cls):
-    cls.add_binary_comparison_operator('<')
-    ## scheduler.h (module 'core'): ns3::Scheduler::Event::Event() [constructor]
-    cls.add_constructor([])
-    ## scheduler.h (module 'core'): ns3::Scheduler::Event::Event(ns3::Scheduler::Event const & arg0) [copy constructor]
-    cls.add_constructor([param('ns3::Scheduler::Event const &', 'arg0')])
-    ## scheduler.h (module 'core'): ns3::Scheduler::Event::impl [variable]
-    cls.add_instance_attribute('impl', 'ns3::EventImpl *', is_const=False)
-    ## scheduler.h (module 'core'): ns3::Scheduler::Event::key [variable]
-    cls.add_instance_attribute('key', 'ns3::Scheduler::EventKey', is_const=False)
-    return
-
-def register_Ns3SchedulerEventKey_methods(root_module, cls):
-    cls.add_binary_comparison_operator('<')
-    cls.add_binary_comparison_operator('>')
-    cls.add_binary_comparison_operator('!=')
-    ## scheduler.h (module 'core'): ns3::Scheduler::EventKey::EventKey() [constructor]
-    cls.add_constructor([])
-    ## scheduler.h (module 'core'): ns3::Scheduler::EventKey::EventKey(ns3::Scheduler::EventKey const & arg0) [copy constructor]
-    cls.add_constructor([param('ns3::Scheduler::EventKey const &', 'arg0')])
-    ## scheduler.h (module 'core'): ns3::Scheduler::EventKey::m_context [variable]
-    cls.add_instance_attribute('m_context', 'uint32_t', is_const=False)
-    ## scheduler.h (module 'core'): ns3::Scheduler::EventKey::m_ts [variable]
-    cls.add_instance_attribute('m_ts', 'uint64_t', is_const=False)
-    ## scheduler.h (module 'core'): ns3::Scheduler::EventKey::m_uid [variable]
-    cls.add_instance_attribute('m_uid', 'uint32_t', is_const=False)
-    return
-
 def register_Ns3SimpleRefCount__Ns3AttributeAccessor_Ns3Empty_Ns3DefaultDeleter__lt__ns3AttributeAccessor__gt___methods(root_module, cls):
     ## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::AttributeAccessor, ns3::empty, ns3::DefaultDeleter<ns3::AttributeAccessor> >::SimpleRefCount() [constructor]
     cls.add_constructor([])
@@ -2520,232 +2362,25 @@
                    is_static=True)
     return
 
-def register_Ns3SimulatorImpl_methods(root_module, cls):
-    ## simulator-impl.h (module 'core'): ns3::SimulatorImpl::SimulatorImpl() [constructor]
-    cls.add_constructor([])
-    ## simulator-impl.h (module 'core'): ns3::SimulatorImpl::SimulatorImpl(ns3::SimulatorImpl const & arg0) [copy constructor]
-    cls.add_constructor([param('ns3::SimulatorImpl const &', 'arg0')])
-    ## simulator-impl.h (module 'core'): void ns3::SimulatorImpl::Cancel(ns3::EventId const & ev) [member function]
-    cls.add_method('Cancel', 
-                   'void', 
-                   [param('ns3::EventId const &', 'ev')], 
-                   is_pure_virtual=True, is_virtual=True)
-    ## simulator-impl.h (module 'core'): void ns3::SimulatorImpl::Destroy() [member function]
-    cls.add_method('Destroy', 
-                   'void', 
-                   [], 
-                   is_pure_virtual=True, is_virtual=True)
-    ## simulator-impl.h (module 'core'): uint32_t ns3::SimulatorImpl::GetContext() const [member function]
-    cls.add_method('GetContext', 
-                   'uint32_t', 
-                   [], 
-                   is_pure_virtual=True, is_const=True, is_virtual=True)
-    ## simulator-impl.h (module 'core'): ns3::Time ns3::SimulatorImpl::GetDelayLeft(ns3::EventId const & id) const [member function]
-    cls.add_method('GetDelayLeft', 
-                   'ns3::Time', 
-                   [param('ns3::EventId const &', 'id')], 
-                   is_pure_virtual=True, is_const=True, is_virtual=True)
-    ## simulator-impl.h (module 'core'): ns3::Time ns3::SimulatorImpl::GetMaximumSimulationTime() const [member function]
-    cls.add_method('GetMaximumSimulationTime', 
-                   'ns3::Time', 
-                   [], 
-                   is_pure_virtual=True, is_const=True, is_virtual=True)
-    ## simulator-impl.h (module 'core'): uint32_t ns3::SimulatorImpl::GetSystemId() const [member function]
-    cls.add_method('GetSystemId', 
-                   'uint32_t', 
-                   [], 
-                   is_pure_virtual=True, is_const=True, is_virtual=True)
-    ## simulator-impl.h (module 'core'): static ns3::TypeId ns3::SimulatorImpl::GetTypeId() [member function]
-    cls.add_method('GetTypeId', 
-                   'ns3::TypeId', 
-                   [], 
-                   is_static=True)
-    ## simulator-impl.h (module 'core'): bool ns3::SimulatorImpl::IsExpired(ns3::EventId const & ev) const [member function]
-    cls.add_method('IsExpired', 
-                   'bool', 
-                   [param('ns3::EventId const &', 'ev')], 
-                   is_pure_virtual=True, is_const=True, is_virtual=True)
-    ## simulator-impl.h (module 'core'): bool ns3::SimulatorImpl::IsFinished() const [member function]
-    cls.add_method('IsFinished', 
-                   'bool', 
-                   [], 
-                   is_pure_virtual=True, is_const=True, is_virtual=True)
-    ## simulator-impl.h (module 'core'): ns3::Time ns3::SimulatorImpl::Next() const [member function]
-    cls.add_method('Next', 
-                   'ns3::Time', 
-                   [], 
-                   is_pure_virtual=True, is_const=True, is_virtual=True)
-    ## simulator-impl.h (module 'core'): ns3::Time ns3::SimulatorImpl::Now() const [member function]
-    cls.add_method('Now', 
-                   'ns3::Time', 
-                   [], 
-                   is_pure_virtual=True, is_const=True, is_virtual=True)
-    ## simulator-impl.h (module 'core'): void ns3::SimulatorImpl::Remove(ns3::EventId const & ev) [member function]
-    cls.add_method('Remove', 
-                   'void', 
-                   [param('ns3::EventId const &', 'ev')], 
-                   is_pure_virtual=True, is_virtual=True)
-    ## simulator-impl.h (module 'core'): void ns3::SimulatorImpl::Run() [member function]
-    cls.add_method('Run', 
-                   'void', 
-                   [], 
-                   is_pure_virtual=True, is_virtual=True)
-    ## simulator-impl.h (module 'core'): void ns3::SimulatorImpl::RunOneEvent() [member function]
-    cls.add_method('RunOneEvent', 
-                   'void', 
-                   [], 
-                   is_pure_virtual=True, is_virtual=True)
-    ## simulator-impl.h (module 'core'): ns3::EventId ns3::SimulatorImpl::Schedule(ns3::Time const & time, ns3::EventImpl * event) [member function]
-    cls.add_method('Schedule', 
-                   'ns3::EventId', 
-                   [param('ns3::Time const &', 'time'), param('ns3::EventImpl *', 'event')], 
-                   is_pure_virtual=True, is_virtual=True)
-    ## simulator-impl.h (module 'core'): ns3::EventId ns3::SimulatorImpl::ScheduleDestroy(ns3::EventImpl * event) [member function]
-    cls.add_method('ScheduleDestroy', 
-                   'ns3::EventId', 
-                   [param('ns3::EventImpl *', 'event')], 
-                   is_pure_virtual=True, is_virtual=True)
-    ## simulator-impl.h (module 'core'): ns3::EventId ns3::SimulatorImpl::ScheduleNow(ns3::EventImpl * event) [member function]
-    cls.add_method('ScheduleNow', 
-                   'ns3::EventId', 
-                   [param('ns3::EventImpl *', 'event')], 
-                   is_pure_virtual=True, is_virtual=True)
-    ## simulator-impl.h (module 'core'): void ns3::SimulatorImpl::ScheduleWithContext(uint32_t context, ns3::Time const & time, ns3::EventImpl * event) [member function]
-    cls.add_method('ScheduleWithContext', 
-                   'void', 
-                   [param('uint32_t', 'context'), param('ns3::Time const &', 'time'), param('ns3::EventImpl *', 'event')], 
-                   is_pure_virtual=True, is_virtual=True)
-    ## simulator-impl.h (module 'core'): void ns3::SimulatorImpl::SetScheduler(ns3::ObjectFactory schedulerFactory) [member function]
-    cls.add_method('SetScheduler', 
-                   'void', 
-                   [param('ns3::ObjectFactory', 'schedulerFactory')], 
-                   is_pure_virtual=True, is_virtual=True)
-    ## simulator-impl.h (module 'core'): void ns3::SimulatorImpl::Stop() [member function]
-    cls.add_method('Stop', 
-                   'void', 
-                   [], 
-                   is_pure_virtual=True, is_virtual=True)
-    ## simulator-impl.h (module 'core'): void ns3::SimulatorImpl::Stop(ns3::Time const & time) [member function]
-    cls.add_method('Stop', 
-                   'void', 
-                   [param('ns3::Time const &', 'time')], 
-                   is_pure_virtual=True, is_virtual=True)
-    return
-
-def register_Ns3Synchronizer_methods(root_module, cls):
-    ## synchronizer.h (module 'core'): ns3::Synchronizer::Synchronizer(ns3::Synchronizer const & arg0) [copy constructor]
-    cls.add_constructor([param('ns3::Synchronizer const &', 'arg0')])
-    ## synchronizer.h (module 'core'): ns3::Synchronizer::Synchronizer() [constructor]
-    cls.add_constructor([])
-    ## synchronizer.h (module 'core'): uint64_t ns3::Synchronizer::EventEnd() [member function]
-    cls.add_method('EventEnd', 
-                   'uint64_t', 
-                   [])
-    ## synchronizer.h (module 'core'): void ns3::Synchronizer::EventStart() [member function]
-    cls.add_method('EventStart', 
-                   'void', 
-                   [])
-    ## synchronizer.h (module 'core'): uint64_t ns3::Synchronizer::GetCurrentRealtime() [member function]
-    cls.add_method('GetCurrentRealtime', 
-                   'uint64_t', 
-                   [])
-    ## synchronizer.h (module 'core'): int64_t ns3::Synchronizer::GetDrift(uint64_t ts) [member function]
-    cls.add_method('GetDrift', 
-                   'int64_t', 
-                   [param('uint64_t', 'ts')])
-    ## synchronizer.h (module 'core'): uint64_t ns3::Synchronizer::GetOrigin() [member function]
-    cls.add_method('GetOrigin', 
-                   'uint64_t', 
-                   [])
-    ## synchronizer.h (module 'core'): static ns3::TypeId ns3::Synchronizer::GetTypeId() [member function]
-    cls.add_method('GetTypeId', 
-                   'ns3::TypeId', 
-                   [], 
-                   is_static=True)
-    ## synchronizer.h (module 'core'): bool ns3::Synchronizer::Realtime() [member function]
-    cls.add_method('Realtime', 
-                   'bool', 
-                   [])
-    ## synchronizer.h (module 'core'): void ns3::Synchronizer::SetCondition(bool arg0) [member function]
-    cls.add_method('SetCondition', 
-                   'void', 
-                   [param('bool', 'arg0')])
-    ## synchronizer.h (module 'core'): void ns3::Synchronizer::SetOrigin(uint64_t ts) [member function]
-    cls.add_method('SetOrigin', 
-                   'void', 
-                   [param('uint64_t', 'ts')])
-    ## synchronizer.h (module 'core'): void ns3::Synchronizer::Signal() [member function]
-    cls.add_method('Signal', 
-                   'void', 
-                   [])
-    ## synchronizer.h (module 'core'): bool ns3::Synchronizer::Synchronize(uint64_t tsCurrent, uint64_t tsDelay) [member function]
-    cls.add_method('Synchronize', 
-                   'bool', 
-                   [param('uint64_t', 'tsCurrent'), param('uint64_t', 'tsDelay')])
-    ## synchronizer.h (module 'core'): uint64_t ns3::Synchronizer::DoEventEnd() [member function]
-    cls.add_method('DoEventEnd', 
-                   'uint64_t', 
-                   [], 
-                   is_pure_virtual=True, visibility='protected', is_virtual=True)
-    ## synchronizer.h (module 'core'): void ns3::Synchronizer::DoEventStart() [member function]
-    cls.add_method('DoEventStart', 
-                   'void', 
-                   [], 
-                   is_pure_virtual=True, visibility='protected', is_virtual=True)
-    ## synchronizer.h (module 'core'): uint64_t ns3::Synchronizer::DoGetCurrentRealtime() [member function]
-    cls.add_method('DoGetCurrentRealtime', 
-                   'uint64_t', 
-                   [], 
-                   is_pure_virtual=True, visibility='protected', is_virtual=True)
-    ## synchronizer.h (module 'core'): int64_t ns3::Synchronizer::DoGetDrift(uint64_t ns) [member function]
-    cls.add_method('DoGetDrift', 
-                   'int64_t', 
-                   [param('uint64_t', 'ns')], 
-                   is_pure_virtual=True, visibility='protected', is_virtual=True)
-    ## synchronizer.h (module 'core'): bool ns3::Synchronizer::DoRealtime() [member function]
-    cls.add_method('DoRealtime', 
-                   'bool', 
-                   [], 
-                   is_pure_virtual=True, visibility='protected', is_virtual=True)
-    ## synchronizer.h (module 'core'): void ns3::Synchronizer::DoSetCondition(bool arg0) [member function]
-    cls.add_method('DoSetCondition', 
-                   'void', 
-                   [param('bool', 'arg0')], 
-                   is_pure_virtual=True, visibility='protected', is_virtual=True)
-    ## synchronizer.h (module 'core'): void ns3::Synchronizer::DoSetOrigin(uint64_t ns) [member function]
-    cls.add_method('DoSetOrigin', 
-                   'void', 
-                   [param('uint64_t', 'ns')], 
-                   is_pure_virtual=True, visibility='protected', is_virtual=True)
-    ## synchronizer.h (module 'core'): void ns3::Synchronizer::DoSignal() [member function]
-    cls.add_method('DoSignal', 
-                   'void', 
-                   [], 
-                   is_pure_virtual=True, visibility='protected', is_virtual=True)
-    ## synchronizer.h (module 'core'): bool ns3::Synchronizer::DoSynchronize(uint64_t nsCurrent, uint64_t nsDelay) [member function]
-    cls.add_method('DoSynchronize', 
-                   'bool', 
-                   [param('uint64_t', 'nsCurrent'), param('uint64_t', 'nsDelay')], 
-                   is_pure_virtual=True, visibility='protected', is_virtual=True)
-    return
-
 def register_Ns3SystemThread_methods(root_module, cls):
     ## system-thread.h (module 'core'): ns3::SystemThread::SystemThread(ns3::SystemThread const & arg0) [copy constructor]
     cls.add_constructor([param('ns3::SystemThread const &', 'arg0')])
-    ## system-thread.h (module 'core'): ns3::SystemThread::SystemThread(ns3::Callback<void,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty> callback) [constructor]
+    ## system-thread.h (module 'core'): ns3::SystemThread::SystemThread(ns3::Callback<void, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> callback) [constructor]
     cls.add_constructor([param('ns3::Callback< void, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'callback')])
-    ## system-thread.h (module 'core'): bool ns3::SystemThread::Break() [member function]
-    cls.add_method('Break', 
+    ## system-thread.h (module 'core'): static bool ns3::SystemThread::Equals(pthread_t id) [member function]
+    cls.add_method('Equals', 
                    'bool', 
-                   [])
+                   [param('pthread_t', 'id')], 
+                   is_static=True)
     ## system-thread.h (module 'core'): void ns3::SystemThread::Join() [member function]
     cls.add_method('Join', 
                    'void', 
                    [])
-    ## system-thread.h (module 'core'): void ns3::SystemThread::Shutdown() [member function]
-    cls.add_method('Shutdown', 
-                   'void', 
-                   [])
+    ## system-thread.h (module 'core'): static pthread_t ns3::SystemThread::Self() [member function]
+    cls.add_method('Self', 
+                   'pthread_t', 
+                   [], 
+                   is_static=True)
     ## system-thread.h (module 'core'): void ns3::SystemThread::Start() [member function]
     cls.add_method('Start', 
                    'void', 
@@ -3417,7 +3052,7 @@
     cls.add_constructor([])
     ## net-device.h (module 'network'): ns3::NetDevice::NetDevice(ns3::NetDevice const & arg0) [copy constructor]
     cls.add_constructor([param('ns3::NetDevice const &', 'arg0')])
-    ## net-device.h (module 'network'): void ns3::NetDevice::AddLinkChangeCallback(ns3::Callback<void,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty> callback) [member function]
+    ## net-device.h (module 'network'): void ns3::NetDevice::AddLinkChangeCallback(ns3::Callback<void, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> callback) [member function]
     cls.add_method('AddLinkChangeCallback', 
                    'void', 
                    [param('ns3::Callback< void, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'callback')], 
@@ -3892,168 +3527,12 @@
                    [param('ns3::Ptr< ns3::NixVector >', 'arg0')])
     return
 
-def register_Ns3RealtimeSimulatorImpl_methods(root_module, cls):
-    ## realtime-simulator-impl.h (module 'core'): ns3::RealtimeSimulatorImpl::RealtimeSimulatorImpl(ns3::RealtimeSimulatorImpl const & arg0) [copy constructor]
-    cls.add_constructor([param('ns3::RealtimeSimulatorImpl const &', 'arg0')])
-    ## realtime-simulator-impl.h (module 'core'): ns3::RealtimeSimulatorImpl::RealtimeSimulatorImpl() [constructor]
-    cls.add_constructor([])
-    ## realtime-simulator-impl.h (module 'core'): void ns3::RealtimeSimulatorImpl::Cancel(ns3::EventId const & ev) [member function]
-    cls.add_method('Cancel', 
-                   'void', 
-                   [param('ns3::EventId const &', 'ev')], 
-                   is_virtual=True)
-    ## realtime-simulator-impl.h (module 'core'): void ns3::RealtimeSimulatorImpl::Destroy() [member function]
-    cls.add_method('Destroy', 
-                   'void', 
-                   [], 
-                   is_virtual=True)
-    ## realtime-simulator-impl.h (module 'core'): uint32_t ns3::RealtimeSimulatorImpl::GetContext() const [member function]
-    cls.add_method('GetContext', 
-                   'uint32_t', 
-                   [], 
-                   is_const=True, is_virtual=True)
-    ## realtime-simulator-impl.h (module 'core'): ns3::Time ns3::RealtimeSimulatorImpl::GetDelayLeft(ns3::EventId const & id) const [member function]
-    cls.add_method('GetDelayLeft', 
-                   'ns3::Time', 
-                   [param('ns3::EventId const &', 'id')], 
-                   is_const=True, is_virtual=True)
-    ## realtime-simulator-impl.h (module 'core'): ns3::Time ns3::RealtimeSimulatorImpl::GetHardLimit() const [member function]
-    cls.add_method('GetHardLimit', 
-                   'ns3::Time', 
-                   [], 
-                   is_const=True)
-    ## realtime-simulator-impl.h (module 'core'): ns3::Time ns3::RealtimeSimulatorImpl::GetMaximumSimulationTime() const [member function]
-    cls.add_method('GetMaximumSimulationTime', 
-                   'ns3::Time', 
-                   [], 
-                   is_const=True, is_virtual=True)
-    ## realtime-simulator-impl.h (module 'core'): ns3::RealtimeSimulatorImpl::SynchronizationMode ns3::RealtimeSimulatorImpl::GetSynchronizationMode() const [member function]
-    cls.add_method('GetSynchronizationMode', 
-                   'ns3::RealtimeSimulatorImpl::SynchronizationMode', 
-                   [], 
-                   is_const=True)
-    ## realtime-simulator-impl.h (module 'core'): uint32_t ns3::RealtimeSimulatorImpl::GetSystemId() const [member function]
-    cls.add_method('GetSystemId', 
-                   'uint32_t', 
-                   [], 
-                   is_const=True, is_virtual=True)
-    ## realtime-simulator-impl.h (module 'core'): static ns3::TypeId ns3::RealtimeSimulatorImpl::GetTypeId() [member function]
-    cls.add_method('GetTypeId', 
-                   'ns3::TypeId', 
-                   [], 
-                   is_static=True)
-    ## realtime-simulator-impl.h (module 'core'): bool ns3::RealtimeSimulatorImpl::IsExpired(ns3::EventId const & ev) const [member function]
-    cls.add_method('IsExpired', 
-                   'bool', 
-                   [param('ns3::EventId const &', 'ev')], 
-                   is_const=True, is_virtual=True)
-    ## realtime-simulator-impl.h (module 'core'): bool ns3::RealtimeSimulatorImpl::IsFinished() const [member function]
-    cls.add_method('IsFinished', 
-                   'bool', 
-                   [], 
-                   is_const=True, is_virtual=True)
-    ## realtime-simulator-impl.h (module 'core'): ns3::Time ns3::RealtimeSimulatorImpl::Next() const [member function]
-    cls.add_method('Next', 
-                   'ns3::Time', 
-                   [], 
-                   is_const=True, is_virtual=True)
-    ## realtime-simulator-impl.h (module 'core'): ns3::Time ns3::RealtimeSimulatorImpl::Now() const [member function]
-    cls.add_method('Now', 
-                   'ns3::Time', 
-                   [], 
-                   is_const=True, is_virtual=True)
-    ## realtime-simulator-impl.h (module 'core'): ns3::Time ns3::RealtimeSimulatorImpl::RealtimeNow() const [member function]
-    cls.add_method('RealtimeNow', 
-                   'ns3::Time', 
-                   [], 
-                   is_const=True)
-    ## realtime-simulator-impl.h (module 'core'): void ns3::RealtimeSimulatorImpl::Remove(ns3::EventId const & ev) [member function]
-    cls.add_method('Remove', 
-                   'void', 
-                   [param('ns3::EventId const &', 'ev')], 
-                   is_virtual=True)
-    ## realtime-simulator-impl.h (module 'core'): void ns3::RealtimeSimulatorImpl::Run() [member function]
-    cls.add_method('Run', 
-                   'void', 
-                   [], 
-                   is_virtual=True)
-    ## realtime-simulator-impl.h (module 'core'): void ns3::RealtimeSimulatorImpl::RunOneEvent() [member function]
-    cls.add_method('RunOneEvent', 
-                   'void', 
-                   [], 
-                   is_virtual=True)
-    ## realtime-simulator-impl.h (module 'core'): ns3::EventId ns3::RealtimeSimulatorImpl::Schedule(ns3::Time const & time, ns3::EventImpl * event) [member function]
-    cls.add_method('Schedule', 
-                   'ns3::EventId', 
-                   [param('ns3::Time const &', 'time'), param('ns3::EventImpl *', 'event')], 
-                   is_virtual=True)
-    ## realtime-simulator-impl.h (module 'core'): ns3::EventId ns3::RealtimeSimulatorImpl::ScheduleDestroy(ns3::EventImpl * event) [member function]
-    cls.add_method('ScheduleDestroy', 
-                   'ns3::EventId', 
-                   [param('ns3::EventImpl *', 'event')], 
-                   is_virtual=True)
-    ## realtime-simulator-impl.h (module 'core'): ns3::EventId ns3::RealtimeSimulatorImpl::ScheduleNow(ns3::EventImpl * event) [member function]
-    cls.add_method('ScheduleNow', 
-                   'ns3::EventId', 
-                   [param('ns3::EventImpl *', 'event')], 
-                   is_virtual=True)
-    ## realtime-simulator-impl.h (module 'core'): void ns3::RealtimeSimulatorImpl::ScheduleRealtime(ns3::Time const & time, ns3::EventImpl * event) [member function]
-    cls.add_method('ScheduleRealtime', 
-                   'void', 
-                   [param('ns3::Time const &', 'time'), param('ns3::EventImpl *', 'event')])
-    ## realtime-simulator-impl.h (module 'core'): void ns3::RealtimeSimulatorImpl::ScheduleRealtimeNow(ns3::EventImpl * event) [member function]
-    cls.add_method('ScheduleRealtimeNow', 
-                   'void', 
-                   [param('ns3::EventImpl *', 'event')])
-    ## realtime-simulator-impl.h (module 'core'): void ns3::RealtimeSimulatorImpl::ScheduleRealtimeNowWithContext(uint32_t context, ns3::EventImpl * event) [member function]
-    cls.add_method('ScheduleRealtimeNowWithContext', 
-                   'void', 
-                   [param('uint32_t', 'context'), param('ns3::EventImpl *', 'event')])
-    ## realtime-simulator-impl.h (module 'core'): void ns3::RealtimeSimulatorImpl::ScheduleRealtimeWithContext(uint32_t context, ns3::Time const & time, ns3::EventImpl * event) [member function]
-    cls.add_method('ScheduleRealtimeWithContext', 
-                   'void', 
-                   [param('uint32_t', 'context'), param('ns3::Time const &', 'time'), param('ns3::EventImpl *', 'event')])
-    ## realtime-simulator-impl.h (module 'core'): void ns3::RealtimeSimulatorImpl::ScheduleWithContext(uint32_t context, ns3::Time const & time, ns3::EventImpl * event) [member function]
-    cls.add_method('ScheduleWithContext', 
-                   'void', 
-                   [param('uint32_t', 'context'), param('ns3::Time const &', 'time'), param('ns3::EventImpl *', 'event')], 
-                   is_virtual=True)
-    ## realtime-simulator-impl.h (module 'core'): void ns3::RealtimeSimulatorImpl::SetHardLimit(ns3::Time limit) [member function]
-    cls.add_method('SetHardLimit', 
-                   'void', 
-                   [param('ns3::Time', 'limit')])
-    ## realtime-simulator-impl.h (module 'core'): void ns3::RealtimeSimulatorImpl::SetScheduler(ns3::ObjectFactory schedulerFactory) [member function]
-    cls.add_method('SetScheduler', 
-                   'void', 
-                   [param('ns3::ObjectFactory', 'schedulerFactory')], 
-                   is_virtual=True)
-    ## realtime-simulator-impl.h (module 'core'): void ns3::RealtimeSimulatorImpl::SetSynchronizationMode(ns3::RealtimeSimulatorImpl::SynchronizationMode mode) [member function]
-    cls.add_method('SetSynchronizationMode', 
-                   'void', 
-                   [param('ns3::RealtimeSimulatorImpl::SynchronizationMode', 'mode')])
-    ## realtime-simulator-impl.h (module 'core'): void ns3::RealtimeSimulatorImpl::Stop() [member function]
-    cls.add_method('Stop', 
-                   'void', 
-                   [], 
-                   is_virtual=True)
-    ## realtime-simulator-impl.h (module 'core'): void ns3::RealtimeSimulatorImpl::Stop(ns3::Time const & time) [member function]
-    cls.add_method('Stop', 
-                   'void', 
-                   [param('ns3::Time const &', 'time')], 
-                   is_virtual=True)
-    ## realtime-simulator-impl.h (module 'core'): void ns3::RealtimeSimulatorImpl::DoDispose() [member function]
-    cls.add_method('DoDispose', 
-                   'void', 
-                   [], 
-                   visibility='private', is_virtual=True)
-    return
-
 def register_Ns3TapBridge_methods(root_module, cls):
     ## tap-bridge.h (module 'tap-bridge'): ns3::TapBridge::TapBridge(ns3::TapBridge const & arg0) [copy constructor]
     cls.add_constructor([param('ns3::TapBridge const &', 'arg0')])
     ## tap-bridge.h (module 'tap-bridge'): ns3::TapBridge::TapBridge() [constructor]
     cls.add_constructor([])
-    ## tap-bridge.h (module 'tap-bridge'): void ns3::TapBridge::AddLinkChangeCallback(ns3::Callback<void,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty> callback) [member function]
+    ## tap-bridge.h (module 'tap-bridge'): void ns3::TapBridge::AddLinkChangeCallback(ns3::Callback<void, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> callback) [member function]
     cls.add_method('AddLinkChangeCallback', 
                    'void', 
                    [param('ns3::Callback< void, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'callback')], 
--- a/src/tap-bridge/model/tap-bridge.cc	Wed Apr 11 11:00:27 2012 +0200
+++ b/src/tap-bridge/model/tap-bridge.cc	Wed Apr 11 13:49:33 2012 +0200
@@ -42,6 +42,7 @@
 #include <errno.h>
 #include <limits>
 #include <stdlib.h>
+#include <unistd.h>
 
 //
 // Sometimes having a tap-creator is actually more trouble than solution.  In 
@@ -214,26 +215,6 @@
   NS_ABORT_MSG_IF (m_sock != -1, "TapBridge::StartTapDevice(): Tap is already started");
 
   //
-  // We're going to need a pointer to the realtime simulator implementation.
-  // It's important to remember that access to that implementation may happen 
-  // in a completely different thread than the simulator is running in (we're 
-  // going to spin up that thread below).  We are talking about multiple threads
-  // here, so it is very, very dangerous to do any kind of reference couning on
-  // a shared object that is unaware of what is happening.  What we are going to 
-  // do to address that is to get a reference to the realtime simulator here 
-  // where we are running in the context of a running simulator scheduler --
-  // recall we did a Simulator::Schedule of this method above.  We get the
-  // simulator implementation pointer in a single-threaded way and save the
-  // underlying raw pointer for use by the (other) read thread.  We must not
-  // free this pointer or we may delete the simulator out from under us an 
-  // everyone else.  We assume that the simulator implementation cannot be 
-  // replaced while the tap bridge is running and so will remain valid through
-  // the time during which the read thread is running.
-  //
-  Ptr<RealtimeSimulatorImpl> impl = DynamicCast<RealtimeSimulatorImpl> (Simulator::GetImplementation ());
-  m_rtImpl = GetPointer (impl);
-
-  //
   // A similar story exists for the node ID.  We can't just naively do a
   // GetNode ()->GetId () since GetNode is going to give us a Ptr<Node> which
   // is reference counted.  We need to stash away the node ID for use in the
@@ -683,8 +664,7 @@
 
   NS_LOG_INFO ("TapBridge::ReadCallback(): Received packet on node " << m_nodeId);
   NS_LOG_INFO ("TapBridge::ReadCallback(): Scheduling handler");
-  NS_ASSERT_MSG (m_rtImpl, "TapBridge::ReadCallback(): Realtime simulator implementation pointer not set");
-  m_rtImpl->ScheduleRealtimeNowWithContext (m_nodeId, MakeEvent (&TapBridge::ForwardToBridgedDevice, this, buf, len));
+  Simulator::ScheduleWithContext (m_nodeId, Seconds (0.0), MakeEvent (&TapBridge::ForwardToBridgedDevice, this, buf, len));
 }
 
 void
--- a/src/tap-bridge/model/tap-bridge.h	Wed Apr 11 11:00:27 2012 +0200
+++ b/src/tap-bridge/model/tap-bridge.h	Wed Apr 11 13:49:33 2012 +0200
@@ -32,7 +32,6 @@
 #include "ns3/ptr.h"
 #include "ns3/mac48-address.h"
 #include "ns3/unix-fd-reader.h"
-#include "ns3/realtime-simulator-impl.h"
 
 namespace ns3 {
 
@@ -458,12 +457,6 @@
    */
   uint8_t *m_packetBuffer;
 
-  /**
-   * A copy of a raw pointer to the required real-time simulator implementation.
-   * Never free this pointer!
-   */
-  RealtimeSimulatorImpl *m_rtImpl;
-
   /*
    * a copy of the node id so the read thread doesn't have to GetNode() in
    * in order to find the node ID.  Thread unsafe reference counting in 
--- a/src/tools/bindings/modulegen__gcc_ILP32.py	Wed Apr 11 11:00:27 2012 +0200
+++ b/src/tools/bindings/modulegen__gcc_ILP32.py	Wed Apr 11 13:49:33 2012 +0200
@@ -40,6 +40,8 @@
     module.add_class('Item', import_from_module='ns.network', outer_class=root_module['ns3::ByteTagList::Iterator'])
     ## callback.h (module 'core'): ns3::CallbackBase [class]
     module.add_class('CallbackBase', import_from_module='ns.core')
+    ## data-output-interface.h (module 'stats'): ns3::DataOutputCallback [class]
+    module.add_class('DataOutputCallback', allow_subclassing=True, import_from_module='ns.stats')
     ## delay-jitter-estimation.h (module 'tools'): ns3::DelayJitterEstimation [class]
     module.add_class('DelayJitterEstimation')
     ## event-garbage-collector.h (module 'tools'): ns3::EventGarbageCollector [class]
@@ -78,6 +80,8 @@
     module.add_class('SimpleRefCount', automatic_type_narrowing=True, import_from_module='ns.core', template_parameters=['ns3::Object', 'ns3::ObjectBase', 'ns3::ObjectDeleter'], parent=root_module['ns3::ObjectBase'], memory_policy=cppclass.ReferenceCountingMethodsPolicy(incref_method='Ref', decref_method='Unref', peekref_method='GetReferenceCount'))
     ## simulator.h (module 'core'): ns3::Simulator [class]
     module.add_class('Simulator', destructor_visibility='private', import_from_module='ns.core')
+    ## data-calculator.h (module 'stats'): ns3::StatisticalSummary [class]
+    module.add_class('StatisticalSummary', allow_subclassing=True, import_from_module='ns.stats')
     ## tag.h (module 'network'): ns3::Tag [class]
     module.add_class('Tag', import_from_module='ns.network', parent=root_module['ns3::ObjectBase'])
     ## tag-buffer.h (module 'network'): ns3::TagBuffer [class]
@@ -152,10 +156,16 @@
     module.add_class('CallbackImplBase', import_from_module='ns.core', parent=root_module['ns3::SimpleRefCount< ns3::CallbackImplBase, ns3::empty, ns3::DefaultDeleter<ns3::CallbackImplBase> >'])
     ## callback.h (module 'core'): ns3::CallbackValue [class]
     module.add_class('CallbackValue', import_from_module='ns.core', parent=root_module['ns3::AttributeValue'])
+    ## data-calculator.h (module 'stats'): ns3::DataCalculator [class]
+    module.add_class('DataCalculator', import_from_module='ns.stats', parent=root_module['ns3::Object'])
+    ## data-output-interface.h (module 'stats'): ns3::DataOutputInterface [class]
+    module.add_class('DataOutputInterface', import_from_module='ns.stats', parent=root_module['ns3::Object'])
     ## attribute.h (module 'core'): ns3::EmptyAttributeValue [class]
     module.add_class('EmptyAttributeValue', import_from_module='ns.core', parent=root_module['ns3::AttributeValue'])
     ## event-impl.h (module 'core'): ns3::EventImpl [class]
     module.add_class('EventImpl', import_from_module='ns.core', parent=root_module['ns3::SimpleRefCount< ns3::EventImpl, ns3::empty, ns3::DefaultDeleter<ns3::EventImpl> >'])
+    ## basic-data-calculators.h (module 'stats'): ns3::MinMaxAvgTotalCalculator<double> [class]
+    module.add_class('MinMaxAvgTotalCalculator', import_from_module='ns.stats', template_parameters=['double'], parent=[root_module['ns3::DataCalculator'], root_module['ns3::StatisticalSummary']])
     ## nix-vector.h (module 'network'): ns3::NixVector [class]
     module.add_class('NixVector', import_from_module='ns.network', parent=root_module['ns3::SimpleRefCount< ns3::NixVector, ns3::empty, ns3::DefaultDeleter<ns3::NixVector> >'])
     ## object-factory.h (module 'core'): ns3::ObjectFactoryChecker [class]
@@ -194,6 +204,7 @@
     register_Ns3ByteTagListIterator_methods(root_module, root_module['ns3::ByteTagList::Iterator'])
     register_Ns3ByteTagListIteratorItem_methods(root_module, root_module['ns3::ByteTagList::Iterator::Item'])
     register_Ns3CallbackBase_methods(root_module, root_module['ns3::CallbackBase'])
+    register_Ns3DataOutputCallback_methods(root_module, root_module['ns3::DataOutputCallback'])
     register_Ns3DelayJitterEstimation_methods(root_module, root_module['ns3::DelayJitterEstimation'])
     register_Ns3EventGarbageCollector_methods(root_module, root_module['ns3::EventGarbageCollector'])
     register_Ns3EventId_methods(root_module, root_module['ns3::EventId'])
@@ -212,6 +223,7 @@
     register_Ns3PacketTagListTagData_methods(root_module, root_module['ns3::PacketTagList::TagData'])
     register_Ns3SimpleRefCount__Ns3Object_Ns3ObjectBase_Ns3ObjectDeleter_methods(root_module, root_module['ns3::SimpleRefCount< ns3::Object, ns3::ObjectBase, ns3::ObjectDeleter >'])
     register_Ns3Simulator_methods(root_module, root_module['ns3::Simulator'])
+    register_Ns3StatisticalSummary_methods(root_module, root_module['ns3::StatisticalSummary'])
     register_Ns3Tag_methods(root_module, root_module['ns3::Tag'])
     register_Ns3TagBuffer_methods(root_module, root_module['ns3::TagBuffer'])
     register_Ns3TypeId_methods(root_module, root_module['ns3::TypeId'])
@@ -244,8 +256,11 @@
     register_Ns3CallbackChecker_methods(root_module, root_module['ns3::CallbackChecker'])
     register_Ns3CallbackImplBase_methods(root_module, root_module['ns3::CallbackImplBase'])
     register_Ns3CallbackValue_methods(root_module, root_module['ns3::CallbackValue'])
+    register_Ns3DataCalculator_methods(root_module, root_module['ns3::DataCalculator'])
+    register_Ns3DataOutputInterface_methods(root_module, root_module['ns3::DataOutputInterface'])
     register_Ns3EmptyAttributeValue_methods(root_module, root_module['ns3::EmptyAttributeValue'])
     register_Ns3EventImpl_methods(root_module, root_module['ns3::EventImpl'])
+    register_Ns3MinMaxAvgTotalCalculator__Double_methods(root_module, root_module['ns3::MinMaxAvgTotalCalculator< double >'])
     register_Ns3NixVector_methods(root_module, root_module['ns3::NixVector'])
     register_Ns3ObjectFactoryChecker_methods(root_module, root_module['ns3::ObjectFactoryChecker'])
     register_Ns3ObjectFactoryValue_methods(root_module, root_module['ns3::ObjectFactoryValue'])
@@ -664,6 +679,43 @@
                    is_static=True, visibility='protected')
     return
 
+def register_Ns3DataOutputCallback_methods(root_module, cls):
+    ## data-output-interface.h (module 'stats'): ns3::DataOutputCallback::DataOutputCallback() [constructor]
+    cls.add_constructor([])
+    ## data-output-interface.h (module 'stats'): ns3::DataOutputCallback::DataOutputCallback(ns3::DataOutputCallback const & arg0) [copy constructor]
+    cls.add_constructor([param('ns3::DataOutputCallback const &', 'arg0')])
+    ## data-output-interface.h (module 'stats'): void ns3::DataOutputCallback::OutputSingleton(std::string key, std::string variable, int val) [member function]
+    cls.add_method('OutputSingleton', 
+                   'void', 
+                   [param('std::string', 'key'), param('std::string', 'variable'), param('int', 'val')], 
+                   is_pure_virtual=True, is_virtual=True)
+    ## data-output-interface.h (module 'stats'): void ns3::DataOutputCallback::OutputSingleton(std::string key, std::string variable, uint32_t val) [member function]
+    cls.add_method('OutputSingleton', 
+                   'void', 
+                   [param('std::string', 'key'), param('std::string', 'variable'), param('uint32_t', 'val')], 
+                   is_pure_virtual=True, is_virtual=True)
+    ## data-output-interface.h (module 'stats'): void ns3::DataOutputCallback::OutputSingleton(std::string key, std::string variable, double val) [member function]
+    cls.add_method('OutputSingleton', 
+                   'void', 
+                   [param('std::string', 'key'), param('std::string', 'variable'), param('double', 'val')], 
+                   is_pure_virtual=True, is_virtual=True)
+    ## data-output-interface.h (module 'stats'): void ns3::DataOutputCallback::OutputSingleton(std::string key, std::string variable, std::string val) [member function]
+    cls.add_method('OutputSingleton', 
+                   'void', 
+                   [param('std::string', 'key'), param('std::string', 'variable'), param('std::string', 'val')], 
+                   is_pure_virtual=True, is_virtual=True)
+    ## data-output-interface.h (module 'stats'): void ns3::DataOutputCallback::OutputSingleton(std::string key, std::string variable, ns3::Time val) [member function]
+    cls.add_method('OutputSingleton', 
+                   'void', 
+                   [param('std::string', 'key'), param('std::string', 'variable'), param('ns3::Time', 'val')], 
+                   is_pure_virtual=True, is_virtual=True)
+    ## data-output-interface.h (module 'stats'): void ns3::DataOutputCallback::OutputStatistic(std::string key, std::string variable, ns3::StatisticalSummary const * statSum) [member function]
+    cls.add_method('OutputStatistic', 
+                   'void', 
+                   [param('std::string', 'key'), param('std::string', 'variable'), param('ns3::StatisticalSummary const *', 'statSum')], 
+                   is_pure_virtual=True, is_virtual=True)
+    return
+
 def register_Ns3DelayJitterEstimation_methods(root_module, cls):
     ## delay-jitter-estimation.h (module 'tools'): ns3::DelayJitterEstimation::DelayJitterEstimation(ns3::DelayJitterEstimation const & arg0) [copy constructor]
     cls.add_constructor([param('ns3::DelayJitterEstimation const &', 'arg0')])
@@ -1230,6 +1282,53 @@
                    is_static=True)
     return
 
+def register_Ns3StatisticalSummary_methods(root_module, cls):
+    ## data-calculator.h (module 'stats'): ns3::StatisticalSummary::StatisticalSummary() [constructor]
+    cls.add_constructor([])
+    ## data-calculator.h (module 'stats'): ns3::StatisticalSummary::StatisticalSummary(ns3::StatisticalSummary const & arg0) [copy constructor]
+    cls.add_constructor([param('ns3::StatisticalSummary const &', 'arg0')])
+    ## data-calculator.h (module 'stats'): long int ns3::StatisticalSummary::getCount() const [member function]
+    cls.add_method('getCount', 
+                   'long int', 
+                   [], 
+                   is_pure_virtual=True, is_const=True, is_virtual=True)
+    ## data-calculator.h (module 'stats'): double ns3::StatisticalSummary::getMax() const [member function]
+    cls.add_method('getMax', 
+                   'double', 
+                   [], 
+                   is_pure_virtual=True, is_const=True, is_virtual=True)
+    ## data-calculator.h (module 'stats'): double ns3::StatisticalSummary::getMean() const [member function]
+    cls.add_method('getMean', 
+                   'double', 
+                   [], 
+                   is_pure_virtual=True, is_const=True, is_virtual=True)
+    ## data-calculator.h (module 'stats'): double ns3::StatisticalSummary::getMin() const [member function]
+    cls.add_method('getMin', 
+                   'double', 
+                   [], 
+                   is_pure_virtual=True, is_const=True, is_virtual=True)
+    ## data-calculator.h (module 'stats'): double ns3::StatisticalSummary::getSqrSum() const [member function]
+    cls.add_method('getSqrSum', 
+                   'double', 
+                   [], 
+                   is_pure_virtual=True, is_const=True, is_virtual=True)
+    ## data-calculator.h (module 'stats'): double ns3::StatisticalSummary::getStddev() const [member function]
+    cls.add_method('getStddev', 
+                   'double', 
+                   [], 
+                   is_pure_virtual=True, is_const=True, is_virtual=True)
+    ## data-calculator.h (module 'stats'): double ns3::StatisticalSummary::getSum() const [member function]
+    cls.add_method('getSum', 
+                   'double', 
+                   [], 
+                   is_pure_virtual=True, is_const=True, is_virtual=True)
+    ## data-calculator.h (module 'stats'): double ns3::StatisticalSummary::getVariance() const [member function]
+    cls.add_method('getVariance', 
+                   'double', 
+                   [], 
+                   is_pure_virtual=True, is_const=True, is_virtual=True)
+    return
+
 def register_Ns3Tag_methods(root_module, cls):
     ## tag.h (module 'network'): ns3::Tag::Tag() [constructor]
     cls.add_constructor([])
@@ -2271,6 +2370,90 @@
                    [param('ns3::CallbackBase', 'base')])
     return
 
+def register_Ns3DataCalculator_methods(root_module, cls):
+    ## data-calculator.h (module 'stats'): ns3::DataCalculator::DataCalculator(ns3::DataCalculator const & arg0) [copy constructor]
+    cls.add_constructor([param('ns3::DataCalculator const &', 'arg0')])
+    ## data-calculator.h (module 'stats'): ns3::DataCalculator::DataCalculator() [constructor]
+    cls.add_constructor([])
+    ## data-calculator.h (module 'stats'): void ns3::DataCalculator::Disable() [member function]
+    cls.add_method('Disable', 
+                   'void', 
+                   [])
+    ## data-calculator.h (module 'stats'): void ns3::DataCalculator::Enable() [member function]
+    cls.add_method('Enable', 
+                   'void', 
+                   [])
+    ## data-calculator.h (module 'stats'): std::string ns3::DataCalculator::GetContext() const [member function]
+    cls.add_method('GetContext', 
+                   'std::string', 
+                   [], 
+                   is_const=True)
+    ## data-calculator.h (module 'stats'): bool ns3::DataCalculator::GetEnabled() const [member function]
+    cls.add_method('GetEnabled', 
+                   'bool', 
+                   [], 
+                   is_const=True)
+    ## data-calculator.h (module 'stats'): std::string ns3::DataCalculator::GetKey() const [member function]
+    cls.add_method('GetKey', 
+                   'std::string', 
+                   [], 
+                   is_const=True)
+    ## data-calculator.h (module 'stats'): void ns3::DataCalculator::Output(ns3::DataOutputCallback & callback) const [member function]
+    cls.add_method('Output', 
+                   'void', 
+                   [param('ns3::DataOutputCallback &', 'callback')], 
+                   is_pure_virtual=True, is_const=True, is_virtual=True)
+    ## data-calculator.h (module 'stats'): void ns3::DataCalculator::SetContext(std::string const context) [member function]
+    cls.add_method('SetContext', 
+                   'void', 
+                   [param('std::string const', 'context')])
+    ## data-calculator.h (module 'stats'): void ns3::DataCalculator::SetKey(std::string const key) [member function]
+    cls.add_method('SetKey', 
+                   'void', 
+                   [param('std::string const', 'key')])
+    ## data-calculator.h (module 'stats'): void ns3::DataCalculator::Start(ns3::Time const & startTime) [member function]
+    cls.add_method('Start', 
+                   'void', 
+                   [param('ns3::Time const &', 'startTime')], 
+                   is_virtual=True)
+    ## data-calculator.h (module 'stats'): void ns3::DataCalculator::Stop(ns3::Time const & stopTime) [member function]
+    cls.add_method('Stop', 
+                   'void', 
+                   [param('ns3::Time const &', 'stopTime')], 
+                   is_virtual=True)
+    ## data-calculator.h (module 'stats'): void ns3::DataCalculator::DoDispose() [member function]
+    cls.add_method('DoDispose', 
+                   'void', 
+                   [], 
+                   visibility='protected', is_virtual=True)
+    return
+
+def register_Ns3DataOutputInterface_methods(root_module, cls):
+    ## data-output-interface.h (module 'stats'): ns3::DataOutputInterface::DataOutputInterface(ns3::DataOutputInterface const & arg0) [copy constructor]
+    cls.add_constructor([param('ns3::DataOutputInterface const &', 'arg0')])
+    ## data-output-interface.h (module 'stats'): ns3::DataOutputInterface::DataOutputInterface() [constructor]
+    cls.add_constructor([])
+    ## data-output-interface.h (module 'stats'): std::string ns3::DataOutputInterface::GetFilePrefix() const [member function]
+    cls.add_method('GetFilePrefix', 
+                   'std::string', 
+                   [], 
+                   is_const=True)
+    ## data-output-interface.h (module 'stats'): void ns3::DataOutputInterface::Output(ns3::DataCollector & dc) [member function]
+    cls.add_method('Output', 
+                   'void', 
+                   [param('ns3::DataCollector &', 'dc')], 
+                   is_pure_virtual=True, is_virtual=True)
+    ## data-output-interface.h (module 'stats'): void ns3::DataOutputInterface::SetFilePrefix(std::string const prefix) [member function]
+    cls.add_method('SetFilePrefix', 
+                   'void', 
+                   [param('std::string const', 'prefix')])
+    ## data-output-interface.h (module 'stats'): void ns3::DataOutputInterface::DoDispose() [member function]
+    cls.add_method('DoDispose', 
+                   'void', 
+                   [], 
+                   visibility='protected', is_virtual=True)
+    return
+
 def register_Ns3EmptyAttributeValue_methods(root_module, cls):
     ## attribute.h (module 'core'): ns3::EmptyAttributeValue::EmptyAttributeValue(ns3::EmptyAttributeValue const & arg0) [copy constructor]
     cls.add_constructor([param('ns3::EmptyAttributeValue const &', 'arg0')])
@@ -2317,6 +2500,71 @@
                    is_pure_virtual=True, visibility='protected', is_virtual=True)
     return
 
+def register_Ns3MinMaxAvgTotalCalculator__Double_methods(root_module, cls):
+    ## basic-data-calculators.h (module 'stats'): ns3::MinMaxAvgTotalCalculator<double>::MinMaxAvgTotalCalculator(ns3::MinMaxAvgTotalCalculator<double> const & arg0) [copy constructor]
+    cls.add_constructor([param('ns3::MinMaxAvgTotalCalculator< double > const &', 'arg0')])
+    ## basic-data-calculators.h (module 'stats'): ns3::MinMaxAvgTotalCalculator<double>::MinMaxAvgTotalCalculator() [constructor]
+    cls.add_constructor([])
+    ## basic-data-calculators.h (module 'stats'): void ns3::MinMaxAvgTotalCalculator<double>::Output(ns3::DataOutputCallback & callback) const [member function]
+    cls.add_method('Output', 
+                   'void', 
+                   [param('ns3::DataOutputCallback &', 'callback')], 
+                   is_const=True, is_virtual=True)
+    ## basic-data-calculators.h (module 'stats'): void ns3::MinMaxAvgTotalCalculator<double>::Reset() [member function]
+    cls.add_method('Reset', 
+                   'void', 
+                   [])
+    ## basic-data-calculators.h (module 'stats'): void ns3::MinMaxAvgTotalCalculator<double>::Update(double const i) [member function]
+    cls.add_method('Update', 
+                   'void', 
+                   [param('double const', 'i')])
+    ## basic-data-calculators.h (module 'stats'): long int ns3::MinMaxAvgTotalCalculator<double>::getCount() const [member function]
+    cls.add_method('getCount', 
+                   'long int', 
+                   [], 
+                   is_const=True, is_virtual=True)
+    ## basic-data-calculators.h (module 'stats'): double ns3::MinMaxAvgTotalCalculator<double>::getMax() const [member function]
+    cls.add_method('getMax', 
+                   'double', 
+                   [], 
+                   is_const=True, is_virtual=True)
+    ## basic-data-calculators.h (module 'stats'): double ns3::MinMaxAvgTotalCalculator<double>::getMean() const [member function]
+    cls.add_method('getMean', 
+                   'double', 
+                   [], 
+                   is_const=True, is_virtual=True)
+    ## basic-data-calculators.h (module 'stats'): double ns3::MinMaxAvgTotalCalculator<double>::getMin() const [member function]
+    cls.add_method('getMin', 
+                   'double', 
+                   [], 
+                   is_const=True, is_virtual=True)
+    ## basic-data-calculators.h (module 'stats'): double ns3::MinMaxAvgTotalCalculator<double>::getSqrSum() const [member function]
+    cls.add_method('getSqrSum', 
+                   'double', 
+                   [], 
+                   is_const=True, is_virtual=True)
+    ## basic-data-calculators.h (module 'stats'): double ns3::MinMaxAvgTotalCalculator<double>::getStddev() const [member function]
+    cls.add_method('getStddev', 
+                   'double', 
+                   [], 
+                   is_const=True, is_virtual=True)
+    ## basic-data-calculators.h (module 'stats'): double ns3::MinMaxAvgTotalCalculator<double>::getSum() const [member function]
+    cls.add_method('getSum', 
+                   'double', 
+                   [], 
+                   is_const=True, is_virtual=True)
+    ## basic-data-calculators.h (module 'stats'): double ns3::MinMaxAvgTotalCalculator<double>::getVariance() const [member function]
+    cls.add_method('getVariance', 
+                   'double', 
+                   [], 
+                   is_const=True, is_virtual=True)
+    ## basic-data-calculators.h (module 'stats'): void ns3::MinMaxAvgTotalCalculator<double>::DoDispose() [member function]
+    cls.add_method('DoDispose', 
+                   'void', 
+                   [], 
+                   visibility='protected', is_virtual=True)
+    return
+
 def register_Ns3NixVector_methods(root_module, cls):
     cls.add_output_stream_operator()
     ## nix-vector.h (module 'network'): ns3::NixVector::NixVector() [constructor]
--- a/src/tools/bindings/modulegen__gcc_LP64.py	Wed Apr 11 11:00:27 2012 +0200
+++ b/src/tools/bindings/modulegen__gcc_LP64.py	Wed Apr 11 13:49:33 2012 +0200
@@ -40,6 +40,8 @@
     module.add_class('Item', import_from_module='ns.network', outer_class=root_module['ns3::ByteTagList::Iterator'])
     ## callback.h (module 'core'): ns3::CallbackBase [class]
     module.add_class('CallbackBase', import_from_module='ns.core')
+    ## data-output-interface.h (module 'stats'): ns3::DataOutputCallback [class]
+    module.add_class('DataOutputCallback', allow_subclassing=True, import_from_module='ns.stats')
     ## delay-jitter-estimation.h (module 'tools'): ns3::DelayJitterEstimation [class]
     module.add_class('DelayJitterEstimation')
     ## event-garbage-collector.h (module 'tools'): ns3::EventGarbageCollector [class]
@@ -78,6 +80,8 @@
     module.add_class('SimpleRefCount', automatic_type_narrowing=True, import_from_module='ns.core', template_parameters=['ns3::Object', 'ns3::ObjectBase', 'ns3::ObjectDeleter'], parent=root_module['ns3::ObjectBase'], memory_policy=cppclass.ReferenceCountingMethodsPolicy(incref_method='Ref', decref_method='Unref', peekref_method='GetReferenceCount'))
     ## simulator.h (module 'core'): ns3::Simulator [class]
     module.add_class('Simulator', destructor_visibility='private', import_from_module='ns.core')
+    ## data-calculator.h (module 'stats'): ns3::StatisticalSummary [class]
+    module.add_class('StatisticalSummary', allow_subclassing=True, import_from_module='ns.stats')
     ## tag.h (module 'network'): ns3::Tag [class]
     module.add_class('Tag', import_from_module='ns.network', parent=root_module['ns3::ObjectBase'])
     ## tag-buffer.h (module 'network'): ns3::TagBuffer [class]
@@ -152,10 +156,16 @@
     module.add_class('CallbackImplBase', import_from_module='ns.core', parent=root_module['ns3::SimpleRefCount< ns3::CallbackImplBase, ns3::empty, ns3::DefaultDeleter<ns3::CallbackImplBase> >'])
     ## callback.h (module 'core'): ns3::CallbackValue [class]
     module.add_class('CallbackValue', import_from_module='ns.core', parent=root_module['ns3::AttributeValue'])
+    ## data-calculator.h (module 'stats'): ns3::DataCalculator [class]
+    module.add_class('DataCalculator', import_from_module='ns.stats', parent=root_module['ns3::Object'])
+    ## data-output-interface.h (module 'stats'): ns3::DataOutputInterface [class]
+    module.add_class('DataOutputInterface', import_from_module='ns.stats', parent=root_module['ns3::Object'])
     ## attribute.h (module 'core'): ns3::EmptyAttributeValue [class]
     module.add_class('EmptyAttributeValue', import_from_module='ns.core', parent=root_module['ns3::AttributeValue'])
     ## event-impl.h (module 'core'): ns3::EventImpl [class]
     module.add_class('EventImpl', import_from_module='ns.core', parent=root_module['ns3::SimpleRefCount< ns3::EventImpl, ns3::empty, ns3::DefaultDeleter<ns3::EventImpl> >'])
+    ## basic-data-calculators.h (module 'stats'): ns3::MinMaxAvgTotalCalculator<double> [class]
+    module.add_class('MinMaxAvgTotalCalculator', import_from_module='ns.stats', template_parameters=['double'], parent=[root_module['ns3::DataCalculator'], root_module['ns3::StatisticalSummary']])
     ## nix-vector.h (module 'network'): ns3::NixVector [class]
     module.add_class('NixVector', import_from_module='ns.network', parent=root_module['ns3::SimpleRefCount< ns3::NixVector, ns3::empty, ns3::DefaultDeleter<ns3::NixVector> >'])
     ## object-factory.h (module 'core'): ns3::ObjectFactoryChecker [class]
@@ -194,6 +204,7 @@
     register_Ns3ByteTagListIterator_methods(root_module, root_module['ns3::ByteTagList::Iterator'])
     register_Ns3ByteTagListIteratorItem_methods(root_module, root_module['ns3::ByteTagList::Iterator::Item'])
     register_Ns3CallbackBase_methods(root_module, root_module['ns3::CallbackBase'])
+    register_Ns3DataOutputCallback_methods(root_module, root_module['ns3::DataOutputCallback'])
     register_Ns3DelayJitterEstimation_methods(root_module, root_module['ns3::DelayJitterEstimation'])
     register_Ns3EventGarbageCollector_methods(root_module, root_module['ns3::EventGarbageCollector'])
     register_Ns3EventId_methods(root_module, root_module['ns3::EventId'])
@@ -212,6 +223,7 @@
     register_Ns3PacketTagListTagData_methods(root_module, root_module['ns3::PacketTagList::TagData'])
     register_Ns3SimpleRefCount__Ns3Object_Ns3ObjectBase_Ns3ObjectDeleter_methods(root_module, root_module['ns3::SimpleRefCount< ns3::Object, ns3::ObjectBase, ns3::ObjectDeleter >'])
     register_Ns3Simulator_methods(root_module, root_module['ns3::Simulator'])
+    register_Ns3StatisticalSummary_methods(root_module, root_module['ns3::StatisticalSummary'])
     register_Ns3Tag_methods(root_module, root_module['ns3::Tag'])
     register_Ns3TagBuffer_methods(root_module, root_module['ns3::TagBuffer'])
     register_Ns3TypeId_methods(root_module, root_module['ns3::TypeId'])
@@ -244,8 +256,11 @@
     register_Ns3CallbackChecker_methods(root_module, root_module['ns3::CallbackChecker'])
     register_Ns3CallbackImplBase_methods(root_module, root_module['ns3::CallbackImplBase'])
     register_Ns3CallbackValue_methods(root_module, root_module['ns3::CallbackValue'])
+    register_Ns3DataCalculator_methods(root_module, root_module['ns3::DataCalculator'])
+    register_Ns3DataOutputInterface_methods(root_module, root_module['ns3::DataOutputInterface'])
     register_Ns3EmptyAttributeValue_methods(root_module, root_module['ns3::EmptyAttributeValue'])
     register_Ns3EventImpl_methods(root_module, root_module['ns3::EventImpl'])
+    register_Ns3MinMaxAvgTotalCalculator__Double_methods(root_module, root_module['ns3::MinMaxAvgTotalCalculator< double >'])
     register_Ns3NixVector_methods(root_module, root_module['ns3::NixVector'])
     register_Ns3ObjectFactoryChecker_methods(root_module, root_module['ns3::ObjectFactoryChecker'])
     register_Ns3ObjectFactoryValue_methods(root_module, root_module['ns3::ObjectFactoryValue'])
@@ -664,6 +679,43 @@
                    is_static=True, visibility='protected')
     return
 
+def register_Ns3DataOutputCallback_methods(root_module, cls):
+    ## data-output-interface.h (module 'stats'): ns3::DataOutputCallback::DataOutputCallback() [constructor]
+    cls.add_constructor([])
+    ## data-output-interface.h (module 'stats'): ns3::DataOutputCallback::DataOutputCallback(ns3::DataOutputCallback const & arg0) [copy constructor]
+    cls.add_constructor([param('ns3::DataOutputCallback const &', 'arg0')])
+    ## data-output-interface.h (module 'stats'): void ns3::DataOutputCallback::OutputSingleton(std::string key, std::string variable, int val) [member function]
+    cls.add_method('OutputSingleton', 
+                   'void', 
+                   [param('std::string', 'key'), param('std::string', 'variable'), param('int', 'val')], 
+                   is_pure_virtual=True, is_virtual=True)
+    ## data-output-interface.h (module 'stats'): void ns3::DataOutputCallback::OutputSingleton(std::string key, std::string variable, uint32_t val) [member function]
+    cls.add_method('OutputSingleton', 
+                   'void', 
+                   [param('std::string', 'key'), param('std::string', 'variable'), param('uint32_t', 'val')], 
+                   is_pure_virtual=True, is_virtual=True)
+    ## data-output-interface.h (module 'stats'): void ns3::DataOutputCallback::OutputSingleton(std::string key, std::string variable, double val) [member function]
+    cls.add_method('OutputSingleton', 
+                   'void', 
+                   [param('std::string', 'key'), param('std::string', 'variable'), param('double', 'val')], 
+                   is_pure_virtual=True, is_virtual=True)
+    ## data-output-interface.h (module 'stats'): void ns3::DataOutputCallback::OutputSingleton(std::string key, std::string variable, std::string val) [member function]
+    cls.add_method('OutputSingleton', 
+                   'void', 
+                   [param('std::string', 'key'), param('std::string', 'variable'), param('std::string', 'val')], 
+                   is_pure_virtual=True, is_virtual=True)
+    ## data-output-interface.h (module 'stats'): void ns3::DataOutputCallback::OutputSingleton(std::string key, std::string variable, ns3::Time val) [member function]
+    cls.add_method('OutputSingleton', 
+                   'void', 
+                   [param('std::string', 'key'), param('std::string', 'variable'), param('ns3::Time', 'val')], 
+                   is_pure_virtual=True, is_virtual=True)
+    ## data-output-interface.h (module 'stats'): void ns3::DataOutputCallback::OutputStatistic(std::string key, std::string variable, ns3::StatisticalSummary const * statSum) [member function]
+    cls.add_method('OutputStatistic', 
+                   'void', 
+                   [param('std::string', 'key'), param('std::string', 'variable'), param('ns3::StatisticalSummary const *', 'statSum')], 
+                   is_pure_virtual=True, is_virtual=True)
+    return
+
 def register_Ns3DelayJitterEstimation_methods(root_module, cls):
     ## delay-jitter-estimation.h (module 'tools'): ns3::DelayJitterEstimation::DelayJitterEstimation(ns3::DelayJitterEstimation const & arg0) [copy constructor]
     cls.add_constructor([param('ns3::DelayJitterEstimation const &', 'arg0')])
@@ -1230,6 +1282,53 @@
                    is_static=True)
     return
 
+def register_Ns3StatisticalSummary_methods(root_module, cls):
+    ## data-calculator.h (module 'stats'): ns3::StatisticalSummary::StatisticalSummary() [constructor]
+    cls.add_constructor([])
+    ## data-calculator.h (module 'stats'): ns3::StatisticalSummary::StatisticalSummary(ns3::StatisticalSummary const & arg0) [copy constructor]
+    cls.add_constructor([param('ns3::StatisticalSummary const &', 'arg0')])
+    ## data-calculator.h (module 'stats'): long int ns3::StatisticalSummary::getCount() const [member function]
+    cls.add_method('getCount', 
+                   'long int', 
+                   [], 
+                   is_pure_virtual=True, is_const=True, is_virtual=True)
+    ## data-calculator.h (module 'stats'): double ns3::StatisticalSummary::getMax() const [member function]
+    cls.add_method('getMax', 
+                   'double', 
+                   [], 
+                   is_pure_virtual=True, is_const=True, is_virtual=True)
+    ## data-calculator.h (module 'stats'): double ns3::StatisticalSummary::getMean() const [member function]
+    cls.add_method('getMean', 
+                   'double', 
+                   [], 
+                   is_pure_virtual=True, is_const=True, is_virtual=True)
+    ## data-calculator.h (module 'stats'): double ns3::StatisticalSummary::getMin() const [member function]
+    cls.add_method('getMin', 
+                   'double', 
+                   [], 
+                   is_pure_virtual=True, is_const=True, is_virtual=True)
+    ## data-calculator.h (module 'stats'): double ns3::StatisticalSummary::getSqrSum() const [member function]
+    cls.add_method('getSqrSum', 
+                   'double', 
+                   [], 
+                   is_pure_virtual=True, is_const=True, is_virtual=True)
+    ## data-calculator.h (module 'stats'): double ns3::StatisticalSummary::getStddev() const [member function]
+    cls.add_method('getStddev', 
+                   'double', 
+                   [], 
+                   is_pure_virtual=True, is_const=True, is_virtual=True)
+    ## data-calculator.h (module 'stats'): double ns3::StatisticalSummary::getSum() const [member function]
+    cls.add_method('getSum', 
+                   'double', 
+                   [], 
+                   is_pure_virtual=True, is_const=True, is_virtual=True)
+    ## data-calculator.h (module 'stats'): double ns3::StatisticalSummary::getVariance() const [member function]
+    cls.add_method('getVariance', 
+                   'double', 
+                   [], 
+                   is_pure_virtual=True, is_const=True, is_virtual=True)
+    return
+
 def register_Ns3Tag_methods(root_module, cls):
     ## tag.h (module 'network'): ns3::Tag::Tag() [constructor]
     cls.add_constructor([])
@@ -2271,6 +2370,90 @@
                    [param('ns3::CallbackBase', 'base')])
     return
 
+def register_Ns3DataCalculator_methods(root_module, cls):
+    ## data-calculator.h (module 'stats'): ns3::DataCalculator::DataCalculator(ns3::DataCalculator const & arg0) [copy constructor]
+    cls.add_constructor([param('ns3::DataCalculator const &', 'arg0')])
+    ## data-calculator.h (module 'stats'): ns3::DataCalculator::DataCalculator() [constructor]
+    cls.add_constructor([])
+    ## data-calculator.h (module 'stats'): void ns3::DataCalculator::Disable() [member function]
+    cls.add_method('Disable', 
+                   'void', 
+                   [])
+    ## data-calculator.h (module 'stats'): void ns3::DataCalculator::Enable() [member function]
+    cls.add_method('Enable', 
+                   'void', 
+                   [])
+    ## data-calculator.h (module 'stats'): std::string ns3::DataCalculator::GetContext() const [member function]
+    cls.add_method('GetContext', 
+                   'std::string', 
+                   [], 
+                   is_const=True)
+    ## data-calculator.h (module 'stats'): bool ns3::DataCalculator::GetEnabled() const [member function]
+    cls.add_method('GetEnabled', 
+                   'bool', 
+                   [], 
+                   is_const=True)
+    ## data-calculator.h (module 'stats'): std::string ns3::DataCalculator::GetKey() const [member function]
+    cls.add_method('GetKey', 
+                   'std::string', 
+                   [], 
+                   is_const=True)
+    ## data-calculator.h (module 'stats'): void ns3::DataCalculator::Output(ns3::DataOutputCallback & callback) const [member function]
+    cls.add_method('Output', 
+                   'void', 
+                   [param('ns3::DataOutputCallback &', 'callback')], 
+                   is_pure_virtual=True, is_const=True, is_virtual=True)
+    ## data-calculator.h (module 'stats'): void ns3::DataCalculator::SetContext(std::string const context) [member function]
+    cls.add_method('SetContext', 
+                   'void', 
+                   [param('std::string const', 'context')])
+    ## data-calculator.h (module 'stats'): void ns3::DataCalculator::SetKey(std::string const key) [member function]
+    cls.add_method('SetKey', 
+                   'void', 
+                   [param('std::string const', 'key')])
+    ## data-calculator.h (module 'stats'): void ns3::DataCalculator::Start(ns3::Time const & startTime) [member function]
+    cls.add_method('Start', 
+                   'void', 
+                   [param('ns3::Time const &', 'startTime')], 
+                   is_virtual=True)
+    ## data-calculator.h (module 'stats'): void ns3::DataCalculator::Stop(ns3::Time const & stopTime) [member function]
+    cls.add_method('Stop', 
+                   'void', 
+                   [param('ns3::Time const &', 'stopTime')], 
+                   is_virtual=True)
+    ## data-calculator.h (module 'stats'): void ns3::DataCalculator::DoDispose() [member function]
+    cls.add_method('DoDispose', 
+                   'void', 
+                   [], 
+                   visibility='protected', is_virtual=True)
+    return
+
+def register_Ns3DataOutputInterface_methods(root_module, cls):
+    ## data-output-interface.h (module 'stats'): ns3::DataOutputInterface::DataOutputInterface(ns3::DataOutputInterface const & arg0) [copy constructor]
+    cls.add_constructor([param('ns3::DataOutputInterface const &', 'arg0')])
+    ## data-output-interface.h (module 'stats'): ns3::DataOutputInterface::DataOutputInterface() [constructor]
+    cls.add_constructor([])
+    ## data-output-interface.h (module 'stats'): std::string ns3::DataOutputInterface::GetFilePrefix() const [member function]
+    cls.add_method('GetFilePrefix', 
+                   'std::string', 
+                   [], 
+                   is_const=True)
+    ## data-output-interface.h (module 'stats'): void ns3::DataOutputInterface::Output(ns3::DataCollector & dc) [member function]
+    cls.add_method('Output', 
+                   'void', 
+                   [param('ns3::DataCollector &', 'dc')], 
+                   is_pure_virtual=True, is_virtual=True)
+    ## data-output-interface.h (module 'stats'): void ns3::DataOutputInterface::SetFilePrefix(std::string const prefix) [member function]
+    cls.add_method('SetFilePrefix', 
+                   'void', 
+                   [param('std::string const', 'prefix')])
+    ## data-output-interface.h (module 'stats'): void ns3::DataOutputInterface::DoDispose() [member function]
+    cls.add_method('DoDispose', 
+                   'void', 
+                   [], 
+                   visibility='protected', is_virtual=True)
+    return
+
 def register_Ns3EmptyAttributeValue_methods(root_module, cls):
     ## attribute.h (module 'core'): ns3::EmptyAttributeValue::EmptyAttributeValue(ns3::EmptyAttributeValue const & arg0) [copy constructor]
     cls.add_constructor([param('ns3::EmptyAttributeValue const &', 'arg0')])
@@ -2317,6 +2500,71 @@
                    is_pure_virtual=True, visibility='protected', is_virtual=True)
     return
 
+def register_Ns3MinMaxAvgTotalCalculator__Double_methods(root_module, cls):
+    ## basic-data-calculators.h (module 'stats'): ns3::MinMaxAvgTotalCalculator<double>::MinMaxAvgTotalCalculator(ns3::MinMaxAvgTotalCalculator<double> const & arg0) [copy constructor]
+    cls.add_constructor([param('ns3::MinMaxAvgTotalCalculator< double > const &', 'arg0')])
+    ## basic-data-calculators.h (module 'stats'): ns3::MinMaxAvgTotalCalculator<double>::MinMaxAvgTotalCalculator() [constructor]
+    cls.add_constructor([])
+    ## basic-data-calculators.h (module 'stats'): void ns3::MinMaxAvgTotalCalculator<double>::Output(ns3::DataOutputCallback & callback) const [member function]
+    cls.add_method('Output', 
+                   'void', 
+                   [param('ns3::DataOutputCallback &', 'callback')], 
+                   is_const=True, is_virtual=True)
+    ## basic-data-calculators.h (module 'stats'): void ns3::MinMaxAvgTotalCalculator<double>::Reset() [member function]
+    cls.add_method('Reset', 
+                   'void', 
+                   [])
+    ## basic-data-calculators.h (module 'stats'): void ns3::MinMaxAvgTotalCalculator<double>::Update(double const i) [member function]
+    cls.add_method('Update', 
+                   'void', 
+                   [param('double const', 'i')])
+    ## basic-data-calculators.h (module 'stats'): long int ns3::MinMaxAvgTotalCalculator<double>::getCount() const [member function]
+    cls.add_method('getCount', 
+                   'long int', 
+                   [], 
+                   is_const=True, is_virtual=True)
+    ## basic-data-calculators.h (module 'stats'): double ns3::MinMaxAvgTotalCalculator<double>::getMax() const [member function]
+    cls.add_method('getMax', 
+                   'double', 
+                   [], 
+                   is_const=True, is_virtual=True)
+    ## basic-data-calculators.h (module 'stats'): double ns3::MinMaxAvgTotalCalculator<double>::getMean() const [member function]
+    cls.add_method('getMean', 
+                   'double', 
+                   [], 
+                   is_const=True, is_virtual=True)
+    ## basic-data-calculators.h (module 'stats'): double ns3::MinMaxAvgTotalCalculator<double>::getMin() const [member function]
+    cls.add_method('getMin', 
+                   'double', 
+                   [], 
+                   is_const=True, is_virtual=True)
+    ## basic-data-calculators.h (module 'stats'): double ns3::MinMaxAvgTotalCalculator<double>::getSqrSum() const [member function]
+    cls.add_method('getSqrSum', 
+                   'double', 
+                   [], 
+                   is_const=True, is_virtual=True)
+    ## basic-data-calculators.h (module 'stats'): double ns3::MinMaxAvgTotalCalculator<double>::getStddev() const [member function]
+    cls.add_method('getStddev', 
+                   'double', 
+                   [], 
+                   is_const=True, is_virtual=True)
+    ## basic-data-calculators.h (module 'stats'): double ns3::MinMaxAvgTotalCalculator<double>::getSum() const [member function]
+    cls.add_method('getSum', 
+                   'double', 
+                   [], 
+                   is_const=True, is_virtual=True)
+    ## basic-data-calculators.h (module 'stats'): double ns3::MinMaxAvgTotalCalculator<double>::getVariance() const [member function]
+    cls.add_method('getVariance', 
+                   'double', 
+                   [], 
+                   is_const=True, is_virtual=True)
+    ## basic-data-calculators.h (module 'stats'): void ns3::MinMaxAvgTotalCalculator<double>::DoDispose() [member function]
+    cls.add_method('DoDispose', 
+                   'void', 
+                   [], 
+                   visibility='protected', is_virtual=True)
+    return
+
 def register_Ns3NixVector_methods(root_module, cls):
     cls.add_output_stream_operator()
     ## nix-vector.h (module 'network'): ns3::NixVector::NixVector() [constructor]
--- a/src/tools/model/average.h	Wed Apr 11 11:00:27 2012 +0200
+++ b/src/tools/model/average.h	Wed Apr 11 13:49:33 2012 +0200
@@ -25,6 +25,7 @@
 #include <ostream>
 #include <limits>
 #include <stdint.h>
+#include "ns3/basic-data-calculators.h"
 
 namespace ns3 {
 
@@ -45,28 +46,28 @@
 {
 public:
   Average ()
-    : m_size (0), m_min (std::numeric_limits<T>::max ()), m_max (0),
-      m_avg (0), m_avg2 (0) 
+    : m_size (0), m_min (std::numeric_limits<T>::max ()), m_max (0)
   {
   }
 
   /// Add new sample
   void Update (T const & x)
   {
+    // Give the variance calculator the next value.
+    m_varianceCalculator.Update (x);
+
     m_min = std::min (x, m_min);
     m_max = std::max (x, m_max);
-    m_avg = (m_size * m_avg + x) / (m_size + 1);
-    m_avg2 = (m_size * m_avg2 + x * x) / (m_size + 1);
     m_size++;
   }
   /// Reset statistics
   void Reset ()
   {
+    m_varianceCalculator.Reset ();
+
     m_size = 0;
     m_min = std::numeric_limits<T>::max ();
     m_max = 0;
-    m_avg = 0;
-    m_avg2 = 0;
   }
 
   ///\name Sample statistics
@@ -78,11 +79,11 @@
   /// Maximum
   T        Max     () const { return m_max; }
   /// Sample average
-  double   Avg     () const { return m_avg; }
+  double   Avg     () const { return m_varianceCalculator.getMean ();}
   /// Estimate of mean, alias to Avg
   double   Mean    () const { return Avg (); }
   /// Unbiased estimate of variance
-  double   Var     () const { return Count () / (double)(Count () - 1) * (m_avg2 - m_avg*m_avg); }
+  double   Var     () const { return m_varianceCalculator.getVariance ();}
   /// Standard deviation
   double   Stddev  () const { return sqrt (Var ()); }
   //\}
@@ -107,7 +108,7 @@
 private:
   uint32_t m_size;
   T      m_min, m_max;
-  double m_avg, m_avg2;
+  MinMaxAvgTotalCalculator<double> m_varianceCalculator;
 };
 
 /// Print avg (err) [min, max]
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/tools/test/average-test-suite.cc	Wed Apr 11 13:49:33 2012 +0200
@@ -0,0 +1,272 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/*
+ * Copyright (c) 2012 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
+ *
+ * Author: Mitch Watrous (watrous@u.washington.edu)
+ */
+
+#include <math.h>
+
+#include "ns3/test.h"
+#include "ns3/average.h"
+
+using namespace ns3;
+
+const double TOLERANCE = 1e-14;
+
+// ===========================================================================
+// Test case for a single integer.
+// ===========================================================================
+
+class OneIntegerTestCase : public TestCase
+{
+public:
+  OneIntegerTestCase ();
+  virtual ~OneIntegerTestCase ();
+
+private:
+  virtual void DoRun (void);
+};
+
+OneIntegerTestCase::OneIntegerTestCase ()
+  : TestCase ("Average Object Test using One Integer")
+
+{
+}
+
+OneIntegerTestCase::~OneIntegerTestCase ()
+{
+}
+
+void
+OneIntegerTestCase::DoRun (void)
+{
+  Average<int> calculator;
+
+  long count = 1;
+
+  double sum = 0;
+  double sqrSum = 0;
+  double min;
+  double max;
+  double mean;
+  double stddev;
+  double variance;
+
+  // Put all of the values into the calculator.
+  int multiple = 5;
+  int value;
+  for (long i = 0; i < count; i++)
+    {
+      value = multiple * (i + 1);
+
+      calculator.Update (value);
+
+      sum    += value;
+      sqrSum += value * value;
+    }
+
+  // Calculate the expected values for the statistical functions.
+  min = multiple;
+  max = multiple * count;
+  mean = sum / count;
+  if (count == 1)
+    {
+      variance = 0;
+    }
+  else
+    {
+      variance = (count * sqrSum - sum * sum) / (count * (count - 1));
+    }
+  stddev = sqrt (variance);
+
+  // Test the calculator.
+  NS_TEST_ASSERT_MSG_EQ_TOL (calculator.Count (),    count,    TOLERANCE, "Count value wrong");
+  NS_TEST_ASSERT_MSG_EQ_TOL (calculator.Min (),      min,      TOLERANCE, "Min value wrong");
+  NS_TEST_ASSERT_MSG_EQ_TOL (calculator.Max (),      max,      TOLERANCE, "Max value wrong");
+  NS_TEST_ASSERT_MSG_EQ_TOL (calculator.Mean (),     mean,     TOLERANCE, "Mean value wrong");
+  NS_TEST_ASSERT_MSG_EQ_TOL (calculator.Stddev (),   stddev,   TOLERANCE, "Stddev value wrong");
+  NS_TEST_ASSERT_MSG_EQ_TOL (calculator.Var (), variance, TOLERANCE, "Variance value wrong");
+}
+
+
+// ===========================================================================
+// Test case for five integers.
+// ===========================================================================
+
+class FiveIntegersTestCase : public TestCase
+{
+public:
+  FiveIntegersTestCase ();
+  virtual ~FiveIntegersTestCase ();
+
+private:
+  virtual void DoRun (void);
+};
+
+FiveIntegersTestCase::FiveIntegersTestCase ()
+  : TestCase ("Average Object Test using Five Integers")
+
+{
+}
+
+FiveIntegersTestCase::~FiveIntegersTestCase ()
+{
+}
+
+void
+FiveIntegersTestCase::DoRun (void)
+{
+  Average<int> calculator;
+
+  long count = 5;
+
+  double sum = 0;
+  double sqrSum = 0;
+  double min;
+  double max;
+  double mean;
+  double stddev;
+  double variance;
+
+  // Put all of the values into the calculator.
+  int multiple = 5;
+  int value;
+  for (long i = 0; i < count; i++)
+    {
+      value = multiple * (i + 1);
+
+      calculator.Update (value);
+
+      sum    += value;
+      sqrSum += value * value;
+    }
+
+  // Calculate the expected values for the statistical functions.
+  min = multiple;
+  max = multiple * count;
+  mean = sum / count;
+  if (count == 1)
+    {
+      variance = 0;
+    }
+  else
+    {
+      variance = (count * sqrSum - sum * sum) / (count * (count - 1));
+    }
+  stddev = sqrt (variance);
+
+  // Test the calculator.
+  NS_TEST_ASSERT_MSG_EQ_TOL (calculator.Count (),    count,    TOLERANCE, "Count value wrong");
+  NS_TEST_ASSERT_MSG_EQ_TOL (calculator.Min (),      min,      TOLERANCE, "Min value wrong");
+  NS_TEST_ASSERT_MSG_EQ_TOL (calculator.Max (),      max,      TOLERANCE, "Max value wrong");
+  NS_TEST_ASSERT_MSG_EQ_TOL (calculator.Mean (),     mean,     TOLERANCE, "Mean value wrong");
+  NS_TEST_ASSERT_MSG_EQ_TOL (calculator.Stddev (),   stddev,   TOLERANCE, "Stddev value wrong");
+  NS_TEST_ASSERT_MSG_EQ_TOL (calculator.Var (), variance, TOLERANCE, "Variance value wrong");
+}
+
+
+// ===========================================================================
+// Test case for five double values.
+// ===========================================================================
+
+class FiveDoublesTestCase : public TestCase
+{
+public:
+  FiveDoublesTestCase ();
+  virtual ~FiveDoublesTestCase ();
+
+private:
+  virtual void DoRun (void);
+};
+
+FiveDoublesTestCase::FiveDoublesTestCase ()
+  : TestCase ("Average Object Test using Five Double Values")
+
+{
+}
+
+FiveDoublesTestCase::~FiveDoublesTestCase ()
+{
+}
+
+void
+FiveDoublesTestCase::DoRun (void)
+{
+  Average<double> calculator;
+
+  long count = 5;
+
+  double sum = 0;
+  double sqrSum = 0;
+  double min;
+  double max;
+  double mean;
+  double stddev;
+  double variance;
+
+  // Put all of the values into the calculator.
+  double multiple = 3.14;
+  double value;
+  for (long i = 0; i < count; i++)
+    {
+      value = multiple * (i + 1);
+
+      calculator.Update (value);
+
+      sum    += value;
+      sqrSum += value * value;
+    }
+
+  // Calculate the expected values for the statistical functions.
+  min = multiple;
+  max = multiple * count;
+  mean = sum / count;
+  if (count == 1)
+    {
+      variance = 0;
+    }
+  else
+    {
+      variance = (count * sqrSum - sum * sum) / (count * (count - 1));
+    }
+  stddev = sqrt (variance);
+
+  // Test the calculator.
+  NS_TEST_ASSERT_MSG_EQ_TOL (calculator.Count (),    count,    TOLERANCE, "Count value wrong");
+  NS_TEST_ASSERT_MSG_EQ_TOL (calculator.Min (),      min,      TOLERANCE, "Min value wrong");
+  NS_TEST_ASSERT_MSG_EQ_TOL (calculator.Max (),      max,      TOLERANCE, "Max value wrong");
+  NS_TEST_ASSERT_MSG_EQ_TOL (calculator.Mean (),     mean,     TOLERANCE, "Mean value wrong");
+  NS_TEST_ASSERT_MSG_EQ_TOL (calculator.Stddev (),   stddev,   TOLERANCE, "Stddev value wrong");
+  NS_TEST_ASSERT_MSG_EQ_TOL (calculator.Var (), variance, TOLERANCE, "Variance value wrong");
+}
+
+
+class AverageTestSuite : public TestSuite
+{
+public:
+  AverageTestSuite ();
+};
+
+AverageTestSuite::AverageTestSuite ()
+  : TestSuite ("average", UNIT)
+{
+  AddTestCase (new OneIntegerTestCase);
+  AddTestCase (new FiveIntegersTestCase);
+  AddTestCase (new FiveDoublesTestCase);
+}
+
+static AverageTestSuite averageTestSuite;
--- a/src/tools/wscript	Wed Apr 11 11:00:27 2012 +0200
+++ b/src/tools/wscript	Wed Apr 11 13:49:33 2012 +0200
@@ -2,7 +2,7 @@
 
 def build(bld):
 
-    module = bld.create_ns3_module('tools', ['network'])
+    module = bld.create_ns3_module('tools', ['network', 'stats'])
     module.source = [
         'model/event-garbage-collector.cc',
         'model/gnuplot.cc',
@@ -11,6 +11,7 @@
 
     module_test = bld.create_ns3_module_test_library('tools')
     module_test.source = [
+        'test/average-test-suite.cc',
         'test/event-garbage-collector-test-suite.cc',
         ]
     
--- a/src/visualizer/model/visual-simulator-impl.cc	Wed Apr 11 11:00:27 2012 +0200
+++ b/src/visualizer/model/visual-simulator-impl.cc	Wed Apr 11 13:49:33 2012 +0200
@@ -109,12 +109,6 @@
   return m_simulator->IsFinished ();
 }
 
-Time
-VisualSimulatorImpl::Next (void) const
-{
-  return m_simulator->Next ();
-}
-
 void
 VisualSimulatorImpl::Run (void)
 {
@@ -130,12 +124,6 @@
     );
 }
 
-void
-VisualSimulatorImpl::RunOneEvent (void)
-{
-  m_simulator->RunOneEvent ();
-}
-
 void 
 VisualSimulatorImpl::Stop (void)
 {
--- a/src/visualizer/model/visual-simulator-impl.h	Wed Apr 11 11:00:27 2012 +0200
+++ b/src/visualizer/model/visual-simulator-impl.h	Wed Apr 11 13:49:33 2012 +0200
@@ -51,7 +51,6 @@
 
   virtual void Destroy ();
   virtual bool IsFinished (void) const;
-  virtual Time Next (void) const;
   virtual void Stop (void);
   virtual void Stop (Time const &time);
   virtual EventId Schedule (Time const &time, EventImpl *event);
@@ -62,7 +61,6 @@
   virtual void Cancel (const EventId &ev);
   virtual bool IsExpired (const EventId &ev) const;
   virtual void Run (void);
-  virtual void RunOneEvent (void);
   virtual Time Now (void) const;
   virtual Time GetDelayLeft (const EventId &id) const;
   virtual Time GetMaximumSimulationTime (void) const;
--- a/src/visualizer/visualizer/core.py	Wed Apr 11 11:00:27 2012 +0200
+++ b/src/visualizer/visualizer/core.py	Wed Apr 11 13:49:33 2012 +0200
@@ -162,7 +162,13 @@
             ns3_node = ns.network.NodeList.GetNode(self.node_index)
             ipv4 = ns3_node.GetObject(ns.internet.Ipv4.GetTypeId())
             ipv6 = ns3_node.GetObject(ns.internet.Ipv6.GetTypeId())
-            lines = ['<b><u>Node %i</u></b>' % self.node_index]
+        
+            name = '<b><u>Node %i</u></b>' % self.node_index
+            node_name = ns.core.Names.FindName (ns3_node)
+            if len(node_name)!=0:
+                name += ' <b>(' + node_name + ')</b>'
+
+            lines = [name]
             lines.append('')
 
             self.emit("query-extra-tooltip-info", lines)
--- a/src/wimax/bindings/modulegen__gcc_ILP32.py	Wed Apr 11 11:00:27 2012 +0200
+++ b/src/wimax/bindings/modulegen__gcc_ILP32.py	Wed Apr 11 13:49:33 2012 +0200
@@ -364,6 +364,8 @@
     module.add_class('WimaxConnection', parent=root_module['ns3::Object'])
     ## wimax-mac-queue.h (module 'wimax'): ns3::WimaxMacQueue [class]
     module.add_class('WimaxMacQueue', parent=root_module['ns3::Object'])
+    ## wimax-mac-queue.h (module 'wimax'): ns3::WimaxMacQueue::QueueElement [struct]
+    module.add_class('QueueElement', outer_class=root_module['ns3::WimaxMacQueue'])
     ## wimax-mac-to-mac-header.h (module 'wimax'): ns3::WimaxMacToMacHeader [class]
     module.add_class('WimaxMacToMacHeader', parent=root_module['ns3::Header'])
     ## wimax-phy.h (module 'wimax'): ns3::WimaxPhy [class]
@@ -704,6 +706,7 @@
     register_Ns3UplinkSchedulerSimple_methods(root_module, root_module['ns3::UplinkSchedulerSimple'])
     register_Ns3WimaxConnection_methods(root_module, root_module['ns3::WimaxConnection'])
     register_Ns3WimaxMacQueue_methods(root_module, root_module['ns3::WimaxMacQueue'])
+    register_Ns3WimaxMacQueueQueueElement_methods(root_module, root_module['ns3::WimaxMacQueue::QueueElement'])
     register_Ns3WimaxMacToMacHeader_methods(root_module, root_module['ns3::WimaxMacToMacHeader'])
     register_Ns3WimaxPhy_methods(root_module, root_module['ns3::WimaxPhy'])
     register_Ns3AttributeAccessor_methods(root_module, root_module['ns3::AttributeAccessor'])
@@ -7643,6 +7646,46 @@
                    [param('uint32_t', 'maxSize')])
     return
 
+def register_Ns3WimaxMacQueueQueueElement_methods(root_module, cls):
+    ## wimax-mac-queue.h (module 'wimax'): ns3::WimaxMacQueue::QueueElement::QueueElement(ns3::WimaxMacQueue::QueueElement const & arg0) [copy constructor]
+    cls.add_constructor([param('ns3::WimaxMacQueue::QueueElement const &', 'arg0')])
+    ## wimax-mac-queue.h (module 'wimax'): ns3::WimaxMacQueue::QueueElement::QueueElement() [constructor]
+    cls.add_constructor([])
+    ## wimax-mac-queue.h (module 'wimax'): ns3::WimaxMacQueue::QueueElement::QueueElement(ns3::Ptr<ns3::Packet> packet, ns3::MacHeaderType const & hdrType, ns3::GenericMacHeader const & hdr, ns3::Time timeStamp) [constructor]
+    cls.add_constructor([param('ns3::Ptr< ns3::Packet >', 'packet'), param('ns3::MacHeaderType const &', 'hdrType'), param('ns3::GenericMacHeader const &', 'hdr'), param('ns3::Time', 'timeStamp')])
+    ## wimax-mac-queue.h (module 'wimax'): uint32_t ns3::WimaxMacQueue::QueueElement::GetSize() const [member function]
+    cls.add_method('GetSize', 
+                   'uint32_t', 
+                   [], 
+                   is_const=True)
+    ## wimax-mac-queue.h (module 'wimax'): void ns3::WimaxMacQueue::QueueElement::SetFragmentNumber() [member function]
+    cls.add_method('SetFragmentNumber', 
+                   'void', 
+                   [])
+    ## wimax-mac-queue.h (module 'wimax'): void ns3::WimaxMacQueue::QueueElement::SetFragmentOffset(uint32_t offset) [member function]
+    cls.add_method('SetFragmentOffset', 
+                   'void', 
+                   [param('uint32_t', 'offset')])
+    ## wimax-mac-queue.h (module 'wimax'): void ns3::WimaxMacQueue::QueueElement::SetFragmentation() [member function]
+    cls.add_method('SetFragmentation', 
+                   'void', 
+                   [])
+    ## wimax-mac-queue.h (module 'wimax'): ns3::WimaxMacQueue::QueueElement::m_fragmentNumber [variable]
+    cls.add_instance_attribute('m_fragmentNumber', 'uint32_t', is_const=False)
+    ## wimax-mac-queue.h (module 'wimax'): ns3::WimaxMacQueue::QueueElement::m_fragmentOffset [variable]
+    cls.add_instance_attribute('m_fragmentOffset', 'uint32_t', is_const=False)
+    ## wimax-mac-queue.h (module 'wimax'): ns3::WimaxMacQueue::QueueElement::m_fragmentation [variable]
+    cls.add_instance_attribute('m_fragmentation', 'bool', is_const=False)
+    ## wimax-mac-queue.h (module 'wimax'): ns3::WimaxMacQueue::QueueElement::m_hdr [variable]
+    cls.add_instance_attribute('m_hdr', 'ns3::GenericMacHeader', is_const=False)
+    ## wimax-mac-queue.h (module 'wimax'): ns3::WimaxMacQueue::QueueElement::m_hdrType [variable]
+    cls.add_instance_attribute('m_hdrType', 'ns3::MacHeaderType', is_const=False)
+    ## wimax-mac-queue.h (module 'wimax'): ns3::WimaxMacQueue::QueueElement::m_packet [variable]
+    cls.add_instance_attribute('m_packet', 'ns3::Ptr< ns3::Packet >', is_const=False)
+    ## wimax-mac-queue.h (module 'wimax'): ns3::WimaxMacQueue::QueueElement::m_timeStamp [variable]
+    cls.add_instance_attribute('m_timeStamp', 'ns3::Time', is_const=False)
+    return
+
 def register_Ns3WimaxMacToMacHeader_methods(root_module, cls):
     ## wimax-mac-to-mac-header.h (module 'wimax'): ns3::WimaxMacToMacHeader::WimaxMacToMacHeader(ns3::WimaxMacToMacHeader const & arg0) [copy constructor]
     cls.add_constructor([param('ns3::WimaxMacToMacHeader const &', 'arg0')])
--- a/src/wimax/bindings/modulegen__gcc_LP64.py	Wed Apr 11 11:00:27 2012 +0200
+++ b/src/wimax/bindings/modulegen__gcc_LP64.py	Wed Apr 11 13:49:33 2012 +0200
@@ -364,6 +364,8 @@
     module.add_class('WimaxConnection', parent=root_module['ns3::Object'])
     ## wimax-mac-queue.h (module 'wimax'): ns3::WimaxMacQueue [class]
     module.add_class('WimaxMacQueue', parent=root_module['ns3::Object'])
+    ## wimax-mac-queue.h (module 'wimax'): ns3::WimaxMacQueue::QueueElement [struct]
+    module.add_class('QueueElement', outer_class=root_module['ns3::WimaxMacQueue'])
     ## wimax-mac-to-mac-header.h (module 'wimax'): ns3::WimaxMacToMacHeader [class]
     module.add_class('WimaxMacToMacHeader', parent=root_module['ns3::Header'])
     ## wimax-phy.h (module 'wimax'): ns3::WimaxPhy [class]
@@ -704,6 +706,7 @@
     register_Ns3UplinkSchedulerSimple_methods(root_module, root_module['ns3::UplinkSchedulerSimple'])
     register_Ns3WimaxConnection_methods(root_module, root_module['ns3::WimaxConnection'])
     register_Ns3WimaxMacQueue_methods(root_module, root_module['ns3::WimaxMacQueue'])
+    register_Ns3WimaxMacQueueQueueElement_methods(root_module, root_module['ns3::WimaxMacQueue::QueueElement'])
     register_Ns3WimaxMacToMacHeader_methods(root_module, root_module['ns3::WimaxMacToMacHeader'])
     register_Ns3WimaxPhy_methods(root_module, root_module['ns3::WimaxPhy'])
     register_Ns3AttributeAccessor_methods(root_module, root_module['ns3::AttributeAccessor'])
@@ -7643,6 +7646,46 @@
                    [param('uint32_t', 'maxSize')])
     return
 
+def register_Ns3WimaxMacQueueQueueElement_methods(root_module, cls):
+    ## wimax-mac-queue.h (module 'wimax'): ns3::WimaxMacQueue::QueueElement::QueueElement(ns3::WimaxMacQueue::QueueElement const & arg0) [copy constructor]
+    cls.add_constructor([param('ns3::WimaxMacQueue::QueueElement const &', 'arg0')])
+    ## wimax-mac-queue.h (module 'wimax'): ns3::WimaxMacQueue::QueueElement::QueueElement() [constructor]
+    cls.add_constructor([])
+    ## wimax-mac-queue.h (module 'wimax'): ns3::WimaxMacQueue::QueueElement::QueueElement(ns3::Ptr<ns3::Packet> packet, ns3::MacHeaderType const & hdrType, ns3::GenericMacHeader const & hdr, ns3::Time timeStamp) [constructor]
+    cls.add_constructor([param('ns3::Ptr< ns3::Packet >', 'packet'), param('ns3::MacHeaderType const &', 'hdrType'), param('ns3::GenericMacHeader const &', 'hdr'), param('ns3::Time', 'timeStamp')])
+    ## wimax-mac-queue.h (module 'wimax'): uint32_t ns3::WimaxMacQueue::QueueElement::GetSize() const [member function]
+    cls.add_method('GetSize', 
+                   'uint32_t', 
+                   [], 
+                   is_const=True)
+    ## wimax-mac-queue.h (module 'wimax'): void ns3::WimaxMacQueue::QueueElement::SetFragmentNumber() [member function]
+    cls.add_method('SetFragmentNumber', 
+                   'void', 
+                   [])
+    ## wimax-mac-queue.h (module 'wimax'): void ns3::WimaxMacQueue::QueueElement::SetFragmentOffset(uint32_t offset) [member function]
+    cls.add_method('SetFragmentOffset', 
+                   'void', 
+                   [param('uint32_t', 'offset')])
+    ## wimax-mac-queue.h (module 'wimax'): void ns3::WimaxMacQueue::QueueElement::SetFragmentation() [member function]
+    cls.add_method('SetFragmentation', 
+                   'void', 
+                   [])
+    ## wimax-mac-queue.h (module 'wimax'): ns3::WimaxMacQueue::QueueElement::m_fragmentNumber [variable]
+    cls.add_instance_attribute('m_fragmentNumber', 'uint32_t', is_const=False)
+    ## wimax-mac-queue.h (module 'wimax'): ns3::WimaxMacQueue::QueueElement::m_fragmentOffset [variable]
+    cls.add_instance_attribute('m_fragmentOffset', 'uint32_t', is_const=False)
+    ## wimax-mac-queue.h (module 'wimax'): ns3::WimaxMacQueue::QueueElement::m_fragmentation [variable]
+    cls.add_instance_attribute('m_fragmentation', 'bool', is_const=False)
+    ## wimax-mac-queue.h (module 'wimax'): ns3::WimaxMacQueue::QueueElement::m_hdr [variable]
+    cls.add_instance_attribute('m_hdr', 'ns3::GenericMacHeader', is_const=False)
+    ## wimax-mac-queue.h (module 'wimax'): ns3::WimaxMacQueue::QueueElement::m_hdrType [variable]
+    cls.add_instance_attribute('m_hdrType', 'ns3::MacHeaderType', is_const=False)
+    ## wimax-mac-queue.h (module 'wimax'): ns3::WimaxMacQueue::QueueElement::m_packet [variable]
+    cls.add_instance_attribute('m_packet', 'ns3::Ptr< ns3::Packet >', is_const=False)
+    ## wimax-mac-queue.h (module 'wimax'): ns3::WimaxMacQueue::QueueElement::m_timeStamp [variable]
+    cls.add_instance_attribute('m_timeStamp', 'ns3::Time', is_const=False)
+    return
+
 def register_Ns3WimaxMacToMacHeader_methods(root_module, cls):
     ## wimax-mac-to-mac-header.h (module 'wimax'): ns3::WimaxMacToMacHeader::WimaxMacToMacHeader(ns3::WimaxMacToMacHeader const & arg0) [copy constructor]
     cls.add_constructor([param('ns3::WimaxMacToMacHeader const &', 'arg0')])
--- a/src/wimax/model/bs-scheduler-rtps.cc	Wed Apr 11 11:00:27 2012 +0200
+++ b/src/wimax/model/bs-scheduler-rtps.cc	Wed Apr 11 13:49:33 2012 +0200
@@ -494,7 +494,6 @@
   ServiceFlowRecord *serviceFlowRecord;
   std::vector<ServiceFlow*> serviceFlows;
 
-  std::deque<WimaxMacQueue::QueueElement>::const_iterator iter3;
   uint32_t symbolsRequired[100];
   WimaxPhy::ModulationType modulationType_[100];
   uint8_t diuc_[100];
--- a/src/wimax/model/wimax-mac-queue.h	Wed Apr 11 11:00:27 2012 +0200
+++ b/src/wimax/model/wimax-mac-queue.h	Wed Apr 11 13:49:33 2012 +0200
@@ -117,7 +117,7 @@
   void SetFragmentation (MacHeaderType::HeaderType packetType);
   void SetFragmentNumber (MacHeaderType::HeaderType packetType);
   void SetFragmentOffset (MacHeaderType::HeaderType packetType, uint32_t offset);
-private:
+
   struct QueueElement
   {
     QueueElement (void);
@@ -146,6 +146,8 @@
     void SetFragmentOffset (uint32_t offset);
   };
 
+private:
+
   /*
    In the case of non-UGS service flows at the SS side the queue will store both data packets
    and bandwidth request packets. The two are distinguished by their headers. The below two functions
--- a/src/wscript	Wed Apr 11 11:00:27 2012 +0200
+++ b/src/wscript	Wed Apr 11 13:49:33 2012 +0200
@@ -125,7 +125,7 @@
     module.env.append_value("INCLUDES", '#')
 
     module.pcfilegen = bld(features='ns3pcfile')
-    module.pcfilegen.module = module
+    module.pcfilegen.module = module.name
     
     return module
 
@@ -413,13 +413,14 @@
 @TaskGen.feature('ns3pcfile')
 @TaskGen.after_method('process_rule')
 def apply(self):
-    output_filename = 'lib%s.pc' % os.path.basename(self.module.target)
+    module = self.bld.find_ns3_module(self.module)
+    output_filename = 'lib%s.pc' % os.path.basename(module.target)
     output_node = self.path.find_or_declare(output_filename)
     assert output_node is not None, str(self)
     task = self.create_task('ns3pcfile')
     self.bld.install_files('${LIBDIR}/pkgconfig', output_node)
     task.set_outputs([output_node])
-    task.module = self.module
+    task.module = module
 
 
 
--- a/test.py	Wed Apr 11 11:00:27 2012 +0200
+++ b/test.py	Wed Apr 11 13:49:33 2012 +0200
@@ -906,8 +906,8 @@
                 if job.is_example or job.is_pyexample:
                     #
                     # If we have an example, the shell command is all we need to
-                    # know.  It will be something like "examples/udp-echo" or 
-                    # "examples/mixed-wireless.py"
+                    # know.  It will be something like "examples/udp/udp-echo" or 
+                    # "examples/wireless/mixed-wireless.py"
                     #
                     (job.returncode, standard_out, standard_err, et) = run_job_synchronously(job.shell_command, 
                         job.cwd, options.valgrind, job.is_pyexample, job.build_path)
@@ -1140,10 +1140,10 @@
     #  ./test,py:                                           run all of the suites and examples
     #  ./test.py --constrain=core:                          run all of the suites of all kinds
     #  ./test.py --constrain=unit:                          run all unit suites
-    #  ./test,py --suite=some-test-suite:                   run a single suite
-    #  ./test,py --example=udp/udp-echo:                    run no test suites
-    #  ./test,py --pyexample=wireless/mixed-wireless.py:    run no test suites
-    #  ./test,py --suite=some-suite --example=some-example: run the single suite
+    #  ./test.py --suite=some-test-suite:                   run a single suite
+    #  ./test.py --example=examples/udp/udp-echo:           run single example
+    #  ./test.py --pyexample=examples/wireless/mixed-wireless.py:  run python example
+    #  ./test.py --suite=some-suite --example=some-example: run the single suite
     #
     # We can also use the --constrain option to provide an ordering of test 
     # execution quite easily.
--- a/wscript	Wed Apr 11 11:00:27 2012 +0200
+++ b/wscript	Wed Apr 11 13:49:33 2012 +0200
@@ -666,6 +666,14 @@
         break
 
 
+def _find_ns3_module(self, name):
+    for obj in _get_all_task_gen(self):
+        # disable the modules themselves
+        if hasattr(obj, "is_ns3_module") and obj.name == name:
+            return obj
+    raise KeyError(name)
+
+
 def build(bld):
     env = bld.env
 
@@ -694,6 +702,7 @@
     bld.create_suid_program = types.MethodType(create_suid_program, bld)
     bld.__class__.all_task_gen = property(_get_all_task_gen)
     bld.exclude_taskgen = types.MethodType(_exclude_taskgen, bld)
+    bld.find_ns3_module = types.MethodType(_find_ns3_module, bld)
 
     # process subfolders from here
     bld.add_subdirs('src')
@@ -776,7 +785,7 @@
 
             # disable pcfile taskgens for disabled modules
             if 'ns3pcfile' in getattr(obj, "features", []):
-                if obj.module.name not in bld.env.NS3_ENABLED_MODULES:
+                if obj.module not in bld.env.NS3_ENABLED_MODULES:
                     bld.exclude_taskgen(obj)