Movatterモバイル変換


[0]ホーム

URL:


[RFC Home] [TEXT|PDF|HTML] [Tracker] [IPR] [Info page]

EXPERIMENTAL
Network Working Group                                     David CheritonRequest for Comments:  1045                          Stanford University                                                           February 1988VMTP: VERSATILE MESSAGE TRANSACTION PROTOCOLProtocol SpecificationSTATUS OF THIS MEMOThis RFC describes a protocol proposed as a standard for the Internetcommunity.  Comments are encouraged.  Distribution of this document isunlimited.OVERVIEWThis memo specifies the Versatile Message Transaction Protocol (VMTP)[Version 0.7 of 19-Feb-88], a transport protocol specifically designedto support the transaction model of communication, as exemplified byremote procedure call (RPC).  The full function of VMTP, includingsupport for security, real-time, asynchronous message exchanges,streaming, multicast and idempotency, provides a rich selection to theVMTP user level.  Subsettability allows the VMTP module for particularclients and servers to be specialized and simplified to the servicesactually required.  Examples of such simple clients and servers includePROM network bootload programs, network boot servers, data sensors andsimple controllers, to mention but a few examples.

RFC 1045                       VMTP                        February 1988                           Table of Contents1. Introduction                                                      1   1.1. Motivation                                                     2       1.1.1. Poor RPC Performance                                     2       1.1.2. Weak Naming                                              3       1.1.3. Function Poor                                            3   1.2. Relation to Other Protocols                                    4   1.3. Document Overview                                              52. Protocol Overview                                                 6   2.1. Entities, Processes and Principals                             7   2.2. Entity Domains                                                 9   2.3. Message Transactions                                          10   2.4. Request and Response Messages                                 11   2.5. Reliability                                                   12       2.5.1. Transaction Identifiers                                 13       2.5.2. Checksum                                                14       2.5.3. Request and Response Acknowledgment                     14       2.5.4. Retransmissions                                         15       2.5.5. Timeouts                                                15       2.5.6. Rate Control                                            18   2.6. Security                                                      19   2.7. Multicast                                                     21   2.8. Real-time Communication                                       22   2.9. Forwarded Message Transactions                                24   2.10. VMTP Management                                              25   2.11. Streamed Message Transactions                                25   2.12. Fault-Tolerant Applications                                  28   2.13. Packet Groups                                                29   2.14. Runs of Packet Groups                                        31   2.15. Byte Order                                                   32   2.16. Minimal VMTP Implementation                                  33   2.17. Message vs. Procedural Request Handling                      33   2.18. Bibliography                                                 343. VMTP Packet Formats                                              37   3.1. Entity Identifier Format                                      37   3.2. Packet Fields                                                 38Cheriton                                                        [page i]

RFC 1045                       VMTP                        February 1988   3.3. Request Packet                                                45   3.4. Response Packet                                               474. Client Protocol Operation                                        49   4.1. Client State Record Fields                                    49   4.2. Client Protocol States                                        51   4.3. State Transition Diagrams                                     51   4.4. User Interface                                                52   4.5. Event Processing                                              53   4.6. Client User-invoked Events                                    54       4.6.1. Send                                                    54       4.6.2. GetResponse                                             56   4.7. Packet Arrival                                                56       4.7.1. Response                                                58   4.8. Management Operations                                         61       4.8.1. HandleNoCSR                                             62   4.9. Timeouts                                                      645. Server Protocol Operation                                        66   5.1. Remote Client State Record Fields                             66   5.2. Remote Client Protocol States                                 66   5.3. State Transition Diagrams                                     67   5.4. User Interface                                                69   5.5. Event Processing                                              70   5.6. Server User-invoked Events                                    71       5.6.1. Receive                                                 71       5.6.2. Respond                                                 72       5.6.3. Forward                                                 73       5.6.4. Other Functions                                         74   5.7. Request Packet Arrival                                        74   5.8. Management Operations                                         78       5.8.1. HandleRequestNoCSR                                      79   5.9. Timeouts                                                      826. Concluding Remarks                                               84I. Standard VMTP Response Codes                                       85II. VMTP RPC Presentation Protocol                                    87Cheriton                                                       [page ii]

RFC 1045                       VMTP                        February 1988   II.1. Request Code Management                                      87III. VMTP Management Procedures                                       89   III.1. Entity Group Management                                    100   III.2. VMTP Management Digital Signatures                         101IV. VMTP Entity Identifier Domains                                   102   IV.1. Domain 1                                                    102   IV.2. Domain 3                                                    104   IV.3. Other Domains                                               105   IV.4. Decentralized Entity Identifier Allocation                  105V. Authentication Domains                                            107   V.1. Authentication Domain 1                                      107   V.2. Other Authentication Domains                                 107VI. IP Implementation                                                108VII. Implementation Notes                                            109   VII.1. Mapping Data Structures                                    109   VII.2. Client Data Structures                                     111   VII.3. Server Data Structures                                     111   VII.4. Packet Group transmission                                  112   VII.5. VMTP Management Module                                     113   VII.6. Timeout Handling                                           114   VII.7. Timeout Values                                             114   VII.8. Packet Reception                                           115   VII.9. Streaming                                                  116   VII.10. Implementation Experience                                 117VIII. UNIX 4.3 BSD Kernel Interface for VMTP                         118Index                                                                120Cheriton                                                      [page iii]

RFC 1045                       VMTP                        February 1988                            List of Figures   Figure 1-1:   Relation to Other Protocols                           4   Figure 3-1:   Request Packet Format                                45   Figure 3-2:   Response Packet Format                               47   Figure 4-1:   Client State Transitions                             52   Figure 5-1:   Remote Client State Transitions                      68   Figure III-1:   Authenticator Format                               92   Figure VII-1:   Mapping Client Identifier to CSR                  109   Figure VII-2:   Mapping Server Identifiers                        110   Figure VII-3:   Mapping Group Identifiers                         111Cheriton                                                       [page iv]

RFC 1045                       VMTP                        February 19881. IntroductionThe Versatile Message Transaction Protocol (VMTP) is a transportprotocol designed to support remote procedure call (RPC) and generaltransaction-oriented communication.  By transaction-orientedcommunication, we mean that:   - Communication is request-response:  A client sends a request     for a service to a server, the request is processed, and the     server responds.  For example, a client may ask for the next     page of a file as the service.  The transaction is terminated     by the server responding with the next page.   - A transaction is initiated as part of sending a request to a     server and terminated by the server responding.  There are no     separate operations for setting up or terminating associations     between clients and servers at the transport level.   - The server is free to discard communication state about a     client between transactions without causing incorrect behavior     or failures.The term message transaction (or transaction) is used in the reminder ofthis document for a request-response exchange in the sense describedabove.VMTP handles the error detection, retransmission, duplicate suppressionand, optionally, security required for transport-level end-to-endreliability.The protocol is designed to provide a range of behaviors within thetransaction model, including:   - Minimal two packet exchanges for short, simple transactions.   - Streaming of multi-packet requests and responses for efficient     data transfer.   - Datagram and multicast communication as an extension of the     transaction model.Example Uses:   - Page-level file access - VMTP is intended as the transport     level for file access, allowing simple, efficient operation on     a local network.  In particular, VMTP is appropriate for use     by diskless workstations accessing shared network fileCheriton                                                        [page 1]

RFC 1045                       VMTP                        February 1988     servers.   - Distributed programming - VMTP is intended to provide an     efficient transport level protocol for remote procedure call     implementations, distributed object-oriented systems plus     message-based systems that conform to the request-response     model.   - Multicast communication with groups of servers to:  locate a     specific object within the group, update a replicated object,     synchronize the commitment of a distributed transaction, etc.   - Distributed real-time control with prioritized message     handling, including datagrams, multicast and asynchronous     calls.The protocol is designed to operate on top of a simple unreliabledatagram service, such as is provided by IP.1.1. MotivationVMTP was designed to address three categories of deficiencies withexisting transport protocols in the Internet architecture.  We use TCPas the key current transport protocol for comparison.1.1.1. Poor RPC PerformanceFirst, current protocols provide poor performance for remote procedurecall (RPC) and network file access.  This is attributable to three keycauses:   - TCP requires excessive packets for RPC, especially for     isolated calls.  In particular, connection setup and clear     generates extra packets over that needed for VMTP to support     RPC.   - TCP is difficult to implement, speaking purely from the     empirical experience over the last 10 years.  VMTP was     designed concurrently with its implementation, with focus on     making it easy to implement and providing sensible subsets of     its functionality.   - TCP handles packet loss due to overruns poorly.  We claim that     overruns are the key source of packet loss in a     high-performance RPC environment and, with the increasingCheriton                                                        [page 2]

RFC 1045                       VMTP                        February 1988     performance of networks, will continue to be the key source.     (Older machines and network interfaces cannot keep up with new     machines and network interfaces.  Also, low-end network     interfaces for high-speed networks have limited receive     buffering.)VMTP is designed for ease of implementation and efficient RPC.  Inaddition, it provides selective retransmission with rate-based flowcontrol, thus addressing all of the above issues.1.1.2. Weak NamingSecond, current protocols provide inadequate naming of transport-levelendpoints because the names are based on IP addresses.  For example, aTCP endpoint is named by an Internet address and port identifier.Unfortunately, this makes the endpoint tied to a particular hostinterface, not specifically the process-level state associated with thetransport-level endpoint.  In particular, this form of naming causesproblems for process migration, mobile hosts and multi-homed hosts.VMTP provides host-address independent names, thereby solving the abovementioned problems.In addition, TCP provides no security and reliability guarantees on thedynamically allocated names.  In particular, other than well-knownports, (host-addr, port-id)-tuples can change meaning on rebootfollowing a crash.  VMTP provides large identifiers with guarantee ofstability, meaning that either the identifier never changes in meaningor else remains invalid for a significant time before becoming validagain.1.1.3. Function PoorTCP does not support multicast, real-time datagrams or security.  Infact, it only supports pair-wise, long-term, streamed reliableinterchanges.  Yet, multicast is of growing importance and is beingdeveloped for the Internet (seeRFC 966 and 988).  Also, a datagramfacility with the same naming, transmission and reception facilities asthe normal transport level is a powerful asset for real-time andparallel applications.  Finally, security is a basic requirement in anincreasing number of environments.  We note that security is natural toimplement at the transport level to provide end-to-end security (asopposed to (inter)network level security).  Without security at thetransport level, a transport level protocol cannot guarantee thestandard transport level service definition in the presence of anintruder.  In particular, the intruder can interject packets or modifyCheriton                                                        [page 3]

RFC 1045                       VMTP                        February 1988packets while updating the checksum, making mockery out of thetransport-level claim of "reliable delivery".In contrast, VMTP provides multicast, real-time datagrams and security,addressing precisely these weaknesses.In general, VMTP is designed with the next generation of communicationsystems in mind.  These communication systems are characterized asfollows.  RPC, page-level file access and other request-responsebehavior dominates.  In addition, the communication substrate, bothlocal and wide-area, provides high data rates, low error rates andrelatively low delay.  Finally, intelligent, high-performance networkinterfaces are common and in fact required to achieve performance thatapproximates the network capability.  However, VMTP is also designed tofunction acceptably with existing networks and network interfaces.1.2. Relation to Other ProtocolsVMTP is a transport protocol that fits into the layered Internetprotocol environment.  Figure 1-1 illustrates the place of VMTP in theprotocol hierarchy. +-----------+ +----+ +-----------------+ +------+ |File Access| |Time| |Program Execution| |Naming|... Application +-----------+ +----+ +-----------------+ +------+      Layer       |           |           |             |      |       +-----------+-----------+-------------+------+                               |                        +------------------+                        | RPC Presentation |          Presentation                        +------------------+          Layer                                  |            +------+          +--------+            |  TCP |          | VMTP   |              Transport            +------+          +--------+              Layer                |                  |           +-----------------------------------+           |       Internet Protocol & ICMP    |      Internetwork           +-----------------------------------+      Layer               Figure 1-1:   Relation to Other ProtocolsThe RPC presentation level is not currently defined in the Internetsuite of protocols.Appendix II defines a proposed RPC presentationlevel for use with VMTP and assumed for the definition of the VMTPmanagement procedures.  There is also a need for the definition of theCheriton                                                        [page 4]

RFC 1045                       VMTP                        February 1988Application layer protocols listed above.If internetwork services are not required, VMTP can be used without theIP layer, layered directly on top of the network or data link layers.1.3. Document OverviewThe next chapter gives an overview of the protocol, covering naming,message structure, reliability, flow control, streaming, real-time,security, byte-ordering and management.  Chapter 3 describes the VMTPpacket formats.  Chapter 4 describes the client VMTP protocol operationin terms of pseudo-code for event handling.  Chapter 5 describes theserver VMTP protocol operation in terms of pseudo-code for eventhandling.  Chapter 6 summarizes the state of the protocol, someremaining issues and expected directions for the future.Appendix Ilists some standard Response codes.Appendix II describes the RPCpresentation protocol proposed for VMTP and used with the VMTPmanagement procedures.Appendix III lists the VMTP managementprocedures.Appendix IV proposes initial approaches for handling entityidentification for VMTP.Appendix V proposes initial authenticationdomains for VMTP.Appendix VI provides some details for implementingVMTP on top of IP.Appendix VII provides some suggestions on hostimplementation of VMTP, focusing on data structures and supportfunctions.Appendix VIII describes a proposed program interface forUNIX 4.3 BSD and its descendants and related systems.Cheriton                                                        [page 5]

RFC 1045                       VMTP                        February 19882. Protocol OverviewVMTP provides an efficient, reliable, optionally secure transportservice in the message transaction or request-response model with thefollowing features:   - Host address-independent naming with provision for multiple     forms of names for endpoints as well as associated (security)     principals.  (See Sections2.1,2.2,3.1 andAppendix IV.)   - Multi-packet request and response messages, with a maximum     size of 4 megaoctets per message.  (Sections2.3 and2.14.)   - Selective retransmission. (Section 2.13.)  and rate-based flow     control to reduce overrun and the cost of overruns.  (Section2.5.6.)   - Secure message transactions with provision for a variety of     encryption schemes.  (Section 2.6.)   - Multicast message transactions with multiple response messages     per request message.  (Section 2.7.)   - Support for real-time communication with idempotent message     transactions with minimal server overhead and state (Section2.5.3), datagram request message transactions with no     response, optional header-only checksum, priority processing     of transactions, conditional delivery and preemptive handling     of requests (Section 2.8)   - Forwarded message transactions as an optimization for certain     forms of nested remote procedure calls or message     transactions.  (Section 2.9.)   - Multiple outstanding (asynchronous) message transactions per     client.  (Section 2.11.)   - An integrated management module, defined with a remote     procedure call interface on top of VMTP providing a variety of     communication services (Section 2.10.)   - Simple subset implementation for simple clients and simple     servers.  (Section 2.16.)This chapter provides an overview of the protocol as introduction to thebasic ideas and as preparation for the subsequent chapters that describethe packet formats and event processing procedures in detail.Cheriton                                                        [page 6]

RFC 1045                       VMTP                        February 1988In overview, VMTP provides transport communication between network-visible entities via message transactions.  A message transactionconsists of a request message sent by the client, or requestor, to agroup of server entities followed by zero or more response messages tothe client, at most one from each server entity.  A message isstructured as a message control portion and a segment data portion.  Amessage is transmitted as one or more packet groups.  A packet group  isone or more packets (up to a maximum of 32 packets) grouped by theprotocol for acknowledgment, sequencing, selective retransmission andrate control.Entities and VMTP operations are managed using a VMTP managementmechanism that is accessed through a procedural interface (RPC)implemented on top of VMTP.  In particular, information about a remoteentity is obtained and maintained using the Probe VMTP managementoperation.  Also, acknowledgment information and requests forretransmission are sent as notify requests to the management module.(In the following description, reference to an "acknowledgment" of arequest or a response refers to a management-level notify operation thatis acknowledging the request or response.)2.1. Entities, Processes and PrincipalsVMTP defines and uses three main types of identifiers:  entityidentifiers, process identifiers and principal identifiers, each 64-bitsin length.  Communication takes place between network-visible entities,typically mapping to, or representing, a message port or procedureinvocation.  Thus, entities are the VMTP communication endpoints.  Theprocess associated with each entity designates the agent behind thecommunication activity for purposes of resource allocation andmanagement.  For example, when a lock is requested on a file, the lockis associated with the process, not the requesting entity, allowing aprocess to use multiple entity identifiers to perform operations withoutlock conflict between these entities.  The principal associated with anentity specifies the permissions, security and accounting designationassociated with the entity.  The process and principal identifiers areincluded in VMTP solely to make these values available to VMTP userswith the security and efficiency provided by VMTP.  Only the entityidentifiers are actively used by the protocol.Entity identifiers are required to have three properties;Uniqueness      Each entity identifier is uniquely defined at any given                time.  (An entity identifier may be reused over time.)Stability       An entity identifier does not change between validCheriton                                                        [page 7]

RFC 1045                       VMTP                        February 1988                meanings without suitable provision for removing                references to the entity identifier.  Certain entity                identifiers are strictly stable, (i.e. never changing                meaning), typically being administratively assigned                (although they need not be bound to a valid entity at                all times), often called well-known identifiers.  All                other entity identifiers are required to be T-stable,                not change meaning without having remained invalid for                at least a time interval T.Host address independent                An entity identifier is unique independent of the host                address of its current host.  Moreover, an entity                identifier is not tied to a single Internet host                address.  An entity can migrate between hosts, reside on                a mobile host that changes Internet addresses or reside                on a multi-homed host.  It is up to the VMTP                implementation to determine and maintain up to date the                host addresses of entities with which it is                communicating.The stability of entity identifiers guarantees that an entity identifierrepresents the same logical communication entity and principal (in thesecurity sense) over the time that it is valid.  For example, if anentity identifier is authenticated as having the privileges of a givenuser account, it continues to have those privileges as long as it iscontinuously valid (unless some explicit notice is provided otherwise).Thus, a file server need not fully authenticate the entity on every fileaccess request.  With T-stable identifiers, periodically checking thevalidity of an entity identifier with period less than T seconds detectsa change in entity identifier validity.A group of entities can form an entity group, which is a set of zero ormore entities identified by a single entity identifier.  For example,one can have a single entity identifier that identifies the group ofname servers.  An entity identifier representing an entity group isdrawn from the same name space as entity identifiers.  However, singleentity identifiers are flagged as such by a bit in the entityidentifier, indicating that the identifier is known to identify at mostone entity.  In addition to the group bit, each entity identifierincludes other standard type flags.  One flag indicates whether theidentifier is an alias for an entity in another domain (SeeSection 2.2below.).  Another flag indicates, for an entity group identifier,whether the identifier is a restricted group or not.  A restricted groupis one in which an entity can be added only by another entity with groupmanagement authorization.  With an unrestricted group, an entity isallowed to add itself.  If an entity identifier does not represent aCheriton                                                        [page 8]

RFC 1045                       VMTP                        February 1988group, a type bit indicates whether the entity uses big-endian orlittle-endian data representation (corresponding to Motorola 680X0 andVAX byte orders, respectively).  Further specification of the format ofentity identifiers is contained inSection 3.1 andAppendix IV.An entity identifier identifies a Client, a Server or a group ofServers <1>.  A Client is always identified by a T-stable identifier.  Aserver or group of servers may be identified by a a T-stable identifier(group or single entity) or by strictly stable (statically assigned)entity group identifier.  The same T-stable identifier can be used toidentify a Client and Server simultaneously as long as both arelogically associated with the same entity.  The state required forreliable, secure communication between entities is maintained in clientstate records (CSRs), which include the entity identifier of the Client,its principal, its current or next transaction identifier and so on.2.2. Entity DomainsAn entity domain is an administration or an administration mechanismthat guarantees the three required entity identifier properties ofuniqueness, stability and host address independence for the entities itadministers.  That is, entity identifiers are only guaranteed to beunique and stable within one entity domain.  For example, the set of allInternet hosts may function as one domain.  Independently, the set ofhosts local to one autonomous network may function as a separate domain.Each entity domain is identified by an entity domain identifier, Domain.Only entities within the same domain may communicate directly via VMTP.However, hosts and entities may participate in multiple entity domainssimultaneously, possibly with different entity identifiers.  Forexample, a file server may participate in multiple entity domains inorder to provide file service to each domain.  Each entity domainspecifies the algorithms for allocation, interpretation and mapping ofentity identifiers.Domains are necessary because it does not appear feasible to specify oneuniversal VMTP entity identification administration that covers allentities for all time.  Domains limit the number of entities that needto be managed to maintain the uniqueness and stability of the entity_______________<1>   Terms such as Client, Server, Request, Response, etc.  arecapitalized in this document when they refer to their specific meaningin VMTP.Cheriton                                                        [page 9]

RFC 1045                       VMTP                        February 1988name space.  Domains can also serve to separate entities of differentsecurity levels.  For instance, allocation of a unclassified entityidentifier cannot conflict with secret level entity identifiers becausethe former is interpreted only in the unclassified domain, which isdisjoint from the secret domain.It is intended that there be a small number of domains.  In particular,there should be one (or a few) domains per installation "type", ratherthan per installation.  For example, the Internet is expected to use onedomain per security level, resulting in at most 8 different domains.Cluster-based internetwork architectures, those with a local clusterprotocol distinct from the wide-area protocol, may use one domain forlocal use and one for wide-area use.Additional details on the specification of specific domains is providedinAppendix IV.2.3. Message TransactionsThe message transaction is the unit of interaction between a Client thatinitiates the transaction and one or more Servers.  A messagetransaction starts with a request message  generated by a client.  Atthe service interface, a server becomes involved with a transaction byreceiving and accepting the request.  A server terminates itsinvolvement with a transaction by sending a response message.  In agroup message transaction, the server entity designated by the clientcorresponds to a group of entities.  In this case, each server in thegroup receives a copy of the request.  In the client's view, thetransaction is terminated when it receives the response message or, inthe case of a group message transaction, when it receives the lastresponse message.  Because it is normally impractical to determine whenthe last response message has been received.  the current transaction isterminated by VMTP when the next transaction is initiated.Within an entity domain, a transaction is uniquely identified by thetuple (Client, Transaction, ForwardCount).  where Transaction is a32-bit number and ForwardCount is a 4-bit value.  A Client usesmonotonically increasing Transaction identifiers for new messagetransactions.  Normally, the next higher transaction number, modulo2**32, is used for the next message transaction, although there arecases in which it skips a small range of Transaction identifiers.  (Seethe description of the STI control flag.)  The ForwardCount is used whena message transaction is forwarded and is zero otherwise.A Client generates a stream of message transactions with increasingtransaction identifiers, directed at a diversity of Servers.  We say aCheriton                                                       [page 10]

