<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://www.nsnam.org/mediawiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Fax</id>
	<title>Nsnam - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://www.nsnam.org/mediawiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Fax"/>
	<link rel="alternate" type="text/html" href="https://www.nsnam.org/wiki/Special:Contributions/Fax"/>
	<updated>2026-04-21T16:45:35Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.8</generator>
	<entry>
		<id>https://www.nsnam.org/mediawiki/index.php?title=HOWTO_use_NS_LOG_to_find_a_problem&amp;diff=4824</id>
		<title>HOWTO use NS LOG to find a problem</title>
		<link rel="alternate" type="text/html" href="https://www.nsnam.org/mediawiki/index.php?title=HOWTO_use_NS_LOG_to_find_a_problem&amp;diff=4824"/>
		<updated>2010-08-24T13:54:08Z</updated>

		<summary type="html">&lt;p&gt;Fax: /* When everything else fails */ typo&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TOC}}&lt;br /&gt;
&lt;br /&gt;
One of the easiest ways a person can narrow down the location of a problem in ns-3 is by using NS_LOG and our predefined logging components.  Typically one uses NS_LOG in a case where the exact nature of the problem is not yet understood.  Logging provides a way to narrow down the problem location to an extent where either the log message will indicate the source of the problem orit will be easy to fire up the script in a debugger and take a closer look.&lt;br /&gt;
&lt;br /&gt;
A tried and true method for quickly locating a problem is via binary search.  You can use binary search to locate a bug just as easily as you can use binary search to locate an item in the usual sense.  In the case of debugging a network simulation script, you will usually first consider the end-to-end path of a packet and then take a look at what is happening half-way.  If the problem is visible at the half-way point, you think of what is half-way to that point and take a look there.  If the problem is not manifested at the halfway point, you take a look at what is happening half-way again towards the end point.  Using this technique, you can quickly narrow down the location of a problem.&lt;br /&gt;
&lt;br /&gt;
Of course, you can do this in a debugger just as easily as with NS_LOG '''if you know exactly where to set your breakpoints a priori'''.  An interesting feature of NS_LOG is that you can really do the same thing without knowing what is going on other than in a general network knowledge sense.  &lt;br /&gt;
&lt;br /&gt;
In this HOWTO, I demonstrate how one could use the binary search technique to locate a hypothetical problem in the our first.cc example.  As a bonus, look at the end for how to use NS_LOG as a learning tool for understanding the system.&lt;br /&gt;
&lt;br /&gt;
== HOWTO use NS LOG to find a problem ==&lt;br /&gt;
&lt;br /&gt;
The first.cc example uses an echo client on a single client node and an echo server on a single server node.  It orchesrates an echo across a point-to-point link.  A moment's thought will tell you that the halfway point in this simulation is at the point-to-point link.  The ns-3 model is that there is a net device and a channel so you will want to enable logging for the point-to-point channel.&lt;br /&gt;
&lt;br /&gt;
If you know something about the structure of the source, you'll just know to look in &lt;br /&gt;
&lt;br /&gt;
  src/devices/point-to-point/point-to-point-channel.cc &lt;br /&gt;
&lt;br /&gt;
for the NS_LOG_COMPONENT_DEFINE of the logging component.  If you don't have that kind of information rattling around in your brain you can just go to the top level directory and do &lt;br /&gt;
&lt;br /&gt;
  find . -name '*.cc' | xargs grep NS_LOG_COMPONENT_DEFINE&lt;br /&gt;
&lt;br /&gt;
This might seem like brute force and awkwardness, but you'll only find a couple of pages of them.  If you really don't want to wade through the two pages, you can also narrow the search&lt;br /&gt;
&lt;br /&gt;
  find . -name '*.cc' | xargs grep NS_LOG_COMPONENT_DEFINE | grep -i point&lt;br /&gt;
&lt;br /&gt;
and you'll currently see&lt;br /&gt;
&lt;br /&gt;
  ./devices/point-to-point/point-to-point-channel.cc:NS_LOG_COMPONENT_DEFINE (&amp;quot;PointToPointChannel&amp;quot;);&lt;br /&gt;
  ./devices/point-to-point/ppp-header.cc:NS_LOG_COMPONENT_DEFINE (&amp;quot;PppHeader&amp;quot;);&lt;br /&gt;
  ./devices/point-to-point/point-to-point-net-device.cc:NS_LOG_COMPONENT_DEFINE (&amp;quot;PointToPointNetDevice&amp;quot;);&lt;br /&gt;
  ./internet-stack/ipv4-end-point-demux.cc:NS_LOG_COMPONENT_DEFINE (&amp;quot;Ipv4EndPointDemux&amp;quot;);&lt;br /&gt;
  ./internet-stack/ipv4-end-point.cc:NS_LOG_COMPONENT_DEFINE (&amp;quot;Ipv4EndPoint&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
You can easily see that the log component to enable is, not too surprisingly, '''PointToPointChannel'''.&lt;br /&gt;
&lt;br /&gt;
Go ahead and enable the log component and run the program to see what's happening.&lt;br /&gt;
&lt;br /&gt;
  export NS_LOG=PointToPointChannel&lt;br /&gt;
  ./waf --run first&lt;br /&gt;
&lt;br /&gt;
You'll immediately see that the packet made it down to the channel from the&lt;br /&gt;
client.&lt;br /&gt;
&lt;br /&gt;
  2s PointToPointChannel:TransmitStart(0x634910, 0x6256f0, 0x622510)&lt;br /&gt;
  2s PointToPointChannel:TransmitStart(): UID is 0)&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
