			Installing the FoxNet

FoxNet version 2 runs on Dec Alpha/OSF1 (v2.0 and later) and
MIPS/Ultrix (4.4).  To run the FoxNet on one of these machines, you
will need the foxml modified SML/NJ 109 ("FoxML") compiler for your
architecture and FoxNet sources available from by anonymous ftp.
FoxML sources are also available.

1. Get the latest distribution of the FoxNet by anonymous ftp from
   ftp.cs.cmu.edu in plain, compressed (.Z) and gzipped (.gz) formats.
   You will need the sml code:

	foxnet.src.YY.MM.DD.tar.Z

   the compiler executable

	either foxnet.bin.alpha32-osf1.YY.MM.DD.tar.Z
	or foxnet.bin.mipsel-ultrix.YY.MM.DD.tar.Z

   and, optionally, the compiler sources:

	foxnet.foxml-source.YY.MM.DD.tar.Z

2. Unpack FoxML and the FoxNet sources using uncompress or gunzip and
   tar.  For example

	% uncompress foxnet.src.YY.MM.DD.tar.Z
	% tar xf foxnet.src.YY.MM.DD.tar

3. Obtain a new IP number and hostname for your FoxNet from your
   network administrator.  The FoxNet will not work using the same IP
   address as its host machine (or any other machine on the network
   for that matter).

4. Configure the FoxNet

   The FoxNet gathers configuration from structure Hostname_Ip
   (defined in src/prot/init/hostnameip.str), operating system
   configuration files, and, optionally, FoxNet specific
   customizations to these files.  Note: the applications supplied
   assume network interface number 0 is in use.  Specifying another
   interface requires changing the "interface_number" parameter to
   structure Initialize in the application sources (in src/app/*/*).

   In most cases, all you need to do is add a line to Hostname_Ip with
   your hostname and new IP address.  This is described in the section
   "Minimal Configuration" below.

   a) Minimal Configuration

      All parameters except the FoxNet IP address can be obtained
      from the operating system's configuration files.  You can
      simply specify the IP address by adding a line in
      prot/init/hostnameip.str, which exists specifically for this
      purpose.

      The only problem with this is that the translation is
      specified at compile time, so applications won't run on new
      machines.  If this happens, you can modify the system
      configuration files as detailed below (separately for each
      operating system).

   b) Optional OSF1 configuration

      Parameters are read from the files /etc/rc.config,
      /etc/resolv.conf, and /etc/routes, as follows:

	Hostname - given by `FOXNET_HOSTNAME=' (or `HOSTNAME=') line
                   in rc.config.

	IP address - If this is not coded in hostnameip.str, it is given
		     by the the IP number in the `FOXNET_IFCONFIG_<n>='
		     (or `IFCONFIG_<n>=') line in rc.config, where <n>
		     is your network interface number (usually 0).

	Netmask and IP MTU - Found in the same IFCONFIG line as the IP
			     address.  See "man ifconfig" for details.

      The IP gateway to use is taken from /etc/routes, and domain
      server and name information from /etc/resolv.conf.  No provision
      has been made for customizing these for the FoxNet.

   c) Optional Ultrix configuration

      Ultrix configuration files are not as customizable than those of
      OSF1.  The cleanest way to configure the FoxNet is to create an
      /etc/foxnet file.  Otherwise, the FoxNet will look for
      information in /etc/rc, /etc/hostname, /etc/resolv.conf, and
      /etc/hosts.

      Here is a sample /etc/foxnet file (note: entries must start in
      first column):

	Dev.interface_0: ln0
	IP.mask_0: 255.255.0.0
	IP.mtu_0: 500
	IP.hostname_0: fortran.foxnet.cs.cmu.edu
	IP.gateway_0: gw.cs.cmu.edu
	DNS.domain_0: alias.cs.cmu.edu
	DNS.domain_0: cs.cmu.edu
	DNS.domain_0: ri.cmu.edu
	DNS.domain_0: edrc.cmu.edu
	DNS.domain_0: cmu.edu
	DNS.nameserver_0: 128.2.222.180
	DNS.nameserver_0: 128.2.203.61

      /etc/hosts will be searched for the IP address for the FoxNet's
      hostname (fortran.foxnet.cs.cmu.edu in this example) if it is
      not already coded in hostname_ip.str.

5. Configure your system

   First, make sure the kernel your are running supports a
   packetfilter interface.  If the command "/usr/bin/pfstat -f"
   doesn't print anything, have your system administrator install
   the packetfilter by building kernel with "options PACKETFILTER" and
   running MAKEDEV (see "man packetfilter").

   Make sure that the packetfilter pseudo-device files /dev/pfilt/*
   are accessible for both reading and writing:  Either run the FoxNet
   as root, or change the protection of these files.  Be aware of the
   security implication of allowing unrestricted access to the local
   network.

   The FoxNet needs to share some of the packets (e.g. ARP replies)
   that are also handled by the operating system's networking stack.
   To allow this run:

	pfconfig +copyall pf0

   pfconfig is in /usr/etc or /usr/sbin depending on operating system.
   Rebooting your computer will reset the packetfilter, and you will
   have to pfconfig again.  If copyall is not enabled, APR resolution
   will fail and the FoxNet will print a lengthy diagnostic message
   beginning with a line of the form:

	arp.fun(eth): raising exception 'Connection, unable to resolve self = 12.34.56.78., peer = 87.65.43.21., protocol = 2048'

6. Compile and run the FoxNet.

   Change directories to src and start up foxml

	% ../bin/foxml

   then load the FoxNet

	- use "foxnet.use";

   This takes about 30 minutes on a decstation (mips) 5000/200, 20
   minutes on a DEC 3000/400 (alpha), and 6 minutes on a AlphaStation
   250 4/266.  Our machines equipped with 96 MB of memory.

7. Applications.

   Several applications demonstrate the use of the FoxNet to implement
   internet clients and servers.  The "hello" client connects to a
   server and exchanges some information (the name, email address, and
   comments you specify, plus cpu and operating system information).
   We are interested in learning a little about the user of the
   FoxNet, so please connect to our server:

	- use "foxapp.use";
	- build_inetd ();  (* also builds the hello client *)
	- Hello.client "foxnet.cs.cmu.edu";

   Other applications provided are finger, httpd, inetd, ping, and
   telnet.  Load these by executing

	- use_<application-name> ();  (* use "foxapp.use" first *)

   then invoke the appropriate function:

	- Finger.finger "user@host";
	- Ping.ping ("host", 3);
	- Telnet_Client.telnet "host";

   A telnet server is available in structure Telnet_Server and also
   in Full_Inetd, but will only work when run as root.

   The HTTP server is best run as part of Full_Inetd (n.b. httpd
   requires that inetd has already been loaded).  Edit the
   default_prefix_actions in app/httpd/httpd.fun to configure it for
   your system.

   Inetd is an application which supports several services.  A minimal
   configuration is loaded when you execute "use_inetd ();".  Invoke
   it with

	- Inetd.inetd (SOME <time-limit-in-seconds>);

   Evaluating "build_inetd ();" creates a Full_Inetd structure which
   supports http, telnet, and hello services.

   Note: FoxNet applications are not designed to be interrupted.  If
         you type ^C, the FoxNet will be left in an unknown state.
         To recover, execute "Fox_Basis.Scheduler.reset ()" to kill
         all existing coroutines, and reload your application.
