home *** CD-ROM | disk | FTP | other *** search
/ CICA 1994 September / CICA_Shareware_for_Windows_Walnut_Creek_September_1994.iso / win3 / util / pktmux12.exe / PKTMUX.DOC < prev    next >
Text File  |  1993-01-29  |  118KB  |  2,416 lines

  1. /* C:\DOC\PKTMUX.DOC **** 29 JAN 93 ** 11:43 ******; G W Robinson
  2.  
  3.  
  4.                    R A L   I B M   P C   U S E R   G U I D E
  5.                    -----------------------------------------
  6.  
  7.                        PKTMUX Packet Driver Multiplexor
  8.                        --------------------------------
  9.  
  10.       Contents
  11.       ========
  12.  
  13.       1.    Introduction and Disclaimer
  14.  
  15.       2.    Installation
  16.  
  17.       3.    Overview
  18.  
  19.       4.    Usage Guidelines
  20.  
  21.       5.    Program Description
  22.       5.1     PKTMUX.EXE
  23.       5.2     PKTDRV.EXE
  24.       5.3     PKTSTATS.EXE
  25.       5.4     WINPKT.COM
  26.  
  27.       6.    Examples
  28.       6.1     Packet Driver, PCTCP and PC-NFS Applications under DOS
  29.       6.2     MOS2 under DOS
  30.       6.3     Packet Driver and IEEE 802.3 (ISO 8802/3) applications
  31.       6.4     Packet Driver and Rainbow Applications
  32.       6.5     Packet Driver Applications under Windows 3
  33.       6.6     Packet Driver, PCTCP and PC-NFS Applications under Windows
  34.       6 7     Windows 3 Applications
  35.       6.8     Novell Netware
  36.       6.9     Packet Driver/PKTMUX/PKTDRV BAT files
  37.  
  38.       7.    Technical Description
  39.       7.1     Basic Methodology
  40.       7.2     Buffer Strategy
  41.       7.3     Channel Management
  42.       7.4     Control Programs
  43.       7.5     Listeners and /l Options
  44.       7.6     Port Duplication
  45.       7.7     IP Fragmentation
  46.       7.8     Other IP Protocols
  47.       7.9     IEEE802.3 (ISO 8802/3) Protocol Support
  48.       7.10    Use of Packet Driver Internal Buffer
  49.       7.11    Novell Protocol Support
  50.       7.12    Packet Driver Protocol Filtering
  51.  
  52.       8.    Problem Solving
  53.  
  54.       9.    Bugs/Features and Problem Programs
  55.  
  56.       10.   Differences in PKTMUX versions
  57.  
  58.       11.   Support
  59.  
  60.       12.   References
  61.  
  62.  
  63.  
  64.       1. Introduction and Disclaimer
  65.       ==============================
  66.  
  67.       The author and his employers accept no responsibilty for any damage
  68.       done by this software.  It is run strictly at the user's risk and
  69.       all necessary precautions, such as backing up of discs, should be
  70.       taken before hand.
  71.  
  72.       Similarily the vendors/authors of applications and Packet Drivers
  73.       accept no responsibility for problems and malfunctions, and will
  74.       give no support, when their software is used with PKTMUX.
  75.  
  76.       This document describes PKTMUX which is a program that provides a
  77.       multiplexing interface to a Packet Driver. It thus allows several
  78.       IP protocol stacks to be run in parallel either under DOS or a
  79.       control program such as Windows 3 or DESQview.
  80.  
  81.       Multiplexing IP protocol stacks is a non trivial problem and this
  82.       program is only likely to meet about 90% of user requirements.
  83.       There will always be 10% who need a more sophisticated product.
  84.       Because PKTMUX makes certain probability assumptions it is also
  85.       highly likely that it will make a mistake every now and then when
  86.       they are not valid.  At best an application will recover from this
  87.       situation and at worse something, possibly even the whole PC, will
  88.       fail.  It is therefore likely that PKTMUX will never be 100%
  89.       reliable and in some situations it may be so flakey as to be
  90.       unusable.
  91.  
  92.       This documents version 1.2b and differences from previous versions
  93.       are detailed in Section 10.  The programs from this version must
  94.       not be mixed with those from previous versions as they are
  95.       incompatible.  Many thanks to those around the world who have
  96.       reported problems and helped with their solution.
  97.  
  98.  
  99.       2. Installation
  100.       ===============
  101.  
  102.       The system comes as a single program named PKTMUXxx.EXE where xx is
  103.       the version number, currently 12.  When this program is run it
  104.       expands into several files.  These are:
  105.  
  106.         PKTMUX.EXE      The packet multiplexor
  107.         PKTDRV.EXE      The pseudo Packet Driver interface to PKTMUX
  108.         PKTSTATS.EXE    A program state and statistics display program
  109.         PKTMUX.DOC      This documentation
  110.  
  111.       In addition a free program WINPKT.COM and a source listing
  112.       WINPKT.ASM is supplied since this provides some of PKTMUX's
  113.       functionality and is rather smaller.
  114.  
  115.       The programs should be copied into a directory in the Path such as
  116.       C:\BIN on RAL machines.  PKTMUX.DOC should be put in a
  117.       documentation directory such as C:\DOC on RAL machines.  The BAT
  118.       file INSTALL.BAT does this.
  119.  
  120.  
  121.  
  122.       3. Overview
  123.       ===========
  124.  
  125.       The Packet Driver interface was developed by FTP Software Inc as a
  126.       standardised way of accessing different makes of communications
  127.       cards.  It is widely used especially over ethernets and a large
  128.       amount of communications software is available for it.  The
  129.       ethernet implementation makes use of the fact that two bytes in the
  130.       header define the packet type and this is used to provide a
  131.       multiplexing mechanism between several packet types.  However it
  132.       looks no further into the protocol stack and thus this feature is
  133.       of limited use when protocols of the same type, such as those from
  134.       the TCP/IP family, are used.
  135.  
  136.       PKTMUX attempts to remove this limitation by providing a
  137.       multiplexing facility for Internet Protocols (IP).  This is done by
  138.       not only switching on the packet type (which denotes IP) but also
  139.       the IP protocol type (which can denote IP protocols TCP, UDP, ICMP
  140.       and others).  In the case of TCP and UDP it can also switch on the
  141.       Port number being used.  It is therefore possible to run more than
  142.       one IP protocol stack at the same time.  It is not possible to
  143.       multiplex other protocol stacks or more than one of each IP
  144.       protocol type other than TCP, UDP or ICMP.  One protocol stack can
  145.       be IEEE 802.3 (ISO 8802/3) protocol.
  146.  
  147.       PKTMUX was originally written to meet the needs of the RAL MOS2
  148.       system which is a TSR (Terminate and Stay Resident) program that
  149.       provides IBM 3270 emulation over asynchronous and ethernet
  150.       communications.  In this context it provides two functions for the
  151.       TCP/IP version of MOS2.  On is that it allows additional
  152.       communications applications to run alongside MOS2.  This is useful
  153.       because, since MOS2 is a TSR, you can hot key back to DOS and run
  154.       other commands.  Thus an LPR or FTP can be run alongside the MOS2
  155.       3270 session.
  156.  
  157.       A second requirement was to allow MOS2 to run under a control
  158.       program such as Windows 3 or DESQview.  This is an instance of a
  159.       more general problem in running an application which uses a Packet
  160.       Driver under a control program.  It arises because the Packet
  161.       Driver, which is loaded before Windows, calls the application when
  162.       it has received a packet.  This is quite satisfactory under DOS but
  163.       under Windows there is no certainty that the application is
  164.       currently running and there is therefore the risk of jumping into
  165.       the middle of another program with dire consequences.  A Packet
  166.       Driver option -w gets over this by checking that part of the
  167.       application program code is present and throwing away the packet if
  168.       not.  This leads to a rather slow data rate as the protocol timeout
  169.       and retry mechanisms have to be brought into play to recover from
  170.       the situation.  A better solution is provided by the free software
  171.       WINPKT which only works under Windows 3 Enhanced mode and uses
  172.       Windows 3 facilities to make sure the application is running.  A
  173.       copy of WINPKT is provided in this package.  WINPKT has the
  174.       drawback that it does not work with other control programs such as
  175.       DESQview and also with certain ethernet cards such as the BICC 16
  176.       bit varient.  PKTMUX meets this requirement and gives the
  177.       additional feature of being able to run communications applications
  178.       in more than one window.
  179.  
  180.  
  181.  
  182.       Given the widespread use of Packet Driver it is surprising that
  183.       nobody has written a PKTMUX before.  It is probably because a
  184.       general purpose multiplexor is impossible to implement.  PKTMUX
  185.       only attempts to meet the needs of IP protocols and is therefore
  186.       likely to be of little use in other situations.  It must however be
  187.       emphasised that PKTMUX will only work when the probability of
  188.       various identifying values being duplicated is low and that when
  189.       duplication does occur then the various retry mechanisms can
  190.       recover from the mess.  If this is not the case the PKTMUX is of
  191.       little use.
  192.  
  193.       PKTMUX has so far been tested satisfactorily with PCTCP, PC-NFS,
  194.       NCSA, CUTCP, B&W TCP, Waterloo TCP and Novell Netware.  It has also
  195.       been tested with shims that interface onto a Packet Driver such as
  196.       PDETHER for ODI and RAL LLCPKT for BICC MPS.  It also runs on top
  197.       of the RAL LLCPK2 program that provides a Packet Driver and BICC
  198.       MPS interface.
  199.  
  200.       Further technical details are given in the Program and
  201.       Technical Description sections.
  202.  
  203.  
  204.  
  205.       4. Usage Guidelines
  206.       ===================
  207.  
  208.       The following give basic usage guidelines.  For more detail consult
  209.       the Program Descriptions and Examples sections. All programs except
  210.       WINPKT give help when run with the /h option.
  211.  
  212.       The normal procedure for running a communications application is to
  213.       load a Packet Driver and then run the application. To introduce
  214.       multiplexing into this PKTMUX and PKTDRV must be loaded after the
  215.       Packet Driver and before the application.
  216.  
  217.       Thus under DOS type the following after you have loaded the Packet
  218.       Driver:
  219.  
  220.         PKTMUX n                ; n is the maximum number of packet
  221.                                 ; driver channels to support - default 2
  222.         PKTDRV                  ; repeated n times - displays Interrupt
  223.                                 ; used
  224.  
  225.       Then run the applications as required.  Note the first ones must
  226.       usually be TSRs otherwise you cannot get back to DOS to load
  227.       subsequent applications.  Applications which search for a Packet
  228.       Driver will find the first free PKTDRV.  Once an application
  229.       starts using PKTDRV it becomes busy and is no longer recognised as
  230.       a Packet Driver.  Note that this only happens once the application
  231.       has started communicating over the network so each application
  232.       must be got to this state before further applications are loaded.
  233.       If not then two applications will link into the same PKTDRV and
  234.       fail. Applications for which you have to specify the Packet Driver
  235.       Interrupt should be set for the highest PKTDRV Interrupt to avoid
  236.       conflicts.
  237.  
  238.       For usage under a control program such as Windows 3 run PKTMUX as
  239.       above but dont run PKTDRV until after the control program is
  240.       active.  Then run one copy of PKTDRV in any DOS session from which
  241.       you wish to use a communications application that runs over a
  242.       Packet Driver. All sessions must continue to run when in the
  243.       Background and for Windows 3 the Background Priority should be
  244.       at least 50 and it must be in Enhanced mode.
  245.  
  246.       For applications that run directly under Windows 3 (eg WINQVT)
  247.       either use WINPKT or, if further packet driver channels are
  248.       required, then run PKTMUX as above and then one PKTDRV before
  249.       Windows 3 is loaded.  Then start up the Windows application which
  250.       will use this PKTDRV.  Further applications running in DOS sessions
  251.       must have their PKTDRV loaded in their DOS session before they are
  252.       run.
  253.  
  254.       The program PKTSTATS gives details of program states and various
  255.       statistics.
  256.  
  257.  
  258.  
  259.       5. Program Descriptions
  260.       =======================
  261.  
  262.  
  263.       5.1 PKTMUX.EXE
  264.       --------------
  265.  
  266.       This is a TSR that provides, in conjunction with PKTDRV, multiple
  267.       IP protocol channels to a Packet Driver. Its format is:
  268.  
  269.         PKTMUX  chan_cnt pkt_drv_int chan_time_out /options
  270.  
  271.       which installs the multiplexor on the first packet driver it finds
  272.       or hex interrupt "pkt_drv_int" is this is specified (note 1).
  273.       "Chan_cnt" channels are supported - default is 2 (note 2).
  274.       "chan_time_out" is the time in seconds a timed out channel waits
  275.       before being reset (note 6).  Any failure during loading will cause
  276.       PKTMUX to abort and set the DOS ERRORLEVEL to 1.  PKTMUX memory
  277.       usage ranges from 15K for one channel to 34K for eight channels.
  278.  
  279.       The following options modify the action taken:
  280.  
  281.         a  display additional information on loading.
  282.         b  look for and use buffer in Packet Driver (note 12).
  283.         d  drop packets if application has no buffers (note 5).
  284.         o  override use of specified interrupt (note 1).
  285.         h  display this help information.
  286.         i  support one IEEE 802.3 channel (note 9).
  287.         p  pause if error found (note 13).
  288.         q  query state of a PKTMUX (note 11).
  289.         r  reset timed out channels; rr resets internal flags as well and
  290.            should be used with care (note 6).
  291.         s  silence output except warnings (unless /ss) or errors
  292.            (unless /sss) (note 10).
  293.         t  terminate PKTMUX and Packet Driver (note 3).
  294.         u  unload PKTMUX if not being used by a PKTDRV (note 3).
  295.         v  set DOS Environment variable PKT_INT to interrupt used or
  296.            found (notes 1 & 11).
  297.         x  multiplex all received packets - testing only (note 7).
  298.         1 to 9  allocate buffers for this channel count (note 4).
  299.  
  300.       Examples are:
  301.  
  302.         pktmux               ; normal use - 2 channels
  303.         pktmux 4             ; install to multiplex four applications
  304.         pktmux 2 62          ; install on Packet Driver at Int 62
  305.         pktmux 4 /b          ; try using Packet Driver buffer
  306.         pktmux 4 /bi         ; support IEEE 802.3 and also try and use
  307.                              ; Packet Driver buffer
  308.         pktmux /u            ; unload PKTMUX (dont forget to unload
  309.                              ; PKTDRVs first)
  310.         pktmux 8 /4          ; install to multiplex eight applications
  311.                              ; but only allocate enough buffers for four
  312.         pktmux /r            ; reset timed out channels
  313.  
  314.  
  315.  
  316.       Notes:
  317.  
  318.       1.  By default PKTMUX searches for a Packet Driver and, on finding
  319.       one, takes over its interrupt effectively hiding it so it cannot be
  320.       found by any other application.  There is then no confusion between
  321.       the real Packet Driver and the pseudo ones provided by PKTDRV.  If
  322.       the /v option is given then the interrupt used is recorded in the
  323.       Environment variable PKT_INT.  Note that PKTMUX will refuse to load
  324.       if during its search for a Packet Driver either another PKTMUX or a
  325.       PKTDRV is found or if one of these is the specified pkt_drv_int.
  326.       This latter restriction can be overcome by the /o (override)
  327.       option.
  328.  
  329.       2.  By default PKTMUX supports two Packet Driver channels.  This
  330.       means it will communicate with up to two copies of PKTDRV and
  331.       provide two pseudo Packet Driver interfaces.  Each PKTDRV acts,
  332.       within limits, as if it were a Packet Driver with its own ethernet
  333.       card albiet with the same MAC address as any others.  PKTMUX
  334.       supports up to eight busy copies of PKTDRV.  Note that supporting
  335.       only one channel achieves the same effect as a normal Packet Driver
  336.       and is only useful where PKTMUX provides additional functionality
  337.       such as allowing an application to run under Windows 3.
  338.  
  339.       3.  The /u option causes PKTMUX to unload unless a PKTDRV is still
  340.       busy.  The /t option does the same thing but also sends a terminate
  341.       request to the Packet Driver, which will also unload if it supports
  342.       this facility.
  343.  
  344.       4.  By default PKTMUX allocates a basic set of buffers and then
  345.       adds an additional one to each size group for each channel.  Tests
  346.       suggest this is adequate for most cases.  However this can be
  347.       overridden by giving /n where n is a decimal number in the range 0
  348.       to 9.  PKTMUX will then allocate buffers as if this number of
  349.       channels were to be used.  This can be used to either save memory
  350.       by reducing the buffer allocation or increasing the number of
  351.       buffers when experience suggests it is needed.  The memory overhead
  352.       per channel is a little over 2K.
  353.  
  354.       The buffer allocation is shown by PKTMUX when it is loaded and in
  355.       detail by running PKTSTATS /a after PKTMUX has been loaded.
  356.  
  357.       5. PKTMUX does its best to avoid losing data by holding packets in
  358.       its buffers when an application is unable to accept them. In some
  359.       cases this can cause a shortage of buffers. The /d (drop) option
  360.       causes PKTMUX to behave exactly as a Packet Driver and to drop any
  361.       packet that is refused by an application because it has
  362.       insufficient buffer space. This option acts on all channels and
  363.       overrides a similar option on PKTDRV which works on a per channel
  364.       basis.
  365.  
  366.  
  367.  
  368.       6.  When running under Windows 3 or DESQview with a PKTDRV and the
  369.       application in a DOS session then, if the session is terminated
  370.       without closing down the application, PKTMUX is left with the
  371.       channel marked as Busy.  It will either be freed after
  372.       "Chan_time_out" seconds (default infinity) or the option /r (reset)
  373.       can be used on a call to PKTMUX to reset all such channels.  If /rr
  374.       is given then the busy flags in PKTMUX are also reset which could
  375.       cause it to fail.  See also the PKTDRV /r option and the section on
  376.       Channel Management in the Technical Description below for further
  377.       details.
  378.  
  379.       7.  By default PKTMUX sends data direct to the application when
  380.       only one channel is in use.  If the /x option is given then packets
  381.       are copied to a buffer and multiplexed by the normal mechanisms as
  382.       if several channels were operational.  This is therefore a test
  383.       facility to check if PKTMUX is able to support an application
  384.       irrespective of any other application that is running. Note that
  385.       if /x is used with Novell and Windows 3 it can crash Windows.
  386.  
  387.       8.  PKTMUX only supports Accesses for Packet Driver Class 1
  388.       (DEC/Intel/Xerox "Bluebook" Ethernet).  It will not refuse other
  389.       Classes but the result is undefined and a failure is likely if
  390.       the same Class is used over more than one channel.
  391.  
  392.       9.  If the /i option is given then PKTMUX opens the Packet Driver
  393.       for all types and does its own filtering on the Type field in order
  394.       to decide to which handle a packet is destined.  This is order to
  395.       allow one channel to Access as Packet Driver Class 1 and to accept
  396.       IEEE 802.3 type packets where the Type field is the data length and
  397.       is a value of 1500 bytes or less.  This dramatically reduces the
  398.       efficiency of PKTMUX so should only be used when IEEE 802.3 packets
  399.       are to be used.  Unfortunately the overhead remains irrespective of
  400.       whether such packets are being used but this can be mitigated by
  401.       the /b option.
  402.  
  403.       Note this is a new facility to evaluate feasibility and may not be
  404.       very satisfactory. In particular if used with Novell and Windows 3
  405.       it can crash Windows.
  406.  
  407.       10.  If the /s option is given then PKTMUX does not give out any
  408.       messages unless an error or warning occurs. The option /ss prevents
  409.       any warning messages as well and /sss prevents errors as well.
  410.  
  411.       11. The /q option causes PKTMUX to return the state of
  412.       "pkt_drvr_int" in both text form and also via the ERRORLEVEL as
  413.       follows:
  414.  
  415.                 0    No PKTMUX found
  416.                 1    PKTMUX found
  417.  
  418.       If the "pkt_drvr_int" is not specified then a search is made from
  419.       Interrupts 60 to 7F looking for PKTMUX. If the /v option is given
  420.       then the interrupt used is recorded in the Environment variable
  421.       PKT_INT.
  422.  
  423.  
  424.       12.  The /b option causes PKTMUX to try and locate the data buffer
  425.       within the Packet Driver so that it can look at the data before
  426.       taking a copy of the packet.  This option is specific to the Packet
  427.       Drivers of certain ethernet cards and has been tested successfully
  428.       on the following:
  429.  
  430.                 Card                     Buffer Size Found in Bytes
  431.  
  432.         BICC 16 bit ISA and MCA versions            64
  433.         NE2000                                      23
  434.         WD8003                                      64
  435.  
  436.       Note that if PKTMUX is unable to find the data buffer the option is
  437.       disabled so it can be used safely in any situation.  However if the
  438.       card you are using is not in the above list then it would be
  439.       prudent to check that all is well just in case the algorithm fails
  440.       to locate the correct buffer.  If the /x option is given then
  441.       PKTMUX goes through the motions of trying to locate the buffer but
  442.       does not use it.  Note that PKTSTATS displays the current state of
  443.       the algorithm and with the /a option gives more details.
  444.  
  445.       This is a new facility to evaluate feasibility and may not be very
  446.       satisfactory in some cases.  It is further explained in the
  447.       Technical Description section below.
  448.  
  449.       13.  One of the problems in running PKTMUX from a batch file is
  450.       that if an error occurs then the message often disappears off the
  451.       screen before it can be noted. The /p option causes output to pause
  452.       if an error is detected when PKTMUX is first loaded and wait for
  453.       input from the user before proceeding.
  454.  
  455.  
  456.  
  457.  
  458.       5.2 PKTDRV.EXE
  459.       --------------
  460.  
  461.       This is a TSR which provides the pseudo Packet Driver interface in
  462.       conjunction with PKTMUX.  Its format is:
  463.  
  464.         PKTDRV pkt_drvr_int mux_int all_type /options
  465.  
  466.       which uses the multiplexor on hex interrupt "mux_int" or by default
  467.       searches for it.  It installs itself as a Packet Driver on hex
  468.       interrupt "pkt_drvr_int" or, by default, the first free interrupt
  469.       after the multiplexor (note 1).  The "all_type" parameter
  470.       (repeatable) defines the packet Type values used when an
  471.       application asks for all types (eg PC-NFS v3.0).  The
  472.       default setting is 0800, 0806 and 8035 (note 2).  Any failure
  473.       during loading will cause PKTMUX to abort and set the DOS
  474.       ERRORLEVEL to 1.  PKTDRV memory usage is a little over 1K.
  475.  
  476.       The following options modify the action taken:
  477.  
  478.         c   copy send buffers (note 3).
  479.         d   drop packets if application has no buffers (note 5).
  480.         e   extend search area under a control program (note 11).
  481.         f   force PKTDRV to be Free; !f forces to Busy (note 1)
  482.         h   display this help information.
  483.         i   asking for all types gives IEEE 802.3 channel (note 7).
  484.         l   act as listener for any protocol type (note 4).
  485.        !l   dont act as listener for any protocol type.
  486.         lf  act as listener for TCP FTP; !lf negates.
  487.         li  act as listener for IP; !li negates.
  488.         lt  act as listener for TCP; !lt negates.
  489.         lt# act as listener for TCP port # (decimal); !lt# negates.
  490.         lu  act as listener for UDP only; !lu negates.
  491.         lu# act as listener for UDP port # (decimal); !lu# negates.
  492.         n   only load PKTDRV if needed ie. there is no free PKTDRV
  493.             already (note 8).
  494.         o   override use of specified interrupt (note 1).
  495.         p  pause if error found (note 12).
  496.         q   query state of a PKTDRV (note 10).
  497.         r   reset a PKTDRV that is busy (note 1).
  498.         s   silence output except warnings (unless /ss) or errors
  499.             (unless /sss) (note 9).
  500.         t   terminate PKTDRV, PKTMUX and Packet Driver (note 6).
  501.         u   unload last loaded PKTDRV if Busy (note 6).
  502.         uu  unload last loaded PKTDRV even if Busy.
  503.         ur  repeatedly unload last loaded PKTDRV if not Busy.
  504.         v   set DOS Environment variable PKT_INT to interrupt used or
  505.             found (notes 1 & 11).
  506.         w#  wake up using ethernet IRQ # (decimal) (note 13).
  507.  
  508.  
  509.       Examples are:
  510.  
  511.         pktdrv               ; normal use
  512.         pktdrv /c            ; copy send buffers
  513.         pktdrv 66 62         ; multiplexor on 62, put Packet Driver on 66
  514.         pktdrv /t            ; terminate PKTDRV, PKTMUX and Packet Driver
  515.         pktdrv /u            ; unload last PKTDRV to be loaded
  516.         pktdrv /uu           ; unload last PKTDRV to be loaded even if Busy
  517.         pktdrv 63 /u         ; unload PKTDRV on Int 63
  518.         pktdrv 0 0 800 806 1000 ; Application wanting all packet types will
  519.                                 ; just get 0800, 0806 and 1000
  520.         pktdrv /!l /lf       ; not a listener for any service except FTP
  521.         pktdrv /lt21         ; listener for TCP port 21
  522.         pktdrv /w3           ; wake up with ethernet IRQ 3
  523.  
  524.       Notes:
  525.  
  526.       1.  PKTDRV by default uses the next free Interrupt after that used
  527.       by PKTMUX.  It avoids Interrupts 61, 62 and 64, as these are used
  528.       by PCTCP, Vista eXceed and Novell respectively, and also 67 as this
  529.       is the EMS entry point.  Interrupts 70 - 76 are normally in use on
  530.       all but the XT type PCs.  If the /v option is given then the
  531.       interrupt used is recorded in the Environment variable PKT_INT.  If
  532.       the Interrupt is specified it is checked to see if it already in
  533.       use by PKTDRV, PKTMUX or a Packet Driver and if so PKTDRV will
  534.       refuse to load unless the /o option is given.
  535.  
  536.       Note that under a control program, such as Windows 3, PKTDRV will,
  537.       by default, use the same Interrupt in each DOS session it is loaded
  538.       in.  This is because each DOS session has its own version of the
  539.       Interrupts.  For the same reason PKTSTATS will only see the PKTDRV,
  540.       if any, in its DOS session yet will display the correct total that
  541.       are busy.
  542.  
  543.       Part of the Packet Driver definition is the use of the string PKT
  544.       DRVR just after the interrupt entry point in order to identify it.
  545.       A communications application which does not require the explicit
  546.       definition of the Packet Driver interrupt searches from Interrupt
  547.       60 up to 7f until it finds one.  PKTDRV uses the same mechanism and
  548.       so appears to be a genuine Packet Driver.  However once a
  549.       communications application has accessed PKTDRV the identification
  550.       is changed and only reverts back when the application has given a
  551.       release command.  Thus several copies of PKTDRV can provide the
  552.       impression that multiple Packet Drivers are present.  The state of
  553.       each PKTDRV is shown by calling PKTSTATS - Free means it can be
  554.       used by an application and Busy means its identification has been
  555.       changed and it is in use.
  556.  
  557.       One problem with this mechanism is when two applications can use
  558.       the same Packet Driver - for example PCTCP running alongside a
  559.       Novell Packet Driver using TYPE 8137 protocol - then doing this
  560.       over one PKTDRV will fail.  One solution is to use separate PKTDRV
  561.       for each.  Alternatively once the first application has been
  562.       started and the PKTDRV is now Busy then a command of the form:
  563.  
  564.         pktdrv pkt_drvr_int /f
  565.  
  566.       forces the state back to Free. A second application can then be
  567.       loaded which finds PKTDRV and can use it.
  568.  
  569.  
  570.  
  571.       The opposite problem is when an application is loaded, locates a
  572.       Free PKTDRV but does not issue any commands and thus change the
  573.       PKTDRV state to Busy.  The call:
  574.  
  575.         pktdrv pkt_drvr_int /!f
  576.  
  577.       forces the PKTDRV to be Busy thus subsequent applications will not
  578.       find it.
  579.  
  580.       If a PKTDRV is marked as Busy and the application has terminated
  581.       (or crashed!) then calling PKTDRV with /r option will reset the
  582.       specified "pkt_drvr_int" PKTDRV.  Note that /r resets the channel
  583.       whereas /f simply resets the program identification and leaves all
  584.       the call details intact.  If the PKTDRV was also terminated at the
  585.       same time as the application, such as when a Windows DOS session is
  586.       terminated, then the channel is Busy but there is no PKTDRV to send
  587.       a Reset to.  In this case PKTMUX will have registered that the
  588.       PKTDRV has gone and giving the command:
  589.  
  590.         pktmux /r
  591.  
  592.       will reset any Busy channel for which there is no PKTDRV.
  593.  
  594.       Note that in the PKTDRV calls above if the "pkt_drvr_int" is
  595.       not specified then a search is made from the last possible PKTDRV
  596.       Interrupt number (7f) back to the first (60).  Thus a generalised
  597.       use of the feature is possible provided the PKTDRV being used is
  598.       the last one that was loaded and/or the highest Interrupt number.
  599.       See also note 11.
  600.  
  601.       The /f, /!f and /r requests are refused if they are directed at a
  602.       PKTDRV which was loaded under DOS and the PKTDRV issuing them is
  603.       running under Windows or DESQview.  This can be overriden by
  604.       repeating the option for example /ff, /!f!f or /rr.
  605.  
  606.       A copy of PKTDRV can be loaded at any time.  If it is required to
  607.       unload the system at some later time it is perhaps wise to load all
  608.       the PKTDRV copies that are required under DOS just after PKTMUX.
  609.       This minimises the chance of problems with interrupt chains but
  610.       means that any use of the /f or /r options need the "pkt_drvr_int"
  611.       specifying.
  612.  
  613.       2.  Instead of requesting certain packet types some applications,
  614.       notably PC-NFS v3.0, ask for all packet types.  PKTMUX
  615.       does not allow this since it makes its job extremely difficult so
  616.       PKTDRV intercepts such a request and replaces it by specific packet
  617.       types.  By default these are 0800 (IP Protocols), 0806 (ARP -
  618.       Address Resolution Protocols) and 8035 (RAPR - Reverse ARP) and
  619.       these are all PC-NFS really needs for its own use.  Where further
  620.       packet types are required these can be overridden and alternatives
  621.       supplied.
  622.  
  623.       One limitation of this implementation is that an application with a
  624.       genuine requirement for all packet types cannot be supported.  An
  625.       exception is IEEE 802.3 (ISO 8802/3) over a Packet Driver Class
  626.       1 as used by the RAL LLCPKT product and this can be supported by
  627.       via the /i option.
  628.  
  629.  
  630.       Note that a single PKTDRV will only support a single application
  631.       when implementing all packet types (such as PC-NFS) or IEEE802.3.
  632.       If another application is required, such as Novell, then it must
  633.       use another PKTDRV.
  634.  
  635.  
  636.       3.  Under Windows 3 (and possibly DESQview) some communications
  637.       cards which use DMA (direct memory access) for sending data don't
  638.       work properly.  The same thing can happen when the application is
  639.       located in upper memory (ie above 640K).  The solution is to copy
  640.       the data from the application's buffer into one in PKTMUX and send
  641.       it from there.  This is done by the /c option and it only applies
  642.       to data sent via that PKTDRV.  The only card so far found to
  643.       require this is the BICC 16bit ethernet card though this may be
  644.       dependent on the PC hardware and the EMM in use.
  645.  
  646.       4.  The /l and /!l options indicate whether or not the application
  647.       using this PKTDRV should act as a listener for well known services.
  648.       See Technical Description below for further details.
  649.  
  650.       5.  The /d (drop) option makes this PKTDRV channel behave as a
  651.       normal Packet Driver and drop any packet for which the application
  652.       has no buffer rather than holding it in a buffer which is the
  653.       default.  The PKTMUX option /d implements the same feature for all
  654.       channels and overrides the PKTDRV setting.
  655.  
  656.       6.  The /u option causes PKTDRV to unload unless it is still busy
  657.       with an application.  Adding an /r requests all PKTDRVs be
  658.       unloaded.  Note this may not be possible if other TSRs where loaded
  659.       between PKTDRVs.  If it is known that an application is not Busy,
  660.       such as when it has crashed, then the /uu option will force the
  661.       unload.  The /t option does the same thing but also sends a
  662.       terminate request to PKTMUX which, if it is acceptable, will also
  663.       send a terminate request to the Packet Driver. These requests are
  664.       refused if the PKTDRV they are directed at was loaded under DOS
  665.       and the PKTDRV issuing them is running under Windows or DESQview.
  666.  
  667.       If the "pkt_drvr_int" is not specified then a search is made from
  668.       the last possible PKTDRV Interrupt number (7f) back to the first
  669.       (60).  Thus a generalised use of this feature is only possible
  670.       provided the PKTDRV being unloaded is the last one that was loaded
  671.       and also the highest Interrupt number. See also note 11.
  672.  
  673.       7.  If the /i option is given then a request for all types will
  674.       result in IEEE 802.3 (ISO 8802/3) type packets (ie those 1500 bytes
  675.       long or less) being routed up this channel.  The PKTMUX /i option
  676.       must also be given for this to work.
  677.  
  678.       Thus implementations of ISO CONS (Pinkbook in the UK academic
  679.       community) can run over PKTMUX where Access is done using Packet
  680.       Driver Class 1.  UK Academic users of the RAINBOW software who wish
  681.       to use a Packet Driver alongside to run say PC-NFS or any other
  682.       TCP/IP stack thus have two options.  They can either run the RAL
  683.       LLCPKT2 product which provides a packet driver interface.  This
  684.       interface can then be either used directly by an application or via
  685.       PKTMUX for several applications.
  686.  
  687.  
  688.       Alternatively they can run LLCPKT direct to a PKTDRV with the /i
  689.       option.  Note however that the overheads of both methods are
  690.       significant. However if the /b option is successfully used on
  691.       PKTMUX then the latter is dramatically more efficient.
  692.  
  693.       Note this is a new facility to evaluate feasibility and may not be
  694.       very satisfactory. Depending on feedback a better implementation
  695.       may be included in the next version.
  696.  
  697.       8.  The /n option instructs PKTDRV to check either the specified
  698.       "pkt_drvr_int" or, if this is not given, then Interrupts between 60
  699.       to 7f to see if a PKTDRV is already running and whether it is Free.
  700.       If this is true it does not load and returns an ERRORLEVEL
  701.       similar to the /q option as follows:
  702.  
  703.                 0    No Free PKTDRV found - PKTDRV loaded ok
  704.                 2    Free PKTDRV found - PKTDRV not loaded
  705.                 3    As 2 but Free PKTDRV loaded before Control Program
  706.                 4    No Free PKTDRV found - PKTDRV load failed for
  707.                      another reason such as no PKTMUX present.
  708.  
  709.       The parameter settings of the free PKTDRV are also set to those of
  710.       the PKTDRV call except for the /w (ethernet board interrupt)
  711.       option which cannot be changed from its original setting.
  712.  
  713.       This option allows a BAT file to only load a PKTDRV if it is
  714.       required. See also note 11. Note that the ERRORLEVEL denoting a
  715.       failure is now 4 instead of 1 as it is when the /n option is not
  716.       present.
  717.  
  718.       9.  If the /s option is given then PKTDRV does not give out any
  719.       messages unless an error or warning occurs. The option /ss prevents
  720.       any warning messages and /sss prevents error messages as well.
  721.  
  722.       10. The /q option causes PKTDRV to return the state of
  723.       "pkt_drvr_int" in both text form and also via the ERRORLEVEL as
  724.       follows:
  725.  
  726.                 0    No PKTDRV found
  727.                 1    Busy PKTDRV found
  728.                 2    Free PKTDRV found
  729.                 3    As 2 but Free PKTDRV loaded before Control Program
  730.  
  731.       If the "pkt_drvr_int" is not specified then a search is made from
  732.       Interrupts 60 to 7F looking for any PKTDRVs.  Reporting a Free
  733.       PKTDRV takes precedence over a Busy one. See also note 11.
  734.  
  735.       11.  The rules for searching for a PKTDRV are modified when
  736.       running in the DOS session of a control program such as Windows or
  737.       DESQview.  In this case, even if the "pkt_drvr_int" is specified,
  738.       only the PKTDRV programs loaded in this DOS session are checked.
  739.       To expand the search to all PKTDRVs, that is to include those
  740.       loaded before the control program was run, the option /e must be
  741.       given.  Thus it is possible to target the effect of any option to
  742.       either the current DOS session or all the PKTDRVs in the machine
  743.       excluding those in other DOS sessions.  If the /v option is given
  744.       then the PKTDRV interrupt is recorded in the Environment variable
  745.       PKT_INT.  These search rules affect options /f, /!f, /n, /q, /r,
  746.       /t and /u.
  747.  
  748.  
  749.       12.  One of the problems in running PKTDRV from a batch file is
  750.       that if an error occurs then the message often disappears off the
  751.       screen before it can be noted. The /p option causes output to pause
  752.       if an error is detected when PKTDRV is first loaded and wait for
  753.       input from the user before proceeding.
  754.  
  755.       13.  Some applications use the ethernet hardware interrupt to drive
  756.       their communications code.  This gives problems with PKTMUX since
  757.       when more than one channel is busy any received data is sent to the
  758.       application after this interrupt has been processed.  The outcome
  759.       is that the application runs satisfactorily on its own but once a
  760.       second channel becomes busy the application then slows down.  The
  761.       solution is to make the ethernet interrupt wake up PKTDRV by using
  762.       the /w option.  The IRQ value of the ethernet hardware interrupt
  763.       must be specified in decimal and should be in the range 2 to 15.
  764.  
  765.       This option should thus be used with any application that requires
  766.       the ethernet hardware IRQ or interrupt to be specified.  It may
  767.       also give improved performance if used for all applications.  The
  768.       only exception is when PKTDRV is running in a Windows or DESQview
  769.       session when the option is ignored as it would crash the PC.
  770.  
  771.       Note that IRQs map onto the PCs interrupt values as follows:
  772.  
  773.         IRQ (Decimal)  : 2  3  4  5  6  7   8   9  10  11  12  13  14  15
  774.         IRQ (Hex)      : 2  3  4  5  6  7   8   9   A   B   C   D   E   F
  775.         Interrupt (Hex): A  B  C  D  E  F  70  71  72  73  74  75  76  77
  776.         Interrupt (Dec):10 11 12 13 14 15 112 113 114 115 116 117 118 119
  777.  
  778.       Applications that have been found to need this option are B&W NFS
  779.       and Wollongong Pathway NFS.
  780.  
  781.  
  782.  
  783.       5.3 PKTSTATS.EXE
  784.       ----------------
  785.  
  786.       This program displays program details and statistics from PKTMUX.
  787.       Its format is:
  788.  
  789.         PKTSTATS /options
  790.  
  791.       The following options modify the action taken:
  792.  
  793.         a  display further information - can be repeated (note 1).
  794.         e  extend PKTDRV search area under a control program (note 5).
  795.         h  display this help information.
  796.         q  query state of a Packet Driver, PKTMUX and PKTDRV (note 4).
  797.         s  silence output from /q option.
  798.         v  set DOS Environment variable PKT_INT to interrupt found by
  799.            /q option (note 5).
  800.  
  801.       Examples are:
  802.  
  803.         pktstats             ; normal use
  804.         pktstats /a          ; show further information
  805.         pktstats /q          ; query state
  806.         pktstats /qe         ; query state under Windows including
  807.                              ; PKTDRV copies loaded under DOS
  808.  
  809.       Notes:
  810.  
  811.       1.  The option /a can be repeated up to 3 times to give increasing
  812.       levels of information.  This is mainly intended for debugging
  813.       purposes.  Repeating /a 3 times can get the program in a loop or
  814.       give misleading information since it scans queues which may be
  815.       changing.  This is intended only for cases when PKTMUX has stopped
  816.       with a system error.
  817.  
  818.       2.  The counts given by PKTSTATS are 16 bit integers so will
  819.       overflow over a period of time.  The counts are not read at the
  820.       same time but are obtained as they are required by PKTSTATS.  As
  821.       PKTMUX is processing data at the same time there may be some
  822.       inconsistencies in fast moving values such as Broadcast and Ignored
  823.       counts.
  824.  
  825.       3.  In the output from PKTSTATS where the name before a count value
  826.       is in CAPITAL letters then this indicates that data is being lost
  827.       or discarded for some reason.  Further details are given in the
  828.       section on Problem Solving.
  829.  
  830.  
  831.  
  832.       Each PKTDRV channel may have one or more of the following
  833.       qualifiers againsts it:
  834.  
  835.         /Drop_buff      PKTDRV /d option given
  836.         /DV             PKTDRV running under DESQview
  837.         /DOS_to_Window  PKTDRV running under DOS but application under
  838.                         Windows so application may loose packets.
  839.         /TIMED_OUT      PKTDRV appears to be no longer active.
  840.         /TX_Copy        PKTDRV /c option given
  841.         /Win            PKTDRV running under Windows
  842.         /Zero_type      All Packet Types requested so mapped onto
  843.                         specified Types - usually 0806 and 0800.
  844.         /802.3          PKTDRV /i option given
  845.  
  846.       4. The /q option causes PKTSTATS to search Interrupts 60 to 7f
  847.       for the state of a Packet Driver, PKTMUX and PKTDRV and report
  848.       back in both text form (unless /s option given) and also via the
  849.       ERRORLEVEL as follows:
  850.  
  851.                 0    No Packet Driver found
  852.                 1    Packet Driver found
  853.                 2    PKTMUX and Packet Driver found
  854.                 3    Busy PKTDRV, PKTMUX and Packet Driver found
  855.                 4    Free PKTDRV, PKTMUX and Packet Driver found
  856.                 5    As 4 but Free PKTDRV loaded before Control Program
  857.  
  858.       Reporting a Free PKTDRV takes precedence over a Busy one.  See also
  859.       note 5.
  860.  
  861.       5.  The rules for searching for a PKTDRV with the /q option are
  862.       modified when running in the DOS session of a control program such
  863.       as Windows or DESQview.  In this case only the PKTDRV programs
  864.       loaded in this DOS session are checked.  To expand the search to
  865.       all PKTDRVs, that is to include those loaded before the control
  866.       program was run, the option /e must be given.  Thus it is possible
  867.       to target the effect of the /q option to either the current DOS
  868.       session or all the PKTDRVs in the machine excluding those in other
  869.       DOS sessions.  If the /v option is given then the interrupt of
  870.       whatever is found is recorded in the Environment variable PKT_INT.
  871.  
  872.  
  873.  
  874.       5.4 WINPKT.COM
  875.       --------------
  876.  
  877.       This program is not part of the PKTMUX system but since it provides
  878.       a subset of the facilities for a smaller memory requirement it is
  879.       included.  In is not supported by RAL.  In accordance with the
  880.       distribution licence the source is also supplied in WINPKT.ASM.
  881.       The program COPYING mentioned at start up is not supplied as I dont
  882.       have a copy.  WINPKT is also part of the Crynwr (ex Clarkson)
  883.       Packet Driver collection v10 and may be a later version.
  884.  
  885.       WINPKT acts as an interface between an application running under
  886.       Windows 3 in Enhanced mode and a Packet Driver.  It uses Windows 3
  887.       calls so is specific to this case.  Its format is:
  888.  
  889.         WINPKT new_pkt_drvr_int old_pkt_drvr_int
  890.  
  891.       where "old_pkt_drvr_int" is the interrupt of the Packet Driver in
  892.       either decimal or hex preceeded by 0x.  "new_pkt_drvr_int" is the
  893.       new interrupt to use and cannot be the same as "old_pkt_drvr_int".
  894.       There are no documented options.
  895.  
  896.  
  897.       Examples are:
  898.  
  899.         winpkt 0x63 0x64        ; Packet driver on Interrupt 64, WINPKT
  900.                                 ; accessed via Interrupt 63
  901.         winpkt                  ; provide help information
  902.  
  903.  
  904.       Notes:
  905.  
  906.       1.  WINPKT should be loaded after the Packet Driver and before
  907.       Windows 3 is loaded.  It is recommended that "new_pkt_drvr_int" is
  908.       before "old_pkt_drvr_int" since applications that search for a
  909.       packet driver will find the driver and not WINPKT.
  910.  
  911.       2.  WINPKT has no unloading mechanism so if unloading is required
  912.       the RAL LOADSYS system or similar must be used.
  913.  
  914.       3. WINPKT may not work with certain ethernet cards. The BICC 16 bit
  915.       card is the only know example so far found. PKTMUX should be used
  916.       in these cases along with the /c option on PKTDRV.
  917.  
  918.  
  919.  
  920.       6.  Examples
  921.       ============
  922.  
  923.       The following examples illustrate the use of PKTMUX and attempt to
  924.       show the various possible uses of the system. It assumes a degree
  925.       of familiarity with setting up and use of the various systems
  926.       exampled. Examples include the RAL MOS2 IBM 3270 emulator since
  927.       this system was one of the reasons for writing PKTMUX. The RAL
  928.       LOADSYS program to load and unload TSRs and Device Drivers can also
  929.       be useful in running multiple protocol stacks. Details of both are
  930.       given in the Reference Section.
  931.  
  932.       It is usually the case that a sequence of commands is put into a
  933.       BAT file and one section below gives examples of techniques that
  934.       facilitate this.
  935.  
  936.       In general there are two classes of communications applications.
  937.       The simplest are those that just need a Packet Driver in order to
  938.       work, for example the CUTCP programs PING, LPR and FTPBIN.  A more
  939.       complicated type are those applications which require their own TSR
  940.       to be loaded first.  The applications then communicate via this
  941.       instead of directly to the Packet Driver.  Examples are
  942.       applications that run over PCTCP and PC-NFS.
  943.  
  944.       Another twist are those applications that either are, or can
  945.       become, TSRs and thus allow you to return to DOS.  Thus further
  946.       applications can be run.  Examples are MOS2 which is a TSR and FTP
  947.       which via the command !  becomes a TSR and starts up a DOS session.
  948.  
  949.  
  950.       6.1 Packet Driver, PCTCP and PC-NFS Applications under DOS
  951.       ----------------------------------------------------------
  952.  
  953.       The following illustrates how to run a Packet Driver application
  954.       alongside those requiring their own TSR to be loaded.  The first is
  955.       for PCTCP and assumes IPCUST.SYS and IFCUST.SYS are loaded in
  956.       CONFIG.SYS.
  957.  
  958.         ne2000 0x63 0x5 0x320    ; Load Packet Driver for NE2000 card
  959.         pktmux                   ; Support 2 channels
  960.         pktdrv                   ; PKTDRV for PCTCP to use
  961.         pktdrv                   ; PKTDRV for Packet Driver application
  962.                                  ; to use
  963.         ethdrv                   ; PCTCP Packet Driver interface
  964.  
  965.       You can now run applications from the PCTCP program suite, such as
  966.       FTP, PING or LPR. Programs that just require a Packet Driver can
  967.       also be run such as FTPBIN from the CUTCP program suite.
  968.  
  969.  
  970.  
  971.       The following illustrates how to run a Packet Driver application
  972.       alongside the PC-NFS TSR.  It is assumed that SOCKDRV.SYS, PKTD.SYS
  973.       and ANSI.SYS are loaded in CONFIG.SYS.
  974.  
  975.         pcnfs.sys /b1            ; loaded in CONFIG.SYS
  976.  
  977.         mbdndpd 0x63 /I10 /D3    ; Load Packet Driver for BICC 16 bit
  978.                                  ; card
  979.         pktmux                   ; Support 2 channels
  980.         pktdrv                   ; PKTDRV for PC-NFS to use
  981.         pktdrv                   ; PKTDRV for Packet Driver application
  982.         cd \nfs
  983.         prt *                    ; Normal PC-NFS loading
  984.         net init
  985.  
  986.       PC-NFS applications such as NFSPING can now be run as well as those
  987.       just requiring a Packet Driver such as FTPBIN from CUTCP.
  988.  
  989.  
  990.       6.2 MOS2 under DOS
  991.       ------------------
  992.  
  993.       The RAL MOS2 IBM 3270 Emulator v2.3 is a TSR.  It supports the
  994.       Waterloo TCP/IP protocol stack and is normally run by loading the
  995.       Packet Driver and then running the file MOS2T.BAT.  To achieve this
  996.       using PKTMUX type:
  997.  
  998.         ne2000 0x63 0x5 0x320    ; Load Packet Driver
  999.         pktmux                   ; Support 2 channels
  1000.         pktdrv                   ; PKTDRV for MOS2 to use
  1001.         pktdrv                   ; PKTDRV for applications to use
  1002.         mos2t                    ; Run MOS2
  1003.  
  1004.       Once MOS2 is running you can then hot key (Alt-Esc) back to DOS and
  1005.       then any other communications application which runs over a Packet
  1006.       Driver can be used. For example PING from the Waterloo TCP/IP
  1007.       suite or FTPBIN or LPR from the CUTCP suite. For example:
  1008.  
  1009.         ftpbin ib                ; establish FTP communications with IB
  1010.  
  1011.  
  1012.       To run MOS2 alongside applications from the PCTCP applications
  1013.       suite the following is suggested:
  1014.  
  1015.         ne2000 0x63 0x5 0x320    ; Load Packet Driver
  1016.         pktmux                   ; Support 2 channels
  1017.         pktdrv                   ; PKTDRV for PCTCP to use
  1018.         pktdrv                   ; PKTDRV for MOS2 to use
  1019.         ethdrv                   ; PCTCP Packet Driver interface
  1020.         mos2t                    ; Run MOS2
  1021.  
  1022.       Once MOS2 is running the PCTCP applications can be used.
  1023.  
  1024.       A combination of the two cases, that is the ability to run
  1025.       applications from the PCTCP program suite or any other application
  1026.       that runs directly over a Packet Driver can be achieved by the
  1027.       following:
  1028.  
  1029.  
  1030.  
  1031.         ne2000 0x63 0x5 0x320    ; Load Packet Driver
  1032.         pktmux 3                 ; Support 3 channels
  1033.         pktdrv                   ; PKTDRV for PCTCP to use
  1034.         pktdrv                   ; PKTDRV for MOS2 to use
  1035.         pktdrv                   ; PKTDRV for applications to use
  1036.         ethdrv                   ; PCTCP Packet Driver interface
  1037.         mos2t                    ; Run MOS2
  1038.  
  1039.       Once MOS2 is running either the PCTCP applications or those
  1040.       requiring a Packet Driver can be used.
  1041.  
  1042.       Note that it is possible to run MOS2 before loading PCTCP but this
  1043.       is not recommended.  Loading PCTCP first removes any problems
  1044.       with the provision of well known services such as an FTP listener.
  1045.       If MOS2 must be loaded first then its PKTDRV should have the /!l
  1046.       option so that any incoming calls for well known services are
  1047.       routed to the next PKTDRV which should be the one for PCTCP.
  1048.  
  1049.  
  1050.       6.3 Packet Driver and IEEE 802.3 (ISO 8802/3) applications
  1051.       ----------------------------------------------------------
  1052.  
  1053.       The following illustrates how to run an IEEE 802.3 application
  1054.       using a Class 1 access alongside one or more Packet Driver
  1055.       applications.  One obviously must be a TSR in order to allow a
  1056.       return to DOS in order to run the other.  If the Packet Driver
  1057.       application was a TSR (eg PC-NFS) then the sequence could be:
  1058.  
  1059.         ne2000 0x63 0x5 0x320    ; Load Packet Driver
  1060.         pktmux /ib               ; Support 2 channels
  1061.         pktdrv                   ; PKTDRV for application to use
  1062.         pktdrv /i                ; PKTDRV for IEEE 802.3 use
  1063.  
  1064.       You then load the Packet Driver application TSR then on returning
  1065.       to DOS run the IEEE 802.3 application. Note that PKTMUX and the
  1066.       PKTDRV used by the IEEE 802.3 application must have a /i option. In
  1067.       fact all PKTDRVs could have the /i option so that the IEEE 802.3
  1068.       application could use any one. However the exception to this is an
  1069.       application, such as PC-NFS v3.0, which asks for all packet types.
  1070.       Its PKTDRV must not have a /i option.
  1071.  
  1072.       The /b option on PKTMUX is very strongly recommended for IEEE 802.3
  1073.       work since, if it works, it should dramatically reduce the
  1074.       overheads.
  1075.  
  1076.  
  1077.  
  1078.       6.4 Packet Driver and Rainbow Applications
  1079.       ------------------------------------------
  1080.  
  1081.       UK academic users of the Rainbow product can run Packet Driver
  1082.       applications alongside by use of a similar sequence to the previous
  1083.       section. The Rainbow software (eg PINKBOOK) must be run over the
  1084.       IEEE 802.3 PKTDRV via the LLCPKT interface provided by RAL. Thus to
  1085.       run it alongside PC-NFS could be done as follows:
  1086.  
  1087.         pcnfs.sys /b1            ; loaded in CONFIG.SYS
  1088.  
  1089.         mbdndpd 0x63 /I10 /D3    ; Load Packet Driver for BICC 16 bit
  1090.                                  ; card
  1091.         pktmux /ib               ; Support 2 channels
  1092.         pktdrv                   ; PKTDRV for PC-NFS to use
  1093.         pktdrv /i                ; PKTDRV for PINKBOOK to use
  1094.         cd \nfs
  1095.         prt *                    ; Normal PC-NFS loading
  1096.         net init
  1097.  
  1098.         llcpkt                   ; LLCPKT Packet Driver to BICC MPS
  1099.                                  ; interface
  1100.         pinkbook                 ; PINKBOOK TSR
  1101.         rainbow                  ; Rainbow application
  1102.  
  1103.  
  1104.       6.5 Packet Driver Applications under Windows 3
  1105.       ----------------------------------------------
  1106.  
  1107.       The following illustrates how to run Packet Driver applications
  1108.       under Windows 3 in Enhanced mode. Use under DESQview is very
  1109.       similar.
  1110.  
  1111.         ne2000 0x63 0x5 0x320    ; Load Packet Driver
  1112.         pktmux 8 /4              ; Support 8 channels but only 4 will
  1113.                                  ; will be active at once
  1114.         win                      ; Run Windows 3
  1115.  
  1116.       To run an application open a DOS session and type:
  1117.  
  1118.         pktdrv                   ; PKTDRV for application to use
  1119.  
  1120.       followed by the application. The application could be the MOS2
  1121.       emulator BAT file for example:
  1122.  
  1123.         mos2t
  1124.  
  1125.       To run further applications just open more DOS sessions and run
  1126.       PKTDRV then the application. For IEEE 802.3 applications the PKTMUX
  1127.       call must have the option /i added (and /b is also recommended) and
  1128.       the PKTDRV run under the DOS session should have a /i. Thus to run
  1129.       the Rainbow application in their Windows DOS session would type:
  1130.  
  1131.  
  1132.         pktdrv /i
  1133.         llcpkt                   ; LLCPKT Packet Driver to BICC MPS
  1134.                                  ; interface
  1135.         pinkbook                 ; PINKBOOK TSR
  1136.         rainbow                  ; Rainbow application
  1137.  
  1138.       Where a PIF file is used then the associated BAT file could
  1139.       contains commands similar to above. A little care is needed with
  1140.       error conditions since if there is no free channel then the PKTDRV
  1141.       load will fail. For example:
  1142.  
  1143.         pktdrv /p
  1144.         IF ERRORLEVEL 1 GOTO EXIT          ; Jump if failed
  1145.         .
  1146.         run application
  1147.         .
  1148.         :EXIT
  1149.  
  1150.       If the loading of PKTDRV fails for any reason the /p option holds
  1151.       up processing allowing the user to see the error message generated.
  1152.       The complete BAT file for the MOS2 emulator would therefore be:
  1153.  
  1154.         pktdrv /p
  1155.         IF ERRORLEVEL 1 GOTO FAIL          ; Jump if failed
  1156.         call mos2t
  1157.         command
  1158.         :EXIT
  1159.  
  1160.       Be warned that Windows, especially 3.0, can become unstable if you
  1161.       have insufficient memory and opening too many DOS sessions may
  1162.       result in a Unrecoverable Application Error.  This usually does no
  1163.       damage and other sessions are unaffected.  Note also that, unless
  1164.       the PC is quite powerful, applications may fail as they will not
  1165.       get enough CPU to process their communications in time and
  1166.       protocols may time out. This is especially so if IEEE 802.3
  1167.       protocols are used.
  1168.  
  1169.  
  1170.  
  1171.       6.6 Packet Driver, PCTCP and PC-NFS Applications under Windows 3
  1172.       ----------------------------------------------------------------
  1173.  
  1174.       This is essentially the same as under DOS but with the PKTDRV for
  1175.       the Packet Driver application run under a DOS session. For example
  1176.       to run both PCTCP and Packet Driver applications the following
  1177.       would suffice.
  1178.  
  1179.         ne2000 0x63 0x5 0x320    ; Load Packet Driver
  1180.         pktmux 8 /4              ; Support 8 channels but only 4 will
  1181.                                  ; will be active at once
  1182.         pktdrv                   ; PKTDRV for PCTCP to use
  1183.         ethdrv                   ; PCTCP Packet Driver interface
  1184.         win                      ; Run Windows 3
  1185.  
  1186.       To run a Packet Driver application open a DOS session and type:
  1187.  
  1188.         pktdrv                   ; PKTDRV for application to use
  1189.  
  1190.       followed by the application. For PCTCP applications just run the
  1191.       application.
  1192.  
  1193.  
  1194.       6.7  Windows 3 Applications
  1195.       ---------------------------
  1196.  
  1197.       Windows 3 applications are slightly different in that they do not
  1198.       run in a DOS session so it is not possible to run PKTDRV after
  1199.       Windows has been loaded.  For those that run over PCTCP or PC-NFS
  1200.       then the appropriate TSR is loaded under DOS after PKTMUX and one
  1201.       PKTDRV as illustrated above.  The application is then run under
  1202.       Windows as normal.
  1203.  
  1204.       For those that run over a Packet Driver, for example WINQVT, then
  1205.       the procedure is very similar to running them under DOS, that is
  1206.       the PKTDRV is loaded before Windows 3. For example to run WINQVT
  1207.       and also other applications that use a Packet Driver the following
  1208.       would suffice:
  1209.  
  1210.         ne2000 0x63 0x5 0x320    ; Load Packet Driver
  1211.         pktmux 8 /4              ; Support 8 channels but only 4 will
  1212.                                  ; will be active at once
  1213.         pktdrv                   ; PKTDRV for WINQVT to use
  1214.         pktint                   ; WINQVT Packet Driver interface
  1215.         win                      ; Run Windows 3
  1216.  
  1217.       Then run WINQVT as normal with QVT_TCP.RC edited to contain the
  1218.       line:
  1219.  
  1220.       packet_vector=65
  1221.  
  1222.       This is done because WINQVT has to have its Packet Driver interrupt
  1223.       specified and PKTDRV will use 65 by default in the above example.
  1224.       If there is any doubt then PKTDRV could have its interrupt number
  1225.       specified as the first parameter for example:
  1226.  
  1227.         pktdrv 65
  1228.  
  1229.  
  1230.  
  1231.       If WINQVT is not going to be loaded immediately then there is a
  1232.       problem that another application may use the PKTDRV intended for
  1233.       WINQVT since it would the the first one found when searching down
  1234.       the Interrupts.  To combat this it is recommended that
  1235.       WINQVT is given a high interrupt number (eg 7F) to guarantee it
  1236.       will be free. For example:
  1237.  
  1238.         ne2000 0x63 0x5 0x320    ; Load Packet Driver
  1239.         pktmux 8 /4              ; Support 8 channels but only 4 will
  1240.                                  ; will be active at once
  1241.         pktdrv 7f                ; PKTDRV for WINQVT to use
  1242.         pktint                   ; WINQVT Packet Driver interface
  1243.         win                      ; Run Windows 3
  1244.  
  1245.       Then run WINQVT as normal with QVT_TCP.RC edited to contain the
  1246.       line:
  1247.  
  1248.       packet_vector=7f
  1249.  
  1250.       To run further Packet Driver applications open a DOS session and
  1251.       run PKTDRV and the application as before.  To run PCTCP or PC-NFS
  1252.       applications then modify the above to include the TSR before
  1253.       loading Windows.  Alternatively for PCTCP the TSR can be run under
  1254.       Windows 3 inside a DOS session since it is effectively a Packet
  1255.       Driver application.  IPCUST.SYS and IFCUST.SYS must have previously
  1256.       been loaded in CONFIG.SYS or could be loaded by the RAL LOADSYS
  1257.       system.
  1258.  
  1259.  
  1260.  
  1261.       6.8  Novell Netware
  1262.       -------------------
  1263.  
  1264.       Novell using a Type 8137 packet can be run in a variety of ways.
  1265.       Note that because PKTMUX hides the real Packet Driver by taking
  1266.       over its interrupt then the Novell Packet Driver interface IPX must
  1267.       use a PKTDRV.  For example:
  1268.  
  1269.         ne2000 0x63 0x5 0x320    ; Load Packet Driver
  1270.         pktmux 2                 ; Support 2 channels
  1271.         pktdrv                   ; PKTDRV for Novell to use
  1272.         pktdrv                   ; PKTDRV for application to use
  1273.         ipx                      ; Load Novell 8137 Packet Driver
  1274.                                  ; interface
  1275.         etc
  1276.  
  1277.       An improvement on this is to note that PKTDRV, like a normal Packet
  1278.       Driver, can support several protocol types so it is possible for
  1279.       one PKTDRV to support both Novell and an application. However the
  1280.       difference is that PKTDRV sets itself busy when it is Accessed so
  1281.       it must be made Free again before it can be Accessed again. For
  1282.       example:
  1283.  
  1284.         ne2000 0x63 0x5 0x320    ; Load Packet Driver
  1285.         pktmux 2                 ; Support 2 channels
  1286.         pktdrv                   ; PKTDRV for Novell and one
  1287.                                  ; application to use
  1288.         ipx                      ; Load Novell 8137 Packet Driver
  1289.                                  ; interface
  1290.         pktdrv /f                ; make PKTDRV free again
  1291.         pktdrv                   ; PKTDRV for second application to use
  1292.         etc
  1293.  
  1294.       Note that in this case the second application must not be one that
  1295.       uses all packet types (eg PC-NFS v3.0) or IEEE802.3.  Further note
  1296.       that if the application does any form of filestore redirection such
  1297.       as PC-NFS or IDRIVE from PC/TCP then this must be loaded before IPX
  1298.       is run.  This is because although at Packet Driver level there are
  1299.       no problems it appears that only the Netware filestore redirector
  1300.       can cope with another redirector following it in the chain. It must
  1301.       therefore be loaded last.
  1302.  
  1303.       If the Novell service is using the Standard Netware protocol, that
  1304.       is using in a standard IEEE802.3 packet, then the Packet Driver
  1305.       will map this to Type 8137 if the -n option is given. Thus the
  1306.       first line in examples above would become:
  1307.  
  1308.         ne2000 -n 0x63 0x5 0x320 ; Load Packet Driver
  1309.  
  1310.  
  1311.  
  1312.  
  1313.       6.9 Packet Driver/PKTMUX/PKTDRV BAT files
  1314.       -----------------------------------------
  1315.  
  1316.       It is frequently the case that a general purpose BAT file has to be
  1317.       written to load communications software.  PKTMUX provides various
  1318.       tools to assist in this as are illustrated in the following
  1319.       examples.  Note that the /s option can be added to all the calls to
  1320.       avoid confusing the user with the messages that are generated. It
  1321.       is also recommended that the /p option is added to all calls to
  1322.       load PKTMUX and PKTDRV so that the BAT file pauses if an error is
  1323.       found thus allowing the user to read the message.
  1324.  
  1325.       The following example checks if a Packet Driver or PKTMUX has
  1326.       already been loaded before loading both along with a PKTDRV ready
  1327.       to run a communications application.
  1328.  
  1329.         pktstats /qp                       ; Query state
  1330.         IF ERRORLEVEL 4 GOTO GOT_FREE      ; Jump if got a Free PKTDRV
  1331.         IF ERRORLEVEL 2 GOTO GOT_PKTMUX    ; Jump if got a PKTMUX
  1332.         IF ERRORLEVEL 1 GOTO GOT_PACKET    ; Jump if got a Packet Driver
  1333.         ne2000 0x63 0x5 0x320              ; Load Packet Driver
  1334.  
  1335.         :GOT_PACKET
  1336.         pktmux                             ; Load PKTMUX
  1337.         IF ERRORLEVEL 1 GOTO FAIL          ; Jump if failed
  1338.  
  1339.         :GOT_PKTMUX
  1340.         pktdrv                             ; PKTDRV busy so load new one
  1341.         IF ERRORLEVEL 1 GOTO FAIL          ; Jump if failed
  1342.  
  1343.         :GOT_FREE                          ; All loaded and a Free PKTDRV
  1344.         etc                                ; available
  1345.  
  1346.  
  1347.       Alternatively the PKTDRV call could have the /n option which would
  1348.       remove the need for the second line jump to GOT_FREE and is a
  1349.       general purpose way of loading a PKTDRV only if one is not already
  1350.       Free.  Such use does require a different testing of the ERRORLEVEL
  1351.       since a value is returned if the PKTDRV is not loaded because a
  1352.       Free one already exists.  For example:
  1353.  
  1354.         pktdrv /n
  1355.         IF ERRORLEVEL 4 GOTO FAIL          ; Jump if failed
  1356.  
  1357.       Note that ERRORLEVEL values of 2 and 3 mean not loaded due to a
  1358.       Free PKTDRV being present.
  1359.  
  1360.  
  1361.  
  1362.       If the application was one that terminated and then released the
  1363.       Packet Driver, for example LPR or TRUMPET, then the line:
  1364.  
  1365.         pktdrv /u
  1366.  
  1367.       could be added after the application had been run to unload the
  1368.       PKTDRV, if this is possible.  This would reduce the memory
  1369.       occupancy and increase the possibility of being able to unload any
  1370.       other TSRs.
  1371.  
  1372.       Note that in all the above cases the /v option could have been
  1373.       added thus causing the interrupt used to be recorded in the DOS
  1374.       Environment variable PKT_INT. Thus in the above case the call:
  1375.  
  1376.         pktdrv /nv
  1377.  
  1378.       would set PKT_INT to either the Free interrupt it found or the
  1379.       Interrupt used by the new PKTDRV. Hence an application requiring to
  1380.       know the Interrupt value in its call could be passed this detail.
  1381.  
  1382.       However if such an application held the interrupt number in a file
  1383.       so that it could not be easily changed in a BAT file then checks
  1384.       for a PKTDRV on this fixed interrupt number, 7f in the
  1385.       example, could be done as follows:
  1386.  
  1387.         pktdrv /q 7f
  1388.         IF ERRORLEVEL 3 GOTO GOT_FREE      ; Jump if got a Free PKTDRV
  1389.         IF ERRORLEVEL 2 GOTO FAIL          ; Jump if got a Busy PKTDRV
  1390.         pktdrv 7f                          ; Load PKTDRV on 7f
  1391.         IF ERRORLEVEL 4 GOTO FAIL          ; Jump if failed
  1392.  
  1393.         :GOT_FREE
  1394.         run application
  1395.  
  1396.         pktdrv 7f /u                       ; Unload PKTDRV if possible
  1397.  
  1398.       If there was already a Busy PKTDRV on Interrupt 7F then it would
  1399.       not be possible to run the application.
  1400.  
  1401.       All the above cases would also work under a control program such as
  1402.       Windows or DESQview provided certain conditions are met concerning
  1403.       any PKTDRV programs loaded under DOS, that is before the control
  1404.       program was loaded.  They must all be busy when the control program
  1405.       was loaded, for example being used by PCTCP or PC-NFS.  If they are
  1406.       still free then they must either be made busy as soon as the
  1407.       control program is loaded by the application, such as WINQVT, being
  1408.       loaded at startup, or they must use a high interrupt such as 7F.
  1409.       The reason behind all this is to avoid an application in a DOS
  1410.       session searching from Interrupt 60 and finding a free PKTDRV
  1411.       running under DOS rather than in the DOS session itself.  Whilst an
  1412.       application will work in this case the response will be a lot
  1413.       slower and the likelyhood of failure much higher.  If it can be
  1414.       guaranteed that any Free PKTDRV loaded under DOS has an Interrupt
  1415.       at the end of the range, eg 7F, then the examples above will work.
  1416.  
  1417.  
  1418.  
  1419.  
  1420.       If not then any Free PKTDRV under DOS must be made Busy to avoid
  1421.       any problems.  The following suggests how and uses the /e option to
  1422.       widen the search outside the DOS session and the /v option to note
  1423.       the PKTDRV interrupt number:
  1424.  
  1425.         pktdrv /nv                         ; Load PKTDRV unless one Free
  1426.                                            ; in this DOS session
  1427.         IF ERRORLEVEL 4 GOTO FAIL          ; Jump if failed
  1428.  
  1429.         :TEST_AGAIN                        ; Have a Free PKTDRV in the
  1430.                                            ; DOS session
  1431.         pktdrv /qve                        ; Check entire machine
  1432.         IF ERRORLEVEL 3 GOTO GOT_DOS       ; Jump if Free PKTDRV under DOS
  1433.         run application                    ; All ok so run application
  1434.         GOTO EXIT
  1435.  
  1436.         :FAIL                              ; Failure to load PKTDRV
  1437.         Echo Cannot load PKTDRV
  1438.         GOTO EXIT
  1439.  
  1440.         :GOT_DOS                           ; Free PKTDRV under DOS
  1441.         pktdrv /e!f!f %PKT_INT%            ; Busy it
  1442.         GOTO TEST_AGAIN                    ; Test again in case another
  1443.  
  1444.         :EXIT
  1445.  
  1446.       This BAT file forces to Busy any Free PKTDRV running under DOS with
  1447.       a lower Interrupt number than any in the DOS session so that an
  1448.       application does not use it.  Note that this BAT file will run
  1449.       equally happily under DOS provided a PKTDRV at a high interrupt
  1450.       number is not Free.
  1451.  
  1452.  
  1453.  
  1454.       7.  Technical Description
  1455.       =========================
  1456.  
  1457.       This section describes how PKTMUX goes about its task and is
  1458.       intended for those who wish to understand how the system works and
  1459.       why it has the limitations it has.  An understanding of the Packet
  1460.       Driver interface is assumed.  The various PKTMUX counts and states
  1461.       detailed below are shown the command:
  1462.  
  1463.         pktstats /a
  1464.  
  1465.       Additional states are given by the option /aa.
  1466.  
  1467.  
  1468.       7.1 Basic Methodology
  1469.       ---------------------
  1470.  
  1471.       In essence the system is very simple.  PKTMUX talks to the Packet
  1472.       Driver and receives data from it.  Each PKTDRV passes all commands
  1473.       onto PKTMUX with the addition of the channel number.  PKTDRV also
  1474.       sits on a timer interrupt and asks PKTMUX once per system tick if
  1475.       there are any packets for this channel and if so then gets them
  1476.       passed over.  A PKTDRV is only Busy from when it has been
  1477.       asked by an application to Access a packet Type to when that is
  1478.       Released.  In between it remains Free.
  1479.  
  1480.  
  1481.       Whilst PKTMUX makes every attempt to be efficient it does create a
  1482.       significant overhead when multiplexing between several
  1483.       applications.  This is because the Packet Driver interface only
  1484.       tells you it has a packet and does not give a pointer so that you
  1485.       can see if you are interested in its contents.  Where only one
  1486.       application is using this packet type then the packet is sent
  1487.       direct to the application.  Otherwise it is necessary for PKTMUX to
  1488.       read the packet into its own storage, analyse its contents and then
  1489.       send it when asked by a PKTDRV to the appropriate application(s).
  1490.       Thus every packet received in this manner has to be copied once
  1491.       more than necessary unless devious cunning is employed via the
  1492.       /b option.
  1493.  
  1494.  
  1495.       7.2 Buffer Strategy
  1496.       -------------------
  1497.  
  1498.       When an application is unable to accept a packet, usually because
  1499.       it has no free buffer space, then PKTMUX keeps the packet in its
  1500.       buffers and every timer tick keeps asking the application to accept
  1501.       it.  It does this even when it normally sends data direct to the
  1502.       application, thus those applications which operate on a small
  1503.       buffer pool may lose less data when under PKTMUX especially when
  1504.       they receive less CPU cycles when running under Windows 3.  The
  1505.       decision whether to keep a packet when an application is unable to
  1506.       accept it is a difficult one and depends on the available buffer
  1507.       pool and activity on other channels.  The ultimate criterion is the
  1508.       age of the buffer and after between 2 and 3 seconds it is dropped.
  1509.       Whilst this mechanism is satisfactory for most applications there
  1510.       are some that give problems.  One that has been noted is TRUMPET
  1511.  
  1512.  
  1513.  
  1514.       which, when an interaction has been completed and it is waiting for
  1515.       user input, refuses to accept any more packets.  Whilst
  1516.       PKTMUX's buffer strategy will cope in normal circumstances, under
  1517.       heavy loading this could give problems.  The /d option is therefore
  1518.       available on PKTDRV which causes a packet to be always dropped when
  1519.       an application is unable to accept it.  Thus it behaves exactly as
  1520.       a Packet Driver.  The /d option is also available on PKTMUX to
  1521.       provide this feature on all channels and could be used in cases of
  1522.       extreme loading.
  1523.  
  1524.  
  1525.       7.3 Channel Management
  1526.       ----------------------
  1527.  
  1528.       Normally a channel is freed when the application Releases all the
  1529.       packet TYPEs is has Accessed.  If this does not occur, usually
  1530.       because the application has crashed, then there are two possible
  1531.       cases.
  1532.  
  1533.       The first, and most normal, is where the PKTDRV being used by the
  1534.       application is still running and a call the PKTSTATS shows it to be
  1535.       Busy.  The command:
  1536.  
  1537.         pktdrv /r
  1538.  
  1539.       will reset the PKTDRV and free the channel.
  1540.  
  1541.       The second case is when the PKTDRV is not running.  PKTMUX detects
  1542.       this by the absense of any timer interrupts and frees the channel
  1543.       after about two seconds.  However this technique fails under a
  1544.       control program such as Windows 3 or DESQview since the DOS session
  1545.       can be locked thus preventing the PKTDRV from sending its timer
  1546.       interrupts.  An example is when an area is Selected under
  1547.       Windows 3.0 for such actions as cut and paste.
  1548.  
  1549.       To overcome this PKTMUX does not immediately free such channels
  1550.       when running under a control program but this gives the new problem
  1551.       that it now has no means of knowing the channel can be freed.  Such
  1552.       channels are marked as having Timed Out and this is displayed by
  1553.       PKTSTATS.  To reset such a channel use the following command:
  1554.  
  1555.         pktmux /r
  1556.  
  1557.       in a DOS session and this will make all such channels free again.
  1558.  
  1559.       An automatic means of recovery from this situation is provided by
  1560.       the third PKTMUX parameter, Chan_time_out.  This is the time in
  1561.       seconds the call stays in a timed out state before being freed
  1562.       automatically.  However this should be set with care since if you
  1563.       spend too long on your cut and paste the channel may be freed and
  1564.       your application will fail.
  1565.  
  1566.  
  1567.       One side effect of an application crashing is that it may leave
  1568.       PKTMUX in one of its internal busy states. This is shown by the
  1569.       PKTSTATS /aa output in the line "Busy Flags". If this occurs then
  1570.       PKTMUX will effectively go to sleep. When this is the case then the
  1571.       call:
  1572.  
  1573.         pktmux /rr
  1574.  
  1575.       will also reset these flags and PKTMUX may resume working. It may
  1576.       also crash!
  1577.  
  1578.       The maximum number of Busy channels supported by PKTMUX is 8 but
  1579.       realistically a rather lower number is recommended.  This value is
  1580.       permitted in order to mitigate the problems detailed above by
  1581.       preventing timed out channels from blocking other applications.  If
  1582.       say only 4 channels are actually going to be required but 8 are
  1583.       specified then to save memory the number of buffers should be
  1584.       reduced by a call such as:
  1585.  
  1586.         pktmux 8 /4
  1587.  
  1588.  
  1589.       7.4 Control Programs
  1590.       --------------------
  1591.  
  1592.       One of the problems with the Packet Driver interface is that when
  1593.       it receives a packet it then calls a routine in the application.
  1594.       This will not fail under DOS but if the application is running
  1595.       under a control program such as Windows 3 or DESQview, where the
  1596.       application can be swopped in and out of the current virtual
  1597.       memory, then there is a need to establish that the current
  1598.       application is the correct one.  PKTMUX does this by noting the
  1599.       code it is to jump to when a packet is received and checking if
  1600.       that is present.  This works satisfactorily unless two copies of
  1601.       the same application are running and in this case the application
  1602.       has to be tagged in a unique way.
  1603.  
  1604.       Note that there are two ways of using PKTDRV under a control
  1605.       program.  The preferred way is to load it in a DOS session after
  1606.       the control program has been started and then run the application.
  1607.       In this way when PKTDRV asks PKTMUX if it has received a buffer it
  1608.       can be sure the application is in memory and so minimises any
  1609.       delay.  Alternatively when an application runs directly under the
  1610.       control program it is therefore not possible to load PKTDRV in the
  1611.       same virtual memory so it has to be loaded under DOS before the
  1612.       control program.  It therefore has no certainty that the
  1613.       application is running when it asks PKTMUX if any data has been
  1614.       received so sometimes has to wait until its timer interrupt
  1615.       coincides with the time slice of the application.  This can slow
  1616.       things down considerably and may require PKTMUX to have a larger
  1617.       buffer pool in order to cope.
  1618.  
  1619.  
  1620.  
  1621.       7.5 Listeners and /l Options
  1622.       ----------------------------
  1623.  
  1624.       One of the problems PKTMUX has to solve is to which application to
  1625.       route packets for which it has no previous knowledge.  Examples are
  1626.       ARP requests and calls to previously unused TCP or UDP ports.
  1627.       Experience has shown it is best to send ARP requests to all
  1628.       applications.  For TCP and UDP ports the requests can be either for
  1629.       well know services (such as TELNET or FTP) in which case the
  1630.       default is to send it to the first application to sign up for that
  1631.       packet type in the hope that it has a listener for this service.
  1632.       This avoids more than one response to such a request.
  1633.  
  1634.       Alternatively it may be to a port previously notified by the
  1635.       application (an example is FTP) and in this case it is sent to all
  1636.       applications who use that packet type.  This latter technique works
  1637.       provided the application is tolerant of such unsolicited messages.
  1638.       Tests so far indicate that PC-NFS and CUTCP dont mind.  However
  1639.       PCTCP, Waterloo TCP and WINQVT are more strict and send back an
  1640.       error message.  For TCP this is a RST (reset) and for UDP it is an
  1641.       ICMP Port Undefined message.  Since this upsets the service being
  1642.       used such cases are trapped and the error message filtered out.
  1643.       Note that the WINQVT log may report "Packet received for invalid
  1644.       port - reset sent".  In the PKTSTATS output such packets are
  1645.       counted under "Ignored:  err Resp" and under "Ign" in the "PKTDRV
  1646.       channels:" tables.  There is currently no way of preventing such
  1647.       unsolicited messages being sent to an application and the /l
  1648.       options only apply to packets for well known ports.
  1649.  
  1650.       The definition of a well known port is a little vague these days.
  1651.       Originally it was 0-255 but the Unix fraternity officially extended
  1652.       this to 1024 for Unix Standard Services and the current RFC 1106
  1653.       list goes way beyond this value.  As some applications assume this
  1654.       rule in their port usage so PKTMUX designates ports 0-255 as well
  1655.       known and routes them to only one channel.  Any other services
  1656.       outside this range are likely to be provided by a specialist server
  1657.       so sending to all should locate it.  This may be revised in the
  1658.       light of experience.
  1659.  
  1660.       The various /l options on PKTDRV override the default setting for
  1661.       well know services and indicate where such a request should be
  1662.       sent or not.  Options of the form /l indicate this application has
  1663.       servers of this type and /!l indicates it does not.  The absence
  1664.       of an /l or /!l option means the application provides all servers
  1665.       but it is used only when no other application has an /l option.
  1666.  
  1667.       The /l option types are implemented as an hierarchy with the
  1668.       specific protocol ports for TCP and UDP taking precedence over the
  1669.       protocols themselves which in turn take precedence over the
  1670.       protocol family (IP).  Last in precedence is a general listener.
  1671.       The applications are also searched in reverse order of loading so
  1672.       that a later application can take precedence over an earlier one.
  1673.  
  1674.  
  1675.       The simplest method of making sure the main services such as FTP
  1676.       are found is to load that application first.  Where this is not
  1677.       possible then the PKTDRVs for applications that do not support
  1678.       servers over a protocol should be marked as such by an /!l (ie not
  1679.       a listener) type option so that it is avoided when looking for the
  1680.       default.  And any application that wants to take over from the
  1681.       default can be marked by an /l (ie I am a listener) type option.
  1682.       Note that requests will be discarded if no listener is found.
  1683.  
  1684.       PKTSTATS will display the listener settings for each channel.
  1685.  
  1686.  
  1687.       7.6 Port Duplication
  1688.       --------------------
  1689.  
  1690.       When an application makes a call to a service it specifies the port
  1691.       to which replies should be sent.  How this port number is generated
  1692.       is dependent on the application.  There is therefore a possibility
  1693.       that two applications could generate the same reply port number.
  1694.       To combat this PKTMUX inspects all reply port numbers in outgoing
  1695.       packets for TCP and UDP and replaces any new and duplicated number
  1696.       by the next one higher, if that is not in use.  It also resets the
  1697.       packet header sumcheck if this is being used.  Port numbers on
  1698.       incoming packets are similarily mapped along with ICMP packets
  1699.       containing TCP and UDP.  Thus it is possible to run two copies of
  1700.       the same application without any problems of port duplication.
  1701.  
  1702.       However there are two areas that cannot be fixed.  One is where the
  1703.       application specifies the reply port via the protocol.  For example
  1704.       FTP usually specifies the port to be used for the file transfer via
  1705.       the PORT command in its controlling data stream.  Since PKTMUX does
  1706.       not analyse the data going through it this is not noted.  There is
  1707.       therefore the possibility that such a port number may be duplicated
  1708.       if two copies of the same application are run.  Fortunately tests
  1709.       with the FTP implementations from PCTCP and CUTCP have not shown
  1710.       this to be a problem.
  1711.  
  1712.       The second is where the reply port is a well known port and an
  1713.       example of this is BOOTP. In this case it assumed that any
  1714.       duplicate use of this port is by an application taking over the
  1715.       function this well known port supports. Thus a BOOTP exchange on
  1716.       one channel will be assumed complete when a second channel uses
  1717.       BOOTP. If this is not the case, as it would be if two applications
  1718.       started up at the same time, then hopefully the BOOTP retry
  1719.       mechanisms will recover the situation.
  1720.  
  1721.  
  1722.  
  1723.       7.7 IP Fragmentation
  1724.       --------------------
  1725.  
  1726.       IP Fragmentation is a means whereby a large packet is carried
  1727.       through a network whose packet size limit is too small. It is done
  1728.       by simply putting the extra data into the data part of one or more
  1729.       IP packets ie. where you would normally expect the TCP or UDP
  1730.       header to be. The constituent packets of the fragment are linked by
  1731.       having the same IP Identification.
  1732.  
  1733.       PKTMUX notes the channel that the first fragment is sent to and
  1734.       then routes all further fragments with the same Identifier to that
  1735.       channel. This works satisfactorily for most cases but has some
  1736.       potential problems.
  1737.  
  1738.       The first is when the fragments arrive out of order.  As PKTMUX
  1739.       needs the first packet in order to get the TCP or UDP header out
  1740.       then any fragment that arrives before this packet will be
  1741.       discarded. Such cases are recorded in the NO FRAGMENT count of
  1742.       PKTSTATS output. The protocol retry mechanisms should retransmit
  1743.       the packet and hopefully the first packet of the fragment will
  1744.       arrive first and everything will be ok.
  1745.  
  1746.       The second is a more difficult problem in that if the same IP
  1747.       Identification is used by two fragmentation sources then PKTMUX has
  1748.       no way of distinquishing between the two.  Hopefully this will be
  1749.       very rare and the receiving application(s) should spot that they
  1750.       have the wrong fragments and their retry mechanisms should recover
  1751.       the situation.
  1752.  
  1753.       Note that when fragmentation is occurring then the number of
  1754.       received and copied fragments (excluding the first) is displayed by
  1755.       PKTSTATS.
  1756.  
  1757.  
  1758.       7.8 Other IP Protocols
  1759.       ----------------------
  1760.  
  1761.       PKTMUX is only able to multiplex on IP protocols it knows about.
  1762.       These currently are TCP, UDP and ICMP. Any other IP protocol type
  1763.       will be handled correctly provided there is only one channel using
  1764.       it. Multiple usage of another IP protocol will therefore fail.
  1765.       Provided any such protocol has a port mechanism of some form it
  1766.       would be possible add to support to PKTMUX if required.
  1767.  
  1768.  
  1769.  
  1770.       7.9 IEEE802.3 (ISO 8802/3) Protocol Support
  1771.       -------------------------------------------
  1772.  
  1773.       Since this protocol changes the meaning of the Type field to be the
  1774.       length, PKTMUX has to ask the Packet Driver to send it all packets
  1775.       and not just those of a certain TYPE.  This dramatically increases
  1776.       the number of packets copied into PKTMUX and hence the overhead on
  1777.       the PC.  It also increases the response time, especially under
  1778.       control programs such as Windows 3, so can give protocol problems
  1779.       as well. Use of the /b option (see next section) can improve this.
  1780.  
  1781.       This option is for those IEEE802.3 implementations that Access the
  1782.       Packet Driver as a Class 1.  The correct way to support IEEE802.3
  1783.       is via Class 11 but this is only available on recent Packet
  1784.       Drivers and gives problems as detailed in section 7.12 below.
  1785.  
  1786.       Users of the RAL LLCPKT2 product which allows the Rainbow software
  1787.       to run alongside a Packet Driver interface should note that PKTMUX
  1788.       now supports the simpler LLCPKT product which, if used with the /b
  1789.       option, can give a more efficient system.
  1790.  
  1791.  
  1792.       7.10 Use of Packet Driver Internal Buffer
  1793.       -----------------------------------------
  1794.  
  1795.       One of the limitations of the Packet Driver interface is that when
  1796.       it receives a packet it then calls a routine in the application
  1797.       asking for a buffer of a certain size.  Thus PKTMUX only knows how
  1798.       big the data is but has no idea of the contents other than that
  1799.       provided via the handle used in the call.  The generic Packet
  1800.       Driver code is actually provided with a pointer to the Type field
  1801.       which is also used to access the next byte but unfortunately the
  1802.       registers pointing to this are overwritten before PKTMUX is called.
  1803.  
  1804.       It is therefore reasonable to assume that somewhere within the
  1805.       Packet Driver program are held the first few bytes of the incoming
  1806.       packet and that they are valid at the point when PKTMUX is asked to
  1807.       provide a buffer in order to read this packet.  The /b option
  1808.       instructs PKTMUX to search the Packet Driver for this buffer, to
  1809.       copy it and then to test it against the data it actually obtains
  1810.       from the Packet Driver.  Should a consistent match be found then
  1811.       the Packet Driver buffer is used to filter out those packets that
  1812.       are of no interest and to send those packets for which there is in
  1813.       only one channel direct to the application.  This should therefore
  1814.       reduce the copying of data and in the case of IEEE802.3 support can
  1815.       dramatically reduce the overhead.  The gain in other cases is
  1816.       dependent on how much of the packet is found and hence how much of
  1817.       the protocol headers is available for analysis.
  1818.  
  1819.  
  1820.       How you locate the buffer is an interesting problem.  So far two
  1821.       types of Packet Driver implementations have been found.  One,
  1822.       exampled by NE2000, uses a fixed buffer every time so this is
  1823.       fairly easy to locate.  A second type uses a buffer pool and this
  1824.       is rather more difficult to track.  The BICC 16 bit card uses this
  1825.       technique and experimentation has shown that a segment register
  1826.       always points to the correct area of memory.  An algorithm that
  1827.       copes with both these cases has been implemented.  Testing with
  1828.       other cards will no doubt require it to be modified.  PKTSTATS
  1829.       gives an indication of where the algorithm is and the eventual
  1830.       outcome of the testing.
  1831.  
  1832.       Please note that this is a test implementation to evaluate the
  1833.       technique.  Once again PKTMUX is breaking all the rules.  How
  1834.       effective this option is depends on the size of buffer available.
  1835.       When the available buffer is 64 bytes you get the full benefit and
  1836.       for all cases there should be a significant improvement in
  1837.       performance.  Where the buffer is smaller then below 48 bytes the
  1838.       benefits tail off considerably. However if you are using IEEE802.3
  1839.       then the /b option avoids the copying of all packets not for
  1840.       this address so gives a significant reduction in overheads.
  1841.  
  1842.  
  1843.       7.11 Novell Protocol Support
  1844.       ----------------------------
  1845.  
  1846.       PKTMUX has been tested satisfactorily with Novell Netware using
  1847.       their Type 8137 protocol.  It has not been tested with the 802.3
  1848.       varient but this protocol will probably work provided the -n option
  1849.       is given to the Packet Driver as shown in the examples section.
  1850.       Further details are given in the next section.
  1851.  
  1852.  
  1853.       7.12 Packet Driver Protocol Filtering
  1854.       -------------------------------------
  1855.  
  1856.       An area fraught with problems is the use of a Packet Driver in a
  1857.       mixed protocol environment.  An example would be TCP/IP and Novell
  1858.       Netware using its 802.3 protocol.  The following gives details of
  1859.       the filtering algorithm used by the Packet Driver and applies to
  1860.       Versions 9 and 10 of the collection.  It has been gleaned by
  1861.       examining the code (mostly HEAD.ASM) provided to standardise the
  1862.       implementation of the Packet Driver and will only apply to drivers
  1863.       that use this code. Drivers from earlier versions of the collection
  1864.       may work differently.
  1865.  
  1866.       On receipt of a packet the Packet Driver examines the Packet Type
  1867.       field, which is the length field in IEEE 802.3, and checks if it is
  1868.       greater than 1500 bytes.  If so it is marked as Class 1 (Bluebook
  1869.       Ethernet) otherwise as Class 11 (IEEE802.3).
  1870.  
  1871.  
  1872.       If the -n (Novell) option has been given then Class 11 packets are
  1873.       checked to see if the DSAP/NSAP (the two bytes after the Packet
  1874.       Type/Length) is 0xFFFF.  If so then this is assumed to be a Novell
  1875.       802.3 packet and the Class is changed to 1 and the Packet Type is
  1876.       changed to 8137.  Class 1 packets are also checked and if a Packet
  1877.       Type of 8137 is found this is changed to 8138.  Similarily any
  1878.       packet sent by the Packet Driver that has a Type of 8137 is
  1879.       modified if the the -n option is given by replacing the Packet Type
  1880.       by the length thus making it IEEE802.3 conformant.  Thus the -n
  1881.       option dictates the protocol being sent to and expected from the
  1882.       Novell server and in both cases the Novell application is using
  1883.       8137.
  1884.  
  1885.       The next test if to search the list of Packet Types that have been
  1886.       Accessed by the application.  When such an Access is made the
  1887.       application specifies the Class and which Packet Type it wishes to
  1888.       receive.  The Packet Type is either a specific one such as 0800 for
  1889.       IP, 0806 for ARP or 8137 for Novell or it can be for All Types
  1890.       implying that the application wishes to receive all packets of the
  1891.       given Class - whether it actually does so is dependent on whether
  1892.       it was the first Access or not as indicated in the rules below.
  1893.  
  1894.       1. When an Access is made its Class and Packet Type are added as
  1895.       the next entry in the list unless it is a request for All Types.
  1896.  
  1897.       2. If a request for All Types is the first Access for that Class
  1898.       it is added as the next entry in the list.
  1899.  
  1900.       3. If the request for All Types is the second or subsequent Access
  1901.       for a Class then it is put at the end of the list and all
  1902.       subsequent Access entries added before it.
  1903.  
  1904.       4.  When the Packet Type list is searched to match an incoming
  1905.       packet the Class and Packet Type are checked against each entry
  1906.       until either a match is found or an All Types entry for any Class
  1907.       is found. Thus an All Types entry blocks any further entries in the
  1908.       table irrespective of their Class.
  1909.  
  1910.       The rules have been slightly simplified in that they describe
  1911.       the Class 1 case where the Packet Type is fixed at two bytes.
  1912.       For Class 11 there is the likelyhood of longer Packet Types since
  1913.       this now selects on the DSAP/NSAP and following bytes so
  1914.       complications arise when different lengths are specified. Should
  1915.       the shorter be a subset of a longer Type then the former takes
  1916.       precedence and the latter Access is rejected.
  1917.  
  1918.       These rules have several interesting consequences for programs,
  1919.       such as PC-NFS v3.0 (actually is the PKTD.SYS v3.0.2 program) and
  1920.       LLCPKT, which ask for All Types, and these are best illustrated by
  1921.       examples.  Consider the case of PC-NFS 3.0 loaded first.  As it
  1922.       asks for All Types of Class 1 then no other application
  1923.       irrespective of its Class will work alongside it.
  1924.  
  1925.       The second case is where PC-NFS is not the first application to
  1926.       be loaded.  If any Access was for the IP or ARP Packet Types then
  1927.       PC-NFS would not work since it needs to receive these Types.
  1928.       However if the first Access was for the Novell Packet Type 8137
  1929.       then PC-NFS would run alongside it.
  1930.  
  1931.  
  1932.       Note that the version of PKTD.SYS for PC-NFS v3.5 and later stopped
  1933.       asking for All Types so the problem effectively goes away and it
  1934.       can be run alongside Novell. But note that PC-NFS must be loaded
  1935.       before Novell for other reasons.
  1936.  
  1937.       Tests have also been carried out on Version 5 Packet Drivers and
  1938.       suggest that they will accept just one All Types Access or several
  1939.       specific Accesses but will not accept any combination of the two.
  1940.       The official BICC card driver, MBDNDPD, is based on this version.
  1941.       This card's Version 10 driver, named ISOLINK, is probably a much
  1942.       better bet.
  1943.  
  1944.  
  1945.  
  1946.  
  1947.       8. Problem Solving
  1948.       ==================
  1949.  
  1950.       This section attempts to suggest how problems with PKTMUX should be
  1951.       tackled. It is worthwhile reading the meaning of the various
  1952.       options and also the Technical Description above in order to
  1953.       ascertain if your problem and its solution is documented therein.
  1954.       Also the section on Bugs/Features and Problem Programs should be
  1955.       consulted.
  1956.  
  1957.       One of the biggest difficulties with PKTMUX is sorting out why
  1958.       something is not working properly.  To assist in this the utility
  1959.       PKTSTATS is provided which, when used with the /a option, gives
  1960.       details of what PKTMUX is up to and its various counts.  Any count
  1961.       whose name is in CAPITAL letters indicates data being lost or
  1962.       discarded because there is a problem and the following attempts to
  1963.       explain what they mean.  Note that such counts are usually only
  1964.       displayed when they have a value so their absence indicates all
  1965.       should be well.
  1966.  
  1967.       The first class of problems is where PKTMUX simply does not work
  1968.       with an application.  The first test is to run the application on
  1969.       its own having loaded PKTMUX with the /x option.  Normally in this
  1970.       situation PKTMUX would pass data direct to the application but with
  1971.       the /x option (multiplex) it copies data to its buffers and uses
  1972.       its multiplexing facilities thus checking if they can cope with the
  1973.       application.  If this fails then the application probably has some
  1974.       quirk that confuses PKTMUX.  If it is a standard application that
  1975.       works elsewhere then you may have a networking set up that PKTMUX
  1976.       cannot cope with.
  1977.  
  1978.       A second test is to add the /c (copy) option to each PKTDRV -
  1979.       PKTSTATS will show /TX_Copy for that channel.  This causes it to
  1980.       copy the data sent to the network into its own buffers and this has
  1981.       been known to cure problems related to the use of upper and/or
  1982.       EMS/XMS memory.
  1983.  
  1984.       Where an application works with PKTMUX as above but not in
  1985.       conjunction with other applications then it is worth trying
  1986.       different combinations and seeing what does and does not work.
  1987.       This may isolate one application as being the problem or show a
  1988.       certain loading order to be the cause.  Possible reasons are that a
  1989.       listener for a well known port is being usurped by another
  1990.       application (see PKTDRV /l option) or that one application simply
  1991.       prevents any other from running.  Check the Bugs/Features and
  1992.       Problem Programs section for any indication of problems.  It is
  1993.       also worthwhile checking if anyone else has a similar problem.
  1994.  
  1995.       Another class of problems is where PKTDRV is marked Busy when it
  1996.       should be Free or there are no Free PKTMUX channels.  This is
  1997.       usually due to applications failing in some manner and the means of
  1998.       recovery are described in the Channel Management part of the
  1999.       Technical Description section.
  2000.  
  2001.  
  2002.       The final, and probably the largest, class of problems is where
  2003.       everything works for a while then things start going wrong. Using
  2004.       PKTSTATS can give an indication of the cause but in general it is
  2005.       only those cases where the problem can be reproduced that a
  2006.       solution can be found with any degree of certainty. Note that
  2007.       PKTMUX depends on probability for its successfull working and when
  2008.       the odds are wrong it will fail for no apparent reason. However for
  2009.       regular failures the suggestions below may help.
  2010.  
  2011.       If the /b option is in use on PKTMUX it should be removed to see if
  2012.       this is the cause.
  2013.  
  2014.       If you are running under a control program such as Windows 3 or
  2015.       DESQview then check that the application is getting a sufficient
  2016.       percentage of the processor especially if the application starts
  2017.       failing when running in the background.  For Windows 3 a Background
  2018.       Priority of anything less than 50 can lead to problems and check
  2019.       that Execution in the Background is enabled. Also check that
  2020.       applications running in a DOS box have their own PKTDRV and are not
  2021.       using one loaded before the control program. This is shown by
  2022.       PKTSTATS and the PKTDRV entry at the start should have a /Win or
  2023.       /DV against it. If it has /DOS_to_Window then you are using a
  2024.       PKTDRV loaded before the control program and this should only be
  2025.       the case for applications that run under the control program such
  2026.       as WINQVT under Windows 3.
  2027.  
  2028.       A general technique is to run PKTSTATS /a and note the various
  2029.       counts.  Then run the application(s) that cause the failure and
  2030.       subsequently run PKTSTATS /a again and note which counts have
  2031.       increased.  This could give a clue about whats going wrong as
  2032.       detailed below.
  2033.  
  2034.       A possible reason for an application not working properly is that
  2035.       it, or PKTMUX, has run out of buffers with which to receive data.
  2036.       This is especially prevalent under a control program such as
  2037.       Windows where applications do not get enough CPU time to process
  2038.       their data.  Details of buffer usage are given in the "Buffers:"
  2039.       table and for the case of PKTMUX running out of buffers the count
  2040.       "PKTMUX NO BUFFER" is given in the "Recv ignored reasons" line.
  2041.       Increasing the number of buffers used via the /1 to /9 options on
  2042.       PKTMUX should solve this one.
  2043.  
  2044.       Detecting that the application is running out of buffers is more
  2045.       difficult since PKTMUX may not be able to deliver the data for a
  2046.       variety of reasons.  This can be isolated by running the
  2047.       application on its own over PKTMUX (without the /x option).  As it
  2048.       has only one channel operative PKTMUX just passes all calls
  2049.       directly to the application.  Any refusal by an application to
  2050.       supply a buffer causes PKTMUX to copy the data into its own
  2051.       buffers.  This is shown in the Copied count on the "Recv total"
  2052.       line and and in the "Recv copy reasons" line.  The PKTDRV channel
  2053.       counts also show the copied count for each channel.  The only
  2054.       solution is to increase the applications buffers if this is
  2055.       possible.
  2056.  
  2057.  
  2058.       When PKTMUX has more than one channel Busy, and has to wait to pass
  2059.       received data to an application, this is also recorded in the
  2060.       PKTDRV table.  The wait reason is either no buffer available from
  2061.       application (Buff) or, under Windows 3 or DESQview only, the
  2062.       application was not in memory (App).  For the Buff case if the /d
  2063.       option is given then the data is discarded and the "Dropped" counts
  2064.       increamented.  The App case is especially prevalent for background
  2065.       processes paticularily when a foreground process requires a lot of
  2066.       CPU.  When it has to wait PKTMUX has to decide whether to try again
  2067.       later or discard the buffer.  The latter is only done when PKTMUX
  2068.       has several channels that are actually moving data at the same time
  2069.       and it has insufficient buffers to meet all their demands.  The
  2070.       "LOST" count in the "PKTDRV channels:" table would be incremented
  2071.       in this instance and again increasing the number of PKTMUX and/or
  2072.       application buffers is a possible solution.  The count in the
  2073.       "Queues" section "LOST DUE TO APPLICATION ....." sums this total
  2074.       for all channels.  It may be that, especially under Windows 3 or
  2075.       DESQview, the PC has simply not enough horsepower to cope with the
  2076.       communications load as well as any processing in progress at the
  2077.       same time.  Thus the application(s) are not processing the received
  2078.       data fast enough to cope with the incoming rate.  Alternatively it
  2079.       may be an application, such as TRUMPET, that refuses to accept
  2080.       packets when it knows it is not expecting data.  Note that the /d
  2081.       option can significantly increase this count since packets are
  2082.       throw away at the first refusal.
  2083.  
  2084.       Another reason that data may be discarded is when there is no
  2085.       listener for the service that is being requested.  The count "NO
  2086.       LISTENER" is incremented in the "Recv ignored reasons" list.  There
  2087.       are several possible reasons for this but in general it is because
  2088.       the /l and /!l options on PKTDRV calls dont leave a suitable
  2089.       listener.  Note that this count will not be incremented if there is
  2090.       a listener available but it does not support the service requested.
  2091.       In this case an application that supports the service must be run
  2092.       with a PKTDRV that routes requests for the service to it by using
  2093.       the /l or /!l options.
  2094.  
  2095.       A final reason for discarding data is when an IP Fragment arrives
  2096.       out of order.  If it arrives before the first fragment then PKTMUX
  2097.       has no way of knowing to which channel it belongs and so discards
  2098.       it and increments the count "NO FRAGMENT" in the "Recv ignored
  2099.       reasons" list. The subsequent retry should overcome this problem
  2100.       provided that this time the first fragment arrives first.
  2101.  
  2102.  
  2103.  
  2104.  
  2105.       9. Bugs/Features and Problem Programs
  2106.       =====================================
  2107.  
  2108.       The following list of situations that need special action.  It is
  2109.       based upon limited experience so only covers a few cases at
  2110.       present.
  2111.  
  2112.       The 16 bit BICC ethernet cards require the /c option on PKTDRV
  2113.       when running under a control program and dont work with WINPKT.
  2114.       The /c is not required when under DOS but is needed when a
  2115.       protocol stack such as PCTCP is run under DOS for a Windows 3
  2116.       application such as Vista eXceed X Windows.
  2117.  
  2118.       When the X Window server Vista eXceed is running over PCTCP it
  2119.       must have enough buffers allocated via the ETHDRV command otherwise
  2120.       the call will be reset at intervals and thus fail. An ETHDRV call
  2121.       similar to the following is recommended:
  2122.  
  2123.          ethdrv -t 10 -p 20
  2124.  
  2125.       Further details are given the Vista eXceed and PCTCP manuals.  It
  2126.       may also be necessary to increase the PKTMUX buffer allocation when
  2127.       using this or other X Windows servers.
  2128.  
  2129.       PKTMUX will not work with the packet driver version of Novell IPX
  2130.       if the PKTDRV is using Interrupt 64. This is because Interrupt 64
  2131.       is a Novell API and so from v1.1 onwards it is not allocated by
  2132.       default.
  2133.  
  2134.       IEEE802.3 support can give problems with other protocols due to the
  2135.       overheads it imposes. In particular Novell running over Type 8137
  2136.       protocol has been found to crash in this mode.
  2137.  
  2138.       PKTMUX tends to operate a lot with interrupts disabled. This may
  2139.       cause problems with time critical communications methods such as
  2140.       asynchronous links using SLIP and ethernet communications via the
  2141.       PCs parallel port.
  2142.  
  2143.       TRUMPET refuses to accept packets when it is waiting for user input
  2144.       and expects no more data.  This can cause PKTMUX to run out of
  2145.       buffers under heavy loading.  It is recommended that the /d option
  2146.       be added to the PKTDRV used by TRUMPET.
  2147.  
  2148.       When PC-NFS is in use alongside PCTCP then a TSR, such as the MOS2
  2149.       3270 emulator, is unable to run when the PCTCP FTP program is
  2150.       waiting for a command. The problem does not occur with the CUTCP
  2151.       FTP so it appears to be related to the wait loop used by the PCTCP
  2152.       FTP when waiting for a command.
  2153.  
  2154.  
  2155.  
  2156.       10. Differences in PKTMUX versions
  2157.       ==================================
  2158.  
  2159.  
  2160.       10.1 Version 1.0
  2161.       ----------------
  2162.  
  2163.       First release to prove that the techniques worked.  Note this
  2164.       version does not support IP Fragmentation.
  2165.  
  2166.  
  2167.       10.2 Version 1.0a
  2168.       -----------------
  2169.  
  2170.       PKTMUX now checks that it is loading on top of a real Packet Driver
  2171.       and aborts if it finds its actually a PKTDRV.
  2172.  
  2173.  
  2174.       10.3 Version 1.1
  2175.       ----------------
  2176.  
  2177.       The programs from this version must not be mixed with those from
  2178.       version 1.0 as they are incompatible.
  2179.  
  2180.       In searching for a Packet Driver PKTMUX now checks the interrupts
  2181.       to see if PKTMUX or PKTDRV is already loaded and aborts if one is.
  2182.       Similarily if the Packet Driver interrupt is specified this is
  2183.       checked to see if it is a real Packet Driver.  This is to prevent
  2184.       multiple loadings of the system.  The option /o (override) has
  2185.       been added to PKTMUX to override this restriction.
  2186.  
  2187.       PKTMUX now starts by default with 2 channels.
  2188.  
  2189.       PKTDRV options /f and /!f have been added to force a PKTDRV to the
  2190.       Free or Busy state.  The PKTSTATS output has been changed to
  2191.       reflect this.
  2192.  
  2193.       PKTDRV no longer uses Interrupt 64 by default as this clashes with
  2194.       a Novell API.
  2195.  
  2196.       IP Fragmentation was not supported in previous versions.  It is now
  2197.       supported within limitations (see Technical Description).
  2198.  
  2199.       The buffer management system has been improved especially with
  2200.       regard to discarding unwanted packets. The option /d (drop) has
  2201.       been added to tell PKTMUX to drop all packets for which the
  2202.       application has no buffer rather than keeping them until the
  2203.       application has space. The same option is available on PKTDRV which
  2204.       works on a per channel basis. The number base of buffers has been
  2205.       also been increased in some cases.
  2206.  
  2207.       A bug in the Packet Driver handle mapping when PC-NFS was in use
  2208.       has been fixed as has one in the area of duplicate handles.
  2209.  
  2210.       A bug in the mapping of ICMP packets onto channels has been fixed.
  2211.       The bug caused ICMP packets containing IP data to be sent all
  2212.       channels.
  2213.  
  2214.  
  2215.  
  2216.       PKTMUX v1.0 used a time out mechanism to determine whether a PKTDRV
  2217.       and its application had been forcably terminated under a Windows or
  2218.       DESQview environment.  Unfortunately this mechanism was also
  2219.       triggered when the window was Selected under Windows 3.0 for
  2220.       actions such as cut and paste and caused the channel to be closed
  2221.       down.  This has been changed in v1.1 so that in these circumstances
  2222.       a channel will not be closed down.  The option /r has been added to
  2223.       PKTMUX to reset such channels otherwise they are permanently busy
  2224.       and there is no PKTDRV to reset them.  A third parameter has also
  2225.       been added to PKTMUX to reset such channels after a given time.
  2226.  
  2227.       ARP Request Broadcasts are now sent to all channels.  The /la
  2228.       option is therefore no longer needed.  The handling of Broadcast
  2229.       packets has also been improved so that only those ARP requests that
  2230.       are not for this address are discarded.
  2231.  
  2232.       BOOTP did not work for second and subsequent channels because it
  2233.       replies on a well known port and this only went to the first
  2234.       listener. This has now been changed and the response is sent to
  2235.       originator of the BOOTP provided no other channel has done a BOOTP
  2236.       in between. If this occurs then the timeout and retry mechanisms
  2237.       should recover the situation.
  2238.  
  2239.       The problem solving section has been improved and the /x option
  2240.       (multiplex) added to PKTMUX to assist this process.
  2241.  
  2242.  
  2243.       10.4 Version 1.2
  2244.       ----------------
  2245.  
  2246.       The maximum number of channels has been increased to 8 in order to
  2247.       improve the flexibility under Windows 3. If a Channel is in a timed
  2248.       out state then further channels can still be opened without
  2249.       reaching the maximum.
  2250.  
  2251.       The /q, /v, /e and PKTDRV /n options have been added and should
  2252.       enable a BAT file to work out the current state and load programs
  2253.       as required and this is illustrated by examples. Details of the
  2254.       options follows.
  2255.  
  2256.       The option /n on PKTDRV only loads PKTDRV if it is needed, that is
  2257.       if there is not already a Free one available, and reports the
  2258.       result via the DOS ERRORLEVEL.
  2259.  
  2260.       The option /q has been introduced on PKTDRV, PKTMUX and PKTSTATS in
  2261.       order to query the current state and returns the reply in text and
  2262.       the DOS ERRORLEVEL.  PKTSTATS indicates the presence of a Packet
  2263.       Driver, PKTMUX and PKTDRV (Free or Busy).  PKTDRV and PKTMUX return
  2264.       the state of their own program.
  2265.  
  2266.       The /v option causes the DOS Environment variable PKT_INT to be set
  2267.       to the hexadecimal value of the interrupt used or found by PKTDRV,
  2268.       PKTMUX or PKTSTATS when executing a command.
  2269.  
  2270.  
  2271.  
  2272.       The /e option extends the search under a control program to outside
  2273.       the DOS session and helps in determining whether a PKTDRV is
  2274.       running within the DOS session or not.
  2275.  
  2276.       The repeatable /s (silent) option has been introduced to reduce the
  2277.       output from PKTMUX, PKTDRV and PKTSTATS.  /sss inhibits all output,
  2278.       /ss all but errors and /s lets through warnings as well.
  2279.  
  2280.       The /b option to reduce packet copying by trying to locate the data
  2281.       in the Packet Driver has been added.  This can may give improved
  2282.       performance which in the case of IEEE 802.3 can be dramatic.  This
  2283.       is a test implementation for evaluation purposes.
  2284.  
  2285.       Support for a channel using IEEE 802.3 over Packet Driver Class 1
  2286.       is now included via the /i option on both PKTMUX and PKTDRV.  This
  2287.       feature allows PKTMUX to support the RAL LLCPKT product instead of
  2288.       using LLCPKT2 and with the /b option can be very much more
  2289.       efficient.  This is a test implementation for evaluation purposes
  2290.       and, depending on feedback, a better implementation may be
  2291.       incorporated in a future release.
  2292.  
  2293.       A bug in PKTDRV whereby the /d option did not work has been fixed.
  2294.  
  2295.       A bug in PKTDRV and PKTMUX whereby they could not be run by
  2296.       LOADHIGH when there was a limited amount of upper memory has been
  2297.       fixed. A bug in correct allocation allocation of buffer memory in
  2298.       such circumstances has also been fixed.
  2299.  
  2300.       PKTDRV and PKTMUX now release all their file handles so frequent
  2301.       unloading does not cause you to run out.
  2302.  
  2303.       A bug which caused WINQVT to crash the PC if it was run twice has
  2304.       been cured. This fix should cure problems with any Windows
  2305.       application which uses a DOS TSR (PKTINT in the case of WINQVT) to
  2306.       interface it to a Packet Driver.
  2307.  
  2308.       The decision criteria for sending a packet direct to an application
  2309.       rather than copying it has been improved.
  2310.  
  2311.       The algorithm whereby packets held in the buffer queue were dropped
  2312.       after a certain time has been improved.  Packets are now held until
  2313.       the application requests them provided there are sufficient free
  2314.       buffers left. The numbers and sizes of buffers has also been
  2315.       revised in the light of experience.
  2316.  
  2317.       The filtering of broadcasts and especially ARP requests has been
  2318.       improved.
  2319.  
  2320.       Bugs in the handling of ICMP messages have been fixed.
  2321.  
  2322.       PKTMUX now copes with features in both NCSA and B&W software
  2323.       where unusual Access commands are made.
  2324.  
  2325.       PKTDRV actions on another PKTDRV such as /r, /u and /t are now
  2326.       checked under Windows and DESQview to see if they are being done on
  2327.       a PKTDRV that was loaded under DOS and refused if so.
  2328.  
  2329.  
  2330.  
  2331.       PKTSTATS output now gives more information especially that relevent
  2332.       to the effect of the /b option.
  2333.  
  2334.  
  2335.       10.5 Version 1.2a
  2336.       -----------------
  2337.  
  2338.       This fixes a bug in the /i (IEEE802.3) code which caused it to
  2339.       crash the PC.
  2340.  
  2341.  
  2342.       10.5 Version 1.2b
  2343.       -----------------
  2344.  
  2345.       The programs from this version must not be mixed with those from
  2346.       other versions of PKTMUX as they are incompatible. This is now
  2347.       checked for.
  2348.  
  2349.       The /w# option has been added to support those applications that
  2350.       use the ethernet board IRQ to drive them. Examples are B&W NFS and
  2351.       Wollongong NFS which run very slowly over PKTMUX unless this option
  2352.       is given on their PKTDRV.
  2353.  
  2354.       PKTMUX now works over the packet driver interface (DIS_PKT.GUP)
  2355.       provided under Windows for Workgroups.
  2356.  
  2357.  
  2358.  
  2359.       11. Support
  2360.       ===========
  2361.  
  2362.       PKTMUX is supplied free and is supported, within the limits of its
  2363.       specification, for all users at RAL on IBM PC and PS/2 computers
  2364.       and near clones.  Note that support is confined to bugs in the
  2365.       programs and clarification in the documentation of the systems
  2366.       limitations.
  2367.  
  2368.       Users outside RAL are requested in the first instance to obtain
  2369.       copies and help from their normal support sources.
  2370.  
  2371.       Academic user support organisations may seek help from RAL but the
  2372.       latter will only be given on a 'best endeavours' basis.
  2373.  
  2374.       There is no support for other organisations other than by private
  2375.       arrangement with the author.
  2376.  
  2377.       Updates of the software may be file transferred from the binary
  2378.       file PKTMUXxx EXE (xx being version number without a point -
  2379.       currently 12) on the RAL IBM mainframe (UK.AC.RL.IB on JANET,
  2380.       IB.RL.AC.UK on the Internet) disc PCSOFT 192.  Be warned that the
  2381.       IBM file and disc naming format uses a space between the parts of a
  2382.       name (eg PKTMUX12 EXE and PCSOFT 192) when they are accessed by a
  2383.       user logged into the machine and this is replaced by another
  2384.       character, usually a full stop (.), for external access such as FTP
  2385.       (eg PKTMUX12.EXE and PCSOFT.192).  Thus from the Internet an
  2386.       Anonymous FTP user should CD to PCSOFT.192 and binary GET
  2387.       PKTMUX12.EXE.  Executing the file will produce the program and
  2388.       documentation.
  2389.  
  2390.       Bug reports or problems should be reported, ideally by email, to
  2391.       Graham Robinson:
  2392.  
  2393.       Via JANET    : GWR@UK.AC.RL.IB         G W Robinson
  2394.       Via Internet : GWR@IB.RL.AC.UK         Atlas Centre
  2395.       UK Telephone : 0235 44 5636 or 6391    Rutherford Appleton Laboratory
  2396.       International: +44 235 44 5636         Chilton, Didcot
  2397.                                              Oxon,OX11 0QX,UK
  2398.  
  2399.       12. References
  2400.       ==============
  2401.  
  2402.       The RAL LOADSYS system version 1.4 is held in file LOAD14 EXE on
  2403.       PCSOFT 192 as detailed above. It is a loader/unloader for both
  2404.       programs and device drivers.
  2405.  
  2406.       The RAL LLCPKT and LLCPKT2 systems are held together in file
  2407.       LLCPKTS EXE on PCSOFT 192.  They map the BICC MPS ethernet
  2408.       interface onto a Packet Driver and are only of use to users of the
  2409.       Rainbow software.
  2410.  
  2411.       The RAL MOS2 IBM 3270 emulator version 2.3 is held in files MOS23
  2412.       EXE, MOS23X EXE and MOS23Y EXE on PCSOFT 192.  This TSR provides
  2413.       IBM 3270 emulation, EEHLLAPI and GDDM-PCLK support over
  2414.       asynchronous and ethernet communications.
  2415.  
  2416.