745 extending the tracing namespace and creating new tracing sources. |
745 extending the tracing namespace and creating new tracing sources. |
746 |
746 |
747 @cindex tracing |
747 @cindex tracing |
748 @cindex ASCII tracing |
748 @cindex ASCII tracing |
749 @subsection ASCII Tracing |
749 @subsection ASCII Tracing |
750 @command{Ns-3} provides an ASCII trace helper that is a wrapper around the |
750 @command{Ns-3} provides functionality wrapping the low-level tracing system |
751 low-level tracing system. This helper lets you configure some useful and |
751 to help you with the details involved in configuring some easily |
752 easily understood packet traces easily. The output of a trace of a simulation |
752 understood packe traces. If you enable this functionality, you will see |
753 run is an ASCII file --- thus the name. For those familiar with |
753 output of a trace of a simulation appear in an ASCII file --- thus the name. |
754 @command{ns-2} output, this type of trace is analogous to the @command{out.tr} |
754 For those familiar with @command{ns-2} output, this type of trace is |
755 generated by many scripts. |
755 analogous to the @command{out.tr} generated by many scripts. |
756 |
756 |
757 @cindex tracing packets |
757 @cindex tracing packets |
758 Let's just jump right in and add some ASCII tracing output to our |
758 Let's just jump right in and add some ASCII tracing output to our |
759 @code{first.cc} script. The first thing you need to do is to add the |
759 @code{first.cc} script. The first thing you need to do is to add the |
760 following code to the script just before the call to @code{Simulator::Run ()}. |
760 following code to the script just before the call to @code{Simulator::Run ()}. |