Sidebar:&lt;br /&gt;
&lt;br /&gt;
Once you know the name of the method called, it is nice to be able to find a description of the function you've seen.  This is easy to do in our Doxygen.  Take a look at http://www.nsnam.org/doxygen-release/index.html (if you are working with a released version) or http://www.nsnam.org/doxygen/index.html (if you are working with the development version).  Expand ''Class List'' in the navigation pane on the left side of the page.  You will see a bunch of classes.  Search for ns3::PointToPointChannel and click on the link.  You will have linked to the class reference page for the PointToPointChannel.  If you look at the ''Public Member Functions'' documentation on this page you will see TransmitStart, which tells you that this method is called to transmit a packet over this channel.&lt;br /&gt;
&lt;br /&gt;
Just interpreting the name found in the log as a class name and method name often works, but notice that the function call log printed in the snippet above looks like a class name followed by a ''single'' colon and then a method name and parameters.  This is not a typo.  The single colon is easily overlooked but has a significant meaning.  The single colon separator means that what appears to be a class name is actually a log component name.  In ns-3 these are often the same thing, but '''''not necessarily'''''.  To find the code for ''TransmitStart'' you culd use the recursive find trick looking for PointToPointChannel::TransmitStart (note the double colon namespace separator in the search term) and you would find it in this case.  This is just because the class name and the log component name are identical.  Generally that's the easiest thing to do first as was done above.  However, if you don't find it this way you will have to search for the log component name and then search for the method name in the .cc file you find.  This will give you the real class name and you can use that class name to find the method documentation in doxygen.&lt;br /&gt;
&lt;br /&gt;
If you haven't yet found the documentation for the logging component itself, go ahead and expand ''Modules'' and then ''Core'' and then ''Debugging'' in the navigation pane of the ns-3 doxygen, and then select ''Logging'' to go to the low-level documentation.  If you are unfamilar with this and are interested in a tutorial introduction to logging, there is a section in the ns-3 tutorial (http://www.nsnam.org/docs/release/tutorial.html) called ''Using the Logging Module'' which you should read.&lt;br /&gt;
&lt;br /&gt;
Now back to the main thread ...&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
So, now you can infer that a packet has made it from the echo client application down through the protocol stack on the client node, into the net device and has begun being transmitted to the server over the channel.  Now, think to yourself, what's halfway up the protocol stack on the server side?  Well, how about UDP.  Again, the question is, what log component to turn on?  The answer if you don't know anything about what's happening in the system is grep, but this time use your general networking knowledge and look for udp.&lt;br /&gt;
&lt;br /&gt;
  find . -name '*.cc' | xargs grep NS_LOG_COMPONENT_DEFINE | grep -i udp&lt;br /&gt;