RFC 1045                       VMTP                        February 1988Client has a transaction outstanding if it has invoked a messagetransaction, but has not received the last Response (or possibly anyResponse).  Normally, a Client has only one transaction outstanding at atime.  However, VMTP allows a Client to have multiple messagetransactions outstanding simultaneously, supporting streamed,asynchronous remote procedure call invocations.  In addition, VMTPsupports nested calls where, for example, procedure A calls procedure Bwhich calls procedure C, each on a separate host with different cliententity identifiers for each call but identified with the same processand principal.2.4. Request and Response MessagesA message transaction consists of a request message and one or moreResponse messages.  A message is structured as message control block(MCB) and segment data, passed as parameters, as suggested below.  +-----------------------+  | Message Control Block |  +-----------------------+  +-----------------------------------+  |       segment data                |  +-----------------------------------+In the request message, the MCB specifies control information about therequest plus an optional data segment.  The MCB has the followingformat:  0                   1                   2                   3  0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +                         ServerEntityId  (8 octets)            + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |   Flags       |         RequestCode                           | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +                         CoresidentEntity (8 octets)           + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ >                         User Data (12 octets)                 < +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |                         MsgDelivery                           | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |                         SegmentSize                           | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+The ServerEntityId is the entity to which the Request MCB is to be sent(or was sent, in the case of reception).  The Flags indicate variousoptions in the request and response handling as well as whether theCheriton                                                       [page 11]

RFC 1045                       VMTP                        February 1988CoresidentEntity, MsgDelivery and SegmentSize fields are in use.  TheRequestCode field specifies the type of Request.  It is analogous to apacket type field of the Ethernet, acting as a switch for higher-levelprotocols.  The CoresidentEntity field, if used, designates a subgroupof the ServerEntityId group to which the Request should be routed,namely those members that are co-resident with the specified entity (orentity group).  The primary intended use is to specify the manager for aparticular service that is co-resident with a particular entity, usingthe well-known entity group identifier for the service manager in theServerEntityId field and the identifier for the entity in theCoresidentEntity field.  The next 12 octets are user- orapplication-specified.The MsgDelivery field is optionally used by the RPC or user level tospecify the portions of the segment data to transmit and on reception,the portions received.  It provides the client and server with(optional) access to, and responsibility for, a simple selectivetransmission and reception facility.  For example, a client may requestretransmission of just those portions of the segment that it failed toreceive as part of the original Response.  The primary intended use isto support highly efficient multi-packet reading from a file server.Exploiting user-level selective retransmission using the MsgDeliveryfield, the file server VMTP module need not save multi-packet Responsesfor retransmission.  Retransmissions, when needed, are instead handleddirectly from the file server buffers.The SegmentSize field indicates the size of the data segment, ifpresent.  The CoresidentEntity, MsgDelivery and SegmentSize fields areusable as additional user data if they are not otherwise used.The Flags field provides a simple mechanism for the user level tocommunicate its use of VMTP options with the VMTP module as well as forVMTP modules to communicate this use among themselves.  The use of theseoptions is generally fixed for each remote procedure so that an RPCmechanism using VMTP can treat the Flags as an integral part of theRequestCode field for the purpose of demultiplexing to the correct stub.A Response message control block follows the same format except theResponse is sent from the Server to the Client and there is noCoresident Entity field (and thus 20 octets of user data).2.5. ReliabilityVMTP provides reliable, sequenced transfer of request and responsemessages as well as several variants, such as unreliable datagramrequests.  The reliability mechanisms include: transaction identifiers,Cheriton                                                       [page 12]

RFC 1045                       VMTP                        February 1988checksums, positive acknowledgment of messages and timeout andretransmission of lost packets.2.5.1. Transaction IdentifiersEach message transaction is uniquely identified by the pair (Client,Transaction).  (We defer discussion of the ForwardCount field toSection2.9.)  The 32-bit transaction identifier is initialized to a randomvalue when the Client entity is created or allocated its entityidentifier.  The transaction identifier is incremented at the end ofeach message transaction.  All Responses with the same specified(Client, Transaction) pair are associated with this Request.The transaction identifier is used for duplicate suppression at theServer.  A Server maintains a state record for each Client for which itis processing a Request, identified by (Client, Transaction).  A Requestwith the same (Client, Transaction) pair is discarded as a duplicate.(The ForwardCount field must also be equal.)  Normally, this record isretained for some period after the Response is sent, allowing the Serverto filter out subsequent duplicates of this Request.  When a Requestarrives and the Server does not have a state record for the sendingClient, the Server takes one of three actions:   1. The Server may send a Probe request, a simple query      operation, to the VMTP management module associated with the      requesting Client to determine the Client's current      Transaction identifier (and other information), initialize a      new state record from this information, and then process the      Request as above.   2. The Server may reason that the Request must be a new request      because it does not have a state record for this Client if it      keeps these state records for the maximum packet lifetime of      packets in the network (plus the maximum VMTP retransmission      time) and it has not been rebooted within this time period.      That is, if the Request is not new either the Request would      have exceeded the maximum packet lifetime or else the Server      would have a state record for the Client.   3. The Server may know that the Request is idempotent or can be      safely redone so it need not care whether the Request is a      duplicate or not.  For example, a request for the current      time can be responded to with the current time without being      concerned whether the Request is a duplicate.  The Response      is discarded at the Client if it is no longer of interest.Cheriton                                                       [page 13]

RFC 1045                       VMTP                        February 19882.5.2. ChecksumEach VMTP packet contains a checksum to allow the receiver to detectcorrupted packets independent of lower level checks.  The checksum fieldis 32 bits, providing greater protection than the standard 16-bit IPchecksum (in combination with an improved checksum algorithm).  Thelarge packets, high packet rates and general network characteristicsexpected in the future warrant a stronger checksum mechanism.The checksum normally covers both the VMTP header and the segment data.Optionally (for real-time applications), the checksum may apply only tothe packet header, as indicated by the HCO control bit being set in theheader.  The checksum field is placed at the end of the packet to allowit to be calculated as part of a software copy or as part of a hardwaretransmission or reception packet processing pipeline, as expected in thenext generation of network interfaces.  Note that the number of headerand data octets is an integral multiple of 8 because VMTP requires thatthe segment data be padded to be a multiple of 64 bits.  The checksumfield is appended after the padding, if any.  The actual algorithm isdescribed inSection 3.2.A zero checksum field indicates that no checksum was transmitted withthe packet.  VMTP may be used without a checksum only when there is ahost-to-host error detection mechanism and the VMTP security facility isnot being used.  For example, one could rely on the Ethernet CRC ifcommunication is restricted to hosts on the same Ethernet and thenetwork interfaces are considered sufficiently reliable.2.5.3. Request and Response AcknowledgmentVMTP assumes an unreliable datagram network and internetwork interface.To guarantee delivery of Requests and Response, VMTP uses positiveacknowledgments, retransmissions and timeouts.A Request is normally acknowledged by receipt of a Response associatedwith the Request, i.e. with the same (Client, Transaction).  Withstreamed message transactions, it may also be acknowledged by asubsequent Response that acknowledges previous Requests in addition tothe transaction it explicitly identifies.  A Response may be explicitlyacknowledged by a NotifyVmtpServer operation requested of the managerfor the Server.  In the case of streaming, this is a cumulativeacknowledgment, acknowledging all Responses with a lower transactionidentifier as well.)  In addition, with non-streamed communication, asubsequent Request from the same Client acknowledges Responses to allprevious message transactions (at least in the sense that either theclient received a Response or is no longer interested in Responses toCheriton                                                       [page 14]

RFC 1045                       VMTP                        February 1988those earlier message transactions).  Finally, a client response timeout(at the server) acknowledges a Response at least in the sense that theserver need not be prepared to retransmit the Response subsequently.Note that there is no end-to-end guarantee of the Response beingreceived by the client at the application level.2.5.4. RetransmissionsIn general, a Request or Response is retransmitted periodically untilacknowledged as above, up to some maximum number of retransmissions.VMTP uses parameters RequestRetries(Server) and ResponseRetries(Client)that indicate the number of retransmissions for the server and clientrespectively before giving up.  We suggest the value 5 be used for bothparameters based on our experience with VMTP and Internet packet loss.Smaller values (such as 3) could be used in low loss environments inwhich fast detection of failed hosts or communication channels isrequired.  Larger values should be used in high loss environments wheretransport-level persistence is important.In a low loss environment, a retransmission only includes the MCB andnot the segment data of the Request or Response, resulting in a single(short) packet on retransmission.  The intended recipient of theretransmission can request selective retransmission of all or part ofthe segment data as necessary.  The selective retransmission mechanismis described inSection 2.13.If a Response is specified as idempotent, the Response is neitherretransmitted nor stored for retransmission.  Instead, the Client mustretransmit the Request to effectively get the Response retransmitted.The server VMTP module responds to retransmissions of the Request bypassing the Request on to the server again to have it regenerate theResponse (by redoing the operation), rather than saving a copy of theResponse.  Only Request packets for the last transaction from thisclient are passed on in this fashion; older Request packets from thisclient are discarded as delayed duplicates.  If a Response is notidempotent, the VMTP module must ensure it has a copy of the Responsefor retransmission either by making a copy of the Response (eitherphysically or copy-on-write) or by preventing the Server from continuinguntil the Response is acknowledged.2.5.5. TimeoutsThere is one client timer for each Client with an outstandingtransaction.  Similarly, there is one server timer for each Clienttransaction that is "active" at the server, i.e. there is a transactionCheriton                                                       [page 15]

RFC 1045                       VMTP                        February 1988record for a Request from the Client.When the client transmits a new Request (without streaming), the clienttimer  is set to roughly the time expected for the Response to bereturned.  On timeout, the Request is retransmitted with the APG(Acknowledge Packet Group) bit set.  The timeout is reset to theexpected roundtrip time to the Server because an acknowledgment shouldbe returned immediately unless a Response has been sent.  The Requestmay also be retransmitted in response to receipt of a VMTP managementoperation indicating that selected portions of the Request messagesegment need to be retransmitted.  With streaming, the timeout appliesto the oldest outstanding message transaction in the run of outstandingmessage transactions.  Without streaming, there is one messagetransaction in the run, reducing to the previous situation.  After thefirst packet of a Response is received, the Client resets the timeout tobe the time expected before the next packet in the Response packet groupis received, assuming it is a multi-packet Response.  If not, the timeris stopped.  Finally, the client timer is used to timeout waiting forsecond and subsequent Responses to a multicast Request.The client timer is set at different times to four different values:TC1(Server)     The expected time required to receive a Response from                the Server.  Set on initial Request transmission plus                after its management module receives a NotifyVmtpClient                operation, acknowledging the Request.TC2(Server)     The estimated round trip delay between the client and                the server.  Set when retransmitting after receiving no                Response for TC1(Server) time and retransmitting the                Request with the APG bit set.TC3(Server)     The estimated maximum expected interpacket time for                multi-packet Responses from the Server.  Set when                waiting for subsequent Response packets within a packet                group before timing out.TC4             The time to wait for additional Responses to a group                Request after the first Response is received.  This is                specified by the user level.These values are selected as follows.  TC1 can be set to TC2 plus aconstant, reflecting the time within which most servers respond to mostrequests.  For example, various measurements of VMTP usage at Stanfordindicate that 90 percent of the servers respond in less than 200milliseconds.  Setting TC1 to TC2 + 200 means that most Requests receivea Response before timing out and also that overhead for retransmissionCheriton                                                       [page 16]

RFC 1045                       VMTP                        February 1988for long running transactions is insignificant.  A sophisticatedimplementation may make the estimation of TC1 further specific to theServer.TC2 may be estimated by measuring the time from when a Probe request issent to the Server to when a response is received.  TC2 can also bemeasured as the time between the transmission of a Request with the APGbit set to receipt of a management operation acknowledging receipt ofthe Request.When the Server is an entity group, TC1 and TC2 should be the largest ofthe values for the members of the group that are expected to respond.This information may be determined by probing the group on first use(and using the values for the last responses to arrive).  Alternatively,one can resort to default values.TC3 is set initially to 10 times the transmission time for the maximumtransmission unit (MTU) to be used for the Response.  A sophisticatedimplementation may record TC3 per Server and refine the estimate basedon measurements of actual interpacket gaps.  However, a tighter estimateof TC3 only improves the reaction time when a packet is lost in a packetgroup, at some cost in unnecessary retransmissions when the estimatebecomes overly tight.The server timer, one per active Client, takes on the following values:TS1(Client)     The estimated maximum expected interpacket time.  Set                when waiting for subsequent Request packets within a                packet group before timing out.TS2(Client)     The time to wait to hear from a client before                terminating the server processing of a Request.  This                limits the time spent processing orphan calls, as well                as limiting how out of date the server's record of the                Client state can be.  In particular, TS2 should be                significantly less than the minimum time within which it                is reasonable to reuse a transaction identifier.TS3(Client)     Estimated roundtrip time to the Client,TS4(Client)     The time to wait after sending a Response (or last                hearing from a client) before discarding the state                associated with the Request which allows it to filter                duplicate Request packets and regenerate the Response.TS5(Client)     The time to wait for an acknowledgment after sending a                Response before retransmitting the Response, or givingCheriton                                                       [page 17]

RFC 1045                       VMTP                        February 1988                up (after some number of retransmissions).TS1 is set the same as TC3.The suggested value for TS2 is TC1 + 3*TC2 for this server, giving theClient time to timeout waiting for a Response and retransmit 3 Requestpackets, asking for acknowledgments.TS3 is estimated the same as TC1 except that refinements to the estimateuse measurements of the Response-to-acknowledgment times.In the general case, TS4 is set large enough so that a Client issuing aseries of closely-spaced Requests to the same Server reuses the samestate record at the Server end and thus does not incur the overhead ofrecreating this state.  (The Server can recreate the state for a Clientby performing a Probe on the Client to get the needed information.)  Itshould also be set low enough so that the transaction identifier cannotwrap around and so that the Server does not run out of CSR's.  Wesuggest a value in the range of 500 milliseconds.  However, if theServer accepts non-idempotent Requests from this Client without doing aProbe on the Client, the TS4 value for this CSR is set to at least 4times the maximum packet lifetime.TS5 is TS3 plus the expected time for transmission and reception of theResponse.  We suggest that the latter be calculated as 3 times thetransmission time for the Response data, allowing time for reception,processing and transmission of an acknowledgment at the Client end.  Asophisticated implementation may refine this estimate further over timeby timing acknowledgments to Responses.2.5.6. Rate ControlVMTP is designed to deal with the present and future problem of packetoverruns.  We expect overruns to be the major cause of dropped packetsin the future.  A client is expected to estimate and adjust theinterpacket gap times so as to not overrun a server or intermediatenodes.  The selective retransmission mechanism allows the server toindicate that it is being overrun (or some intermediate point is beingoverrun).  For example, if the server requests retransmission of everyKth block, the client should assume overrun is taking place and increasethe interpacket gap times.  The client passes the server an indicationof the interpacket gap desired for a response.  The client may have toincrease the interval because packets are being dropped by anintermediate gateway or bridge, even though it can handle a higher rate.A conservative policy is to increase the interpacket gap whenever apacket is lost as part of a multi-packet packet group.Cheriton                                                       [page 18]

RFC 1045                       VMTP                        February 1988The provision of selective retransmission allows the rate of the clientand the server to "push up" against the maximum rate (and thus losepackets) without significant penalty.  That is, every time that packettransmission exceeds the rate of the channel or receiver, the recoverycost to retransmit the dropped packets is generally far less thanretransmitting from the first dropped packet.The interpacket gap is expressed in 1/32nd's of the MTU packettransmission time.  The minimum interpacket gap is 0 and the maximum gapthat can be described in the protocol is 8 packet times.  This places alimit on the slowest receivers that can be efficiently used on anetwork, at least those handling multi-packet Requests and Responses.This scheme also limits the granularity of adjustment.  However, thegranularity is relative to the speed of the network, as opposed to anabsolute time.  For entities on different networks of significantlydifferent speed, we assume the interconnecting gateways can bufferpackets to compensate<2>. With different network speeds and intermediarynodes subject to packet loss, a node must adjust the interpacket gapbased on packet loss.  The interpacket gap parameter may be of limiteduse.2.6. SecurityVMTP provides an (optional) secure mode that protects against the usualsecurity threats of peeking, impostoring, message tampering and replays.Secure VMTP must be used to guarantee any of the transport-levelreliability properties unless it is guaranteed that there are nointruders or agents that can modify packets and update the packetchecksums.  That is, non-secure VMTP provides no guarantees in thepresence of an intelligent intruder.The design closely follows that described by Birrell [1].  Authenticatedinformation about a remote entity, including an encryption/decryptionkey, is obtained and maintained using a VMTP management operation, theauthenticated Probe operation, which is executed as a non-secure VMTPmessage transaction.  If a server receives a secure Request for whichthe server has no entity state, it sends a Probe request to the VMTP_______________<2>   Gateways must also employ techniques to preserve or intelligentlymodify (if appropriate) the interpacket gaps.  In particular, they mustbe sure not to arbitrarily remove interpacket gaps as a result of theirforwarding of packets.Cheriton                                                       [page 19]

RFC 1045                       VMTP                        February 1988management module of the client, "challenging" it to provide anauthenticator that both authenticates the client as being associatedwith a particular principal as well as providing a key forencryption/decryption.  The principal can include a real and effectiveprincipal, as used in UNIX <3>.  Namely, the real principal is theprincipal on whose behalf the Request is being performed whereas theeffective principal is the principal of the module invoking the requestor remote procedure call.Peeking is prevented by encrypting every Request and Response packetwith a working Key that is shared between Client and Server.Impostoring and replays are detected by comparing the Transactionidentifier with that stored in the corresponding entity state record(which is created and updated by VMTP as needed).  Message tampering isdetected by encryption of the packet including the Checksum field.  Anintruder cannot update the checksum after modifying the packet withoutknowing the Key.  The cost of fully encrypting a packet is close to thecost of generating a cryptographic checksum (and of course, encryptionis needed in the general case), so there is no explicit provision forcryptographic checksum without packet encryption.A Client determines the Principal of the Server and acquires anauthenticator for this Server and Principal using a higher levelprotocol.  The Server cannot decrypt the authenticator or the Requestpackets unless it is in fact the Principal expected by the Client.An encrypted VMTP packet is flagged by the EPG bit  in the VMTP packetheader.  Thus, encrypted packets are easily detected and demultiplexedfrom unencrypted packets.  An encrypted VMTP packet is entirelyencrypted except for the Client, Version, Domain, Length and PacketFlags fields at the beginning of the packet.  Client identifiers can beassigned, changed and used to have no real meaning to an intruder or toonly communicate public information (such as the host Internet address).They are otherwise just a random means of identification anddemultiplexing and do not therefore divulge any sensitive information.Further secure measures must be taken at the network or data link levelsif this information or traffic behavior is considered sensitive.VMTP provides multiple authentication domains  as well as an encryptionqualifier to accommodate different encryption algorithms and their_______________<3>   Principal group membership must be obtained, if needed, by ahigher level protocol.Cheriton                                                       [page 20]

RFC 1045                       VMTP                        February 1988corresponding security/performance trade-offs.  (SeeAppendix V.)  Aseparate key distribution and authentication protocol is required tohandle generation and distribution of authenticators and keys.  Thisprotocol can be implemented on top of VMTP and can closely follow theBirrell design as well.Security is optional in the sense that messages may be secure ornon-secure, even between consecutive message transactions from the sameclient.  It is also optional in that VMTP clients and servers are notrequired to implement secure VMTP (although they are required to respondintelligently to attempts to use secure VMTP).  At worst, a Client mayfail to communicate with a Server if the Server insists on securecommunication and the Client does not implement security or vice versa.However, a failure to communicate in this case is necessary from asecurity standpoint.2.7. MulticastThe Server entity identifier in a message transaction can identify anentity group, in which case the Request is multicast to every Entity inthis group (on a best-efforts basis).  The Request is retransmitteduntil at least one Response is received (or an error timeout occurs)unless it is a datagram Request.  The Client can receive multipleResponses to the Request.The VMTP service interface does not directly provide reliable multicastbecause it is expensive to provide, rarely needed by applications, andcan be implemented by applications using the multiple Response feature.However, the protocol itself is adequate for reliable multicast usingpositive acknowledgments.  In particular, a sophisticated Clientimplementation could maintain a list of members for each entity group ofinterest and retransmit the Request until acknowledged by all members.No modifications are required to the Server implementations.VMTP supports a simple form of subgroup addressing.  If the CRE  bit isset in a Request, the Request is delivered to the subgroup of entitiesin the Server group that are co-resident with one or more entities inthe group (or individual entity) identified by the CoresidentEntityfield of the Request.  This is commonly used to send to the managerentity for a particular entity, where Server specifies the group of suchmanagers.  Co-resident means "using the same VMTP module", and logicallyon the same network host.  In particular, a Probe request can be sent tothe particular VMTP management module for an entity by specifying theVMTP management group as the Server and the entity in question as theCoResidentEntity.Cheriton                                                       [page 21]

RFC 1045                       VMTP                        February 1988As an experimental aspect of the protocol, VMTP supports the Serversending a group Response which is sent to the Client as well as membersof the destination group of Servers to which the original Request wassent.  The MDG bit indicates whether the Client is a member of thisgroup, allowing the Server module to determine whether separatelyaddressed packet groups are required to send the Response to both theClient and the Server group.  Normally, a Server accepts a groupResponse only if it has received the Request and not yet responded tothe Client.  Also, the Server must explicitly indicate it wants toaccept group Responses.  Logically, this facility is analogous toresponding to a mail message sent to a distribution list by sending acopy of the Response to the distribution list.2.8. Real-time CommunicationVMTP provides three forms of support for real-time communication, inaddition to its standard facilities, which make it applicable to a widerange of real-time applications.  First, a priority is transmitted ineach Request and Response which governs the priority of its handling.The priority levels are intended to correspond roughly to:   - urgent/emergency.   - important   - normal   - background.with additional gradations for each level.  The interpretation andimplementation of these priority levels is otherwise host-specific, e.g.the assignment to host processing priorities.Second, datagram Requests allow the Client to send a datagram to anotherentity or entity group using the VMTP naming, transmission and deliverymechanism, but without blocking, retransmissions or acknowledgment.(The client can still request acknowledgment using the APG bit althoughthe Server does not expect missing portions of a multi-packet datagramRequest to be retransmitted even if some are not received.)  A datagramRequest in non-streamed mode supersedes all previous Requests from thesame Client.  A datagram Request in stream mode is queued (if necessary)after previous datagram Requests on the same stream.  (SeeSection2.11.)Finally, VMTP provides several control bit flags to modify the handlingof Requests and Responses for real-time requirements.  First, theCheriton                                                       [page 22]

RFC 1045                       VMTP                        February 1988conditional message delivery (CMD) flag causes a Request to be discardedif the recipient is not waiting for it when it arrives, similarly forthe Response.  This option allows a client to send a Request that iscontingent on the server being able to process it immediately.  Theheader checksum only (HCO) flag indicates that the checksum has beencalculated only on the VMTP header and not on the data segment.Applications such as voice and video can avoid the overhead ofcalculating the checksum on data whose utility is insensitive to typicalbit errors without losing protection on the header information.Finally, the No Retransmission (NRT) flag indicates that the recipientof a message should not ask for retransmission if part of the message ismissing but rather either use what was received or discard it.None of these facilities introduce new protocol states.  In fact, thetotal processing overhead in the normal case is a bit flag test for CMD,HCO or NRT plus assignment of priority on packet transmission andreception.  (In fact, CMD and NRT are not tested in the normal case.)The additional code complexity is minimal.  We feel that the overheadfor providing these real-time facilities is minimal and that thesefacilities are both important and adequate for a wide class of real-timeapplications.Several of the normal facilities of VMTP appear useful for real-timeapplications.  First, multicast is useful for distributed, replicated(fault-tolerant) real-time applications, allowing efficient state queryand update for (for example) sensors and control state.  Second, the DGMor idempotent flag for Responses has some real-time benefits, namely:  aRequest is redone to get the latest values when the Response is lost,rather than just returning the old values.  The desirability of thisbehavior is illustrated by considering a request for the current time ofday.  An idempotent handling of this request gives better accuracy inreturning the current time in the case that a retransmission isnecessary.  Finally, the request-response semantics (in the absence ofstreaming) of each new Request from a Client terminating the previousmessage transactions from that Client, if any, provides the "most recentis most important" handling of processing that most real-timeapplications require.In general, a key design goal of VMTP was provide an efficientgeneral-purpose transport protocol with the features required forreal-time communication.  Further experience is required to determinewhether this goal has been achieved.Cheriton                                                       [page 23]

