Basic Concepts
--------------

Before going further, it will be helpful to understand a few basic concepts.

Network: The term network is used to define a collection of similar devices
	 that are somehow connected to each other.  A good example of a
	 network would be the telephone system.  In a computer network, the
	 devices would be computer systems.

Protocol: Protocols define the rules by which devices on a network abide
	  by to communicate with each other.  Some of the different things
	  that protocols define are how data is to be sent from one object
	  to another, what format the data must be in, and how multiple
	  devices are to send data on the same network medium.

Addressing: In order for one device on a network to send data to another
	    device, there must be a method defined for indentifying each
	    machine.  This method is known as addressing, and is defined
	    by the particular network protocol being used.

Node Number: Each device (or node) that is connected to a network must have
	     a unique number that is associated with it.  This number is
	     usually known as the device's node number.  In some cases, the
	     device's node number may also contain information that identifies
	     which network a node is on.

Host: The term host is often used to describe a computer system connected
      to a network, and will be used throughout the rest of this section.

Host Name: In almost all networking systems, each node on a network will
	   be given a name that will be used by user's to identify it, instead
	   of users having to remember the node's network address.


The Internet
------------

Probably the largest network in existance today is the Internet (notice
the capital 'i'.).  The Internet consists of well over a million hosts
connected over thousands of networks all over the world.  All of the
host on the Internet use a common set of protocols to talk to one another.

The one protocol that each host on the Internet must be able to understand
is (not suprisingly) known as the Internet Protocol, or IP. This protocol is
the base in which all other protocols in use on the Internet depend on to
function.

The current version of Envoy also uses the Internet Protocol, which means
that a host using Envoy is capable of communicating with other host using Envoy
anywhere in the world, as long as both of them are connected to the Internet.


Internet Addressing
-------------------

The Internet Protocol specifies that each host on the Internet will have
a 32-bit number that uniquely identifies that host.  This number is
known as the host's IP Address.

IP Addresses contain information to identify which network a host is on,
and what the hosts's node number is.

Because networks can vary in size, IP Addressing was designed to handle
anything from networks with only 200 or so hosts, up to networks with
up to 16 million hosts.  This was done was by creating different classes
of addresses which are identified by the first part of the IP Address.
At the present time, there are currently three classes of IP Addresses, known
as A, B and C.

Class A IP Addresses are those with the first byte of the address being
in the range of 0 to 127.  Class B IP Addresses are those with the first
byte of the address being in the range of 128 to 191.  Class C addresses
are those with the first byte of the Addressing being in the range of
192 to 223.  The rest of the remaining address space is reserved for future
use.

Each of the three currently defined address classes break the IP Address
down into a network portion and a host portion.  Class A IP Addresses use
the first byte of the address to indentify a network, and the remaining
three bytes to indentify a host.  Class B IP Addresses use the first two
bytes of the address to indentify a network, and the last two bytes to
indentify a host.  Class C IP Addresses use the first three bytes to indentify
a network and the last byte to indentify a host.

For convenience, IP Addresses are usually written as four decimal numbers
separated by periods, with each number being in the range of 0 to 255.
An example IP Address written in this form would be 137.239.16.3, which
happens to be the IP Address of Commodore's Internet mail server.  Network IP
Addresses are usually written with the host portion of an address set to
all 0's.  So, the network that Commodore's mail gateway is on would be written
as 137.239.0.0.


Routing
-------

