%
% x-kernel v3.3
%
% Copyright (c) 1996,1993,1991,1990  Arizona Board of Regents
%

\section{Example Internet Configuration}\label{example}

A simulated internet is constructed out of three kinds of building
blocks: {\it networks}, {\it routers}, and {\it hosts}.  The {\var
xsim.data} file describes all aspects of the simulated internet,
including its topology, its link types and speeds, the buffer space
available on its routers, and the protocol stacks running on its
hosts.  The following section presents an {\var xsim.data} file for
a simple internetwork.

Our example internet contains two Ethernets and a 200KBps
point-to-point link.  A FCFS router attaches to each Ethernet, and the
point-to-point link connects the routers.  Two hosts, ``1'' and ``2'',
are configured on each Ethernet, for a total of four hosts.  When the
simulator is executed, a 1MB file is transferred between the hosts
named ``1''; the hosts named ``2'' conduct random {\it tcplib}
transfers to provide the background traffic \cite{Danzig91sigcomm}.
Figure~\ref{internet} shows a picture of our example internet.

\begin{figure}[ht]
\centering
\leavevmode\hbox{\epsfig{file=internet.eps,height=2.0in}}
\caption{The internet to be simuated.}\label{internet}
\end{figure}

Here is the {\var xsim.data} file we've constructed to represent the
pictured internet:

\input xsim.data

We now highlight certain aspects of this {\var xsim.data} file, and
point out how parts of this file correspond to features of the
internet of Figure~\ref{internet}.  For more details on any of the
items discussed, see Section~\ref{spec}.

The first lines of the example file contain {\var set} commands.  The
{\var set} command simply associates a variable with a string.
Subsequent references to the variable, prefixed with a {\var \$} sign,
are replaced by the associated string.

Next, we find a group of {\var host} entries.  These entries define
the configurations and behaviors of the four hosts shown in
Figure~\ref{internet}.  Following the keyword {\var host} in each
entry is the host's name.  The {\var protocols} line in each {\var
host} entry indicates the protocol stack on that host; those hosts
with {\var megtest} at the top of their stack will stream the 1MB
file, while those with {\var traffic} on the stack will conduct the
random transfers. (The protocol stacks are not shown in
Figure~\ref{internet}.)  Finally, the {\var args} line contains
arguments interpreted by the host's protocols.  An argument of
particular significance is the {\var -c192.0.2.1} of host {\var h1n1},
which indicates that this host is a {\var megtest} client talking to a
server at IP address 192.0.2.1; correspondingly, host {\var h1n2}
specifies the {\var -s} argument to indicate its willingness to accept
a {\var megtest} connection from any client.  The {\var -hosts 1
192.0.2.2} argument of host {\var h2n1} similarly indicates that this
host is a {\var traffic} client, talking to a server at the given IP
address.

Following the host specifications are entries to define the two
routers.  The keyword {\var router} is followed by the type of router
(FCFS) and the router's name.  The {\var rtable} line lists the
routing table for the router.  Referring to Figure~\ref{internet} and
the entry for router {\var r1}, we note that since the router connects
to network 192.0.1.0, it forwards packets with that network
destination directly to the appropriate host. However, it directs
packets addressed to network 192.0.2.0 to the router at IP address
192.0.3.2.  The final lines of a given {\var router} entry contain
arguments used to configure that router.

Now consider the {\var net} entries that specify the two Ethernets and
the point-to-point link.  The first line lists the type of network
(e.g., ETH) and its network IP address.  The {\var connections} line
lists all of the routers and hosts connected to the network, and
assigns them their IP addresses. In the case of hosts, a driver
instance---{\var ethd} in the example---is also specified.  The {\var
args} line sets various network-specific parameters, such as the
200KBps rate of the point-to-point link.

The next section documents all aspects of the {\var xsim.data} file in
detail.  Section~\ref{more_examples} then presents a second, much larger,
{\var xsim.data} file.
