Network Working Group | T.E. Keiser |
Internet-Draft | Sine Nomine |
Intended status: Informational | June 02, 2011 |
Expires: December 04, 2011 |
AFS-3 Rx RPC XDR Primitive Type Definitions
draft-keiser-afs3-xdr-primitive-types-00
AFS-3 embeds a set of XDR primitive type definitions, which are referenced throughout the various AFS-3 protocol specifications. This memo defines the mapping between these AFS-3 primitive types, and the underlying XDR primitives.
Comments regarding this draft are solicited. Please include the AFS-3 protocol standardization mailing list (afs3-standardization@openafs.org) as a recipient of any comments.
This Internet-Draft is submitted in full conformance with the provisions of BCP 78 and BCP 79.
Internet-Drafts are working documents of the Internet Engineering Task Force (IETF). Note that other groups may also distribute working documents as Internet-Drafts. The list of current Internet- Drafts is at http://datatracker.ietf.org/drafts/current/.
Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as "work in progress."
This Internet-Draft will expire on December 04, 2011.
Copyright (c) 2011 IETF Trust and the persons identified as the document authors. All rights reserved.
This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (http://trustee.ietf.org/license-info) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document. Code Components extracted from this document must include Simplified BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Simplified BSD License.
AFS-3 [AFS1] [AFS2] is a distributed file system that has its origins in the VICE project [CMU-ITC-84-020] [VICE1] at the Carnegie Mellon University Information Technology Center [CMU-ITC-83-025], a joint venture between CMU and IBM. VICE later became AFS when CMU moved development to a new commercial venture called Transarc Corporation, which later became IBM Pittsburgh Labs. AFS-3 is a suite of un-standardized network protocols based on a remote procedure call (RPC) suite known as Rx [AFS3-RX]. While de jure standards for AFS-3 fail to exist, the various AFS-3 implementations have agreed upon certain de facto standards, largely helped by the existence of an open source fork called OpenAFS that has served the role of reference implementation. In addition to using OpenAFS as a reference, IBM wrote and donated developer documentation that contains somewhat outdated specifications for the Rx protocol and all AFS-3 remote procedure calls, as well as a detailed description of the AFS-3 system architecture.
The Rx RPC protocol utilizes XDR [RFC4506] as its means of encoding RPC call and response payloads. While XDR provides type definitions for each popular bit-length integer, it does so using relatively ambiguous names (e.g., hyper). To improve readability, AFS-3 standards reference custom XDR types that embed the bit length within the type name. This memo standardizes those primitive types, as well as the encoding for the AFS-3 UUID.
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119 [RFC2119].
AFS-3 defines a number of special types which are direct mappings onto existing XDR types. Thus, these types are essentially XDR typedefs:
AFS-3 type name -> XDR primitive type [Reference] --------------- ------------------ ----------- char int RFC 4506 Section 4.1 unsigned char unsigned int RFC 4506 Section 4.2 afs_int8 int RFC 4506 Section 4.1 afs_uint8 unsigned int RFC 4506 Section 4.2 short int RFC 4506 Section 4.1 unsigned short unsigned int RFC 4506 Section 4.2 afs_int16 int RFC 4506 Section 4.1 afs_uint16 unsigned int RFC 4506 Section 4.2 afs_int32 int RFC 4506 Section 4.1 afs_uint32 unsigned int RFC 4506 Section 4.2 afs_int64 hyper RFC 4506 Section 4.5 afs_uint64 unsigned hyper RFC 4506 Section 4.5
AFS-3 common typedefs
This type is considered deprecated; future protocol specifications should reference the "afs_int8" type instead.
This type is considered deprecated; future protocol specifications should reference the "afs_uint8" type instead.
This type is considered deprecated; future protocol specifications should reference the "afs_int16" type instead.
This type is considered deprecated; future protocol specifications should reference the "afs_uint16" type instead.
Please note that XDR uses a 4-octet alignment, and thus these 1- and 2-octet types will take 4 octets on the wire. Consequently, this is merely a way of defining data structures that have an optimized in-memory footprint, without imbuing any wire-encoding advantage.
AFS-3, being closely related to DCE, relies heavily upon a UUID type. The AFS-3 UUID type is identical to the DCE-variant, version 1 UUID type (see Appendix A of [dce_rpc]). The C data structure definition for such a UUID is as follows:
struct afsUUID { afs_uint32 time_low; afs_uint16 time_mid; afs_uint16 time_hi_and_version; char clock_seq_hi_and_reserved; char clock_seq_low; char node[6]; }; typedef struct afsUUID afsUUID;
An afsUUID type is XDR encoded on the wire as follows:
(MSB) (LSB) 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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | time_low | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | 0 | time_mid | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | 0 | time_hi_and_version | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | {3} | {1} | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | {3} | {2} | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | {3} | node[0] | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | {3} | node[1] | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | {3} | node[2] | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | {3} | node[3] | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | {3} | node[4] | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | {3} | node[5] | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ {1} clock_seq_hi_and_reserved {2} clock_seq_low {3} sign extended padding: 0, or 0xffffff depending on value of MSB in field to be sign-extended and padded
afsUUID XDR encoding
XDR encoding an "afsUUID" type SHALL involve the following sequence of operations:
Many of the fields which are encoded in this data structure are smaller than four octets. In order to XDR encode these fields, they must first be resized. Since many of these fields are signed, this involves sign extension. This process depends upon the machine architecture. Virtually all machines in existence today utilize 2s-complement integer arithmetic, where this process merely involves padding with zeros if the MSB is zero or ones if the MSB is one.
XDR decoding an "afsUUID" type SHALL involve the following sequence of operations:
This memo includes no request to IANA.
This memo includes no request to the AFS Assigned Numbers Registrar.
This document merely describes various AFS-3 XDR types. Any protocol specification which uses these primitives types must ensure the security of the resulting XDR data streams, e.g., via prescription of a suitable Rx RPC security class.
[RFC2119] | Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, March 1997. |
[RFC4506] | Eisler, M., "XDR: External Data Representation Standard", STD 67, RFC 4506, May 2006. |
typedef afs_int8 int; typedef afs_uint8 unsigned int; typedef afs_int16 int; typedef afs_uint16 unsigned int; typedef afs_int32 int; typedef afs_uint32 unsigned int; typedef afs_int64 hyper; typedef afs_uint64 unsigned hyper;