home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / archives / packetdrivers.tar.gz / pd.tar / new / pktmux12.exe / PKTMUX.DOC < prev    next >
Text File  |  1992-11-12  |  116KB  |  2,371 lines

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