home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / pub / wkermit / kwindow5doc.txt < prev    next >
Text File  |  2020-01-01  |  27KB  |  908 lines

  1. ***Change from November 11, 1985 draft definition.
  2.    Change is to section 4.4
  3.  
  4. ** Changes from July 19 draft definition indicated by ** at left margin.
  5.    Changes are to section 4.3 and section 5.3
  6.  
  7.                            KERMIT WINDOWING PROTOCOL          December 6, 1985
  8.                                 DRAFT VERSION 1.3
  9.  
  10.  
  11.        1 INTRODUCTION
  12.  
  13.  
  14.  
  15.        The windowing protocol as defined for the Kermit file transfer protocol
  16.        is based on the main premise of continuously sending data packets up to
  17.        the number defined by a  set  window  size.   These  data  packets  are
  18.        continuously acknowledged  by  the  receive side and the ideal transfer
  19.        occurs as long as they are transmitted with good  checksums,  they  are
  20.        transmitted in  sequential  order and there are no lost data packets or
  21.        acknowledgements.  The various error conditions define the  details  of
  22.        the windowing protocol and are best examined on a case basis.
  23.  
  24.        There are  five  stages that describe the overall sequence of events in
  25.        the Kermit protocol.  Three of these stages deviate from  the  original
  26.        protocol in order to add the windowing feature.  Stages 1 through 5 are
  27.        briefly described on the following page.  The three stages (1, 3 and 4)
  28.        which deviate  from the original protocol are then described in greater
  29.        detail in the pages that follow.
  30.  
  31.  
  32.  
  33.  
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.                               DRAFT PROPOSED DEFINITION              Page    1
  64.  
  65.  
  66.  
  67.                               KERMIT WINDOWING PROTOCOL          December 6, 198
  68.  
  69.  
  70.  
  71.        2 OVERALL SEQUENCE OF EVENTS
  72.  
  73.  
  74.  
  75.        STAGE 1 - Propose and Accept Windowing
  76.  
  77.        The send  side  requests  windowing  in   the   transmission   of   the
  78.        Send-Initiate (S)  packet.   The  receive  side  accepts  windowing  by
  79.        sending an acknowledgement (ACK packet) for the  Send-Initiate  packet.
  80.  
  81.        STAGE 2 - Send and Accept File-Header Packet
  82.  
  83.        The send  side  transmits  the File-Header (F) packet and waits for the
  84.        receive side to acknowledge it prior to transmitting any data.
  85.  
  86.        STAGE 3 - Transfer Data
  87.  
  88.        The sending routine transmits Data (D)  packets  one  after  the  other
  89.        until the  protocol  window  is  closed.   The receiving side ACKs good
  90.        data, stores data to disk as necessary and NAKs bad data.
  91.  
  92.        When the sender receives an ACK, the window may be rotated and the next
  93.        packet sent.  If the sender receives a NAK, the data  packet  concerned
  94.        is retransmitted.
  95.  
  96.        STAGE 4 - Send and Accept End_of_File Packet
  97.  
  98.        As the  sender is reading the file for data to send, it will eventually
  99.        reach the end of the file.  It then waits until  all  outstanding  data
  100.        packets have  been  acknowledged,  and  then  sends  an End-of_File (Z)
  101.        packet.
  102.  
  103.        When the receive side gets the End-of-File packet it stores the rest of
  104.        the data to disk, closes the file, and ACKs the End-of_File packet.
  105.  
  106.        The protocol then returns to Stage 2,  sending  and  acknowledging  any
  107.        further File-Header (F) packets.
  108.  
  109.        STAGE 5 - End of Transmission
  110.  
  111.        Once the  End-of-File  packet  has been sent and acknowledged and there
  112.        are no more files to send, the sender transmits the End-of-Transmission
  113.        (B) packet in order to end the ongoing transaction.  Once the  receiver
  114.        ACKs this  packet,  the transaction is ended and the logical connection
  115.        closed.
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.                               DRAFT PROPOSED DEFINITION              Page    2
  128.  
  129.  
  130.  
  131.                               KERMIT WINDOWING PROTOCOL          December 6, 198
  132.  
  133.  
  134.  
  135.        3 PROPOSE AND ACCEPT WINDOWING (STAGE 1)
  136.  
  137.  
  138.  
  139.        The initial connection as currently defined  for  the  Kermit  protocol
  140.        will need  to change only in terms of the contents of the Send-Initiate
  141.        packet.  The receiving Kermit waits for the sending Kermit to  transmit
  142.        the Send-Initiate  (S)  packet  and the sending packet does not proceed
  143.        with any additional transmission until the ACK has been returned by the
  144.        receiver.
  145.  
  146.        The contents  of  the  Send-Init  packet,  however,  will  be  slightly
  147.        revised.  The data field of the Send-Init packet currently contains all
  148.        of the configuration parameters.  The first six fields of the Send-Init
  149.        packet are fixed as follows:
  150.  
  151.            1       2        3        4         5        6
  152.          +--------+--------+--------+--------+--------+--------+
  153.          | MAXL   | TIME   | NPAD   | PADC   | EOL    | QCTL   |
  154.          +--------+--------+--------+--------+--------+--------+
  155.  
  156.        Fields 7  through  10  are  optional  features  of  Kermit and fields 7
  157.        through 9 will also  remain  unchanged  as  defined  for  the  existing
  158.        protocol:
  159.  
  160.              7        8        9        10
  161.          +--------+--------+--------+--------+
  162.          | QBIN   | CHKT   | REPT   | CAPAS  |
  163.          +--------+--------+--------+--------+
  164.  
  165.        Field 10  is  the  capability  field  and  requires  N  number of bytes
  166.        depending on the number of capabilities defined for kermit.   Each  bit
  167.        position of these 6-bit fields corresponds to a capability with the low
  168.        order bit  used  to  indicate  whether  or  not another capability byte
  169.        follows.  If the low order bit is  "1"  then  another  capability  byte
  170.        follows.  If the low order bit is "0" then the current byte is the last
  171.        capability byte.   The  second  through  sixth  bit positions represent
  172.        capabilities in the same way.  If a bit position is set to 1  then  the
  173.        capability it  represents  is present.  If the bit position is set to 0
  174.        then the capability it represents does not exist.  Currently, there are
  175.        only 3 capabilities defined for Kermit as follows:
  176.  
  177.            #1  Reserved
  178.            #2  Reserved
  179.            #3  Ability to accept "A" packets (file attributes)
  180.  
  181.        The windowing capability will constitute a fourth  capability  and  the
  182.        fourth bit  of  the  capability  field  will  be set to 1 if the kermit
  183.        implementation can handle windowing.
  184.  
  185.            #4  Ability to handle windowing.
  186.  
  187.  
  188.  
  189.  
  190.  
  191.                               DRAFT PROPOSED DEFINITION              Page    3
  192.  
  193.  
  194.  
  195.                               KERMIT WINDOWING PROTOCOL          December 6, 198
  196.  
  197.  
  198.  
  199.        The remaining fields of the Send-Init packet are  either  reserved  for
  200.        future use  by  the standard Kermit protocol or reserved for local site
  201.        implementations.  The four fields following the  capability  field  are
  202.        reserved for the standard Kermit protocol.  We propose the use of field
  203.        11 to be used to specify the "Window Size" for all kermits
  204.  
  205.              11        12       13      14        15        16 - N
  206.          +--------+--------+--------+--------+--------+------------------+
  207.          | WINDW  | RESV1  | RESV2  | RESV3  | RESV4  | LOCAL Reserved   |
  208.          +--------+--------+--------+--------+--------+------------------+
  209.  
  210.        11.  WINDW The window size to be used encoded printably using
  211.                   the char() function.  The window size may range
  212.                   from 1 to 31 inclusive.
  213.  
  214.        The sender  will  specify  the  window  size  it  wishes to use and the
  215.        receiver will reply (in the ACK packet) with the window size it  wishes
  216.        to use.   The window size actually used will be the minimum of the two.
  217.        If the receiver replies with a window size of 0 then no windowing  will
  218.        be done.
  219.  
  220.  
  221.  
  222.  
  223.  
  224.  
  225.  
  226.  
  227.  
  228.  
  229.  
  230.  
  231.  
  232.  
  233.  
  234.  
  235.  
  236.  
  237.  
  238.  
  239.  
  240.  
  241.  
  242.  
  243.  
  244.  
  245.  
  246.  
  247.  
  248.  
  249.  
  250.  
  251.  
  252.  
  253.  
  254.  
  255.                               DRAFT PROPOSED DEFINITION              Page    4
  256.  
  257.  
  258.  
  259.                               KERMIT WINDOWING PROTOCOL          December 6, 198
  260.  
  261.  
  262.  
  263.        4 TRANSFER DATA (STAGE 3)
  264.  
  265.  
  266.  
  267.        The sequence  of  events  required for the transmission of data packets
  268.        and confirmation of receipts  constitute  the  main  functions  of  the
  269.        windowing protocol.   There  are  four  main  functions  which  can  be
  270.        identified within this stage.  These are:
  271.  
  272.             - the sender's processing of the data packets,
  273.             - the receiver's handling of incoming packets,
  274.             - the sender's handling of the confirmations,
  275.             - the error handling on both sides.
  276.  
  277.        The following discussion details the specific actions required for each
  278.        of these functions.  Refer to the  state  table  at  the  end  of  this
  279.        document for  the  specific  action taken on a "received message" basis
  280.        for the full protocol.
  281.  
  282.  
  283.  
  284.  
  285.           4.1 The Sender's Processing of Data Packets
  286.  
  287.  
  288.           The sender instigates the transmission by  sending  the  first  data
  289.           packet and  then  operating in a cyclical mode of sending data until
  290.           the defined window is closed.
  291.  
  292.           Data to be sent must be read from the file, encoded into the  Kermit
  293.           Data packet, and saved in a Send-Table.  A Send-Table entry consists
  294.           of the  data  packet itself (which makes convenient the re-send of a
  295.           NAKed packet), a bit which keeps track of  whether  the  packet  has
  296.           been ACKed (the ACKed bit), and a retry counter.  The table is large
  297.           enough to hold all the packets for the protocol window.
  298.  
  299.           Before each transmission, the input buffer is checked and  input  is
  300.           processed, as  described  below.   Transmission  is  stopped  if the
  301.           protocol window "closes", that is, if the Send-Table is full.
  302.  
  303.  
  304.  
  305.  
  306.  
  307.  
  308.  
  309.  
  310.  
  311.  
  312.  
  313.  
  314.  
  315.  
  316.  
  317.  
  318.  
  319.                               DRAFT PROPOSED DEFINITION              Page    5
  320.  
  321.  
  322.  
  323.                               KERMIT WINDOWING PROTOCOL          December 6, 198
  324.  
  325.  
  326.  
  327.           4.2 The Receiver's Handling of Incoming Packets
  328.  
  329.  
  330.           The receiver keeps its  own  table  as  it  receives  incoming  data
  331.           packets.  This  allows  the  receiver  to receive subsequent packets
  332.           while it is waiting for a re-send of an erroneous  or  lost  packet.
  333.           In other  words,  the incoming packets do not have to be received in
  334.           sequential order and can still be written to disk in order.
  335.  
  336.           A Receive-Table entry consists of the data packet, a bit which keeps
  337.           track of whether a good version of the packet has been received (the
  338.           ACKed bit), and a retry counter for the  NAKs  we  send  to  request
  339.           retransmissions of  the  packet.   The table is large enough to hold
  340.           all the packets for the protocol window.
  341.  
  342.           The different possibilities for a received packet are:
  343.  
  344.              1. A new packet, the next sequential one (the usual case)
  345.              2. A new packet, not the next sequential one (some were lost)
  346.              3. An old packet, retransmitted
  347.              4. An unexpected data packet
  348.              5. Any packet with a bad checksum
  349.  
  350.           These are discussed separately below.
  351.  
  352.  
  353.           1.  The next new packet has sequence number  one  past  the  <latest
  354.           table entry>.  The packet is ACKed, and the Receive-Table is checked
  355.           for space.   If  it  is  full (already contains window_size entries)
  356.           then the oldest entry is written to disk.  (This entry  should  have
  357.           the ACKed  bit set.  If not, the receiver aborts the file transfer.)
  358.           The received packet is then stored in the  Receive-Table,  with  the
  359.           ACKed bit set.
  360.  
  361.  
  362.           2.  If the packet received has sequence number  in  the  range  <two
  363.           past the  latest  table entry> to <window_size past the latest table
  364.           entry> then it is a new packet, but some have been lost.  (The upper
  365.           limit here represents the  highest  packet  the  sender  could  send
  366.           within its  protocol  window.  Note that the requirement to test for
  367.           this case is what limits the maximum  window_size  to  half  of  the
  368.           range of  possible  sequence numbers) We ACK the packet, and NAK all
  369.           packets that were skipped.  (The skipped packets are those from <one
  370.           past the latest table entry> to <one before  the  received  packet>)
  371.           The Receive-Table is then checked.  The table may have to be rotated
  372.           to accomodate the packet, as with case 1.  (This time, several table
  373.           entries may  have  to  be written to disk.  As before, if any do not
  374.           have the ACKed bit set, they will trigger an abort.)  The packet  is
  375.           then stored in the table, and the ACKed bit set.
  376.  
  377.  
  378.           3.  A retransmitted packet will have sequence number  in  the  range
  379.           <the oldest table entry> to <the latest table entry>.  The packet is
  380.           ACKed, then placed in the table, setting the ACKed bit.
  381.  
  382.  
  383.                               DRAFT PROPOSED DEFINITION              Page    6
  384.  
  385.  
  386.  
  387.                               KERMIT WINDOWING PROTOCOL          December 6, 198
  388.  
  389.  
  390.  
  391.           4.  A packet with sequence number outside of  the  range  from  <the
  392.           oldest table  entry> to <window_size past the latest table entry> is
  393.           ignored.
  394.  
  395.  
  396.           5.  If the packet received  has  a  bad  checksum,  we  must  decide
  397.           whether to  generate  a  NAK,  and if so, with what sequence number.
  398.           The best action may depend on the configuration  and  channel  error
  399.           rate.  For  now,  we  adopt  the  following heuristic:  If there are
  400.           unACKed entries in our Receive-Table, we send a NAK for  the  oldest
  401.           one.  Otherwise  we ignore the packet.  (Notice that this will occur
  402.           in a common case:  when things have  been  going  smoothly  and  one
  403.           packet gets  garbled.   In this case, when we later receive the next
  404.           packet we will NAK for this one as described under Case 2 above.)
  405.  
  406.  
  407.  
  408.  
  409.  
  410.  
  411.  
  412.  
  413.  
  414.  
  415.  
  416.  
  417.  
  418.  
  419.  
  420.  
  421.  
  422.  
  423.  
  424.  
  425.  
  426.  
  427.  
  428.  
  429.  
  430.  
  431.  
  432.  
  433.  
  434.  
  435.  
  436.  
  437.  
  438.  
  439.  
  440.  
  441.  
  442.  
  443.  
  444.  
  445.  
  446.  
  447.                               DRAFT PROPOSED DEFINITION              Page    7
  448.  
  449.  
  450.  
  451.                               KERMIT WINDOWING PROTOCOL          December 6, 198
  452.  
  453.  
  454.  
  455.           4.3 The Sender's Handling of Confirmations
  456.  
  457.  
  458.           The sender's receipt of confirmations controls the rotation  of  the
  459.           Send-Table and  normally returns the sender to a sending state.  The
  460.           sender's action  depends  on  the  packet  checksum,  the  type   of
  461.           confirmation (ACK  or  NAK),  and whether the confirmation is within
  462.           the high and low boundaries of the Send-Table.
  463.  
  464.           If the checksum is bad the packet is ignored.
  465.  
  466.           When the sender receives an ACK, the sequence  number  is  examined.
  467.           If the  sequence  number is outside of the current table boundaries,
  468.           then the ACK is also ignored.  If the sequence number is  inside  of
  469.           the current  table  boundaries then the ACKed bit for that packet is
  470.           marked.  If the entry  is  at  the  low  boundary,  this  enables  a
  471.           "rotation" of  the  table.   The low boundary is changed to the next
  472.           sequential entry for which the ACKed bit is  not  set.   This  frees
  473.           space in the table to allow further transmissions.
  474.  
  475.           When the sender receives a NAK, the table boundaries are checked.
  476.           A  NAK  inside the table boundary indicates that the sender must
  477.           re-send  the packet. The sender  first tests the packet's retry
  478.           counter against the retry threshold. If the threshold has been
  479.           reached, then the transfer  is stopped (by going to the Abort
  480.           state). Otherwise, the retry counter is incremented and the
  481.           packet re-sent.
  482.  
  483. **        A NAK outside  of  the  table boundary causes the sender to send
  484. **        the  earliest  unACKed  packet, or if all have been ACKed, the
  485. **        next packet.  The retry counter is tested and incremented as above.
  486.  
  487.  
  488.  
  489.  
  490.  
  491.  
  492.  
  493.  
  494.  
  495.  
  496.  
  497.  
  498.  
  499.  
  500.  
  501.  
  502.  
  503.  
  504.  
  505.  
  506.  
  507.  
  508.  
  509.  
  510.  
  511.  
  512.  
  513.  
  514.  
  515.                               DRAFT PROPOSED DEFINITION              Page    8
  516.  
  517.  
  518.  
  519.                               KERMIT WINDOWING PROTOCOL          December 6, 198
  520.  
  521.  
  522.  
  523.           4.4 Error Handling for Both Sides
  524.  
  525.  
  526.  
  527.           Three situations  are  discussed  here:   Sender  timeout,  Receiver
  528.           timeout, and invalid packets.
  529.  
  530.           If certain packets are lost, each side may "hang", waiting  for  the
  531.           other.  To  get  things  moving  when  this  happens each may have a
  532.           "timeout limit", the longest they will wait for something  from  the
  533.           other side.
  534.  
  535.           If the sender's timeout condition is triggered, then  it  will  send
  536.           the oldest  unACKed  packet.   This  will  be  the  first one in the
  537.           Send-Table.
  538.  
  539.           If the receiver's timeout condition is triggered, then it will  send
  540.           a NAK  for the "most desired packet".  This is defined as either the
  541.           oldest unACKed packet, or if none are unACKed, then the next  packet
  542.           to be received (sequence number <latest table entry plus one>).  The
  543.           packet retry  count  is  not  incremented  by  this NAK;  instead we
  544.           depend on the timeout retry count, discussed next.
  545.  
  546.           For either the sender  or  receiver,  the  timeout  retry  count  is
  547.           incremented each  time a timeout occurs.  If the timeout retry limit
  548.           is exceeded then the side  aborts  the  file  transfer.   Each  side
  549.           resets the retry count to zero whenever they receive a packet.
  550.  
  551.           In addition, as with the existing Kermit, any invalid  packet  types
  552.           received by either side will cause an Error packet and stop the file
  553.           transfer.
  554.  
  555.  
  556. ***       TIMEOUT AVOIDANCE HEURISTIC
  557. Section
  558. added
  559. through   An additional heuristic will prevent most timeouts due to lost
  560. stars     ACKs or NAKs.  The sender re-sends the earliest packet (the packet
  561. below     blocking the window) if the following conditions are true:
  562.  
  563.              1. The Sender's window is blocked.
  564.              2. The Retry Count for the earliest packet is zero.
  565.              3. An ACK (or optionally also NAK) for any later packet
  566.                 has been received.
  567.  
  568.           This heuristic takes advantage of the fact that ACKs and NAKs
  569.           should normally be received in order.  Receipt of a later ACK
  570.           implies that the earliest ACK was lost.  Therefore, we can
  571.           anticipate that a timeout is likely to occur and avoid it by
  572.           resending (once) the packet blocking the window.  The packet is
  573.           only sent once (i.e. if the retry count is zero) to avoid
  574. ***       complicating error recovery.
  575.  
  576.  
  577.  
  578.  
  579.  
  580.  
  581.  
  582.  
  583.  
  584.  
  585.                               DRAFT PROPOSED DEFINITION              Page    9
  586.  
  587.  
  588.  
  589.                               KERMIT WINDOWING PROTOCOL          December 6, 198
  590.  
  591.  
  592.  
  593.        5 SEND AND ACCEPT END_OF_FILE PACKET (STAGE 4)
  594.  
  595.  
  596.  
  597.        There are  several  ways  to  end  the file transfer.  The first is the
  598.        normal way, when the sender encounters an  end-of-file  condition  when
  599.        reading the  file  to  get  a  packet  for transmission.  The second is
  600.        because of a sender side user interrupt.  The third  is  because  of  a
  601.        receiver side user interrupt.  Both of these cause the received file to
  602.        be discarded.   In  addition  either side may stop the transfer with an
  603.        Error packet if an unrecoverable error is encountered.
  604.  
  605.  
  606.  
  607.  
  608.           5.1 Normal End of File Handling
  609.  
  610.  
  611.           When the sender reaches the end of file, it must wait until all data
  612.           packets have been acknowledged before sending  the  End-of-File  (Z)
  613.           packet.  To  do this it must be able to check the end-of-file status
  614.           when it processes ACKs.  If the ACK  causes  the  Send-Table  to  be
  615.           emptied and  the  end-of-file has been reached, then a transition is
  616.           made to the Send_Eof state which sends the End_of_File packet.
  617.  
  618.           When the  receiver  gets  the  End_of_File  packet,  it  writes  the
  619.           contents of  the  Receive-Table  to  the file (suitably decoded) and
  620.           closes the file.  (If any entries do not have the ACKed bit set,  or
  621.           if errors  occur  in  writing the file, the receiver aborts the file
  622.           transfer.)  If the operation is successful, the  receiver  sends  an
  623.           ACK.  It  then  sets  its  sequence number to the End_of_File packet
  624.           sequence number and goes to Rcv_File state.
  625.  
  626.  
  627.  
  628.  
  629.           5.2 Sender User Interrupt
  630.  
  631.  
  632.           Whenever the sender checks for input from  the  data  communications
  633.           line, it  should  also check for user input.  If that indicates that
  634.           the file transfer should be stopped, the sender goes directly to the
  635.           Send_Eof state and sends an  End_of_File  packet  with  the  Discard
  636.           indication.  It  will not have to wait for outstanding packets to be
  637.           ACKed.
  638.  
  639.           When the receiver gets  the  End_of_File  packet  with  the  Discard
  640.           indication it  discards  the  file,  sets its sequence number to the
  641.           End_of_File packet sequence number, and goes to RcvFile state.
  642.  
  643.  
  644.  
  645.  
  646.  
  647.  
  648.  
  649.                               DRAFT PROPOSED DEFINITION              Page   10
  650.  
  651.  
  652.  
  653.                               KERMIT WINDOWING PROTOCOL          December 6, 198
  654.  
  655.  
  656.  
  657.           5.3 Receiver User Interrupt
  658.  
  659.  
  660.           Whenever the receiver checks for input from the data  communications
  661.           line, it  also  should check for user input.  If that indicates that
  662.           the file transfer should be stopped, the receiver sets an "interrupt
  663.           indication" of X (for "stop this file transfer") or of Z (for  "stop
  664.           the batch  of  file  transfers").   When the receiver later sends an
  665.           ACK, it places an X or Z in the data field.
  666.  
  667.           When the sender gets this ACK, it goes to  the  Send_Eof  state  and
  668.           sends the  End_of_File packet with the Discard indication, as above.
  669. **        The sequence number of the End_of_File packet is the (sequence
  670. **        number of the ACK with Discard) + 1.
  671.  
  672.           When the receiver gets  the  End_of_File  packet  with  the  Discard
  673.           indication, it  discards  the  file, sets its sequence number to the
  674.           End_of_File packet sequence number, and goes to RcvFile state.
  675.  
  676.  
  677.  
  678.  
  679.  
  680.  
  681.  
  682.  
  683.  
  684.  
  685.  
  686.  
  687.  
  688.  
  689.  
  690.  
  691.  
  692.  
  693.  
  694.  
  695.  
  696.  
  697.  
  698.  
  699.  
  700.  
  701.  
  702.  
  703.  
  704.  
  705.  
  706.  
  707.  
  708.  
  709.  
  710.  
  711.  
  712.                               DRAFT PROPOSED DEFINITION              Page   11
  713.  
  714.  
  715.  
  716.                               KERMIT WINDOWING PROTOCOL          December 6, 198
  717.  
  718.  
  719.  
  720.           5.4 LOW LEVEL PROTOCOL REQUIREMENTS
  721.  
  722.  
  723.           The Kermit windowing protocol, as defined in  this  document,  makes
  724.           certain assumptions  about the underlying transmission and reception
  725.           mechanism.
  726.  
  727.           First, it must provide a full-duplex channel so that messages may be
  728.           sent and received simultaneously.
  729.  
  730.           Second, it will prove advantageous to  be  able  to  buffer  several
  731.           received messages  at  the  low  level before processing them at the
  732.           Kermit level.  This is for two  reasons.   The  first  is  that  the
  733.           Kermit windowing  level  of the protocol may take a while to process
  734.           one input, and meanwhile several  others  may  arrive.   The  second
  735.           reason is  to  support XON/XOFF flow control.  If Kermit receives an
  736.           XOFF from the data communications line, it  must  wait  for  an  XON
  737.           before sending  its  packet.   While  it  is  waiting, the low level
  738.           receive must  be  able  to  accept  input.   Otherwise  a   deadlock
  739.           situation could  arise  with  each side flow controlled, waiting for
  740.           the other.
  741.  
  742.  
  743.  
  744.  
  745.  
  746.  
  747.  
  748.  
  749.  
  750.  
  751.  
  752.  
  753.  
  754.  
  755.  
  756.  
  757.  
  758.  
  759.  
  760.  
  761.  
  762.  
  763.  
  764.  
  765.  
  766.  
  767.  
  768.  
  769.  
  770.  
  771.  
  772.  
  773.  
  774.  
  775.  
  776.                               DRAFT PROPOSED DEFINITION              Page   12
  777.  
  778.  
  779.  
  780.                               KERMIT WINDOWING PROTOCOL          December 6, 198
  781.  
  782.  
  783.  
  784.           5.5 KERMIT WINDOWING PROTOCOL STATE TABLE
  785.  
  786.  
  787.           The following defines the inputs expected,  the  actions  performed,
  788.           and the  succeeding  states for proposed new Send_Data_Windowing and
  789.           Rcv_Data_Windowing states.
  790.  
  791.           If both sides agree on windowing in the  Send  Init  exchange,  then
  792.           instead of  entering  the  old  Send_Data  or  Rcv_Data  states from
  793.           Send_File or Rcv_File,  we  enter  the  new  Send_Data_Windowing  or
  794.           Rcv_Data_Windowing.
  795.  
  796.  
  797.  
  798.           SEND_DATA_WINDOWING
  799.  
  800.           Rec'd Msg                Action                          Next State
  801.           ---------                ------                          ----------
  802.  
  803.           No input/Window closed  (1) Wait for input                   SDW
  804.           No input/Window open    (2) Read file, encode packet,        SDW
  805.                                       Place in table, mark unACKed,
  806.                                       Send packet
  807.  
  808.           ACK/ X or Z             (3) set interrupt indicator (X/Z)  Send_Eof
  809.           ACK/outside table        -ignore-                            SDW
  810.           ACK/inside table        (4) mark pkt ACKed,         SDW or Send_Eof
  811.                                       if low rotate table,
  812.                                       if file eof & table empty
  813.                                          then goto Send_Eof
  814.  
  815.           NAK/outside table        -ignore-                            SDW
  816.           NAK/inside table        (5) test retry limit,                SDW
  817.                                       re-send DATA packet
  818.  
  819.           Bad checksum            -ignore-                             SDW
  820.  
  821.           Timeout                 (6) re-send oldest unACKed pkt       SDW
  822.  
  823.           User interrupt          (7) set interrupt indicator (X/Z)  Send_Eof
  824.  
  825.           Other                   (8) send Error                      Abort
  826.  
  827.  
  828.  
  829.  
  830.  
  831.  
  832.  
  833.  
  834.  
  835.  
  836.  
  837.  
  838.  
  839.  
  840.                               DRAFT PROPOSED DEFINITION              Page   13
  841.  
  842.  
  843.  
  844.                               KERMIT WINDOWING PROTOCOL          December 6, 198
  845.  
  846.  
  847.  
  848.           RCV_DATA_WINDOWING
  849.  
  850.           Rec'd Msg                Action                          Next State
  851.           ---------                ------                          ----------
  852.  
  853.           DATA/new                (1) send ACK                         RDW
  854.                                       if table full: file & rotate
  855.                                       store new pkt in table
  856.           DATA/old                (2) send ACK, store in table         RDW
  857.           DATA/unexpected         -ignore-                             RDW
  858.  
  859.           Z/discard               (3) discard file                   Rcv_File
  860.           Z/                      (4) write table to file & close    Rcv_File
  861.                                       if OK send ACK, else Error     or Abort
  862.  
  863.           Bad checksum            (5) send NAK for oldest unACKed      RDW
  864.  
  865.           Timeout                 (6) send NAK for most desired pkt    RDW
  866.  
  867.           User Interrupt          (7) Set interrupt indicator X or Z   RDW
  868.  
  869.           Other                   (8) send Error pkt                  Abort
  870.  
  871.  
  872.  
  873.  
  874.  
  875.  
  876.  
  877.  
  878.  
  879.  
  880.  
  881.  
  882.  
  883.  
  884.  
  885.  
  886.  
  887.  
  888.  
  889.  
  890.  
  891.  
  892.  
  893.  
  894.  
  895.  
  896.  
  897.  
  898.  
  899.  
  900.  
  901.  
  902.  
  903.  
  904.                               DRAFT PROPOSED DEFINITION              Page   14
  905.  
  906.  
  907.  
  908.