idnits 2.17.1 draft-lentini-nfsv4-server-side-copy-06.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- == There are 5 instances of lines with non-RFC6890-compliant IPv4 addresses in the document. If these are example addresses, they should be changed. == There are 5 instances of lines with private range IPv4 addresses in the document. If these are generic example addresses, they should be changed to use any of the ranges defined in RFC 6890 (or successor): 192.0.2.x, 198.51.100.x or 203.0.113.x. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year -- The document date (October 21, 2010) is 4937 days in the past. Is this intentional? -- Found something which looks like a code comment -- if you have code sections in the document, please surround them with '' and '' lines. Checking references for intended status: Proposed Standard ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) -- Looks like a reference, but probably isn't: '0' on line 1404 ** Obsolete normative reference: RFC 3530 (Obsoleted by RFC 7530) ** Obsolete normative reference: RFC 5661 (Obsoleted by RFC 8881) -- Obsolete informational reference (is this intentional?): RFC 2616 (Obsoleted by RFC 7230, RFC 7231, RFC 7232, RFC 7233, RFC 7234, RFC 7235) Summary: 2 errors (**), 0 flaws (~~), 3 warnings (==), 4 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 NFSv4 J. Lentini 3 Internet-Draft M. Eisler 4 Intended status: Standards Track D. Kenchammana 5 Expires: April 24, 2011 NetApp 6 A. Madan 7 Carnegie Mellon University 8 R. Iyer 9 October 21, 2010 11 NFS Server-side Copy 12 draft-lentini-nfsv4-server-side-copy-06.txt 14 Abstract 16 This document describes a set of NFS operations for offloading a file 17 copy to a file server or between two file servers. 19 Status of this Memo 21 This Internet-Draft is submitted in full conformance with the 22 provisions of BCP 78 and BCP 79. 24 Internet-Drafts are working documents of the Internet Engineering 25 Task Force (IETF). Note that other groups may also distribute 26 working documents as Internet-Drafts. The list of current Internet- 27 Drafts is at http://datatracker.ietf.org/drafts/current/. 29 Internet-Drafts are draft documents valid for a maximum of six months 30 and may be updated, replaced, or obsoleted by other documents at any 31 time. It is inappropriate to use Internet-Drafts as reference 32 material or to cite them other than as "work in progress." 34 This Internet-Draft will expire on April 24, 2011. 36 Copyright Notice 38 Copyright (c) 2010 IETF Trust and the persons identified as the 39 document authors. All rights reserved. 41 This document is subject to BCP 78 and the IETF Trust's Legal 42 Provisions Relating to IETF Documents 43 (http://trustee.ietf.org/license-info) in effect on the date of 44 publication of this document. Please review these documents 45 carefully, as they describe your rights and restrictions with respect 46 to this document. Code Components extracted from this document must 47 include Simplified BSD License text as described in Section 4.e of 48 the Trust Legal Provisions and are provided without warranty as 49 described in the Simplified BSD License. 51 Table of Contents 53 1. Requirements notation . . . . . . . . . . . . . . . . . . . . 3 54 2. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 3 55 3. Protocol Overview . . . . . . . . . . . . . . . . . . . . . . 3 56 3.1. Intra-Server Copy . . . . . . . . . . . . . . . . . . . . 5 57 3.2. Inter-Server Copy . . . . . . . . . . . . . . . . . . . . 6 58 3.3. Server-to-Server Copy Protocol . . . . . . . . . . . . . . 9 59 3.3.1. Using NFSv4.x as a Server-to-Server Copy Protocol . . 9 60 3.3.2. Using an alternative Server-to-Server Copy Protocol . 10 61 4. Operations . . . . . . . . . . . . . . . . . . . . . . . . . . 11 62 4.1. netloc4 - Network Locations . . . . . . . . . . . . . . . 11 63 4.2. Operation U: COPY_NOTIFY - Notify a source server of a 64 future copy . . . . . . . . . . . . . . . . . . . . . . . 12 65 4.3. Operation V: COPY_REVOKE - Revoke a destination 66 server's copy privileges . . . . . . . . . . . . . . . . . 14 67 4.4. Operation W: COPY - Initiate a server-side copy . . . . . 15 68 4.5. Operation X: COPY_ABORT - Cancel a server-side copy . . . 23 69 4.6. Operation Y: COPY_STATUS - Poll for status of a 70 server-side copy . . . . . . . . . . . . . . . . . . . . . 24 71 4.7. Operation Z: CB_COPY - Report results of a server-side 72 copy . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 73 4.8. Copy Offload Stateids . . . . . . . . . . . . . . . . . . 26 74 5. Security Considerations . . . . . . . . . . . . . . . . . . . 27 75 5.1. Inter-Server Copy Security . . . . . . . . . . . . . . . . 27 76 5.1.1. Requirements for Secure Inter-Server Copy . . . . . . 27 77 5.1.2. Inter-Server Copy with RPCSEC_GSSv3 . . . . . . . . . 28 78 5.1.3. Inter-Server Copy via ONC RPC but without 79 RPCSEC_GSSv3 . . . . . . . . . . . . . . . . . . . . . 34 80 5.1.4. Inter-Server Copy without ONC RPC and RPCSEC_GSSv3 . . 35 81 6. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 35 82 7. References . . . . . . . . . . . . . . . . . . . . . . . . . . 35 83 7.1. Normative References . . . . . . . . . . . . . . . . . . . 35 84 7.2. Informational References . . . . . . . . . . . . . . . . . 35 85 Appendix A. Acknowledgments . . . . . . . . . . . . . . . . . . . 36 86 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . . 36 88 1. Requirements notation 90 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 91 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 92 document are to be interpreted as described in [RFC2119]. 94 2. Introduction 96 This document describes a server-side copy feature for the NFS 97 protocol. 99 The server-side copy feature provides a mechanism for the NFS client 100 to perform a file copy on the server without the data being 101 transmitted back and forth over the network. 103 Without this feature, an NFS client copies data from one location to 104 another by reading the data from the server over the network, and 105 then writing the data back over the network to the server. Using 106 this server-side copy operation, the client is able to instruct the 107 server to copy the data locally without the data being sent back and 108 forth over the network unnecessarily. 110 In general, this feature is useful whenever data is copied from one 111 location to another on the server. It is particularly useful when 112 copying the contents of a file from a backup. Backup-versions of a 113 file are copied for a number of reasons, including restoring and 114 cloning data. 116 If the source object and destination object are on different file 117 servers, the file servers will communicate with one another to 118 perform the copy operation. The server-to-server protocol by which 119 this is accomplished is not defined in this document. 121 3. Protocol Overview 123 The server-side copy offload operations support both intra-server and 124 inter-server file copies. An intra-server copy is a copy in which 125 the source file and destination file reside on the same server. In 126 an inter-server copy, the source file and destination file are on 127 different servers. In both cases, the copy may be performed 128 synchronously or asynchronously. 130 Throughout the rest of this document, we refer to the NFS server 131 containing the source file as the "source server" and the NFS server 132 to which the file is transferred as the "destination server". In the 133 case of an intra-server copy, the source server and destination 134 server are the same server. Therefore in the context of an intra- 135 server copy, the terms source server and destination server refer to 136 the single server performing the copy. 138 The operations described below are designed to copy files. Other 139 file system objects can be copied by building on these operations or 140 using other techniques. For example if the user wishes to copy a 141 directory, the client can synthesize a directory copy by first 142 creating the destination directory and then copying the source 143 directory's files to the new destination directory. If the user 144 wishes to copy a namespace junction [FEDFS-NSDB] [FEDFS-ADMIN], the 145 client can use the ONC RPC Federated Filesystem protocol 146 [FEDFS-ADMIN] to perform the copy. Specifically the client can 147 determine the source junction's attributes using the FEDFS_LOOKUP_FSN 148 procedure and create a duplicate junction using the 149 FEDFS_CREATE_JUNCTION procedure. 151 For the inter-server copy protocol, the operations are defined to be 152 compatible with a server-to-server copy protocol in which the 153 destination server reads the file data from the source server. This 154 model in which the file data is pulled from the source by the 155 destination has a number of advantages over a model in which the 156 source pushes the file data to the destination. The advantages of 157 the pull model include: 159 o The pull model only requires a remote server (i.e. the destination 160 server) to be granted read access. A push model requires a remote 161 server (i.e. the source server) to be granted write access, which 162 is more privileged. 164 o The pull model allows the destination server to stop reading if it 165 has run out of space. In a push model, the destination server 166 must flow control the source server in this situation. 168 o The pull model allows the destination server to easily flow 169 control the data stream by adjusting the size of its read 170 operations. In a push model, the destination server does not have 171 this ability. The source server in a push model is capable of 172 writing chunks larger than the destination server has requested in 173 attributes and session parameters. In theory, the destination 174 server could perform a "short" write in this situation, but this 175 approach is known to behave poorly in practice. 177 The following operations are provided to support server-side copy: 179 COPY_NOTIFY: For inter-server copies, the client sends this 180 operation to the source server to notify it of a future file copy 181 from a given destination server for the given user. 183 COPY_REVOKE: Also for inter-server copies, the client sends this 184 operation to the source server to revoke permission to copy a file 185 for the given user. 187 COPY: Used by the client to request a file copy. 189 COPY_ABORT: Used by the client to abort an asynchronous file copy. 191 COPY_STATUS: Used by the client to poll the status of an 192 asynchronous file copy. 194 CB_COPY: Used by the destination server to report the results of an 195 asynchronous file copy to the client. 197 These operations are described in detail in Section 4. This section 198 provides an overview of how these operations are used to perform 199 server-side copies. 201 3.1. Intra-Server Copy 203 To copy a file on a single server, the client uses a COPY operation. 204 The server may respond to the copy operation with the final results 205 of the copy or it may perform the copy asynchronously and deliver the 206 results using a CB_COPY operation callback. If the copy is performed 207 asynchronously, the client may poll the status of the copy using 208 COPY_STATUS or cancel the copy using COPY_ABORT. 210 A synchronous intra-server copy is shown in Figure 1. In this 211 example, the NFS server chooses to perform the copy synchronously. 212 The copy operation is completed, either successfully or 213 unsuccessfully, before the server replies to the client's request. 214 The server's reply contains the final result of the operation. 216 Client Server 217 + + 218 | | 219 |--- COPY ---------------------------->| Client requests 220 |<------------------------------------/| a file copy 221 | | 222 | | 224 Figure 1: A synchronous intra-server copy. 226 An asynchronous intra-server copy is shown in Figure 2. In this 227 example, the NFS server performs the copy asynchronously. The 228 server's reply to the copy request indicates that the copy operation 229 was initiated and the final result will be delivered at a later time. 230 The server's reply also contains a copy stateid. The client may use 231 this copy stateid to poll for status information (as shown) or to 232 cancel the copy using a COPY_ABORT. When the server completes the 233 copy, the server performs a callback to the client and reports the 234 results. 236 Client Server 237 + + 238 | | 239 |--- COPY ---------------------------->| Client requests 240 |<------------------------------------/| a file copy 241 | | 242 | | 243 |--- COPY_STATUS --------------------->| Client may poll 244 |<------------------------------------/| for status 245 | | 246 | . | Multiple COPY_STATUS 247 | . | operations may be sent. 248 | . | 249 | | 250 |<-- CB_COPY --------------------------| Server reports results 251 |\------------------------------------>| 252 | | 254 Figure 2: An asynchronous intra-server copy. 256 3.2. Inter-Server Copy 258 A copy may also be performed between two servers. The copy protocol 259 is designed to accommodate a variety of network topologies. As shown 260 in Figure 3, the client and servers may be connected by multiple 261 networks. In particular, the servers may be connected by a 262 specialized, high speed network (network 192.168.33.0/24 in the 263 diagram) that does not include the client. The protocol allows the 264 client to setup the copy between the servers (over network 265 10.11.78.0/24 in the diagram) and for the servers to communicate on 266 the high speed network if they choose to do so. 268 192.168.33.0/24 269 +-------------------------------------+ 270 | | 271 | | 272 | 192.168.33.18 | 192.168.33.56 273 +-------+------+ +------+------+ 274 | Source | | Destination | 275 +-------+------+ +------+------+ 276 | 10.11.78.18 | 10.11.78.56 277 | | 278 | | 279 | 10.11.78.0/24 | 280 +------------------+------------------+ 281 | 282 | 283 | 10.11.78.243 284 +-----+-----+ 285 | Client | 286 +-----------+ 288 Figure 3: An example inter-server network topology. 290 For an inter-server copy, the client notifies the source server that 291 a file will be copied by the destination server using a COPY_NOTIFY 292 operation. The client then initiates the copy by sending the COPY 293 operation to the destination server. The destination server may 294 perform the copy synchronously or asynchronously. 296 A synchronous inter-server copy is shown in Figure 4. In this case, 297 the destination server chooses to perform the copy before responding 298 to the client's COPY request. 300 An asynchronous copy is shown in Figure 5. In this case, the 301 destination server chooses to respond to the client's COPY request 302 immediately and then perform the copy asynchronously. 304 Client Source Destination 305 + + + 306 | | | 307 |--- COPY_NOTIFY --->| | 308 |<------------------/| | 309 | | | 310 | | | 311 |--- COPY ---------------------------->| 312 | | | 313 | | | 314 | |<----- read -----| 315 | |\--------------->| 316 | | | 317 | | . | Multiple reads may 318 | | . | be necessary 319 | | . | 320 | | | 321 | | | 322 |<------------------------------------/| Destination replies 323 | | | to COPY 325 Figure 4: A synchronous inter-server copy. 327 Client Source Destination 328 + + + 329 | | | 330 |--- COPY_NOTIFY --->| | 331 |<------------------/| | 332 | | | 333 | | | 334 |--- COPY ---------------------------->| 335 |<------------------------------------/| 336 | | | 337 | | | 338 | |<----- read -----| 339 | |\--------------->| 340 | | | 341 | | . | Multiple reads may 342 | | . | be necessary 343 | | . | 344 | | | 345 | | | 346 |--- COPY_STATUS --------------------->| Client may poll 347 |<------------------------------------/| for status 348 | | | 349 | | . | Multiple COPY_STATUS 350 | | . | operations may be sent 351 | | . | 352 | | | 353 | | | 354 | | | 355 |<-- CB_COPY --------------------------| Destination reports 356 |\------------------------------------>| results 357 | | | 359 Figure 5: An asynchronous inter-server copy. 361 3.3. Server-to-Server Copy Protocol 363 During an inter-server copy, the destination server reads the file 364 data from the source server. The source server and destination 365 server are not required to use a specific protocol to transfer the 366 file data. The choice of what protocol to use is ultimately the 367 destination server's decision. 369 3.3.1. Using NFSv4.x as a Server-to-Server Copy Protocol 371 The destination server MAY use standard NFSv4.x (where x >= 1) to 372 read the data from the source server. If NFSv4.x is used for the 373 server-to-server copy protocol, the destination server can use the 374 filehandle contained in the COPY request with standard NFSv4.x 375 operations to read data from the source server. Specifically, the 376 destination server may use the NFSv4.x OPEN operation's CLAIM_FH 377 facility to open the file being copied and obtain an open stateid. 378 Using the stateid, the destination server may then use NFSv4.x READ 379 operations to read the file. 381 3.3.2. Using an alternative Server-to-Server Copy Protocol 383 In a homogeneous environment, the source and destination servers 384 might be able to perform the file copy extremely efficiently using 385 specialized protocols. For example the source and destination 386 servers might be two nodes sharing a common file system format for 387 the source and destination file systems. Thus the source and 388 destination are in an ideal position to efficiently render the image 389 of the source file to the destination file by replicating the file 390 system formats at the block level. Another possibility is that the 391 source and destination might be two nodes sharing a common storage 392 area network, and thus there is no need to copy any data at all, and 393 instead ownership of the file and its contents might simply be re- 394 assigned to the destination. To allow for these possibilities, the 395 destination server is allowed to use a server-to-server copy protocol 396 of its choice. 398 In a heterogeneous environment, using a protocol other than NFSv4.x 399 (e.g. HTTP [RFC2616] or FTP [RFC0959]) presents some challenges. In 400 particular, the destination server is presented with the challenge of 401 accessing the source file given only an NFSv4.x filehandle. 403 One option for protocols that identify source files with path names 404 is to use an ASCII hexadecimal representation of the source 405 filehandle as the file name. 407 Another option for the source server is to use URLs to direct the 408 destination server to a specialized service. For example, the 409 response to COPY_NOTIFY could include the URL 410 ftp://s1.example.com:9999/_FH/0x12345, where 0x12345 is the ASCII 411 hexadecimal representation of the source filehandle. When the 412 destination server receives the source server's URL, it would use 413 "_FH/0x12345" as the file name to pass to the FTP server listening on 414 port 9999 of s1.example.com. On port 9999 there would be a special 415 instance of the FTP service that understands how to convert NFS 416 filehandles to an open file descriptor (in many operating systems, 417 this would require a new system call, one which is the inverse of the 418 makefh() function that the pre-NFSv4 MOUNT service needs). 420 Authenticating and identifying the destination server to the source 421 server is also a challenge. Recommendations for how to accomplish 422 this are given in Section 5.1.2.4 and Section 5.1.4. 424 4. Operations 426 In the sections that follow, several operations are defined that 427 together provide the server-side copy feature. These operations are 428 intended to be OPTIONAL operations as defined in section 17 of 429 [RFC5661]. The COPY_NOTIFY, COPY_REVOKE, COPY, COPY_ABORT, and 430 COPY_STATUS operations are designed to be sent within an NFSv4 431 COMPOUND procedure. The CB_COPY operation is designed to be sent 432 within an NFSv4 CB_COMPOUND procedure. 434 Each operation is performed in the context of the user identified by 435 the ONC RPC credential of its containing COMPOUND or CB_COMPOUND 436 request. For example, a COPY_ABORT operation issued by a given user 437 indicates that a specified COPY operation initiated by the same user 438 be canceled. Therefore a COPY_ABORT MUST NOT interfere with a copy 439 of the same file initiated by another user. 441 An NFS server MAY allow an administrative user to monitor or cancel 442 copy operations using an implementation specific interface. 444 4.1. netloc4 - Network Locations 446 The server-side copy operations specify network locations using the 447 netloc4 data type shown below: 449 enum netloc_type4 { 450 NL4_NAME = 0, 451 NL4_URL = 1, 452 NL4_NETADDR = 2 453 }; 455 union netloc4 switch (netloc_type4 nl_type) { 456 case NL4_NAME: utf8str_cis nl_name; 457 case NL4_URL: utf8str_cis nl_url; 458 case NL4_NETADDR: netaddr4 nl_addr; 459 }; 461 If the netloc4 is of type NL4_NAME, the nl_name field MUST be 462 specified as a UTF-8 string. The nl_name is expected to be resolved 463 to a network address via DNS, LDAP, NIS, /etc/hosts, or some other 464 means. If the netloc4 is of type NL4_URL, a server URL [RFC3986] 465 appropriate for the server-to-server copy operation is specified as a 466 UTF-8 string. If the netloc4 is of type NL4_NETADDR, the nl_addr 467 field MUST contain a valid netaddr4 as defined in Section 3.3.9 of 468 [RFC5661]. 470 When netloc4 values are used for an inter-server copy as shown in 471 Figure 3, their values may be evaluated on the source server, 472 destination server, and client. The network environment in which 473 these systems operate should be configured so that the netloc4 values 474 are interpreted as intended on each system. 476 4.2. Operation U: COPY_NOTIFY - Notify a source server of a future copy 478 ARGUMENTS 480 struct COPY_NOTIFY4args { 481 /* CURRENT_FH: source file */ 482 netloc4 cna_destination_server; 483 }; 485 RESULTS 487 union COPY_NOTIFY4res switch (nfsstat4 cnr_status) { 488 case NFS4_OK: 489 nfstime4 cnr_lease_time; 490 netloc4 cnr_source_server<>; 491 default: 492 void; 493 }; 495 DESCRIPTION 497 This operation is used for an inter-server copy. A client sends this 498 operation in a COMPOUND request to the source server to authorize a 499 destination server identified by cna_destination_server to read the 500 file specified by CURRENT_FH on behalf of the given user. 502 The cna_destination_server MUST be specified using the netloc4 503 network location format. The server is not required to resolve the 504 cna_destination_server address before completing this operation. 506 If this operation succeeds, the source server will allow the 507 cna_destination_server to copy the specified file on behalf of the 508 given user. If COPY_NOTIFY succeeds, the destination server is 509 granted permission to read the file as long as both of the following 510 conditions are met: 512 o The destination server begins reading the source file before the 513 cnr_lease_time expires. If the cnr_lease_time expires while the 514 destination server is still reading the source file, the 515 destination server is allowed to finish reading the file. 517 o The client has not issued a COPY_REVOKE for the same combination 518 of user, filehandle, and destination server. 520 The cnr_lease_time is chosen by the source server. A cnr_lease_time 521 of 0 (zero) indicates an infinite lease. To renew the copy lease 522 time the client should resend the same copy notification request to 523 the source server. 525 To avoid the need for synchronized clocks, copy lease times are 526 granted by the server as a time delta. However, there is a 527 requirement that the client and server clocks do not drift 528 excessively over the duration of the lease. There is also the issue 529 of propagation delay across the network which could easily be several 530 hundred milliseconds as well as the possibility that requests will be 531 lost and need to be retransmitted. 533 To take propagation delay into account, the client should subtract it 534 from copy lease times (e.g. if the client estimates the one-way 535 propagation delay as 200 milliseconds, then it can assume that the 536 lease is already 200 milliseconds old when it gets it). In addition, 537 it will take another 200 milliseconds to get a response back to the 538 server. So the client must send a lease renewal or send the copy 539 offload request to the cna_destination_server at least 400 540 milliseconds before the copy lease would expire. If the propagation 541 delay varies over the life of the lease (e.g. the client is on a 542 mobile host), the client will need to continuously subtract the 543 increase in propagation delay from the copy lease times. 545 The server's copy lease period configuration should take into account 546 the network distance of the clients that will be accessing the 547 server's resources. It is expected that the lease period will take 548 into account the network propagation delays and other network delay 549 factors for the client population. Since the protocol does not allow 550 for an automatic method to determine an appropriate copy lease 551 period, the server's administrator may have to tune the copy lease 552 period. 554 A successful response will also contain a list of names, addresses, 555 and URLs called cnr_source_server, on which the source is willing to 556 accept connections from the destination. These might not be 557 reachable from the client and might be located on networks to which 558 the client has no connection. 560 If the client wishes to perform an inter-server copy, the client MUST 561 send a COPY_NOTIFY to the source server. Therefore, the source 562 server MUST support COPY_NOTIFY. 564 For a copy only involving one server (the source and destination are 565 on the same server), this operation is unnecessary. 567 The COPY_NOTIFY operation may fail for the following reasons (this is 568 a partial list): 570 NFS4ERR_MOVED: The file system which contains the source file is not 571 present on the source server. The client can determine the 572 correct location and reissue the operation with the correct 573 location. 575 NFS4ERR_NOTSUPP: The copy offload operation is not supported by the 576 NFS server receiving this request. 578 NFS4ERR_WRONGSEC: The security mechanism being used by the client 579 does not match the server's security policy. 581 4.3. Operation V: COPY_REVOKE - Revoke a destination server's copy 582 privileges 584 ARGUMENTS 586 struct COPY_REVOKE4args { 587 /* CURRENT_FH: source file */ 588 netloc4 cra_destination_server; 589 }; 591 RESULTS 593 struct COPY_REVOKE4res { 594 nfsstat4 crr_status; 595 }; 597 DESCRIPTION 599 This operation is used for an inter-server copy. A client sends this 600 operation in a COMPOUND request to the source server to revoke the 601 authorization of a destination server identified by 602 cra_destination_server from reading the file specified by CURRENT_FH 603 on behalf of given user. If the cra_destination_server has already 604 begun copying the file, a successful return from this operation 605 indicates that further access will be prevented. 607 The cra_destination_server MUST be specified using the netloc4 608 network location format. The server is not required to resolve the 609 cra_destination_server address before completing this operation. 611 The COPY_REVOKE operation is useful in situations in which the source 612 server granted a very long or infinite lease on the destination 613 server's ability to read the source file and all copy operations on 614 the source file have been completed. 616 For a copy only involving one server (the source and destination are 617 on the same server), this operation is unnecessary. 619 If the server supports COPY_NOTIFY, the server is REQUIRED to support 620 the COPY_REVOKE operation. 622 The COPY_REVOKE operation may fail for the following reasons (this is 623 a partial list): 625 NFS4ERR_MOVED: The file system which contains the source file is not 626 present on the source server. The client can determine the 627 correct location and reissue the operation with the correct 628 location. 630 NFS4ERR_NOTSUPP: The copy offload operation is not supported by the 631 NFS server receiving this request. 633 4.4. Operation W: COPY - Initiate a server-side copy 635 ARGUMENTS 637 #define COPY4_GUARDED = 0x00000001; 638 #define COPY4_METADATA = 0x00000002; 640 struct COPY4args { 641 /* SAVED_FH: source file */ 642 /* CURRENT_FH: destination file or */ 643 /* directory */ 644 offset4 ca_src_offset; 645 offset4 ca_dst_offset; 646 length4 ca_count; 647 uint32_t ca_flags; 648 component4 ca_destination; 649 netloc4 ca_source_server<>; 650 }; 652 RESULTS 654 union COPY4res switch (nfsstat4 cr_status) { 655 /* CURRENT_FH: destination file */ 656 case NFS4_OK: 657 stateid4 cr_callback_id<1>; 658 default: 659 length4 cr_bytes_copied; 660 }; 662 DESCRIPTION 663 The COPY operation is used for both intra- and inter-server copies. 664 In both cases, the COPY is always sent from the client to the 665 destination server of the file copy. The COPY operation requests 666 that a file be copied from the location specified by the SAVED_FH 667 value to the location specified by the combination of CURRENT_FH and 668 ca_destination. 670 The SAVED_FH must be a regular file. If SAVED_FH is not a regular 671 file, the operation MUST fail and return NFS4ERR_WRONG_TYPE. 673 In order to set SAVED_FH to the source file handle, the compound 674 procedure requesting the COPY will include a sub-sequence of 675 operations such as 677 PUTFH source-fh 678 SAVEFH 680 If the request is for a server-to-server copy, the source-fh is a 681 filehandle from the source server and the compound procedure is being 682 executed on the destination server. In this case, the source-fh is a 683 foreign filehandle on the server receiving the COPY request. If 684 either PUTFH or SAVEFH checked the validity of the filehandle, the 685 operation would likely fail and return NFS4ERR_STALE. 687 In order to avoid this problem, the minor version incorporating the 688 COPY operations will need to make a few small changes in the handling 689 of existing operations. If a server supports the server-to-server 690 COPY feature, a PUTFH followed by a SAVEFH MUST NOT return 691 NFS4ERR_STALE for either operation. These restrictions do not pose 692 substantial difficulties for servers. The CURRENT_FH and SAVED_FH 693 may be validated in the context of the operation referencing them and 694 an NFS4ERR_STALE error returned for an invalid file handle at that 695 point. 697 The CURRENT_FH and ca_destination together specify the destination of 698 the copy operation. If ca_destination is of 0 (zero) length, then 699 CURRENT_FH specifies the target file. In this case, CURRENT_FH MUST 700 be a regular file and not a directory. If ca_destination is not of 0 701 (zero) length, the ca_destination argument specifies the file name to 702 which the data will be copied within the directory identified by 703 CURRENT_FH. In this case, CURRENT_FH MUST be a directory and not a 704 regular file. 706 If the file named by ca_destination does not exist and the operation 707 completes successfully, the file will be visible in the file system 708 namespace. If the file does not exist and the operation fails, the 709 file MAY be visible in the file system namespace depending on when 710 the failure occurs and on the implementation of the NFS server 711 receiving the COPY operation. If the ca_destination name cannot be 712 created in the destination file system (due to file name 713 restrictions, such as case or length), the operation MUST fail. 715 The ca_src_offset is the offset within the source file from which the 716 data will be read, the ca_dst_offset is the offset within the 717 destination file to which the data will be written, and the ca_count 718 is the number of bytes that will be copied. An offset of 0 (zero) 719 specifies the start of the file. A count of 0 (zero) requests that 720 all bytes from ca_src_offset through EOF be copied to the 721 destination. If concurrent modifications to the source file overlap 722 with the source file region being copied, the data copied may include 723 all, some, or none of the modifications. The client can use standard 724 NFS operations (e.g. OPEN with OPEN4_SHARE_DENY_WRITE or mandatory 725 byte range locks) to protect against concurrent modifications if the 726 client is concerned about this. If the source file's end of file is 727 being modified in parallel with a copy that specifies a count of 0 728 (zero) bytes, the amount of data copied is implementation dependent 729 (clients may guard against this case by specifying a non-zero count 730 value or preventing modification of the source file as mentioned 731 above). 733 If the source offset or the source offset plus count is greater than 734 or equal to the size of the source file, the operation will fail with 735 NFS4ERR_INVAL. The destination offset or destination offset plus 736 count may be greater than the size of the destination file. This 737 allows for the client to issue parallel copies to implement 738 operations such as "cat file1 file2 file3 file4 > dest". 740 If the destination file is created as a result of this command, the 741 destination file's size will be equal to the number of bytes 742 successfully copied. If the destination file already existed, the 743 destination file's size may increase as a result of this operation 744 (e.g. if ca_dst_offset plus ca_count is greater than the 745 destination's initial size). 747 If the ca_source_server list is specified, then this is an inter- 748 server copy operation and the source file is on a remote server. The 749 client is expected to have previously issued a successful COPY_NOTIFY 750 request to the remote source server. The ca_source_server list 751 SHOULD be the same as the COPY_NOTIFY response's cnr_source_server 752 list. If the client includes the entries from the COPY_NOTIFY 753 response's cnr_source_server list in the ca_source_server list, the 754 source server can indicate a specific copy protocol for the 755 destination server to use by returning a URL, which specifies both a 756 protocol service and server name. Server-to-server copy protocol 757 considerations are described in Section 3.3 and Section 5.1. 759 The ca_flags argument allows the copy operation to be customized in 760 the following ways using the guarded flag (COPY4_GUARDED) and the 761 metadata flag (COPY4_METADATA). 763 [NOTE: Earlier versions of this document defined a 764 COPY4_SPACE_RESERVED flag for controlling space reservations on the 765 destination file. This flag has been removed with the expectation 766 that the space_reserve attribute defined in [SPACE-RESERVE] will be 767 adopted.] 769 If the guarded flag is set and the destination exists on the server, 770 this operation will fail with NFS4ERR_EXIST. 772 If the guarded flag is not set and the destination exists on the 773 server, the behavior is implementation dependent. 775 If the metadata flag is set and the client is requesting a whole file 776 copy (i.e. ca_count is 0 (zero)), a subset of the destination file's 777 attributes MUST be the same as the source file's corresponding 778 attributes and a subset of the destination file's attributes SHOULD 779 be the same as the source file's corresponding attributes. The 780 attributes in the MUST and SHOULD copy subsets will be defined for 781 each NFS version. 783 For NFSv4.1, Table 1 and Table 2 list the REQUIRED and RECOMMENDED 784 attributes respectively. A "MUST" in the "Copy to destination file?" 785 column indicates that the attribute is part of the MUST copy set. A 786 "SHOULD" in the "Copy to destination file?" column indicates that the 787 attribute is part of the SHOULD copy set. 789 +--------------------+----+---------------------------+ 790 | Name | Id | Copy to destination file? | 791 +--------------------+----+---------------------------+ 792 | supported_attrs | 0 | no | 793 | type | 1 | MUST | 794 | fh_expire_type | 2 | no | 795 | change | 3 | SHOULD | 796 | size | 4 | MUST | 797 | link_support | 5 | no | 798 | symlink_support | 6 | no | 799 | named_attr | 7 | no | 800 | fsid | 8 | no | 801 | unique_handles | 9 | no | 802 | lease_time | 10 | no | 803 | rdattr_error | 11 | no | 804 | filehandle | 19 | no | 805 | suppattr_exclcreat | 75 | no | 806 +--------------------+----+---------------------------+ 808 Table 1 810 +--------------------+----+---------------------------+ 811 | Name | Id | Copy to destination file? | 812 +--------------------+----+---------------------------+ 813 | acl | 12 | MUST | 814 | aclsupport | 13 | no | 815 | archive | 14 | no | 816 | cansettime | 15 | no | 817 | case_insensitive | 16 | no | 818 | case_preserving | 17 | no | 819 | change_policy | 60 | no | 820 | chown_restricted | 18 | MUST | 821 | dacl | 58 | MUST | 822 | dir_notif_delay | 56 | no | 823 | dirent_notif_delay | 57 | no | 824 | fileid | 20 | no | 825 | files_avail | 21 | no | 826 | files_free | 22 | no | 827 | files_total | 23 | no | 828 | fs_charset_cap | 76 | no | 829 | fs_layout_type | 62 | no | 830 | fs_locations | 24 | no | 831 | fs_locations_info | 67 | no | 832 | fs_status | 61 | no | 833 | hidden | 25 | MUST | 834 | homogeneous | 26 | no | 835 | layout_alignment | 66 | no | 836 | layout_blksize | 65 | no | 837 | layout_hint | 63 | no | 838 | layout_type | 64 | no | 839 | maxfilesize | 27 | no | 840 | maxlink | 28 | no | 841 | maxname | 29 | no | 842 | maxread | 30 | no | 843 | maxwrite | 31 | no | 844 | mdsthreshold | 68 | no | 845 | mimetype | 32 | MUST | 846 | mode | 33 | MUST | 847 | mode_set_masked | 74 | no | 848 | mounted_on_fileid | 55 | no | 849 | no_trunc | 34 | no | 850 | numlinks | 35 | no | 851 | owner | 36 | MUST | 852 | owner_group | 37 | MUST | 853 | quota_avail_hard | 38 | no | 854 | quota_avail_soft | 39 | no | 855 | quota_used | 40 | no | 856 | rawdev | 41 | no | 857 | retentevt_get | 71 | MUST | 858 | retentevt_set | 72 | no | 859 | retention_get | 69 | MUST | 860 | retention_hold | 73 | MUST | 861 | retention_set | 70 | no | 862 | sacl | 59 | MUST | 863 | space_avail | 42 | no | 864 | space_free | 43 | no | 865 | space_total | 44 | no | 866 | space_used | 45 | no | 867 | system | 46 | MUST | 868 | time_access | 47 | MUST | 869 | time_access_set | 48 | no | 870 | time_backup | 49 | no | 871 | time_create | 50 | MUST | 872 | time_delta | 51 | no | 873 | time_metadata | 52 | SHOULD | 874 | time_modify | 53 | MUST | 875 | time_modify_set | 54 | no | 876 +--------------------+----+---------------------------+ 878 Table 2 880 [NOTE: The space_reserve attribute [SPACE-RESERVE] will be in the 881 MUST set.] 883 [NOTE: The source file's attribute values will take precedence over 884 any attribute values inherited by the destination file.] 885 In the case of an inter-server copy or an intra-server copy between 886 file systems, the attributes supported for the source file and 887 destination file could be different. By definition,the REQUIRED 888 attributes will be supported in all cases. If the metadata flag is 889 set and the source file has a RECOMMENDED attribute that is not 890 supported for the destination file, the copy MUST fail with 891 NFS4ERR_ATTRNOTSUPP. 893 Any attribute supported by the destination server that is not set on 894 the source file SHOULD be left unset. 896 Metadata attributes not exposed via the NFS protocol SHOULD be copied 897 to the destination file where appropriate. 899 The destination file's named attributes are not duplicated from the 900 source file. After the copy process completes, the client MAY 901 attempt to duplicate named attributes using standard NFSv4 902 operations. However, the destination file's named attribute 903 capabilities MAY be different from the source file's named attribute 904 capabilities. 906 If the metadata flag is not set and the client is requesting a whole 907 file copy (i.e. ca_count is 0 (zero)), the destination file's 908 metadata is implementation dependent. 910 If the client is requesting a partial file copy (i.e. ca_count is not 911 0 (zero)), the client SHOULD NOT set the metadata flag and the server 912 MUST ignore the metadata flag. 914 If the operation does not result in an immediate failure, the server 915 will return NFS4_OK, and the CURRENT_FH will remain the destination's 916 filehandle. 918 If an immediate failure does occur, cr_bytes_copied will be set to 919 the number of bytes copied to the destination file before the error 920 occurred. The cr_bytes_copied value indicates the number of bytes 921 copied but not which specific bytes have been copied. 923 A return of NFS4_OK indicates that either the operation is complete 924 or the operation was initiated and a callback will be used to deliver 925 the final status of the operation. 927 If the cr_callback_id is returned, this indicates that the operation 928 was initiated and a CB_COPY callback will deliver the final results 929 of the operation. The cr_callback_id stateid is termed a copy 930 stateid in this context. The server is given the option of returning 931 the results in a callback because the data may require a relatively 932 long period of time to copy. 934 If no cr_callback_id is returned, the operation completed 935 synchronously and no callback will be issued by the server. The 936 completion status of the operation is indicated by cr_status. 938 If the copy completes successfully, either synchronously or 939 asynchronously, the data copied from the source file to the 940 destination file MUST appear identical to the NFS client. However, 941 the NFS server's on disk representation of the data in the source 942 file and destination file MAY differ. For example, the NFS server 943 might encrypt, compress, deduplicate, or otherwise represent the on 944 disk data in the source and destination file differently. 946 In the event of a failure the state of the destination file is 947 implementation dependent. The COPY operation may fail for the 948 following reasons (this is a partial list). 950 NFS4ERR_MOVED: The file system which contains the source file, or 951 the destination file or directory is not present. The client can 952 determine the correct location and reissue the operation with the 953 correct location. 955 NFS4ERR_NOTSUPP: The copy offload operation is not supported by the 956 NFS server receiving this request. 958 NFS4ERR_PARTNER_NOTSUPP: The remote server does not support the 959 server-to-server copy offload protocol. 961 NFS4ERR_PARTNER_NO_AUTH: The remote server does not authorize a 962 server-to-server copy offload operation. This may be due to the 963 client's failure to send the COPY_NOTIFY operation to the remote 964 server, the remote server receiving a server-to-server copy 965 offload request after the copy lease time expired, or for some 966 other permission problem. 968 NFS4ERR_FBIG: The copy operation would have caused the file to grow 969 beyond the server's limit. 971 NFS4ERR_NOTDIR: The CURRENT_FH is a file and ca_destination has non- 972 zero length. 974 NFS4ERR_WRONG_TYPE: The SAVED_FH is not a regular file. 976 NFS4ERR_ISDIR: The CURRENT_FH is a directory and ca_destination has 977 zero length. 979 NFS4ERR_INVAL: The source offset or offset plus count are greater 980 than or equal to the size of the source file. 982 NFS4ERR_DELAY: The server does not have the resources to perform the 983 copy operation at the current time. The client should retry the 984 operation sometime in the future. 986 NFS4ERR_METADATA_NOTSUPP: The destination file cannot support the 987 same metadata as the source file. 989 NFS4ERR_WRONGSEC: The security mechanism being used by the client 990 does not match the server's security policy. 992 4.5. Operation X: COPY_ABORT - Cancel a server-side copy 994 ARGUMENTS 996 struct COPY_ABORT4args { 997 /* CURRENT_FH: destination file */ 998 stateid4 caa_stateid; 999 }; 1001 RESULTS 1003 struct COPY_ABORT4res { 1004 nfsstat4 car_status; 1005 }; 1007 DESCRIPTION 1009 COPY_ABORT is used for both intra- and inter-server asynchronous 1010 copies. The COPY_ABORT operation allows the client to cancel a 1011 server-side copy operation that it initiated. This operation is sent 1012 in a COMPOUND request from the client to the destination server. 1013 This operation may be used to cancel a copy when the application that 1014 requested the copy exits before the operation is completed or for 1015 some other reason. 1017 The request contains the filehandle and copy stateid cookies that act 1018 as the context for the previously initiated copy operation. 1020 The result's car_status field indicates whether the cancel was 1021 successful or not. A value of NFS4_OK indicates that the copy 1022 operation was canceled and no callback will be issued by the server. 1023 A copy operation that is successfully canceled may result in none, 1024 some, or all of the data copied. 1026 If the server supports asynchronous copies, the server is REQUIRED to 1027 support the COPY_ABORT operation. 1029 The COPY_ABORT operation may fail for the following reasons (this is 1030 a partial list): 1032 NFS4ERR_NOTSUPP: The abort operation is not supported by the NFS 1033 server receiving this request. 1035 NFS4ERR_RETRY: The abort failed, but a retry at some time in the 1036 future MAY succeed. 1038 NFS4ERR_COMPLETE_ALREADY: The abort failed, and a callback will 1039 deliver the results of the copy operation. 1041 NFS4ERR_SERVERFAULT: An error occurred on the server that does not 1042 map to a specific error code. 1044 4.6. Operation Y: COPY_STATUS - Poll for status of a server-side copy 1046 ARGUMENTS 1048 struct COPY_STATUS4args { 1049 /* CURRENT_FH: destination file */ 1050 stateid4 csa_stateid; 1051 }; 1053 RESULTS 1055 union COPY_STATUS4res switch (nfsstat4 csr_status) { 1056 case NFS4_OK: 1057 length4 csr_bytes_copied; 1058 nfsstat4 csr_complete<1>; 1059 default: 1060 void; 1061 }; 1063 DESCRIPTION 1065 COPY_STATUS is used for both intra- and inter-server asynchronous 1066 copies. The COPY_STATUS operation allows the client to poll the 1067 server to determine the status of an asynchronous copy operation. 1068 This operation is sent by the client to the destination server. 1070 If this operation is successful, the number of bytes copied are 1071 returned to the client in the csr_bytes_copied field. The 1072 csr_bytes_copied value indicates the number of bytes copied but not 1073 which specific bytes have been copied. 1075 If the optional csr_complete field is present, the copy has 1076 completed. In this case the status value indicates the result of the 1077 asynchronous copy operation. In all cases, the server will also 1078 deliver the final results of the asynchronous copy in a CB_COPY 1079 operation. 1081 The failure of this operation does not indicate the result of the 1082 asynchronous copy in any way. 1084 If the server supports asynchronous copies, the server is REQUIRED to 1085 support the COPY_STATUS operation. 1087 The COPY_STATUS operation may fail for the following reasons (this is 1088 a partial list): 1090 NFS4ERR_NOTSUPP: The copy status operation is not supported by the 1091 NFS server receiving this request. 1093 NFS4ERR_BAD_STATEID: The stateid is not valid (see Section 4.8 1094 below). 1096 NFS4ERR_EXPIRED: The stateid has expired (see Copy Offload Stateid 1097 section below). 1099 4.7. Operation Z: CB_COPY - Report results of a server-side copy 1101 ARGUMENTS 1103 union copy_info4 switch (nfsstat4 cca_status) { 1104 case NFS4_OK: 1105 void; 1106 default: 1107 length4 cca_bytes_copied; 1108 }; 1110 struct CB_COPY4args { 1111 nfs_fh4 cca_fh; 1112 stateid4 cca_stateid; 1113 copy_info4 cca_copy_info; 1114 }; 1116 RESULTS 1118 struct CB_COPY4res { 1119 nfsstat4 ccr_status; 1120 }; 1122 DESCRIPTION 1123 CB_COPY is used for both intra- and inter-server asynchronous copies. 1124 The CB_COPY callback informs the client of the result of an 1125 asynchronous server-side copy. This operation is sent by the 1126 destination server to the client in a CB_COMPOUND request. The copy 1127 is identified by the filehandle and stateid arguments. The result is 1128 indicated by the status field. If the copy failed, cca_bytes_copied 1129 contains the number of bytes copied before the failure occurred. The 1130 cca_bytes_copied value indicates the number of bytes copied but not 1131 which specific bytes have been copied. 1133 In the absence of an established backchannel, the server cannot 1134 signal the completion of the COPY via a CB_COPY callback. The loss 1135 of a callback channel would be indicated by the server setting the 1136 SEQ4_STATUS_CB_PATH_DOWN flag in the sr_status_flags field of the 1137 SEQUENCE operation. The client must re-establish the callback 1138 channel to receive the status of the COPY operation. Prolonged loss 1139 of the callback channel could result in the server dropping the COPY 1140 operation state and invalidating the copy stateid. 1142 If the client supports the COPY operation, the client is REQUIRED to 1143 support the CB_COPY operation. 1145 The CB_COPY operation may fail for the following reasons (this is a 1146 partial list): 1148 NFS4ERR_NOTSUPP: The copy offload operation is not supported by the 1149 NFS client receiving this request. 1151 4.8. Copy Offload Stateids 1153 A server may perform a copy offload operation asynchronously. An 1154 asynchronous copy is tracked using a copy offload stateid. Copy 1155 offload stateids are included in the COPY, COPY_ABORT, COPY_STATUS, 1156 and CB_COPY operations. 1158 Section 8.2.4 of [RFC5661] specifies that stateids are valid until 1159 either (A) the client or server restart or (B) the client returns the 1160 resource. 1162 A copy offload stateid will be valid until either (A) the client or 1163 server restart or (B) the client returns the resource by issuing a 1164 COPY_ABORT operation or the client replies to a CB_COPY operation. 1166 A copy offload stateid's seqid MUST NOT be 0 (zero). In the context 1167 of a copy offload operation, it is ambiguous to indicate the most 1168 recent copy offload operation using a stateid with seqid of 0 (zero). 1169 Therefore a copy offload stateid with seqid of 0 (zero) MUST be 1170 considered invalid. 1172 5. Security Considerations 1174 The security considerations pertaining to NFSv4 [RFC3530] apply to 1175 this document. 1177 The standard security mechanisms provide by NFSv4 [RFC3530] may be 1178 used to secure the protocol described in this document. 1180 NFSv4 clients and servers supporting the the inter-server copy 1181 operations described in this document are REQUIRED to implement 1182 [RPCSEC_GSSv3], including the RPCSEC_GSSv3 privileges copy_from_auth 1183 and copy_to_auth. If the server-to-server copy protocol is ONC RPC 1184 based, the servers are also REQUIRED to implement the RPCSEC_GSSv3 1185 privilege copy_confirm_auth. These requirements to implement are not 1186 requirements to use. NFSv4 clients and servers are RECOMMENDED to 1187 use [RPCSEC_GSSv3] to secure server-side copy operations. 1189 5.1. Inter-Server Copy Security 1191 5.1.1. Requirements for Secure Inter-Server Copy 1193 Inter-server copy is driven by several requirements: 1195 o The specification MUST NOT mandate an inter-server copy protocol. 1196 There are many ways to copy data. Some will be more optimal than 1197 others depending on the identities of the source server and 1198 destination server. For example the source and destination 1199 servers might be two nodes sharing a common file system format for 1200 the source and destination file systems. Thus the source and 1201 destination are in an ideal position to efficiently render the 1202 image of the source file to the destination file by replicating 1203 the file system formats at the block level. In other cases, the 1204 source and destination might be two nodes sharing a common storage 1205 area network, and thus there is no need to copy any data at all, 1206 and instead ownership of the file and its contents simply gets re- 1207 assigned to the destination. 1209 o The specification MUST provide guidance for using NFSv4.x as a 1210 copy protocol. For those source and destination servers willing 1211 to use NFSv4.x there are specific security considerations that 1212 this specification can and does address. 1214 o The specification MUST NOT mandate pre-configuration between the 1215 source and destination server. Requiring that the source and 1216 destination first have a "copying relationship" increases the 1217 administrative burden. However the specification MUST NOT 1218 preclude implementations that require pre-configuration. 1220 o The specification MUST NOT mandate a trust relationship between 1221 the source and destination server. The NFSv4 security model 1222 requires mutual authentication between a principal on an NFS 1223 client and a principal on an NFS server. This model MUST continue 1224 with the introduction of COPY. 1226 5.1.2. Inter-Server Copy with RPCSEC_GSSv3 1228 When the client sends a COPY_NOTIFY to the source server to expect 1229 the destination to attempt to copy data from the source server, it is 1230 expected that this copy is being done on behalf of the principal 1231 (called the "user principal") that sent the RPC request that encloses 1232 the COMPOUND procedure that contains the COPY_NOTIFY operation. The 1233 user principal is identified by the RPC credentials. A mechanism 1234 that allows the user principal to authorize the destination server to 1235 perform the copy in a manner that lets the source server properly 1236 authenticate the destination's copy, and without allowing the 1237 destination to exceed its authorization is necessary. 1239 An approach that sends delegated credentials of the client's user 1240 principal to the destination server is not used for the following 1241 reasons. If the client's user delegated its credentials, the 1242 destination would authenticate as the user principal. If the 1243 destination were using the NFSv4 protocol to perform the copy, then 1244 the source server would authenticate the destination server as the 1245 user principal, and the file copy would securely proceed. However, 1246 this approach would allow the destination server to copy other files. 1247 The user principal would have to trust the destination server to not 1248 do so. This is counter to the requirements, and therefore is not 1249 considered. Instead an approach using RPCSEC_GSSv3 [RPCSEC_GSSv3] 1250 privileges is proposed. 1252 One of the stated applications of the proposed RPCSEC_GSSv3 protocol 1253 is compound client host and user authentication [+ privilege 1254 assertion]. For inter-server file copy, we require compound NFS 1255 server host and user authentication [+ privilege assertion]. The 1256 distinction between the two is one without meaning. 1258 RPCSEC_GSSv3 introduces the notion of privileges. We define three 1259 privileges: 1261 copy_from_auth: A user principal is authorizing a source principal 1262 ("nfs@") to allow a destination principal ("nfs@ 1263 ") to copy a file from the source to the destination. 1264 This privilege is established on the source server before the user 1265 principal sends a COPY_NOTIFY operation to the source server. 1267 typedef string secret4<>; 1269 struct copy_from_auth_priv { 1270 secret4 cfap_shared_secret; 1271 netloc4 cfap_destination; 1272 /* the NFSv4 user name that the user principal maps to */ 1273 utf8str_mixed cfap_username; 1274 /* equal to seq_num of rpc_gss_cred_vers_3_t */ 1275 unsigned int cfap_seq_num; 1276 }; 1278 cap_shared_secret is a secret value the user principal generates. 1280 copy_to_auth: A user principal is authorizing a destination 1281 principal ("nfs@") to allow it to copy a file from 1282 the source to the destination. This privilege is established on 1283 the destination server before the user principal sends a COPY 1284 operation to the destination server. 1286 struct copy_to_auth_priv { 1287 /* equal to cfap_shared_secret */ 1288 secret4 ctap_shared_secret; 1289 netloc4 ctap_source; 1290 /* the NFSv4 user name that the user principal maps to */ 1291 utf8str_mixed ctap_username; 1292 /* equal to seq_num of rpc_gss_cred_vers_3_t */ 1293 unsigned int ctap_seq_num; 1294 }; 1296 ctap_shared_secret is a secret value the user principal generated 1297 and was used to establish the copy_from_auth privilege with the 1298 source principal. 1300 copy_confirm_auth: A destination principal is confirming with the 1301 source principal that it is authorized to copy data from the 1302 source on behalf of the user principal. When the inter-server 1303 copy protocol is NFSv4, or for that matter, any protocol capable 1304 of being secured via RPCSEC_GSSv3 (i.e. any ONC RPC protocol), 1305 this privilege is established before the file is copied from the 1306 source to the destination. 1308 struct copy_confirm_auth_priv { 1309 /* equal to GSS_GetMIC() of cfap_shared_secret */ 1310 opaque ccap_shared_secret_mic<>; 1311 /* the NFSv4 user name that the user principal maps to */ 1312 utf8str_mixed ccap_username; 1313 /* equal to seq_num of rpc_gss_cred_vers_3_t */ 1314 unsigned int ccap_seq_num; 1315 }; 1317 5.1.2.1. Establishing a Security Context 1319 When the user principal wants to COPY a file between two servers, if 1320 it has not established copy_from_auth and copy_to_auth privileges on 1321 the servers, it establishes them: 1323 o The user principal generates a secret it will share with the two 1324 servers. This shared secret will be placed in the 1325 cfap_shared_secret and ctap_shared_secret fields of the 1326 appropriate privilege data types, copy_from_auth_priv and 1327 copy_to_auth_priv. 1329 o An instance of copy_from_auth_priv is filled in with the shared 1330 secret, the destination server, and the NFSv4 user id of the user 1331 principal. It will be sent with an RPCSEC_GSS3_CREATE procedure, 1332 and so cfap_seq_num is set to the seq_num of the credential of the 1333 RPCSEC_GSS3_CREATE procedure. Because cfap_shared_secret is a 1334 secret, after XDR encoding copy_from_auth_priv, GSS_Wrap() (with 1335 privacy) is invoked on copy_from_auth_priv. The 1336 RPCSEC_GSS3_CREATE procedure's arguments are: 1338 struct { 1339 rpc_gss3_gss_binding *compound_binding; 1340 rpc_gss3_chan_binding *chan_binding_mic; 1341 rpc_gss3_assertion assertions<>; 1342 rpc_gss3_extension extensions<>; 1343 } rpc_gss3_create_args; 1345 The string "copy_from_auth" is placed in assertions[0].privs. The 1346 output of GSS_Wrap() is placed in extensions[0].data. The field 1347 extensions[0].critical is set to TRUE. The source server calls 1348 GSS_Unwrap() on the privilege, and verifies that the seq_num 1349 matches the credential. It then verifies that the NFSv4 user id 1350 being asserted matches the source server's mapping of the user 1351 principal. If it does, the privilege is established on the source 1352 server as: <"copy_from_auth", user id, destination>. The 1353 successful reply to RPCSEC_GSS3_CREATE has: 1355 struct { 1356 opaque handle<>; 1357 rpc_gss3_chan_binding *chan_binding_mic; 1358 rpc_gss3_assertion granted_assertions<>; 1359 rpc_gss3_assertion server_assertions<>; 1360 rpc_gss3_extension extensions<>; 1361 } rpc_gss3_create_res; 1363 The field "handle" is the RPCSEC_GSSv3 handle that the client will 1364 use on COPY_NOTIFY requests involving the source and destination 1365 server. granted_assertions[0].privs will be equal to 1366 "copy_from_auth". The server will return a GSS_Wrap() of 1367 copy_to_auth_priv. 1369 o An instance of copy_to_auth_priv is filled in with the shared 1370 secret, the source server, and the NFSv4 user id. It will be sent 1371 with an RPCSEC_GSS3_CREATE procedure, and so ctap_seq_num is set 1372 to the seq_num of the credential of the RPCSEC_GSS3_CREATE 1373 procedure. Because ctap_shared_secret is a secret, after XDR 1374 encoding copy_to_auth_priv, GSS_Wrap() is invoked on 1375 copy_to_auth_priv. The RPCSEC_GSS3_CREATE procedure's arguments 1376 are: 1378 struct { 1379 rpc_gss3_gss_binding *compound_binding; 1380 rpc_gss3_chan_binding *chan_binding_mic; 1381 rpc_gss3_assertion assertions<>; 1382 rpc_gss3_extension extensions<>; 1383 } rpc_gss3_create_args; 1385 The string "copy_to_auth" is placed in assertions[0].privs. The 1386 output of GSS_Wrap() is placed in extensions[0].data. The field 1387 extensions[0].critical is set to TRUE. After unwrapping, 1388 verifying the seq_num, and the user principal to NFSv4 user ID 1389 mapping, the destination establishes a privilege of 1390 <"copy_to_auth", user id, source>. The successful reply to 1391 RPCSEC_GSS3_CREATE has: 1393 struct { 1394 opaque handle<>; 1395 rpc_gss3_chan_binding *chan_binding_mic; 1396 rpc_gss3_assertion granted_assertions<>; 1397 rpc_gss3_assertion server_assertions<>; 1398 rpc_gss3_extension extensions<>; 1400 } rpc_gss3_create_res; 1402 The field "handle" is the RPCSEC_GSSv3 handle that the client will 1403 use on COPY requests involving the source and destination server. 1404 The field granted_assertions[0].privs will be equal to 1405 "copy_to_auth". The server will return a GSS_Wrap() of 1406 copy_to_auth_priv. 1408 5.1.2.2. Starting a Secure Inter-Server Copy 1410 When the client sends a COPY_NOTIFY request to the source server, it 1411 uses the privileged "copy_from_auth" RPCSEC_GSSv3 handle. 1412 cna_destination_server in COPY_NOTIFY MUST be the same as the name of 1413 the destination server specified in copy_from_auth_priv. Otherwise, 1414 COPY_NOTIFY will fail with NFS4ERR_ACCESS. The source server 1415 verifies that the privilege <"copy_from_auth", user id, destination> 1416 exists, and annotates it with the source filehandle, if the user 1417 principal has read access to the source file, and if administrative 1418 policies give the user principal and the NFS client read access to 1419 the source file (i.e. if the ACCESS operation would grant read 1420 access). Otherwise, COPY_NOTIFY will fail with NFS4ERR_ACCESS. 1422 When the client sends a COPY request to the destination server, it 1423 uses the privileged "copy_to_auth" RPCSEC_GSSv3 handle. 1424 ca_source_server in COPY MUST be the same as the name of the source 1425 server specified in copy_to_auth_priv. Otherwise, COPY will fail 1426 with NFS4ERR_ACCESS. The destination server verifies that the 1427 privilege <"copy_to_auth", user id, source> exists, and annotates it 1428 with the source and destination filehandles. If the client has 1429 failed to establish the "copy_to_auth" policy it will reject the 1430 request with NFS4ERR_PARTNER_NO_AUTH. 1432 If the client sends a COPY_REVOKE to the source server to rescind the 1433 destination server's copy privilege, it uses the privileged 1434 "copy_from_auth" RPCSEC_GSSv3 handle and the cra_destination_server 1435 in COPY_REVOKE MUST be the same as the name of the destination server 1436 specified in copy_from_auth_priv. The source server will then delete 1437 the <"copy_from_auth", user id, destination> privilege and fail any 1438 subsequent copy requests sent under the auspices of this privilege 1439 from the destination server. 1441 5.1.2.3. Securing ONC RPC Server-to-Server Copy Protocols 1443 After a destination server has a "copy_to_auth" privilege established 1444 on it, and it receives a COPY request, if it knows it will use an ONC 1445 RPC protocol to copy data, it will establish a "copy_confirm_auth" 1446 privilege on the source server, using nfs@ as the 1447 initiator principal, and nfs@ as the target principal. 1449 The value of the field ccap_shared_secret_mic is a GSS_VerifyMIC() of 1450 the shared secret passed in the copy_to_auth privilege. The field 1451 ccap_username is the mapping of the user principal to an NFSv4 user 1452 name ("user"@"domain" form), and MUST be the same as ctap_username 1453 and cfap_username. The field ccap_seq_num is the seq_num of the 1454 RPCSEC_GSSv3 credential used for the RPCSEC_GSS3_CREATE procedure the 1455 destination will send to the source server to establish the 1456 privilege. 1458 The source server verifies the privilege, and establishes a 1459 <"copy_confirm_auth", user id, destination> privilege. If the source 1460 server fails to verify the privilege, the COPY operation will be 1461 rejected with NFS4ERR_PARTNER_NO_AUTH. All subsequent ONC RPC 1462 requests sent from the destination to copy data from the source to 1463 the destination will use the RPCSEC_GSSv3 handle returned by the 1464 source's RPCSEC_GSS3_CREATE response. 1466 Note that the use of the "copy_confirm_auth" privilege accomplishes 1467 the following: 1469 o if a protocol like NFS is being used, with export policies, export 1470 policies can be overridden in case the destination server as-an- 1471 NFS-client is not authorized 1473 o manual configuration to allow a copy relationship between the 1474 source and destination is not needed. 1476 If the attempt to establish a "copy_confirm_auth" privilege fails, 1477 then when the user principal sends a COPY request to destination, the 1478 destination server will reject it with NFS4ERR_PARTNER_NO_AUTH. 1480 5.1.2.4. Securing Non ONC RPC Server-to-Server Copy Protocols 1482 If the destination won't be using ONC RPC to copy the data, then the 1483 source and destination are using an unspecified copy protocol. The 1484 destination could use the shared secret and the NFSv4 user id to 1485 prove to the source server that the user principal has authorized the 1486 copy. 1488 For protocols that authenticate user names with passwords (e.g. HTTP 1489 [RFC2616] and FTP [RFC0959]), the nfsv4 user id could be used as the 1490 user name, and an ASCII hexadecimal representation of the 1491 RPCSEC_GSSv3 shared secret could be used as the user password or as 1492 input into non-password authentication methods like CHAP [RFC1994]. 1494 5.1.3. Inter-Server Copy via ONC RPC but without RPCSEC_GSSv3 1496 ONC RPC security flavors other than RPCSEC_GSSv3 MAY be used with the 1497 server-side copy offload operations described in this document. In 1498 particular, host-based ONC RPC security flavors such as AUTH_NONE and 1499 AUTH_SYS MAY be used. If a host-based security flavor is used, a 1500 minimal level of protection for the server-to-server copy protocol is 1501 possible. 1503 In the absence of strong security mechanisms such as RPCSEC_GSSv3, 1504 the challenge is how the source server and destination server 1505 identify themselves to each other, especially in the presence of 1506 multi-homed source and destination servers. In a multi-homed 1507 environment, the destination server might not contact the source 1508 server from the same network address specified by the client in the 1509 COPY_NOTIFY. This can be overcome using the procedure described 1510 below. 1512 When the client sends the source server the COPY_NOTIFY operation, 1513 the source server may reply to the client with a list of target 1514 addresses, names, and/or URLs and assign them to the unique triple: 1515 . If the destination uses 1516 one of these target netlocs to contact the source server, the source 1517 server will be able to uniquely identify the destination server, even 1518 if the destination server does not connect from the address specified 1519 by the client in COPY_NOTIFY. 1521 For example, suppose the network topology is as shown in Figure 3. 1522 If the source filehandle is 0x12345, the source server may respond to 1523 a COPY_NOTIFY for destination 10.11.78.56 with the URLs: 1525 nfs://10.11.78.18//_COPY/10.11.78.56/_FH/0x12345 1527 nfs://192.168.33.18//_COPY/10.11.78.56/_FH/0x12345 1529 The client will then send these URLs to the destination server in the 1530 COPY operation. Suppose that the 192.168.33.0/24 network is a high 1531 speed network and the destination server decides to transfer the file 1532 over this network. If the destination contacts the source server 1533 from 192.168.33.56 over this network using NFSv4.1, it does the 1534 following: 1536 COMPOUND { PUTROOTFH, LOOKUP "_COPY" ; LOOKUP "10.11.78.56"; LOOKUP 1537 "_FH" ; OPEN "0x12345" ; GETFH } 1539 The source server will therefore know that these NFSv4.1 operations 1540 are being issued by the destination server identified in the 1541 COPY_NOTIFY. 1543 5.1.4. Inter-Server Copy without ONC RPC and RPCSEC_GSSv3 1545 The same techniques as Section 5.1.3, using unique URLs for each 1546 destination server, can be used for other protocols (e.g. HTTP 1547 [RFC2616] and FTP [RFC0959]) as well. 1549 6. IANA Considerations 1551 This document has no actions for IANA. 1553 7. References 1555 7.1. Normative References 1557 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 1558 Requirement Levels", BCP 14, RFC 2119, March 1997. 1560 [RFC3530] Shepler, S., Callaghan, B., Robinson, D., Thurlow, R., 1561 Beame, C., Eisler, M., and D. Noveck, "Network File System 1562 (NFS) version 4 Protocol", RFC 3530, April 2003. 1564 [RFC3986] Berners-Lee, T., Fielding, R., and L. Masinter, "Uniform 1565 Resource Identifier (URI): Generic Syntax", STD 66, 1566 RFC 3986, January 2005. 1568 [RFC5661] Shepler, S., Eisler, M., and D. Noveck, "Network File 1569 System (NFS) Version 4 Minor Version 1 Protocol", 1570 RFC 5661, January 2010. 1572 [RPCSEC_GSSv3] 1573 Williams, N., "Remote Procedure Call (RPC) Security 1574 Version 3", draft-williams-rpcsecgssv3 (work in progress), 1575 2008. 1577 7.2. Informational References 1579 [FEDFS-ADMIN] 1580 Lentini, J., Everhart, C., Ellard, D., Tewari, R., and M. 1581 Naik, "Administration Protocol for Federated Filesystems", 1582 draft-ietf-nfsv4-federated-fs-admin (Work In Progress), 1583 2010. 1585 [FEDFS-NSDB] 1586 Lentini, J., Everhart, C., Ellard, D., Tewari, R., and M. 1587 Naik, "NSDB Protocol for Federated Filesystems", 1588 draft-ietf-nfsv4-federated-fs-protocol (Work In Progress), 1589 2010. 1591 [RFC0959] Postel, J. and J. Reynolds, "File Transfer Protocol", 1592 STD 9, RFC 959, October 1985. 1594 [RFC1994] Simpson, W., "PPP Challenge Handshake Authentication 1595 Protocol (CHAP)", RFC 1994, August 1996. 1597 [RFC2616] Fielding, R., Gettys, J., Mogul, J., Frystyk, H., 1598 Masinter, L., Leach, P., and T. Berners-Lee, "Hypertext 1599 Transfer Protocol -- HTTP/1.1", RFC 2616, June 1999. 1601 [SPACE-RESERVE] 1602 Eisler, M., Kenchammana, D., Lentini, J., Shankararao, M., 1603 and R. Iyer, "NFS space reservation operations", 1604 draft-iyer-nfsv4-space-reservation-ops (work in progress), 1605 2010. 1607 Appendix A. Acknowledgments 1609 Tom Talpey co-authored an unpublished version of this document. We 1610 thank Tom for his contributions, especially with regards to the 1611 asynchronous completion callback mechanism. 1613 This document was reviewed by a number of individuals. We would like 1614 to thank Pranoop Erasani, Tom Haynes, Arthur Lent, Trond Myklebust, 1615 Dave Noveck, Theresa Lingutla-Raj, Manjunath Shankararao, Satyam 1616 Vaghani, and Nico Williams for their input and advice. 1618 Authors' Addresses 1620 James Lentini 1621 NetApp 1622 1601 Trapelo Rd, Suite 16 1623 Waltham, MA 02451 1624 USA 1626 Phone: +1 781-768-5359 1627 Email: jlentini@netapp.com 1628 Mike Eisler 1629 NetApp 1630 5765 Chase Point Circle 1631 Colorado Springs, CO 80919 1632 USA 1634 Phone: +1 719-599-9026 1635 Email: mike@eisler.com 1636 URI: http://www.eisler.com 1638 Deepak Kenchammana 1639 NetApp 1640 475 East Java Drive 1641 Sunnyvale, CA 94089 1642 USA 1644 Phone: +1 408-822-4765 1645 Email: kencham@netapp.com 1647 Anshul Madan 1648 Carnegie Mellon University 1649 School of Computer Science 1650 5000 Forbes Avenue 1651 Pittsburgh, PA 15213 1652 USA 1654 Email: anshulmadan@cmu.edu 1656 Rahul Iyer 1657 655 S Fair Oaks Ave 1658 Apt #I-314 1659 Sunnyvale, CA 94086 1660 USA 1662 Email: rahulair@yahoo.com