				WANPIPE(tm)

	Multiprotocol WANPIPE Driver for Linux Operating System

			       Release 2.0.3



			  U S E R'S   M A N U A L



			    Document Version 2.0

			      August 25, 1998


			     Author: Jaspreet Singh

	     Copyright (c) 1995-1997 Sangoma Technologies Inc.

------------------------------------------------------------------------------

			      C O N T E N T S

	Introduction ..........................................
	1. WANPIPE Driver Basics ..............................
	2. Installing WANPIPE Driver Package ..................
	   1) Unpack distribution archive......................
	   2) Package Components...............................
           3) Run WANPIPE Driver Setup script..................
	   4) Configure Linux Kernel...........................
	   5) Re-build Linux Kernel............................
	3. Configuring WANPIPE.................................
           1) Run WANPIPE Configure script.....................
           2) Using Configuration files........................
              1) Meta-Configuration file.......................
              2) Interface configuration files.................
              3) Main router configuration file................
		 1) Edit [devices] section.....................
	 	 2) Edit [interfaces] section..................
		 3) Edit device private configuration section..
		 4) Edit/Create Interface configuration section
	4. Configuring FT1 cards...............................
	5. Starting and Stopping WAN Router ...................
	6. Using the FPIPEMON and PPIPEMON monitors ...........
	7. Trouble Shooting and Diagnostics ...................
	8. Technical Support ..................................
	APPENDIX A.............................................
	APPENDIX B.............................................
------------------------------------------------------------------------------
INTRODUCTION

This manual explains how to install and configure the WANPIPE package.

	Conventions used in this Manual
		
	Command line syntax conventions used are as follows:

	command		portion of the command line represented as normal
			text should be entered literally (exactly as printed)

	{argument}	portion of the command line enclosed in currly braces
			represents variable name and should be subsituted by
			the actual object name.

	[option]	portion of the command line enclosed in square brackets
			is optional and can be omitted. 


1. WANPIPE DRIVER BASICS

WANPIPE Driver provides driver support for WANPIPE internal router cards over
Frame Relay, PPP, Cisco HDLC and X25 networks.  The driver supports WANPIPE S508
and FT1/508 cards.   The lastest version of these packages only support WANPIPE 
S508 and FT1/508 cards.  So if you currently own a 502E or a 503 please contact 
Sangoma Technologies Inc. for an upgrade.

 
2. INSTALLING WANPIPE DRIVER PACKAGE

WANPIPE Driver package is distributed as a tar archive on a 3.5" diskette or,
optionally, it can be downloaded from the "/pub/linux/vX.Y.Z" (where vX.Y.Z 
represents the linux kernel version number)  directory located at 
Sangoma's FTP site (ftp.sangoma.com).  

Currently there are two types of packages available at the FTP site:  

	wantools-X.Y.Z.tgz:  	where X.Y.Z is a product version number.
				This archive should always be installed on a 
				CLEAN Kernel (unpatched by WANPIPE Drivers).
 
	wantools_upgrade-X.Y.Z.tgz: where X.Y.Z is a product version number.
				This archive should be installed on a system
                                that contains a prior (lower) version of
				WANPIPE Driver.

The latest software is under the following name:

	wanpipe-X.Y.Z.tgz:	where X.Y.Z is a product version number.
                                This archive should always be installed on a
                                CLEAN Kernel (unpatched by WANPIPE Drivers).

	wanpipe_upgrade-X.Y.Z.tgz: where X.Y.Z is a product version number.
                                This archive should be installed on a system
                                that contains a prior (lower) version of
                                WANPIPE Driver.


It is recommended that a WANPIPE Driver package be installed on a Linux 
Kernel that has no prior installation of WANPIPE Drivers unless upgrading from
an earlier version.  

WARNING:  THIS VERSION ONLY SUPPORTS S508 and S508/FT1 cards.  PLEASE CONTACE
	  SANGOMA TECHNOLOGIES INC. IF YOU WANT TO UPGRADE YOUR OLD S502E or 
	  S503 CARD.

1) Unpack distribution archive.

To unpack the distribution, log in as superuser (root) and change your current
directory to the root directory by executing 'cd /' command.  Note, that this
is the topmost directory in the filesystem, NOT the user root home directory
(which is usually /root).  You can also use the 'su' command to log in as
root from any other user account. 

The files from this distribution are copied into the /usr/lib/router/ directory.

If you received your distribution on a diskette, insert it into a disk drive
and execute the following command:

        tar xf /dev/fd0

The above command assumes that the diskette is in the primary disk drive
(known as drive A: in MS DOS).  If you want to use secondary drive (drive B:),
substitute 'fd0' for 'fd1'. 

WARNING: THIS WILL OVERWRITE THE "/usr/lib/router" DIRECTORY.

If you downloaded the WANPIPE Driver package from the FTP site, use command:

        tar xzf {tarfile}

where {tarfile} is the name (including path) of the tar archive.  For example,
if you placed downloaded distribution wantools-1.0.0.tgz into directory
/home/you, the command would look as follows:

        tar xzf /home/you/wantools-1.0.0.tgz

WARNING: THIS WILL OVERWRITE THE "/usr/lib/router" DIRECTORY.

2) Package Components.

