\section{Output}\label{output}

The {\var megtest} and {\var traffic} protocols print some general
information to the display while the simulator is running.  The
simulated time elapsed is shown, along with messages from individual
hosts about their states and error conditions.  At the completion of a
run, summary information is printed about the {\var megtest} transfer
or {\var traffic} conversations.

The most interesting and important output generated by a simulation,
however, takes the form of trace files.  The protocols and routers
included with the simulator have had trace statements inserted at
places in the code where significant events occur; each trace
statement writes a few bytes to a trace file, indicating the event and
recording relevant state.  See the ``Data Trace Library'' section of
the {\xk} Programmer's Manual for information on the this tracing
facility \cite{ProgMan_3.3}.  Also, see the code for the TCP Vegas
protocol in {\var /xkernel/simulator/protocols/vtcp} for an example of
how to augment a protocol with trace statements. The file {\var
README.trace} in this directory lists all of the protocol's trace
statements, and explains where each occurs and what information it
saves.  For an example of how to add trace statements to a driver
protocol, see {\var /xkernel/simulator/sim/ethd}.

Two graphical display tools have been developed to convert the trace
files generated by a simulation into readable PostScript graphs. They
are {\var ptcp} and {\var extrace}, and both can be found in {\var
/xkernel/bin/solaris-sparc}, {\var /xkernel/bin/sunos-sparc} or {\var
/xkernel/bin/osf1-alpha}, depending on the system you are using.  The
{\var ptcp} tool generates TCP-specific graphs, displaying such
information as the size of the send window and the time when a packet
was retransmitted.  Graphs produced by {\var extrace} show changes in
queue sizes on the routers. For an explanation of how to interpret the
output from these two tools, see Section~\ref{Ptcp} and Section
~\ref{Extrace}.