Due to the fact that part of an IP address is used to identify a network,
and part of the address identifies a host, it is easy for a host to determine
whether or not another host is on the same network or not.  For example,
if a host with an address of 137.239.16.1 wanted to send data to a host
with an address of 137.239.92.4, it would be able to send the data directly
because both addresses have the same network address of 137.239.0.0. (Network
addresses are usually written with the host portion of an address set to
all 0's.)

However, if a machine with an address of 137.239.16.1 wanted to send data
to a host with an address of 141.219.70.1, it would have a problem because
the other machine wasn't on same network.

In order for the first host to send data to a host on another network, it will
have to forward it's data to a machine on it's network that is capable of
sending data to other networks.  Machines that are capable of transferring
data from one network to another are known as routers or gateways.

Looking at the diagram below, machine A is on a network with an address of
137.239.0.0.  Machine C is on a network with an address of 141.219.0.0.
Machine C is connected to both networks.  Machine B in this case is a router.

             +-+
             |A| 137.239.16.1
             +-+
              |
--------------+-----------------------+----------------------- 137.239.0.0
				      |
				     +-+ 137.239.32.200
				     |B|
				     +-+ 141.219.21.10
				      |
--------------------------------------+----------+------------ 141.219.0.0
						 |
						+-+
						|C| 141.219.70.1
						+-+

Machines on the 137.239.0.0 network that want to send data to machines
on the 141.219.0.0 network will need to know to send data to machine
B where it will be forwarded.  Likewise, machines on the 141.219.0.0 network
will need to send packets destined for the 137.239.0.0 network to machine
B.

Machines using the IP Protocol keep a list of destination networks and
the router or gateway to use to get to that network.  This list, or routing
table, is what allows machine A to know how to get to machine C.

For the network above, machine A would have two entries in it's routing
table, as would machine C.

         	Destination	Gateway

Machine A	137.239.0.0	137.239.16.1
		141.219.0.0	137.239.32.200
-----------------------------------------------
Machine B	141.219.0.0	141.219.70.1
		137.239.0.0	141.219.21.10


Machine B would also have two entries in it's routing table:

		Destination	Gateay

Machine B	137.239.0.0	137.239.32.200
		141.219.0.0	141.219.21.10


One thing that may seem confusing are the entries in which the gateway address
is the same as the machine itself.  These routes are added automatically
by the networking software at startup time.  Routes for other networks that
aren't directly connected to machines must be added manually.  However, this
would soon become annoying if a user had to add a route for every possible
destination network that his machine might talk to.

In order to avoid this, it is possible to specify a default route to use
when a specific destination/gateway entry doesn't exist for a given network.
This is done by specifying a destination of 0.0.0.0.  (The Envoy Network
Configuration editor also understands the word "default", and will display
that word for a route with a destination network address of 0.0.0.0).

So, the three machines' routing tables could be configured as follows:

         	Destination	Gateway

Machine A	137.239.0.0	137.239.16.1
		default		137.239.32.200
-----------------------------------------------
Machine B	137.239.0.0	137.239.32.200
		141.219.0.0	141.219.21.10
-----------------------------------------------
Machine C	141.219.0.0	141.219.70.1
		default		141.219.21.10


Default routes will not work in all cases, however.  Care should be
taken to avoid creating loops.  Consider the networks below.

             +-+
             |A| 137.239.16.1
             +-+
              |
--------------+--+----------------------------------------+-- 137.239.0.0
		 |                                        |
		+-+ 137.239.32.200                	  |
		|B|                                       |
		+-+ 141.219.21.10                         |
		 |                                       +-+ 137.239.18.5
-----------------+----------+------------ 141.219.0.0	 |D|
			    |                            +-+ 169.142.20.3
			   +-+ 141.219.70.1      	  |
			   |C| 				  |
			   +-+ 169.142.10.100		  |
			    |                             |
----------------------------+-----------------------------+


In this situation, the routing tables might (incorrectly) be set up like this:

         	Destination	Gateway

Machine A	137.239.0.0	137.239.16.1
		default		137.239.32.200
-----------------------------------------------
Machine B	137.239.0.0	137.239.32.200
		141.219.0.0	141.219.21.10
		default		141.219.70.1
-----------------------------------------------
Machine C	141.219.0.0	141.219.70.1
		169.142.0.0	169.142.10.100
		default		169.142.20.3
-----------------------------------------------
Machine D	137.239.0.0	137.239.18.5
		141.219.0.0	141.219.20.3
		default		137.239.32.200


The problem with this setup is that if machine A decided to send data to
a machine with an address of 192.9.210.105, the data would end up in a
loop.  The data would follow the path A-->B-->C-->D-->B-->C and so on.
If any of the three machines acting has a gateway instead had explicit
routes for all three networks instead of a deault route, the loop would
not occur, because the data would eventually arrive at a machine that
didn't know how to forward it, where it would then be lost.



Subnet Masks
------------

Usually on large class A or class B networks it is advantageous to break a
network up into smaller pieces improve performance and to make managing the
network easier.

For example, a site such as a large university with hundreds of machines
spread out over a large area would most likely break it's network up into
smaller pieces, perhaps having a seperate network for each floor in every
building.  This would have several advantages, the main one being performance.
Because machines on a single floor are more likely to talk to machines on
the same floor, than talk to machines across campus, network traffic would be
isolated to a relatively small area.  High speed networks such as FDDI (fiber
optic) could then be used to interconnect the smaller networks.

In similar fasion, a company with a large building with only a few floors
might wish to use a seprate local area network for different divisions of
the company, such as Marketing, Sales, Engineering, etc.

One of the more common ways to break up a network is subnetting.  Subnetting
allows you to extend the portion of an IP network address that is used to
identify a network.  For example, a class B network would normally use the
first two bytes of the address to identify the network, leaving the last
two bytes to identify a host.  With subnetting, the network portion could
be extended so that the first three bytes identify a network, leaving the
last byte to identify a host, effectively breaking a class B address up into
many smaller class C networks.




Choosing an IP Network Address
------------------------------

If you ever plan to have your network attached to the Internet, then you
must contact the NIC to have an IP Network address assigned for your site.
Some companies that supply Internet connections may be able to do this for you.
Even if you do not plan to hook your network up to the internet, it may be
a good idea to have a network address assigned to you just in case.  If you
do not have a network addresses assigned and later choose to connect to the
Internet, you will have to renumber all of your systems.

If you are absolutely certain that you will never be connected to the Internet,
you may choose any network address that you would like, keeping in mind the
requirements for your network.

If your site already has a network installed, you should contact your system
administrator to see if your site already has an assigned IP network address.
You network administrator will also be able to help you with questions about
configuring Envoy's routing tables.


