idnits 2.17.1 draft-lentini-nfsv4-server-side-copy-05.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 (July 10, 2010) is 5039 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 1276 ** 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: January 11, 2011 NetApp 6 A. Madan 7 Carnegie Mellon University 8 R. Iyer 9 July 10, 2010 11 NFS Server-side Copy 12 draft-lentini-nfsv4-server-side-copy-05.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 January 11, 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 . . . 20 69 4.6. Operation Y: COPY_STATUS - Poll for status of a 70 server-side copy . . . . . . . . . . . . . . . . . . . . . 21 71 4.7. Operation Z: CB_COPY - Report results of a server-side 72 copy . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 73 4.8. Copy Offload Stateids . . . . . . . . . . . . . . . . . . 23 74 5. Security Considerations . . . . . . . . . . . . . . . . . . . 24 75 5.1. Inter-Server Copy Security . . . . . . . . . . . . . . . . 24 76 5.1.1. Requirements for Secure Inter-Server Copy . . . . . . 24 77 5.1.2. Inter-Server Copy with RPCSEC_GSSv3 . . . . . . . . . 25 78 5.1.3. Inter-Server Copy via ONC RPC but without 79 RPCSEC_GSSv3 . . . . . . . . . . . . . . . . . . . . . 31 80 5.1.4. Inter-Server Copy without ONC RPC and RPCSEC_GSSv3 . . 32 81 6. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 32 82 7. References . . . . . . . . . . . . . . . . . . . . . . . . . . 32 83 7.1. Normative References . . . . . . . . . . . . . . . . . . . 32 84 7.2. Informational References . . . . . . . . . . . . . . . . . 32 85 Appendix A. Acknowledgments . . . . . . . . . . . . . . . . . . . 33 86 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . . 33 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] and FTP [RFC0959]) presents some challenges. 400 In particular, the destination server is presented with the challenge 401 of 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; 639 #define COPY4_SPACE_RESERVED = 0x00000004; 641 struct COPY4args { 642 /* SAVED_FH: source file */ 643 /* CURRENT_FH: destination file or */ 644 /* directory */ 645 offset4 ca_src_offset; 646 offset4 ca_dst_offset; 647 length4 ca_count; 648 uint32_t ca_flags; 649 component4 ca_destination; 650 netloc4 ca_source_server<>; 651 }; 653 RESULTS 655 union COPY4res switch (nfsstat4 cr_status) { 656 /* CURRENT_FH: destination file */ 657 case NFS4_OK: 658 stateid4 cr_callback_id<1>; 659 default: 660 length4 cr_bytes_copied; 661 }; 663 DESCRIPTION 664 The COPY operation is used for both intra- and inter-server copies. 665 In both cases, the COPY is always sent from the client to the 666 destination server of the file copy. The COPY operation requests 667 that a file be copied from the location specified by the SAVED_FH 668 value to the location specified by the combination of CURRENT_FH and 669 ca_destination. 671 The SAVED_FH must be a regular file. If SAVED_FH is not a regular 672 file, the operation MUST fail and return NFS4ERR_WRONG_TYPE. 674 In order to set SAVED_FH to the source file handle, the compound 675 procedure requesting the COPY will include a sub-sequence of 676 operations such as 678 PUTFH source-fh 679 SAVEFH 681 If the request is for a server-to-server copy, the source-fh is a 682 filehandle from the source server and the compound procedure is being 683 executed on the destination server. In this case, the source-fh is a 684 foreign filehandle on the server receiving the COPY request. If 685 either PUTFH or SAVEFH checked the validity of the filehandle, the 686 operation would likely fail and return NFS4ERR_STALE. 688 In order to avoid this problem, the minor version incorporating the 689 COPY operations will need to make a few small changes in the handling 690 of existing operations. If a server supports the server-to-server 691 COPY feature, a PUTFH followed by a SAVEFH MUST NOT return 692 NFS4ERR_STALE for either operation. These restrictions do not pose 693 substantial difficulties for servers. The CURRENT_FH and SAVED_FH 694 may be validated in the context of the operation referencing them and 695 an NFS4ERR_STALE error returned for an invalid file handle at that 696 point. 698 The CURRENT_FH and ca_destination together specify the destination of 699 the copy operation. If ca_destination is of 0 (zero) length, then 700 CURRENT_FH specifies the target file. In this case, CURRENT_FH MUST 701 be a file and not a directory. If ca_destination is not of 0 (zero) 702 length, the ca_destination argument specifies the file name to which 703 the data will be copied within the directory identified by 704 CURRENT_FH. In this case, CURRENT_FH MUST be a directory and not a 705 file. 707 If the file named by ca_destination does not exist and the operation 708 completes successfully, the file will be visible in the file system 709 namespace. If the file does not exist and the operation fails, the 710 file MAY be visible in the file system namespace depending on when 711 the failure occurs and on the implementation of the NFS server 712 receiving the COPY operation. If the ca_destination name cannot be 713 created in the destination file system (due to file name 714 restrictions, such as case or length), the operation MUST fail. 716 The ca_src_offset is the offset within the source file from which the 717 data will be read, the ca_dst_offset is the offset within the 718 destination file to which the data will be written, and the ca_count 719 is the number of bytes that will be copied. An offset of 0 (zero) 720 specifies the start of the file. A count of 0 (zero) requests that 721 all bytes from ca_src_offset through EOF be copied to the 722 destination. If concurrent modifications to the source file overlap 723 with the source file region being copied, the data copied may include 724 all, some, or none of the modifications. If the source file's end of 725 file is being modified in parallel with a copy that specifies a count 726 of 0 (zero) bytes, the amount of data copied is implementation 727 dependent (clients may guard against this case by specifying a non- 728 zero count value). 730 If the source offset or the source offset plus count is greater than 731 or equal to the size of the source file, the operation will fail with 732 NFS4ERR_INVAL. The destination offset or destination offset plus 733 count may be greater than the size of the destination file. This 734 allows for the client to issue parallel copies to implement 735 operations such as "cat file1 file2 file3 file4 > dest". 737 If the destination file is created as a result of this command, the 738 destination file's size will be equal to the number of bytes 739 successfully copied. If the destination file already existed, the 740 destination file's size may increase as a result of this operation 741 (e.g. if ca_dst_offset plus ca_count is greater than the 742 destination's initial size). 744 If the ca_source_server list is specified, then this is an inter- 745 server copy operation and the source file is on a remote server. The 746 client is expected to have previously issued a successful COPY_NOTIFY 747 request to the remote source server. The ca_source_server list 748 SHOULD be the same as the COPY_NOTIFY response's cnr_source_server 749 list. If the client includes the entries from the COPY_NOTIFY 750 response's cnr_source_server list in the ca_source_server list, the 751 source server can indicate a specific copy protocol for the 752 destination server to use by returning a URL, which specifies both a 753 protocol service and server name. Server-to-server copy protocol 754 considerations are described in Section 3.3 and Section 5.1. 756 The ca_flags argument allows the copy operation to be customized in 757 the following ways using the guarded flag (COPY4_GUARDED), the 758 metadata flag (COPY4_METADATA), and the space reserved flag 759 (COPY4_SPACE_RESERVED). 761 If the guarded flag is set and the destination exists on the server, 762 this operation will fail with NFS4ERR_EXIST. 764 If the guarded flag is not set and the destination exists on the 765 server, the behavior is implementation dependent. 767 If the metadata flag is set, the REQUIRED and RECOMMENDED attributes 768 of the destination file MUST be the same as the source file's 769 corresponding REQUIRED and RECOMMENDED attributes. The set of 770 REQUIRED and RECOMMENDED attributes are defined by the NFS protocol 771 version over which the copy is being performed (i.e., if the COPY is 772 being sent over NFSv4.X then these are the REQUIRED and RECOMMENDED 773 attributes defined by NFSv4.X). By definition the source server and 774 destination server will support the same set of REQUIRED attributes 775 but might not support the same set of RECOMMENDED attributes. The 776 destination server MUST return NFS4ERR_ATTRNOTSUPP if the source file 777 has a RECOMMENDED attribute that cannot be set on the destination 778 file. Any attribute supported by the destination server that is not 779 set on the source file SHOULD be left unset. The destination file's 780 named attributes are not duplicated from the source file. After the 781 copy process completes, the client MAY attempt to duplicate named 782 attributes using standard NFSv4 operations. However, the destination 783 server's named attribute capabilities MAY be different from the 784 source server's named attribute capabilities. 786 If the metadata flag is not set, the destination's metadata is 787 implementation dependent. 789 If the space reserved flag is set, the operation will only succeed if 790 the file server can guarantee that all future non-extending writes to 791 the copied file will not fail due to insufficient space. 793 If the space reserved flag is not set, the space reservation state of 794 the new file is implementation dependent. 796 If the operation does not result in an immediate failure, the server 797 will return NFS4_OK, and the CURRENT_FH will remain the destination's 798 filehandle. 800 If an immediate failure does occur, cr_bytes_copied will be set to 801 the number of bytes copied to the destination file before the error 802 occurred. The cr_bytes_copied value indicates the number of bytes 803 copied but not which specific bytes have been copied. 805 A return of NFS4_OK indicates that either the operation is complete 806 or the operation was initiated and a callback will be used to deliver 807 the final status of the operation. 809 If the cr_callback_id is returned, this indicates that the operation 810 was initiated and a CB_COPY callback will deliver the final results 811 of the operation. The cr_callback_id stateid is termed a copy 812 stateid in this context. The server is given the option of returning 813 the results in a callback because the data may require a relatively 814 long period of time to copy. 816 If no cr_callback_id is returned, the operation completed 817 synchronously and no callback will be issued by the server. The 818 completion status of the operation is indicated by cr_status. 820 In the event of a failure the state of the destination file is 821 implementation dependent.The COPY operation may fail for the 822 following reasons (this is a partial list). 824 NFS4ERR_MOVED: The file system which contains the source file, or 825 the destination file or directory is not present. The client can 826 determine the correct location and reissue the operation with the 827 correct location. 829 NFS4ERR_NOTSUPP: The copy offload operation is not supported by the 830 NFS server receiving this request. 832 NFS4ERR_PARTNER_NOTSUPP: The remote server does not support the 833 server-to-server copy offload protocol. 835 NFS4ERR_PARTNER_NO_AUTH: The remote server does not authorize a 836 server-to-server copy offload operation. This may be due to the 837 client's failure to send the COPY_NOTIFY operation to the remote 838 server, the remote server receiving a server-to-server copy 839 offload request after the copy lease time expired, or for some 840 other permission problem. 842 NFS4ERR_FBIG: The copy operation would have caused the file to grow 843 beyond the server's limit. 845 NFS4ERR_NOTDIR: The CURRENT_FH is a file and ca_destination has non- 846 zero length. 848 NFS4ERR_WRONG_TYPE: The SAVED_FH is not a regular file. 850 NFS4ERR_ISDIR: The CURRENT_FH is a directory and ca_destination has 851 zero length. 853 NFS4ERR_INVAL: The source offset or offset plus count are greater 854 than or equal to the size of the source file. 856 NFS4ERR_DELAY: The server does not have the resources to perform the 857 copy operation at the current time. The client should retry the 858 operation sometime in the future. 860 NFS4ERR_METADATA_NOTSUPP: The destination file cannot support the 861 same metadata as the source file. 863 NFS4ERR_WRONGSEC: The security mechanism being used by the client 864 does not match the server's security policy. 866 4.5. Operation X: COPY_ABORT - Cancel a server-side copy 868 ARGUMENTS 870 struct COPY_ABORT4args { 871 /* CURRENT_FH: destination file */ 872 stateid4 caa_stateid; 873 }; 875 RESULTS 877 struct COPY_ABORT4res { 878 nfsstat4 car_status; 879 }; 881 DESCRIPTION 883 COPY_ABORT is used for both intra- and inter-server asynchronous 884 copies. The COPY_ABORT operation allows the client to cancel a 885 server-side copy operation that it initiated. This operation is sent 886 in a COMPOUND request from the client to the destination server. 887 This operation may be used to cancel a copy when the application that 888 requested the copy exits before the operation is completed or for 889 some other reason. 891 The request contains the filehandle and copy stateid cookies that act 892 as the context for the previously initiated copy operation. 894 The result's car_status field indicates whether the cancel was 895 successful or not. A value of NFS4_OK indicates that the copy 896 operation was canceled and no callback will be issued by the server. 897 A copy operation that is successfully canceled may result in none, 898 some, or all of the data copied. 900 If the server supports asynchronous copies, the server is REQUIRED to 901 support the COPY_ABORT operation. 903 The COPY_ABORT operation may fail for the following reasons (this is 904 a partial list): 906 NFS4ERR_NOTSUPP: The abort operation is not supported by the NFS 907 server receiving this request. 909 NFS4ERR_RETRY: The abort failed, but a retry at some time in the 910 future MAY succeed. 912 NFS4ERR_COMPLETE_ALREADY: The abort failed, and a callback will 913 deliver the results of the copy operation. 915 NFS4ERR_SERVERFAULT: An error occurred on the server that does not 916 map to a specific error code. 918 4.6. Operation Y: COPY_STATUS - Poll for status of a server-side copy 920 ARGUMENTS 922 struct COPY_STATUS4args { 923 /* CURRENT_FH: destination file */ 924 stateid4 csa_stateid; 925 }; 927 RESULTS 929 union COPY_STATUS4res switch (nfsstat4 csr_status) { 930 case NFS4_OK: 931 length4 csr_bytes_copied; 932 nfsstat4 csr_complete<1>; 933 default: 934 void; 935 }; 937 DESCRIPTION 939 COPY_STATUS is used for both intra- and inter-server asynchronous 940 copies. The COPY_STATUS operation allows the client to poll the 941 server to determine the status of an asynchronous copy operation. 942 This operation is sent by the client to the destination server. 944 If this operation is successful, the number of bytes copied are 945 returned to the client in the csr_bytes_copied field. The 946 csr_bytes_copied value indicates the number of bytes copied but not 947 which specific bytes have been copied. 949 If the optional csr_complete field is present, the copy has 950 completed. In this case the status value indicates the result of the 951 asynchronous copy operation. In all cases, the server will also 952 deliver the final results of the asynchronous copy in a CB_COPY 953 operation. 955 The failure of this operation does not indicate the result of the 956 asynchronous copy in any way. 958 If the server supports asynchronous copies, the server is REQUIRED to 959 support the COPY_STATUS operation. 961 The COPY_STATUS operation may fail for the following reasons (this is 962 a partial list): 964 NFS4ERR_NOTSUPP: The copy status operation is not supported by the 965 NFS server receiving this request. 967 NFS4ERR_BAD_STATEID: The stateid is not valid (see Section 4.8 968 below). 970 NFS4ERR_EXPIRED: The stateid has expired (see Copy Offload Stateid 971 section below). 973 4.7. Operation Z: CB_COPY - Report results of a server-side copy 975 ARGUMENTS 977 union copy_info4 switch (nfsstat4 cca_status) { 978 case NFS4_OK: 979 void; 980 default: 981 length4 cca_bytes_copied; 982 }; 984 struct CB_COPY4args { 985 nfs_fh4 cca_fh; 986 stateid4 cca_stateid; 987 copy_info4 cca_copy_info; 988 }; 990 RESULTS 992 struct CB_COPY4res { 993 nfsstat4 ccr_status; 994 }; 996 DESCRIPTION 998 CB_COPY is used for both intra- and inter-server asynchronous copies. 999 The CB_COPY callback informs the client of the result of an 1000 asynchronous server-side copy. This operation is sent by the 1001 destination server to the client in a CB_COMPOUND request. The copy 1002 is identified by the filehandle and stateid arguments. The result is 1003 indicated by the status field. If the copy failed, cca_bytes_copied 1004 contains the number of bytes copied before the failure occurred. The 1005 cca_bytes_copied value indicates the number of bytes copied but not 1006 which specific bytes have been copied. 1008 In the absence of an established backchannel, the server cannot 1009 signal the completion of the COPY via a CB_COPY callback. The loss 1010 of a callback channel would be indicated by the server setting the 1011 SEQ4_STATUS_CB_PATH_DOWN flag in the sr_status_flags field of the 1012 SEQUENCE operation. The client must re-establish the callback 1013 channel to receive the status of the COPY operation. Prolonged loss 1014 of the callback channel could result in the server dropping the COPY 1015 operation state and invalidating the copy stateid. 1017 If the client supports the COPY operation, the client is REQUIRED to 1018 support the CB_COPY operation. 1020 The CB_COPY operation may fail for the following reasons (this is a 1021 partial list): 1023 NFS4ERR_NOTSUPP: The copy offload operation is not supported by the 1024 NFS client receiving this request. 1026 4.8. Copy Offload Stateids 1028 A server may perform a copy offload operation asynchronously. An 1029 asynchronous copy is tracked using a copy offload stateid. Copy 1030 offload stateids are included in the COPY, COPY_ABORT, COPY_STATUS, 1031 and CB_COPY operations. 1033 Section 8.2.4 of [RFC5661] specifies that stateids are valid until 1034 either (A) the client or server restart or (B) the client returns the 1035 resource. 1037 A copy offload stateid will be valid until either (A) the client or 1038 server restart or (B) the client returns the resource by issuing a 1039 COPY_ABORT operation or the client replies to a CB_COPY operation. 1041 A copy offload stateid's seqid MUST NOT be 0 (zero). In the context 1042 of a copy offload operation, it is ambiguous to indicate the most 1043 recent copy offload operation using a stateid with seqid of 0 (zero). 1044 Therefore a copy offload stateid with seqid of 0 (zero) MUST be 1045 considered invalid. 1047 5. Security Considerations 1049 The security considerations pertaining to NFSv4 [RFC3530] apply to 1050 this document. 1052 The standard security mechanisms provide by NFSv4 [RFC3530] may be 1053 used to secure the protocol described in this document. 1055 NFSv4 clients and servers supporting the the inter-server copy 1056 operations described in this document are REQUIRED to implement 1057 [RPCSEC_GSSv3], including the RPCSEC_GSSv3 privileges copy_from_auth 1058 and copy_to_auth. If the server-to-server copy protocol is ONC RPC 1059 based, the servers are also REQUIRED to implement the RPCSEC_GSSv3 1060 privilege copy_confirm_auth. These requirements to implement are not 1061 requirements to use. NFSv4 clients and servers are RECOMMENDED to 1062 use [RPCSEC_GSSv3] to secure server-side copy operations. 1064 5.1. Inter-Server Copy Security 1066 5.1.1. Requirements for Secure Inter-Server Copy 1068 Inter-server copy is driven by several requirements: 1070 o The specification MUST NOT mandate an inter-server copy protocol. 1071 There are many ways to copy data. Some will be more optimal than 1072 others depending on the situation that exists between a source and 1073 destination server. For example the source and destination 1074 servers might be two nodes sharing a common file system format for 1075 the source and destination file systems. Thus the source and 1076 destination are in an ideal position to efficiently render the 1077 image of the source file to the destination file by replicating 1078 the file system formats at the block level. For example, the 1079 source and destination might be two nodes sharing a common storage 1080 area network, and thus there is no need to copy any data at all, 1081 and instead ownership of the file and its contents simply gets re- 1082 assigned to the destination. 1084 o The specification MUST provide guidance for using NFSv4.x as a 1085 copy protocol. For those source and destination servers willing 1086 to use NFSv4.x there are specific security considerations that 1087 this specification can and does address. 1089 o The specification MUST NOT mandate pre-configuration between the 1090 source and destination server. Requiring that the source and 1091 destination first have a "copying relationship" increases the 1092 administrative burden. However the specification MUST NOT 1093 preclude implementations that require pre-configuration. 1095 o The specification MUST NOT mandate a trust relationship between 1096 the source and destination server. The NFSv4 security model 1097 requires mutual authentication between a principal on an NFS 1098 client and a principal on an NFS server. This model MUST continue 1099 with the introduction of COPY. 1101 5.1.2. Inter-Server Copy with RPCSEC_GSSv3 1103 When the client sends a COPY_NOTIFY to the source server to expect 1104 the destination to attempt to copy data from the source server, it is 1105 expected that this copy is being done on behalf of the principal 1106 (called the "user principal") that sent the RPC request that encloses 1107 the COMPOUND procedure that contains the COPY_NOTIFY operations. The 1108 user principal is identified by the RPC credentials. The problem is 1109 how can the user principal provide an authorization that directs the 1110 source to allow the destination to perform the copy in a manner that 1111 lets the source properly authenticate the destination's copy, and 1112 without allowing the destination to exceed its authorization? 1114 One way would be to send delegated credentials of the client's user 1115 principal to the destination server. The destination would then 1116 authenticate as the user principal. If the destination were using 1117 the NFSv4 protocol to perform the copy, then the source server would 1118 authenticate the destination server as the user principal, and the 1119 file copy could securely proceed. However, this approach would allow 1120 the destination server to copy other files. The user principal would 1121 have to trust the destination server to not do so. This is counter 1122 to the requirements, and so is not presented here. Instead an 1123 approach using RPCSEC_GSSv3 [RPCSEC_GSSv3] privileges is proposed. 1125 One of the stated applications of the proposed RPCSEC_GSSv3 protocol 1126 is compound client host and user authentication [+ privilege 1127 assertion]. For inter-server file copy, we require compound NFS 1128 server host and user authentication [+ privilege assertion]. The 1129 distinction between the two is one without meaning. 1131 RPCSEC_GSSv3 introduces the notion of privileges. We define three 1132 privileges: 1134 copy_from_auth: A user principal is authorizing a source principal 1135 ("nfs@") to allow a destination principal ("nfs@ 1136 ") to copy a file from the source to the destination. 1137 This privilege is established on the source server before the user 1138 principal sends a COPY_NOTIFY operation to the source server. 1140 typedef string secret4<>; 1142 struct copy_from_auth_priv { 1143 secret4 cfap_shared_secret; 1144 netloc4 cfap_destination; 1145 /* the NFSv4 user name that the user principal maps to */ 1146 utf8str_mixed cfap_username; 1147 /* equal to seq_num of rpc_gss_cred_vers_3_t */ 1148 unsigned int cfap_seq_num; 1149 }; 1151 cap_shared_secret is a secret value the user principal generates. 1153 copy_to_auth: A user principal is authorizing a destination 1154 principal ("nfs@") to allow it to copy a file from 1155 the source to the destination. This privilege is established on 1156 the destination server before the user principal sends a COPY 1157 operation to the destination server. 1159 struct copy_to_auth_priv { 1160 /* equal to cfap_shared_secret */ 1161 secret4 ctap_shared_secret; 1162 netloc4 ctap_source; 1163 /* the NFSv4 user name that the user principal maps to */ 1164 utf8str_mixed ctap_username; 1165 /* equal to seq_num of rpc_gss_cred_vers_3_t */ 1166 unsigned int ctap_seq_num; 1167 }; 1169 ctap_shared_secret is a secret value the user principal generated 1170 and was used to establish the copy_from_auth privilege with the 1171 source principal. 1173 copy_confirm_auth: A destination principal is confirming with the 1174 source principal that it is authorized to copy data from the 1175 source on behalf of the user principal. When the inter-server 1176 copy protocol is NFSv4, or for that matter, any protocol capable 1177 of being secured via RPCSEC_GSSv3 (i.e. any ONC RPC protocol), 1178 this privilege is established before the file is copied from the 1179 source to the destination. 1181 struct copy_confirm_auth_priv { 1182 /* equal to GSS_GetMIC() of cfap_shared_secret */ 1183 opaque ccap_shared_secret_mic<>; 1184 /* the NFSv4 user name that the user principal maps to */ 1185 utf8str_mixed ccap_username; 1186 /* equal to seq_num of rpc_gss_cred_vers_3_t */ 1187 unsigned int ccap_seq_num; 1188 }; 1190 5.1.2.1. Establishing a Security Context 1192 When the user principal wants to COPY a file between two servers, if 1193 it has not established copy_from_auth and copy_to_auth privileges on 1194 the servers, it establishes them: 1196 o The user principal generates a secret it will share with the two 1197 servers. This shared secret will be placed in the 1198 cfap_shared_secret and ctap_shared_secret of the appropriate 1199 privilege data types, copy_from_auth_priv, and copy_to_auth_priv. 1201 o An instance of copy_from_auth_priv is filled in with the shared 1202 secret, the destination server, and the NFSv4 user id of the user 1203 principal. It will be sent with an RPCSEC_GSS3_CREATE procedure, 1204 and so cfap_seq_num it set to the seq_num of the credential of the 1205 RPCSEC_GSS3_CREATE procedure. Because cfap_shared_secret is a 1206 secret, after XDR encoding copy_from_auth_priv, GSS_Wrap() (with 1207 privacy) is invoked on copy_from_auth_priv. The 1208 RPCSEC_GSS3_CREATE procedure's arguments are: 1210 struct { 1211 rpc_gss3_gss_binding *compound_binding; 1212 rpc_gss3_chan_binding *chan_binding_mic; 1213 rpc_gss3_assertion assertions<>; 1214 rpc_gss3_extension extensions<>; 1215 } rpc_gss3_create_args; 1217 The string "copy_from_auth" is placed in assertions[0].privs. The 1218 output of GSS_Wrap() is placed in extensions[0].data. The field 1219 extensions[0].critical is set to TRUE. The source server calls 1220 GSS_Unwrap() on the privilege, and verifies that the seq_num 1221 matches the credential. It then verifies that the NFSv4 user id 1222 being asserted matches the source server's mapping of the user 1223 principal. If it does, the privilege is established on the source 1224 server as: <"copy_from_auth", user id, destination>. The 1225 successful reply to RPCSEC_GSS3_CREATE has: 1227 struct { 1228 opaque handle<>; 1229 rpc_gss3_chan_binding *chan_binding_mic; 1230 rpc_gss3_assertion granted_assertions<>; 1231 rpc_gss3_assertion server_assertions<>; 1232 rpc_gss3_extension extensions<>; 1233 } rpc_gss3_create_res; 1235 The field "handle" is the RPCSEC_GSSv3 handle that the client will 1236 use on COPY_NOTIFY requests involving the source and destination 1237 server. granted_assertions[0].privs will be equal to 1238 "copy_from_auth". The server will return a GSS_Wrap() of 1239 copy_to_auth_priv. 1241 o An instance of copy_to_auth_priv is filled in with the shared 1242 secret, the source server, and the NFSv4 user id. It will be sent 1243 with an RPCSEC_GSS3_CREATE procedure, and so ctap_seq_num it set 1244 to the seq_num of the credential of the RPCSEC_GSS3_CREATE 1245 procedure. Because ctap_shared_secret is a secret, after XDR 1246 encoding copy_to_auth_priv, GSS_Wrap() is invoked on 1247 copy_to_auth_priv. The RPCSEC_GSS3_CREATE procedure's arguments 1248 are: 1250 struct { 1251 rpc_gss3_gss_binding *compound_binding; 1252 rpc_gss3_chan_binding *chan_binding_mic; 1253 rpc_gss3_assertion assertions<>; 1254 rpc_gss3_extension extensions<>; 1255 } rpc_gss3_create_args; 1257 The string "copy_to_auth" is placed in assertions[0].privs. The 1258 output of GSS_Wrap() is placed in extensions[0].data. The field 1259 extensions[0].critical is set to TRUE. After unwrapping, 1260 verifying the seq_num, and the user principal to NFSv4 user ID 1261 mapping, the destination establishes a privilege of 1262 <"copy_to_auth", user id, source>. The successful reply to 1263 RPCSEC_GSS3_CREATE has: 1265 struct { 1266 opaque handle<>; 1267 rpc_gss3_chan_binding *chan_binding_mic; 1268 rpc_gss3_assertion granted_assertions<>; 1269 rpc_gss3_assertion server_assertions<>; 1270 rpc_gss3_extension extensions<>; 1272 } rpc_gss3_create_res; 1274 The field "handle" is the RPCSEC_GSSv3 handle that the client will 1275 use on COPY requests involving the source and destination server. 1276 The field granted_assertions[0].privs will be equal to 1277 "copy_to_auth". The server will return a GSS_Wrap() of 1278 copy_to_auth_priv. 1280 5.1.2.2. Starting a Secure Inter-Server Copy 1282 When the client sends a COPY_NOTIFY request to the source server, it 1283 uses the privileged "copy_from_auth" RPCSEC_GSSv3 handle. 1284 cna_destination_server in COPY_NOTIFY MUST be the same as the name of 1285 the destination server specified in copy_from_auth_priv. Otherwise, 1286 COPY_NOTIFY will fail with NFS4ERR_ACCESS. The source server 1287 verifies that the privilege <"copy_from_auth", user id, destination> 1288 exists, and annotates it with the source filehandle, if the user 1289 principal has read access to the source file, and if administrative 1290 policies give the user principal and the NFS client read access to 1291 the source file (i.e. if the ACCESS operation would grant read 1292 access). Otherwise, COPY_NOTIFY will fail with NFS4ERR_ACCESS. 1294 When the client sends a COPY request to the destination server, it 1295 uses the privileged "copy_to_auth" RPCSEC_GSSv3 handle. 1296 ca_source_server in COPY MUST be the same as the name of the source 1297 server specified in copy_to_auth_priv. Otherwise, COPY will fail 1298 with NFS4ERR_ACCESS. The destination server verifies that the 1299 privilege <"copy_to_auth", user id, source> exists, and annotates it 1300 with the source and destination filehandles. If the client has 1301 failed to establish the "copy_to_auth" policy it will reject the 1302 request with NFS4ERR_PARTNER_NO_AUTH. 1304 If the client sends a COPY_REVOKE to the source server to rescind the 1305 destination server's copy privilege, it uses the privileged 1306 "copy_from_auth" RPCSEC_GSSv3 handle and the cra_destination_server 1307 in COPY_REVOKE MUST be the same as the name of the destination server 1308 specified in copy_from_auth_priv. The source server will then delete 1309 the <"copy_from_auth", user id, destination> privilege and fail any 1310 subsequent copy requests sent under the auspices of this privilege 1311 from the destination server. 1313 5.1.2.3. Securing ONC RPC Server-to-Server Copy Protocols 1315 After a destination server has a "copy_to_auth" privilege established 1316 on it, and it receives a COPY request, if it knows it will use an ONC 1317 RPC protocol to copy data, it will establish a "copy_confirm_auth" 1318 privilege on the source server, using nfs@ as the 1319 initiator principal, and nfs@ as the target principal. 1321 The value of the field ccap_shared_secret_mic is a GSS_VerifyMIC() of 1322 the shared secret passed in the copy_to_auth privilege. The field 1323 ccap_username is the mapping of the user principal to an NFSv4 user 1324 name ("user"@"domain" form), and MUST be the same as ctap_username 1325 and cfap_username. The field ccap_seq_num is the seq_num of the 1326 RPCSEC_GSSv3 credential used for the RPCSEC_GSS3_CREATE procedure the 1327 destination will send to the source server to establish the 1328 privilege. 1330 The source server verifies the privilege, and establishes a 1331 <"copy_confirm_auth", user id, destination> privilege. If the source 1332 server fails to verify the privilege, the COPY operation will be 1333 rejected with NFS4ERR_PARTNER_NO_AUTH. All subsequent ONC RPC 1334 requests sent from the destination to copy data from the source to 1335 the destination will use the RPCSEC_GSSv3 handle returned by the 1336 source's RPCSEC_GSS3_CREATE response. 1338 Note that the use of the "copy_confirm_auth" privilege accomplishes 1339 the following: 1341 o if a protocol like NFS is being used, with export policies, export 1342 policies can be overridden in case the destination server as-an- 1343 NFS-client is not authorized 1345 o manual configuration to allow a copy relationship between the 1346 source and destination is not needed. 1348 If the attempt to establish a "copy_confirm_auth" privilege fails, 1349 then when the user principal sends a COPY request to destination, the 1350 destination server will reject it with NFS4ERR_PARTNER_NO_AUTH. 1352 5.1.2.4. Securing Non ONC RPC Server-to-Server Copy Protocols 1354 If the destination won't be using ONC RPC to copy the data, then the 1355 source and destination are using an unspecified copy protocol. The 1356 destination could use the shared secret and the NFSv4 user id to 1357 prove to the source server that the user principal has authorized the 1358 copy. 1360 For protocols that authenticate user names with passwords (e.g. HTTP 1361 [RFC2616] and FTP [RFC0959]), the nfsv4 user id could be used as the 1362 user name, and an ASCII hexadecimal representation of the 1363 RPCSEC_GSSv3 shared secret could be used as the user password or as 1364 input into non-password authentication methods like CHAP [RFC1994]. 1366 5.1.3. Inter-Server Copy via ONC RPC but without RPCSEC_GSSv3 1368 ONC RPC security flavors other than RPCSEC_GSSv3 MAY be used with the 1369 server-side copy offload operations described in this document. In 1370 particular, host-based ONC RPC security flavors such as AUTH_NONE and 1371 AUTH_SYS MAY be used. If a host-based security flavor is used, a 1372 minimal level of protection for the server-to-server copy protocol is 1373 possible. 1375 In the absence of strong security mechanisms such as RPCSEC_GSSv3, 1376 the challenge is how the source server and destination server 1377 identify themselves to each other, especially in the presence of 1378 multi-homed source and destination servers. In a multi-homed 1379 environment, the destination server might not contact the source 1380 server from the same network address specified by the client in the 1381 COPY_NOTIFY. This can be overcome using the procedure described 1382 below. 1384 When the client sends the source server the COPY_NOTIFY operation, 1385 the source server may reply to the client with a list of target 1386 addresses, names, and/or URLs and assign them to the unique triple: 1387 . If the destination uses 1388 one of these target netlocs to contact the source server, the source 1389 server will be able to uniquely identify the destination server, even 1390 if the destination server does not connect from the address specified 1391 by the client in COPY_NOTIFY. 1393 For example, suppose the network topology is as shown in Figure 3. 1394 If the source filehandle is 0x12345, the source server may respond to 1395 a COPY_NOTIFY for destination 10.11.78.56 with the URLs: 1397 nfs://10.11.78.18//_COPY/10.11.78.56/_FH/0x12345 1399 nfs://192.168.33.18//_COPY/10.11.78.56/_FH/0x12345 1401 The client will then send these URLs to the destination server in the 1402 COPY operation. Suppose that the 192.168.33.0/24 network is a high 1403 speed network and the destination server decides to transfer the file 1404 over this network. If the destination contacts the source server 1405 from 192.168.33.56 over this network using NFSv4.1, it does the 1406 following: 1408 COMPOUND { PUTROOTFH, LOOKUP "_COPY" ; LOOKUP "10.11.78.56"; LOOKUP 1409 "_FH" ; OPEN "0x12345" ; GETFH } 1411 The source server will therefore know that these NFSv4.1 operations 1412 are being issued by the destination server identified in the 1413 COPY_NOTIFY. 1415 5.1.4. Inter-Server Copy without ONC RPC and RPCSEC_GSSv3 1417 The same techniques as Section 5.1.3, using unique URLs for each 1418 destination server, can be used for other protocols (e.g. HTTP 1419 [RFC2616] and FTP [RFC0959]) as well. 1421 6. IANA Considerations 1423 This document has no actions for IANA. 1425 7. References 1427 7.1. Normative References 1429 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 1430 Requirement Levels", BCP 14, RFC 2119, March 1997. 1432 [RFC3530] Shepler, S., Callaghan, B., Robinson, D., Thurlow, R., 1433 Beame, C., Eisler, M., and D. Noveck, "Network File System 1434 (NFS) version 4 Protocol", RFC 3530, April 2003. 1436 [RFC3986] Berners-Lee, T., Fielding, R., and L. Masinter, "Uniform 1437 Resource Identifier (URI): Generic Syntax", STD 66, 1438 RFC 3986, January 2005. 1440 [RFC5661] Shepler, S., Eisler, M., and D. Noveck, "Network File 1441 System (NFS) Version 4 Minor Version 1 Protocol", 1442 RFC 5661, January 2010. 1444 [RPCSEC_GSSv3] 1445 Williams, N., "Remote Procedure Call (RPC) Security 1446 Version 3", draft-williams-rpcsecgssv3 (work in progress), 1447 2008. 1449 7.2. Informational References 1451 [FEDFS-ADMIN] 1452 Lentini, J., Everhart, C., Ellard, D., Tewari, R., and M. 1453 Naik, "Administration Protocol for Federated Filesystems", 1454 draft-ietf-nfsv4-federated-fs-admin (Work In Progress), 1455 2010. 1457 [FEDFS-NSDB] 1458 Lentini, J., Everhart, C., Ellard, D., Tewari, R., and M. 1459 Naik, "NSDB Protocol for Federated Filesystems", 1460 draft-ietf-nfsv4-federated-fs-protocol (Work In Progress), 1461 2010. 1463 [RFC0959] Postel, J. and J. Reynolds, "File Transfer Protocol", 1464 STD 9, RFC 959, October 1985. 1466 [RFC1994] Simpson, W., "PPP Challenge Handshake Authentication 1467 Protocol (CHAP)", RFC 1994, August 1996. 1469 [RFC2616] Fielding, R., Gettys, J., Mogul, J., Frystyk, H., 1470 Masinter, L., Leach, P., and T. Berners-Lee, "Hypertext 1471 Transfer Protocol -- HTTP/1.1", RFC 2616, June 1999. 1473 Appendix A. Acknowledgments 1475 Tom Talpey co-authored an unpublished version of this document. We 1476 thank Tom for his contributions, especially with regards to the 1477 asynchronous completion callback mechanism. 1479 This document was reviewed by a number of individuals. We would like 1480 to thank Pranoop Erasani, Tom Haynes, Arthur Lent, Trond Myklebust, 1481 Dave Noveck, Theresa Lingutla-Raj, Manjunath Shankararao, Satyam 1482 Vaghani, and Nico Williams for their input and advice. 1484 Authors' Addresses 1486 James Lentini 1487 NetApp 1488 1601 Trapelo Rd, Suite 16 1489 Waltham, MA 02451 1490 USA 1492 Phone: +1 781-768-5359 1493 Email: jlentini@netapp.com 1495 Mike Eisler 1496 NetApp 1497 5765 Chase Point Circle 1498 Colorado Springs, CO 80919 1499 USA 1501 Phone: +1 719-599-9026 1502 Email: mike@eisler.com 1503 URI: http://www.eisler.com 1504 Deepak Kenchammana 1505 NetApp 1506 475 East Java Drive 1507 Sunnyvale, CA 94089 1508 USA 1510 Phone: +1 408-822-4765 1511 Email: kencham@netapp.com 1513 Anshul Madan 1514 Carnegie Mellon University 1515 School of Computer Science 1516 5000 Forbes Avenue 1517 Pittsburgh, PA 15213 1518 USA 1520 Email: anshulmadan@cmu.edu 1522 Rahul Iyer 1523 655 S Fair Oaks Ave 1524 Apt #I-314 1525 Sunnyvale, CA 94086 1526 USA 1528 Email: rahulair@yahoo.com