&lt;br /&gt;
You'll see that we have the following log components containing the case-insensitive string udp:&lt;br /&gt;
&lt;br /&gt;
  ./examples/emu-udp-echo.cc:NS_LOG_COMPONENT_DEFINE (&amp;quot;EmulatedUdpEchoExample&amp;quot;);&lt;br /&gt;
  ./examples/realtime-udp-echo.cc:NS_LOG_COMPONENT_DEFINE (&amp;quot;RealtimeUdpEchoExample&amp;quot;);&lt;br /&gt;
  ./examples/udp-echo.cc:NS_LOG_COMPONENT_DEFINE (&amp;quot;UdpEchoExample&amp;quot;);&lt;br /&gt;
  ./src/node/udp-socket.cc:NS_LOG_COMPONENT_DEFINE (&amp;quot;UdpSocket&amp;quot;);&lt;br /&gt;
  ./src/applications/udp-echo/udp-echo-server.cc:NS_LOG_COMPONENT_DEFINE (&amp;quot;UdpEchoServerApplication&amp;quot;);&lt;br /&gt;
  ./src/applications/udp-echo/udp-echo-client.cc:NS_LOG_COMPONENT_DEFINE (&amp;quot;UdpEchoClientApplication&amp;quot;);&lt;br /&gt;
  ./src/internet-stack/udp-socket-impl.cc:NS_LOG_COMPONENT_DEFINE (&amp;quot;UdpSocketImpl&amp;quot;);&lt;br /&gt;
  ./src/internet-stack/udp-l4-protocol.cc:NS_LOG_COMPONENT_DEFINE (&amp;quot;UdpL4Protocol&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
You can really play this by ear.  How about turning on UdpL4Protocol.  You know what an L4 protocol is, right?  UdpSocketImpl or UdpSocket sound kindof high in the stack, so as a wild guess just turn on UdpL4Protocol.&lt;br /&gt;
&lt;br /&gt;
  export NS_LOG=UdpL4Protocol&lt;br /&gt;
  ./waf --run first&lt;br /&gt;
&lt;br /&gt;
Among other things, you'll see&lt;br /&gt;
&lt;br /&gt;
  Sent 1024 bytes to 10.1.1.2&lt;br /&gt;
  2.00369s UdpL4Protocol:Receive(0x635d30, 0x625250, 10.1.1.1, 10.1.1.2)&lt;br /&gt;
&lt;br /&gt;
This tells you that a packet from 10.1.1.1 to 10.1.1.2 has made it as far as the UdpL4Protocol::Receive method (which you might not have known existed) and also gives you a method name that you can search for and begin seeing what is happening.  Again, grep is your friend&lt;br /&gt;
&lt;br /&gt;
  find . -name '*.cc' | xargs grep UdpL4Protocol::Receive&lt;br /&gt;
&lt;br /&gt;
and you will see&lt;br /&gt;
&lt;br /&gt;
  ./internet-stack/udp-l4-protocol.cc:UdpL4Protocol::Receive(Ptr&amp;lt;Packet&amp;gt; packet,&lt;br /&gt;
&lt;br /&gt;
Now you have a file and a method so your knowledge of what is happening is increasing.  You can spend some time perusing the file if you like just to get a handle on what is happening at this point in the stack.&lt;br /&gt;
&lt;br /&gt;
Focusing at the problem at hand, you know know that the packet has made it about three quarters of the way from the client to the server.  The find and grep for udp above tells you that you really only have the udp socket left between you and the server application.  The '''UdpSocketImpl''' component sounds like a good place to look, so turn it on.&lt;br /&gt;
&lt;br /&gt;
  export NS_LOG=UdpSocketImpl&lt;br /&gt;
  ./waf --run first&lt;br /&gt;
&lt;br /&gt;
You will see&lt;br /&gt;
&lt;br /&gt;
  Sent 1024 bytes to 10.1.1.2&lt;br /&gt;
  2.00369s UdpSocketImpl:ForwardUp(0x624900, 0x625a20, 10.1.1.1, 49153)&lt;br /&gt;
  2.00369s UdpSocketImpl:RecvFrom(0x624900, 4294967295, 0)&lt;br /&gt;
  2.00369s UdpSocketImpl:Recv(0x624900, 4294967295, 0)&lt;br /&gt;
&lt;br /&gt;
The socket gets the packet from 10.1.1.1 and then forwards it up the stack and eventually wants to call the '''recv''' function which eventually gives the server application the data.&lt;br /&gt;
&lt;br /&gt;
Anyway, I think you get the picture.  Binary search for problems using NS_LOG.  While you are doing the binary search, look at what is being displayed to help you understand what is going on in the stack.  Use grep and find to locate the methods you see and then go read the code to get a better understanding of the system.  If you want to understand what *should* be happening, do this exercise using one of the examples and watch the packet flow across a similar case and then go back to your code and see where it diverges from what you saw in the example.  &lt;br /&gt;
&lt;br /&gt;
Once you have run the binary search down to the finest granularity using NS_LOG, you can fire up your debugger and zero right in on the problem to within a few method calls.  Of course, in many cases, something you did or did not do becomes obvious and you just go fix up your script and move on never having had to fire up gdb or ddd at all.&lt;br /&gt;
&lt;br /&gt;
=== When everything else fails ===&lt;br /&gt;
This tip is reported in the [http://www.nsnam.org/docs/tutorial/tutorial_21.html#Enabling-Logging tutorial] and it is worth to be reported here as well.&lt;br /&gt;
When everything else fails, namely, when you have absolutely no clue what is the component that makes the whole program stop, you can try and turn on ''all the logging'' at once. To do this simply set the &amp;lt;code&amp;gt;NS_LOG&amp;lt;/code&amp;gt; environment variable as follows:&lt;br /&gt;
 export 'NS_LOG=*=level_all|prefix_func|prefix_time'&lt;br /&gt;
The &amp;lt;code&amp;gt;*&amp;lt;/code&amp;gt; wildcard expands to ''all'' the &amp;lt;code&amp;gt;LogComponent&amp;lt;/code&amp;gt;s defined in ns-3, while &amp;lt;code&amp;gt;level_all&amp;lt;/code&amp;gt; is the equivalent of &amp;lt;code&amp;gt;LOG_LEVEL_ALL&amp;lt;/code&amp;gt; in the main simulation script.&lt;br /&gt;
As a consequence, it is quite clear that this represents an extreme measure that produces tons of output, and as such, should be used as a last resort.&lt;br /&gt;
&lt;br /&gt;
== HOWTO use NS LOG as a learning tool ==&lt;br /&gt;
&lt;br /&gt;
You can also use NS_LOG as a learning tool to dig down into the system.  If you want to figure out more about ns-3 routing, one way is to find some routing log components and find out where $#!^ happens.&lt;br /&gt;
&lt;br /&gt;
  find . -name '*.cc' | xargs grep NS_LOG_COMPONENT_DEFINE | grep -i routing&lt;br /&gt;
&lt;br /&gt;
  ./src/routing/olsr/olsr-header.cc:NS_LOG_COMPONENT_DEFINE(&amp;quot;OlsrHeader&amp;quot;);&lt;br /&gt;
  ./src/routing/olsr/olsr-routing-protocol.cc:NS_LOG_COMPONENT_DEFINE (&amp;quot;OlsrAgent&amp;quot;);&lt;br /&gt;
  ./src/routing/global-routing/global-route-manager-impl.cc:NS_LOG_COMPONENT_DEFINE (&amp;quot;GlobalRouteManager&amp;quot;);&lt;br /&gt;
  ./src/routing/global-routing/candidate-queue.cc:NS_LOG_COMPONENT_DEFINE (&amp;quot;CandidateQueue&amp;quot;);&lt;br /&gt;
  ./src/routing/global-routing/global-router-interface.cc:NS_LOG_COMPONENT_DEFINE (&amp;quot;GlobalRouter&amp;quot;);&lt;br /&gt;
  ./src/internet-stack/ipv4-static-routing.cc:NS_LOG_COMPONENT_DEFINE (&amp;quot;Ipv4StaticRouting&amp;quot;);&lt;br /&gt;
  ./src/internet-stack/ipv4-global-routing.cc:NS_LOG_COMPONENT_DEFINE (&amp;quot;Ipv4GlobalRouting&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
Look in examples for a file with the root of the word &amp;quot;routing&amp;quot; in its name.&lt;br /&gt;
&lt;br /&gt;
  ls examples/*rout*&lt;br /&gt;
&lt;br /&gt;
As of this writing, you'll see&lt;br /&gt;
&lt;br /&gt;
  examples/dynamic-global-routing.cc  examples/mixed-global-routing.cc      examples/simple-global-routing.cc&lt;br /&gt;
  examples/global-routing-slash32.cc  examples/simple-alternate-routing.cc  examples/static-routing-slash32.cc&lt;br /&gt;
&lt;br /&gt;
Why not take a look at something with simple in its name too.  It seems reasonable that the log component '''Ipv4GlobalRouting''' will have something to do with the example file '''simple-global-routing.cc''' doesn't it?  See what happens:&lt;br /&gt;
&lt;br /&gt;
  export NS_LOG=Ipv4GlobalRouting&lt;br /&gt;
  ./waf --run simple-global-routing&lt;br /&gt;
&lt;br /&gt;
When you run this, you will get lots and lots of log messages.  You can redirect the run output to a file and you can just start poking around.&lt;br /&gt;
&lt;br /&gt;
Take a look at some output.  This is interesting setup information&lt;br /&gt;
&lt;br /&gt;
  0s Ipv4GlobalRouting:AddHostRouteTo(10.1.1.2, 10.1.1.2, 1)&lt;br /&gt;
  0s Ipv4GlobalRouting:AddHostRouteTo(10.1.2.2, 10.1.1.2, 1)&lt;br /&gt;
  0s Ipv4GlobalRouting:AddHostRouteTo(10.1.3.2, 10.1.1.2, 1)&lt;br /&gt;
  0s Ipv4GlobalRouting:AddHostRouteTo(10.1.2.1, 10.1.1.2, 1)&lt;br /&gt;
  0s Ipv4GlobalRouting:AddHostRouteTo(10.1.3.1, 10.1.1.2, 1)&lt;br /&gt;
  0s Ipv4GlobalRouting:AddNetworkRouteTo(10.1.1.0, 255.255.255.0, 10.1.1.2, 1)&lt;br /&gt;
  0s Ipv4GlobalRouting:AddNetworkRouteTo(10.1.2.0, 255.255.255.0, 10.1.1.2, 1)&lt;br /&gt;
  0s Ipv4GlobalRouting:AddNetworkRouteTo(10.1.3.0, 255.255.255.0, 10.1.1.2, 1)&lt;br /&gt;
  0s Ipv4GlobalRouting:AddNetworkRouteTo(10.1.2.0, 255.255.255.0, 10.1.1.2, 1)&lt;br /&gt;
  0s Ipv4GlobalRouting:AddNetworkRouteTo(10.1.3.0, 255.255.255.0, 10.1.1.2, 1)&lt;br /&gt;
&lt;br /&gt;
Further down notice that the timestamps seem to be grouped.  &lt;br /&gt;
&lt;br /&gt;
  8.70113s Ipv4GlobalRouting:RequestRoute(0x648950, 1, 0x7fffe3cded30, 0x65db70, 0x7fffe3cde8e0)&lt;br /&gt;
  8.70113s Ipv4GlobalRouting:RequestRoute(): source = 10.1.1.1&lt;br /&gt;
  8.70113s Ipv4GlobalRouting:RequestRoute(): destination = 10.1.3.1&lt;br /&gt;
  8.70113s Ipv4GlobalRouting:RequestRoute(): Unicast destination- looking up&lt;br /&gt;
  8.70113s Ipv4GlobalRouting:LookupGlobal()&lt;br /&gt;
  8.70113s Ipv4GlobalRouting:LookupGlobal(): Found global host route0x649bf0&lt;br /&gt;
&lt;br /&gt;
You can probably already get a sense for what must be going on.  You can now go and find the code using grep.&lt;br /&gt;
&lt;br /&gt;
  find . -name '*.cc' | xargs grep Ipv4GlobalRouting::RequestRoute&lt;br /&gt;
  ./src/internet-stack/ipv4-global-routing.cc:Ipv4GlobalRouting::RequestRoute (&lt;br /&gt;
&lt;br /&gt;
tells you where to look for some of the global routing-related code.  From the log messages you can probably infer the basic operation before you even go look at the code.&lt;br /&gt;
&lt;br /&gt;
You can also see (in the original find) that there are other components '''GlobalRouteManager''' and '''GlobalRouter''' that live in a directory called '''src/routing/global-routing''' -- you can turn on those log components to see what is happening there.  Armed with some of this basic contextural information you can also look in the manual where you will find a routing chapter with detailed descriptions of some of the methods you've seen already.  Using NS_LOG you can see the API described in the manual at work and follow what is happening in real code.&lt;br /&gt;
&lt;br /&gt;
Anyway, NS_LOG is really a very powerful tool.  Most people tend to under-appreciate it since they learned in programming 101 that debugging with printfs is for kids.  Don't kid yourself, though.  Use every tool available to you.  Debugging with printfs in an '''intelligent way''' can make your life much easier.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
[[User:Craigdo|Craigdo]] 02:39, 14 May 2009 (UTC)&lt;/div&gt;</summary>
		<author><name>Fax</name></author>
	</entry>
	<entry>
		<id>https://www.nsnam.org/mediawiki/index.php?title=HOWTO_use_NS_LOG_to_find_a_problem&amp;diff=4823</id>
		<title>HOWTO use NS LOG to find a problem</title>
		<link rel="alternate" type="text/html" href="https://www.nsnam.org/mediawiki/index.php?title=HOWTO_use_NS_LOG_to_find_a_problem&amp;diff=4823"/>
		<updated>2010-08-24T13:53:13Z</updated>

		<summary type="html">&lt;p&gt;Fax: /* HOWTO use NS LOG to find a problem */ reporting tip present in the tutorial&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TOC}}&lt;br /&gt;
&lt;br /&gt;
One of the easiest ways a person can narrow down the location of a problem in ns-3 is by using NS_LOG and our predefined logging components.  Typically one uses NS_LOG in a case where the exact nature of the problem is not yet understood.  Logging provides a way to narrow down the problem location to an extent where either the log message will indicate the source of the problem orit will be easy to fire up the script in a debugger and take a closer look.&lt;br /&gt;
&lt;br /&gt;
A tried and true method for quickly locating a problem is via binary search.  You can use binary search to locate a bug just as easily as you can use binary search to locate an item in the usual sense.  In the case of debugging a network simulation script, you will usually first consider the end-to-end path of a packet and then take a look at what is happening half-way.  If the problem is visible at the half-way point, you think of what is half-way to that point and take a look there.  If the problem is not manifested at the halfway point, you take a look at what is happening half-way again towards the end point.  Using this technique, you can quickly narrow down the location of a problem.&lt;br /&gt;
&lt;br /&gt;
Of course, you can do this in a debugger just as easily as with NS_LOG '''if you know exactly where to set your breakpoints a priori'''.  An interesting feature of NS_LOG is that you can really do the same thing without knowing what is going on other than in a general network knowledge sense.  &lt;br /&gt;
&lt;br /&gt;
In this HOWTO, I demonstrate how one could use the binary search technique to locate a hypothetical problem in the our first.cc example.  As a bonus, look at the end for how to use NS_LOG as a learning tool for understanding the system.&lt;br /&gt;
&lt;br /&gt;
== HOWTO use NS LOG to find a problem ==&lt;br /&gt;
&lt;br /&gt;
The first.cc example uses an echo client on a single client node and an echo server on a single server node.  It orchesrates an echo across a point-to-point link.  A moment's thought will tell you that the halfway point in this simulation is at the point-to-point link.  The ns-3 model is that there is a net device and a channel so you will want to enable logging for the point-to-point channel.&lt;br /&gt;
&lt;br /&gt;
If you know something about the structure of the source, you'll just know to look in &lt;br /&gt;
&lt;br /&gt;
  src/devices/point-to-point/point-to-point-channel.cc &lt;br /&gt;
&lt;br /&gt;
for the NS_LOG_COMPONENT_DEFINE of the logging component.  If you don't have that kind of information rattling around in your brain you can just go to the top level directory and do &lt;br /&gt;
&lt;br /&gt;
  find . -name '*.cc' | xargs grep NS_LOG_COMPONENT_DEFINE&lt;br /&gt;
&lt;br /&gt;
This might seem like brute force and awkwardness, but you'll only find a couple of pages of them.  If you really don't want to wade through the two pages, you can also narrow the search&lt;br /&gt;
&lt;br /&gt;
  find . -name '*.cc' | xargs grep NS_LOG_COMPONENT_DEFINE | grep -i point&lt;br /&gt;
&lt;br /&gt;
and you'll currently see&lt;br /&gt;
&lt;br /&gt;
  ./devices/point-to-point/point-to-point-channel.cc:NS_LOG_COMPONENT_DEFINE (&amp;quot;PointToPointChannel&amp;quot;);&lt;br /&gt;
  ./devices/point-to-point/ppp-header.cc:NS_LOG_COMPONENT_DEFINE (&amp;quot;PppHeader&amp;quot;);&lt;br /&gt;
  ./devices/point-to-point/point-to-point-net-device.cc:NS_LOG_COMPONENT_DEFINE (&amp;quot;PointToPointNetDevice&amp;quot;);&lt;br /&gt;
  ./internet-stack/ipv4-end-point-demux.cc:NS_LOG_COMPONENT_DEFINE (&amp;quot;Ipv4EndPointDemux&amp;quot;);&lt;br /&gt;
  ./internet-stack/ipv4-end-point.cc:NS_LOG_COMPONENT_DEFINE (&amp;quot;Ipv4EndPoint&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
You can easily see that the log component to enable is, not too surprisingly, '''PointToPointChannel'''.&lt;br /&gt;
&lt;br /&gt;
Go ahead and enable the log component and run the program to see what's happening.&lt;br /&gt;
&lt;br /&gt;
  export NS_LOG=PointToPointChannel&lt;br /&gt;
  ./waf --run first&lt;br /&gt;
&lt;br /&gt;
You'll immediately see that the packet made it down to the channel from the&lt;br /&gt;
client.&lt;br /&gt;
&lt;br /&gt;
  2s PointToPointChannel:TransmitStart(0x634910, 0x6256f0, 0x622510)&lt;br /&gt;
  2s PointToPointChannel:TransmitStart(): UID is 0)&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
Sidebar:&lt;br /&gt;
&lt;br /&gt;
Once you know the name of the method called, it is nice to be able to find a description of the function you've seen.  This is easy to do in our Doxygen.  Take a look at http://www.nsnam.org/doxygen-release/index.html (if you are working with a released version) or http://www.nsnam.org/doxygen/index.html (if you are working with the development version).  Expand ''Class List'' in the navigation pane on the left side of the page.  You will see a bunch of classes.  Search for ns3::PointToPointChannel and click on the link.  You will have linked to the class reference page for the PointToPointChannel.  If you look at the ''Public Member Functions'' documentation on this page you will see TransmitStart, which tells you that this method is called to transmit a packet over this channel.&lt;br /&gt;
&lt;br /&gt;
Just interpreting the name found in the log as a class name and method name often works, but notice that the function call log printed in the snippet above looks like a class name followed by a ''single'' colon and then a method name and parameters.  This is not a typo.  The single colon is easily overlooked but has a significant meaning.  The single colon separator means that what appears to be a class name is actually a log component name.  In ns-3 these are often the same thing, but '''''not necessarily'''''.  To find the code for ''TransmitStart'' you culd use the recursive find trick looking for PointToPointChannel::TransmitStart (note the double colon namespace separator in the search term) and you would find it in this case.  This is just because the class name and the log component name are identical.  Generally that's the easiest thing to do first as was done above.  However, if you don't find it this way you will have to search for the log component name and then search for the method name in the .cc file you find.  This will give you the real class name and you can use that class name to find the method documentation in doxygen.&lt;br /&gt;
&lt;br /&gt;
If you haven't yet found the documentation for the logging component itself, go ahead and expand ''Modules'' and then ''Core'' and then ''Debugging'' in the navigation pane of the ns-3 doxygen, and then select ''Logging'' to go to the low-level documentation.  If you are unfamilar with this and are interested in a tutorial introduction to logging, there is a section in the ns-3 tutorial (http://www.nsnam.org/docs/release/tutorial.html) called ''Using the Logging Module'' which you should read.&lt;br /&gt;
&lt;br /&gt;
Now back to the main thread ...&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
So, now you can infer that a packet has made it from the echo client application down through the protocol stack on the client node, into the net device and has begun being transmitted to the server over the channel.  Now, think to yourself, what's halfway up the protocol stack on the server side?  Well, how about UDP.  Again, the question is, what log component to turn on?  The answer if you don't know anything about what's happening in the system is grep, but this time use your general networking knowledge and look for udp.&lt;br /&gt;
&lt;br /&gt;
  find . -name '*.cc' | xargs grep NS_LOG_COMPONENT_DEFINE | grep -i udp&lt;br /&gt;
&lt;br /&gt;
You'll see that we have the following log components containing the case-insensitive string udp:&lt;br /&gt;
&lt;br /&gt;
  ./examples/emu-udp-echo.cc:NS_LOG_COMPONENT_DEFINE (&amp;quot;EmulatedUdpEchoExample&amp;quot;);&lt;br /&gt;
  ./examples/realtime-udp-echo.cc:NS_LOG_COMPONENT_DEFINE (&amp;quot;RealtimeUdpEchoExample&amp;quot;);&lt;br /&gt;
  ./examples/udp-echo.cc:NS_LOG_COMPONENT_DEFINE (&amp;quot;UdpEchoExample&amp;quot;);&lt;br /&gt;
  ./src/node/udp-socket.cc:NS_LOG_COMPONENT_DEFINE (&amp;quot;UdpSocket&amp;quot;);&lt;br /&gt;
  ./src/applications/udp-echo/udp-echo-server.cc:NS_LOG_COMPONENT_DEFINE (&amp;quot;UdpEchoServerApplication&amp;quot;);&lt;br /&gt;
  ./src/applications/udp-echo/udp-echo-client.cc:NS_LOG_COMPONENT_DEFINE (&amp;quot;UdpEchoClientApplication&amp;quot;);&lt;br /&gt;
  ./src/internet-stack/udp-socket-impl.cc:NS_LOG_COMPONENT_DEFINE (&amp;quot;UdpSocketImpl&amp;quot;);&lt;br /&gt;
  ./src/internet-stack/udp-l4-protocol.cc:NS_LOG_COMPONENT_DEFINE (&amp;quot;UdpL4Protocol&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
You can really play this by ear.  How about turning on UdpL4Protocol.  You know what an L4 protocol is, right?  UdpSocketImpl or UdpSocket sound kindof high in the stack, so as a wild guess just turn on UdpL4Protocol.&lt;br /&gt;
&lt;br /&gt;
  export NS_LOG=UdpL4Protocol&lt;br /&gt;
  ./waf --run first&lt;br /&gt;
&lt;br /&gt;
Among other things, you'll see&lt;br /&gt;
&lt;br /&gt;
  Sent 1024 bytes to 10.1.1.2&lt;br /&gt;
  2.00369s UdpL4Protocol:Receive(0x635d30, 0x625250, 10.1.1.1, 10.1.1.2)&lt;br /&gt;
&lt;br /&gt;
This tells you that a packet from 10.1.1.1 to 10.1.1.2 has made it as far as the UdpL4Protocol::Receive method (which you might not have known existed) and also gives you a method name that you can search for and begin seeing what is happening.  Again, grep is your friend&lt;br /&gt;
&lt;br /&gt;
  find . -name '*.cc' | xargs grep UdpL4Protocol::Receive&lt;br /&gt;
&lt;br /&gt;
and you will see&lt;br /&gt;
&lt;br /&gt;
  ./internet-stack/udp-l4-protocol.cc:UdpL4Protocol::Receive(Ptr&amp;lt;Packet&amp;gt; packet,&lt;br /&gt;
&lt;br /&gt;
Now you have a file and a method so your knowledge of what is happening is increasing.  You can spend some time perusing the file if you like just to get a handle on what is happening at this point in the stack.&lt;br /&gt;
&lt;br /&gt;
Focusing at the problem at hand, you know know that the packet has made it about three quarters of the way from the client to the server.  The find and grep for udp above tells you that you really only have the udp socket left between you and the server application.  The '''UdpSocketImpl''' component sounds like a good place to look, so turn it on.&lt;br /&gt;
&lt;br /&gt;
  export NS_LOG=UdpSocketImpl&lt;br /&gt;
  ./waf --run first&lt;br /&gt;
&lt;br /&gt;
You will see&lt;br /&gt;
&lt;br /&gt;
  Sent 1024 bytes to 10.1.1.2&lt;br /&gt;
  2.00369s UdpSocketImpl:ForwardUp(0x624900, 0x625a20, 10.1.1.1, 49153)&lt;br /&gt;
  2.00369s UdpSocketImpl:RecvFrom(0x624900, 4294967295, 0)&lt;br /&gt;
  2.00369s UdpSocketImpl:Recv(0x624900, 4294967295, 0)&lt;br /&gt;
&lt;br /&gt;
The socket gets the packet from 10.1.1.1 and then forwards it up the stack and eventually wants to call the '''recv''' function which eventually gives the server application the data.&lt;br /&gt;
&lt;br /&gt;
Anyway, I think you get the picture.  Binary search for problems using NS_LOG.  While you are doing the binary search, look at what is being displayed to help you understand what is going on in the stack.  Use grep and find to locate the methods you see and then go read the code to get a better understanding of the system.  If you want to understand what *should* be happening, do this exercise using one of the examples and watch the packet flow across a similar case and then go back to your code and see where it diverges from what you saw in the example.  &lt;br /&gt;
&lt;br /&gt;
Once you have run the binary search down to the finest granularity using NS_LOG, you can fire up your debugger and zero right in on the problem to within a few method calls.  Of course, in many cases, something you did or did not do becomes obvious and you just go fix up your script and move on never having had to fire up gdb or ddd at all.&lt;br /&gt;
&lt;br /&gt;
=== When everything else fails ===&lt;br /&gt;
This tip is reported in the [http://www.nsnam.org/docs/tutorial/tutorial_21.html#Enabling-Logging tutorial] and it is worth to be reported here as well.&lt;br /&gt;
When everything else fails, namely, when you cannot have absolutely no clue what is the component that makes the whole program stop, you can try and turn on ''all the logging'' at once. To do this simply set the &amp;lt;code&amp;gt;NS_LOG&amp;lt;/code&amp;gt; environment variable as follows:&lt;br /&gt;
 export 'NS_LOG=*=level_all|prefix_func|prefix_time'&lt;br /&gt;
The &amp;lt;code&amp;gt;*&amp;lt;/code&amp;gt; wildcard expands to ''all'' the &amp;lt;code&amp;gt;LogComponent&amp;lt;/code&amp;gt;s defined in ns-3, while &amp;lt;code&amp;gt;level_all&amp;lt;/code&amp;gt; is the equivalent of &amp;lt;code&amp;gt;LOG_LEVEL_ALL&amp;lt;/code&amp;gt; in the main simulation script.&lt;br /&gt;
As a consequence, it is quite clear that this represents an extreme measure that produces tons of output, and as such, should be used as a last resort.&lt;br /&gt;
&lt;br /&gt;
== HOWTO use NS LOG as a learning tool ==&lt;br /&gt;
&lt;br /&gt;
You can also use NS_LOG as a learning tool to dig down into the system.  If you want to figure out more about ns-3 routing, one way is to find some routing log components and find out where $#!^ happens.&lt;br /&gt;
&lt;br /&gt;
  find . -name '*.cc' | xargs grep NS_LOG_COMPONENT_DEFINE | grep -i routing&lt;br /&gt;
&lt;br /&gt;
  ./src/routing/olsr/olsr-header.cc:NS_LOG_COMPONENT_DEFINE(&amp;quot;OlsrHeader&amp;quot;);&lt;br /&gt;
  ./src/routing/olsr/olsr-routing-protocol.cc:NS_LOG_COMPONENT_DEFINE (&amp;quot;OlsrAgent&amp;quot;);&lt;br /&gt;
  ./src/routing/global-routing/global-route-manager-impl.cc:NS_LOG_COMPONENT_DEFINE (&amp;quot;GlobalRouteManager&amp;quot;);&lt;br /&gt;
  ./src/routing/global-routing/candidate-queue.cc:NS_LOG_COMPONENT_DEFINE (&amp;quot;CandidateQueue&amp;quot;);&lt;br /&gt;
  ./src/routing/global-routing/global-router-interface.cc:NS_LOG_COMPONENT_DEFINE (&amp;quot;GlobalRouter&amp;quot;);&lt;br /&gt;
  ./src/internet-stack/ipv4-static-routing.cc:NS_LOG_COMPONENT_DEFINE (&amp;quot;Ipv4StaticRouting&amp;quot;);&lt;br /&gt;
  ./src/internet-stack/ipv4-global-routing.cc:NS_LOG_COMPONENT_DEFINE (&amp;quot;Ipv4GlobalRouting&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
Look in examples for a file with the root of the word &amp;quot;routing&amp;quot; in its name.&lt;br /&gt;
&lt;br /&gt;
  ls examples/*rout*&lt;br /&gt;
&lt;br /&gt;
As of this writing, you'll see&lt;br /&gt;
&lt;br /&gt;
  examples/dynamic-global-routing.cc  examples/mixed-global-routing.cc      examples/simple-global-routing.cc&lt;br /&gt;
  examples/global-routing-slash32.cc  examples/simple-alternate-routing.cc  examples/static-routing-slash32.cc&lt;br /&gt;
&lt;br /&gt;
Why not take a look at something with simple in its name too.  It seems reasonable that the log component '''Ipv4GlobalRouting''' will have something to do with the example file '''simple-global-routing.cc''' doesn't it?  See what happens:&lt;br /&gt;
&lt;br /&gt;
  export NS_LOG=Ipv4GlobalRouting&lt;br /&gt;
  ./waf --run simple-global-routing&lt;br /&gt;
&lt;br /&gt;
When you run this, you will get lots and lots of log messages.  You can redirect the run output to a file and you can just start poking around.&lt;br /&gt;
&lt;br /&gt;
Take a look at some output.  This is interesting setup information&lt;br /&gt;
&lt;br /&gt;
  0s Ipv4GlobalRouting:AddHostRouteTo(10.1.1.2, 10.1.1.2, 1)&lt;br /&gt;
  0s Ipv4GlobalRouting:AddHostRouteTo(10.1.2.2, 10.1.1.2, 1)&lt;br /&gt;
  0s Ipv4GlobalRouting:AddHostRouteTo(10.1.3.2, 10.1.1.2, 1)&lt;br /&gt;
  0s Ipv4GlobalRouting:AddHostRouteTo(10.1.2.1, 10.1.1.2, 1)&lt;br /&gt;
  0s Ipv4GlobalRouting:AddHostRouteTo(10.1.3.1, 10.1.1.2, 1)&lt;br /&gt;
  0s Ipv4GlobalRouting:AddNetworkRouteTo(10.1.1.0, 255.255.255.0, 10.1.1.2, 1)&lt;br /&gt;
  0s Ipv4GlobalRouting:AddNetworkRouteTo(10.1.2.0, 255.255.255.0, 10.1.1.2, 1)&lt;br /&gt;
  0s Ipv4GlobalRouting:AddNetworkRouteTo(10.1.3.0, 255.255.255.0, 10.1.1.2, 1)&lt;br /&gt;
  0s Ipv4GlobalRouting:AddNetworkRouteTo(10.1.2.0, 255.255.255.0, 10.1.1.2, 1)&lt;br /&gt;
  0s Ipv4GlobalRouting:AddNetworkRouteTo(10.1.3.0, 255.255.255.0, 10.1.1.2, 1)&lt;br /&gt;
&lt;br /&gt;
Further down notice that the timestamps seem to be grouped.  &lt;br /&gt;
&lt;br /&gt;
  8.70113s Ipv4GlobalRouting:RequestRoute(0x648950, 1, 0x7fffe3cded30, 0x65db70, 0x7fffe3cde8e0)&lt;br /&gt;
  8.70113s Ipv4GlobalRouting:RequestRoute(): source = 10.1.1.1&lt;br /&gt;
  8.70113s Ipv4GlobalRouting:RequestRoute(): destination = 10.1.3.1&lt;br /&gt;
  8.70113s Ipv4GlobalRouting:RequestRoute(): Unicast destination- looking up&lt;br /&gt;
  8.70113s Ipv4GlobalRouting:LookupGlobal()&lt;br /&gt;
  8.70113s Ipv4GlobalRouting:LookupGlobal(): Found global host route0x649bf0&lt;br /&gt;
&lt;br /&gt;
You can probably already get a sense for what must be going on.  You can now go and find the code using grep.&lt;br /&gt;
&lt;br /&gt;
  find . -name '*.cc' | xargs grep Ipv4GlobalRouting::RequestRoute&lt;br /&gt;
  ./src/internet-stack/ipv4-global-routing.cc:Ipv4GlobalRouting::RequestRoute (&lt;br /&gt;
&lt;br /&gt;
tells you where to look for some of the global routing-related code.  From the log messages you can probably infer the basic operation before you even go look at the code.&lt;br /&gt;
&lt;br /&gt;
You can also see (in the original find) that there are other components '''GlobalRouteManager''' and '''GlobalRouter''' that live in a directory called '''src/routing/global-routing''' -- you can turn on those log components to see what is happening there.  Armed with some of this basic contextural information you can also look in the manual where you will find a routing chapter with detailed descriptions of some of the methods you've seen already.  Using NS_LOG you can see the API described in the manual at work and follow what is happening in real code.&lt;br /&gt;
&lt;br /&gt;
Anyway, NS_LOG is really a very powerful tool.  Most people tend to under-appreciate it since they learned in programming 101 that debugging with printfs is for kids.  Don't kid yourself, though.  Use every tool available to you.  Debugging with printfs in an '''intelligent way''' can make your life much easier.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
[[User:Craigdo|Craigdo]] 02:39, 14 May 2009 (UTC)&lt;/div&gt;</summary>
		<author><name>Fax</name></author>
	</entry>
	<entry>
		<id>https://www.nsnam.org/mediawiki/index.php?title=HOWTO_determine_the_path_of_an_attribute_or_trace_source&amp;diff=4491</id>
		<title>HOWTO determine the path of an attribute or trace source</title>
		<link rel="alternate" type="text/html" href="https://www.nsnam.org/mediawiki/index.php?title=HOWTO_determine_the_path_of_an_attribute_or_trace_source&amp;diff=4491"/>
		<updated>2010-06-08T16:11:55Z</updated>

		<summary type="html">&lt;p&gt;Fax: Added hint on logging Config-related messages&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Aggregated Objects==&lt;br /&gt;
$-prefixed items in a path are used to perform an aggregation lookup using the TypeId of the Object you are looking for.&lt;br /&gt;
Since almost all TypeIds have a ns3:: prefix, you will usually see the compound prefix $ns3:: &lt;br /&gt;
&lt;br /&gt;
Example: &lt;br /&gt;
&amp;lt;pre&amp;gt;/NodeList/*/$ns3::TcpL4Protocol&amp;lt;/pre&amp;gt; &lt;br /&gt;
the above path works because ns3::TcpL4Protocol instances are aggregated to the node in which they exist.&lt;br /&gt;
On the other hand see this one:&lt;br /&gt;
&amp;lt;pre&amp;gt;/NodeList/0/DeviceList/0/$ns3::WifiRemoteStationManager&amp;lt;/pre&amp;gt; &lt;br /&gt;
the above path is getting device 0 in node 0, and, then, doing GetObject&amp;lt;WifiRemoteStationManager&amp;gt;&lt;br /&gt;
on it but it gets null because the remote station manager is not&lt;br /&gt;
aggregated to the device.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Objects referenced by attributes of other Objects==&lt;br /&gt;
2) non-$ prefixed non-terminating items in a path are used to perform an&lt;br /&gt;
attribute lookup on an attribute of type Pointer. This is often used as an alternative to object aggregation.&lt;br /&gt;
&lt;br /&gt;
As an example, when using a wifi device:&lt;br /&gt;
&amp;lt;pre&amp;gt;/NodeList/0/DeviceList/0/RemoteStationManager/MacTxDataFailed&amp;lt;/pre&amp;gt; &lt;br /&gt;
the above path works, because devices with TypeId ns3::WifiNetDevice have a RemoteStationManager attribute which is of type Ptr&amp;lt;WifiRemoteStationManager&amp;gt;. On the other hand, see this one:&lt;br /&gt;
&amp;lt;pre&amp;gt;/NodeList/0/TcpL4Protocol&amp;lt;/pre&amp;gt; &lt;br /&gt;
the above path doesn't work, &amp;lt;pre&amp;gt;/NodeList/0&amp;lt;/pre&amp;gt; gets you to a Node Object, and there is no Attribute named TcpL4Protocol. All this in spite of the fact that TcpL4Protocol is aggregated with Node -- remember that for querying aggregated objects you need the $ prefix.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Hints==&lt;br /&gt;
* A nice way to figure out a path is to [[HOWTO use the ConfigStore | use the ConfigStore]]: if you use it to dump all attributes in a text file, you can see a valid path for each attribute (this, arguably, does not work for trace sources).&lt;br /&gt;
* Also, note that there is a 'Config' LogComponent: just activate it by stating &amp;lt;code&amp;gt;LogComponentEnable (&amp;quot;Config&amp;quot;, LOG_LEVEL_ALL);&amp;lt;/code&amp;gt; somewhere in your simulation script.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
*http://groups.google.com/group/ns-3-users/browse_thread/thread/c162f5a8d13fe9d1/67b21278f7abf925?lnk=gst&amp;amp;q=config#67b21278f7abf925&lt;br /&gt;
*http://mailman.isi.edu/pipermail/ns-developers/2009-August/006350.html&lt;/div&gt;</summary>
		<author><name>Fax</name></author>
	</entry>
	<entry>
		<id>https://www.nsnam.org/mediawiki/index.php?title=HOWTO_determine_all_the_available_Values&amp;diff=4485</id>
		<title>HOWTO determine all the available Values</title>
		<link rel="alternate" type="text/html" href="https://www.nsnam.org/mediawiki/index.php?title=HOWTO_determine_all_the_available_Values&amp;diff=4485"/>
		<updated>2010-06-07T09:36:05Z</updated>

		<summary type="html">&lt;p&gt;Fax: Created page with '{{TOC}}  == HOWTO determine all the available Values == Let us suppose you want to create an attribute for some object. Once you decide the type of the attribute (eg. unsigned in…'&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TOC}}&lt;br /&gt;
&lt;br /&gt;
== HOWTO determine all the available Values ==&lt;br /&gt;
Let us suppose you want to create an attribute for some object.&lt;br /&gt;
Once you decide the type of the attribute (eg. unsigned integer, Time value, ...), you will need to specify an appropriate constructor and an appropriate checker.&lt;br /&gt;
&lt;br /&gt;
For instance, the following is an excerpt from the PacketSink object:&lt;br /&gt;
    .AddAttribute (&amp;quot;Local&amp;quot;, &amp;quot;The Address on which to Bind the rx socket.&amp;quot;,&lt;br /&gt;
                   AddressValue (),&lt;br /&gt;
                   MakeAddressAccessor (&amp;amp;VoipPacketSink::m_local),&lt;br /&gt;
                   MakeAddressChecker ())&lt;br /&gt;
&lt;br /&gt;
As a consequence you may want to check if the value you have in mind has already been defined.&lt;br /&gt;
You can retrieve the list of all available values, by just giving the following command (YMMV):&lt;br /&gt;
    egrep -A3 -RIe 'AddAttribute' src/ | egrep '.Value \(' | sed 's/\(Value\)\(.*$\)/\1/g' | rev | awk '{print $1}' | rev | sort -u&lt;/div&gt;</summary>
		<author><name>Fax</name></author>
	</entry>
	<entry>
		<id>https://www.nsnam.org/mediawiki/index.php?title=HOWTOs&amp;diff=4484</id>
		<title>HOWTOs</title>
		<link rel="alternate" type="text/html" href="https://www.nsnam.org/mediawiki/index.php?title=HOWTOs&amp;diff=4484"/>
		<updated>2010-06-07T09:25:37Z</updated>

		<summary type="html">&lt;p&gt;Fax: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TOC}}&lt;br /&gt;
== How to do Various Interesting Things with ns-3 ==&lt;br /&gt;
&lt;br /&gt;
=== System-Related Items ===&lt;br /&gt;
&lt;br /&gt;
* [[HOWTO make ns-3 interact with the real world]]&lt;br /&gt;
* [[HOWTO use VirtualBox to run simulations on Windows machines]]&lt;br /&gt;
* [[HOWTO get ns-3 running on Mac OS X (10.5.2 Intel)]]&lt;br /&gt;
* [[HOWTO get ns-3 running on Mac OS X (10.6.2 Intel)]]&lt;br /&gt;
* [[HOWTO Use Linux Containers to set up virtual networks]]&lt;br /&gt;
* [[HOWTO use VMware to set up virtual networks (Windows)]]&lt;br /&gt;
* [[HOWTO use ns-3 scripts to drive real hardware (experimental)]]&lt;br /&gt;
* [[HOWTO use ns-3 directly on the ORBIT testbed hardware]]&lt;br /&gt;
* [[HOWTO use ns-3 in the ORBIT testbed environment]]&lt;br /&gt;
* [[HOWTO use ns-3 directly on the CMU wireless emulator]]&lt;br /&gt;
&lt;br /&gt;
=== Programming-Related Items ===&lt;br /&gt;
* [[HOWTO make and use a new application]]&lt;br /&gt;
* [[HOWTO extract the IP src/dst address from a packet]]&lt;br /&gt;
* [[HOWTO create a new type of protocol header or trailer]]&lt;br /&gt;
* [[HOWTO use null callbacks]]&lt;br /&gt;
* [[HOWTO create a new OSI layer 1 + 2 implementation]]&lt;br /&gt;
* [[HOWTO create a traffic generator]]&lt;br /&gt;
* [[HOWTO configure eclipse with ns-3]]&lt;br /&gt;
* [[HOWTO determine the path of an attribute or trace source]]&lt;br /&gt;
* [[HOWTO use the ConfigStore]]&lt;br /&gt;
* [[HOWTO determine all the available Values]]&lt;br /&gt;
&lt;br /&gt;
=== Debugging-Related Items ===&lt;br /&gt;
* [[HOWTO use NS_LOG to find a problem]]&lt;br /&gt;
* [[HOWTO understand and find cause of terminated with signal errors]]&lt;br /&gt;
&lt;br /&gt;
=== Mercurial-Related Items ===&lt;br /&gt;
* [[HOWTO use Mercurial Queues to manage your ns-3 patches]]&lt;br /&gt;
&lt;br /&gt;
== Developers' Pages ==&lt;br /&gt;
* [http://gicl.cs.drexel.edu/people/tjkopena/wiki/pmwiki.php?n=NS3.NS3 Joseph Kopena's ns-3 wiki]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
[[User:Craigdo|Craigdo]] 16:34, 22 April 2010 (UTC)&lt;/div&gt;</summary>
		<author><name>Fax</name></author>
	</entry>
	<entry>
		<id>https://www.nsnam.org/mediawiki/index.php?title=HOWTO_use_the_ConfigStore&amp;diff=3161</id>
		<title>HOWTO use the ConfigStore</title>
		<link rel="alternate" type="text/html" href="https://www.nsnam.org/mediawiki/index.php?title=HOWTO_use_the_ConfigStore&amp;diff=3161"/>
		<updated>2009-09-21T21:03:41Z</updated>

		<summary type="html">&lt;p&gt;Fax: changed from ConfigureEarly and ConfigureLate to ConfigureDefaults and ConfigureAttributes&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==File-based ConfigStore==&lt;br /&gt;
You need your simulation program to be written like this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
int main (...)&lt;br /&gt;
{&lt;br /&gt;
  CommandLine cmd;&lt;br /&gt;
  cmd.Parse (...);&lt;br /&gt;
&lt;br /&gt;
  ConfigStore config;&lt;br /&gt;
  config.ConfigureDefaults ();&lt;br /&gt;
&lt;br /&gt;
  ... topology creation&lt;br /&gt;
&lt;br /&gt;
  config.ConfigureAttributes ();&lt;br /&gt;
&lt;br /&gt;
  Simulator::Run ();&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
then run your simulation program with the following parameters to save a plain text file (in this example, config.txt):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./waf --run &amp;quot;scratch/myprogram --ns3::ConfigStore::Mode=Save --ns3::ConfigStore::Filename=config.txt&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==GtkConfigStore==&lt;br /&gt;
&lt;br /&gt;
You need your simulation program to be written like this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
int main (...)&lt;br /&gt;
{&lt;br /&gt;
&lt;br /&gt;
  ... topology creation&lt;br /&gt;
&lt;br /&gt;
  GtkConfigStore configstore;  &lt;br /&gt;
  configstore.ConfigureAttributes();&lt;br /&gt;
&lt;br /&gt;
  Simulator::Run ();&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then before the simulation runs a window will pop up allowing you to browse Object attributes and to save/load the configuration.&lt;/div&gt;</summary>
		<author><name>Fax</name></author>
	</entry>
</feed>