Subject: [nfsv4] [PATCH] Partially address item NSDB-5

From: Chuck Lever <[email-masked]>
Date: Thu, 30 Aug 2012 13:35:53 -0700

Review comment from

http://www.ietf.org/mail-archive/web/nfsv4/current/msg10851.html

| 4.2.1.14
|   XDR blobs? Really?

Section 4.2.1.14 describes the fedfsNfsPath attribute, part of the
NFS-specific subclass of FSL record types.  The value of this
attribute is converted by fileservers into part of an fs_locations4
or fs_locations_info4 response.  It is stored in LDAP as a binary
single-valued attribute.

Since the value of this attribute is already XDR-encoded, NFS
fileservers don't need to unmarshal and re-encode this content when
responding to a referral.  In addition, LDAP does not have a type
that can represent an ordered list of UTF-8 strings, so encoding of
some kind is required for this data item.

However, XDR blobs are binary.  Thus they are not human-readable
when stored in LDAP, and cannot be edited by typical LDAP clients.
We are interested in providing simple mechanisms for viewing and
updating FedFS content stored in LDAP.  A binary blob is not simple
to view or modify with typical LDAP tools.

LDAP experts and others are also not happy with the representation
of the fileserver network endpoint as a UTF-8 hostname string and a
separate port number.

To remedy this situation, replace the fedfsNfsPath, fedfsFslHost,
and fedfsFslPort attributes with a single attribute containing an
NFS URL that represents the fileset location encoded for this FSL
record.

Removing fedfsFslHost allows each subclass of fedFsFsl to specify
it's own way of representing the network location of a fileset.

There are several issues that must be resolved to make this a
successful change:

  o  NFS URLs are currently defined in RFC 2224 for NFS version 2
     and version 3.  This definition must be extended, within
     contemporary IETF guidelines for URIs (namely RFCs 3986 and
     4395), to accommodate NFS version 4.

  o  URLs are US-ASCII strings.  Since NFS pathnames and IDNA
     labels are UTF-8 strings, character encoding rules must be
     provided for both the hostname and pathname portion of an URL.

  o  URL pathnames use only forward slash as the pathname separator
     character.  Escape mechanisms must be provided to support
     alternate pathname separator characters.
---

 nsdb-proto.xml                    |  212 +++++++++++++++++++------------------
 references/reference.RFC.2224.xml |   47 ++++++++
 2 files changed, 154 insertions(+), 105 deletions(-)
 create mode 100644 references/reference.RFC.2224.xml

diff --git a/nsdb-proto.xml b/nsdb-proto.xml
index b893e34..2489007 100644
--- a/nsdb-proto.xml
+++ b/nsdb-proto.xml
@@ -278,9 +278,6 @@
             NSDB node that contains authoritative information for
             this FSL. </t>
 
-            <t hangText="   FslHost:"> the network location of the
-            host fileserver storing the physical data </t>
-
         </list>
         </t>
 
@@ -317,6 +314,78 @@
         The contents and format of such FSL subtypes are not defined in
         this document. </t>
 
