home *** CD-ROM | disk | FTP | other *** search
/ Unix System Administration Handbook 1997 October / usah_oct97.iso / rfc / 900s / rfc938.txt < prev    next >
Text File  |  1992-09-22  |  39KB  |  1,084 lines

  1.  
  2.  
  3. Network Working Group                                       Trudy Miller
  4. Request for Comments: 938                                            ACC
  5.                                                            February 1985
  6.  
  7.                  Internet Reliable Transaction Protocol
  8.                  Functional and Interface Specification
  9.  
  10.  
  11. STATUS OF THIS MEMO
  12.  
  13.    This RFC is being distributed to members of the DARPA research
  14.    community in order to solicit their reactions to the proposals
  15.    contained in it.  While the issues discussed may not be directly
  16.    relevant to the research problems of the DARPA community, they may be
  17.    interesting to a number of researchers and implementors.  This RFC
  18.    suggests a proposed protocol for the ARPA-Internet community, and
  19.    requests discussion and suggestions for improvements.  Distribution
  20.    of this memo is unlimited.
  21.  
  22. ABSTRACT
  23.  
  24.    The Internet Reliable Transaction Protocol (IRTP) is a transport
  25.    level host to host protocol designed for an internet environment.  It
  26.    provides reliable, sequenced delivery of packets of data between
  27.    hosts and multiplexes/demultiplexes streams of packets from/to user
  28.    processes representing ports.  It is simple to implement, with a
  29.    minimum of connection management, at the possible expense of
  30.    efficiency.
  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. Miller                                                          [Page i]
  57.  
  58.  
  59.  
  60. RFC 938                                                    February 1985
  61. Internet Reliable Transaction Protocol
  62.  
  63.  
  64. TABLE OF CONTENTS
  65.  
  66.    INTRODUCTION
  67.  
  68.       1.1   Purpose .........................................  1
  69.       1.2   Underlying Mechanisms ...........................  1
  70.       1.3   Relationship to Other Protocols .................  2
  71.  
  72.    IRTP HEADERS
  73.  
  74.       2.1   Header Format ...................................  3
  75.       2.2   Packet Type .....................................  3
  76.       2.3   Port Number .....................................  3
  77.       2.4   Sequence Number .................................  4
  78.       2.5   Length ..........................................  4
  79.       2.6   Checksum ........................................  4
  80.  
  81.    INTERFACES
  82.  
  83.       3.1   User Services Provided By IRTP ..................  5
  84.       3.2   IP Services Expected by IRTP ....................  5
  85.  
  86.    MODEL OF OPERATION
  87.  
  88.       4.1   State Variables .................................  6
  89.       4.2   IRTP Initialization .............................  7
  90.       4.3   Host-to-Host Synchronization ....................  7
  91.       4.3.1   Response to SYNCH Packets .....................  7
  92.       4.3.2   Response to SYNCH ACK Packet ..................  8
  93.       4.4   Transmitting Data ...............................  8
  94.       4.4.1   Receiving Data From Using Processes ...........  8
  95.       4.4.2   Packet Retransmission ......................... 10
  96.       4.5   Receiving Data .................................. 10
  97.       4.5.1   Receive and Acknowledgment Windows ............ 11
  98.       4.5.2   Invalid Packets ............................... 12
  99.       4.5.3   Sequence Numbers Within Acknowledge Window .... 12
  100.       4.5.4   Sequence Numbers Within the Receive Window .... 12
  101.       4.5.5   Forwarding Data to Using Processes ............ 13
  102.  
  103.    IMPLEMENTATION ISSUES
  104.  
  105.       5.1   Retransmission Strategies ....................... 14
  106.       5.2   Pinging ......................................... 14
  107.       5.3   Deleting Connection Tables ...................... 16
  108.  
  109.  
  110.  
  111.  
  112.  
  113. Miller                                                         [Page ii]
  114.  
  115.  
  116.  
  117. RFC 938                                                    February 1985
  118. Internet Reliable Transaction Protocol
  119.  
  120.  
  121.    LIST OF FIGURES
  122.  
  123.       Figure 1-1    Relationship of IRTP to Other Protocols .  2
  124.       Figure 2-1    IRTP Header Format ......................  3
  125.       Figure 4-1    SYNCH Packet Format .....................  8
  126.       Figure 4-2    SYNCH ACK Packet Format .................  8
  127.       Figure 4-3    DATA Packet Format ......................  9
  128.       Figure 4-4    DATA ACK Packet Format .................. 11
  129.       Figure 4-5    PORT NAK Packet Format .................. 11
  130.  
  131.    ABBREVIATIONS
  132.  
  133.       ICMP        Internet Control Message Protocol
  134.       IP          Internet Protocol
  135.       IRTP        Internet Reliable Transaction Protocol
  136.       RDP         Reliable Data Protocol
  137.       TCP         Transmission Control Protocol
  138.       UDP         User Datagram Protocol
  139.  
  140.  
  141.  
  142.  
  143.  
  144.  
  145.  
  146.  
  147.  
  148.  
  149.  
  150.  
  151.  
  152.  
  153.  
  154.  
  155.  
  156.  
  157.  
  158.  
  159.  
  160.  
  161.  
  162.  
  163.  
  164.  
  165.  
  166.  
  167.  
  168.  
  169.  
  170. Miller                                                        [Page iii]
  171.  
  172.  
  173.  
  174. RFC 938                                                    February 1985
  175. Internet Reliable Transaction Protocol
  176.  
  177.  
  178. CHAPTER 1 - INTRODUCTION
  179.  
  180.    The Internet Reliable Transaction Protocol (IRTP) is a full duplex,
  181.    transaction oriented, host to host protocol which provides reliable
  182.    sequenced delivery of packets of data, called transaction packets.
  183.  
  184.    Note: throughout this document the terms host and internet address
  185.    are used interchangeably.
  186.  
  187.    1.1 Purpose
  188.  
  189.       The IRTP was designed for an environment in which one host will
  190.       have to maintain reliable communication with many other hosts.  It
  191.       is assumed that there is a (relatively) sporadic flow of
  192.       information with each destination host, however information flow
  193.       may be initiated at any time at either end of the connection.  The
  194.       nature of the information is in the form of transactions, i.e.
  195.       small, self contained messages.  There may be times at which one
  196.       host will want to communicate essentially the same information to
  197.       all of its known destinations as rapidly as possible.
  198.  
  199.       In effect, the IRTP defines a constant underlying connection
  200.       between two hosts. This connection is not established and broken
  201.       down, rather it can be resynchronized with minimal loss of data
  202.       whenever one of the hosts has been rebooted.
  203.  
  204.       Due to the lack of connection management, it is desirable that all
  205.       IRTP processes keep static information about all possible remote
  206.       hosts. However, the IRTP has been designed such that minimal state
  207.       information needs to be associated with each host to host pair,
  208.       thereby allowing one host to communicate with many remote hosts.
  209.  
  210.       The IRTP is more complex than UDP in that it provides reliable,
  211.       sequenced delivery of packets, but it is less complex than TCP in
  212.       that sequencing is done on a packet by packet (rather than
  213.       character stream) basis, and there is only one connection defined
  214.       between any two internet addresses (that is, it is not a process
  215.       to process protocol.)
  216.  
  217.    1.2 Underlying Mechanisms
  218.  
  219.       The IRTP uses retransmission and acknowledgments to guarantee
  220.       delivery. Checksums are used to guarantee data integrity and to
  221.       protect against misrouting.  There is a host to host
  222.       synchronization mechanism and packet sequencing to provide
  223.       duplicate detection and ordered delivery to the user process.  A
  224.       simple mechanism allows IRTP to multiplex and demultiplex streams
  225.  
  226.  
  227. Miller                                                          [Page 1]
  228.  
  229.  
  230.  
  231. RFC 938                                                    February 1985
  232. Internet Reliable Transaction Protocol
  233.  
  234.  
  235.       of transaction packets being exchanged between multiple IRTP users
  236.       on this host and statically paired IRTP users on the same remote
  237.       host.
  238.  
  239.    1.3 Relationship to Other Protocols
  240.  
  241.       The IRTP is designed for use in a potentially lossy internet
  242.       environment.  It requires that IP be under it.  The IP protocol
  243.       number of IRTP is 28.
  244.  
  245.       Conversely, IRTP provides a reliable transport protocol for one or
  246.       more user processes.  User processes must have well-known IRTP
  247.       port numbers, and can communicate only with matching processes
  248.       with the same port number.  (Note that the term port refers to a
  249.       higher level protocol.  IRTP connections exists between two hosts,
  250.       not between a host/port and another host/port.)
  251.  
  252.       These relationships are depicted below.
  253.  
  254.          +--------+    +--------+   +-----------+
  255.          | port a |....| port x |   | TCP users |   Application Level
  256.          +--------+    +--------+   +-----------+
  257.                |          |            | ... |
  258.              +--------------+       +-----------+
  259.              |     IRTP     |       |    TCP    |   Host Level
  260.              +--------------+       +-----------+
  261.                     |                     |
  262.          +--------------------------------------+
  263.          |    Internet Protocol and ICMP        |   Internet Level
  264.          +--------------------------------------+
  265.                           |
  266.          +--------------------------------------+
  267.          |      Local Network Protocol          |   Network Level
  268.          +--------------------------------------+
  269.  
  270.          Figure 1-1.  Relationship of IRTP to Other Protocols
  271.  
  272.  
  273.  
  274.  
  275.  
  276.  
  277.  
  278.  
  279.  
  280.  
  281.  
  282.  
  283.  
  284. Miller                                                          [Page 2]
  285.  
  286.  
  287.  
  288. RFC 938                                                    February 1985
  289. Internet Reliable Transaction Protocol
  290.  
  291.  
  292. CHAPTER 2 - IRTP HEADERS
  293.  
  294.    2.1 Header Format
  295.  
  296.       Each IRTP packet is preceded by an eight byte header depicted
  297.       below. The individual fields are described in the following
  298.       sections.
  299.  
  300.          0      7 8     15 16             31
  301.          +--------+--------+--------+--------+
  302.          | packet |  port  |     sequence    |
  303.          |  type  | number |      number     |
  304.          +--------+--------+--------+--------+
  305.          |      length     |    checksum     |
  306.          |                 |                 |
  307.          +-----------------+-----------------+
  308.          |                                   |
  309.          |       optional data octets        |
  310.          + . . . . . . . . . . . . . . . . . |
  311.  
  312.          Figure 2-1.  IRTP Header Format
  313.  
  314.    2.2 Packet Type
  315.  
  316.       Five packet types are defined by the IRTP. These are:
  317.  
  318.       packet type   numeric code
  319.  
  320.       SYNCH              0
  321.       SYNCH ACK          1
  322.       DATA               2
  323.       DATA ACK           3
  324.       PORT NAK           4
  325.  
  326.       The use of individual packet types is discussed in MODEL OF
  327.       OPERATION.
  328.  
  329.    2.3 Port Number
  330.  
  331.       This field is used for the multiplexing and demultiplexing of
  332.       packets from multiple user processes across a single IRTP
  333.       connection.  Processes which desire to use IRTP must claim port
  334.       numbers.  A port number represents a higher level protocol, and
  335.       data to/from this port may be exchanged only with a process which
  336.       has claimed the same port number at a remote host.  A process can
  337.       claim multiple port numbers, however, only one process may claim
  338.       an individual port number.  All port numbers are well-known.
  339.  
  340.  
  341. Miller                                                          [Page 3]
  342.  
  343.  
  344.  
  345. RFC 938                                                    February 1985
  346. Internet Reliable Transaction Protocol
  347.  
  348.  
  349.    2.4 Sequence Number
  350.  
  351.       For each communicating pair of hosts, there are two sequence
  352.       numbers defined, which are the send sequence numbers for the two
  353.       ends.  Sequence numbers are treated as unsigned 16 bit integers.
  354.       Each time a new transaction packet is sent, the sender increases
  355.       the sequence number by one.  Initial sequence numbers are
  356.       established when the connection is resynchronized (see Section
  357.       4.3.)
  358.  
  359.    2.5 Length
  360.  
  361.       The length is the number of octets in this transaction packet,
  362.       including the header and the data.  (This means that the minimum
  363.       value of the length is 8.)
  364.  
  365.    2.6 Checksum
  366.  
  367.       The checksum is the 16-bit one's complement of the one's
  368.       complement sum of the IRTP header and the transaction packet data
  369.       (padded with an octet of zero if necessary to make an even number
  370.       of octets.)
  371.  
  372.  
  373.  
  374.  
  375.  
  376.  
  377.  
  378.  
  379.  
  380.  
  381.  
  382.  
  383.  
  384.  
  385.  
  386.  
  387.  
  388.  
  389.  
  390.  
  391.  
  392.  
  393.  
  394.  
  395.  
  396.  
  397.  
  398. Miller                                                          [Page 4]
  399.  
  400.  
  401.  
  402. RFC 938                                                    February 1985
  403. Internet Reliable Transaction Protocol
  404.  
  405.  
  406. CHAPTER 3 - INTERFACES
  407.  
  408.    3.1 User Services Provided by IRTP
  409.  
  410.       The exact interface to the TRTP from the using processes is
  411.       implementation dependent, however, IRTP should provide the
  412.       following services to the using processes.
  413.  
  414.          o  user processes must be able to claim a port number
  415.  
  416.          o  users must be able to request that data be sent to a
  417.             particular port at an internet address (the port must be one
  418.             which the user has claimed)
  419.  
  420.          o  users must be able to request transaction data from a
  421.             particular port at any (unspecified) remote internet address
  422.             (the port must be one which the user has claimed)
  423.  
  424.          o  if a port is determined to be unreachable at a particular
  425.             destination, the using process which has claimed that port
  426.             should be notified
  427.  
  428.       In addition to these minimal data transfer services, a particular
  429.       implementation may want to have a mechanism by which a
  430.       "supervisory" (that is, port independent) module can define
  431.       dynamically the remote internet addresses which are legal targets
  432.       for host to host communication by this IRTP module.  This
  433.       mechanism might be internal or external to the IRTP module itself.
  434.  
  435.    3.2 IP Services Expected by IRTP
  436.  
  437.       IRTP expects a standard interface to IP through which it can send
  438.       and receive transaction packets as IP datagrams.  In addition, if
  439.       possible, it is desirable that IP or ICMP notify IRTP in the event
  440.       that a remote internet address is unreachable.
  441.  
  442.       If the IP implementation (including ICMP) is able to notify IRTP
  443.       of source quench conditions, individual IRTP implementations may
  444.       be able to perform some dynamic adjustment of transmission
  445.       characteristics.
  446.  
  447.  
  448.  
  449.  
  450.  
  451.  
  452.  
  453.  
  454.  
  455. Miller                                                          [Page 5]
  456.  
  457.  
  458.  
  459. RFC 938                                                    February 1985
  460. Internet Reliable Transaction Protocol
  461.  
  462.  
  463. CHAPTER 4 - MODEL OF OPERATION
  464.  
  465.    The basic operation of IRTP is as follows.  The first time two hosts
  466.    communicate (or the first time after both have simultaneously
  467.    failed,) synchronization is established using constant initial
  468.    sequence numbers (there is a sequence number for each direction of
  469.    transmission).  The TCP "quiet time" is used following reboots to
  470.    insure that this will not cause inaccurate acknowledgment processing
  471.    by one side or the other.
  472.  
  473.    Once synchronization has been achieved data may be passed in both
  474.    directions.  Each transaction packet has a 16 bit sequence number.
  475.    Sequence numbers increase monotonically as new packets are generated.
  476.    The receipt of each sequence number must be acknowledged, either
  477.    implicitly or explicitly.  At most 8 unacknowledged packets may be
  478.    outstanding in one direction.  This number (called MAXPACK) is fixed
  479.    for all IRTP modules. Unacknowledged packets must be periodically
  480.    retransmitted.  Sequence numbers are also used for duplicate
  481.    detection by receiving IRTP modules.
  482.  
  483.    If synchronization is lost due to the failure of one of the
  484.    communicating hosts, after a reboot that host requests the remote
  485.    host to communicate sequence number information, and data transfer
  486.    continues.
  487.  
  488.    4.1 State Variables
  489.  
  490.       Each IRTP is associated with a single internet address.  The
  491.       synchronization mechanism of the IRTP depends on the requirement
  492.       that each IRTP module knows the internet addresses of all modules
  493.       with which it will communicate.  For each remote internet address,
  494.       an IRTP module must maintain the following information (called the
  495.       connection table):
  496.  
  497.       rem_addr     (32 bit remote internet address)
  498.       conn_state   (8  bit connection state)
  499.       snd_nxt      (16 bit send sequence number)
  500.       rcv_nxt      (16 bit expected next receive sequence number)
  501.       snd_una      (16 bit first unacknowledged sequence number)
  502.  
  503.       In addition to maintaining the connection tables defined above, it
  504.       is required that every IRTP module have some mechanism which
  505.       generates "retransmission events" such that SYNCH packets are
  506.       periodically retransmitted for any connection in synch_wait state
  507.       (see Section 4.3), and the appropriate DATA packet is periodically
  508.       retransmitted for any connection in data_transfer state (see
  509.       Section 4.4.2).  It is implementation dependent whether this
  510.  
  511.  
  512. Miller                                                          [Page 6]
  513.  
  514.  
  515.  
  516. RFC 938                                                    February 1985
  517. Internet Reliable Transaction Protocol
  518.  
  519.  
  520.       mechanism is connection dependent, or a uniform mechanism for all
  521.       connections, so it has not been made part of the connection state
  522.       table.  See Chapter 5 for more discussion.
  523.  
  524.    4.2 IRTP Initialization
  525.  
  526.       Whenever a remote internet address becomes known by an IRTP
  527.       process, a 2 minute "quiet time" as described in the TCP
  528.       specification must be observed before accepting any incoming
  529.       packets or user requests.  This is to insure that no old IRTP
  530.       packets are still in the network.  In addition, a connection table
  531.       is initialized as follows:
  532.  
  533.       rem_addr     =    known internet address
  534.       conn_state   =    0 = out-of-synch
  535.       snd_nxt      =    0
  536.       rcv_nxt      =    0
  537.       snd_una      =    0
  538.  
  539.       Strictly speaking, the IRTP specification does not allow
  540.       connection tables to be dynamically deleted and recreated,
  541.       however, if this happens the above procedure must be repeated.
  542.       See Chapter 5 for more discussion.
  543.  
  544.    4.3 Host-to-Host Synchronization
  545.  
  546.       An IRTP module must initiate synchronization whenever it receives
  547.       a DATA packet or a user request referencing an internet address
  548.       whose connection state is out-of-synch.  Typically, this will
  549.       happen only the first time that internet address is active
  550.       following the reinitialization of the IRTP module. A SYNCH packet
  551.       as shown below is transmitted.  Having sent this packet, the host
  552.       enters connection state synch_wait (conn_state = 1).  In this
  553.       state, any incoming DATA, DATA ACK or PORT NAK packets are
  554.       ignored.  The SYNCH packet itself must be retransmitted
  555.       periodically until synchronization has been achieved.
  556.  
  557.       4.3.1 Response to SYNCH Packets -
  558.  
  559.          Whenever a SYNCH packet is received, the recipient, regardless
  560.          of current connection state, is required to to return a SYNCH
  561.          ACK packet as shown below.  At this point the recipient enters
  562.          data_transfer state (conn_state = 2).
  563.  
  564.  
  565.  
  566.  
  567.  
  568.  
  569. Miller                                                          [Page 7]
  570.  
  571.  
  572.  
  573. RFC 938                                                    February 1985
  574. Internet Reliable Transaction Protocol
  575.  
  576.  
  577.       4.3.2 Response to SYNCH ACK Packet -
  578.  
  579.          On receipt of a SYNCH ACK packet, the behavior of the recipient
  580.          depends on its state.  If the recipient is in synch_wait state
  581.          the recipient sets rcv_nxt to the sequence number value, sets
  582.          snd_nxt and snd_una to the value in the two-octet data field,
  583.          and enters data_transfer state (conn_state = 2).  Otherwise,
  584.          the packet is ignored.
  585.  
  586.             0      7 8     15 16             31
  587.             +--------+--------+--------+--------+
  588.             |00000000|00000000|00000000 00000000|
  589.             +--------+--------+--------+--------+
  590.             |        8        |    checksum     |
  591.             +-----------------+-----------------+
  592.  
  593.             Figure 4-1.  SYNCH Packet Format
  594.  
  595.             0      7 8     15 16             31
  596.             +--------+--------+--------+--------+
  597.             |00000001| unused |     snd_una     |
  598.             +--------+--------+--------+--------+
  599.             |        10       |    checksum     |
  600.             +-----------------+-----------------+
  601.             |      rcv_nxt    |
  602.             +-----------------+
  603.  
  604.             Figure 4-2.  SYNCH ACK Packet Format
  605.  
  606.    4.4 Transmitting Data
  607.  
  608.       Once in data_transfer state DATA, DATA ACK and PORT NAK packets
  609.       are used to achieve communication between IRTP processes, subject
  610.       to the constraint that no more than MAXPACK unacknowledged packets
  611.       may be transmitted on a connection at any time.  Note that all
  612.       arithmetic operations and comparisons on sequence numbers
  613.       described in this chapter are to be done modulo 2 to the 16.
  614.  
  615.       4.4.1 Receiving Data From Using Processes -
  616.  
  617.          User processes may request IRTP to send packets of at most 512
  618.          user data octets to a remote internet address and IRTP port.
  619.          When such a request is received, the behavior of the IRTP
  620.          depends on the state of the connection with the remote host and
  621.          on implementation dependent considerations.  If the connection
  622.  
  623.  
  624.  
  625.  
  626. Miller                                                          [Page 8]
  627.  
  628.  
  629.  
  630. RFC 938                                                    February 1985
  631. Internet Reliable Transaction Protocol
  632.  
  633.  
  634.          between this IRTP module and the remote host is not in
  635.          data_transfer state, that state must be achieved (see Section
  636.          4.3) before acting on the user request.
  637.  
  638.          Once the connection is in data_transfer state, the behavior of
  639.          the IRTP module in reaction to a write request from a user is
  640.          implementation dependent.  The simplest IRTP implementations
  641.          will not accept write requests when MAXPACK unacknowledged
  642.          packets have been sent to the remote connection and will
  643.          provide interested users a mechanism by which they can be
  644.          notified when the connection is no longer in this state, which
  645.          is called flow controlled.  Such implementations are called
  646.          blocking IRTP implementations.  These implementations check, on
  647.          receipt of a write request, to see if the value of snd_nxt is
  648.          less than snd_una+MAXPACK.  If it is, IRTP prepends a DATA
  649.          packet header as shown below, and transmits the packet.  The
  650.          value of snd_nxt is then incremented by one.  In addition, the
  651.          packet must be retained in a retransmission queue until it is
  652.          acknowledged.
  653.  
  654.             0       7 8     15 16             31
  655.             +--------+--------+--------+--------+
  656.             |00000010|port num|     snd_nxt     |
  657.             +--------+--------+--------+--------+
  658.             |     length      |    checksum     |
  659.             +-----------------+-----------------+
  660.             |           data octet(s)           |
  661.             + . . . . . . . . . . . . . . . . . +
  662.  
  663.             Figure 4-3.  DATA Packet Format
  664.  
  665.          Other implementations may allow (some number of) write requests
  666.          to be accepted even when the connection is flow controlled.
  667.          These implementations, called non-blocking IRTP
  668.          implementations, must maintain, in addition to the
  669.          retransmission queue for each connection, a queue of accepted
  670.          but not yet transmitted packets, in order of request.  This is
  671.          called the pretransmission queue for the connection.
  672.  
  673.          When a non-blocking implementation receives a write request, if
  674.          the connection is not flow controlled, it behaves exactly as a
  675.          blocking IRTP.  Otherwise, it prepends a DATA packet header
  676.          without a sequence number to the data, and appends the packet
  677.          to the pretransmission queue.  Note that in this case, snd_nxt
  678.          is not incremented.  The value of snd_nxt is incremented only
  679.          when a packet is transmitted for the first time.
  680.  
  681.  
  682.  
  683. Miller                                                          [Page 9]
  684.  
  685.  
  686.  
  687. RFC 938                                                    February 1985
  688. Internet Reliable Transaction Protocol
  689.  
  690.  
  691.       4.4.2 Packet Retransmission -
  692.  
  693.          The IRTP protocol requires that the transaction packet with
  694.          sequence number snd_una be periodically retransmitted as long
  695.          as there are any unacknowledged, but previously transmitted,
  696.          packets (that is, as long as the value of snd_una is not equal
  697.          to that of snd_nxt.)
  698.  
  699.          The value of snd_una increases over time due to the receipt of
  700.          DATA ACK or PORT NAK packets from a remote host (see Sections
  701.          4.5.3 and 4.5.4 below).  When either of these packet types is
  702.          received, if the incoming sequence number in that packet is
  703.          greater than the current value of snd_una, the value of snd_una
  704.          is set to the incoming sequence number in that packet.  Any
  705.          DATA packets with sequence number less than the new snd_una
  706.          which were queued for retransmission are released.
  707.  
  708.          (If this is a non-blocking IRTP implementation, for each DATA
  709.          packet which is thus released from the retransmission queue,
  710.          the earliest buffered packet may be transmitted from the
  711.          pretransmission queue, as long as the pretransmission queue is
  712.          non-empty.  Prior to transmitting the packet, the current value
  713.          of snd_nxt is put in the sequence number field of the header.
  714.          The value of snd_nxt is then incremented by one.)
  715.  
  716.          Finally, if the acknowledgment is a PORT NAK, the user process
  717.          with the nacked port number should be notified that the remote
  718.          port is not there.
  719.  
  720.          It is also to be desired, though it is not required, that IRTP
  721.          modules have some mechanism to decide that a remote host is not
  722.          responding in order to notify user processes that this host is
  723.          apparently unreachable.
  724.  
  725.    4.5 Receiving Data
  726.  
  727.       When an IRTP module in data_transfer state receives a DATA packet,
  728.       its behavior depends on the port number, sequence number and
  729.       implementation dependent space considerations.
  730.  
  731.       DATA ACK and PORT NAK packets are used to acknowledge the receipt
  732.       of DATA packets.  Both of these acknowledgment packets acknowledge
  733.       the receipt of all sequence numbers up to, but not including, the
  734.       sequence number in their headers.  Note that this value is denoted
  735.       "rcv_nxt" in the figures below.  This number is the value of
  736.       rcv_nxt at the source of the acknowledgment packet when the
  737.       acknowledgment was generated.
  738.  
  739.  
  740. Miller                                                         [Page 10]
  741.  
  742.  
  743.  
  744. RFC 938                                                    February 1985
  745. Internet Reliable Transaction Protocol
  746.  
  747.  
  748.          0      7 8     15 16             31
  749.          +--------+--------+--------+--------+
  750.          |00000011|port num|     rcv_nxt     |
  751.          +--------+--------+--------+--------+
  752.          |        8        |    checksum     |
  753.          +-----------------+-----------------+
  754.  
  755.          Figure 4-4.  DATA ACK Packet Format
  756.  
  757.          0      7 8     15 16             31
  758.          +--------+--------+--------+--------+
  759.          |00000100|port num|     rcv_nxt     |
  760.          +--------+--------+--------+--------+
  761.          |        8        |    checksum     |
  762.          +-----------------+-----------------+
  763.  
  764.          Figure 4-5.  PORT NAK Packet Format
  765.  
  766.       It is not required that a receiving IRTP implementation return an
  767.       acknowledgment packet for every incoming DATA packet, nor is it
  768.       required that the acknowledged sequence number be that in the most
  769.       recently received packet.  The exact circumstances under which
  770.       DATA ACK and PORT NAK packets are sent are detailed below.  The
  771.       net effect is that every sequence number is acknowledged, a sender
  772.       can force reacknowledgment if an ACK is lost, all acknowledgments
  773.       are cumulative, and no out of order acknowledgments are permitted.
  774.  
  775.       4.5.1 Receive and Acknowledgment Windows -
  776.  
  777.          Each IRTP module has two windows associated with the receive
  778.          side of a connection.  For convenience in the following
  779.          discussion these are given names.  The sequence number window
  780.  
  781.          rcv_nxt-MAXPACK =< sequence number < rcv_nxt
  782.  
  783.          is called the acknowledge window.  All sequence numbers within
  784.          this window represent packets which have previously been acked
  785.          or nacked, however, the ack or nack may have been lost in the
  786.          network.
  787.  
  788.          The sequence number window
  789.  
  790.          rcv_nxt =< sequence number < rcv_nxt+MYRCV =< rcv_nxt+MAXPACK
  791.  
  792.          is called the receive window.  All sequence numbers within this
  793.          window represent legal packets which may be in transit,
  794.          assuming that the remote host has received acks for all packets
  795.  
  796.  
  797. Miller                                                         [Page 11]
  798.  
  799.  
  800.  
  801. RFC 938                                                    February 1985
  802. Internet Reliable Transaction Protocol
  803.  
  804.  
  805.          in the acknowledge window.  The value of MYRCV depends on the
  806.          implementation of the IRTP.  In the simplest case this number
  807.          will be one, effectively meaning that the IRTP will ignore any
  808.          incoming packets not in the acknowledge window or not equal to
  809.          rcv_nxt.  If the IRTP has enough memory to buffer some incoming
  810.          out-of-order packets, MYRCV can be set to some number =<
  811.          MAXPACK and a more complex algorithm can be used to compute
  812.          rcv_nxt, thereby achieving potentially greater efficiency.
  813.          Note that in the latter case, these packets are not
  814.          acknowledged until their sequence number is less than rcv_nxt,
  815.          thereby insuring that acknowledgments are always cumulative.
  816.          (See 4.5.4 below.)
  817.  
  818.       4.5.2 Invalid Packets -
  819.  
  820.          When an IRTP receives a DATA packet, it first checks the
  821.          sequence number in the received packet.  If the sequence number
  822.          is not within the acknowledge or receive window, the packet is
  823.          discarded.  Similarly, if the computed checksum does not match
  824.          that in the header, the packet is discarded.  No further action
  825.          is taken.
  826.  
  827.       4.5.3 Sequence Numbers Within Acknowledge Window -
  828.  
  829.          When an IRTP receives an incoming DATA packet whose sequence
  830.          number is within the acknowledge window, if the port specified
  831.          in the incoming DATA packet is known to this IRTP, a DATA ACK
  832.          packet is returned.  Otherwise, a PORT NAK is returned.
  833.  
  834.          In both cases, the value put in the sequence number field of
  835.          the acknowlegement packet is the current value of rcv_nxt at
  836.          the IRTP module which is acknowledging the DATA packet.  The
  837.          DATA packet itself is discarded.
  838.  
  839.          (Note that the PORT NAK acknowledges reception of all packet
  840.          numbers up to rcv_nxt.  It NAKs the port number, not the
  841.          sequence number.)
  842.  
  843.       4.5.4 Sequence Numbers Within the Receive Window -
  844.  
  845.          If the received sequence number is within the receive window,
  846.          rcv_nxt is recomputed.  How this is done is implementation
  847.          dependent.  If MYRCV is one, then rcv_nxt is simply
  848.          incremented.  Otherwise, rcv_nxt is set to the lowest sequence
  849.          number such that all data packets with sequence numbers less
  850.  
  851.  
  852.  
  853.  
  854. Miller                                                         [Page 12]
  855.  
  856.  
  857.  
  858. RFC 938                                                    February 1985
  859. Internet Reliable Transaction Protocol
  860.  
  861.  
  862.          than this number have been received and are buffered at the
  863.          receiving IRTP, or have been delivered to their destination
  864.          port.
  865.  
  866.          Once rcv_nxt has been recomputed, a DATA ACK or PORT NAK is
  867.          returned, depending on whether the port number is known or not
  868.          known.  The value placed in the sequence number field is the
  869.          newly computed value for rcv_nxt.
  870.  
  871.       4.5.5 Forwarding Data to Using Processes -
  872.  
  873.          Whenever an incoming DATA packet has been acknowledged (either
  874.          implicitly or explicitly) its header can be stripped off and it
  875.          can be queued for delivery to the user process which has
  876.          claimed its port number.  If the IRTP implementation allows
  877.          MYRCV to be greater than one, care must be taken that data
  878.          which was originally received out of order is forwarded to its
  879.          intended recipient in order of original sequence number.
  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.  
  905.  
  906.  
  907.  
  908.  
  909.  
  910.  
  911. Miller                                                         [Page 13]
  912.  
  913.  
  914.  
  915. RFC 938                                                    February 1985
  916. Internet Reliable Transaction Protocol
  917.  
  918.  
  919. CHAPTER 5 - IMPLEMENTATION ISSUES
  920.  
  921.    The preceding chapter was left intentionally vague in certain ways.
  922.    In particular, no explicit description of the use of a timer or
  923.    timers within an IRTP module was given, nor was there a description
  924.    of how timer events should relate to "retransmission events".  This
  925.    was done to separate the syntactic and operational requirements of
  926.    the protocol from the performance characteristics of its
  927.    implementation.
  928.  
  929.    It is believed that the protocol is robust.  That is, any
  930.    implementation which strictly conforms to Chapter 4 should provide
  931.    reliable synchronization of two hosts and reliable sequenced transfer
  932.    of transaction data between them.  However, different ways of
  933.    defining the notion of a retransmission event can have potentially
  934.    significant impact on the performance of the protocol in terms of
  935.    throughput and in terms of the load it places on the network.  It is
  936.    up to the implementor to take into account overall requirements of
  937.    the network environment and the intended use of the protocol, if
  938.    possible, to optimize overall characteristics of the implementation.
  939.    Several such issues will be discussed in this chapter.
  940.  
  941.    5.1 Retransmission Strategies
  942.  
  943.       The IRTP requires that a timer mechanism exists to somehow trigger
  944.       retransmissions and requires that the packet with sequence number
  945.       snd_una be the one retransmitted.  It is not required that
  946.       retransmission be performed on every timer event, though this is
  947.       one "retransmission strategy".  A possible alternative strategy is
  948.       to perform a retransmission on a timer event only if no ACKs have
  949.       been received since the last event.
  950.  
  951.       Additionally, the interval of the timer can affect the performance
  952.       of the strategies, as can the value of MYRCV and the lossiness of
  953.       the network environment.
  954.  
  955.       It is not within the scope of this document to recommend a
  956.       retransmission strategy, only to point out that different
  957.       strategies have different consequences.  It might be desirable to
  958.       allow using processes to "specify" a strategy when a port is
  959.       claimed in order to tailor the service of the protocol to the
  960.       needs of a particular application.
  961.  
  962.    5.2 Pinging
  963.  
  964.       It is important to make explicit that IRTP modules ping by
  965.       definition.  That is, as long as a remote internet address is
  966.  
  967.  
  968. Miller                                                         [Page 14]
  969.  
  970.  
  971.  
  972. RFC 938                                                    February 1985
  973. Internet Reliable Transaction Protocol
  974.  
  975.  
  976.       known, and is in use (that is, either synchronization or data
  977.       transfer is being attempted), the protocol requires "periodic
  978.       retransmission" of packets.  Note that this is true even if the
  979.       IRTP module has determined that the remote address is currently
  980.       unreachable.
  981.  
  982.       It is suggested that this situation can be made more sensible by
  983.       adding two fields to the connection table.  These are:
  984.  
  985.       num_retries  (number of times current packet has been sent)
  986.       time_out     (current retransmission timeout)
  987.  
  988.       These fields are to be used as follows.  It is assumed that there
  989.       is some default initial value for time_out called DEFTIME, some
  990.       (relatively long) value for time_out called PINGTIME and some
  991.       value MAX_TRIES.  The exact values of these constants are
  992.       implementation dependent.  The value of DEFTIME may also be
  993.       retransmission strategy dependent.
  994.  
  995.       At the time that a connection table is initialized, num_retries is
  996.       set to zero, and time_out is set to DEFTIME.  Whenever a
  997.       retransmission event occurs (this will either be a retransmission
  998.       of a SYNCH packet or of the packet with sequence number snd_una),
  999.       num_retries is incremented by one unless it is equal to MAX_TRIES.
  1000.       If a destination is determined to be unreachable, either via an
  1001.       ICMP message or a Destination Host Dead message, num_retries is
  1002.       set to MAX_TRIES.  Whenever num_retries transitions to MAX_TRIES,
  1003.       either by being incremented or as above, the destination is is
  1004.       presumed unreachable and user processes are notified. At this
  1005.       point, time_out is set to PINGTIME, the state of the connection
  1006.       does not change and retransmissions occur at PINGTIME intervals
  1007.       until the destination becomes reachable.
  1008.  
  1009.       Conversely, whenever a SYNCH_ACK is received (in synch_wait
  1010.       state), or an (implicit or explicit) acknowledgment of sequence
  1011.       number snd_una is received (in data transfer state), time_out is
  1012.       set to DEFTIME and num_retries is reset to zero.  If time_out was
  1013.       already set to PINGTIME, user processes are notified that the
  1014.       destination is now reachable.
  1015.  
  1016.       The effect of this system is obvious.  The implementation still
  1017.       pings as required, but at presumably very infrequent intervals.
  1018.       Alternative solutions, which might place the decision to ping on
  1019.       using processes, are considered undesirable because
  1020.  
  1021.          o  IRTP itself becomes more complicated in terms of states of
  1022.             the connection table
  1023.  
  1024.  
  1025. Miller                                                         [Page 15]
  1026.  
  1027.  
  1028.  
  1029. RFC 938                                                    February 1985
  1030. Internet Reliable Transaction Protocol
  1031.  
  1032.  
  1033.          o  the user interface becomes both more complicated and more
  1034.             rigid
  1035.  
  1036.          o  such solutions might be deadlock prone in some instances
  1037.  
  1038.          o  it seems appropriate that the host to host protocol should
  1039.             be the place to determine destination reachability, if the
  1040.             overall application requires that such information be known
  1041.             (as it does in the environments intended for IRTP.)
  1042.  
  1043.    5.3 Deleting Connection Tables
  1044.  
  1045.       The protocol as defined does not allow connection tables to be
  1046.       deleted (or for a connection state to transition to out_of_synch
  1047.       from any other state).  It might be appropriate to delete a
  1048.       connection table if it is known that the destination internet
  1049.       address is no longer one which this host wants to communicate
  1050.       with.  (The only danger there is that if the destination does not
  1051.       know this, it could ping this host forever.)  It is dangerous to
  1052.       delete a connection table or to go into out_of_synch state to
  1053.       avoid pinging when a destination does not appear to be there.  Two
  1054.       hosts with the same such strategy could potentially deadlock and
  1055.       fail to resynchronize.
  1056.  
  1057. AUTHOR'S ADDRESS
  1058.  
  1059.    Trudy Miller
  1060.    Advanced Computer Communications
  1061.    720 Santa Barbara Street
  1062.    Santa Barbara, CA  93101
  1063.    (805) 963-9431
  1064.  
  1065.  
  1066.  
  1067.  
  1068.  
  1069.  
  1070.  
  1071.  
  1072.  
  1073.  
  1074.  
  1075.  
  1076.  
  1077.  
  1078.  
  1079.  
  1080.  
  1081.  
  1082. Miller                                                         [Page 16]
  1083.  
  1084.