WANPIPE Driver package includes the following components:
	
	o Driver Installation script 		(/usr/lib/router/Setup)
	o Driver Configuration script 		(/usr/lib/router/Configure)
	o Driver start-up script 		(/usr/sbin/router)
	o Driver configuration utility 		(/usr/sbin/wanconfig)
	o Driver configuration files 		(/etc/router.conf and 
							/etc/router.rc)
	o Interface configuration files 	(/usr/lib/router/interfaces/*)
	o Firmware modules for WANPIPE cards 	(/usr/lib/router/wanpipe/*) 
	o Kernel patch file 			(/usr/lib/router/patches)
	o WANPIPE Diagnostic Utilities: 
		- Frame Relay Monitor		(/usr/sbin/fpipemon)
		- PPP Monitor			(/usr/sbin/ppipemon)
		- Cisco HDLC Monitor		(/usr/sbin/cpipemon)
		- Adapter's Memory Viewer 	(/usr/sbin/sdladump)
		- FT1 Configuration Utility	(/usr/sbin/cfgft1)

Additionally, until WANPIPE Drivers become a part of standard Linux
distribution, this package includes kernel patches you will have to apply to 
your Linux source code.  Applying patches is done by the Driver installation 
script, so usually, you won't have to worry about it, even if you have never 
applied kernel patches before.

There are few things, however, you should know about.  First, make sure that
kernel patches are available for your version of Linux kernel.  All supported
kernel versions are listed in Release Notes (/usr/lib/router/README).  Don't
confuse kernel version with the distribution version, as each distributor
keeps its own version numbering.  If you don't know what your kernel version
is, type 'uname -r' at the command prompt.

If your kernel version is not listed, you can install one of the versions that
is.  Most Linux distributions on CD-ROMs contain several kernel versions to
choose from.  If you can't find one of the supported versions on the CD, you
can always download it from the Internet.  If your version is close to one of
the supported ones and you are experienced user, you can apply patches
manually.  Remember though, that in this case you're at your own peril.  But
again, you're experinced user and know what you're doing...

Second, you must have full Linux source code and development system (i.e. GNU
C compiler, make utility, patch etc.) installed on your system.  The Linux 
source tree is usually found in /usr/src/linux directory.  If there is no such 
directory on your machine, or if it's empty, install Linux source code off your 
Linux CD-ROM or download it from the 'Net first.

Third, you must be prepared to re-configure and re-complile Linux kernel after
the installation is complete.  If you never compiled Linux kernel before, ask
someone who did for assistance or read the README file found in /usr/src/linux
directory.

And finally, always back up your Linux source code before applying patches.
Remember, that unlike files, patches are not easily removable, in case you
decide to uninstall this product.


3) Run WANPIPE Driver Setup script.

Change current directory to /usr/lib/router and execute the following command:

        ./Setup

This script will perform the following functions:

        o verify distribution integrity and fix file permissions
        o apply kernel patches
        o install router start-up script (if possible)
        o create configuration files

When applying kernel patches, the Setup script will check the running kernel
version and select appropriate patch (full patch or an upgrade patch).  If the
patch is not available, the script will display a warning.  You may still
continue installation and then apply the patch manually after the installation
is complete.  The Kernel patch file in /usr/lib/router/patches directory is used
to determine whether it is a full or an upgrade patch.  The file names router.gz
and router_upgrade-X.Y.Z.gz represent that respectively.  The Setup script uses
Linux' patch utility when applying kernel patches.  If the patch fails, you may
also COntinue and then examine reject files (*.rej) and attempt to fix the 
problem.  For more information please read patch manual page ('man patch').  
Please also refer to the "patches.txt" document in "/usr/lib/router/doc" 
directory for patches carried out by wanpipe package.

The WANPIPE Driver package includes a start-up script which allows to bring the 
router up and shut it down with a single command.  If your system uses System 
V-style bootstrap procedure, the Setup script will offer you to link the 
start-up script to appropriate system directories so that the router will come 
up automatically when system enters multi-user mode and will be stopped when
entering single-user or when system is shut down.

Note, that this feature is optional.  If your system does not use System
V-style bootstrap or if you chose not to link start-up script, you can always
start and stop router manually by executing 'router start' and 'router stop'
commands respectively.

The Setup script on completion requires you to configure and make the Linux
Kernel again. 

4) Configure Linux kernel.

To configure Linux kernel, change your current directory to /usr/src/linux and
run 'make config'.  Alternatively, you can run 'make menuconfig' for menu-
driven configuration or 'make xconfig', if you are running X-Windows.

If you never configured Linux kernel before, please read /usr/src/linux/README
or ask someone who did for assistance.  In short, the Linux configuration script
will ask you a series of questions regarding your system configuration.  Most
question require single-letter answer: 'y' to enable feature, 'n' to disable
it or 'm' to implement feature as a module.  Entering 'h' brings up a help
text (if available).

When configuring kernel, MAKE SURE YOU ANSWER NO (i.e. 'n' ) to the
following questions:

      	Set version information on all symbols for modules (CONFIG_MODVERSIONS)
	Frame relay DLCI support (EXPERIMENTAL) (CONFIG_DLCI) 

When configuring kernel, MAKE SURE YOU ANSWER YES (i.e. 'y' ) to the
following questions:

        Enable loadable module support (CONFIG_MODULES)
        Kernel daemon support (CONFIG_KERNELD)
        Networking support (CONFIG_NET)
        TCP/IP networking (CONFIG_INET)
        IP: forwarding/gatewaying (CONFIG_IP_FORWARD)
        IP: optimize as router not host (CONFIG_IP_ROUTER)
        WAN Router (CONFIG_WAN_ROUTER)
        Network device support (CONFIG_NETDEVICES)
        WAN Drivers (CONFIG_WAN_DRIVERS)
        ...
	/proc filesystem support (CONFIG_PROC_FS)

After answering 'y' (yes) to the 'WAN Drivers (CONFIG_WAN_DRIVERS)' question you
will be presented with the list of available WAN drivers.  Answer 'y' when
asked 'Sangoma WANPIPE(tm) multiprotocol cards (CONFIG_VENDOR_SANGOMA)'.  The
following configuration options will then be presented:


Maximum number of cards
	CONFIG_WANPIPE_CARDS
	Enter number of WANPIPE adapters installed in your machine.  The
	driver can support up to 8 cards.  You may enter more that you
	actually have if you plan to add more cards in the future without
	re-compiling the driver, but remember that in this case you'll waste
	some kernel memory (about 1K per card).

WANPIPE X.25 support
	CONFIG_WANPIPE_X25
	Say 'Y' to this option, if you are planning to connect WANPIPE
	card to an X.25 network.  If you say 'N', the X.25 support will not
	be included in the driver (saves about 16K of kernel memory).

WANPIPE Frame Relay support
	CONFIG_WANPIPE_FR
	Say 'Y' to this option, if you are planning to connect WANPIPE
	card to a frame relay network.  If you say 'N', the frame relay
	support will not be included in the driver (saves about 16K of
	kernel memory).

WANPIPE PPP support
	CONFIG_WANPIPE_PPP
	Say 'Y' to this option, if you are planning to connect WANPIPE
	card to a leased line using Point-to-Point protocol (PPP).  If you
	say 'N', the PPP support will not be included in the driver (saves
	about 16K of kernel memory).

WANPIPE Cisco HDLC support
	CONFIG_WANPIPE_CHDLC
	Say 'Y' to this option, if you are planning to connect WANPIPE
	card to a leased line using Cisco HDLC protocol.  If you say 'N', 
	the Cisco HDLC support will not be included in the driver.
	
5) Re-build Linux kernel.

If you never compiled Linux kernel before, please read /usr/src/linux/README
or ask someone who did for assistance.  Note that if your machine is slow
and/or has little memory, re-building Linux kernel may take several hours.

Re-building Linux kernel involves executing 'make' command several times with
different arguments:

        run 'make dep' to rebuild source code dependencies,
        run 'make clean' to delete all stale object files,
        run 'make zlilo' or 'make zImage' to build new kernel,
        run 'make modules' to build kernel modules,
        run 'make modules_install' to install modules.

When all this is done, reboot your machine.


3. CONFIGURING WANPIPE 

There are several configuration files associated with WANPIPE.  They
are all in ASCII text format and can be edited with any text editor, such as
vi.  However, we recommend to use an interactive configuration script
(/usr/lib/router/Configure), where applicable, to set up and edit
configuration files, as it ensures correct syntax and can prevent 
misconfigurations.

1) Run WANPIPE Configure Script

Log in as superuser (root) and execute the following command only if you
answered yes to 'install start-up script' in Wantools Setup script:

	router stop

this will stop the WAN Router. Now  change your current directory to 
/usr/lib/router and execute the configuration script by typing:

	./Configure

This will run a script that will let you add/delete interfaces and add/delete 
drivers. The following shows a screen shot of the Configure script.  


		----------------------------------------------------------
	      		Multiprotocol WAN Router Configuration Script
	    	      Copyright (c) 1995-1997, Sangoma Technologies Inc.
		----------------------------------------------------------

		1) show interfaces
		2) add interface
		3) delete interface
		4) add driver
		5) delete driver
		h) help
		q) quit


	Please enter your selection (1..5, h or q) ->


To use the WANPIPE drivers for Sangoma cards enter number 4 to add driver.  The 
Configure script will now let you enter in the name of the driver you require. 
It is necessary that this driver be present on your system.  For WANPIPE 
internal router cards enter:

	wanpipe 

Press <enter> to return to the main menu.  Now you are ready to add interfaces.
The Configure script enables you to add Network interfaces.  A sequence of 
screens lets you enter interface name, interface' IP address, netmask, 
point to point address , its network address and a gateway.  The interface name
could be anything as long as the user remembers to associate the same name in 
the main router configuration file (etc/router.conf). 

As mentioned above, configuration can also be done via files. The following 
section describes the configuration files. 

2) Using Configuration files

1)Meta-configuration file

Router meta-configuration file /etc/router.rc defines location of other files,
such as start-up log file, main router configuration file, etc., and is used
by the router start-up script.  This file is set up by the router setup script
during the installation and rarely needs to be edited.

The meta-configuration file is actually a shell script, although it does not
contain any executable commands, only shell variable definitions.  Still,
usual shell syntax must be observed when editing this file.

The following variables are defined in the meta-configuration file:

    ROUTER_BOOT
        Defines whether to start router (YES) or not (NO).  It is useful if
        you want to prevent router from starting without unlinking start-up
        script or altering main configuration file.
        Default is ROUTER_BOOT=YES

    ROUTER_CONF
        Defines name and location of the main router configuration file.
        Default is ROUTER_CONF=/etc/router.conf

    ROUTER_LOG
        Defines name and location of the router start-up log file.  Log file
        is created by the router start-up script and can be used to
        troubleshoot router configuration.
        Default is ROUTER_LOG=/var/log/router

    ROUTER_LOCK
        Defines name and location of the router lock file.  Lock file is
        created by the start-up script when the router is started and removed
        when it is stopped.
        Default is ROUTER_LOCK=/var/lock/router

    WAN_DRIVERS
        Lists WAN driver to be loaded by the start-up script.  Note, that the
        list must be enclosed in double-quotes and driver names must be
        separated by a space character.
        Default is WAN_DRIVERS=""
	For Sangoma WAN drivers it should include "wanpipe".

You can add/remove drivers to/from the drivers list interactively, using the WAN
Router configuration script (/usr/lib/router/Configure).


2) Interface configuration files

Interface configuration files are put into the /usr/lib/router/interfaces
directory and must have the same names as corresponding network interfaces
defined in the router configuration file (/etc/router.conf).  Like router 
meta-configuration file we discussed earlier, these files are shell 
scripts merely defining some environment variables.  They are 'included' by the 
router start-up script, which then calls 'ifconfig' and 'route' utilities to 
perform actual interface configuration.  The following shows a sample of simple
interface file:


			#!/bin/sh
			# Router interface configuration file
			# name:	fr1
			# date:	Tue May 20 14:23:50 EDT 1997
			#
			ONBOOT=yes
			IPADDR=202.1.2.1
			NETMASK=
			POINTOPOINT=202.1.2.2
			BROADCAST=
			NETWORK=202.1.2.0
			GATEWAY=
 

The following variables are defined in the interface configuration file:

    ONBOOT
        Defines whether to configure this interface (yes) or not (no).  It is
        useful if you want to disable the interface temporarily without deleting
        the configuration file.  Default is ONBOOT=yes

    IPADDR
        Defines IP address for this interface.  IP addresses are written as
        four dot-separated decimal numbers from 0 to 255 (e.g. 192.131.56.1).
        Usually this address is assigned to you by your network administrator
        or by the Internet service provider.

    NETMASK
        Defines network address mask used to separate host portion of the IP
        address from the network portions.  Usually, TCP/IP protocol stack can
        do it by looking at the address itself and deciding whether it belongs
        to address class A, class B or class C.  However, there are situations
        when you may want to override this (e.g. when you create sub-nets
        within your particular address class).  In this case you have to
        supply a netmask.  Like the IP address, the netmask is written as four
        dot-separated decimal numbers from 0 to 255 (e.g. 255.255.255.192).

    POINTOPOINT
        Most WAN links are of point-to-point type, which means that there is
        only one machine connected to the other end of the link and its
        address is known in advance.  This option is the address of the 'other
        end' of the link and is usually assigned by the network administrator
        or Internet service provider.  Like any other IP address, poit-to-point 
	address is written as four dot-separated decimal numbers from 0 to 255
	(e.g. 192.131.56.2).

    BROADCAST
        This option is reserved for media supporting broadcast addressing,
        such as Ethernet

    NETWORK
        This is the address of the network you are connecting to.  It is used 
	to set up the kernel routing tables.  By supplying this address you 
	instruct the kernel to direct all network traffic destined to that 
	network to this interface.  Like any other IP address, the network 
	address is written as four dot-separated decimal numbers from 0 to 255
	(e.g. 192.131.56.0).  Alternatively, you can use symbolic network name
	from the /etc/networks file in place of the numeric address.  A special
	case is the network address 0.  This will create a default route, 
	meaning that all network traffic with no specific route found in the 
	routing table will be forwarded to this interface.  Default route is 
	useful for connections to the 'outside world', such as Internet service 
	provider.

    GATEWAY
        If the network you are connecting to is not directly reachable, you
        may also specify a gateway address.  Note however, that gateway has to
        be reachable, i.e. a static route to the gateway must exist.  The 
	gateway address also follows usual IP address notation or can be 
	replaced with the symbolic name from the /etc/host file.

Although you can create the interface configuration files manually, we suggest
you use WAN Router configuration script (/usr/lib/router/Configure) which
allows you to create, delete and view them interactively.

Note that use of the interface configuration files is optional.  In fact, they
can accomodate only very basic configurations.  More sophisticated cases 
involving multiple gateways and extensive subnetting will require manual 
configuration.  On the other hand this feature is not limited to interfaces 
created by the WAN Router.  Interface configuration file can be created for 
any existing Linux interface, such as SLIP, PLIP or PPP.  Bear in mind though, 
that in this case initialization and tearing down of these interfaces will be 
synchronized with starting and stopping WAN Router.

PPP AND FRAME-RELAY NOW HAVE THE ABILITY TO LEARN LOCAL AND REMOTE IP ADDRESSES.
If you want to configure PPP to learn its own and point-to-point IP addresses
( read section 3) then set the IPADDR to 0 and POINTOPOINT field blank. 
In this case no routes will be added using the interface file.  Once the PPP
has been negotiated then the routes will be added.   In this configuration when
the link goes down then the routes are deleted as well.   The WANPIPE driver now
has the ability to add and remove routes.  If IPADDR and POINTOPOINT fields
in the interface file are populated and if PPP is configured for dynamic IP 
assignment then OLD ROUTES WILL NOT BE REMOVED.  The old routes are route 
that are added looking at the interface file. 
 
The WANPIPE driver for Frame-relay supports INVERSE ARPS.  Inverse arp packets 
report to the remote end its point-to-point address.  Please refer to RFC 1293
for explanation on Inverse ARP.   If you do not know the point-to-point ip 
address, then leave the POINTOPOINT field blank.  In this case IF THE REMOTE ENDIS SENDING inverse arps then the frame relay driver will reply to the ARPs and
add the route.   The local IP and the remote IP reported by Inverse Arp packets
must be on the same sub net for the WANPIPE driver to respond to them and add
routes. 

For Cisco HDLC, SLARP packets are used to discover both local and point-to-point
addresses.  If your interface is configured to send SLARP requests, then set 
the IPADDR to 0 and leave the POINTOPOINT field blank.	 If you don't want to
send SLARP requests, then you MUST set your local IP address (IPADDR field) and POINTOPOINT field.  Please note that whenever SLARP requests are used, the host 
portion of both the local and point-to-point addresses must be either 1 or 2 
(ie: 192.168.39.1 or 204.1.2.2).	
	
3) Main router configuration file
 
Main router configuration file /etc/router.conf defines WAN links and network
interfaces and is used by the wanconfig, router configuration utility, to
configure WAN drivers. 

A sample file is also present in the /usr/lib/router/samples directory.  Please
also refer to the sample router.conf in APPENDIX B.  The router.conf file in 
the /etc directory has to editted to make it specific to the WANPIPE hardware 
and the protocol being used.  The following steps should be followed to ensure
proper setup of your WANPIPE driver:

	1) Edit [devices] section

	WANPIPE devices are named 'wanpipeN', where N is 0 to 8.  For each 
	adapter installed add a line to the [devices] section as follows:

        wanpipeN={config_id},{description}

	where   {config_id}     is one of the following:
        	                WAN_X25 for X.25 link
                	        WAN_FR for frame relay link
                        	WAN_PPP for PPP link
				WAN_CHDLC for Cisco HDLC link

		{description}   optional description string

	For example:

        	wanpipe1=WAN_X.25, X.25 link
        	wanpipe2=WAN_FR, frame relay link
		wanpipe3=WAN_PPP, PPP link
		wanpipe4=WAN_CHDLC, Cisco HDLC link


	2) Edit [interfaces] section

	This section defines the Network interfaces created by the Configure 
	script.  For each interface defined add a line to the [interfaces] 
	section as follows:
	
	{name} = {device},{media_addr},{description}
	
	where:	{name}		name of the interface defined in 
				(/usr/lib/router/interfaces/) 
		
		{device}	name of the device (from the [devices] section)
				this interface is associated with
	
		{media_addr}	media address for this logical channel, if
				applicable.

		{description}	description of this interface (optional)

        Media address syntax is device and media specific.  The convention  
	is as follows:

  	---------------------------------------------------------------------
  	Media type                      | Media address
  	--------------------------------+------------------------------------
  	X.25 permanent virtual circuit  | PVC number in decimal notation
                                        |
  	X.25 switched virtual circuit   | '@' character followed by the X.25
                                        | destination address in decimal
                                        | notation
                                        |
  	Frame relay permanent virtual   | DLCI number in decimal notation
        circuit                         |
 	---------------------------------------------------------------------
	
	For example:

        wan0=wanpipe1, @123456, X.25 connection to the branch office 1 (SVC)
        wan1=wanpipe1, 1, X.25 PVC connection to the branch office 2 (PVC)
        wan2=wanpipe2, 16, frame relay connection to the branch office 3
        wan3=wanpipe2, 17, frame relay connection to ISP
	
	< no media address is used >
	ppp0   = wanpipe3,, PPP link to office 1
	chdlc0 = wanpipe4,, Cisco HDLC link to office 2

	3) Edit device private configuration section
	
	For each WANPIPE device defined in the [devices] section create a 
        section with the same name, i.e. for the device wanpipe1 create a
	section [wanpipe1], for the device wanpipe2 create a section 
	[wanpipe2] and so on.

	This section includes all the card specific parameters with additonal 
        protocol specific parameters if applicable.  With this section you
        can configure all the WANPIPE cards.  However for the FT1 boards you 
	MUST also configure them using the FT1 CONFIGURATION UTILITY ( called
	cfgft1 in /usr/sbin/ directory )
 
	The following explains the keywords used in device private configuration
	section and states whether they are mandatory or optional. It also 
	states which keywords are protocol specific. 

		IOPort
        		Adapter's I/O port address.  Make sure there is no
                        conflict. (Mandatory for all cards and protocols) This
			address has to be similar to the value set by the 
			jumpers on the board.

    		IRQ
       		 	Adapter's interrupt request level.  Make sure there is
                        no conflict. (Mandatory for all cards and protocol) 
			These are software set.

    		MemAddr
        		Address of the adapter shared memory window. 
			If commented out the memory address is determined
			automatically. (Optional)

		Firmware
        		Name of the adapter firmware (including path).
                        (Mandatory for all cards)
			
			PROTOCOL:

				FRAME RELAY
 					Avaiable options are:
					For 508 cards:
					/usr/lib/router/wanpipe/fr508.sfm 
			
				PPP
					Available options are: 
					For 508 cards:
					/usr/lib/router/wanpipe/ppp508.sfm

				X25
					Available options are:
					For 508 cards:
					/usr/lib/router/wanpipe/x25_508.sfm

				CISCO HDLC
					Available options are:
					For 508 cards:
					/usr/lib/router/wanpipe/chdlc508.sfm

  		Interface
                        Physical interface type. Available options (508 
                        cards) are:
                	RS232   RS-232C interface (V.10)
                	V35     V.35 interface (V.11/RS-422/RS-485/X.21)

                        DOES NOT APPLY TO FT1 CARDS.
			
		Clocking
        		Source of the adapter transmit and receive clock 
			signals.  Available options are:

                	External	Clock is provided externally (e.g. by 
					the modem or CSU/DSU).  Use this
					for FT1 boards.

                	Internal        Clock is generated on the adapter.
					When there are two Sangoma Cards back
					to back set clocking to Internal on one
					of the cards.

    		BaudRate
			Data transfer rate in bits per second.  These values
			are meaningful if internal clocking is selected. 
			(like in a back-to-back testing configuration)

			PROTOCOL:
	
				FRAME RELAY/PPP/CISCO HDLC 

					Typical values are:
                			9600            9.6 kbps
                			19200           19.2 kbps
                			38400           38.4 kbps
              				56000           56 kbps
					64000           64 kbps
					128000          128 kbps
					1544000         1.544 Mbps (T-1)
					2048000         2 Mbps (E-1)
				X25

					Typical values are:
					9600            9.6 kbps
                			19200           19.2 kbps
                			38400           38.4 kbps
                			56000           56 kbps
                			64000           64 kbps
                			128000          128 kbps


   		MTU
        		Maximum transmit unit size (in bytes).  This value 
			limits the maximum size of the data packet that can be 
			sent over the WAN link, including any encapsulation 
			header that router may add.  It usually has to be not 
			less than the largest MTU of all interfaces configured 
			for this link plus WAN media header size (if any), 
			unless the WAN driver can perform fragmentation of data 
			packets.

			PROTOCOLS:

				FRAME RELAY
					Note that this also includes header 
					information required for encapsulating 
					higher level protocols such as TCP/IP 
					and IPX.  The maximum MTU size supported
					by the adapter is 4096 bytes.
					Default value is 1500.
				
				X25
					This value defines the maximum size of 
					the X.25 data packet.  Available options
					are:
						64
						128
						256
						512
						1024

        				Note that X.25 driver provides for 
					packet fragmentation, so that MTUs
					of the network interfaces using X.25 
					link can be as large as needed
			
				PPP
					The MTU value specified is used for 
					Local Maximum-Receive-Unit(MRU)
					/MTU and Minimum Remote MRU.  
					Recommended value for PPP is 1500.
					
				CISCO HDLC
					The MTU value specified is used for
					Maximum length of the Cisco HDLC data
					field.  Range is 300 - 15354.  
					Recommended value is 1500.
						
		UDPPORT
        		The UDP port to be used for UDP management by the 
			monitor (explained later).  The monitor utilities like
			fpipemon and pipemon should refer to the udpport defined
			here.

		Station
			PROTOCOL:

				FRAME RELAY
	     				This parameter specifies whether the 
					adapter should operate as a Customer 
					Premises Equipment (CPE) or emulate a 
					frame relay switch (Access Node).  
					Available options are:
                			CPE     CPE mode (default)
                			Node    Access Node (switch emulation 
						mode)
	
				PPP
					Does not Apply.
	
				CISCO HDLC
					Does not Apply.
				
				X25
					This parameter defines whether the 
					adapter should operate as a Data
        				Terminal Equipment (DTE) or Data 
					Circuit Equipment (DCE).  Normally,
        				you should select DTE mode.  DCE mode 
					is primarily used in back-to-back 
					testing configurations. Available 
					options are:
                			DTE     DTE mode (default)
                			DCE     DCE mode

		TTL
			This keyword defines the Time To Live for a UDP
			packet used by the monitoring system.  The user can 
			control the scope of a UDP packet by associating a 
			number that decrements with each hop.

			PROTOCOL
	
				FRAME RELAY
					Any value between 0 to 255.
				
				PPP
					Any value between 0 to 255.
				
				CISCO HDLC
					Any value between 0 to 255.

				X25
					Currently not implemented.
		
		IPX
			This parameter either enables or disables the use
			of IPX data.  YES or NO (default) is allowed.  (See 
			also wanpipe.ipx)

			PROTOCOL
	
				FRAME RELAY
					Supported for one channel.
				
				PPP
					Supported.
	
				CISCO HDLC
					Does not apply. Only used for IP

				X25
					Supported for one channel.
		
		NETWORK
			This parameters specifies the IPX Network Number.  Can
			be any unique 8 digit hexadecimal number. The default
			is 0xDEADBEEF.  (See also wanpipe.ipx)

			PROTOCOL
	
				FRAME RELAY
					Supported for one channel.
				
				PPP
					Supported.
	
				CISCO HDLC
					Does not apply.	

				X25
					Supported for one channel.

		Signalling 	*****ONLY APPLIES TO FRAME RELAY PROTOCOL*****
			This parameter specifies frame relay link management 
			type.  Available options are:
                	
			ANSI    ANSI T1.617 Annex D (default)
                	Q933    ITU Q.933A
                	LMI     LMI

		DLCINUMBER       *****ONLY APPLIES TO FRAME RELAY PROTOCOL*****
			This parameter is used to define logical channels 
			activated by the adapter configured as an Access Node.  
        		Number of DLCI should not exceed 100 for the S508 
			adapter.  Default value for DLCINUMBER parameter is 0. 
			This is typically used in a back-to-back testing 
			configuration.

		T391		*****ONLY APPLIES TO FRAME RELAY PROTOCOL*****
        		This is the Link Integrity Verification Timer value in 
			seconds.  It should be within a range from 5 to 30 and 
			is relevant only if adapter is configured as CPE.

    		T392		*****ONLY APPLIES TO FRAME RELAY PROTOCOL*****
        		This is the Polling Verification Timer value in seconds.
			It should be within a range from 5 to 30 and is relevant
			only if adapter is configured as Access Node.

    		N391		*****ONLY APPLIES TO FRAME RELAY PROTOCOL*****
        		This is the Full Status Polling Cycle Counter. Its 
			value should be within a range from 1 to 255 and is 
			relevant only if adapter is configured as CPE.

    		N392		*****ONLY APPLIES TO FRAME RELAY PROTOCOL*****
        		This is the Error Threshold Counter. Its value should 
			be within a range from 1 to 10 and is relevant for both 			CPE and Access Node configurations.

		N393		*****ONLY APPLIES TO FRAME RELAY PROTOCOL*****
        		This is the Monitored Events Counter. Its value should 
			be within a range from 1 to 10 and is relevant for both 
			CPE and Access Node configurations.

	    	LowestPVC, 	*****ONLY APPLIES TO X25 PROTOCOL*****
		HighestPVC
        		These parameters are used to define permanent virtual 
			circuit range as assigned by your the X.25 service 
			provider.  Valid values are between 0 and 4095.  Default
 			values for both parameters are 0, meaning that no PVCs 
			are assigned.  Note that maximum number of both 
			permanent and virtual cuircuits should not exceed 255.

		LowestSVC,	 *****ONLY APPLIES TO X25 PROTOCOL***** 
		HighestSVC
       	 		These parameters are used to define switched virtual 
			circuit range as assigned by your the X.25 service 
			provider.  Valid values are between 0 and 4095.  Default
		 	values for both parameters are 0, meaning that no SVCs 
			are assigned.  Note that maximum number of both 
			permanent and virtual cuircuits should not exceed 255.

    		HDCLWindow	 *****ONLY APPLIES TO X25 PROTOCOL*****
        		This parameter defines the size of the HDLC frame 
			window, i.e. the maximum number of sequentially 
			numbered Information frames that can be sent without 
			waiting for acknowledgement.  Valid values are from 1
        		to 7.  Default is 7.

		PacketWindow	*****ONLY APPLIES TO X25 PROTOCOL*****
        		This parameter defines the default size of the X.25 
			packet window, i.e. the maximum number of sequentially 
			numberred data packets that can be sent without waiting
			for acknowledgement.  Valid values are from 1 to 7.  
			Default is 2.

    		CCITTCompat	*****ONLY APPLIES TO X25 PROTOCOL*****
        		This parameter defines CCITT X.25 compatibility level.
		  	Available options are:
                	1988   1988 version of the Recommendation X.25 (default)
                	1984   1984 version of the Recommendation X.25
                	1980   1980 version of the Recommendation X.25
	
		AUTHENTICATOR	*****ONLY APPLIES TO PPP PROTOCOL*****
			This paramater decides whether your local host will
			be the authenticator or not.  Options : YES or NO.
			If your local side is the authenticator then your 
			side will require that the authentication is passed 
			before the link can be established.  If your local side
	 		is not the authenticator then your peer side will 
			determine if any authentication is required or not.
		
		IP_MODE		*****ONLY APPLIES TO PPP PROTOCOL*****
			This parameter decides whether you want to request 
			local and remote IP addresses or NOT.  Options: STATIC
			or PEER.  If you are configured as STATIC then your side
			will not request for IP addresses. If you are configured
			as PEER then your side will request the remote end for
			local and remote IP address. Default: STATIC
			IT CAN ONLY BE SET FOR REQUESTING IP ADDRESSES

		IGNORE_DCD 	*****ONLY APPLIES TO CISCO HDLC PROTOCOL****
			This parameter decides whether DCD will be ignored or
			not when determining active link status for Cisco HDLC.
			Options: YES or NO. Default: NO

		IGNORE_CTS	*****ONLY APPLIES TO CISCO HDLC PROTOCOL****
			This parameter decides whether CTS will be ignored or
			not when determining active link status for Cisco HDLC.
			Options: YES or NO. Default: NO
	
		IGNORE_KEEPALIVE *****ONLY APPLIES TO CISCO HDLC PROTOCOL****
			This parameter decides whether Keep alives will be 
			ignored or not when determining active link status for
			Cisco HDLC. Options YES of NO. Default: NO

		KEEPALIVE_TX_TIMER *****ONLY APPLIES TO CISCO HDLC PROTOCOL****
			This parameter states the interval between keep alive.
			If you are set to ignore keepalives then this value is
			meaningless. The value of this parameter is given in 
			milliseconds. Options: 0 - 60000 ms. Default: 10000 ms

		KEEPALIVE_RX_TIMER *****ONLY APPLIES TO CISCO HDLC PROTOCOL****
			This parameter states the interval to expect keepalives
			If you are set to ignore keepalives then this value is
			meaningless. The value of this parameter is given in
			milliseconds.  Options 10 - 60000 ms. Default: 10000 ms 

		KEEPALIVE_ERR_MARGIN *****ONLY APPLIES TO CISCO HDLC PROTOCOL***
			This parameter states the number of consecutive keep 
			alive timeouts before bringing down the link.  If  you 
			are set to ignore keepalives then this value is meaning
			less.  Options: 1 - 20.  Default: 3 

		SLARP_TIMER	*****ONLY APPLIES TO CISCO HDLC PROTOCOL*****
			This parameter decides whether to send SLARP packets or
			not.  Options: 0 - 60000ms.  If 0 is specified then no
			SLARP packets are transmitted. Any non zero value in the
			range specifies the time in milliseconds between sending
			SLARP request. Default: 5000 ms.


	4) Edit/Create Interface private configuration section

	This section applies only to FRAME RELAY, PPP and X25 protocol. For 
	every interface listed in the [interfaces] section create another 
	section underneath all the private device configuration section.  For 
	instance for interface "fr1" create section [fr1], for interface "svc1" 
	create section [svc1] and so on.  If these sections are not defined 
	then all the parameters in the section are assigned default value.
	
	For FRAME RELAY protocol the following parameter(s) should be added in
	the interfaces section:

		MULTICAST
			This parameter either enables or disables discarding 
			packets with a multicast source address.  Available 
			options are:
		
			YES	Do not discard packets with a multicast source 
				addr.	
			NO	Discard packets with a multicast source addr.
		
			Default is set to NO.

		CIR
			This parameter enables or disables Committed Information
			rate on the board.  Options are 1 - 512 kbps.  PLEASE 
			NOTE THAT THIS VALUE REFERS TO ONLY TRANSFERING 
			DATA PACKETS.  If this parameter is commented out then
			CIR for that interface is disabled. 
		BC	
			This paramater states the Committed Burst Size. Options
			are 1 - 512 kbits. 

		BE
			This parameter states the Excess Burst Size. Options are
			0 - 512 kbits.

		INARP
			This parameter enables or disables transmission of
			Inverse Arp Request packets.

		INARPINTERVAL 
			This parameter sets the time interval in seconds between
 			Inverse ARP Request. Default is 10 sec

	For X25 protocol the following parameter(s) should be added in the 
	interfaces section:

		IDLETIMEOUT
			The time in seconds before an SVC will disconnect if
			there is no data over the link.  The default is 90
			seconds.

		HOLDTIMEOUT
			The time in seconds to wait before retrying a failed
			connection.  The default is 10 seconds.


	For PPP protocol the following parameter(s) should be added in the 
	interfaces section:

		MULTICAST
			This parameter either enables or disables discarding 
			packets with a multicast source address.  Available 
			options are:
		
			YES	Do not discard packets with a multicast source 
				addr.	
			NO	Discard packets with a multicast source addr.
		
			Default is set to NO.

		PAP
			This parameter enables or disables the use of PAP.
			Available options are:
			
			YES 	Enable PAP   
			
			NO 	Disable PAP

			This option is needed regardless of the station being
			an AUTHENTICATOR.
	
		CHAP	
			This parameter enables or disables the use of CHAP.
			Available options are:
	
			YES	Enable CHAP	
	
			NO	Disable CHAP

			This option is needed regardless of the station being
			an AUTHENTICATOR.

		USERID
			This parameter is dependent on the AUTHENTICATOR
			parameter.  If AUTHENTICATOR is set to NO then
			you will simply enter in your login name that the
			other side specified to you.

			If AUTHENTICATOR is set to YES then you will have to
			maintain a list of all the users that are valid for
			authentication purposes. If your list contains ONLY
			ONE MEMBER then simply enter in the login name.  If
			the list contains more than one member then follow
			the below format:
				USERID = LOGIN1 / LOGIN2 / LOGIN3....so on
			
			The "/" separators are VERY IMPORTANT if you have 
			more than one member to support.

		PASSWD
			This parameter is dependent on the AUTHENTICATOR 
			parameter.  If AUTHENTICATOR is set to NO then you
			will simply enter in your password for the login
			name that the other side specified to you.

			If AUTHENTICATOR is set to YES then you will have to
			maintain a list of all the passwords for all the 
			users that are valid for authentication purposes.  If
			your list contains ONLY ONE MEMBER then simply enter
			in the password for the corresponding login name in
			the USERID parameter.  If the list contains more than
			one member then follow the format below:

				PASSWD = PASS1 / PASS2 / PASS3....so on

			The "/" separators are VERY IMPORTANT if you have more
			than one member to support.  The ORDER of your passwords
			is very important.  They correspond to the order of 
			the userids.
	 

		SYSNAME
			This parameter is dependent on the AUTHENTICATOR 
			parameter.  If AUTHENTICATOR is set to NO then you can
			simply ignore this parameter. (comment it )

			If AUTHENTICATOR is set to YES then you have to enter
			Challenge system name which can be no longer than 31
			characters.

4. CONFIGURING FT1 CARDS

The Sangoma S508/FT-1 is Sangoma S508 adapter with an integrated CSU/DSU unit.
The S508/FT-1 is used to connect data terminal equipment to the T1 (1.544 Mbps)
or Fractional T1 digital telephone network.  This unit performs all Bell compatible encoding, decoding, timing and diagnostic responses.

Set-up is done only infrequently.  Monitoring and testing may be done from any network attached PC.

The configuration utility cfgft1 can be found in /usr/sbin directory.  The cfgft1 utility first loads the card and then allows the user to  pass  configuration commands to the adapter.  The following are the options needed for loading the card:

	cfgft1 [ -p HexPortNumber ] [ -m HexMemAddr ]

	-p HexPortNumber
		The HexPortNumber represents the  IO  port  of  the
		card.   Please  ensure  that  the IO port specified
		matches the jumper settings on the board.  If  this
		option  is  not used then the utility tries to ini-
		tialize the card at  0x360  (factory  default  set-
		ting).

	-m HexMemAddr
		The  HexMemAddr  represents  the Memory Address the
		utility uses to configure the  card  at.   If  this
		option  is  not  used  then  the  utility  tries to
		intialize the 0xD0000 memory  area.   Valid  memory
		addresses    are:    0xA0000,0xA2000...0xAE000    /
		0xC0000,0xC2000...0xCE000                         /
		0xD0000,0xD2000...0xDE000   /  0xE0000,  0xE2000...
		0xEE000

Once the card has been loaded and intialized you are now ready to configure the S508/FT-1 card.

The Sangoma S508/FT-1 DSU has three memory banks:
	1. The factory default.
	2. The user configured bank.
	3. The scratch pad (working memory).

To check the current settings (bank settings), type D0 <ENTER>.  Configuration changes are made as follows:

	1. Type C <ENTER> to  open  the  configuration mode.
	2. Change the required settings.
	3. After making these changes, type D1 <ENTER> to see the temporary  
	   configuration bank.
	4. If these changes are correct, then type W<ENTER> to write the 
	   configuration to the non-volatile memory.
	5. Type Q <ENTER> to exit the configuration mode.

 	COMMANDS

		+n	Add channel n (where  n is 1-24) to the active list
		-n      Delete channel n (where n is 1-24) from the active list
		M0      Set  framing  mode  to  ESF (ExtendedsuperFrame)
		M1      Set framing mode to D4
		K0      Set encoding mode to B8ZS
		K1      Set encoding mode to AMI
		L0      Set line build out to CSU (0db) or DSX-1 (0-133ft)
		L1      Set line build out to DSX-1 (133 - 266ft)
		L2      Set line build out to DSX-1 (266 - 399ft)
		L3      Set line build out to DSX-1 (399 - 533ft)
		L4      Set line build out to DSX-1 (533 - 655ft)
		L5      Set line build out to CSU (-7.5 db)
		L6      Set line build out to CSU (-15 db)
		L7      Set line build out to CSU (-22.5 db)
		P0      Set clock mode to normal (SLAVE)
		P1      Set clock mode to master (LDM mode only)
		W       Write configuration to non-volatile memory
		F       Get factory default configuration
		Q       Exit configuration mode and move temporary
			(scratch pad) configuration to  default  configura-
			tion 
		D0      Display actual configuration
		D1      Display configuration in temporary memory
		E0      Unit does not echo commands sent to it
		E1      Unit echos back commands sent to it
		T0      User test modes enabled
		T1      User test modes disabled

		NB:  Whenever  you  have finished your changes, you
		MUST do a WQ in order for them  to  "take".   After
              	that do a D0 to check that the changes have, indeed
              	been written to permanent memory.

	Examples
		The following are few examples to illustrate the different
		usage of the cfgft1 command:

       		cfgft1 :   This  tries  to  initialize the card at IO port
              		0x360 and memory D0000.

       		cfgft1 -p0x350 : This tries to initialize the card at IO port
              		0x350 and memory 0xD0000.

       		cfgft1 -m0xE0000 : This tries to initialize the card at IO port
              		0x360 and memory0xE0000.

       		cfgft1 -p0x350 -m0xE0000 : This tries to initialize the card at  			IO  port 0x350 and memory 0xE0000.

       		Configuring S508/FT-1 example.
              	Required   configuration:  Channels  1-3  disabled, channels 22
 		and 23 enabled Line build set to  DSX-1 (399 - 533ft) ESF 
		framing mode Clock mode to normal 
		
		Type: C-1-2-3+21+22K0L3M0P0D1WQ<ENTER>

                              OR

              	C<ENTER>       Open configuration mode
              	-1-2-3<ENTER>  Remove channels 1, 2 and 3 from the active list
              	+21+22 <ENTER> Add channels 21 and 22 to the active list
		K0<ENTER>      Set the encoding mode to B8ZS
              	L3<ENTER>      Set the line build out to DSX-1 (399 - 533ft)
              	M0<ENTER>      Set the framing to ESF
              	P0<ENTER>      Set the clock mode to normal
              	D1<ENTER>      Display the temporary configuration before saving
              	W<ENTER>       Update the user memory
              	Q<ENTER>       Close the configuration mode

              	If you are adding or removing many D0 channels, break up the 
		command into 2 or more commands, as the command line buffer has
		limited length.  For instance, to drop the line speed to 128kbps
		, you need to remove  channels 3 to 24.
              
		Do:

              	C<ENTER>
              	-3-4-5-6-7-8-9-10-11<ENTER>
              	-12-13-14-15-16-17-18-19-20-21-22-23-24<ENTER>
              	WQ<ENTER>
              	D0<ENTER>

		and the  correct  configuration  should  be  shown.  ALSO PLEASE
		REBOOT THE MACHINE AND RUN CFGFT1 UTILITY AGAIN WITH D0 COMMAND
		TO VERIFY THE  CONFIGURATION.

5. STARTING AND STOPPING WAN ROUTER

To simply start WAN Routers enter 'router start' at the command prompt.  To 
shut the router down type 'router stop'.

The start-up script will first read meta-configuration file /etc/router.rc to
set up its operational environment.  Then it will check to see if router lock
file already exists (/var/lock/router).  If it does, then the start-up script 
will assume that the router is already running and terminate with the following
message: "Router is already running. Stop it first!".

Next, the start-up script will load the wanpipe driver listed in the WAN_DRIVERS
variable in the /etc/router.rc file using Linux' modprobe utility.  This will
atomatically load the router module (router.o) and other necessary kernel 
modules (sdladrv.o).  Note that modprobe relies on module dependencies being 
up-to-date.  If router module or some other modules don't load, you may try to 
re-build module dependencies with 'depmod -a' command.

When all drivers are loaded, the start-up script runs wanconfig utility
to configure the wanpipe drivers and create network interfaces.  The 
configuration file used by wanconfig is defined by the ROUTER_CONF variable in 
the /etc/router.rc file which is /etc/router.conf.  The results of the 
configuration are stored in the router log file (/var/log/router).

And finally, the start-up script configures network interfaces (TCP/IP level)
and sets up static routes using Linux' ifconfig and route utilities.  When
doing so, it uses configuration files found in /usr/lib/router/interfaces
directory.  These files can be created manually or using router configuration
script (Configure script) as described in previous section.  Depending on your
needs you can have the router add and remove routes for you. 

When router is shut down with 'router stop' command, the start-up script
shuts down all nework interfaces, then unloads the wanpipe drivers, thus 
returning system to its initial state.


6. USING THE FPIPEMON AND PPIPEMON MONITORS

Included with the wanpipe drivers are two UDP management monitors, fpipemon and
ppipemon, for Frame Relay and PPP respectively.  You must be superuser (root)
to run these monitors. Simply invoking the command name (either 'fpipemon' or
'ppipemon') will give the command line usage.  The UDP management port to be
utilized can be configured with the UDPPORT option in the router.conf
configuration file.

Notice that there are two ways in which to use the monitor to talk to the
driver.  The first is through the actual link provided by the driver.  ie.
Either the Frame Relay or PPP link (underneath).  In this instance the IP
address to be specified could be any address on the sub-network, provided it
is forwarded to the driver.  The other method to talk to the driver is from
'above' or from the system.  This method allows the use of a feature called
line tracing.  To use the monitor from 'above' you must either run the monitor
on the machine with the Sangoma card, or you must have another network
connection to this machine (eg. Ethernet).  The IP address to specify in
this instance must not be the actual IP address of the card.  Any other IP
address on the sub-network will work, since the system tries to forward
the packet through the driver.

Using these two methods to communicate with the driver makes these monitors
extremely versatile.  For example, you may monitor Sangoma cards installed
in non-Linux systems.  In the same way you can monitor the Linux cards from
non-linux systems (provided you have the monitors for that platform).  Since
the monitors rely on UDP, you can use them over any IP network (such as the
Internet) to reliably monitor your Sangoma cards.  Also by assigning your
cards to different UDP ports, you can monitor all cards from one monitoring
station.

Refer to appendix A for usage and options for fpipemon and ppipemon.



7. TROUBLE SHOOTING AND DIAGNOSTICS

If you encounter errors during installation and/or start-up, try to determine
which command, utility or process causes the error.  Carefully record and
examine all warnings and error messages.  Read appropriate section of this
manual again and make sure you have not missed anything important.  MAN PAGES
ARE ALSO AVAILABLE ON TOPICS LIKE: router, router.conf, sdladump, cfgft1, 
fpipemon, ppipemon and cpipemon.

When WAN Router start-up is complete, all WAN devices defined in the [devices]
section of router configuration file (/etc/router.conf) should appear in the
/proc/net/router directory.  Similarly, all network interfaces defined in the
[interfaces] section should appear in the /proc/net/dev directory (provided
that corresponding WAN device was successfully configured).  If some of the
devices and/or interfaces are missing, then verify configuration file and
check WAN Router log file (/var/log/router) for error messages and/or warnings.

Here is a sample contents of the WAN Router log file:

        Tue Jan  7 15:17:31 EST 1997: starting WAN router
        Loading driver wanpipe ... ok
        WAN Router Configurator. v1.0.0 (c) 1995-1996 Sangoma Technologies Inc.
         * Parsing configuration file /etc/router.conf ...
         * Reading section [devices]...
         * Reading section [wanpipe1]...
         * Reading section [interfaces]...
         * section [pvc1] not found!
         * Reading section [svc1]...
         * Configuring device wanpipe1 (Datapac X.25 link)
         * Setting IOPORT to 0x300
         * Setting IRQ to 12
         * Reading 26636 bytes from /home/firmware/x25_508.sfm ...
         * Setting INTERFACE to RS232
         * Setting CLOCKING to External
         * Setting BAUDRATE to 56000
         * Setting MTU to 256
         * Setting STATION to DTE
         * Setting LOWESTPVC to 1
         * Setting HIGHESTPVC to 5
         * Setting LOWESTSVC to 6
         * Setting HIGHESTSVC to 10
         * Setting HDLCWINDOW to 7
         * Setting PACKETWINDOW to 2
         * Setting CCITTCOMPAT to 1988
         * Configuring channel pvc1 (Branch office). Media address: 1
         * Configuring channel svc1 (Branch office). Media address: @123456
         * Setting IDLETIMEOUT to 90
         * Setting HOLDTIMEOUT to 10

WANPIPE Driver logs extensive diagnostics during its initialization into
the system log file.  To monitor logged system messages use the following
command:

        tail -f /var/log/messages

You can watch for any errors and/or warnings during WANPIPE loading and 
initialization.

To verify WAN device configuration, use Config and Status pseudo-files found
in /proc/net/router directory.  Doing 'cat' on these files reveals current
device state and configuration.  The sample output is shown below:

        cat /proc/net/router/Config

 Device name | port |IRQ|DMA|mem.addr|mem.size|option1|option2|option3|option4
 wanpipe2    |0x364 |  5|  0|0xEC000 |0x2000  |   5030|   7200|  65536|   6200
 wanpipe1    |0x300 | 12|  0|0xEE000 |0x2000  |   5080|  16000| 131072|   5800

        cat /proc/net/router/Status

 Device name |station|interface|clocking|baud rate| MTU |ndev|link state
 wanpipe2    | DCE   | RS-232  |external|    56000| 1600|  2 |connected
 wanpipe1    | DTE   | RS-232  |external|    56000|  256|  2 |connecting


To obtain device statistics, do 'cat' on WAN device entry in /proc/net/router
directory as follows:

        cat /proc/net/router/{device}

     total frames received:    	0
   receiver overrun errors:    	0	Number of receiver overrun errors
                CRC errors:    	0	Number of receiver CRC errors
       frame length errors:    	0       Number of frames discarded due to frame
 					being too long
       frame format errors:    	0	Number of times receiver was halted due
					to full buffers
   aborted frames received:   	0	Number of abort frames received
   reveived frames dropped:   	0	Number of frames dropped
      other receive errors:    	0	Number of frames discarded due to errors

  total frames transmitted:    	0
aborted frames transmitted:  	0	Number of abort frames transmitted
   transmit frames dropped:    	0	Number of frames dropped
       transmit collisions:    	0	Number of frames failed to transmit
					due to device busy 
     other transmit errors:    	0	Numbner of frames failed to transmit
					due to buffer/other constraints.

To verify TCP/IP configuration of WAN interfaces, use Linux' ifconfig and
route utilities.  Interface status and statistics can be viewed with
'ifconfig {interface}' command.  The output should look similar to this:

        wan0    Link encap:UNSPEC       HWaddr (whatever)
                inet addr:<your_ip_addr> P-t-p:<other_ip_addr> Mask:<netmask>
                UP POINTOPOINT RUNNING  MTU:1500  Metric:1
                Rx packets:0 errors:0 dropped:0 overruns:0
                Tx packets:0 errors:0 dropped:0 overruns:0
                Interrupt:9 Base address:0x360 Memory ee000-effff

Make sure that IP address and netmask are correct and that RUNNING and UP
flags are set.  If the interace exists, but does not appear to be configured,
then run router configuration script (/usr/lib/router/Configure), select 'Show
interfaces' from the main menu and view configuration for the interface in
question.  If configuration file does not exist, create it by selecting 'Add
interface' from the main menu.

View routing table by typing 'route' at the command prompt and make sure that
routes to all remote networks and hosts exist.  The output should look similar
to this:

        Destination     Gateway Genmask         Flags   Window  Use     Iface
        <other_ip_addr> *       255.255.255.0   UH      0       0       wan0

If all the above looks ok, you should be able to ping remote host.  If pings
are not getting through, try to determine which part of the connection fails.
There can be at least four possibilites:

        o pings are not being transmitted by the local machine
        o pings are not being received by the remote machine
        o pings are not being replied to by the remote machine
        o replies are not being received by the local machine

Quite often you can tell which part of the connection is not functioning by
simply looking at the interface statistics output by the ifconfig utility at
both local and remote machines.

A debugging utility, sdladump, is also included with the distribution which 
allows viewing adapter local memory in hexadecimal dump format during run-time.
Its command line syntax is:

        sdladump {device} [{offset} [{length}]]

where:  {device}        name of the WANPIPE adapter, as it appears in the
                        /proc/net/router/directory, e.g. wanpipe1

        {offset}        adapter local memory address.  Default is 0

        {length}        size of the adapter memory area to be dumped.  Default
                        is 256 bytes (0x100)

Note that adapter must be configured before you can use sdladump utility.


Another useful debugging utility is the proc file system. You can use the 
following command :

	cat /proc/net/dev

to get the information about your interface.  Following is a sample display for
the command above:

Inter-|   Receive                  |  Transmit
 face |packets errs drop fifo frame|packets errs drop fifo colls carrier
    lo:      0    0    0    0    0        0    0    0    0     0    0
  eth0:  40579    0    0    0    0     1534    0    0    0     1    0
  ppp0:1968973    0    0    0    0  1969002 2221    0    0  4266    0

In this case ppp0 is the interface built using WANPIPE.  This information
gives you how the driver for your device is behaving.  Following is the 
explanation of the heading used:

	packets 	: States the number of TX/RX packets
	errs		: States the number of TX/RX errors.  In this case,
			  the packet was not sent and will be retried.
	drop		: States the number of TX/RX dropped packets.  This
			  occurs when the link (interface) is down and 
			  application is trying to transmit.  
	fifo		: Not used by WANPIPE
	colls		: States the number of TX/RX collisions.  This means
			  that the device was busy and the packet will be
			  retried.
	carrier		: Not used by WANPIPE

8. TECHNICAL SUPPORT

If you are unable to diagnose and/or fix a problem yourself, you can ask
Sangoma Technologies Inc. for technical support via fax or e-mail:

        FAX:    (905)474-9223
        E-mail: jaspreet@sangoma.com or dm@sangoma.com

When sending your request, please provide us with the following information:

        o Detailed description of the problem
        o System type (CPU, speed, RAM size)
        o Linux kernel version number
        o WANPIPE driver version number
        o Adapter type
        o Communications link type and parameters (e.g. line speed)
        o Interface type (RS-232/V.35), DSU/CSU type (if any), etc.
        o Contents of the following files:
                /etc/router.rc
                /etc/router.conf
                /var/log/router
                /var/log/messages
                /usr/lib/router/interfaces/*
      	o Output of the following commands
                cat /proc/interrupts
                cat /proc/ioports
                cat /proc/net/dev
                cat /proc/net/router/Config
                cat /proc/net/router/Status
                cat /proc/net/router/{device}
                ifconfig {interface}
                route

All requests for technical support are normally replied to within 24 hours
(excluding weekends and holydays).


APPENDIX A

The following are the current options available for fpipemon utility:

	fpipemon [f](lush)/ [t](1 features)  option ip-address [port]

	One of the following:
        	s  Link Status
        	m  Modem Status
        	l  Line Trace: display Interpreted data
        	lr Line Trace: display RAW data
        	ds Display If_Send Driver Statistics
       	 	di Display Interrupt Driver Statistics
        	dg Display General Driver Statistics
        	u  Display Router UP Time

	Options that can be flushed:
        	c Comm Error Statistics
       	 	g Global Statistics
        	e Global Error Statistics
        	a List Active DLCIs
        	i Read DLCI Statistic  :specify your DLCI beside it (...i ##...)
        	d Flush all Driver statistics

	Options for S508/FT1 only
        	v View Status
        	s Self Test
        	l Line Loop Test
        	d Digital Loop Test
        	r Remote Test
        	o Operational Mode


The following are the current options available for ppipemon utility:

	ppipemon [f](lush)/ [t](1 features) option ip-address [port]

	One of the following:
        	g  PPP General Configuration
        	u  PPP Timers and Counters
        	a  Authentication Configuration
        	i  IP Configuration
        	x  IPX Configuration
       	 	s  PPP FSM Current State
        	n  Parameters Negotiated on Last Connection or Attempt
        	c  Cause for Last Disconnection
        	m  Modem Status
        	q  Line Trace: display Interpreted data
        	qr Line Trace: display RAW data
        	ds Display If_Send Driver Statistics
        	di Display Interrrupt Driver Statistics
        	dg Display General Driver Statistics
        	j  Display Router UP time

	Options that can be flushed:
        	l General Statistics
        	e Communication Error Statistics
        	p Packet Statistics
        	r LCP Statistics
        	b Loopback Detection / LCP Error Statistics
        	o IP Control Protocol( IPCP )Statistics
        	y IPX Control Protocol( IPXCP )Statistics
        	w Password Authentication Protocol( PAP )Statistics
        	h Challenge-Handshake Auth. Protocol( CHAP )Statistics
        	d Flush all Driver Statistics

	Options for S508/FT1 only
        	v View Status
        	s Self Test
        	l Line Loop Test
        	d Digital Loop Test
        	r Remote Test
        	o Operational Mode
 
APPENDIX B

The following shows a sample router.conf file for WANPIPE driver and card
configurations.

# ============================================================================
# WAN Router Configuration File.
# ============================================================================

# ----------------------------------------------------------------------------
# The [devices] section defines physical WAN connections. Each statement in
# this section has the following format:
#
#       device=config_id,description
#
# where:
#       device          WAN device name as it appears in /proc/net/router
#                       directory.  Also used to locate configuration section
#                       for this device.
#       config_id       identifier used for decoding configuration section.
#                       Currently defined the following IDs:
#                               WAN_X25 generic X.25 configuration
#                               WAN_PPP generic PPP configuration
#                               WAN_FR  generic frame realy configuration
#       description     verbal description of this device (optional).
# ----------------------------------------------------------------------------
[devices]
wanpipe1 = WAN_X25, X.25 link
wanpipe2 = WAN_FR, Frame relay link
wanpipe3 = WAN_PPP, Leased line
wanpipe4 = WAN_CHDLC, Cisco HDLC

# ----------------------------------------------------------------------------
# The [interfaces] section defines logical channels and corresponding
# network interfaces created by the router. Each statement in this section
# has the following format:
#
#       name=device,media_addr,description
#
# where:
#       name            interface name as it appears in /proc/net/dev.  Also
#                       used to locate configuration section for this
#                       interface.  Descriptive names can be used.
#       device          WAN device name from the [devices] section.
#       media_addr      media address for this logical channel. Virtual
#                       circuit addresses should start with '@'.
#       description     verbal description of this interface (optional).
# ----------------------------------------------------------------------------
[interfaces]
pvc1 = wanpipe1, 1, X.25 Permanent Virtual Circuit
svc1 = wanpipe1, @123456, X.25 Switched Virtual Circuit
fr16 = wanpipe2, 16, frame relay DLCI
fr17 = wanpipe2, 17, frame relay DLCI
sppp = wanpipe3,, synchronous PPP connection
chdlc0 = wanpipe4,, cisco hdlc connection

# ----------------------------------------------------------------------------
# Link configuration sections.
# Each statement of the configuraton section has the following format:
#
#       parameter=value
#
# where:
#       parameter       symbolic name of the configuration parameter.
#       value           number or symbolic name representing value of the
#                       configuration parameter.
# ----------------------------------------------------------------------------

[wanpipe1]                      ####### Sample X.25 Link Configuration #######
                                # ----- Hardware configuration ---------------
IOPort          = 0x360         # I/O port base
IRQ             = 2             # interrupt request level
Firmware        = /usr/lib/router/wanpipe/x25_508.sfm   # adapter firmware
                                # ----- Dual Port Memory Base Address --------
#Memaddr        = 0xD0000       # Commenting this out enables Auto Memory
                                # selection. Valid Memory addresses are:
                                # 0xA0000,0xA2000...0xAE000 / 0xC0000,0xC2000...                                # 0xCE000 / 0xD0000,0xD2000...0xDE000 / 0xE0000,                                # 0xE2000...0xEE000
                                # ----- Physical interface configuration -----
Interface       = RS232         # physical interface type, RS232/V35
Clocking        = Internal      # Tx/Rx clock source, External/Internal
BaudRate        = 56000         # data transfer rate in bps, 1200..2048000
                                # ----- Media-specific configuration ---------
MTU             = 256           # maximum data transfer unit, bytes
Station         = DTE           # station type, DTE/DCE
LowestPVC       = 1             # lowest permanent circuit number
HighestPVC      = 5             # highest permanent circuit number
LowestSVC       = 6             # lowest switched circuit number
HighestSVC      = 10            # highest switched circuit number
HdlcWindow      = 7             # HDLC window size, 1..7
PacketWindow    = 2             # X.25 packet window size, 1..7
CCITTCompat     = 1988          # CCITT compatibility 1988/1984/1980

[wanpipe2]                      ####### Sample Frame Relay Configuration #####
                                # ----- Hardware configuration ---------------
IOPort          = 0x360         # I/O port base
IRQ             = 12            # interrupt request level
Firmware        = /usr/lib/router/wanpipe/fr508.sfm     # adapter firmware
                                # ----- Dual Port Memory Base Address --------
#Memaddr        = 0xD0000       # Commenting this out enables Auto Memory
                                # selection. Valid Memory addresses are:
                                # 0xA0000,0xA2000...0xAE000 / 0xC0000,0xC2000...                                # 0xCE000 / 0xD0000,0xD2000...0xDE000 / 0xE0000,                                # 0xE2000...0xEE000
                                # ----- Physical interface configuration -----
Interface       = RS232         # physical interface type, RS232/V35
Clocking        = External      # Tx/Rx clock source, External/Internal
BaudRate        = 56000         # data transfer rate in bps, 1200..2048000
                                # ----- Media-specific configuration ---------
MTU             = 1600          # maximum data transfer unit, bytes
UDPPORT         = 9000          # for UDP management
Station         = CPE           # station type, CPE/Node
Signalling      = ANSI          # In-channel signalling, ANSI/LMI/Q933
                                # -----------------IPX Support----------------
IPX             = NO            # Enable IPX Support : YES or NO ?
NETWORK         = 0xABCDEFAB    # IPX Network Number : any 8 Hex digits
                                # -CRITICAL DATA: CONTACT SANGOMA TECHNOLOGIES-
#DLCINUMBER     = 1             # Used for back-to-back configuration
T391            = 10            # Link Integrity Verification Timer
T392            = 15            # Polling Verification Timer
N391            = 6             # Full Status Polling Cycle Counter
N392            = 3             # Error Threshold Counter
N393            = 4             # Monitored Events Counter

TTL             = 0x7F          # Time To Live parameter for UDP packets

[wanpipe3]                      ####### Sample PPP Link Configuration ########
                                # ----- Hardware configuration ---------------
IOPort          = 0x360         # I/O port base
IRQ             = 5             # interrupt request level
Firmware        = /usr/lib/router/wanpipe/ppp508.sfm    # adapter firmware
                                # ----- Dual Port Memory Base Address --------
#Memaddr        = 0xD0000       # Commenting this out enables Auto Memory
                                # selection. Valid Memory addresses are:
                                # 0xA0000,0xA2000...0xAE000 / 0xC0000,0xC2000...                                # 0xCE000 / 0xD0000,0xD2000...0xDE000 / 0xE0000,                                # 0xE2000...0xEE000
                                # ----- Physical interface configuration -----
Interface       = RS232         # physical interface type, RS232/V35
Clocking        = External      # Tx/Rx clock source, External/Internal
BaudRate        = 56000         # data transfer rate in bps, 1200..2048000
                                # -----------------IPX Support----------------
IPX             = NO            # Enable IPX Support : YES or NO ?
NETWORK         = 0xABCDEFAB    # IPX Network Number : any 8 Hex digits
                                # --------Dynamic IP Assignment---------------
IP_MODE         = STATIC        # Options: STATIC: Do not request address
                                #          PEER: Request Local/Remote Address
                                # ----- Media-specific configuration ---------
MTU             = 1500          # maximum data transfer unit, bytes
UDPPORT         = 9000          # for UDP management

AUTHENTICATOR   = NO            # The one who initiaties request for PAP or CHAP
TTL             = 0x7F          # Time To Live parameter for UDP packets


[wanpipe4]                      ##### Sample Cisco HDLC Link Configuration #####                                # ----- Hardware configuration ---------------
IOPort          = 0x360         # I/O port base
IRQ             = 5             # interrupt request level
Firmware        = /usr/lib/router/wanpipe/chdlc508.sfm  # adapter firmware
                                # ----- Dual Port Memory Base Address --------
#Memaddr        = 0xD0000       # Commenting this out enables Auto Memory
                                # selection. Valid Memory addresses are:
                                # 0xA0000,0xA2000...0xAE000 / 0xC0000,0xC2000...                                # 0xCE000 / 0xD0000,0xD2000...0xDE000 / 0xE0000,                                # 0xE2000...0xEE000
                                # ----- Physical interface configuration -----
Interface       = RS232         # physical interface type, RS232/V35
Clocking        = External      # Tx/Rx clock source, External/Internal
BaudRate        = 56000         # data transfer rate in bps, 1200..2048000
                                # ----- Media-specific configuration ---------
MTU             = 1500          # maximum data transfer unit, bytes
UDPPORT         = 9000          # for UDP management
TTL             = 0x7F          # Time To Live parameter for UDP packets
                                # --------- Link Management parameters ---------IGNORE_DCD      = NO            # Ignore DCD when determining active link status                                # (YES/NO) Default: NO
IGNORE_CTS      = NO            # Ignore CTS when determining active link status                                # (YES/NO) Default: NO
IGNORE_KEEPALIVE= NO            # Ignore Keep alives when determining active
                                # link status (YES/NO) Default: NO
                                #
KEEPALIVE_TX_TIMER   = 10000    # Interval between Keep Alive (0-60000 ms)
                                # Default 10000ms
KEEPALIVE_RX_TIMER   = 11000    # Interval to expect Keepalives (10-60000 ms)
                                # Default 10000ms
KEEPALIVE_ERR_MARGIN = 5        # Consecutive keepalive timeouts before bringing                                # down the link. Default 3, range: 1 - 20
SLARP_TIMER     = 1000          # Time (ms) between sending SLARP requests
                                # range:(0-60000ms) Default: 5000 ms
# ----------------------------------------------------------------------------
# Logical channel (interface) configuration sections.
# Each statement of the configuraton section has the following format:
#
#       parameter=value
#
# where:
#       parameter       symbolic name of the configuration parameter
#       value           number or symbolic name representing value of the
#                       configuration parameter.
# ----------------------------------------------------------------------------
[svc1]
IdleTimeout=90          # sec, before disconnecting due to inactivity
HoldTimeout=10          # sec, before retrying failed connection

# Channel specific information, overrides Global configuration if specified.
[fr16]
MULTICAST       = NO    # Multicast Enabled?            (YES/NO)
#CIR            = 16    # Committed Information rate.   1 - 512 kbps
#BC             = 16    # Committed Burst Size.         1 - 512 kbits
#BE             = 0     # Excess Burst Size.            0 - 512 kbits
INARP           = NO    # Inverse ARP Requests?         (YES/NO)
INARPINTERVAL   = 0     # sec, between Inverse: ARP Requests
                        # Default is 10 sec.
[sppp]
MUTLICAST       = NO    # Multicast Enabled?
PAP             = NO    # Enable PAP ?                  (YES/NO)
CHAP            = NO    # Enable CHAP?                  (YES/NO)
#USERID         =       # If not the authenticator then enter your login name
                        # If you are the authenticator then provide a list of
                        # all login name. For eg. (USER1 / USER2.../ USER10...)
                        # The login name are separated by "/"
#PASSWD         =       # if not the authenticator then enter your passwd for
                        # your login name. If you are the authenticator then
                        # provide a list of all the passwd for all the login
                        # names in the SAME ORDER. For eg. (PASS1 / PASS2.../
                        # PASS10...)
#SYSNAME        =       # If you are the authenticator then enter your local
                        # system name. Otherwise keep it commented out

-----< THE END >--------------------------------------------------------------