+        <section anchor="nfs-uri" title="The NFS URI scheme">
+
+        <t> We extend the NFS URL scheme specified in
+        <xref target="RFC2224"/> (which is defined only for NFS
+        versions 2 and 3, to use it for locating NFS version 4
+        filesets.  This extention follows rules set out for Uniform
+        Resource Identifier schemes in <xref target="RFC3986"/>.
+        In the following text, we refer to this extended NFS URL
+        as an NFS URI. </t>
+
+        <t> The network location of an NFS fileset is stored in an
+        FSL record encoded as an NFS URI.  An NFS URI uses the
+        authority and path URI components, but not the query or
+        fragment components.  Use of the familiar "nfs" scheme name
+        is retained. </t>
+
+            <section title="The NFS URI authority component">
+
+            <t> In its "server" field, the NFSv4 fs_location4 data type
+            contains a list of universal addresses or UTF-8 hostnames.
+            Each may optionally include a port number.  The NFSv4
+            fs_locations_item4 data type contains this data in its
+            "fli_entries" field <xref target="RFC5661"/>.  This
+            information is encoded in the authority component of an
+            NFS URI.  Sections 3.2.2 and 3.2.3 of <xref target="RFC3986"/>
+            specify how to represent this data in the "host" subcomponent
+            of the authority component of a URI. </t>
+
+            <t> The "server" and "fli_entries" fields can encode a list
+            of server hostnames that share the same pathname.  An FSL
+            record represents only a single hostname and pathname pair.
+            An NFS fileserver MAY combine a set of FSL records into a
+            single fs_location4 or fs_locations_item4 only if each FSL
+            record in the set contains the same pathname and extended
+            filesystem information. </t>
+
+            </section>
+
+            <section title="The NFS URI path component">
+
+            <t> The path component of an NFS URI encodes the "rootpath"
+            field of the NFSv4 fs_location4 data type or the
+            "fli_rootpath" of the NFSv4 fs_locations_item4 data type
+            <xref target="RFC5661"/>.  The rules for encoding the path
+            component of a URI are specified in section 3.3 of
+            <xref target="RFC3986"/>. </t>
+
+            <t> A URI path consists of a sequence of path segments
+            separated by a slash ("/") character <xref target="RFC3986"/>.  
+            The component4 elements of an NFS pathname are encoded as
+            path segments in an NFS URI.  A slash ("/") character
+            contained in a component4 element MUST be represented using
+            URI percent encoding. </t>
+
+            <t> A URI path can be empty.  In this case, the represented
+            NFS pathname is "/". </t>
+    
+            <t> Although "." and ".." are legal to use within the path
+            component of a URI, they MUST NOT be used in the path
+            component of an NFS URI. </t>
+
+            <t> The component4 elements of an NFS pathname SHOULD be
+            prepared using the component4 rules defined in Chapter 12
+            "Internationalization" of <xref target="3530bis"/> prior to
+            encoding the path component of an NFS URI.  Because a URI
+            is a US-ASCII string, any UTF-8 code point in a component4
+            element MUST use URI percent encoding. </t>
+
+        </section>
+
+        </section>
+
         <section title="Mutual Consistency across Fileset Locations">
 
         <t> All of the FSLs that have the same FSN (and thereby
@@ -1197,57 +1266,6 @@
 
         </section>
 
-        <section title="fedfsFslHost">
-
-            <t> A fedfsFslHost is the host component of an FSL. The
-            fedfsFslHost attribute is a subclass of fedfsNetAddr,
-            with the same encoding rules. </t>
-
-            <t> This attribute is single-valued.  </t>
-
-            <t> &lt;CODE BEGINS> </t>
-
-            <figure><artwork><![CDATA[
-        ///
-        /// attributetype (
-        ///     1.3.6.1.4.1.31103.1.9 NAME 'fedfsFslHost'
-        ///     DESC 'Service location for a fileserver'
-        ///     SUP fedfsNetAddr
-        ///     SINGLE-VALUE
-        ///     )
-        ///
-            ]]></artwork></figure>
-
-            <t> &lt;CODE ENDS> </t>
-
-        </section>
-
-        <section title="fedfsFslPort">
-
-            <t> A fedfsFslPort is the decimal representation of
-            a file service's port number. The fedfsFslPort
-            attribute is a subclass of fedfsNetPort, with the
-            same encoding rules. </t>
-
-            <t> This attribute is single-valued.  </t>
-
-            <t> &lt;CODE BEGINS> </t>
-
-            <figure><artwork><![CDATA[
-        ///
-        /// attributetype (
-        ///     1.3.6.1.4.1.31103.1.10 NAME 'fedfsFslPort'
-        ///     DESC 'The file service transport port number'
-        ///     SUP fedfsNetPort
-        ///     SINGLE-VALUE
-        ///     )
-        ///
-            ]]></artwork></figure>
-
-            <t> &lt;CODE ENDS> </t>
-
-        </section>
-
         <section title="fedfsAnnotation" anchor="fedfsAnnotation">
 
             <t> A fedfsAnnotation contains an object annotation
@@ -1362,21 +1380,11 @@
 
         </section>
 
-        <section title="fedfsNfsPath">
-
-            <t> A fedfsNfsPath is the path attribute of an FSL.
-                The path MUST be the XDR encoded NFS path as
-                defined by the NFS pathname4 XDR type of the
-                fs_location's rootpath <xref target="3530bis"/>
-                and the fs_locations_item's fli_rootpath
-                <xref target="RFC5661"/>. The NFS pathname4 XDR
-                type is a variable length array of component4
-                elements. The NFS component4 XDR type is a variable
-                length array of opaque data. A fedfsNfsPath
-                attribute's component4 elements SHOULD be prepared
-                using the component4 rules defined in Chapter 12
-                "Internationalization" of
-                <xref target="3530bis"/>. </t>
+        <section title="fedfsNfsURI">
+
+            <t> A fedfsNfsURI stores the host and pathname components
+            of an FSL.  A fedfsNfsURI MUST be encoded as an NFS URI
+            <xref target="nfs-uri"/>. </t>
 
             <t> This attribute is single-valued.  </t>
 
@@ -1385,10 +1393,10 @@
             <figure><artwork><![CDATA[
         ///
         /// attributetype (
-        ///     1.3.6.1.4.1.31103.1.100 NAME 'fedfsNfsPath'
-        ///     DESC 'Server-local path to a fileset'
-        ///     EQUALITY octetStringMatch
-        ///     SYNTAX 1.3.6.1.4.1.1466.115.121.1.40
+        ///     1.3.6.1.4.1.31103.1.120 NAME 'fedfsNfsURI'
+        ///     DESC 'Location of fileset'
+        ///     EQUALITY integerMatch
+        ///     SUP IA5String
         ///     SINGLE-VALUE
         ///     )
         ///
@@ -1396,9 +1404,6 @@
 
             <t> &lt;CODE ENDS> </t>
 
-            <t> OID 1.3.6.1.4.1.1466.115.121.1.40 is the Octet String
-            syntax <xref target="RFC4517"/>.  </t>
-
         </section>
 
         <section title="fedfsNfsCurrency">
@@ -1990,16 +1995,11 @@
             location.  Other subtypes MAY be defined for other
             protocols (e.g., CIFS).  </t>
 
-            <t> A fedfsFsl's fedfsFslUuid, fedfsFsnUuid,
-            fedfsFslHost attributes are REQUIRED.  </t>
-
-            <t> A fedfsFsl's fedfsFslPort, fedfsAnnotation, and
-            fedfsDescr attributes are OPTIONAL.  </t>
+            <t> A fedfsFsl's fedfsFslUuid and fedfsFsnUuid
+            attributes are REQUIRED.  </t>
 
-            <t> If the fedfsFslPort is omitted, a standard port
-            number based on the type of FSL should be assumed. For
-            an NFS FSL, the standard NFS port number, 2049, SHOULD
-            be assumed. </t>
+            <t> A fedfsFsl's fedfsAnnotation, and fedfsDescr
+            attributes are OPTIONAL.  </t>
 
             <t> The DN of an FSL is REQUIRED to take the following
             form:  "fedfsFslUuid=$FSLUUID,fedfsFsnUuid=$FSNUUID,$NCE"
@@ -2020,10 +2020,8 @@
         ///     MUST (
         ///             fedfsFslUuid
         ///             $ fedfsFsnUuid
-        ///             $ fedfsFslHost
         ///     )
         ///     MAY (
-        ///             $ fedfsFslPort
         ///             $ fedfsAnnotation
         ///             $ fedfsDescr
         ///     ))
@@ -2059,7 +2057,7 @@
         ///     DESC 'An NFS location of a fileset'
         ///     SUP fedfsFsl STRUCTURAL
         ///     MUST (
-        ///             fedfsNfsPath
+        ///             fedfsNfsURI
         ///             $ fedfsNfsCurrency
         ///             $ fedfsNfsGenFlagWritable
         ///             $ fedfsNfsGenFlagGoing
@@ -2269,14 +2267,12 @@
         given FSN by adding a new fedfsFsl entry in the
         NSDB's LDAP directory. </t>
 
-        <t> A fedfsFsl entry contains a fedfsFslUuid,
-        fedfsFsnUuid, and fedfsFslHost.  The
+        <t> A fedfsFsl entry contains a fedfsFslUuid and
+        fedfsFsnUuid.  The
         administrator chooses the fedfsFslUuid.  The process
         for choosing the fedfsFslUuid is described in
         <xref target="sec:uuid"/>.  The fedfsFsnUuid is
-        the UUID of the FSL's FSN.  The fedfsFslHost value is
-        the network location of the fileserver that stores the
-        FSL. </t>
+        the UUID of the FSL's FSN. </t>
 
         <t> The administrator will also set additional
         attributes depending on the FSL type. </t>
@@ -2296,9 +2292,7 @@
         objectClass: fedfsNfsFsl
         fedfsFslUuid: $FSLUUID
         fedfsFsnUuid: $FSNUUID
-        fedfsFslHost: $HOST
-        fedfsFslPort: $PORT
-        fedfsNfsPath: $PATH
+        fedfsNfsURI: nfs://$HOST:$PORT//$PATH
         fedfsNfsCurrency: $CURRENCY
         fedfsNfsGenFlagWritable: $WRITABLE
         fedfsNfsGenFlagGoing: $GOING
@@ -2342,9 +2336,7 @@
         objectClass: fedfsNfsFsl
         fedfsFslUuid: ba89a802-41a9-44cf-8447-dda367590eb3
         fedfsFsnUuid: e8c4761c-eb3b-4307-86fc-f702da197966
-        fedfsFslHost: server.example.com
-        fedfsFslPort: 2049
-        fedfsNfsPath:< file:///tmp/fsl_path
+        fedfsNfsURI: nfs://server.example.com//tmp/fsl_path
         fedfsNfsCurrency: 0
         fedfsNfsGenFlagWritable: TRUE
         fedfsNfsGenFlagGoing: FALSE
@@ -2768,14 +2760,14 @@
         <c> 1.3.6.1.4.1.31103.1.6    </c> <c> fedfsNsdbPort           </c> <c> deprecated </c>
         <c> 1.3.6.1.4.1.31103.1.7    </c> <c> fedfsNcePrefix          </c> <c> deprecated </c>
         <c> 1.3.6.1.4.1.31103.1.8    </c> <c> fedfsFslUuid            </c> <c> RFC-TBD1 </c>
-        <c> 1.3.6.1.4.1.31103.1.9    </c> <c> fedfsFslHost            </c> <c> RFC-TBD1 </c>
-        <c> 1.3.6.1.4.1.31103.1.10   </c> <c> fedfsFslPort            </c> <c> RFC-TBD1 </c>
+        <c> 1.3.6.1.4.1.31103.1.9    </c> <c> fedfsFslHost            </c> <c> deprecated </c>
+        <c> 1.3.6.1.4.1.31103.1.10   </c> <c> fedfsFslPort            </c> <c> deprecated </c>
         <c> 1.3.6.1.4.1.31103.1.11   </c> <c> fedfsFslTTL             </c> <c> deprecated </c>
         <c> 1.3.6.1.4.1.31103.1.12   </c> <c> fedfsAnnotation         </c> <c> RFC-TBD1 </c>
         <c> 1.3.6.1.4.1.31103.1.13   </c> <c> fedfsDescr              </c> <c> RFC-TBD1 </c>
         <c> 1.3.6.1.4.1.31103.1.14   </c> <c> fedfsNceDN              </c> <c> RFC-TBD1 </c>
         <c> 1.3.6.1.4.1.31103.1.15   </c> <c> fedfsFsnTTL             </c> <c> RFC-TBD1 </c>
-        <c> 1.3.6.1.4.1.31103.1.100  </c> <c> fedfsNfsPath            </c> <c> RFC-TBD1 </c>
+        <c> 1.3.6.1.4.1.31103.1.100  </c> <c> fedfsNfsPath            </c> <c> deprecated </c>
         <c> 1.3.6.1.4.1.31103.1.101  </c> <c> fedfsNfsMajorVer        </c> <c> deprecated </c>
         <c> 1.3.6.1.4.1.31103.1.102  </c> <c> fedfsNfsMinorVer        </c> <c> deprecated </c>
         <c> 1.3.6.1.4.1.31103.1.103  </c> <c> fedfsNfsCurrency        </c> <c> RFC-TBD1 </c>
@@ -2795,6 +2787,7 @@
         <c> 1.3.6.1.4.1.31103.1.117  </c> <c> fedfsNfsWriteOrder      </c> <c> RFC-TBD1 </c>
         <c> 1.3.6.1.4.1.31103.1.118  </c> <c> fedfsNfsVarSub          </c> <c> RFC-TBD1 </c>
         <c> 1.3.6.1.4.1.31103.1.119  </c> <c> fedfsNfsValidFor        </c> <c> RFC-TBD1 </c>
+        <c> 1.3.6.1.4.1.31103.1.120  </c> <c> fedfsNfsURI             </c> <c> RFC-TBD1 </c>
         <c> 1.3.6.1.4.1.31103.1.1001 </c> <c> fedfsNsdbContainerInfo  </c> <c> RFC-TBD1 </c>
         <c> 1.3.6.1.4.1.31103.1.1002 </c> <c> fedfsFsn                </c> <c> RFC-TBD1 </c>
         <c> 1.3.6.1.4.1.31103.1.1003 </c> <c> fedfsFsl                </c> <c> RFC-TBD1 </c>
@@ -2888,7 +2881,7 @@
         <list style="hanging">
         <t hangText="Object Identifier:"> 1.3.6.1.4.1.31103.1.9 </t>
         <t hangText="Descriptor (short name):"> fedfsFslHost </t>
-        <t hangText="Usage:"> attribute type </t>
+        <t hangText="Usage:"> attribute type, deprecated </t>
         </list>
     </t>
 
@@ -2896,7 +2889,7 @@
         <list style="hanging">
         <t hangText="Object Identifier:"> 1.3.6.1.4.1.31103.1.10 </t>
         <t hangText="Descriptor (short name):"> fedfsFslPort </t>
-        <t hangText="Usage:"> attribute type </t>
+        <t hangText="Usage:"> attribute type, deprecated </t>
         </list>
     </t>
 
@@ -2944,7 +2937,7 @@
         <list style="hanging">
         <t hangText="Object Identifier:"> 1.3.6.1.4.1.31103.1.100 </t>
         <t hangText="Descriptor (short name):"> fedfsNfsPath </t>
-        <t hangText="Usage:"> attribute type </t>
+        <t hangText="Usage:"> attribute type, deprecated </t>
         </list>
     </t>
 
@@ -3102,6 +3095,14 @@
 
     <t>
         <list style="hanging">
+        <t hangText="Object Identifier:"> 1.3.6.1.4.1.31103.1.120 </t>
+        <t hangText="Descriptor (short name):"> fedfsNfsURI </t>
+        <t hangText="Usage:"> attribute type </t>
+        </list>
+    </t>
+
+    <t>
+        <list style="hanging">
         <t hangText="Object Identifier:"> 1.3.6.1.4.1.31103.1.1001 </t>
         <t hangText="Descriptor (short name):"> fedfsNsdbContainerInfo </t>
         <t hangText="Usage:"> object class </t>
@@ -3176,6 +3177,7 @@
 
         <?rfc include="references/reference.RFC.1094.xml"?>
         <?rfc include="references/reference.RFC.1813.xml"?>
+        <?rfc include="references/reference.RFC.2224.xml"?>
         <?rfc include="references/reference.RFC.3254.xml"?>
         <?rfc include="references/reference.AFS.xml"?>
         <?rfc include="references/reference.RFC.5716.xml"?>
diff --git a/references/reference.RFC.2224.xml b/references/reference.RFC.2224.xml
new file mode 100644
index 0000000..fab50e2
--- /dev/null
+++ b/references/reference.RFC.2224.xml
@@ -0,0 +1,47 @@
+<?xml version='1.0' encoding='UTF-8'?>
+
+<reference anchor='RFC2224'>
+
+<front>
+<title>NFS URL Scheme</title>
+<author initials='B.' surname='Callaghan' fullname='Brent Callaghan'>
+<organization>Sun Microsystems, Inc.</organization>
+<address>
+<postal>
+<street>Mailstop Mpk17-201</street>
+<street>901 San Antonio Road</street>
+<street>Palo Alto</street>
+<street>California 94303</street></postal>
+<phone>1-415-786-5067</phone>
+<facsimile>1-415-786-5896</facsimile>
+<email>[email-masked]</email></address></author>
+<date year='1997' month='October' />
+<area>Applications</area>
+<keyword>NFS</keyword>
+<keyword>network file system</keyword>
+<keyword>uniform resource</keyword>
+<abstract>
+<t>
+   A new URL scheme, &apos;nfs&apos; is defined.  It is used to refer to files and
+   directories on NFS servers using the general URL syntax defined in
+   RFC 1738, &quot;Uniform Resource Locators (URL)&quot;.
+</t>
+<t>
+   This scheme uses the public filehandle and multi-component lookup
+   [RFC2054, RFC2055] to access server data with a minimum of protocol
+   overhead.
+</t>
+<t>
+   The NFS protocol provides access to shared filesystems across
+   networks.  It is designed to be machine, operating system, network
+   architecture, and transport protocol independent.  The protocol
+   currently exists in two versions: version 2  and version 3
+   , both built on ONC RPC  at its associated eXternal
+   Data Representation (XDR)  and Binding Protocol .
+</t></abstract></front>
+
+<seriesInfo name='RFC' value='2224' />
+<format type='TXT' octets='22726' target='http://www.rfc-editor.org/rfc/rfc2224.txt' />
+<format type='HTML' octets='35259' target='http://xml.resource.org/public/rfc/html/rfc2224.html' />
+<format type='XML' octets='24941' target='http://xml.resource.org/public/rfc/xml/rfc2224.xml' />
+</reference>