RFC 1045                       VMTP                        February 19882.9. Forwarded Message TransactionsA Server may invoke another Server to handle a Request.  It is fairlycommon for the invocation of the second Server to be the last actionperformed by the first Server as part of handling the Request.  Forexample, the original Server may function primarily to select a processto handle the Request.  Also, the Server may simply check theauthorization on the Request.  Describing this situation in the contextof RPC, a nested remote procedure call may be the last action in theremote procedure and the return parameters are exactly those of thenested call.  (This situation is analogous to tail recursion.)As an optimization to support this case, VMTP provides a Forwardoperation that allows the server to send the nested Request to the otherserver and have this other server respond directly to the Client.If the message transaction being forwarded was not multicast, not secureor the two Servers are the same principal and the ForwardCount of theRequest is less than the maximum forward count of 15, the Forwardoperation is implemented by the Server sending a Request onto the nextServer with the forwarded Request identified by the same Client andTransaction as the original Request and a ForwardCount one greater thanthe Request received from the Client.  In this case, the new Serverresponds directly to the Client.  A forwarded Request is illustrated inthe following figure. +---------+   Request       +----------+ | Client  +---------------->| Server 1 | +---------+                 +----------+      ^                        |      |                        | forwarded Request      |                        V      |   Response           +----------+      +----------------------| Server 2 |                             +----------+If the message transaction does not meet the above requirements, theServer's VMTP module issues a nested call and simply maps the returnedResponse to a Response to original Request without further Server-levelprocessing.  In this case, the only optimization over a user-levelnested call is one fewer VMTP service operation; the VMTP module handlesthe return to the invoking call directly.  The Server may also use thisform of forwarding when the Request is part of a stream of messagetransactions.  Otherwise, it must wait until the forwarded messagetransaction completes before proceeding with the subsequent messagetransactions in the stream.Cheriton                                                       [page 24]

RFC 1045                       VMTP                        February 1988Implementation of the user-level Forward operation is optional,depending on whether the server modules require this facility.  Handlingan incoming forwarded Request is a minor modification of handling anormal incoming Request.  In particular, it is only necessary to examinethe ForwardCount field when the Transaction of the Request matches thatof the last message transaction received from the Client.  Thus, theadditional complexity in the VMTP module for the required forwardingsupport is minimal; the complexity is concentrated in providing a highlyoptimized user-level Forward primitive, and that is optional.2.10. VMTP ManagementVMTP management includes operations for creating, deleting, modifyingand querying VMTP entities and entity groups.  VMTP management islogically implemented by a VMTP management server module that is invokedusing a message transaction addressed to the Server, VMTP_MANAGER_GROUP,a well-known group entity identifier, in conjunction with CoresidentEntity mechanism introduced inSection 2.7.  A particular Request mayaddress the local module, the module managing a particular entity, theset of modules managing those entities contained in a specific group orall management modules, as appropriate.The VMTP management procedures are specified inAppendix III.2.11. Streamed Message TransactionsStreamed message transactions refer to two or more message transactionsinitiated by a Client before it receives the response to the firstmessage transaction, with each transaction being processed and respondedto in order but asynchronous relative to the initiation of thetransactions.  A Client streams messages transactions, and thereby hasmultiple message transactions outstanding, by sending them as part of asingle run of message transactions.  A run  of message transactions is asequence of message transactions with the same Client and Server andconsecutive Transaction identifiers, with all but the first and lastRequests and Responses flagged with the NSR (Not Start Run)  and NER(Not End Run)  control bits.  (Conversely, the first Request andResponse does not have the NSR set and the last Request and Responsedoes not have the NER bit set.)  The message transactions in a run useCheriton                                                       [page 25]

RFC 1045                       VMTP                        February 1988consecutive transaction identifiers (except if the STI bit <4> is usedin one, in which case the transaction identifier for the next messagetransaction is 256 greater, rather than 1).The Client retains a record for each outstanding transaction until itgets a Response or is timed out in error.  The record provides theinformation required to retransmit the Request.  On retransmissiontimeout, the client retransmits the last Request for which it has notreceived a Response the same as is done with non-streamed communication.(I.e. there need be only one timeout for all the outstanding messagetransactions associated with a single client.)The consecutive transaction identifiers within a run of messagetransactions are used as sequence numbers for error control.  The Serverhandles each message transaction in the sequence specified by itstransaction identifier.  When it receives a message transaction that isnot marked as the beginning of a run, it checks that it previouslyreceived a message transaction with the predecessor transactionidentifier, either 1 less than the current one or 256 less if theprevious one had the STI bit set.  If not, the Server sends aNotifyVmtpClient operation to the Client's manager indicating either:(1) the first message transaction was not fully received, or else (2) ithas no record of the last one received.  If the NRT control flag is set,it does not await nor expect retransmission but proceeds with handlingthis Request.  This flag is used primarily when datagram Requests areused as part of a stream of message transactions.  If NRT was notspecified, the Client must retransmit from the first message transactionnot fully received (either at all or in part) before the Server canproceed with handling this run of Requests or else restart the run ofmessage transactions.The Client expects to receive the Responses in a consecutive sequence,using the Transaction identifier to detect missing Responses.  Thus, theServer must return Responses in sequence except possibly for some gaps,as follows.  The Server can specify in the PGcount field in a Response,the number of consecutively previous Responses that this Response_______________<4>   The STI bit is used by the Client to effectively allocate 255transaction identifiers for use by the Server in returning a largeResponse or stream of Responses.Cheriton                                                       [page 26]

RFC 1045                       VMTP                        February 1988corresponds to, up to a maximum of 255 previous Responses <5>.  Thus,for example, a Response with Transaction identifier 46 and PGcount 3represents Responses 43, 44, 45 and 46.  This facility allows the Serverto eliminate sending Responses to Requests that require no Response,effectively batching the Responses into one.  It also allows the Serverto effectively maintain strictly consecutive sequencing when the Clienthas skipped 256 Transaction identifiers using the STI bit and the Serverdoes not have that many Responses to return.If the Client receives a Response that is not consecutive, itretransmits the Request(s) for which the Response(s) is/are missing(unless, of course, the corresponding Requests were sent as datagrams).The Client should wait at the end of a run of message transactions forthe last one to complete.When a Server receives a Request with the NSR bit clear and a highertransaction identifier than it currently has for the Client, itterminates all processing and discards Responses associated with theprevious Requests.  Thus, a stream of message transactions iseffectively aborted by starting a new run, even if the Server was in themiddle of handling the previous run.Using a mixture of datagram and normal Requests as part of a stream ofmessage transactions, particularly with the use of the NRT bit, can leadto complex behavior under packet loss.  It is recommended that a run ofmessage transactions be all of one type to avoid problems, i.e. allnormal or all datagrams.  Finally, when a Server forwards a Request thatis part of a run, it must suspend further processing of the subsequentRequests until the forwarded Request has been handled, to preserve orderof processing.  The simplest handling of this situation is to use a realnested call when forwarding with streamed message transactions.Flow control of streamed message transactions relies on rate control atthe Client plus receipt (or non-receipt) of management notify operationsindicating the presence of overrunning.  A Client must reduce the numberof outstanding message transactions at the Server when it receives aNotifyVmtpServer operation with the MSGTRANS_OVERFLOW ResponseCode.  Thetransact parameter indicates the last packet group that was accepted._______________<5>  PGcount actually corresponds to packet groups which are describedinSection 2.13.  This (simplified) description is accurate when thereis one Request or Response per packet group.Cheriton                                                       [page 27]

RFC 1045                       VMTP                        February 1988The implementation of multiple outstanding message transactions requiresthe ability to record, timeout and buffer multiple outstanding messagetransactions at the Client end as well as the Server end.  However, thisfacility is optional for both the Client and the Server.  Client systemswith heavy-weight processes and high network access cost are most likelyto benefit from this facility.  Servers that serve a wide variety ofclient machines should implement streaming to accommodate these types ofclients.2.12. Fault-Tolerant ApplicationsOne approach to fault-tolerant systems is to maintain a log of allmessages sent at each node and replay the messages at a node when thenode fails, after restarting it from the last checkpoint <6>.  As anexperimental facility, VMTP provides a Receive Sequence Number field inthe NotifyVmtpClient and NotifyVmtpServer operations as well as the NextReceive Sequence (NRS) flag in the Response packet to allow a sender tolog a receive sequence number with each message sent, allowing thepackets to be replayed at a recovering node in the same sequence as theywere originally received, thereby recovering to the same state asbefore.Basically, each sending node maintains a receive sequence number foreach receiving node.  On sending a Request to a node, it presume thatthe receive sequence number is one greater than the one it has recordedfor that node.  If not, the receiving node sends a notify operationindicating the receive sequence number assigned the Request.  The NRS inthe Response confirms that the Request message was the next receivesequence number, so the sender can detect if it failed to receive thenotify operation in the previous case.  With Responses, the packets areordered by the Transaction identifier except for multicast messagetransactions, in which there may be multiple Responses with the sameidentification.  In this case, NotifyVmtpServer operations are used toprovide receive sequence numbers.This experimental extension of the protocol is focused on support forfault-tolerant real-time distributed systems required in variouscritical applications.  It may be removed or extended, depending onfurther investigations._______________<6>  The sender-based logging is being investigated by Willy Zwaenepoelof Rice University.Cheriton                                                       [page 28]

