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

\subsection {The {\var net} Entry}\label{simNetAppendix}

The {\var net} entries in the {\var xsim.data} file specify the kinds
of networks to include in the simulated internet, the parameters for
these networks (e.g., bandwidth, latency), and the IP addresses for
all networks, routers, and hosts involved in the simulation.  The
connectivity for the entire internetwork is specified by the {\var
net} entries alone.

In the {\var xsim.data} file, a particular {\var net} entry must come
{\it after} the entries of all hosts and routers that it connects.
The syntax of a network entry is defined as follows:

\begin{verbatim}
net <type> <net address>;
  connections = <name> [instance] <address>, <name> [instance] <address>,... ;
  args = <arg>, <arg>, ... ;
\end{verbatim}

The {\var net} line specifies the type of network. Two types of
networks are currently defined: Ethernet ({\var ETH}) and
point-to-point ({\var PP}). The properties of each type are documented
in subsequent sections.  The {\var <net address>} field specifies the
network IP address.  The host portion of this address can be 0,
although the full address may be specified, as is done in the example
given in the previous section.

The {\var connections} line lists the IP addresses of the hosts and
routers connected to this particular network; only the host part of
the IP address should be specified.  The optional {\var instance} is
used only when specifying a host, and indicates the name of the driver
instance that is connected at that IP address (e.g., {\var ethd/1}).

There are several things to keep in mind when specifying IP addresses
for networks, hosts, and routers.

\begin{itemize}

\item The simulator only saves the last two bytes of an IP address in
a trace entry. This is done to conserve space.  Therefore, to get
unambiguous trace results, each host and router should be uniquely
identified by the last two bytes of its IP address.

\item The simulator calculates the full IP address for a host or
router by performing a logical OR between the network IP address
(specified in the {\var net} line) and the host IP address (from the
{\var connections} line).

\item For a large internetwork, judicious choices of IP addresses
can make the job of specifying routing tables in the {\var router}
entry easier.  See Section~\ref{router_entry} for information on how
to pick IP addresses so that it is easier to use the routing
``shortcuts'' provided by the simulator.

\end{itemize} 

The {\var args} line includes parameters specific to the type of the
network being defined, and are used to define aspects of the network
such as its bandwidth, the network MTU, and the associated framing
overhead.  Parameters for Ethernet are listed in Section~\ref{ETH},
paremeters for point-to-point links are given in Section~\ref{PP}.  A
syntactic point to be aware of is that no spaces should be included
anywhere between the argument and its value: {\var rate=10Mb}.

\subsubsection{Ethernet ({\var ETH})}\label{ETH}

The Ethernet network type simulates a multiple access network with
optional collision detection.  Note that this is really an abstract
network type, capable of simulating networks with a variety of
characteristics.  If no arguments are specified, the network's default
configuration is that of a 10Mbps Ethernet, with the exception that
collision detection is disabled.  However, the bandwidth, latency,
packet overhead, and MTU can be changed to produce networks with
behaviors different from that of the standard Ethernet.

The following arguments can be specified on the {\var args} line of an
Ethernet entry.

\begin{verbatim}
collisions= on | off 
\end{verbatim}
 
Enables/disables Ethernet collisions.  When this option is off, two or
more hosts are allowed to successfully transmit on the Ethernet
simultaneously.  When on, if two hosts send simultaneously, a
collision is detected and the hosts perform the Ethernet exponential
backoff algorithm.  The default is {\var off}.
 
\begin{verbatim}
delay=<integer>[unit]
\end{verbatim}
 
Sets the latency, that is, the time it takes for a packet to propagate
from one end of the network to the other.  The optional unit can be
{\var us} (microseconds), {\var ms} (milliseconds), or {\var s}
(seconds).  The default value is 0, and the default unit is
microseconds.
 
\begin{verbatim}
maxPacket=<integer>
\end{verbatim}

Specifies, in bytes, the maximum packet size for the network.  Packets
larger than this maximum should be fragmented by a higher-level
protocol; if they are not, they will be dropped.  The default {\var
maxPacket} for {\var ETH} is 1518, comprising 1500 bytes of payload,
14 bytes of Ethernet header, and a 4-byte CRC.

\begin{verbatim}
minPacket=<integer>
\end{verbatim}
 
Specifies, in bytes, the minimum packet size for that network.
Packets smaller than the minimum will be padded.  The default {\var
minPacket} for {\var ETH} networks is 64 bytes, 14 of which are for
the Ethernet header, and 4 for the CRC.
 
\begin{verbatim}
pktHeader=<integer>
\end{verbatim}
 
For use with {\var minPacket} and {\var maxPacket}. The simulator adds
the value of {\var pktHeader} to the length of the message pushed to
SIM to determine the packet's length. In {\var ETH}, since the header
is attached by the {\var ethd} protocol, the network's {\var
pktHeader} defaults to 0.  In other words, the size of a {\it packet}
is given by the size of the {\it message} pushed to SIM, plus {\var
pktHeader}.  If {\it packet} $<$ {\var minPacket}, it is padded; if
{\it packet} $>$ {\var maxPacket}, it is dropped.  When using {\var
ETH} networks to model other types of networks, one may want to use
negative values for {\var pktHeader} when the modeled network's header
is less than 14 bytes.

\begin{verbatim}
pktOverhead=<integer>
\end{verbatim}
 
Conceptually, this option adds the specified number of bytes to each
packet as it is transmitted on the network.  The intended use is to
model the overhead consumed by framing information.  The added {\var
pktOverhead} does not count as part of the packet length from the
standpoint of {\var minPacket} or {\var maxPacket}.  The default is 8,
as Intel's Lance uses 8 bytes for framing.

\begin{verbatim}
rate=<real>[unit] | T1 | T3
\end{verbatim}
 
Sets the bandwidth, in units per second, for the network.  The rate
can be a positive real number followed immediately by an optional
unit.  The unit is one of: {\var MB}, {\var Mb}, {\var KB}, {\var Kb},
{\var B}, or {\var b}. A {\var B} in all units represents bytes and
{\var b} denotes bits.  For instance, {\var 4.5Mb} specifies a
bandwidth of 4.5 mega{\it bits} per second.  If no unit is specified,
the default is bytes.  {\var T1} and {\var T3} can also be specified
as rates.  {\var T1} corresponds to approximately 1.5Mbps, and {\var
T3} is about 45Mbps. For Ethernet, the default bandwidth is 10Mbps.
 
\subsubsection {Point-to-point Links (PP)}\label{PP}

The point-to-point network type can be used to connect two routers or
hosts.  It differs from the Ethernet in that it should be thought of
as two links, one in each direction.  Packets flowing in one direction
cannot affect flows in the other direction.

The following arguments can be used to modify the behavior of a
simulated point-to-point link.  They have the same meanings as those
specified above for the Ethernet.

\begin{verbatim}
delay=<integer>[unit]                  # default is 0
minPacket=<integer>                    # default is 0
maxPacket=<integer>                    # default is 1500
pktHeader=<integer>                    # default is 0
pktOverhead=<integer>                  # default is 0
rate=<real>[unit] | T1 | T3            # MUST be specified
\end{verbatim}