RFC 1045                       VMTP                        February 19882.13. Packet GroupsA message (whether Request or Response) is sent as one or more packetgroups.  A packet group is one or more packets, each containing the sametransaction identification and message control block.  Each packet isformatted as below with the message control block logically embedded inthe VMTP header. +------------------------------------++---------------------+ |            VMTP Header             ||                     | +------------+-----------------------||   segment data      | |VMTP Control| Message Control Block ||                     | +------------+-----------------------++---------------------+The some fields of the VMTP control portion of the packet and datasegment portion can differ between packets within the same packet group.The segment data portion of a packet group represents up to 16kilooctets of the segment specified in the message control block.  Theportion contained in each packet is indicated by the PacketDeliveryfield contained in the VMTP header.  The PacketDelivery field as a bitmask has a similar interpretation to the MsgDelivery field in that eachbit corresponds to a segment data block of 512 octets.  ThePacketDelivery field limits a packet group to 16 kilooctets and amaximum of 32 VMTP packets (with a minimum of 1 packet).  Data can besent in fewer packets by sending multiple data blocks per packet.  Werequire that the underlying datagram service support delivery of (atminimum) the basic 580 octet VMTP packet <7>.  To illustrate the use ofthe PacketDelivery field, consider for example the Ethernet which has aMTU of 1536 octets.  so one would send 2 512-octet segment data blocksper packet.  (In fact, if a third block is last in the segment and lessthan 512 octets and fits in the packet without making it too big, anEthernet packet could contain three data blocks.  Thus, an Ethernetpacket group for a segment of size 0x1D00 octets (14.5 blocks) andMsgDelivery 0x000074FF consists of 6 packets indicated as follows <8>._______________<7>  Note that with a 20 octet IP header, a VMTP packet is 600octets.  We propose the convention that any host implementing VMTPimplicitly agrees to accept IP/VMTP packets of at least 600 octets.<8>  We use the C notation 0xHHHH to represent a hexadecimal number.Cheriton                                                       [page 29]

RFC 1045                       VMTP                        February 1988 Packet Delivery  1 1  1 1  1 1  1 1  0 0  1 0  1 0  1 0  0 0 0 0 0 . . .           0000 0400 0800 0C00 1000 1400 1800 1C00          +----+----+----+----+----+----+----+-+ Segment  |....|....|....|....|....|....|....|.|          +----+----+----+----+----+----+----+-+          :    :    :    :    :    :  : /  /   :          v    v    v    v    v    v  v   /|   v          +----+----+----+----+    +----+  +---+ Packets  |  1 |  2 |  3 |  4 |    |  5 |  | 6 |          +----+----+----+----+    +----+  +---+Each '.' is 256 octets of data.  The PacketDelivery masks for the 6packets are: 0x00000003, 0x0000000C, 0x00000030, 0x000000C0, 0x00001400and 0x00006000, indicating the segment blocks contained in each of thepackets.  (Note that the delivery bits are in little endian order.)A packet group is sent as a single "blast" of packets with no explicitflow control.  However, the sender should estimate and transmit at arate of packet transmission to avoid congesting the network oroverwhelming the receiver, as described inSection 2.5.6.  Packets in apacket group can be sent in any order with no change in semantics.When the first packet of a packet group is received (assuming the Serverdoes not decide to discard the packet group), the Server saves a copy ofthe VMTP packet header, indicates it is currently receiving a packetgroup, initializes a "current delivery mask" (indicating the data in thesegment received so far) to 0, accepts this packet (updating the currentdelivery mask) and sets the timer for the packet group.  Subsequentpackets in the packet group update the current delivery mask.Reception of a packet group is terminated when either the currentdelivery mask indicates that all the packets in the packet group havebeen received or the packet group reception timer expires (set to TC3 orTS1).  If the packet group reception timer expires, if the NRT bit isset in the Control flags then the packet group is discarded if notcomplete unless MDM is set.  In this case, the MsgDelivery field in themessage control block is set to indicate the segment data blocksactually received and the message control block and segment datareceived is delivered to application level.If NRT is not set and not all data blocks have been received, aNotifyVmtpClient (if a Request) or NotifyVmtpServer (if a Response) issent back with a PacketDelivery field indicating the blocks received.The source of the packet group is then expected to retransmit themissing blocks.  If not all blocks of a Request are received afterRequestAckRetries(Client) retransmissions, the Request is discarded andCheriton                                                       [page 30]

RFC 1045                       VMTP                        February 1988a NotifyVmtpClient operation with an error response code is sent to theclient's manager unless MDM is set.  With a Response, there areResponseAckRetries(Server) retransmissions and then, if MDM is not set,the requesting entity is returned the message control block with anindication of the amount of segment data received extending contiguouslyfrom the start of the segment.  E.g. if the sender sent 6 512-octetblocks and only the first two and the last two arrived, the receiverwould be told that 1024 octets were received.  The ResponseCode field isset to BAD_REPLY_SEGMENT.  (Note that VMTP is only able to indicate thespecific segment blocks received if MDM is set.)The parameters RequestAckRetries(Client) and ResponseAckRetries(Server)could be set on a per-client and per-server basis in a sophisticatedimplementation based on knowledge of packet loss.If the APG flag is set, a NotifyVmtpClient or NotifyVmtpServeroperation is sent back at the end of the packet group reception,depending on whether it is a Request or a Response.At minimum, a Server should check that each packet in the packet groupcontains the same Client, Server, Transaction identifier and SegmentSizefields.  It is a protocol error for any field other than the Checksum,packet group control flags, Length and PacketDelivery in the VMTP headerto differ between any two packets in one packet group.  A packet groupcontaining a protocol error of this nature should be discarded.Notify operations should be sent (or invoked) in the manager wheneverthere is a problem with a unicast packet.  i.e. negative acknowledgmentsare always sent in this case.  In the case of problems with multicastpackets, the default is to send nothing in response to an errorcondition unless there is some clear reason why no other node canrespond positively.  For example, the packet might be a Probe for anentity that is known to have been recently existing on the receivinghost but now invalid and could not have migrated.  In this case, thereceiving host responds to the Probe indicating the entity isnonexistent, knowing that no other host can respond to the Probe.  Forpackets and packet groups that are received and processed withoutproblems, a Notify operation is invoked only if the APG bit is set.2.14. Runs of Packet GroupsA run of packet groups is a sequence of packet groups, all Requestpackets or all Response packets, with the same Client and consecutivetransaction identifiers, all but the first and last packets flagged withthe NSR (Not Start Run) and NER (Not End Run) control bits.  When eachpacket group in the run corresponds to a single Request or Response, itCheriton                                                       [page 31]

RFC 1045                       VMTP                        February 1988is identical to a run of message transactions. (SeeSection 2.11)However, a Request message or a Response message may consists of up to256 packet groups within a run, for a maximum of 4 megaoctets of segmentdata.  A message that is continued in the next packet group in the runis flagged in the current packet group by the CMG flag.  Otherwise, thenext packet group in the run (if any) is treated as a separate Requestor Response.Normally, each Request and Response message is sent as a single packetgroup and each run consists of a single packet group.  In this caseneither NSR or NER are set.  For multi-packet group messages, thePacketDelivery mask in the i-th packet group of a message corresponds tothe portion of the segment offset by i-1 times 16 kilooctets,designating the the first packet group to have i = 1.2.15. Byte OrderFor purposes of transmission and reception, the MCB is treated asconsisting of 8 32-bit fields and the segment is a sequence of bytes.VMTP transmits the MCB in big-endian order, performing byte-swapping, ifnecessary, before transmission.  A little-endian host must byte-swap theMCB on reception.  (The data segment is transmitted as a sequence ofbytes with no reordering.)  The byte order of the sender of a message isindicated by the LEE  bit in the entity identifier for the sender, theClient field if a Request and the Server field if a Response.  Thesender and receiver of a message are required to agree in some higherlevel protocol (such as an RPC presentation protocol) on who doesfurther swapping of the MCB and data segment if required by the types ofthe data actually being transmitted.  For example, the segment data maycontain a record with 8-bit, 16-bit and 32-bit fields, so additionaltransformation is required to move the segment from a host of one byteorder to another.VMTP to date has used a higher-level presentation protocol in whichsegment data is sent in the native order of the sending host andbyte-swapped as necessary by the receiving host.  This approachminimizes the byte-swapping overhead between machines of common byteorder (including when the communication is transparently local to onehost), avoids a strong bias in the protocol to one byte-order, andallows for the sending entity to be sending to a group of hosts withdifferent byte orders.  (Note that the byte-swap overhead for the MCB isminimal.)  The presentation-level overhead is minimal because mostcommon operations, such as file access operations, have parameters thatfit the MCB and data segment data types exactly.Cheriton                                                       [page 32]

RFC 1045                       VMTP                        February 19882.16. Minimal VMTP ImplementationA minimal VMTP client needs to be able to send a Request packet groupand receive a Response packet group as well as accept and respond toRequests sent to its management module, including Probe and NotifyClientoperations.  It may also require the ability to invoke Probe and Notifyoperations to locate a Server and acknowledge responses.  (the latteronly if it is involved in transactions that are not idempotent ordatagram message transactions.  However, a simple sensor, for example,can transmit VMTP datagram Requests indicating its current state witheven less mechanism.)  The minimal client thus requires very little codeand is suitable as a basis for (e.g.) a network boot loader.A minimal VMTP server implements idempotent, non-encrypted messagetransactions, possibly with no segment data support.  It should use anentity state record for each Request but need only retain it whileprocessing the Request.  Without segment data larger than a packet,there is no need for any timers, buffering (outside of immediate requestprocessing) or queuing.  In particular, it needs only as many records asmessage transactions it handles simultaneously (e.g. 1).  The entitystate record is required to recognize and respond to Requestretransmissions during request processing.The minimal server need only receive Requests and and be able to sendResponse packets.  It need have only a minimal management modulesupporting Probe operations.  (Support for the NotifyVmtpClientoperation is only required if it does not respond immediately to aRequest.)  Thus the VMTP support for say a time server, sensor, oractuator can be extremely simple.  Note that the server need never issuea Probe operation if it uses the host address of the Request for theResponse and does not require the Client information returned by theProbe operation.  The minimal server should also support reception offorwarded Requests.2.17. Message vs. Procedural Request HandlingA request-response protocol can be used to implement two forms ofsemantics on reception.  With procedural handling of a Request, aRequest is handled by a process associated with the Server thateffectively takes on the identity of the calling process, treating theRequest message as invoking a procedure, and relinquishing itsassociation to the calling process on return.  VMTP supports multiplenested calls spanning multiple machines.  In this case, the distributedcall stack that results is associated with a single process from thestandpoint of authentication and resource management, using theProcessId field supported by VMTP.  The entity identifiers effectivelyCheriton                                                       [page 33]

RFC 1045                       VMTP                        February 1988link these call frames together.  That is, the Client field in a Requestis effectively the return link to the previous call frame.With message handling of a Request, a Request message is queued for aserver process.  The server process dequeues, reads, processes andresponds to the Request message, executing as a separate process.Subsequent Requests to the same server are queued until the server asksto receive the next Request.Procedural semantics have the advantage of allowing each Request (up tothe resource limits of the Server) to execute concurrently at theServer, with Request-specific synchronization.  Message semantics havethe advantage that Requests are serialized at the Server and that therequest processing logically executes with the priority, protection andindependent execution of a separate process.  Note that procedural andmessage handling of a request appear no differently to the clientinvoking the message transaction, except possibly for differences inperformance.We view the two Request handling approaches as appropriate underdifferent circumstances.  VMTP supports both models.2.18. BibliographyThe basic protocol is similar to that used in the original form of the Vkernel [3,4] as well as the transport protocol of Birrell andNelson's [2] remote procedure call mechanism.  An earlier version of theprotocol was described in SIGCOMM'86 [6].  The rate-based flow controlis similar to the techniques of Netblt [9].  The support for idempotencydraws, in part, on the favorable experience with idempotency in the Vdistributed system.  Its use was originally inspired by the WoodstockFile Server [11].  The multicast support draws on the multicastfacilities in V [5] and is designed to work with, and is now implementedusing, the multicast extensions to the Internet [8] described inRFC 966and 988.  The secure version of the protocol is similar to thatdescribed by Birrell [1] for secure RPC.  The use of runs of packetgroups is similar to Fletcher and Watson's delta-T protocol [10].  Theuse of "management" operations implemented using VMTP in place ofspecialized packet types is viewed as part of a general strategy ofusing recursion to simplify protocol architectures [7].Finally, this protocol was designed, in part, to respond to therequirements identified by Braden inRFC 955.  We believe that VMTPsatisfies the requirements stated inRFC 955.Cheriton                                                       [page 34]

RFC 1045                       VMTP                        February 1988[1]   A.D. Birrell, "Secure Communication using Remote Procedure      Calls", ACM. Trans. on Computer Systems 3(1), February, 1985.[2]   A. Birrell and B. Nelson, "Implementing Remote Procedure Calls",      ACM Trans. on Computer Systems 2(1), February, 1984.[3]   D.R. Cheriton and W. Zwaenepoel, "The Distributed V Kernel and its      Performance for Diskless Workstations", In Proceedings of the 9th      Symposium on Operating System Principles,  ACM, 1983.[4]   D.R. Cheriton, "The V Kernel: A Software Base for Distributed      Systems", IEEE Software 1(2), April, 1984.[5]   D.R. Cheriton and W. Zwaenepoel, "Distributed Process Groups in      the V Kernel", ACM Trans. on Computer Systems 3(2), May, 1985.[6]   D.R. Cheriton, "VMTP: A Transport Protocol for the Next      Generation of Communication Systems", In Proceedings of      SIGCOMM'86, ACM, Aug 5-7, 1986.[7]   D.R. Cheriton, "Exploiting Recursion to Simplify an RPC      Communication Architecture", in preparation, 1988.[8]   D.R. Cheriton and S.E. Deering, "Host Groups: A Multicast      Extension for Datagram Internetworks", In 9th Data Communication      Symposium, IEEE Computer Society and ACM SIGCOMM, September, 1985.[9]   D.D. Clark and M. Lambert and L. Zhang, "NETBLT: A Bulk Data      Transfer Protocol", Technical ReportRFC 969, Defense Advanced      Research Projects Agency, 1985.[10]  J.G. Fletcher and R.W. Watson, "Mechanism for a Reliable Timer-      based Protocol", Computer Networks 2:271-290, 1978.Cheriton                                                       [page 35]

RFC 1045                       VMTP                        February 1988[11]  D. Swinehart and G. McDaniel and D. Boggs, "WFS: A Simple File      System for a Distributed Environment", In Proc. 7th Symp.      Operating Systems Principles, 1979.Cheriton                                                       [page 36]

RFC 1045                       VMTP                        February 19883. VMTP Packet FormatsVMTP uses 2 basic packet formats corresponding to Request packets andResponse packets.  These packet formats are identical in most of thefields to simplify the implementation.We first describe the entity identifier format and the packet fieldsthat are used in general, followed by a detailed description of each ofthe packet formats.  These fields are described below in detail.  Theindividual packet formats are described in the following subsections.The reader and VMTP implementor may wish to refer to Chapters 4 and 5for a description of VMTP event handling and only refer to this detaileddescription as needed.3.1. Entity Identifier FormatThe 64-bit non-group entity identifiers have the following substructure.  0                   1                   2                   3  0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |R| |L|R| |A|0|E|E|      Domain-specific structure |E| |E|S| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+                Domain-specific structure                        | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+The field meanings are as follows:RAE             Remote Alias Entity - the entity identifier identifies                an entity that is acting as an alias for some entity                outside this entity domain.  This bit is used by                higher-level protocols.  For instance, servers may take                extra security and protection measures with aliases.GRP             Group - 0, for non-group entity identifiers.LEE             Little-Endian Entity - the entity transmits data in                little-endian (VAX) order.RES              Reserved - must be 0.The 64-bit entity group identifiers have the following substructure.Cheriton                                                       [page 37]

RFC 1045                       VMTP                        February 1988  0                   1                   2                   3  0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |R| |U|R| |A|1|G|E|      Domain-specific structure |E| |P|S| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+                Domain-specific structure                        | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+The field meanings are as follows:RAE             Remote Alias Entity - same as for non-group entity                identifier.GRP             Group - 1, for entity group identifiers.UGP             Unrestricted Group - no restrictions are placed on                joining this group.  I.e. any entity can join limited                only by implementation resources.RES              Reserved - must be 0.The all-zero entity identifier is reserved and guaranteed to beunallocated in all domains.  In addition, a domain may reserve part ofthe entity identifier space for statically allocated identifiers.However, this is domain-specific.Description of currently defined entity identifier domains is providedinAppendix IV.3.2. Packet FieldsClient          64-bit identifier for the client entity associated with                this packet.  The structure, allocation and binding of                this identifier is specific to the specified Domain.  An                entity identifier always includes 4 types bits as                specified inSection 3.1.Version         The 3-bit identifier specifying the version of the                protocol.  Current version is version 0.Domain          The 13-bit identifier specifying the naming and                administration domain for the client and server named in                the packet.Cheriton                                                       [page 38]

RFC 1045                       VMTP                        February 1988Packet Flags: 3 bits. (The normal case has none of the flags set.)  HCO           Header checksum only - checksum has only been calculated                on the header.  This is used in some real-time                applications where the strict correctness of the data is                not needed.  EPG           Encrypted packet group - part of a secure message                transaction.  MPG           Multicast packet group - packet was multicast on                transmission.Length          A 13-bit field that specifies the number of 32-bit words                in the segment data portion of the packet (if any),                excluding the checksum field.  (Every VMTP packet is                required to be a multiple of 64 bits, possibly by                padding out the segment data.)  The minimum legal Length                is 0, the maximum length is 4096 and it must be an even                number.Control Flags: 9 bits. (The normal case has none of the flags set.)  NRS           Next Receive Sequence - the associated Request message                (in a Response) or previous Response (if a Request) was                received consecutive with the last Request from this                entity.  That is, there was no interfering messages                received.  APG           Acknowledge Packet Group - Acknowledge packet group on                receipt.  If a Request, send back a Request to the                client's manager providing an update on the state of the                transaction as soon as the request packet group is                received, independent of the response being available.                If a Response, send an update to the server's manager as                soon as possible after response packet group is received                providing an update on the state of the transaction at                the client  NSR           Not Start Run - 1 if this packet is not part of the                first packet group of a run of packet groups.  NER           Not End Run - 1 if this packet is not part of the last                packet group of a run of packet groups.  NRT           No Retransmission - do not ask for retransmissions of                this packet group if not all received within timeoutCheriton                                                       [page 39]

RFC 1045                       VMTP                        February 1988                period, just deliver or discard.  MDG           Member of Destination Group - this packet is sent to a                group and the client is a member of this group.  CMG           Continued Message - the message (Request or Response) is                continued in the next packet group.  The next packet                group has to be part of the same run of packet groups.  STI           Skip Transaction Identifiers - the next transaction                identifier that the Client plans to use is the current                transaction plus 256, if part of the same run and at                least this big if not.  In a Request, this authorizes                the Server to send back up to 256 packet groups                containing the Response.  DRT           Delay Response Transmission - set by request sender if                multiple responses are expected (as indicated by the MRD                flag in the RequestCode) and it may be overrun by                multiple responses.  The responder(s) should then                introduce a short random delay in sending the Response                to minimize the danger of overrunning the Client.  This                is normally only used for responding to multicast                Requests where the Client may be receiving a large                number of Responses, as indicated by the MRD flag in the                Request flags.  Otherwise, the Response is sent                immediately.RetransmitCount:                3 bits - the ordinal number of transmissions of this                packet group prior to this one, modulo 8.  This field is                used in estimation of roundtrip times.  This count may                wrap around during a message transaction.  However, it                should be sufficient to match acknowledgments and                responses with a particular transmission.ForwardCount:   4 bits indicating the number of times this Request has                been forwarded.  The original Request is always sent                with a ForwardCount of 0.Interpacket Gap: 8 bits.                Indicates the recommended time to use between subsequent                packet transmissions within a multi-packet packet group                transmission.  The Interpacket Gap time is in 1/32nd of                a network packet transmission time for a packet of size                MTU for the node.  (Thus, the maximum gap time is 8                packet times.)Cheriton                                                       [page 40]

RFC 1045                       VMTP                        February 1988PGcount: 8 bits                The number of packet groups that this packet group                represents in addition to that specified by the                Transaction field.  This is used in acknowledging                multiple packet groups in streamed communication.Priority        4-bit identifier for priority for the processing of this                request both on transmission and reception.  The                interpretation is:                1100            urgent/emergency                1000            important                0000            normal                0100            background                Viewing the higher-order bit as a sign bit (with 1                meaning negative), low values are high priority and high                values are low priority.  The low-order 2 bits indicate                additional (lower) gradations for each level.Function Code: 1 bit - types of VMTP packets.  If the low-order bit of                the function code is 0, the packet is sent to the                Server, else it is sent to the Client.                0               Request                1               ResponseTransaction: 32 bits:                Identifier for this message transaction.PacketDelivery: 32 bits:                Delivery indicates the segment blocks contained in this                packet.  Each bit corresponds to one 512-octet block of                segment data.  A 1 bit in the i-th bit position                (counting the LSB as 0) indicates the presence of the                i-th segment block.Server: 64 bits                Entity identifier for the server or server group                associated with this transaction.  This is the receiver                when a Request packet and the sender when a Response                packet.Cheriton                                                       [page 41]

RFC 1045                       VMTP                        February 1988Code: 32 bits   The Request Code and Response Code, set either at the                user level or VMTP level depending on use and packet                type.  Both the Request and Response codes include 8                high-order bits from the following set of control bits:  CMD           Conditional Message Delivery -  only deliver the request                or response if the receiving entity is waiting for it at                the time of delivery, otherwise drop the message.  DGM           DataGram Message - indicates that the message is being                sent as a datagram.  If a Request message, do not wait                for reply, or retransmit.  If a Response message, treat                this message transaction as idempotent.  MDM           Message Delivery Mask - indicates that the MsgDelivery                field is being used.  Otherwise, the MsgDelivery field                is available for general use.  SDA           Segment Data Appended - segment data is appended to the                message control block, with the total size of the                segment specified by the SegmentSize field.  Otherwise,                the segment data is null and the SegmentSize field is                not used by VMTP and available for user- or RPC-level                uses.  CRE           CoResident Entity - indicates that the CoResidentEntity                field in the message should be interpreted by VMTP.                Otherwise, this field is available for additional user                data.  MRD           Multiple Responses Desired - multiple Responses are                desired to to this Request if it is multicast.                Otherwise, the VMTP module can discard subsequent                Responses after the first Response.  PIC           Public Interface Code - Values for Code with this bit                set are reserved for definition by the VMTP                specification and other standard protocols defined on                top of VMTP.  RES           Reserved for future use. Must be 0.CoResidentEntity                64-bit Identifier for an entity or group of entities                with which the Server entity or entities must be                co-resident, i.e. route only to entities (identified by                Server) on the same host(s) as that specified byCheriton                                                       [page 42]

RFC 1045                       VMTP                        February 1988                CoResidentEntity, Only meaningful if CRE is set in the                Code field.User Data       12 octets Space in the header for the VMTP user to                specify user-specific control and data.MsgDelivery: 32 bits                The segment blocks being transmitted (in total) in this                packet group following the conventions for the                PacketDelivery field.  This field is ignored by the                protocol and treated as an additional user data field if                MDM is 0.  On transmission, the user level sets the                MsgDelivery to indicate those portions of the segment to                be transmitted.  On receipt, the MsgDelivery field is                modified by the VMTP module to indicate the segment data                blocks that were actually received before the message                control block is passed to the user or RPC level.  In                particular, the kernel does not discard the packet group                if segment data blocks are missing.  A Server or Client                entity receiving a message with a MsgDelivery in use                must check the field to ensure adequate delivery and                retry the operation if necessary.SegmentSize: 32 bits                Size of segment in octets, up to a maximum of 16                kilooctets without streaming and 4 megaoctets with                streaming, if SDA is set.  Otherwise, this field is                ignored by the protocol and treated as an additional                user data field.Segment Data: 0-16 kilooctets                0 octets if SDA is 0, else the portion of the segment                corresponding to the Delivery Mask, limited by the                SegmentSize and the MTU, padded out to a multiple of 64                bits.Checksum: 32 bits.                The 32-bit checksum for the header and segment data.The VMTP checksum algorithm <9> develops a 32-bit checksum by computing_______________<9>  This algorithm and description are largely due to Steve Deering ofStanford University.Cheriton                                                       [page 43]

RFC 1045                       VMTP                        February 1988two 16-bit, ones-complement sums (like IP), each covering differentparts of the packet.  The packet is divided into clusters of 16 16-bitwords.  The first, third, fifth,... clusters are added to the first sum,and the second, fourth, sixth,... clusters are added to the second sum.Addition stops at the end of the packet; there is no need to pad out toa cluster boundary (although it is necessary that the packet be anintegral multiple of 64 bits; padding octets may have any value and areincluded in the checksum and in the transmitted packet).  If either ofthe resulting sums is zero, it is changed to 0xFFFF.  The two sums areappended to the transmitted packet, with the first sum being transmittedfirst.  Four bytes of zero in place of the checksum may be used toindicate that no checksum was computed.The 16-bit, ones-complement addition in this algorithm is the same asused in IP and, therefore, subject to the same optimizations.  Inparticular, the words may be added up 32-bits at a time as long as thecarry-out of each addition is added to the sum on the followingaddition, using an "add-with-carry" type of instruction.  (64-bit or128-bit additions would also work on machines that have registers thatbig.)A particular weakness of this algorithm (shared by IP) is that it doesnot detect the erroneous swapping of 16-bit words, which may easilyoccur due to software errors.  A future version of VMTP is expected toinclude a more secure algorithm, but such an algorithm appears torequire hardware support for efficient execution.Not all of these fields are used in every packet.  The specific packetformats are described below.  If a field is not mentioned in thedescription of a packet type, its use is assumed to be clear from theabove description.Cheriton                                                       [page 44]

RFC 1045                       VMTP                        February 19883.3. Request PacketThe Request packet (or packet group) is sent from the client to theserver or group of servers to solicit processing plus the return of zeroor more responses.  A Request packet is identified by a 0 in the LSB ofthe fourth 32-bit word in the packet.  0                   1                   2                   3  0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +                       Client (8 octets)                       + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |Ver  |                         |H|E|M|                         | |sion |          Domain         |C|P|P|      Length             | |     |                         |O|G|G|                         | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |N|A|N|N|N|M|C|S|D|Retra|Forward|    Inter-     |       |R|R|R| | |R|P|S|E|R|D|M|T|R|nsmit| Count |    Packet     | Prior |E|E|E|0| |S|G|R|R|T|G|G|I|T|Count|       |     Gap       | -ity  |S|S|S| | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |                      Transaction                              | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |                     PacketDelivery                            | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +                    Server (8 octets)                          + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |C|D|M|S|R|C|M|P|                                               | |M|G|D|D|E|R|R|I|        RequestCode                            | |D|M|M|A|S|E|D|C|                                               | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +                 CoResidentEntity (8 octets)                   + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ >                   User Data (12 octets)                       < +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |                      MsgDelivery                              | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |                       SegmentSize                             | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ >                  segment data, if any                         < +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |                        Checksum                               | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+                  Figure 3-1:   Request Packet FormatThe fields of the Request packet are set according to the semanticsdescribed inSection 3.2 with the following qualifications.Cheriton                                                       [page 45]

RFC 1045                       VMTP                        February 1988InterPacketGap  The estimated interpacket gap time the client would like                for the Response packet group to be sent by the Server                in responding to this Request.Transaction     Identifier for transaction, at least one greater than                the previously issued Request from this Client.Server          Server to which this Request is destined.RequestCode     Request code for this request, indicating the operation                to perform.Cheriton                                                       [page 46]

RFC 1045                       VMTP                        February 19883.4. Response PacketThe Response packet is sent from the Server to the Client in response toa Request, identified by a 1 in the LSB of the fourth 32-bit word in thepacket.  0                   1                   2                   3  0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +                       Client (8 octets)                       + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |Ver  |                         |H|E|M|                         | |sion |          Domain         |C|P|P|      Length             | |     |                         |O|G|G|                         | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |N|A|N|N|N|R|C|S|R|Retra|Forward|               |       |R|R|R| | |R|P|S|E|R|E|M|T|E|nsmit| Count |    PGcount    | Prior |E|E|E|1| |S|G|R|R|T|S|G|I|S|Count|       |               | -ity  |S|S|S| | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |                      Transaction                              | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |                      PacketDelivery                           | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +                        Server (8 octets)                      + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |C|D|M|S|R|R|R|R|                                               | |M|G|D|D|E|E|E|E|        ResponseCode                           | |D|M|M|A|S|S|S|S|                                               | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ >                   UserData (20 octets)                        < +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |                     MsgDelivery                               | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |                    Segment Size                               | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ >                  segment data, if any                         < +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |                       Checksum                                | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+                  Figure 3-2:   Response Packet FormatThe fields of the Response packet are set according to the semanticsdescribed inSection 3.2 with the following qualifications.Client, Version, Domain, Transaction                Match those in the Request packet group to which this isCheriton                                                       [page 47]

RFC 1045                       VMTP                        February 1988                a response.STI             1 if this Response is using one or more of the                transaction identifiers skipped by the Client after the                Request to which this is a Response.  STI in the Request                essentially allocates up to 256 transaction identifiers                for the Server to use in a run of Response packet                groups.RetransmitCount The retransmit count from the last Request packet                received to which this is a response.ForwardCount    The number of times the corresponding Request was                forwarded before this Response was generated.PGcount         The number of consecutively previous packet groups that                this response is acknowledging in addition to the one                identified by the Transaction identifier.Server          Server sending this response.  This may differ from that                originally specified in the Request packet if the                original Server was a server group, or the request was                forwarded.The next two chapters describes the protocol operation using thesepacket formats, with the the Client and the Server portions describedseparately.Cheriton                                                       [page 48]

RFC 1045                       VMTP                        February 19884. Client Protocol OperationThis chapter describes the operation of the client portion of VMTP interms of the procedures for handling VMTP user events, packet receptionevents, management operations and timeout events.  Note that the clientportion of VMTP is separable from the server portion.  It is feasible tohave a node that only implements the client end of VMTP.To simplify the description, we define a client state record (CSR) plussome standard utility routines.4.1. Client State Record FieldsIn the following protocol description, there is one client state record(CSR) per (client,transaction) outstanding message transaction.  Here isa suggested set of fields.Link            Link to next CSR when queued in one of the transmission,                timeout or message queues.QueuePtr        Pointer to queue head in which this CSR is contained or                NULL if none.  Queue could be one of transmission queue,                timeout queue, server queue or response queue.ProcessIdentification                The process identification and address space.Priority        Priority for processing, network service, etc.State           One of the client states described below.FinishupFunc    Procedure to be executed on the CSR when it is completes                its processing in transmission or timeout queues.TimeoutCount    Time to remain in timeout queue.TimeoutLimit    User-specified time after which the message transaction                is aborted. The timeout is infinite if set to zero.RetransCount    Number of retransmissions since last hearing from the                Server.LastTransmitTime                The time at which the last packet was sent.  This field                is used to calculate roundtrip times, using the                RetransmitCount to match the responding packet to aCheriton                                                       [page 49]

RFC 1045                       VMTP                        February 1988                particular transmission.  I.e. Response or management                NotifyVmtpClient operation to Request and a management                NotifyVmtpServer operation to a Response.TimetoLive      Time to live to be used on transmission of IP packets.TransmissionMask                Bit mask indicating the portions of the segment to                transmit.  Set before entering the transmission queue                and cleared incrementally as the 512-byte segment blocks                of the segment are transmitted.LocalClientLink Link to next CSR hashing to same hash index in the                ClientMap.LocalClient     Entity identifier for client when this CSR is used to                send a Request packet.LocalTransaction                Transaction identifier for current message transaction                the local client has outstanding.LocalPrincipal  Account identification, possibly including key and key                timeout.LocalDelivery   Bit mask of segment blocks that have not been                acknowledged in the Request or have been received in the                Response, depending on the state.ResponseQueue   Queue of CSR's representing the queued Responses for                this entity.VMTP Header     Prototype VMTP header, used to generate and store the                header portion of a Request for transmission and                retransmission on timeout.SegmentDesc     Description of the segment data associated with the CSR,                either the area storing the original Request data, the                area for receiving Request data, or the area storing the                Response data that is returned.HostAddr        The network or internetwork host address to which the                Client last transmitted.  This field also indicates the                type of the address, e.g. IP, Ethernet, etc.Note: the CSR can be combined with a light-weight process descriptorwith considerable benefit if the process is designed to block when itCheriton                                                       [page 50]

RFC 1045                       VMTP                        February 1988issues a message transaction.  In particular, by combining the twodescriptors, the implementation saves time because it only needs tolocate and queue one descriptor with various operations (rather thanhaving to locate two descriptors).  It also saves space, given that theVMTP header prototype provides space such as the user data field whichmay serve to store processor state for when the process is preempted.Non-preemptive blocking can use the process stack to store the processorstate so only a program counter and stack pointer may be required in theprocess descriptor beyond what we have described.  (This is the approachused in the V kernel.)4.2. Client Protocol StatesA Client State Record records the state of message transaction generatedby this host, identified by the (Client, Transaction) values in the CSR.As a client originating a transaction, it is in one of the followingstates.AwaitingResponse                Waiting for a Response packet group to arrive with the                same (Client,Transaction) identification.ReceivingResponse                Waiting for additional packets in the Response packet                group it is currently receiving."Other"         Not waiting for a response, which can be Processing or                some other operating system state, or one of the Server                states if it also acts as a server.This covers all the states for a client.4.3. State Transition DiagramsThe client state transitions are illustrated in Figure 4-1.  The clientgoes into the state AwaitingResponse on sending a request unless it is adatagram request.  In the AwaitingResponse state, it can timeout andretry and eventually give up and return to the processing state unlessit receives a Response.  (A NotifyVmtpClient operation resets thetimeout but does not change the state.)  On receipt of a single packetresponse, it returns to the processing state.  Otherwise, it goes toReceivingResponse state.  After timeout or final response packet isreceived, the client returns to the processing state.  The processingstate also includes any other state besides those associated withissuing a message transaction.Cheriton                                                       [page 51]

RFC 1045                       VMTP                        February 1988   +------------+   | Processing |<--------------------|   |            |<-------------|      |   |            |<---|         |      |   +|------^--^-+  Single    Last     | Transmit  |  |    Packet    Response |    |      |  |    Response  Packet   |    |      |  |      |         |      |    +-DGM->+ Timeout |         |   Final timeout    |         |      |         |      |   +V-----------+    |       +-----------+   |  Awaiting  |----+       | Receiving |->Response-+   |  Response  |->Response->| Response  |           |   |            |  (multi-   |           |<----------+   +-|--------^-+   packet)  +----------^+     V        |                |        |     +-Timeout+                +>Timeout+                 Figure 4-1:   Client State Transitions4.4. User InterfaceThe RPC or user interface to VMTP is implementation-dependent and mayuse systems calls, functions or some other mechanism.  The list ofrequests that follow is intended to suggest the basic functionality thatshould be available.Send( mcb, timeout, segptr, segsize )                Initiate a message transaction to the server and request                message specified by mcb and return a response in mcb,                if it is received within the specified timeout period                (or else return USER_TIMEOUT in the Code field).  The                segptr parameter specifies the location from which the                segment data is sent and the location into which the                response data is to be delivered.  The segsize field                indicates the maximum length of this area.GetResponse( responsemcb, timeout, segptr, segsize )                Get the next response sent to this client as part of the                current message transaction, returning the segment data,                if any, into the memory specified by segptr and segsize.This interface assumes that there is a client entity associated with theinvoking process that is to be used with these operations.  Otherwise,the client entity must be specified as an additional parameter.Cheriton                                                       [page 52]

RFC 1045                       VMTP                        February 19884.5. Event ProcessingThe following events may occur in the VMTP client:   - User Requests        * Send        * GetResponse   - Packet Arrival        * Response Packet        * Request     The minimal Client implementation handles Request packets for     its VMTP management (server) module and sends NotifyVmtpClient     requests in response to others, indicating the specified     server does not exist.   - Management Operation - NotifyVmtpClient   - Timeouts        * Client Retransmission TimeoutThe handling of these events is described in detail in the followingsubsections.We first describe some conventions and procedures used in thedescription.  A field of the received packet is indicated as (forexample) p.Transaction, for the Transaction field.  Optional portions ofthe code, such as the streaming handling code are prefixed with a "|" inthe first column.MapClient( client )                Return pointer to CSR for client with the specified                clientId, else NULL.SendPacketGroup( csr )                Send the packet group (Request, Response) according to                that specified by the CSR.NotifyClient( csr, p, code )                Invoke the NotifyVmtpClient operation with the                parameters csr.RemoteClient, p.control,Cheriton                                                       [page 53]

RFC 1045                       VMTP                        February 1988                csr.ReceiveSeqNumber, csr.RemoteTransaction and                csr.RemoteDelivery, and code.  If csr is NULL, use                p.Client, p.Transaction and p.PacketDelivery instead and                the global ReceiveSequenceNumber, if supported.  This                function simplifies the description over calling                NotifyVmtpClient directly in the procedural                specification below.  (SeeAppendix III.)NotifyServer( csr, p, code )                Invoke the NotifyVmtpServer operation with the                parameters p.Server, csr.LocalClient,                csr.LocalTransaction, csr.LocalDelivery and code.  Use                p.Client, P.Transaction and 0 for the clientId, transact                and delivery parameters if csr is NULL.  This function                simplifies the description over calling NotifyVmtpServer                directly in the procedural specification below.  (SeeAppendix III.)DGMset(p)       True if DGM bit set in packet (or csr) else False.                (Similar functions are used for other bits.)Timeout( csr, timeperiod, func )                Set or reset timer on csr record for timeperiod later                and invoke func if the timeout expires.4.6. Client User-invoked EventsA user event occurs when a VMTP user application invokes one of the VMTPinterface procedures.4.6.1. SendSend( mcb, timeout, segptr, segsize )    map to main CSR for this client.    increment csr.LocalTransaction    Init csr and check parameters and segment if any.    Set SDA if sending appended data.    Flush queued replies from previous transaction, if any.    if local non-group server then        deliver locally        await response        return    if GroupId(server) then        Check for and deliver to local members.        if CRE request and non-group local CR entity thenCheriton                                                       [page 54]

RFC 1045                       VMTP                        February 1988           await response           return        endif        set MDG if member of this group.    endif    clear csr.RetransCount    set csr.TransmissionMask    set csr.TimeLimit to timeout    set csr.HostAddr for csr.Server    SendPacketGroup( csr )    if DGMset(csr) then       return    endif    set csr.State to AwaitingResponse    Timeout( rootcsr, TC1(csr.Server), LocalClientTimeout )    returnend SendNotes:   1. Normally, the HostAddr is extracted from the ServerHost      cache, which maps server entity identifiers to host      addresses.  However, on cache miss, the client first queries      the network using the ProbeEntity operation, as specified inAppendix III, determining the host address from the Response.      The ProbeEntity operation is handled as a separate message      transaction by the Client.The stream interface incorporates a parameter to pass a responseHandlerprocedure that is invoked when the message transaction completes.StreamSend( mcb, timeout, segptr, segsize, responseHandler )    map to main CSR for this client.|   Allocate a new csr if root in use.|   lastcsr := First csr for last request.|   if STIset(lastcsr)|       csr.LocalTransaction := lastcsr.LocalTransaction + 256|   else|       csr.LocalTransaction := lastcsr.LocalTransaction + 1    Init csr and check parameters and segment if any.    . . . ( rest is the same as for the normal Send)Notes:   1. Each outstanding message transaction is represented by a CSR      queued on the root CSR for this client entity.  The root CSR      is used to handle timeouts, etc.  On timeout, the last packetCheriton                                                       [page 55]

RFC 1045                       VMTP                        February 1988      from the last packet group is retransmitted (with or without      the segment data).4.6.2. GetResponseGetResponse( req, timeout, segptr, segsize )    csr := CurrentCSR;    if responses queued then return next response      (in req, segptr to max of segsize )    if timeout is zero then return KERNEL_TIMEOUT error    set state to AWAITING_RESPONSE    Timeout( csr, timeout, ReturnKernelTimeout );end GetResponseNotes:   1. GetResponse is only used with multicast Requests, which is      the only case in which multiple (different) Responses should      be received.   2. A response must remain queued until the next message      transaction is invoked to filter out duplicates of this      response.   3. If the response is incomplete (only relevant if a      multi-packet response), then the client may wait for the      response to be fully received, including issuing requests for      retransmission (using NotifyVmtpServer operations) before      returning the response.   4. As an optimization, a response may be stored in the CSR of      the client.  In this case, the response must be transferred      to a separate buffer (for duplicate suppression) before      waiting for another response.  Using this optimization, a      response buffer is not allocated in the common case of the      client receiving only one response.4.7. Packet ArrivalIn general, on packet reception, a packet is mapped to the client staterecord, decrypted if necessary using the key in the CSR.  It then hasits checksum verified and then is transformed to the right byte order.The packet is then processed fully relative to its packet function code.It is discarded immediately if it is addressed to a different domainthan the domain(s) in which the receiving host participates.Cheriton                                                       [page 56]

RFC 1045                       VMTP                        February 1988For each of the 2 packet types, we assume a procedure called with apointer p to the VMTP packet and psize, the size of the packet inoctets.  Thus, generic packet reception is:if not LocalDomain(p.Domain) then return;csr := MapClient( p.Client )if csr is NULL then    HandleNoCsr( p, psize )    returnif Secure(p) then    if SecureVMTP not supported then        { Assume a Request. }        if not Multicast(p) then            NotifyClient(NULL, p, SECURITY_NOT_SUPPORTED )        return    endif|   Decrypt( csr.Key, p, psize )if p.Checksum not null then    if not VerifyChecksum(p, psize) then return;if OppositeByteOrder(p) then ByteSwap( p, psize )if psize not equal sizeof(VmtpHeader) + 4*p.Length then    NotifyClient(NULL, p, VMTP_ERROR )    returnInvoke Procedure[p.FuncCode]( csr, p, psize )Discard packet and returnNotes:   1. The Procedure[p.FuncCode] refers to one of the 2 procedures      corresponding to the two different packet types of VMTP,      Requests and Responses.   2. In all the following descriptions, a packet is discarded on      "return" unless otherwise stated.   3. The procedure HandleNoCSR is a management routine that      allocates and initializes a CSR and processes the packet or      else sends an error indication to the sender of the packet.      This procedure is described in greater detail inSection4.8.1.Cheriton                                                       [page 57]

RFC 1045                       VMTP                        February 19884.7.1. ResponseThis procedure handles incoming Response packets.HandleResponse( csr, p, psize )    if not LocalClient( csr ) then        if Multicast then return|       if Migrated( p.Client ) then|           NotifyServer(csr, p ENTITY_MIGRATED )|       else            NotifyServer(csr, p, ENTITY_NOT_HERE )        return    endif    if NSRset(p) then        if Streaming not supported then            NotifyServer(csr, p, STREAMING_NOT_SUPPORTED )            return STREAMED_RESPONSE|       Find csr corresponding to p.Transaction|       if none found then|           NotifyServer(csr, p, BAD_TRANSACTION_ID )|           return     else      if csr.LocalTransaction not equal p.Transaction then        NotifyServer(csr, p, BAD_TRANSACTION_ID )        return    endif    Locate reply buffer rb for this p.Server    if found then        if rb.State is not ReceivingResponse then          { Duplicate }            if APGset(p) or NERset(p) then                { Send Response to stop response packets. }                NotifyServer(csr, p, RESPONSE_DISCARDED )            endif            return         endif         { rb.State is ReceivingRequest}         if new segment data then retain in CSR segment area.         if packetgroup not complete then             Timeout( rb, TC3(p.Server), LocalClientTimeout )             return;          endif          goto EndPacketGroup    endif    { Otherwise, a new response message. }Cheriton                                                       [page 58]

RFC 1045                       VMTP                        February 1988    if (NSRset(p) or NERset(p)) and NoStreaming then        NotifyServer(csr, p, VMTP_ERROR )        return|    if NSRset(p) then|      { Check consecutive with previous packet group }|       Find last packet group CSR from p.Server.|       if p.Transaction not|             lastcsr.RemoteTransaction+1 mod 2**32 then|         { Out of order packet group }|            NotifyServer(csr, p, BAD_TRANSACTION_ID)|           return|       endif|       if lastcsr not completed then|           NotifyServer(lastcsr, p, RETRY )|       endif|       if CMG(lastcsr) then|           Add segment data to lastcsr Response|           Notify lastcsr with new packet group.|           Clear lastcsr.VerifyInterval|       else|           if lastcsr available then|                 use it for this packet group|           else allocate and initialize new CSR|           Save message and segment data in new CSR area.|       endif|   else { First packet group }        Allocate and init reply buffer rb for this response.        if allocation fails then            NotifyServer(csr, p, BUSY )            return        Set rb.State to ReceivingResponse        Copy message and segment data to rb's segment area         and set rb.PacketDelivery to that delivered.        Save p.Server host address in ServerHost cache.    endif    if packetgroup not complete then        Timeout( rb, TS1(p.Client), LocalClientTimeout )        return;    endifendPacketGroup:    { We have received last packet in packet group. }    if APGset(p) then NotifyServer(csr, p, OK )|   if NERset(p) and CMGset(p) then|       Queue waiting for continuation packet group.|       Timeout( rb, TC2(rb.Server), LocalClientTimeout )|       return|   endifCheriton                                                       [page 59]

RFC 1045                       VMTP                        February 1988    { Deliver response message. }    Deliver response to Client, or queue as appropriate.end HandleResponseNotes:   1. The mechanism for handling streaming is optional and can be      replaced with the tests for use of streaming.  Note that the      server should never stream at the Client unless the Client      has streamed at the Server or has used the STI control bit.      Otherwise, streamed Responses are a protocol error.   2. As an optimization, a Response can be stored into the CSR for      the Client rather than allocating a separate CSR for a      response buffer.  However, if multiple responses are handled,      the code must be careful to perform duplicate detection on      the Response stored there as well as those queued.  In      addition, GetResponse must create a queued version of this      Response before allowing it to be overwritten.   3. The handling of Group Responses has been omitted for brevity.      Basically, a Response is accepted if there has been a Request      received locally from the same Client and same Transaction      that has not been responded to.  In this case, the Response      is delivered to the Server or queued.Cheriton                                                       [page 60]

RFC 1045                       VMTP                        February 19884.8. Management OperationsVMTP uses management operations (invoked as remote procedure calls) toeffectively acknowledge packet groups and request retransmissions.  Thefollowing routine is invoked by the Client's management module onrequest from the Server.NotifyVmtpClient( clientId,ctrl,receiveSeqNumber,transact,delivery,code)    Get csr for clientId    if none then return    if RemoteClient( csr ) and not NotifyVmtpRemoteClient then       return|   else (for streaming)|      Find csr with same LocalTransaction as transact|      if csr is NULL then return    if csr.State not AwaitingResponse then return    if ctrl.PGcount then ack previous packet groups.    select on code      case OK:        Notify ack'ed segment blocks from delivery        Clear csr.RetransCount;        Timeout( csr, TC1(csr.Server), LocalClientTimeout )        return      case RETRY:        Set csr.TransmissionMask to missing segment blocks,            as specified by delivery        SendPacketGroup( csr )        Timeout( csr, TC1(csr.Server), LocalClientTimeout )      case RETRY_ALL        Set csr.TransmissionMask to retransmit all blocks.        SendPacketGroup( csr )        Timeout( csr, TC1(csr.Server), LocalClientTimeout )|       if streaming then|          Restart transmission of packet groups,|                starting from transact+1         return      case BUSY:         if csr.TimeLimit exceeded then             Set csr.Code to USER_TIMEOUT             return Response to application             return;        Set csr.TransmissionMask for full retransmission        Clear csr.RetransCount        Timeout( csr, TC1(csr.Server), LocalClientTimeout )        return      case ENTITY_MIGRATED:        Get new host address for entityCheriton                                                       [page 61]

RFC 1045                       VMTP                        February 1988        Set csr.TransmissionMask for full retransmission        Clear csr.RetransCount        SendPacketGroup( csr )        Timeout( csr, TC1(csr.Server), LocalClientTimeout )        return      case STREAMING_NOT_SUPPORTED:        Record that server does not support streaming        if CMG(csr) then forget this packet group        else resend Request as separate packet group.        return      default:         Set csr.Code to code         return Response to application         return;    endselectend NotifyVmtpClientNotes:   1. The delivery parameter indicates the segment blocks received      by the Server.  That is, a 1 bit in the i-th position      indicates that the i-th segment block in the segment data of      the Request was received.  All subsequent NotifyVmtpClient      operations for this transaction should be set to acknowledge      a superset of the segment blocks in this packet.  In      particular, the Client need not be prepared to retransmit the      segment data once it has been acknowledged by a Notify      operation.4.8.1. HandleNoCSRHandleNoCSR is called when a packet arrives for which there is no CSRmatching the client field of the packet.HandleNoCSR( p, psize )    if Secure(p) then        if SecureVMTP not supported then            { Assume a Request }            if not Multicast(p) then                NotifyClient(NULL,p,SECURITY_NOT_SUPPORTED)            return        endif        HandleRequestNoCSR( p, psize )        return    endifCheriton                                                       [page 62]

RFC 1045                       VMTP                        February 1988    if p.Checksum not null then        if not VerifyChecksum(p, psize) then return;    if OppositeByteOrder(p) then ByteSwap( p, psize )    if psize not equal sizeof(VmtpHeader) + 4*p.Length then        NotifyClient(NULL, p, VMTP_ERROR )        return    if p.FuncCode is Response then|        if Migrated( p.Client ) then|           NotifyServer(csr, p ENTITY_MIGRATED )|       else            NotifyServer(csr, p, NONEXISTENT_ENTITY )        return    endif    if p.FuncCode is Request then       HandleRequestNoCSR( p, psize )    returnend HandleNoCSRNotes:   1. The node need only check to see if the client entity has      migrated if in fact it supports migration of entities.   2. The procedure HandleRequestNoCSR is specified inSection5.8.1.  In the minimal client version, it need only handle      Probe requests and can do so directly without allocating a      new CSR.Cheriton                                                       [page 63]

RFC 1045                       VMTP                        February 19884.9. TimeoutsA client with a message transaction in progress has a single timercorresponding to the first unacknowledged request message.  (In theabsence of streaming, this request is also the last request sent.)  Thistimeout is handled as follows:LocalClientTimeout( csr )  select on csr.State    case AwaitingResponse:      if csr.RetransCount > MaxRetrans(csr.Server) then             terminate Client's message transactions up to             and including the current message transaction.             set return code to KERNEL_TIMEOUT          return      increment csr.RetransCount      Resend current packet group with APG set.      Timeout( csr, TC2(csr.Server), LocalClientTimeout )      return    case ReceivingResponse:      if DGMset(csr) or csr.RetransCount > Max then         if MDMset(csr) then            Set MCB.MsgDeliveryMask to blocks received.         else            Set csr.Code to BAD_REPLY_SEGMENT         return to user Client      endif      increment csr.RetransCount      NotifyServer with RETRY      Timeout( csr, TC3(csr.Server), LocalClientTimeout )      return  end selectend LocalClientTimeoutNotes:   1. A Client can only request retransmission of a Response if the      Response is not idempotent.  If idempotent, it must      retransmit the Request.  The Server should generally support      the MsgDeliveryMask for Requests that it treats as idempotent      and that require multi-packet Responses.  Otherwise, there is      no selective retransmission for idempotent message      transactions.   2. The current packet group is the last one transmitted.  Thus,      with streaming, there may be several packet groups      outstanding that precede the current packet group.Cheriton                                                       [page 64]

RFC 1045                       VMTP                        February 1988   3. The Request packet group should be retransmitted without the      segment data, resulting in a single short packet in the      retransmission.  The Server must then send a      NotifyVmtpClient with a RETRY or RETRY_ALL code to get the      segment data transmitted as needed.  This strategy minimizes      the overhead on the network and the server(s) for      retransmissions.Cheriton                                                       [page 65]

RFC 1045                       VMTP                        February 19885. Server Protocol OperationThis section describes the operation of the server portion of theprotocol in terms of the procedures for handling VMTP user events,packet reception events and timeout events.  Each server is assumed toimplement the client procedures described in the previous chapter.(This is not strictly necessary but it simplifies the exposition.)5.1. Remote Client State Record FieldsThe CSR for a server is extended with the following fields, in additionto the ones listed for the client version.RemoteClient    Identifier for remote client that sent the Request that                this CSR is handling.RemoteClientLink                Link to next CSR hashing to same hash index in the                ClientMap.RemoteTransaction                Transaction identifier for Request from remote client.RemoteDelivery  The segment blocks received so far as part of a Request                or yet to be acknowledged as part of a Response.VerifyInterval  Time interval since there was confirmation that the                remote Client was still valid.RemotePrincipal Account identification, possibly including key and key                timeout for secure communication.5.2. Remote Client Protocol StatesA CSR in the server end is in one of the following states.AwaitingRequest Waiting for a Request packet group.  It may be marked as                waiting on a specific Client, or on any Client.ReceivingRequest                Waiting to receive additional Request packets in a                multi-packet group Request.Responded       The Response has been sent and the CSR is timing out,                providing duplicate suppression and retransmission (ifCheriton                                                       [page 66]

RFC 1045                       VMTP                        February 1988                the Response was not idempotent).ResponseDiscarded                Response has been acknowledged or has timed out so                cannot be retransmitted.  However, duplicates are still                filtered and CSR can be reused for new message                transaction.Processing      Executing on behalf of the Client.Forwarded       The message transaction has been forwarded to another                Server that is to respond directly to the Client.5.3. State Transition DiagramsThe CSR state transitions in the server are illustrated in Figure 5-1.The CSR generally starts in the AwaitingRequest state.  On receipt of aRequest, the Server either has an up-to-date CSR for the Client or elseit sends a Probe request (as a separate VMTP message transaction) to theVMTP management module associated with the Client.  In the latter case,the processing of the Request is delayed until a Response to the Proberequest is received.  At that time, the CSR information is brought up todate and the Request is processed.  If the Request is a single-packetrequest, the CSR is then set in the Processing state to handle therequest.  Otherwise (a multi-packet Request), the CSR is put into theReceivingResponse state, waiting to receive subsequent Request packetsthat constitute the Request message.  It exits the ReceivingRequeststate on timeout or on receiving the last Request packet.  In the formercase, the request is delivered with an indication of the portionreceived, using the MsgDelivery field if MDM is set.  After requestprocessing is complete, either the Response is sent and the CSR entersthe Responded state or the message transaction is forwarded and the CSRenters the Forwarded state.In the Responded state, if the Response is not marked as idempotent, theResponse is retransmitted on receipt of a retransmission of thecorresponding Request, on receipt of a NotifyVmtpServer operationrequesting retransmission or on timeout at which time APG is set,requesting an acknowledgment from the Client.  The Response isretransmitted some maximum number of times at which time the Response isdiscarded and the CSR is marked accordingly.  If a Request or aNotifyVmtpServer operation is received expecting retransmission of theResponse after the CSR has entered the ResponseDiscarded state, aNotifyVmtpClient operation is sent back (or invoked in the Clientmanagement module) indicating that the response was discarded unless theRequest was multicast, in which case no action is taken.  After aCheriton                                                       [page 67]

RFC 1045                       VMTP                        February 1988     (Retransmit Forwarded Request and NotifyVmtpClient)                    Request/                    Ack/                   +Timeout+                   V       |                 +-|-------^-+                 |           |          +-Time-| Forwarded |<-------------+          |  out +-----------+              |          |                                 |          |          (Retransmit Response)  |          |                      Request    |          V                      Ack        |          |                    +-Timeout-+  |          |                    V         |  |        +---------+ Ack/ +|---------^+ | +-Time-|Response |<-Timeout--| Responded | | |  out |Discarded|           +----^------+ | |      +---------+                |        | |  +------------+                 |        | |  |            |->-Send Response-+        | |  |            |->-forward Request--------+ +->| Processing |<----------------------+ |  |            |<----------------+     | |  |            |<---|            |     | |  +-|--------^-+    |          Last    | | Receive     |      |          Request | |    |   Timeout   Single       Packet  | |    |        |    Packet         |   Timeout |    |        |    Request        ^     ^ |    |        |      ^           +|-----|--+ |  +-V--------|-+    |           |Receiving|<-+Time +->|  Awaiting  |->--+->Request->| Request |--+ out    |  Request   |    |  (multi-  +---------+    +------|-----+    ^  packet)        Request       |           |        Response      Send Probe     to           |        Probe       +---V----+     |       |Awaiting|     ^       |Response|-->--+       |to Probe|       +--------+             Figure 5-1:   Remote Client State Transitionstimeout corresponding to the time required to filter out duplicates, theCheriton                                                       [page 68]

RFC 1045                       VMTP                        February 1988CSR returns either to the AwaitingRequest state or to the Processingstate.  Note that "Ack" refers to acknowledgment by a Notify operation.A Request that is forwarded leaves the CSR in the Forwarded state.  Inthe Forwarded state, the forwarded Request is retransmittedperiodically, expecting NotifyRemoteClient operations back from theServer to which the Request was forwarded, analogous to the Clientbehavior in the AwaitingResponse state.  In this state, aNotifyRemoteClient from this Server acknowledges the Request or asksthat it be retransmitted or reports an error.  A retransmission of theRequest from the Client causes a NotifyVmtpClient to be returned to theClient if APG is set.  The CSR leaves the Forwarded state after timingout in the absence of NotifyRemoteClient operations from the forwardServer or on receipt of a NotifyRemoteClient operation indicating theforward Server has sent a Response and received an acknowledgement.  Itthen enters the ResponseDiscarded state.Receipt of a new Request from the same Client aborts the currenttransaction, independent of its state, and initiates a new transactionunless the new Request is part of a run of message transactions.  If itis part of a run of message transactions, the handling follows the statediagram except the new Request is not Processed until there has been aresponse sent to the previous transaction.5.4. User InterfaceThe RPC or user interface to VMTP is implementation-dependent and mayuse systems calls, functions or some other mechanism.  The list ofrequests that follow is intended to suggest the basic functionality thatshould be available.AcceptMessage( reqmcb, segptr, segsize, client, transid, timeout )                Accept a new Request message in the specified reqmcb                area, placing the segment data, if any, in the area                described by segptr and segsize.  This returns the                Server in the entityId field of the reqmcb and actual                segment size in the segsize parameters.  It also returns                the Client and Transaction for this message transaction                in the corresponding parameters.  This procedure                supports message semantics for request processing.  When                a server process executes this call, it blocks until a                Request message has been queued for the server.                AcceptMessage returns after the specified timeout period                if a message has not been received by that time.RespondMessage( responsemcb, client, transid, segptr )Cheriton                                                       [page 69]

RFC 1045                       VMTP                        February 1988                Respond to the client with the specified response                message and segment, again with message semantics.RespondCall( responsemcb, segptr )                Respond to the client with the specified response                message and segment, with remote procedure call                semantics.  This procedure does not return.  The                lightweight process that executes this procedure is                matched to a stack, program counter, segment area and                priority from the information provided in a                ModifyService call, as specified inAppendix III.ForwardMessage( requestmcb, transid, segptr, segsize, forwardserver )                Forward the client to the specified forwardserver with                the request specified in mcb.ForwardCall( requestmcb, segptr, segsize, forwardserver )                Forward the client transaction to the specified                forwardserver with the request specified by requestmcb.                This procedure does not return.GetRemoteClientId()                Return the entityId for the remote client on whose                behave the process is executing.  This is only                applicable in the procedure call model of request                handling.GetForwarder( client )                Return the entity that forwarded this Request, if any.GetProcess( client )                Return an identifier for the process associated with                this client entity-id.GetPrincipal( client )                Return the principal associated with this client                entity-id.5.5. Event ProcessingThe following events may occur in VMTP servers.   - User Requests        * ReceiveCheriton                                                       [page 70]

RFC 1045                       VMTP                        February 1988        * Respond        * Forward        * GetForwarder        * GetProcess        * GetPrincipal   - Packet Arrival        * Request Packet   - Management Operations        * NotifyVmtpServer   - Timeouts        * Client State Record TimeoutThe handling of these events is described in detail in the followingsubsections.  The conventions of the previous chapter are followed,including the use of the various subroutines in the description.5.6. Server User-invoked EventsA user event occurs when a VMTP server invokes one of the VMTP interfaceprocedures.5.6.1. ReceiveAcceptMessage(reqmcb, segptr, segsize, client, transid, timeout)    Locate server's request queue.    if request is queued then        Remember CSR associated with this Request.        return Request in reqmcb, segptr and segsize               and client and transaction id.    Wait on server's request queue for next request    up time timeout seconds.end ReceiveCallNotes:Cheriton                                                       [page 71]

RFC 1045                       VMTP                        February 1988   1. If a multi-packet Request is partially received at the time      of the AcceptMessage, the process waits until it completes.   2. The behavior of a process accepting a Request as a      lightweight thread is similar except that the process      executes using the Request data logically as part of the      requesting Client process.5.6.2. RespondRespondCall is described as one case of the Respond transmissionprocedure; RespondMessage is similar.RespondCall( responsemcb, responsesegptr )    Locate csr for this client.    Check segment data accessible, if any    if local client then        Handle locally        return    endif    if responsemcb.Code is RESPONSE_DISCARDED then        Mark as RESPONSE_DISCARDED        return    SendPacketGroup( csr )    set csr.State to Responded.    if DGM reply then { Idempotent }        release segment data        Timeout( csr, TS4(csr.Client), FreeCsr );    else { Await acknowledgement or new Request else ask for ack. }        Timeout( csr, TS5(csr.Client), RemoteClientTimeout )end RespondCallNotes:   1. RespondMessage is similar except the Server process must be      synchronized with the release of the segment data (if any).   2. The non-idempotent Response with segment data is sent first      without a request for an acknowledgement.  The Response is      retransmitted after time TS5(client) if no acknowledgment or      new Request is received from the client in the meantime.  At      this point, the APG bit is sent.   3. The MCB of the Response is buffered in the client CSR, which      remains for TS4 seconds, sufficient to filter old duplicates.      The segment data (if any) must be retained intact until:  (1)Cheriton                                                       [page 72]

RFC 1045                       VMTP                        February 1988      after transmission if idempotent or (2) after acknowledged or      timeout has occurred if not idempotent.  Techniques such as      copy-on-write might be used to keep a copy of the Response      segment data without incurring the cost of a copy.5.6.3. ForwardForwarding is logically initiating a new message transaction between theServer (now acting as a Client) and the server to which the Request isforwarded.  When the second server returns a Response, the same Responseis immediately returned to the Client.  The forwarding support in VMTPpreserves these semantics while providing some performance optimizationsin some cases.ForwardCall( req, segptr, segsize, forwardserver )    Locate csr for this client.    Check segment data accessible, if any    if local client or Request was multicast or secure       or csr.ForwardCount == 15 then        Handle as a new Send operation        return    if forwardserver is local then        Handle locally        return    Set csr.funccode to Request    Increment csr.ForwardCount    Set csr.State to Responded    SendPacketGroup( csr ) { To ForwardServer }    Timeout( csr, TS4(csr.Client), FreeAlien )end ForwardCallNotes:   1. A Forward is logically a new call or message transaction.  It      must be really implemented as a new message transaction if      the original Request was multicast or secure (with the      optional further refinement that it can be used with a secure      message transaction when the Server and ForwardServer are the      same principal and the Request was not multicast).   2. A Forward operation is never handled as an idempotent      operation because it requires knowledge that the      ForwardServer will treat the forwarded operation as      idempotent as well.  Thus, a Forward operation that includes      a segment should set APG on the first transmission of theCheriton                                                       [page 73]

RFC 1045                       VMTP                        February 1988      forwarded Request to get an acknowledgement for this data.      Once the acknowledgement is received, the forwarding Server      can discard the segment data, leaving only the basic CSR to      handle retransmissions from the Client.5.6.4. Other FunctionsGetRemoteClient is a simple local query of the CSR.  GetProcess andGetPrincipal also extract this information from the CSR.  A servermodule may defer the Probe callback to the Client to get thatinformation until it is requested by the Server (assuming it is notusing secure communication and duplicate suppression is adequate withoutcallback.)  GetForwarder is implemented as a callback to the Client,using a GetRequestForwarder VMTP management operation.  Additionalmanagement procedures for VMTP are described inAppendix III.5.7. Request Packet ArrivalThe basic packet reception follows that described for the Clientroutines.  A Request packet is handled by the procedure HandleRequest.HandleRequest( csr, p, psize )    if LocalClient(csr) then        { Forwarded Request on local Client }        if csr.LocalTransaction != p.Transaction then return        if csr.State != AwaitingResponse then return        if p.ForwardCount < csr.ForwardCount then           Discard Request and return.        Find a CSR for Client as a remote Client.        if not found then            if packet group complete then                handle as a local message transaction                return            Allocate and init CSR            goto newTransaction        { Otherwise part of current transaction }        { Handle directly below. }n    if csr.RemoteTransaction = p.Transaction then      { Matches current transaction }        if OldForward(p.ForwardCount,csr.ForwardCount) then            return        if p.ForwardCount > csr.ForwardCount then          { New forwarded transaction }            goto newTransactionCheriton                                                       [page 74]

RFC 1045                       VMTP                        February 1988        { Otherwise part of current transaction }        if csr.State = ReceivingRequest then            if new segment data then retain in CSR segment area.            if Request not complete then               Timeout( csr, TS1(p.Client), RemoteClientTimeout )               return;            endif            goto endPacketGroup        endif        if csr.State is Responded then          { Duplicate }            if csr.Code is RESPONSE_DISCARDED               and Multicast(p) then                return            endif            if not DGM(csr) then { Not idempotent }                if SegmentData(csr) then set APG                { Resend Response or Request, if Forwarded }                SendPacketGroup( csr )                timeout=if SegmentData(csr) then TS5(csr.Client)                          else TS4(csr.Client)                Timeout( csr, timeout, RemoteClientTimeout )                return            { Else idempotent - fall thru to newTransaction }        else { Presume it is a retransmission }            NotifyClient( csr, p, OK )            return   else if OldTransaction(csr.RemoteTransact,p.Transaction) then        return    { Otherwise, a new message transaction. }newTransaction:    Abort handling of previous transactions for this Client.    if (NSRset(p) or NERset(p)) and NoStreaming then        NotifyClient( csr, p, STREAMING_NOT_SUPPORTED )        return|   if NSRset(p) then { Streaming }|     { Check that consecutive with previous packet group }|       Find last packet group CSR from this client.|      if p.Transaction not lastcsr.RemoteTransaction+1 mod 2**32|         and not STIset(lastcsr) or|        p.Transaction not lastcsr.RemoteTransaction+256 mod **32|        then|         { Out of order packet group }|         NotifyClient(csr, p, BAD_TRANSACTION_ID )|         return|       endifCheriton                                                       [page 75]

RFC 1045                       VMTP                        February 1988|       if lastcsr not completed then|           NotifyClient( lastcsr, p, RETRY )|       endif|       if lastcsr available then use it for this packet group|       else allocate and initialize new CSR|       if CMG(lastcsr) then|          Add segment data to lastcsr Request|          Keep csr as record of this packet group.|          Clear lastcsr.VerifyInterval|      endif|   else { First packet group }        if MultipleRemoteClients(csr) then ScavengeCsrs(p.Client)        Set csr.RemoteTransaction, csr.Priority        Copy message and segment data to csr's segment area         and set csr.PacketDelivery to that delivered.        Clear csr.PacketDelivery        Clear csr.VerifyInterval        SaveNetworkAddress( csr, p )    endif    if packetgroup not complete then        Timeout( csr, TS3(p.Client), RemoteClientTimeout )        return;    endifendPacketGroup:    { We have received complete packet group. }    if APG(p) then NotifyClient( csr, p, OK )    endif|   if NERset(p) and CMG(p) then|       Queue waiting for continuation packet group.|       Timeout( csr, TS3(csr.Client), RemoteClientTimeout )|       return|   endif    { Deliver request message. }    if GroupId(csr.Server) then        For each server identified by csr.Server            Replicate csr and associated data segment.            if CMDset(csr) and Server busy then               Discard csr and data            else               Deliver or invoke csr for each Server.            if not DGMset(csr) then queue for Response            else Timeout( csr, TS4(csr.Client), FreeCsr )        endfor     else       if CMDset(csr) and Server busy then           Discard csr and data        elseCheriton                                                       [page 76]

RFC 1045                       VMTP                        February 1988           Deliver or invoke csr for this server.        if not DGMset(csr) then queue for Response        else Timeout( csr, TS4(csr.Client), FreeCsr )     endifend HandleRequestNotes:   1. A Request received that specifies a Client that is a local      entity should be a Request forwarded by a remote server to a      local Server.   2. An alternative structure for handling a Request sent to a      group when there are multiple local group members is to      create a remote CSR for each group member on reception of the      first packet and deliver a copy of each packet to each such      remote CSR as each packet arrives.Cheriton                                                       [page 77]

RFC 1045                       VMTP                        February 19885.8. Management OperationsVMTP uses management operations (invoked as remote procedure calls) toeffectively acknowledge packet groups and request retransmissions.  Thefollowing routine is invoked by the Server's management module onrequest from the Client.NotifyVmtpServer(server,clientId,transact,delivery,code)    Find csr with same RemoteTransaction and RemoteClient    as clientId and transact.    if not found or csr.State not Responded then return    if DGMset(csr) then        if transmission of Response in progress then            Abort transmission            if code is migrated then               restart transmission with new host addr.        if Retry then Report protocol error        return    endif    select on code      case RETRY:        if csr.RetransCount > MaxRetrans(clientId) then             if response data segment then                 Discard data and mark as RESPONSE_DISCARDED|                if NERset(csr) and subsequent csr then|                    Deallocate csr and use later csr for|                    future duplicate suppression|                endif             return        endif        increment csr.RetransCount        Set csr.TransmissionMask to missing segment blocks,            as specified by delivery        SendPacketGroup( csr )        Timeout( csr, TS3(csr.Client), RemoteClientTimeout )      case BUSY:        if csr.TimeLimit exceeded then            if response data segment then                Discard data and mark as RESPONSE_DISCARDED|               if NERset(csr) and subsequent csr then|                   Deallocate csr and use later csr for|                   future duplicate suppression|               endif             endif        endif        Set csr.TransmissionMask for full retransmission        Clear csr.RetransCountCheriton                                                       [page 78]

RFC 1045                       VMTP                        February 1988        Timeout( csr, TS3(csr.Server), RemoteClientTimeout )        return      case ENTITY_MIGRATED:        Get new host address for entity        Set csr.TransmissionMask for full retransmission        Clear csr.RetransCount        SendPacketGroup( csr )        Timeout( csr, TS3(csr.Server), RemoteClientTimeout )        return      case default:        Abort transmission of Response if in progress.        if response data segment then           Discard data and mark as RESPONSE_DISCARDED           if NERset(csr) and subsequent csr then               Deallocate csr and use later csr for               future duplicate suppression           endif        return    endselectend NotifyVmtpServerNotes:   1. A NotifyVmtpServer operation requesting retransmission of      the Response is acceptable only if the Response was not      idempotent.  When the Response is idempotent, the Client must      be prepared to retransmit the Request to effectively request      retransmission of the Response.   2. A NotifyVmtpServer operation may be received while the      Response is being transmitted.  If an error return, as an      efficiency, the transmission should be aborted, as suggested      when the Response is a datagram.   3. A NotifyVmtpServer operation indicating OK or an error      allows the Server to discard segment data and not provide for      subsequent retransmission of the Response.5.8.1. HandleRequestNoCSRWhen a Request is received from a Client for which the node has no CSR,the node allocates and initializes a CSR for this Client and does acallback to the Client's VMTP management module to get the Principal,Process and other information associated with this Client.  It alsoCheriton                                                       [page 79]

RFC 1045                       VMTP                        February 1988checks that the TransactionId is correct in order to filter outduplicates.HandleRequestNoCSR( p, psize )|   if Secure(p) then|       Allocate and init CSR|       SaveSourceHostAddr( csr, p )|       ProbeRemoteClient( csr, p, AUTH_PROBE )|       if no response or error then|          delete CSR|          return|       Decrypt( csr.Key, p, psize )|        if p.Checksum not null then|       if not VerifyChecksum(p, psize) then return;|       if OppositeByteOrder(p) then ByteSwap( p, psize )|       if psize not equal sizeof(VmtpHeader) + 4*p.Length then|          NotifyClient(NULL, p, VMTP_ERROR )|          return|       HandleRequest( csr, p, psize )|       return    if Server does not exist then        NotifyClient( csr, p, NONEXISTENT_ENTITY )        return    endif    if security required by server then        NotifyClient(csr, p, SECURITY_REQUIRED )        return    endif    Allocate and init CSR    SaveSourceHostAddr( csr, p );    if server requires Authentication then        ProbeRemoteClient( csr, p, AUTH_PROBE )        if no response or error then           delete CSR           return    endif    { Setup immediately as a new message transaction }    set csr.Server to p.Server    set csr.RemoteTransaction to p.Transaction-1    HandleRequest( csr, p, psize )    endifNotes:   1. A Probe request is always handled as a Request not requiring      authentication so it never generates a callback Probe to theCheriton                                                       [page 80]

RFC 1045                       VMTP                        February 1988      Client.   2. If the Server host retains remote client CSR's for longer      than the maximum packet lifetime and the Request      retransmission time, and the host has been running for at      least that long, then it is not necessary to do a Probe      callback unless the Request is secure.  A Probe callback can      take place when the Server asks for the Process or      PrincipalId associated with the Client.Cheriton                                                       [page 81]

RFC 1045                       VMTP                        February 19885.9. TimeoutsThe server must implement a timeout for remote client CSRs.  There is atimeout for each CSR in the server.RemoteClientTimeout( csr )  select on csr.State    case Responded:        if RESPONSE_DISCARDED then            mark as timed out            Make a candidate for reuse.            return        if csr.RetransCount > MaxRetrans(Client) then            discard Response            mark CSR as RESPONSE_DISCARDED            Timeout(csr, TS4(Client), RemoteClientTimeout)            return        increment csr.RetransCount        { Retransmit Response or forwarded Request }        Set APG to get acknowledgement.        SendPacketGroup( csr )        Timeout( csr, TS3(Client), RemoteClientTimeout )        return    case ReceivingRequest:      if csr.RetransCount > MaxRetrans(csr.Client)         or DGMset(csr) or NRTset(csr) then          Modify csr.segmentSize and csr.MsgDelivery          to indicate packets received.          if MDMset(csr) then              Invoke processing on Request              return          else              discard Request and reuse CSR              (Note: Need not remember Request discarded.)              return      increment csr.RetransCount      NotifyClient( csr, p, RETRY )      Timeout( csr, TS3(Client), RemoteClientTimeout )      return    default:        Report error - invalid state for RemoteClientTimeout    endselectend RemoteClientTimeoutNotes:   1. When a CSR in the Responded state times out after discardingCheriton                                                       [page 82]

RFC 1045                       VMTP                        February 1988      the Response, it can be made available for reuse, either by      the same Client or a different one.  The CSR should be kept      available for reuse by the Client for as long as possible to      avoid unnecessary callback Probes.Cheriton                                                       [page 83]

RFC 1045                       VMTP                        February 19886. Concluding RemarksThis document represents a description of the current state of the VMTPdesign.  We are currently engaged in several experimentalimplementations to explore and refine all aspects of the protocol.Preliminary implementations are running in the UNIX 4.3BSD kernel and inthe V kernel.Several issues are still being discussed and explored with thisprotocol.  First, the size of the checksum field and the algorithm touse for its calculation are undergoing some discussion.  The authorbelieves that the conventional 16-bit checksum used with TCP and IP istoo weak for future high-speed networks, arguing for at least a 32-bitchecksum.  Unfortunately, there appears to be limited theory coveringchecksum algorithms that are suitable for calculation in software.Implementation of the streaming facilities of VMTP is still in progress.This facility is expected to be important for wide-area, long delaycommunication.Cheriton                                                       [page 84]

RFC 1045                       VMTP                        February 1988I. Standard VMTP Response CodesThe following are the numeric values of the response codes used in VMTP.0               OK1               RETRY2               RETRY_ALL3               BUSY4               NONEXISTENT_ENTITY5               ENTITY_MIGRATED6               NO_PERMISSION7               NOT_AWAITING_MSG8               VMTP_ERROR9               MSGTRANS_OVERFLOW10              BAD_TRANSACTION_ID11              STREAMING_NOT_SUPPORTED12              NO_RUN_RECORD13              RETRANS_TIMEOUT14              USER_TIMEOUT15              RESPONSE_DISCARDED16              SECURITY_NOT_SUPPORTED17              BAD_REPLY_SEGMENT18              SECURITY_REQUIRED19              STREAMED_RESPONSE20              TOO_MANY_RETRIES21              NO_PRINCIPALCheriton                                                       [page 85]

RFC 1045                       VMTP                        February 198822              NO_KEY23              ENCRYPTION_NOT_SUPPORTED24              NO_AUTHENTICATOR25-63           Reserved for future VMTP assignment.Other values of the codes are available for use by higher levelprotocols.  Separate protocol documents will specify further standardvalues.Applications are free to use values starting at 0x00800000 (hex) forapplication-specific return values.Cheriton                                                       [page 86]

RFC 1045                       VMTP                        February 1988II. VMTP RPC Presentation ProtocolFor complete generality, the mapping of the procedures and theparameters onto VMTP messages should be defined by a RPC presentationprotocol.  In the absence of an accepted standard protocol, we define anRPC presentation protocol for VMTP as follows.Each procedure is assigned an identifying Request Code.  The Requestcode serves effectively the same as a tag field of variant record,identifying the format of the Request and associated Response as avariant of the possible message formats.The format of the Request for a procedure is its Request Code followedby its parameters sequentially in the message control block until it isfull.The remaining parameters are sent as part of the message segment dataformatted according to the XDR protocol (RFC ??).  In this case, thesize of the segment is specified in the SegmentSize field.The Response for a procedure consists of a ResponseCode field followedby the return parameters sequentially in the message control block,except if there is a parameter returned that must be transmitted assegment data, its size is specified in the SegmentSize field and theparameter is stored in the SegmentData field.Attributes associated with procedure definitions should indicate theFlags to be used in the RequestCode.  Request Codes are assigned asdescribed below.II.1. Request Code ManagementRequest codes are divided into Public Interface Codes andapplication-specific, according to whether the PIC value is set.  Aninterface is a set of request codes representing one service or modulefunction.  A public interface is one that is to be used in multipleindependently developed modules.  In VMTP, public interface codes areallocated in units of 256 structured as +-------------+----------------+-------------------+ | ControlFlags|  Interface     | Version/Procedure | +-------------+----------------+-------------------+    8 bits          16 bits              8 bitsAn interface is free to allocate the 8 bits for version and procedure asdesired.  For example, all 8 bits can be used for procedures.  A modulerequiring more than 256 Version/Procedure values can be allocatedCheriton                                                       [page 87]

RFC 1045                       VMTP                        February 1988multiple Interface values.  They need not be consecutive Interfacevalues.Cheriton                                                       [page 88]

RFC 1045                       VMTP                        February 1988III. VMTP Management ProceduresStandard procedures are defined for VMTP management, including creation,deletion and query of entities and entity groups, probing to getinformation about entities, and updating message transaction informationat the client or the server.The procedures are implemented by the VMTP manager that constitutes aportion of every complete VMTP module.  Each procedure is invoked bysending a Request to the VMTP manager that handles the entity specifiedin the operation or the local manager.  The Request sent using thenormal Send operation with the Server specified as the well-known entitygroup VMTP_MANGER_GROUP, using the CoResident Entity mechanism to directthe request to the specific manager that should handle the Request.(The ProbeEntity operation is multicast to the VMTP_MANAGER_GROUP if thehost address for the entity is not known locally and the host address isdetermined as the host address of the responder.  For all otheroperations, a ProbeEntity operation is used to determine the hostaddress if it is not known.)  Specifying co-resident entity 0 isinterpreted as the co-resident with the invoking process.  Theco-resident entity identifier may also specify a group in which case,the Request is sent to all managers with members in this group.The standard procedures with their RequestCode and parameters are listedbelow with their semantics.  (The RequestCode range 0xVV000100 to0xVV0001FF is reserved for use by the VMTP management routines, where VVis any choice of control flags with the PIC bit set.  The flags are setbelow as required for each procedure.)0x05000101 - ProbeEntity(CREntity, entityId, authDomain) -> (code,                <staterec>)                Request and return information on the specified entity                in the specified authDomain, sending the Request to the                VMTP management module coresident with CREntity.  An                error return is given if the requested information                cannot be provided in the specified authDomain.  The                <staterec> returned is structured as the following                fields.                Transaction identifier                                The current or next transaction                                identifier being used by the probed                                entity.                ProcessId: 64 bits                                Identifier for client process.  The                                meaning of this is specified as part ofCheriton                                                       [page 89]

RFC 1045                       VMTP                        February 1988                                the Domain definition.                PrincipalId     The identifier for the principal or                                account associated with the process                                specified by ProcessId.  The meaning of                                this field is specified as part of the                                Domain definition.                EffectivePrincipalId                                The identifier for the principal or                                account associated with the Client port,                                which may be different from the                                PrincipalId especially if this is an                                nested call.  The meaning of this field                                is specified as part of the Domain                                definition.                The code field indicates whether this is an error                response or not.  The codes and their interpretation                are:                  OK                No error. Probe was completed OK.                  NONEXISTENT_ENTITY                Specified entity does not exist.                  ENTITY_MIGRATED                The entity has migrated and is no longer at the host to                which the request was sent.                  NO_PERMISSION                Entity has refused to provide ProbeResponse.                  VMTP_ERROR                The Request packet group was in error relative to the                VMTP protocol specification.                  "default"                Some type of error - discard ProbeResponse.0x0D000102 - AuthProbeEntity(CREntity,entityId,authDomain,randomId) ->                (code,ProbeAuthenticator,EncryptType,EntityAuthenticator)                Request authentication of the entity specified by                entityId from the VMTP manager coresident with CREntity                in authDomain authentication domain, returning theCheriton                                                       [page 90]

RFC 1045                       VMTP                        February 1988                information contained in the return parameters.  The                fields are set the same as that specified for the basic                ProbeResponse except as noted below.                ProbeAuthenticator                                20 bytes consisting of the EntityId, the                                randomId and the probed Entity's current                                Transaction value plus a 32-bit checksum                                for these two fields (checksummed using                                the standard packet Checksum algorithm),                                all encrypted with the Key supplied in                                the Authenticator.                EncryptType     An identifier that identifies the                                variant of encryption method being used                                by the probed Entity for packets it                                transmits and packets it is able to                                receive.  (SeeAppendix V.)  The                                high-order 8 bits of the EncryptType                                contain the XOR of the 8 octets of the                                PrincipalId associated with private key                                used to encrypt the EntityAuthenticator.                                This value is used by the requestor or                                Client as an aid in locating the key to                                decrypt the authenticator.                EntityAuthenticator                                (returned as segment data) The                                ProcessId, PrincipalId,                                EffectivePrincipal associated with the                                ProbedEntity plus the private                                encryption/decryption key and its                                lifetime limit to be used for                                communication with the Entity.  The                                authenticator is encrypted with a                                private key associated with the Client                                entity such that it can be neither read                                nor forged by a party not trusted by the                                Client Entity.  The format of the                                Authenticator in the message segment is                                shown in detail in Figure III-1.                Key: 64 bits    Encryption key to be used for encrypting                                and decrypting packets sent to and                                received from the probed Entity.  This                                is the "working" key for packet                                transmissions.  VMTP only uses privateCheriton                                                       [page 91]

RFC 1045                       VMTP                        February 1988                +-----------------------------------------------+                |            ProcessId   (8 octets)             |                +-----------------------------------------------+                |           PrincipalId  (8 octets)             |                +-----------------------------------------------+                |           EffectivePrincipalId  (8 octets)    |                +-----------------------------------------------+                |            Key  (8 octets)                    |                +-----------------------------------------------+                |              KeyTimeLimit                     |                +-----------------------------------------------+                |              AuthDomain                       |                +-----------------------------------------------+                |               AuthChecksum                    |                +-----------------------------------------------+                  Figure III-1:   Authenticator Format                                key encryption for data transmission.                KeyTimeLimit: 32 bits                                The time in seconds since Dec. 31st,                                1969 GMT at which one should cease to                                use the Key.                AuthDomain: 32 bits                                The authentication domain in which to                                interpret the principal identifiers.                                This may be different from the                                authDomain specified in the call if the                                Server cannot provide the authentication                                information in the request domain.                AuthChecksum: 32 bits                                Contains the checksum (using the same                                Checksum algorithm as for packet) of                                KeyTimeLimit, Key, PrincipalId and                                EffectivePrincipalId.                Notes:                   1. A authentication Probe Request and Response                      are sent unencrypted in general because it is                      used prior to there being a secure channel.                      Therefore, specific fields or groups of                      fields checksummed and encrypted to prevent                      unauthorized modification or forgery.  InCheriton                                                       [page 92]

RFC 1045                       VMTP                        February 1988                      particular, the ProbeAuthenticator is                      checksummed and encrypted with the Key.                   2. The ProbeAuthenticator authenticates the                      Response as responding to the Request when                      its EntityId, randomId and Transaction values                      match those in the Probe request.  The                      ProbeAutenticator is bound to the                      EntityAutenticator by being encrypted by the                      private Key contained in that authenticator.                   3. The authenticator is encrypted such that it                      can be decrypted by a private key, known to                      the Client.  This authenticator is presumably                      obtained from a key distribution center that                      the Client trusts.  The AuthChecksum prevents                      undetected modifications to the                      authenticator.0x05000103 - ProbeEntityBlock( entityId ) -> ( code, entityId )                Check whether the block of 256 entity identifiers                associated with this entityId are in use.  The entityId                returned should match that being queried or else the                return value should be ignored and the operation redone.0x05000104 - QueryVMTPNode( entityId ) -> (code, MTU, flags, authdomain,                domains, authdomains, domainlist)                Query the VMTP management module for entityId to get                various module- or node-wide parameters, including:  (1)                MTU - Maximum transmission unit or packet size handled                by this node.  (2) flags- zero or more of the following                bit fields:                1               Handles streamed Requests.                2               Can issue streamed message transactions                                for clients.                4               Handles secure Requests.                8               Can issue secure message transactions.                The authdomain indicates the primary authentication                domain supported.  The domains and authdomains                parameters indicate the number of entity domains and                authentication domains supported by this node, which are                listed in the data segment parameter domainlist ifCheriton                                                       [page 93]

RFC 1045                       VMTP                        February 1988                either parameter is non-zero. (All the entity domains                precede the authentication domains in the data segment.)0x05000105 - GetRequestForwarder( CREntity, entityId1 ) -> (code,                entityId2, principal, authDomain)                Return the forwarding server's entity identifer and                principal for the forwarder of entityId1.  CREntity                should be zero to get the local VMTP management module.0x05000106 - CreateEntity( entityId1 ) -> ( code, entityId2 )                Create a new entity and return its entity identifier in                entityId2.  The entity is created local to the entity                specified in entityId1 and local to the requestor if                entityId1 is 0.0x05000107 - DeleteEntity( entityId ) -> ( code )                Delete the entity specified by entityId, which may be a                group.  If a group, the deletion is only on a best                efforts basis.  The client must take additional measures                to ensure complete deletion if required.0x0D000108 -QueryEntity( entityId ) -> ( code, descriptor )                Return a descriptor of entityId in arg of a maximum of                segmentSize bytes.0x05000109 - SignalEntity( entityId, arg )->( code )                Send the signal specified by arg to the entity specified                by entityId.  (arg is 32 bits.)0x0500010A - CreateGroup(CREntity,entityGroupId,entityId,perms)->(code)                Request that the VMTP manager local to CREntity create                an new entity group, using the specified entityGroupId                with entityId as the first member and permissions                "perms", a 32-bit field described later.  The invoker is                registered as a manager of the new group, giving it the                permissions to add or remove members.  (Normally                CREntity is 0, indicating the VMTP manager local to the                requestor.)0x0500010B - AddToGroup(CREntity, entityGroupId, entityId,                perms)->(code)                Request that the VMTP manager local to CREntity add the                specified entityId to the entityGroupId with the                specified permissions.  If entityGroupId specifies a                restricted group, the invoker must have permission to                add members to the group, either because the invoker isCheriton                                                       [page 94]

RFC 1045                       VMTP                        February 1988                a manager of the group or because it was added to the                group with the required permissions.  If CREntity is 0,                then the local VMTP manager checks permissions and                forwards the request with CREntity set to entityId and                the entityId field set to a digital signature (see                below) of the Request by the VMTP manager, certifying                that the Client has the permissions required by the                Request.  (If entityGroupId specifies an unrestricted                group, the Request can be sent directly to the handling                VMTP manager by setting CREntity to entityId.)0x0500010C - RemoveFromGroup(CREntity, entityGroupId, entityId)->(code)                Request that the VMTP manager local to CREntity remove                the specified entityId from the group specified by                entityGroupId.  Normally CREntity is 0, indicating the                VMTP manager local to the requestor.  If CREntity is 0,                then the local VMTP manager checks permissions and                forwards the request with CREntity set to entityId and                the entityId field a digital signature of the Request by                the VMTP manager, certifying that the Client has the                permissions required by the Request.0x0500010D - QueryGroup( entityId )->( code, record )...                Return information on the specified entity.  The                Response from each responding VMTP manager is (code,                record).  The format of the record is (memberCount,                member1, member2, ...).  The Responses are returned on a                best efforts basis; there is no guarantee that responses                from all managers with members in the specified group                will be received.0x0500010E - ModifyService(entityId,flags,count,pc,threadlist)->(code,                count)                Modify the service associated with the entity specified                by entityId.  The flags may indicate a message service                model, in which case the call "count" parameter                indicates the maximum number of queued messages desired;                the return "count" parameter indicates the number of                queued message allowed.  Alternatively, the "flags"                parameters indicates the RPC thread service model, in                which case "count" threads are requested, each with an                inital program counter as specified and stack, priority                and message receive area indicated by the threadlist.                In particular, "threadlist" consists of "count" records                of the form                (priority,stack,stacksize,segment,segmentsize), each one                assigned to one of the threads.  Flags defined for theCheriton                                                       [page 95]

RFC 1045                       VMTP                        February 1988                "flags" parameter are:                1               THREAD_SERVICE - otherwise the message                                model.                2               AUTHENTICATION_REQUIRED - Sent a Probe                                request to determine principal                                associated with the Client, if not                                known.                4               SECURITY_REQUIRED - Request must be                                encrypted or else reject.                8               INCREMENTAL - treat the count value as                                an increment (or decrement) relative to                                the current value rather than an                                absolute value for the maximum number of                                queued messages or threads.                In the thread model, the count must be a positive                increment or else 0, which disables the service.  Only a                count of 0 terminates currently queued requests or                in-progress request handling.0x4500010F -                NotifyVmtpClient(client,cntrl,recSeq,transact,delivery,code)->()                Update the state associated with the transaction                specified by client and transact, an entity identifier                and transaction identifier, respectively.  This                operation is normally used only by another VMTP                management module.  (Note that it is a datagram                operation.)  The other parameters are as follows:                ctrl            A 32-bit value corresponding to 4th                                32-bit word of the VMTP header of a                                Response packet that would be sent in                                response to the Request that this is                                responding to.  That is, the control                                flags, ForwardCount, RetransmitCount and                                Priority fields match those of the                                Request.  (The NRS flag is set if the                                receiveSeqNumber field is used.)  The                                PGCount subfield indicates the number of                                previous Request packet groups being                                acknowledged by this Notify operation.                                (The bit fields that are reserved inCheriton                                                       [page 96]

RFC 1045                       VMTP                        February 1988                                this word in the header are also                                reserved here and must be zero.)                recSeq          Sequence number of reception at the                                Server if the NRS flag is set in the                                ctrl parameter, otherwise reserved and                                zero.  (This is used for sender-based                                logging of message activity for replay                                in case of failure - an optional                                facility.)                delivery        Indicates the segment blocks of the                                packet group have been received at the                                Server.                code            indicates the action the client should                                take, as described below.                The VMTP management module should take action on this                operation according to the code, as specified below.                OK              Do nothing at this time, continue                                waiting for the response with a reset                                timer.                RETRY           Retransmit the request packet group                                immediately with at least the segment                                blocks that the Server failed to                                receive, the complement of those                                indicated by the delivery parameter.                RETRY_ALL       Retransmit the request packet group                                immediately with at least the segment                                blocks that the Server failed to                                receive, as indicated by the delivery                                field plus all subsequently transmitted                                packets that are part of this packet                                run.  (The latter is applicable only for                                streamed message transactions.)                BUSY            The server was unable to accept the                                Request at this time.  Retry later if                                desired to continue with the message                                transaction.                NONEXISTENT_ENTITY                                Specified Server entity does not exist.Cheriton                                                       [page 97]

RFC 1045                       VMTP                        February 1988                ENTITY_MIGRATED The server entity has migrated and is no                                longer at the host to which the request                                was sent.  The Server should attempt to                                determine the new host address of the                                Client using the VMTP management                                ProbeEntity operation (described                                earlier).                NO_PERMISSION   Server has not authorized reception of                                messages from this client.                NOT_AWAITING_MSG                                The conditional message delivery bit was                                set for the Request packet group and the                                Server was not waiting for it so the                                Request packet group was discarded.                VMTP_ERROR      The Request packet group was in error                                relative to the VMTP protocol                                specification.                BAD_TRANSACTION_ID                                Transaction identifier is old relative                                to the transaction identifier held for                                the Client by the Server.                STREAMING_NOT_SUPPORTED                                Server does not support multiple                                outstanding message transactions from                                the same Client, i.e. streamed message                                transactions.                SECURITY_NOT_SUPPORTED                                The Request was secure and this Server                                does not support security.                SECURITY_REQUIRED                                The Server is refusing the Request                                because it was not encrypted.                NO_RUN_RECORD   Server has no record of previous packets                                in this run of packet groups.  This can                                occur if the first packet group is lost                                or if the current packet group is sent                                significantly later than the last one                                and the Server has discarded its client                                state record.Cheriton                                                       [page 98]

RFC 1045                       VMTP                        February 19880x45000110 - NotifyVmtpServer(server,client,transact,delivery,code)->()                Update the server state associated with the transaction                specified by client and transact, an entity identifier                and transaction identifier, respectively.  This                operation is normally used only by another VMTP                management module.  (Note that it is a datagram                operation.)  The other parameters are as follows:                delivery        Indicates the segment blocks of the                                Response packet group that have been                                received at the Client.                code            indicates the action the Server should                                take, as listed below.                The VMTP management module should take action on this                operation according to the code, as specified below.                OK              Client is satisfied with Response data.                                The Server can discard the response                                data, if any.                RETRY           Retransmit the Response packet group                                immediately with at least the segment                                blocks that the Client failed to                                receive, as indicated by the delivery                                parameter.  (The delivery parameter                                indicates those segment blocks received                                by the Client).                RETRY_ALL       Retransmit the Response packet group                                immediately with at least the segment                                blocks that the Client failed to                                receive, as indicated by the (complement                                of) the delivery parameter.  Also,                                retransmit all Response packet groups                                send subsequent to the specified packet                                group.                NONEXISTENT_ENTITY                                Specified Client entity does not exist.                ENTITY_MIGRATED The Client entity has migrated and is no                                longer at the host to which the response                                was sent.                RESPONSE_DISCARDEDCheriton                                                       [page 99]

RFC 1045                       VMTP                        February 1988                                The Response was discarded and no longer                                of interest to the Client.  This may                                occur if the conditional message                                delivery bit was set for the Response                                packet group and the Client was not                                waiting for it so the Response packet                                group was discarded.                VMTP_ERROR      The Response packet group was in error                                relative to the VMTP protocol                                specification.0x41000111 -                NotifyRemoteVmtpClient(client,ctrl,recSeq,transact,delivery,code->()                The same as NotifyVmtpClient except the co-resident                addressing is not used.  This operation is used to                update client state that is remote when a Request is                forwarded.Note the use of the CRE bit in the RequestCodes to route the request tothe correct VMTP management module(s) to handle the request.III.1. Entity Group ManagementAn entity in a group has a set of permissions associated with itsmembership, controling whether it can add or remove others, whether itcan remove itself, and whether others can remove it from the group.  Thepermissions for entity groups are as follows:VMTP_GRP_MANAGER    0x00000001 { Manager of group. }VMTP_REM_BY_SELF    0x00000002 { Can be removed self. }VMTP_REM_BY_PRIN    0x00000004 { Can be rem'ed by same principal}VMTP_REM_BY_OTHE    0x00000008 { Can be removed any others. }VMTP_ADD_PRIN       0x00000010 { Can add by same principal. }VMTP_ADD_OTHE       0x00000020 { Can add any others. }VMTP_REM_PRIN       0x00000040 { Can remove same principal. }VMTP_REM_OTHE       0x00000080 { Can remove any others. }To remove an entity from a restricted group, the invoker must havepermission to remove that entity and the entity must have permissionsthat allow it to be removed by that entity.  With an unrestricted group,only the latter condition applies.With a restricted group, a member can only be added by another entitywith the permissions to add other entities.  The creator of a group isgiven full permissions on a group.  A entity adding another entity to aCheriton                                                      [page 100]

RFC 1045                       VMTP                        February 1988group can only give the entity it adds a subset of its permissions.With unrestricted groups, any entity can add itself to the group.  Itcan also add other entities to the group providing the entity is notmarked as immune to such requests.  (This is an implementationrestriction that individual entities can impose.)III.2. VMTP Management Digital SignaturesAs mentioned above, the entityId field of the AddToGroup andRemoveFromGroup is used to transmit a digital signature indicating thepermission for the operation has been checked by the sending kernel.The digital signature procedures have not yet been defined.  This fieldshould be set to 0 for now to indicate no signature after the CREntityparameter is set to the entity on which the operation is to beperformed.Cheriton                                                      [page 101]

RFC 1045                       VMTP                        February 1988IV. VMTP Entity Identifier DomainsVMTP allows for several disjoint naming domains for its endpoints.  The64-bit entity identifier is only unique and meaningful within itsdomain.  Each domain can define its own algorithm or mechanism forassignment of entity identifiers, although each domain mechanism mustensure uniqueness, stability of identifiers and host independence.IV.1. Domain 1For initial use of VMTP, we define the domain with Domain identifier 1as follows: +-----------+----------------+------------------------+ | TypeFlags | Discriminator  |    Internet Address    | +-----------+----------------+------------------------+    4 bits          28 bits                32 bitsThe Internet address is the Internet address of the host on which thisentity-id is originally allocated.  The Discriminator is an arbitraryvalue that is unique relative to this Internet host address.  Inaddition, the host must guarantee that this identifier does not getreused for a long period of time after it becomes invalid.  ("Invalid"means that no VMTP module considers in bound to an entity.)  Onetechnique is to use the lower order bits of a 1 second clock.  The clockneed not represent real-time but must never be set back after a crash.In a simple implementation, using the low order bits of a clock as thetime stamp, the generation of unique identifiers is overall limited tono more than 1 per second on average.  The type flags were described inSection 3.1.An entity may migrate between hosts.  Thus, an implementation canheuristically use the embedded Internet address to locate an entity butshould be prepared to maintain a cache of redirects for migratedentities, plus accept Notify operations indicating that migration hasoccurred.Entity group identifiers in Domain 1 are structured in one of two forms,depending on whether they are well-known or dynamically allocatedidentifiers.  A well-known entity identifier is structured as: +-----------+----------------+------------------------+ | TypeFlags |  Discriminator |Internet Host Group Addr| +-----------+----------------+------------------------+    4 bits          28 bits                32 bitsCheriton                                                      [page 102]

RFC 1045                       VMTP                        February 1988with the second high-order bit (GRP) set to 1.  This form of entityidentifier is mapped to the Internet host group address specified in thelow-order 32 bits.  The Discriminator distinguishes group identifiersusing the same Internet host group.  Well-known entity group identifiersshould be allocated to correspond to the basic services provided byhosts that are members of the group, not specifically because thatservice is provided by VMTP.  For example, the well-known entity groupidentifier for the domain name service should contain as its embeddedInternet host group address the host group for Domain Name servers.A dynamically allocated entity identifier is structured as: +-----------+----------------+------------------------+ | TypeFlags |  Discriminator |   Internet Host Addr   | +-----------+----------------+------------------------+    4 bits          28 bits             32 bitswith the second high-order bit (GRP) set to 1.  The Internet address inthe low-order 32 bits is a Internet address assigned to the host thatdynamically allocates this entity group identifier.  A dynamicallyallocated entity group identifier is mapped to Internet host groupaddress 232.X.X.X where X.X.X are the low-order 24 bits of theDiscriminator subfield of the entity group identifier.We use the following notation for Domain 1 entity identifiers <10> andpropose it use as a standard convention.        <flags>-<discriminator>-<Internet address>where <flags> are [X]{BE,LE,RG,UG}[A]    X = reserved    BE = big-endian entity    LE = little-endian entity    RG = restricted group    UG = unrestricted group    A  = aliasand <discriminator> is a decimal integer and <Internet address> is instandard dotted decimal IP address notation.Examples:_______________<10>  This notation was developed by Steve Deering.Cheriton                                                      [page 103]

RFC 1045                       VMTP                        February 1988BE-25593-36.8.0.49 is big-endian entity #25593 created on host                36.8.0.49.RG-1-224.0.1.0 is the well-known restricted VMTP managers group.UG-565338-36.8.0.77 is unrestricted entity group #565338 created on host                36.8.0.77.LEA-7823-36.8.0.77 is a little-endian alias entity #7823 created on host                36.8.0.77.This notation makes it easy to communicate and understand entityidentifiers for Domain 1.The well-known entity identifiers specified to date are:VMTP_MANAGER_GROUP   RG-1-224.0.1.0                Managers for VMTP operations.VMTP_DEFAULT_BECLIENT  BE-1-224.0.1.0                Client entity identifier to use when a (big-endian) host                has not determined or been allocated any client entity                identifiers.VMTP_DEFAULT_LECLIENT  LE-1-224.0.1.0                Client entity identifier to use when a (little-endian)                host has not determined or been allocated any client                entity identifiers.Note that 224.0.1.0 is the host group address assigned to VMTP and towhich all VMTP hosts belong.Other well-known entity group identifiers will be specified insubsequent extensions to VMTP and in higher-level protocols that useVMTP.IV.2. Domain 3Domain 3 is reserved for embedded systems that are restricted to asingle network and are independent of IP.  Entity identifiers areallocated using the decentralized approach described below.  The mappingof entity group identifiers is specific to the type of network beingused and not defined here.  In general, there should be a simplealgorithmic mapping from entity group identifier to multicast address,similar to that described for Domain 1.  Similarly, the values fordefault client identifier are specific to the type of network and notCheriton                                                      [page 104]

RFC 1045                       VMTP                        February 1988defined here.IV.3. Other DomainsDefinition of additional VMTP domains is planned for the future.Requests for allocation of VMTP Domains should be addressed to theInternet protocol administrator.IV.4. Decentralized Entity Identifier AllocationThe ProbeEntityBlock operation may be used to determine whether a blockof entity identifiers is in use.  ("In use" means valid or reserved by ahost for allocation.)  This mechanism is used to detect collisions inallocation of blocks of entity identifiers as part of the implementationof decentralized allocation of entity identifiers.  (Decentralizedallocation is used in local domain use of VMTP such as in embeddedsystems- see Domain 3.)Basically, a group of hosts can form a Domain or sub-Domain, a group ofhosts managing their own entity identifier space or subspace,respectively.  As an example of a sub-Domain, a group of hosts in Domain1 all identified with a particular host group address can manage thesub-Domain corresponding to all entity identifiers that contain thathost group address.  The ProbeEntityBlock operation is used to allocatethe random bits of these identifiers as follows.When a host requires a new block of entity identifiers, it selects a newblock (randomly or by some choice algorithm) and then multicasts aProbeEntityBlock request to the members of the (sub-)Domain some Rtimes.  If no response is received after R (re)transmissions, the hostconcludes that it is free to use this block of identifiers.  Otherwise,it picks another block and tries again.Notes:   1. A block of 256 identifiers is specified by an entity      identifier with the low-order 8 bits all zero.   2. When a host allocates an initial block of entity identifiers      (and therefore does not yet have a specified entity      identifier to use) it uses VMTP_DEFAULT_BECLIENT (if      big-endian, else VMTP_DEFAULT_LECLIENT if little-endian) as      its client identifier in the ProbeEntityBlock Request and a      transaction identifier of 0.  As soon as it has allocated a      block of entity identifiers, it should use these identifiersCheriton                                                      [page 105]

RFC 1045                       VMTP                        February 1988      for all subsequent communication.  The default client      identifier values are defined for each Domain.   3. The set of hosts using this decentralized allocation must not      be subject to network partitioning.  That is, the R      transmissions must be sufficient to ensure that every host      sees the ProbeEntityBlock request and (reliably) sends a      response.  (A host that detects a collision can retransmit      the response multiple times until it sees a new      ProbeEntityBlock operation from the same host/Client up to a      maximum number of times.)  For instance, a set of machines      connected by a single local network may able to use this type      of allocation.   4. To guarantee T-stability, a host must prevent reuse of a      block of identifiers if any of the identifiers in the block      are currently valid or have been valid less than T seconds      previously.  To this end, a host must remember recently used      identifiers and object to their reuse in response to a      ProbeEntityBlock operation.   5. Care is required in a VMTP implementation to ensure that      Probe operations cannot be discarded due to lack of buffer      space or queued or delayed so that a response is not      generated quickly.  This is required not only to detect      collisions but also to provide accurate roundtrip estimates      as part of ProbeEntity operations.Cheriton                                                      [page 106]

RFC 1045                       VMTP                        February 1988V. Authentication DomainsA VMTP authentication domain defines the format and interpretation forprincipal identifiers and encryption keys.  In particular, anauthentication domain must specify a means by which principalidentifiers are allocated and guaranteed unique and stable.  Thecurrently defined authentication domains are as follows (0 is reserved).Ideally, all entities within one entity domain are also associated withone authentication domain.  However, authentication domains areorthogonal to entity domains.  Entities within one domain may havedifferent authentication domains.  (In this case, it is generallynecessary to have some correspondence between principals in thedifferent domains.)  Also, one entity identifier may be associated withmultiple authentication domains.  Finally, one authentication domain maybe used across multiple entity domains.V.1. Authentication Domain 1A principal identifier is structured as follows. +---------------------------+------------------------+ |     Internet Address      | Local User Identifier  | +---------------------------+------------------------+             32 bits                    32 bitsThe Internet Address may specify an individual host (such as a UNIXmachine) or may specify a host group address corresponding to a clusterof machines operating under a single adminstration.  In both cases,there is assumed to be an adminstration associated with the embeddedInternet address that guarantees the uniqueness and stability of theUser Identifier relative to the Internet address.  In particular, thatadministration is the only one authorized to allocate principalidentifiers with that Internet address prefix, and it may allocate anyof these identifiers.In authentication domain 1, the standard EncryptionQualifiers are:0               Clear text - no encryption.1               use 64-bit CBC DES for encryption and decryption.V.2. Other Authentication DomainsOther authentication domains will be defined in the future as needed.Cheriton                                                      [page 107]

RFC 1045                       VMTP                        February 1988VI. IP ImplementationVMTP is designed to be implemented on the DoD IP Internet DatagramProtocol (although it may also be implemented as a local networkprotocol directly in "raw" network packets.)VMTP is assigned the protocol number 81.With a 20 octet IP header and one segment block, a VMTP packet is 600octets.  By convention, any host implementing VMTP implicitly agrees toaccept VMTP/IP packets of at least 600 octets.VMTP multicast facilities are designed to work with, and have beenimplemented using, the multicast extensions to the Internet [8]described inRFC 966 and 988.  The wide-scale use of full VMTP/IPdepends on the availability of IP multicast in this form.Cheriton                                                      [page 108]

RFC 1045                       VMTP                        February 1988VII. Implementation NotesThe performance and reliability of a protocol in operation is highlydependent on the quality of its implementation, in addition to the"intrinsic" quality of the protocol design.  One of the design goals ofthe VMTP effort was to produce an efficiently implementable protocol.The following notes and suggestions are based on experience withimplementing VMTP in the V distributed system and the UNIX 4.3 BSDkernel.  The following is described for a client and server handlingonly one domain.  A multi-domain client or server would replicate thesestructures for each domain, although buffer space may be shared.VII.1. Mapping Data StructuresThe ClientMap procedure is implemented using a hash table that maps tothe Client State Record whether this entity is local or remote, as shownin Figure VII-1.             +---+---+--------------------------+ ClientMap   |   | x |                          |             +---+-|-+--------------------------+                   |   +--------------+    +--------------+                   +-->| LocalClient  |--->| LocalClient  |                       +--------------+    +--------------+                       | RemoteClient |    | RemoteClient |-> ...                       +--------------+    +--------------+                       |              |    |              |                       |              |    |              |                       +--------------+    +--------------+            Figure VII-1:   Mapping Client Identifier to CSRLocal clients are linked through the LocalClientLink, similarly for theRemoteClientLink.  Once a CSR with the specified Entity Id is found,some field or flag indicates whether it is identifying a local or remoteEntity.  Hash collisions are handled with the overflow pointersLocalClientLink and RemoteClientLink (not shown) in the CSR for theLocalClient and RemoteClient fields, respectively.  Note that a CSRrepresenting an RPC request has both a local and remote entityidentifier mapping to the same CSR.The Server specified in a Request is mapped to a server descriptor usingthe ServerMap (with collisions handled by the overflow pointer.).  Theserver descriptor is the root of a queue of CSR's for handling requestsplus flags that modify the handling of the Request.  Flags include:Cheriton                                                      [page 109]

RFC 1045                       VMTP                        February 1988                 +-------+---+-------------------------+  ServerMap      |       | x |                         |                 +-------+-|-+-------------------------+                           |   +--------------+                           |   | OverflowLink |                           |   +--------------+                           +-->|   Server     |                               +--------------+                               | Flags | Lock |                               +--------------+                               | Head Pointer |                               +--------------+                               | Tail Pointer |                               +--------------+               Figure VII-2:   Mapping Server IdentifiersTHREAD_QUEUE    Request is to be invoked directly as a remote procedure                invocation, rather than by a server process in the                message model.AUTHENTICATION_REQUIRED                Sent a Probe request to determine principal associated                with the Client, if not known.SECURITY_REQUIRED                Request must be encrypted or else reject.REQUESTS_QUEUED Queue contains waiting requests, rather than free CSR's.                Queue this request as well.SERVER_WAITING  The server is waiting and available to handle incoming                Request immediately, as required by CMD.Alternatively, the Server identifiers can be mapped to a CSR using theMapToClient mechanism with a pointer in the CSR refering to the serverdescriptor, if any.  This scheme is attractive if there are client CSR'sassociated with a service to allow it to communicate as a client usingVMTP with other services.Finally, a similar structure is used to expand entity group identifiersto the local membership, as shown in Figure VII-3.  A group identifieris hashed to an index in the GroupMap.  The list of group descriptorsrooted at that index in the GroupMap contains a group descriptor foreach local member of the group.  The flags are the group permissionsdefined inAppendix III.Cheriton                                                      [page 110]

RFC 1045                       VMTP                        February 1988                 +-------+---+----------------------------------+  GroupMap       |       | x |                                  |                 +-------+-|-+----------------------------------+                           |   +--------------+                           |   | OverflowLink |                           |   +--------------+                           +-->|EntityGroupId |                               +--------------+                               | Flags        |                               +--------------+                               | Member Entity|                               +--------------+               Figure VII-3:   Mapping Group IdentifiersNote that the same pool of descriptors could be used for the server andgroup descriptors given that they are similar in size.VII.2. Client Data StructuresEach client entity is represented as a client state record.  The CSRcontains a VMTP header as well as other bookkeeping fields, includingtimeout count, retransmission count, as described inSection 4.1.  Inaddition, there is a timeout queue, transmission queue and receptionqueue.  Finally, there is a ServerHost cache that maps from serverentity-id records to host address, estimated round trip time,interpacket gap, MTU size and (optimally) estimated processing time forthis server entity.VII.3. Server Data StructuresThe server maintains a heap of client state records (CSR), one for each(Client, Transaction).  (If streams are not supported, there is, atworst, a CSR per Client with which the server has communicated withrecently.)  The CSR contains a VMTP header as well as variousbookkeeping fields including timeout count, retransmission count.  Theserver maintains a hash table mapping of Client to CSR as well as thetransmission, timeout and reception queues.  In a VMTP moduleimplementing both the client and server functions, the same timeoutqueue and transmission queue are used for both.Cheriton                                                      [page 111]

RFC 1045                       VMTP                        February 1988VII.4. Packet Group transmissionThe procedure SendPacketGroup( csr ) transmits the packet groupspecified by the record CSR.  It performs:   1. Fragmentation of the segment data, if any, into packets.      (Note, segment data flagged by SDA bit.)   2. Modifies the VMTP header for each packet as required e.g.      changing the delivery mask as appropriate.   3. Computes the VMTP checksum.   4. Encrypts the appropriate portion of the packet, if required.   5. Prepends and appends network-level header and trailer using      network address from ServerHost cache, or from the responding      CSR.   6. Transmits the packet with the interpacket gap specified in      the cache.  This may involve round-robin scheduling between      hosts as well as delaying transmissions slightly.   7. Invokes the finish-up procedure specified by the CSR record,      completing the processing.  Generally, this finish-up      procedure adds the record to the timeout queue with the      appropriate timeout queue.The CSR includes a 32-bit transmission mask that indicates the portionsof the segment to transmit.  The SendPacketGroup procedure is assumed tohandle queuing at the network transmission queue, queuing in priorityorder according to the priority field specified in the CSR record.(This priority may be reflected in network transmission behavior fornetworks that support priority.)The SendPacketGroup procedure only looks at the following fields of aCSR   - Transmission mask   - FuncCode   - SDA   - Client   - ServerCheriton                                                      [page 112]

RFC 1045                       VMTP                        February 1988   - CoResidentEntity   - KeyIt modifies the following fields   - Length   - Delivery   - ChecksumIn the case of encrypted transmission, it encrypts the entire packet,not including the Client field and the following 32-bits.If the packet group is a Response, (i.e. lower-order bit of functioncode is 1) the destination network address is determined from theClient, otherwise the Server.  The HostAddr field is set either from theServerHost cache (if a Request) or from the original Request if aResponse, before SendPacketGroup is called.The CSR includes a timeout and TTL fields indicating the maximum time tocomplete the processing and the time-to-live for the packets to betransmitted.SendPacketGroup is viewed as the right functionality to implement fortransmission in an "intelligent" network interface.Finally, it appears preferable to be able to assume that all portions ofthe segment remain memory-resident (no page faults) during transmission.In a demand-paged systems, some form of locking is required to keep thesegment data in memory.VII.5. VMTP Management ModuleThe implementation should implement the management operations as aseparate module that is invoked from within the VMTP module.  When aRequest is received, either from the local user level or the network,for the VMTP management module, the management module is invoked as aremote or local procedure call to handle this request and return aresponse (if not a datagram request).  By registering as a local server,the management module should minimize the special-case code required forits invocation.  The management module is basically a case statementthat selects the operation based on the RequestCode and then invokes thespecified management operation.  The procedure implementing themanagement operation, especially operations like NotifyVmtpClient andCheriton                                                      [page 113]

RFC 1045                       VMTP                        February 1988NotifyVmtpServer, are logically part of the VMTP module because theyrequire full access to the basic data structures of the VMTPimplementation.The management module should be implemented so that it can respondquickly to all requests, particularly since the timing of managementinteractions is used to estimate round trip time.  To date, allimplementations of the management module have been done at the kernellevel, along with VMTP proper.VII.6. Timeout HandlingThe timeout queue is a queue of CSR records, ordered by timeout count,as specified in the CSR record.  On entry into the timeout queue, theCSR record has the timeout field set to the time (preferable inmilliseconds or similar unit) to remain in the queue plus the finishupfield set to the procedure to execute on removal on timeout from thequeue.  The timeout field for a CSR in the queue is the time relative tothe record preceding it in the queue (if any) at which it is to beremoved.  Some system-specific mechanism decrements the time for therecord at the front of the queue, invoking the finishup procedure whenthe count goes to zero.Using this scheme, a special CSR is used to timeout and scan CSR's fornon-recently pinged CSR's.  That is, this CSR times out and invokes afinishup procedure that scans for non-recently pinged CSR that are"AwaitingResponse" and signals the request processing entity and deletesthe CSR.  It then returns to the timeout queue.The timeout mechanism tends to be specific to an operating system.  Thescheme described may have to be adapted to the operating system in whichVMTP is to be implemented.This mechanism handles client request timeout and client responsetimeout.  It is not intended to handle interpacket gaps given that thesetimes are expected to be under 1 millisecond in general and possiblyonly a few microseconds.VII.7. Timeout ValuesRoundtrip timeout values are estimated by matching Responses orNotifyVmtpClient Requests to Request transmission, relying on theretransmitCount to identify the particular transmission of the Requestthat generated the response.  A similar technique can be used withResponses and NotifyVmtpServer Requests.  The retransmitCount isCheriton                                                      [page 114]

RFC 1045                       VMTP                        February 1988incremented each time the Response is sent, whether the retransmissionwas caused by timeout or retransmission of the Request.The ProbeEntity request is recommended as a basic way of gettingup-to-date information about a Client as well as predictable hostmachine turnaround in processing a request.  (VMTP assumes and requiresan efficient, bounded response time implementation of the ProbeEntityoperation.)Using this mechanism for measuring RTT, it is recommended that thevarious estimation and smoothing techniques developed for TCP RTTestimation be adapted and used.VII.8. Packet ReceptionLogically a network packet containing a VMTP packet is 5 portions:   - network header, possibly including lower-level headers   - VMTP header   - data segment   - VMTP checksum   - network trailer, etc.It may be advantageous to receive a packet fragmented into theseportions, if supported by the network module.  In this case, ideally theVMTP header may be received directly into a CSR, the data segment into apage that can be mapped, rather than copied, to its final destination,with VMTP checksum and network header in a separate area (used toextract the network address corresponding to the sender).Packet reception is described in detail by the pseudo-code inSection4.7.With a response, normally the CSR has an associated segment areaimmediately available so delivery of segment data is immediate.Similarly, server entities should be "armed" with CSR's with segmentareas that provide for immediate delivery of requests.  It is reasonableto discard segment data that cannot be immediately delivered in thisway, providing that clients and servers are able to preallocate CSR'swith segment areas for requests and responses.  In particular, a clientshould be able to provide some number of additional CSR's for receivingmultiple responses to a multicast request.Cheriton                                                      [page 115]

RFC 1045                       VMTP                        February 1988The CSR data structure is intended to be the interface data structurefor an intelligent network interface.  For reception, the interface is"armed" with CSR's that may point to segment areas in main memory, intowhich it can deliver a packet group.  Ideally, the interface handles allthe processing of all packets, interacting with the host after receivinga complete Request or Response packet group.  An implementation shoulduse an interface based on SendPacketGroup(CSR) andReceivePacketGroup(CSR) to facilitate the introduction of an intelligentnetwork interface.ReceivePacketGroup(csr) provides the interface with a CSR descriptor andzero or more bytes of main memory to receive segment data.  The CSRdescribes whether it is to receive responses (and if so, for whichclient) or requests (and if so for which server).The procedure ReclaimCSR(CSR) reclaims the specified record from theinterface before it has been returned after receiving the specifiedpacket group.A finishup procedure is set in the CSR to be invoked when the CSR isreturned to the host by the normal processing sequence in the interface.Similarly, the timeout parameter is set to indicate the maximum time thehost is providing for the routine to perform the specified function.The CSR and associated segment memory is returned to the host after thetimeout period with an indication of progress after the timeout period.It is not returned earlier.VII.9. StreamingThe implementation of streaming is optional in both VMTP clients andservers.  Ideally, all performance-critical servers should implementstreaming.  In addition, clients that have high context switch overhead,network access overhead or expect to be communicating over long delaylinks should also implement streaming.A client stream is implemented by allocating a CSR for each outstandingmessage transaction.  A stream of transactions is handled similarly tomultiple outstanding transactions from separate clients except for theinteraction between consecutive numbered transactions in a stream.For the server VMTP module, streamed message transactions to a serverare queued (if accepted) subordinate to the first unprocessed CSRcorresponding to this Client.  Thus, streamed transactions from a givenClient are always performed in the order specified by the transactionidentifiers.Cheriton                                                      [page 116]

RFC 1045                       VMTP                        February 1988If a server does not implement streaming, it must refuse streamedmessage transactions using the NotifyVmtpClient operation.  Also, allclient VMTP's that support streaming must support the streamed interfaceto a server that does not support streaming.  That is, it must performthe message transactions one at a time.  Consequently, a program thatuses the streaming interface to a non-streaming server experiencesdegraded performance, but not failure.VII.10. Implementation ExperienceThe implementation experience to date includes a partial implementation(minus the streaming and full security) in the V kernel plus a similarpreliminary implementation in the 4.3 BSD Unix kernel.  In the V kernelimplementation, the CSR's are part of the (lightweight) processdescriptor.The V kernel implementation is able to perform a VMTP messagetransaction with no data segment between two Sun-3/75's connected by 10Mb Ethernet in 2.25 milliseconds.  It is also able to transfer data at4.7 megabits per second using 16 kilobyte Requests (but null checksums.)The UNIX kernel implementation running on Microvax II's achieves a basicmessage transaction time of 9 milliseconds and data rate of 1.9 megabitsper second using 16 kilobyte Responses.  This implementation is usingthe standard VMTP checksum.We hope to report more extensive implementation experience in futurerevisions of this document.Cheriton                                                      [page 117]

RFC 1045                       VMTP                        February 1988VIII. UNIX 4.3 BSD Kernel Interface for VMTPUNIX 4.3 BSD includes a socket-based design for program interfaces to avariety of protocol families and types of protocols (streams,datagrams).  In this appendix, we sketch an extension to this design tosupport a transaction-style protocol.  (Some familiarity with UNIX 4.2/3IPC is assumed.)  Several extensions are required to the systeminterface, rather than just adding a protocol, because no provision wasmade for supporting transaction protocols in the original design.  Theseextensions include a new "transaction" type of socket plus new systemcalls invoke, getreply, probeentity, recreq, sendreply and forward.A socket of type transaction bound to the VMTP protocol typeIPPROTO_VMTP is created by the call    s = socket(AF_INET, SOCK_TRANSACT, VMTP);This socket is bound to an entity identifier by    bind(s, &entityid, sizeof(entityid));The first address/port bound to a socket is considered its primary nameand is the one used on packet transmission.  A message transaction isinvoked between the socket named by s and the Server specified by mcb by    invoke(s, mcb, segptr, seglen, timeout );The mcb is a message control block whose format was described in Section2.4.  The message control block specifies the request to send plus thedestination Server.  The response message control block returned by theserver is stored in mcb when invoke returns.  The invoking process isblocked until a response is received or the message transaction timesout unless the request is a datagram request.  (Non-blocking versionswith signals on completion could also be provided, especially with astreaming implementation.)For multicast message transactions (sent to an entity group), the nextresponse to the current message transaction (if it arrives in less thantimeout milliseconds) is returned by    getreply( s, mcb, segptr, maxseglen, timeout );The invoke operation sent to an entity group completes as soon as thefirst response is received.  A request is retransmitted until the firstreply is received (assuming the request is not a datagram).  Thus, thesystem does not retransmit while getreply is timing out even if noreplies are available.Cheriton                                                      [page 118]

RFC 1045                       VMTP                        February 1988The state of an entity associated with entityId is probed using    probeentity( entityId, state );A UNIX process acting as a VMTP server accepts a Request by theoperation    recvreq(s, mcb, segptr, maxseglen );The request message for the next queued transaction request is returnedin mcb, plus the segment data of maximum length maxseglen, starting atsegptr in the address space.  On return, the message control blockcontains the values as set in invoke except: (1) the Client fieldindicates the Client that sent the received Request message.  (2) theCode field indicates the type of request.  (3) the MsgDelivery fieldindicates the portions of the segment actually received within thespecified segment size, if MDM is 1 in the Code field.  A segment blockis marked as missing (i.e. the corresponding bit in the MsgDeliveryfield is 0) unless it is received in its entirety or it is all of thedata in last segment contained in the segment.To complete a transaction, the reply specified by mcb is sent to theclient specified by the MCB using    sendreply(s, mcb, segptr );The Client field of the MCB indicates the client to respond to.Finally, a message transaction specified by mcb is forwarded tonewserver as though it were sent there by its original invoker using    forward(s, mcb, segptr, timeout );Cheriton                                                      [page 119]

RFC 1045                       VMTP                        February 1988Index          Acknowledgment   14          APG   16, 31, 39          Authentication domain   20          Big-endian   9          Checksum   14, 43          Checksum, not set   44          Client   7, 10, 38          Client timer   16          CMD   42, 110          CMG   32, 40          Co-resident entity   25          Code   42          CoResidentEntity   42, 43          CRE   21, 42          DGM   42          Digital signature, VMTP management   95, 101          Diskless workstations   2          Domain   9, 38          Domain 1   102          Domain 3   104          Entity   7          Entity domain   9          Entity group   8          Entity identifier   37          Entity identifier allocation   105          Entity identifier, all-zero   38          EPG   20, 39          Features   6          ForwardCount   24          Forwarding   24          FunctionCode   41          Group   8          Group message transaction   10          Group timeouts   16          GRP   37          HandleNoCSR   62          HandleRequestNoCSR   79          HCO   14, 23, 39Cheriton                                                      [page 120]

RFC 1045                       VMTP                        February 1988          Host independence   8          Idempotent   15          Interpacket gap   18, 40          IP   108          Key   91          LEE   32, 37          Little-endian   9          MCB   118          MDG   22, 40          MDM   30, 42          Message control block   118          Message size   6          Message transaction   7, 10          MPG   39          MsgDelivery   43          MSGTRANS_OVERFLOW   27          Multicast   4, 21, 120          Multicast, reliable   21          Naming   6          Negative acknowledgment   31          NER   25, 31, 39          NRT   26, 30, 39          NSR   25, 27, 31, 39          Object-oriented   2          Overrun   18          Packet group   7, 29, 39          Packet group run   31          PacketDelivery   29, 31, 41          PGcount   26, 41          PIC   42          Principal   11          Priority   41          Process   11          ProcessId   89          Protocol number,IP   108          RAE   37          Rate control   18          Real-time   2, 4          Realtime   22Cheriton                                                      [page 121]

RFC 1045                       VMTP                        February 1988          Reliability   12          Request message   10          RequestAckRetries   30          RequestRetries   15          Response message   10          ResponseAckRetries   31          ResponseRetries   15          Restricted group   8          Retransmission   15          RetransmitCount   17          Roundtrip time   17          RPC   2          Run   31, 39          Run, message transactions   25          SDA   42          Security   4, 19          Segment block   41          Segment data   43          SegmentSize   42, 43          Selective retransmission   18          Server   7, 10, 41          Server group   8          Sockets, VMTP   118          STI   26, 40          Streaming   25, 55          Strictly stable   8          Subgroups   21          T-stable   8          TC1(Server)   16          TC2(Server)   16          TC3(Server)   16          TC4   16          TCP   2          Timeouts   15          Transaction   10, 41          Transaction identification   10          TS1(Client)   17          TS2(Client)   17          TS3(Client)   17          TS4(Client)   17          TS5(Client)   17          Type flags   8          UNIX interface   118          Unrestricted group   8, 38Cheriton                                                      [page 122]

RFC 1045                       VMTP                        February 1988          NotifyVmtpClient   7, 26, 27, 30          NotifyVmtpServer   7, 14, 30          User Data   43          Version   38          VMTP Management digital signature   95, 101Cheriton                                                      [page 123]

[8]ページ先頭

©2009-2025 Movatter.jp