idnits 2.17.1 draft-lentini-nfsv4-server-side-copy-03.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- ** The document seems to lack a License Notice according IETF Trust Provisions of 28 Dec 2009, Section 6.b.ii or Provisions of 12 Sep 2009 Section 6.b -- however, there's a paragraph with a matching beginning. Boilerplate error? (You're using the IETF Trust Provisions' Section 6.b License Notice from 12 Feb 2009 rather than one of the newer Notices. See https://trustee.ietf.org/license-info/.) 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 7, 2009) is 5407 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 1234 ** Obsolete normative reference: RFC 3530 (Obsoleted by RFC 7530) -- 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 R. Iyer 5 Expires: January 8, 2010 D. Kenchammana 6 NetApp 7 A. Madan 8 Carnegie Mellon University 9 July 7, 2009 11 NFS Server-side Copy 12 draft-lentini-nfsv4-server-side-copy-03.txt 14 Status of this Memo 16 This Internet-Draft is submitted to IETF in full conformance with the 17 provisions of BCP 78 and BCP 79. 19 Internet-Drafts are working documents of the Internet Engineering 20 Task Force (IETF), its areas, and its working groups. Note that 21 other groups may also distribute working documents as Internet- 22 Drafts. 24 Internet-Drafts are draft documents valid for a maximum of six months 25 and may be updated, replaced, or obsoleted by other documents at any 26 time. It is inappropriate to use Internet-Drafts as reference 27 material or to cite them other than as "work in progress." 29 The list of current Internet-Drafts can be accessed at 30 http://www.ietf.org/ietf/1id-abstracts.txt. 32 The list of Internet-Draft Shadow Directories can be accessed at 33 http://www.ietf.org/shadow.html. 35 This Internet-Draft will expire on January 8, 2010. 37 Copyright Notice 39 Copyright (c) 2009 IETF Trust and the persons identified as the 40 document authors. All rights reserved. 42 This document is subject to BCP 78 and the IETF Trust's Legal 43 Provisions Relating to IETF Documents in effect on the date of 44 publication of this document (http://trustee.ietf.org/license-info). 45 Please review these documents carefully, as they describe your rights 46 and restrictions with respect to this document. 48 Abstract 50 This document describes a set of NFS operations for offloading a file 51 copy to a file server or between two file servers. 53 Table of Contents 55 1. Requirements notation . . . . . . . . . . . . . . . . . . . . 3 56 2. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 3 57 3. Protocol Overview . . . . . . . . . . . . . . . . . . . . . . 3 58 3.1. Intra-Server Copy . . . . . . . . . . . . . . . . . . . . 5 59 3.2. Inter-Server Copy . . . . . . . . . . . . . . . . . . . . 6 60 3.3. Server-to-Server Copy Protocol . . . . . . . . . . . . . . 9 61 3.3.1. Using NFSv4.x as a Server-to-Server Copy Protocol . . 9 62 3.3.2. Using an alternative Server-to-Server Copy Protocol . 10 63 4. Operations . . . . . . . . . . . . . . . . . . . . . . . . . . 11 64 4.1. netloc4 - Network Locations . . . . . . . . . . . . . . . 11 65 4.2. Operation U: COPY_NOTIFY - Notify a source server of a 66 future copy . . . . . . . . . . . . . . . . . . . . . . . 12 67 4.3. Operation V: COPY_REVOKE - Revoke a destination 68 server's copy privileges . . . . . . . . . . . . . . . . . 14 69 4.4. Operation W: COPY - Initiate a server-side copy . . . . . 15 70 4.5. Operation X: COPY_ABORT - Cancel a server-side copy . . . 19 71 4.6. Operation Y: COPY_STATUS - Poll for status of a 72 server-side copy . . . . . . . . . . . . . . . . . . . . . 20 73 4.7. Operation Z: CB_COPY - Report results of a server-side 74 copy . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 75 4.8. Copy Offload Stateids . . . . . . . . . . . . . . . . . . 23 76 5. Security Considerations . . . . . . . . . . . . . . . . . . . 23 77 5.1. Inter-Server Copy Security . . . . . . . . . . . . . . . . 24 78 5.1.1. Requirements for Secure Inter-Server Copy . . . . . . 24 79 5.1.2. Inter-Server Copy with RPCSEC_GSSv3 . . . . . . . . . 24 80 5.1.3. Inter-Server Copy via ONC RPC but without 81 RPCSEC_GSSv3 . . . . . . . . . . . . . . . . . . . . . 30 82 5.1.4. Inter-Server Copy without ONC RPC and RPCSEC_GSSv3 . . 31 83 6. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 31 84 7. References . . . . . . . . . . . . . . . . . . . . . . . . . . 31 85 7.1. Normative References . . . . . . . . . . . . . . . . . . . 31 86 7.2. Informational References . . . . . . . . . . . . . . . . . 32 87 Appendix A. Acknowledgments . . . . . . . . . . . . . . . . . . . 32 88 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . . 32 90 1. Requirements notation 92 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 93 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 94 document are to be interpreted as described in [RFC2119]. 96 2. Introduction 98 This document describes a server-side copy feature for the NFS 99 protocol. 101 The server-side copy feature provides a mechanism for the NFS client 102 to perform a file copy on the server without the data being 103 transmitted back and forth over the network. 105 Without this feature, an NFS client copies data from one location to 106 another by reading the data from the server over the network, and 107 then writing the data back over the network to the server. Using 108 this server-side copy operation, the client is able to instruct the 109 server to copy the data locally without the data being sent back and 110 forth over the network unnecessarily. 112 In general, this feature is useful whenever data is copied from one 113 location to another on the server. It is particularly useful when 114 copying the contents of a file from a snapshot. Snapshot-versions of 115 a file are copied for a number of reasons, including restoring and 116 cloning data. 118 If the source object and destination object are on different file 119 servers, the file servers will communicate with one another to 120 perform the copy operation. The server-to-server protocol by which 121 this is accomplished is not defined in this document. 123 3. Protocol Overview 125 The server-side copy offload operations support both intra-server and 126 inter-server file copies. An intra-server copy is a copy in which 127 the source file and destination file reside on the same server. In 128 an inter-server copy, the source file and destination file are on 129 different servers. In both cases, the copy may be performed 130 synchronously or asynchronously. 132 Throughout the rest of this document, we refer to the NFS server 133 containing the source file as the "source server" and the NFS server 134 to which the file is transferred as the "destination server". In the 135 case of an intra-server copy, the source server and destination 136 server are the same server. The terms source server and destination 137 server refer to the single server performing the copy in the context 138 of an intra-server copy. 140 For the inter-server copy protocol, the operations are defined to be 141 compatible with a server-to-server copy protocol in which the 142 destination server reads the file data from the source server. This 143 model in which the file data is pulled from the source by the 144 destination has a number of advantages over a model in which the 145 source pushes the file data to the destination. The advantages of 146 the pull model include: 148 o The pull model only requires a remote server (i.e. the destination 149 server) to be granted read access. A push model requires a remote 150 server (i.e. the source server) to be granted write access, which 151 is more privileged. 153 o The pull model allows the destination server to stop reading if it 154 has run out of space. In a push model, the destination server 155 must flow control the source server in this situation. 157 o The pull model allows the destination server to easily flow 158 control the data stream by adjusting the size of its read 159 operations. In a push model, the destination server does not have 160 this ability. The source server in a push model is capable of 161 writing chunks larger than the destination server has requested in 162 attributes and session parameters. In theory, the destination 163 server could perform a "short" write in this situation, but this 164 approach is known to behave poorly in practice. 166 The following operations are provided to support server-side copy: 168 COPY_NOTIFY: For inter-server copies, the client sends this 169 operation to the source server to notify it of a future file copy 170 from a given destination server for the given user. 172 COPY_REVOKE: Also for inter-server copies, the client sends this 173 operation to the source server to revoke permission to copy a file 174 for the given user. 176 COPY: Used by the client to request a file copy. 178 COPY_ABORT: Used by the client to abort an asynchronous file copy. 180 COPY_STATUS: Used by the client to poll the status of an 181 asynchronous file copy. 183 CB_COPY: Used by the destination server to report the results of an 184 asynchronous file copy to the client. 186 These operations are described in detail in Section 4. This section 187 provides an overview of how these operations are used to perform 188 server-side copies. 190 3.1. Intra-Server Copy 192 To copy a file on a single server, the client uses a COPY operation. 193 The server may respond to the copy operation with the final results 194 of the copy or it may perform the copy asynchronously and deliver the 195 results using a CB_COPY operation callback. If the copy is performed 196 asynchronously, the client may poll the status of the copy using 197 COPY_STATUS or cancel the copy using COPY_ABORT. 199 A synchronous intra-server copy is shown in Figure 1. In this 200 example, the NFS server chooses to perform the copy synchronously. 201 The copy operation is completed, either successfully or 202 unsuccessfully, before the server replies to the client's request. 203 The server's reply contains the final result of the operation. 205 Client Server 206 + + 207 | | 208 |--- COPY ---------------------------->| Client requests 209 |<------------------------------------/| a file copy 210 | | 211 | | 213 Figure 1: A synchronous intra-server copy. 215 An asynchronous intra-server copy is shown in Figure 2. In this 216 example, the NFS server performs the copy asynchronously. The 217 server's reply to the copy request indicates that the copy operation 218 was initiated and the final result will be delivered at a later time. 219 The server's reply also contains a copy stateid. The client may use 220 this copy stateid to poll for status information (as shown) or to 221 cancel the copy using a COPY_ABORT. When the server completes the 222 copy, the server performs a callback to the client and reports the 223 results. 225 Client Server 226 + + 227 | | 228 |--- COPY ---------------------------->| Client requests 229 |<------------------------------------/| a file copy 230 | | 231 | | 232 |--- COPY_STATUS --------------------->| Client may poll 233 |<------------------------------------/| for status 234 | | 235 | . | Multiple COPY_STATUS 236 | . | operations may be sent. 237 | . | 238 | | 239 |<-- CB_COPY --------------------------| Server reports results 240 |\------------------------------------>| 241 | | 243 Figure 2: An asynchronous intra-server copy. 245 3.2. Inter-Server Copy 247 A copy may also be performed between two servers. The copy protocol 248 is designed to accommodate a variety of network topologies. As shown 249 in Figure 3, the client and servers may be connected by multiple 250 networks. In particular, the servers may be connected by a 251 specialized, high speed network (network 192.168.33.0/24 in the 252 diagram) that does not include the client. The protocol allows the 253 client to setup the copy between the servers (over network 254 10.11.78.0/24 in the diagram) and for the servers to communicate on 255 the high speed network if they choose to do so. 257 192.168.33.0/24 258 +-------------------------------------+ 259 | | 260 | | 261 | 192.168.33.18 | 192.168.33.56 262 +-------+------+ +------+------+ 263 | Source | | Destination | 264 +-------+------+ +------+------+ 265 | 10.11.78.18 | 10.11.78.56 266 | | 267 | | 268 | 10.11.78.0/24 | 269 +------------------+------------------+ 270 | 271 | 272 | 10.11.78.243 273 +-----+-----+ 274 | Client | 275 +-----------+ 277 Figure 3: An example inter-server network topology. 279 For an inter-server copy, the client notifies the source server that 280 a file will be copied by the destination server using a COPY_NOTIFY 281 operation. The client then initiates the copy by sending the COPY 282 operation to the destination server. The destination server may 283 perform the copy synchronously or asynchronously. A synchronous 284 inter-server copy is shown in Figure 4. In this case, the 285 destination server must perform the copy before responding to the 286 client's COPY request. An asynchronous copy is shown in Figure 5. 288 Client Source Destination 289 + + + 290 | | | 291 |--- COPY_NOTIFY --->| | 292 |<------------------/| | 293 | | | 294 | | | 295 |--- COPY ---------------------------->| 296 | | | 297 | | | 298 | |<----- read -----| 299 | |\--------------->| 300 | | | 301 | | . | Multiple reads may 302 | | . | be necessary 303 | | . | 304 | | | 305 | | | 306 |<------------------------------------/| Destination replies 307 | | | to COPY 309 Figure 4: A synchronous inter-server copy. 311 Client Source Destination 312 + + + 313 | | | 314 |--- COPY_NOTIFY --->| | 315 |<------------------/| | 316 | | | 317 | | | 318 |--- COPY ---------------------------->| 319 |<------------------------------------/| 320 | | | 321 | | | 322 | |<----- read -----| 323 | |\--------------->| 324 | | | 325 | | . | Multiple reads may 326 | | . | be necessary 327 | | . | 328 | | | 329 | | | 330 |--- COPY_STATUS --------------------->| Client may poll 331 |<------------------------------------/| for status 332 | | | 333 | | . | Multiple COPY_STATUS 334 | | . | operations may be sent 335 | | . | 336 | | | 337 | | | 338 | | | 339 |<-- CB_COPY --------------------------| Destination reports 340 |\------------------------------------>| results 341 | | | 343 Figure 5: An asynchronous inter-server copy. 345 3.3. Server-to-Server Copy Protocol 347 During an inter-server copy, the destination server reads the file 348 data from the source server. The source server and destination 349 server are not required to use a specific protocol to transfer the 350 file data. The choice of what protocol to use is ultimately the 351 destination server's decision. 353 3.3.1. Using NFSv4.x as a Server-to-Server Copy Protocol 355 The destination server MAY use standard NFSv4.x (where x >= 1) to 356 read the data from the source server. If NFSv4.x is used for the 357 server-to-server copy protocol, the destination server can use the 358 filehandle contained in the COPY request with standard NFSv4.x 359 operations to read data from the source server. Specifically, the 360 destination server may use the NFSv4.x OPEN operation's CLAIM_FH 361 facility to open the file being copied and obtain an open stateid. 362 Using the stateid, the destination server may then use NFSv4.x READ 363 operations to read the file. 365 3.3.2. Using an alternative Server-to-Server Copy Protocol 367 In a homogeneous environment, the source and destination servers 368 might be able to perform the file copy extremely efficiently using 369 specialized protocols. For example the source and destination 370 servers might be two nodes sharing a common file system format for 371 the source and destination file systems. Thus the source and 372 destination are in an ideal position to efficiently render the image 373 of the source file to the destination file by replicating the file 374 system formats at the block level. Another possibility is that the 375 source and destination might be two nodes sharing a common storage 376 area network, and thus there is no need to copy any data at all, and 377 instead ownership of the file and its contents might simply be re- 378 assigned to the destination. To allow for these possibilities, the 379 destination server is allowed to use a server-to-server copy protocol 380 of its choice. 382 In a heterogeneous environment, using a protocol other than NFSv4.x 383 (e.g. HTTP [RFC2616] and FTP [RFC0959]) presents some challenges. 384 In particular, the destination server is presented with the challenge 385 of accessing the source file given only an NFSv4.x filehandle. 387 One option for protocols that identify source files with path names 388 is to use an ASCII hexadecimal representation of the source 389 filehandle as the file name. 391 Another option for the source server is to use URLs to direct the 392 destination server to a specialized service. For example, the 393 response to COPY_NOTIFY could include the URL 394 ftp://s1.example.com:9999/_FH/0x12345, where 0x12345 is the ASCII 395 hexadecimal representation of the source filehandle. When the 396 destination server receives the source server's URL, it would use 397 "_FH/0x12345" as the file name to pass to the FTP server listening on 398 port 9999 of s1.example.com. On port 9999 there would be a special 399 instance of the FTP service that understands how to convert NFS 400 filehandles to an open file descriptor (in many operating systems, 401 this would require a new system call, one which is the inverse of the 402 makefh() function that the pre-NFSv4 MOUNT service needs). 404 Authenticating and identifying the destination server to the source 405 server is also a challenge. Recommendations for how to accomplish 406 this are given in Section 5.1.2.4 and Section 5.1.4. 408 4. Operations 410 In the sections that follow, several operations are defined that 411 together provide the server-side copy feature. These operations are 412 intended to be OPTIONAL operations as defined in section 17 of 413 [NFSv4.1]. The COPY_NOTIFY, COPY_REVOKE, COPY, COPY_ABORT, and 414 COPY_STATUS operations are designed to be sent within an NFSv4 415 COMPOUND procedure. The CB_COPY operation is designed to be sent 416 within an NFSv4 CB_COMPOUND procedure. 418 Each operation is performed in the context of the user identified by 419 the ONC RPC credential of its containing COMPOUND or CB_COMPOUND 420 request. For example, a COPY_ABORT operation issued by a given user 421 indicates that a specified COPY operation initiated by the same user 422 be canceled. Therefore a COPY_ABORT MUST NOT interfere with a copy 423 of the same file initiated by another user. 425 An NFS server MAY allow an administrative user to monitor or cancel 426 copy operations using an implementation specific interface. 428 4.1. netloc4 - Network Locations 430 The server-side copy operations specify network locations using the 431 netloc4 data type shown below: 433 enum netloc_type4 { 434 NL4_NAME = 0, 435 NL4_URL = 1, 436 NL4_NETADDR = 2 437 }; 439 union netloc4 switch (netloc_type4 nl_type) { 440 case NL4_NAME: utf8str_cis nl_name; 441 case NL4_URL: utf8str_cis nl_url; 442 case NL4_NETADDR: netaddr4 nl_addr; 443 }; 445 If the netloc4 is of type NL4_NAME, the nl_name field MUST be 446 specified as a UTF-8 string. The nl_name is expected to be resolved 447 to a network address via DNS, LDAP, NIS, /etc/hosts, or some other 448 means. If the netloc4 is of type NL4_URL, a server URL [RFC3986] 449 appropriate for the server-to-server copy operation is specified as a 450 UTF-8 string. If the netloc4 is of type NL4_NETADDR, the nl_addr 451 field MUST contain a valid netaddr4. 453 When netloc4 values are used for an inter-server copy as shown in 454 Figure 3, their values may be evaluated on the source server, 455 destination server, and client. The network environment in which 456 these systems operate should be configured so that the netloc4 values 457 are interpreted as intended on each system. 459 4.2. Operation U: COPY_NOTIFY - Notify a source server of a future copy 461 ARGUMENTS 463 struct COPY_NOTIFY4args { 464 /* CURRENT_FH: source file */ 465 netloc4 cna_destination_server; 466 }; 468 RESULTS 470 union COPY_NOTIFY4res switch (nfsstat4 cnr_status) { 471 case NFS4_OK: 472 nfstime4 cnr_lease_time; 473 netloc4 cnr_source_server<>; 474 default: 475 void; 476 }; 478 DESCRIPTION 480 This operation is used for an inter-server copy. A client sends this 481 operation in a COMPOUND request to the source server to authorize a 482 destination server identified by cna_destination_server to read the 483 file specified by CURRENT_FH on behalf of the given user. 485 The cna_destination_server MUST be specified using the netloc4 486 network location format. The server is not required to resolve the 487 cna_destination_server address before completing this operation. 489 If this operation succeeds, the source server will allow the 490 cna_destination_server to copy the specified file on behalf of the 491 given user. If COPY_NOTIFY succeeds, the destination server is 492 granted permission to read the file as long as both of the following 493 conditions are met: 495 o The destination server begins reading the source file before the 496 cnr_lease_time expires. If the cnr_lease_time expires while the 497 destination server is still reading the source file, the 498 destination server is allowed to finish reading the file. 500 o The client has not issued a COPY_REVOKE for the same combination 501 of user, filehandle, and destination server. 503 The cnr_lease_time is chosen by the source server. A cnr_lease_time 504 of 0 (zero) indicates an infinite lease. To renew the copy lease 505 time the client should resend the same copy notification request to 506 the source server. 508 To avoid the need for synchronized clocks, copy lease times are 509 granted by the server as a time delta. However, there is a 510 requirement that the client and server clocks do not drift 511 excessively over the duration of the lease. There is also the issue 512 of propagation delay across the network which could easily be several 513 hundred milliseconds as well as the possibility that requests will be 514 lost and need to be retransmitted. 516 To take propagation delay into account, the client should subtract it 517 from copy lease times (e.g. if the client estimates the one-way 518 propagation delay as 200 milliseconds, then it can assume that the 519 lease is already 200 milliseconds old when it gets it). In addition, 520 it will take another 200 milliseconds to get a response back to the 521 server. So the client must send a lease renewal or send the copy 522 offload request to the cna_destination_server at least 400 523 milliseconds before the copy lease would expire. If the propagation 524 delay varies over the life of the lease (e.g. the client is on a 525 mobile host), the client will need to continuously subtract the 526 increase in propagation delay from the copy lease times. 528 The server's copy lease period configuration should take into account 529 the network distance of the clients that will be accessing the 530 server's resources. It is expected that the lease period will take 531 into account the network propagation delays and other network delay 532 factors for the client population. Since the protocol does not allow 533 for an automatic method to determine an appropriate copy lease 534 period, the server's administrator may have to tune the copy lease 535 period. 537 A successful response will also contain a list of names, addresses, 538 and URLs called cnr_source_server, on which the source is willing to 539 accept connections from the destination. These might not be 540 reachable from the client and might be located on networks to which 541 the client has no connection. 543 If the client wishes to perform an inter-server copy, the client MUST 544 send a COPY_NOTIFY to the source server. Therefore, the source 545 server MUST support COPY_NOTIFY. 547 For a copy only involving one server (the source and destination are 548 on the same server), this operation is unnecessary. 550 The COPY_NOTIFY operation may fail for the following reasons (this is 551 a partial list): 553 NFS4ERR_NOTSUPP: The copy offload operation is not supported by the 554 NFS server receiving this request. 556 NFS4ERR_WRONGSEC: The security mechanism being used by the client 557 does not match the server's security policy. 559 4.3. Operation V: COPY_REVOKE - Revoke a destination server's copy 560 privileges 562 ARGUMENTS 564 struct COPY_REVOKE4args { 565 /* CURRENT_FH: source file */ 566 netloc4 cra_destination_server; 567 }; 569 RESULTS 571 struct COPY_REVOKE4res { 572 nfsstat4 crr_status; 573 }; 575 DESCRIPTION 577 This operation is used for an inter-server copy. A client sends this 578 operation in a COMPOUND request to the source server to revoke the 579 authorization of a destination server identified by 580 cra_destination_server from reading the file specified by CURRENT_FH 581 on behalf of given user. If the cra_destination_server has already 582 begun copying the file, a successful return from this operation 583 indicates that further access will be prevented. 585 The cra_destination_server MUST be specified using the netloc4 586 network location format. The server is not required to resolve the 587 cra_destination_server address before completing this operation. 589 The COPY_REVOKE operation is useful in situations in which the source 590 server granted a very long or infinite lease on the destination 591 server's ability to read the source file and all copy operations on 592 the source file have been completed. 594 For a copy only involving one server (the source and destination are 595 on the same server), this operation is unnecessary. 597 If the server supports COPY_NOTIFY, the server is REQUIRED to support 598 the COPY_REVOKE operation. 600 The COPY_REVOKE operation may fail for the following reasons (this is 601 a partial list): 603 NFS4ERR_NOTSUPP: The copy offload operation is not supported by the 604 NFS server receiving this request. 606 4.4. Operation W: COPY - Initiate a server-side copy 608 ARGUMENTS 610 #define COPY4_GUARDED = 0x00000001; 611 #define COPY4_METADATA = 0x00000002; 612 #define COPY4_SPACE_RESERVED = 0x00000004; 614 struct COPY4args { 615 /* SAVED_FH: source file */ 616 /* CURRENT_FH: destination file or directory */ 617 offset4 ca_src_offset; 618 offset4 ca_dst_offset; 619 length4 ca_count; 620 uint32_t ca_flags; 621 component4 ca_destination; 622 netloc4 ca_source_server<>; 623 }; 625 RESULTS 627 union COPY4res switch (nfsstat4 cr_status) { 628 /* CURRENT_FH: destination file */ 629 case NFS4_OK: 630 stateid4 cr_callback_id<1>; 631 default: 632 length4 cr_bytes_copied; 633 }; 635 DESCRIPTION 637 The COPY operation is used for both intra- and inter-server copies. 638 In both cases, the COPY is always sent from the client to the 639 destination server of the file copy. The COPY operation requests 640 that a file be copied from the location specified by the SAVED_FH 641 value to the location specified by the combination of CURRENT_FH and 642 ca_destination. 644 The SAVED_FH must be a regular file. If SAVED_FH is not a regular 645 file, the operation MUST fail and return NFS4ERR_WRONG_TYPE. 647 In order to set SAVED_FH to the source file handle, the compound 648 procedure requesting the COPY will include a sub-sequence of 649 operations such as 651 PUTFH source-fh 652 SAVEFH 654 If the request is for a server-to-server copy, the source-fh is a 655 filehandle from the source server and the compound procedure is being 656 executed on the destination server. In this case, the source-fh is a 657 foreign filehandle on the server receiving the COPY request. If 658 either PUTFH or SAVEFH checked the validity of the filehandle, the 659 operation would likely fail and return NFS4ERR_STALE. 661 In order to avoid this problem, the minor version incorporating the 662 COPY operations will need to make a few small changes in the handling 663 of existing operations. If a server supports the server-to-server 664 COPY feature, a PUTFH followed by a SAVEFH MUST NOT return 665 NFS4ERR_STALE for either operation. These restrictions do not pose 666 substantial difficulties for servers. The CURRENT_FH and SAVED_FH 667 may be validated in the context of the operation referencing them and 668 an NFS4ERR_STALE error returned for an invalid file handle at that 669 point. 671 The CURRENT_FH and ca_destination together specify the destination of 672 the copy operation. If ca_destination is of 0 (zero) length, then 673 CURRENT_FH specifies the target file. In this case, CURRENT_FH MUST 674 be a file and not a directory. If ca_destination is not of 0 (zero) 675 length, the ca_destination argument specifies the file name to which 676 the data will be copied within the directory identified by 677 CURRENT_FH. In this case, CURRENT_FH MUST be a directory and not a 678 file. 680 If the file named by ca_destination does not exist and the operation 681 completes successfully, the file will be visible in the file system 682 namespace. If the file does not exist and the operation fails, the 683 file MAY be visible in the file system namespace depending on when 684 the failure occurs and on the implementation of the NFS server 685 receiving the COPY operation. If the ca_destination name cannot be 686 created in the destination file system (due to file name 687 restrictions, such as case or length), the operation MUST fail. 689 The ca_src_offset is the offset within the source file from which the 690 data will be read, the ca_dst_offset is the offset within the 691 destination file to which the data will be written, and the ca_count 692 is the number of bytes that will be copied. An offset of 0 (zero) 693 specifies the start of the file. A count of 0 (zero) requests that 694 all bytes from ca_src_offset through EOF be copied to the 695 destination. If concurrent modifications to the source file overlap 696 with the source file region being copied, the data copied may include 697 all, some, or none of the modifications. If the source file's end of 698 file is being modified in parallel with a copy that specifies a count 699 of 0 (zero) bytes, the amount of data copied is implementation 700 dependent (clients may guard against this case by specifying a non- 701 zero count value). 703 If the source offset or the source offset plus count is greater than 704 or equal to the size of the source file, the operation will fail with 705 NFS4ERR_INVAL. The destination offset or destination offset plus 706 count may be greater than the size of the destination file. This 707 allows for the client to issue parallel copies to implement 708 operations such as "cat file1 file2 file3 file4 > dest". 710 If the destination file is created as a result of this command, the 711 destination file's size will be equal to the number of bytes 712 successfully copied. If the destination file already existed, the 713 destination file's size may increase as a result of this operation 714 (e.g. if ca_dst_offset plus ca_count is greater than the 715 destination's initial size). 717 If the ca_source_server list is specified, then this is an inter- 718 server copy operation and the source file is on a remote server. The 719 client is expected to have previously issued a successful COPY_NOTIFY 720 request to the remote source server. The ca_source_server list 721 SHOULD be the same as the COPY_NOTIFY response's cnr_source_server 722 list. If the client includes the entries from the COPY_NOTIFY 723 response's cnr_source_server list in the ca_source_server_list, the 724 source server can indicate a specific copy protocol for the 725 destination server to use by returning a URL, which specifies both a 726 protocol service and server name. Server-to-server copy protocol 727 considerations are described in Section 3.3 and Section 5.1. 729 The ca_flags argument allows the copy operation to be customized in 730 the following ways using the guarded flag (COPY4_GUARDED), the 731 metadata flag (COPY4_METADATA), and the space reserved flag 732 (COPY4_SPACE_RESERVED). 734 If the guarded flag is set and the destination exists on the server, 735 this operation will fail with NFS4ERR_EXIST. 737 If the guarded flag is not set and the destination exists on the 738 server, the behavior is implementation dependent. 740 If the metadata flag is set, the destination's metadata MUST match 741 the source's metadata. In particular, all of the REQUIRED, 742 RECOMMENDED, and named attributes of the destination file MUST be the 743 same as the source file. To preserve namespace junctions, if access 744 to the source file generates an NFS4ERR_MOVED error, access to the 745 destination file MUST also generate an NFS4ERR_MOVED error. If these 746 requirements cannot be met, the server MUST return 747 NFS4ERR_ATTRNOTSUPP. 749 If the metadata flag is not set, the destination's metadata is 750 implementation dependent. 752 If the space reserved flag is set, the operation will only succeed if 753 the file server can guarantee that all future non-extending writes to 754 the copied file will not fail due to insufficient space. 756 If space_reserved is not set, the space reservation state of the new 757 file is implementation dependent. 759 If the operation does not result in an immediate failure, the server 760 will return NFS4_OK, and the CURRENT_FH will be set to the 761 destination's filehandle. 763 If an immediate failure does occur, cr_bytes_copied will be set to 764 the number of bytes copied to the destination file before the error 765 occurred. The cr_bytes_copied value indicates what percentage of the 766 copy was performed before the error occurred, but not which specific 767 bytes were copied. 769 A return of NFS4_OK indicates that either the operation is complete 770 or the operation was initiated and a callback will be used to deliver 771 the final status of the operation. 773 If the cr_callback_id is returned, this indicates that the operation 774 was initiated and a CB_COPY callback will deliver the final results 775 of the operation. The cr_callback_id stateid is termed a copy 776 stateid in this context. The server is given the option of returning 777 the results in a callback because the data may require a relatively 778 long period of time to copy. 780 If no cr_callback_id is returned, the operation completed 781 synchronously and no callback will be issued by the server. The 782 completion status of the operation is indicated by cr_status. 784 In the event of a failure the state of the destination file is 785 implementation dependent.The COPY operation may fail for the 786 following reasons (this is a partial list). 788 NFS4ERR_NOTSUPP: The copy offload operation is not supported by the 789 NFS server receiving this request. 791 NFS4ERR_PARTNER_NOTSUPP: The remote server does not support the 792 server-to-server copy offload protocol. 794 NFS4ERR_PARTNER_NO_AUTH: The remote server does not authorize a 795 server-to-server copy offload operation. This may be due to the 796 client's failure to send the COPY_NOTIFY operation to the remote 797 server, the remote server receiving a server-to-server copy 798 offload request after the copy lease time expired, or for some 799 other permission problem. 801 NFS4ERR_FBIG: The copy operation would have caused the file to grow 802 beyond the server's limit. 804 NFS4ERR_NOTDIR: The CURRENT_FH is a file and ca_destination has non- 805 zero length. 807 NFS4ERR_WRONG_TYPE: The SAVED_FH is not a regular file. 809 NFS4ERR_ISDIR: The CURRENT_FH is a directory and ca_destination has 810 zero length. 812 NFS4ERR_INVAL: The source offset or offset plus count are greater 813 than or equal to the size of the source file. 815 NFS4ERR_DELAY: The server does not have the resources to perform the 816 copy operation at the current time. The client should retry the 817 operation sometime in the future. 819 NFS4ERR_METADATA_NOTSUPP: The destination file cannot support the 820 same metadata as the source file. 822 NFS4ERR_WRONGSEC: The security mechanism being used by the client 823 does not match the server's security policy. 825 4.5. Operation X: COPY_ABORT - Cancel a server-side copy 827 ARGUMENTS 829 struct COPY_ABORT4args { 830 /* CURRENT_FH: destination file */ 831 stateid4 caa_stateid; 832 }; 834 RESULTS 836 struct COPY_ABORT4res { 837 nfsstat4 car_status; 838 }; 840 DESCRIPTION 842 COPY_ABORT is used for both intra- and inter-server asynchronous 843 copies. The COPY_ABORT operation allows the client to cancel a 844 server-side copy operation that it initiated. This operation is sent 845 in a COMPOUND request from the client to the destination server. 846 This operation may be used to cancel a copy when the application that 847 requested the copy exits before the operation is completed or for 848 some other reason. 850 The request contains the filehandle and copy stateid cookies that act 851 as the context for the previously initiated copy operation. 853 The result's car_status field indicates whether the cancel was 854 successful or not. A value of NFS4_OK indicates that the copy 855 operation was canceled and no callback will be issued by the server. 856 A copy operation that is successfully canceled may result in none, 857 some, or all of the data copied. 859 If the server supports asynchronous copies, the server is REQUIRED to 860 support the COPY_ABORT operation. 862 The COPY_ABORT operation may fail for the following reasons (this is 863 a partial list): 865 NFS4ERR_NOTSUPP: The abort operation is not supported by the NFS 866 server receiving this request. 868 NFS4ERR_RETRY: The abort failed, but a retry at some time in the 869 future MAY succeed. 871 NFS4ERR_COMPLETE_ALREADY: The abort failed, and a callback will 872 deliver the results of the copy operation. 874 NFS4ERR_SERVERFAULT: An error occurred on the server that does not 875 map to a specific error code. 877 4.6. Operation Y: COPY_STATUS - Poll for status of a server-side copy 879 ARGUMENTS 881 struct COPY_STATUS4args { 882 /* CURRENT_FH: destination file */ 883 stateid4 csa_stateid; 884 }; 886 RESULTS 887 union COPY_STATUS4res switch (nfsstat4 cr_status) { 888 case NFS4_OK: 889 length4 csr_bytes_copied; 890 nfsstat4 csr_complete<1>; 891 default: 892 void; 893 }; 895 DESCRIPTION 897 COPY_STATUS is used for both intra- and inter-server asynchronous 898 copies. The COPY_STATUS operation allows the client to poll the 899 server to determine the status of an asynchronous copy operation. 900 This operation is sent by the client to the destination server. 902 If this operation is successful, the number of bytes copied are 903 returned to the client in the csr_bytes_copied field. The 904 csr_bytes_copied value indicates what percentage of the copy has been 905 performed but not which specific bytes have been copied. 907 If the optional csr_complete field is present, the copy has 908 completed. In this case the status value indicates the result of the 909 asynchronous copy operation. In all cases, the server will also 910 deliver the final results of the asynchronous copy in a CB_COPY 911 operation. 913 The failure of this operation does not indicate the result of the 914 asynchronous copy in any way. 916 If the server supports asynchronous copies, the server is REQUIRED to 917 support the COPY_STATUS operation. 919 The COPY_STATUS operation may fail for the following reasons (this is 920 a partial list): 922 NFS4ERR_NOTSUPP: The copy status operation is not supported by the 923 NFS server receiving this request. 925 NFS4ERR_BAD_STATEID: The stateid is not valid (see Section 4.8 926 below). 928 NFS4ERR_EXPIRED: The stateid has expired (see Copy Offload Stateid 929 section below). 931 4.7. Operation Z: CB_COPY - Report results of a server-side copy 933 ARGUMENTS 935 union copy_info4 switch (nfsstat4 cca_status) { 936 case NFS4_OK: 937 void; 938 default: 939 length4 cca_bytes_copied; 940 }; 942 struct CB_COPY4args { 943 nfs_fh4 cca_fh; 944 stateid4 cca_stateid; 945 copy_info4 cca_copy_info; 946 }; 948 RESULTS 950 struct CB_COPY4res { 951 nfsstat4 ccr_status; 952 }; 954 DESCRIPTION 956 CB_COPY is used for both intra- and inter-server asynchronous copies. 957 The CB_COPY callback informs the client of the result of an 958 asynchronous server-side copy. This operation is sent by the 959 destination server to the client in a CB_COMPOUND request. The copy 960 is identified by the filehandle and stateid arguments. The result is 961 indicated by the status field. If the copy failed, cca_bytes_copied 962 contains the number of bytes copied before the failure occurred. The 963 cca_bytes_copied value indicates what percentage of the copy was 964 performed before the error occurred but not which specific bytes were 965 copied. 967 In the absence of an established backchannel, the server cannot 968 signal the completion of the COPY via a CB_COPY callback. The loss 969 of a callback channel would be indicated by the server setting the 970 SEQ4_STATUS_CB_PATH_DOWN flag in the sr_status_flags field of the 971 SEQUENCE operation. The client must re-establish the callback 972 channel to receive the status of the COPY operation. Prolonged loss 973 of the callback channel could result in the server dropping the COPY 974 operation state and invalidating the copy stateid. 976 If the client supports the COPY operation, the client is REQUIRED to 977 support the CB_COPY operation. 979 The CB_COPY operation may fail for the following reasons (this is a 980 partial list): 982 NFS4ERR_NOTSUPP: The copy offload operation is not supported by the 983 NFS client receiving this request. 985 4.8. Copy Offload Stateids 987 A server may perform a copy offload operation asynchronously. An 988 asynchronous copy is tracked using a copy offload stateid. Copy 989 offload stateids are include in the COPY, COPY_ABORT, COPY_STATUS, 990 and CB_COPY operations. 992 Section 8.2.4 of [NFSv4.1] specifies that stateids are valid until 993 either (A) the client or server restart or (B) the client returns the 994 resource. Case (A) applies to a copy offload stateid, but case (B) 995 does not (there is no way for the client to "return the resources"). 997 A copy offload stateid will be valid until either (A) the client or 998 server restart or (C) the client replies to a CB_COPY operation. 1000 A copy offload stateid's seqid MUST NOT be 0 (zero). In the context 1001 of a copy offload operation, it is ambiguous to indicate the most 1002 recent copy offload operation using a stateid with seqid of 0 (zero). 1003 Therefore a copy offload stateid with seqid of 0 (zero) MUST be 1004 considered invalid. 1006 5. Security Considerations 1008 The security considerations pertaining to NFSv4 [RFC3530] apply to 1009 this document. 1011 The standard security mechanisms provide by NFSv4 [RFC3530] may be 1012 used to secure the protocol described in this document. 1014 NFSv4 clients and servers supporting the the inter-server copy 1015 operations described in this document are REQUIRED to implement 1016 [RPCSEC_GSSv3], including the RPCSEC_GSSv3 privileges copy_from_auth 1017 and copy_to_auth. If the server-to-server copy protocol is ONC RPC 1018 based, the servers are also REQUIRED to implement the RPCSEC_GSSv3 1019 privilege copy_confirm_auth. These requirements to implement are not 1020 requirements to use. NFSv4 clients and servers are RECOMMENDED to 1021 use [RPCSEC_GSSv3] to secure server-side copy operations. 1023 5.1. Inter-Server Copy Security 1025 5.1.1. Requirements for Secure Inter-Server Copy 1027 Inter-server copy is driven by several requirements: 1029 o The specification MUST NOT mandate an inter-server copy protocol. 1030 There are many ways to copy data. Some will be more optimal than 1031 others depending on the situation that exists between a source and 1032 destination server. For example the source and destination 1033 servers might be two nodes sharing a common file system format for 1034 the source and destination file systems. Thus the source and 1035 destination are in an ideal position to efficiently render the 1036 image of the source file to the destination file by replicating 1037 the file system formats at the block level. For example, the 1038 source and destination might be two nodes sharing a common storage 1039 area network, and thus there is no need to copy any data at all, 1040 and instead ownership of the file and its contents simply gets re- 1041 assigned to the destination. 1043 o The specification MUST provide guidance for using NFSv4.x as a 1044 copy protocol. For those source and destination servers willing 1045 to use NFSv4.x there are specific security considerations that 1046 this specification can and does address. 1048 o The specification MUST NOT mandate pre-configuration between the 1049 source and destination server. Requiring that the source and 1050 destination first have a "copying relationship" increases the 1051 administrative burden. However the specification MUST NOT 1052 preclude implementations that require pre-configuration. 1054 o The specification MUST NOT mandate a trust relationship between 1055 the source and destination server. The NFSv4 security model 1056 requires mutual authentication between a principal on an NFS 1057 client and a principal on an NFS server. This model MUST continue 1058 with the introduction of COPY. 1060 5.1.2. Inter-Server Copy with RPCSEC_GSSv3 1062 When the client sends a COPY_NOTIFY to the source server to expect 1063 the destination to attempt to copy data from the source server, it is 1064 expected that this copy is being done on behalf of the principal 1065 (called the "user principal") that sent the RPC request that encloses 1066 the COMPOUND procedure that contains the COPY_NOTIFY operations. The 1067 user principal is identified by the RPC credentials. The problem is 1068 how can the user principal provide an authorization that directs the 1069 source to allow the destination to perform the copy in a manner that 1070 lets the source properly authenticate the destination's copy, and 1071 without allowing the destination to exceed its authorization? 1073 One way would be to send delegated credentials of the client's user 1074 principal to the destination server. The destination would then 1075 authenticate as the user principal. If the destination were using 1076 the NFSv4 protocol to perform the copy, then the source server would 1077 authenticate the destination server as the user principal, and the 1078 file copy could securely proceed. However, this approach would allow 1079 the destination server to copy other files. The user principal would 1080 have to trust the destination server to not do so. This is counter 1081 to the requirements, and so is not presented here. Instead an 1082 approach using RPCSEC_GSSv3 [RPCSEC_GSSv3] privileges is proposed. 1084 One of the stated applications of the proposed RPCSEC_GSSv3 protocol 1085 is compound client host and user authentication [+ privilege 1086 assertion]. For inter-server file copy, we require compound NFS 1087 server host and user authentication [+ privilege assertion]. The 1088 distinction between the two is one without meaning. 1090 RPCSEC_GSSv3 introduces the notion of privileges. We define three 1091 privileges: 1093 copy_from_auth: A user principal is authorizing a source principal 1094 ("nfs@") to allow a destination principal ("nfs@ 1095 ") to copy a file from the source to the destination. 1096 This privilege is established on the source server before the user 1097 principal sends a COPY_NOTIFY operation to the source server. 1099 typedef string secret4<>; 1101 struct copy_from_auth_priv { 1102 secret4 cfap_shared_secret; 1103 netloc4 cfap_destination; 1104 /* the NFSv4 user name that the user principal maps to */ 1105 utf8str_mixed cfap_username; 1106 /* equal to seq_num of rpc_gss_cred_vers_3_t */ 1107 unsigned int cfap_seq_num; 1108 }; 1110 cap_shared_secret is a secret value the user principal generates. 1112 copy_to_auth: A user principal is authorizing a destination 1113 principal ("nfs@") to allow it to copy a file from 1114 the source to the destination. This privilege is established on 1115 the destination server before the user principal sends a COPY 1116 operation to the destination server. 1118 struct copy_to_auth_priv { 1119 /* equal to cfap_shared_secret */ 1120 secret4 ctap_shared_secret; 1121 netloc4 ctap_source; 1122 /* the NFSv4 user name that the user principal maps to */ 1123 utf8str_mixed ctap_username; 1124 /* equal to seq_num of rpc_gss_cred_vers_3_t */ 1125 unsigned int ctap_seq_num; 1126 }; 1128 ctap_shared_secret is a secret value the user principal generated 1129 and was used to establish the copy_from_auth privilege with the 1130 source principal. 1132 copy_confirm_auth: A destination principal is confirming with the 1133 source principal that it is authorized to copy data from the 1134 source on behalf of the user principal. When the inter-server 1135 copy protocol is NFSv4, or for that matter, any protocol capable 1136 of being secured via RPCSEC_GSSv3 (i.e. any ONC RPC protocol), 1137 this privilege is established before the file is copied from the 1138 source to the destination. 1140 struct copy_confirm_auth_priv { 1141 /* equal to GSS_GetMIC() of cfap_shared_secret */ 1142 opaque ccap_shared_secret_mic<>; 1143 /* the NFSv4 user name that the user principal maps to */ 1144 utf8str_mixed ccap_username; 1145 /* equal to seq_num of rpc_gss_cred_vers_3_t */ 1146 unsigned int ccap_seq_num; 1147 }; 1149 5.1.2.1. Establishing a Security Context 1151 When the user principal wants to COPY a file between two servers, if 1152 it has not established copy_from_auth and copy_to_auth privileges on 1153 the servers, it establishes them: 1155 o The user principal generates a secret it will share with the two 1156 servers. This shared secret will be placed in the 1157 cfap_shared_secret and ctap_shared_secret of the appropriate 1158 privilege data types, copy_from_auth_priv, and copy_to_auth_priv. 1160 o An instance of copy_from_auth_priv is filled in with the shared 1161 secret, the destination server, and the NFSv4 user id of the user 1162 principal. It will be sent with an RPCSEC_GSS3_CREATE procedure, 1163 and so cfap_seq_num it set to the seq_num of the credential of the 1164 RPCSEC_GSS3_CREATE procedure. Because cfap_shared_secret is a 1165 secret, after XDR encoding copy_from_auth_priv, GSS_Wrap() (with 1166 privacy) is invoked on copy_from_auth_priv. The 1167 RPCSEC_GSS3_CREATE procedure's arguments are: 1169 struct { 1170 rpc_gss3_gss_binding *compound_binding; 1171 rpc_gss3_chan_binding *chan_binding_mic; 1172 rpc_gss3_assertion assertions<>; 1173 rpc_gss3_extension extensions<>; 1174 } rpc_gss3_create_args; 1176 The string "copy_from_auth" is placed in assertions[0].privs. The 1177 output of GSS_Wrap() is placed in extensions[0].data. The field 1178 extensions[0].critical is set to TRUE. The source server calls 1179 GSS_Unwrap() on the privilege, and verifies that the seq_num 1180 matches the credential. It then verifies that the NFSv4 user id 1181 being asserted matches the source server's mapping of the user 1182 principal. If it does, the privilege is established on the source 1183 server as: <"copy_from_auth", user id, destination>. The 1184 successful reply to RPCSEC_GSS3_CREATE has: 1186 struct { 1187 opaque handle<>; 1188 rpc_gss3_chan_binding *chan_binding_mic; 1189 rpc_gss3_assertion granted_assertions<>; 1190 rpc_gss3_assertion server_assertions<>; 1191 rpc_gss3_extension extensions<>; 1192 } rpc_gss3_create_res; 1194 The field "handle" is the RPCSEC_GSSv3 handle that the client will 1195 use on COPY_NOTIFY requests involving the source and destination 1196 server. granted_assertions[0].privs will be equal to 1197 "copy_from_auth". The server will return a GSS_Wrap() of 1198 copy_to_auth_priv. 1200 o An instance of copy_to_auth_priv is filled in with the shared 1201 secret, the source server, and the NFSv4 user id. It will be sent 1202 with an RPCSEC_GSS3_CREATE procedure, and so ctap_seq_num it set 1203 to the seq_num of the credential of the RPCSEC_GSS3_CREATE 1204 procedure. Because ctap_shared_secret is a secret, after XDR 1205 encoding copy_to_auth_priv, GSS_Wrap() is invoked on 1206 copy_to_auth_priv. The RPCSEC_GSS3_CREATE procedure's arguments 1207 are: 1209 struct { 1210 rpc_gss3_gss_binding *compound_binding; 1211 rpc_gss3_chan_binding *chan_binding_mic; 1212 rpc_gss3_assertion assertions<>; 1213 rpc_gss3_extension extensions<>; 1214 } rpc_gss3_create_args; 1216 The string "copy_to_auth" is placed in assertions[0].privs. The 1217 output of GSS_Wrap() is placed in extensions[0].data. The field 1218 extensions[0].critical is set to TRUE. After unwrapping, 1219 verifying the seq_num, and the user principal to NFSv4 user ID 1220 mapping, the destination establishes a privilege of 1221 <"copy_to_auth", user id, source>. The successful reply to 1222 RPCSEC_GSS3_CREATE has: 1224 struct { 1225 opaque handle<>; 1226 rpc_gss3_chan_binding *chan_binding_mic; 1227 rpc_gss3_assertion granted_assertions<>; 1228 rpc_gss3_assertion server_assertions<>; 1229 rpc_gss3_extension extensions<>; 1230 } rpc_gss3_create_res; 1232 The field "handle" is the RPCSEC_GSSv3 handle that the client will 1233 use on COPY requests involving the source and destination server. 1234 The field granted_assertions[0].privs will be equal to 1235 "copy_to_auth". The server will return a GSS_Wrap() of 1236 copy_to_auth_priv. 1238 5.1.2.2. Starting a Secure Inter-Server Copy 1240 When the client sends a COPY_NOTIFY request to the source server, it 1241 uses the privileged "copy_from_auth" RPCSEC_GSSv3 handle. 1242 cna_destination_server in COPY_NOTIFY MUST be the same as the name of 1243 the destination server specified in copy_from_auth_priv. Otherwise, 1244 COPY_NOTIFY will fail with NFS4ERR_ACCESS. The source server 1245 verifies that the privilege <"copy_from_auth", user id, destination> 1246 exists, and annotates it with the source filehandle, if the user 1247 principal has read access to the source file, and if administrative 1248 policies give the user principal and the NFS client read access to 1249 the source file (i.e. if the ACCESS operation would grant read 1250 access). Otherwise, COPY_NOTIFY will fail with NFS4ERR_ACCESS. 1252 When the client sends a COPY request to the destination server, it 1253 uses the privileged "copy_to_auth" RPCSEC_GSSv3 handle. 1255 ca_source_server in COPY MUST be the same as the name of the source 1256 server specified in copy_to_auth_priv. Otherwise, COPY will fail 1257 with NFS4ERR_ACCESS. The destination server verifies that the 1258 privilege <"copy_to_auth", user id, source> exists, and annotates it 1259 with the source and destination filehandles. If the client has 1260 failed to establish the "copy_to_auth" policy it will reject the 1261 request with NFS4ERR_PARTNER_NO_AUTH. 1263 If the client sends a COPY_REVOKE to the source server to rescind the 1264 destination server's copy privilege, it uses the privileged 1265 "copy_from_auth" RPCSEC_GSSv3 handle and the cra_destination_server 1266 in COPY_REVOKE MUST be the same as the name of the destination server 1267 specified in copy_from_auth_priv. The source server will then delete 1268 the <"copy_from_auth", user id, destination> privilege and fail any 1269 subsequent copy requests sent under the auspices of this privilege 1270 from the destination server. 1272 5.1.2.3. Securing ONC RPC Server-to-Server Copy Protocols 1274 After a destination server has a "copy_to_auth" privilege established 1275 on it, and it receives a COPY request, if it knows it will use an ONC 1276 RPC protocol to copy data, it will establish a "copy_confirm_auth" 1277 privilege on the source server, using nfs@ as the 1278 initiator principal, and nfs@ as the target principal. 1280 The value of the field ccap_shared_secret_mic is a GSS_VerifyMIC() of 1281 the shared secret passed in the copy_to_auth privilege. The field 1282 ccap_username is the mapping of the user principal to an NFSv4 user 1283 name ("user"@"domain" form), and MUST be the same as ctap_username 1284 and cfap_username. The field ccap_seq_num is the seq_num of the 1285 RPCSEC_GSSv3 credential used for the RPCSEC_GSS3_CREATE procedure the 1286 destination will send to the source server to establish the 1287 privilege. 1289 The source server verifies the privilege, and establishes a 1290 <"copy_confirm_auth", user id, destination> privilege. If the source 1291 server fails to verify the privilege, the COPY operation will be 1292 rejected with NFS4ERR_PARTNER_NO_AUTH. All subsequent ONC RPC 1293 requests sent from the destination to copy data from the source to 1294 the destination will use the RPCSEC_GSSv3 handle returned by the 1295 source's RPCSEC_GSS3_CREATE response. 1297 Note that the use of the "copy_confirm_auth" privilege accomplishes 1298 the following: 1300 o if a protocol like NFS is being used, with export policies, export 1301 policies can be overridden in case the destination server as-an- 1302 NFS-client is not authorized 1304 o manual configuration to allow a copy relationship between the 1305 source and destination is not needed. 1307 If the attempt to establish a "copy_confirm_auth" privilege fails, 1308 then when the user principal sends a COPY request to destination, the 1309 destination server will reject it with NFS4ERR_PARTNER_NO_AUTH. 1311 5.1.2.4. Securing Non ONC RPC Server-to-Server Copy Protocols 1313 If the destination won't be using ONC RPC to copy the data, then the 1314 source and destination are using an unspecified copy protocol. The 1315 destination could use the shared secret and the NFSv4 user id to 1316 prove to the source server that the user principal has authorized the 1317 copy. 1319 For protocols that authenticate user names with passwords (e.g. HTTP 1320 [RFC2616] and FTP [RFC0959]), the nfsv4 user id could be used as the 1321 user name, and an ASCII hexadecimal representation of the 1322 RPCSEC_GSSv3 shared secret could be used as the user password or as 1323 input into non-password authentication methods like CHAP [RFC1994]. 1325 5.1.3. Inter-Server Copy via ONC RPC but without RPCSEC_GSSv3 1327 ONC RPC security flavors other than RPCSEC_GSSv3 MAY be used with the 1328 server-side copy offload operations described in this document. In 1329 particular, host-based ONC RPC security flavors such as AUTH_NONE and 1330 AUTH_SYS MAY be used. If a host-based security flavor is used, a 1331 minimal level of protection for the server-to-server copy protocol is 1332 possible. 1334 In the absence of strong security mechanisms such as RPCSEC_GSSv3, 1335 the challenge is how the source server and destination server 1336 identify themselves to each other, especially in the presence of 1337 multi-homed source and destination servers. In a multi-homed 1338 environment, the destination server might not contact the source 1339 server from the same network address specified by the client in the 1340 COPY_NOTIFY. This can be overcome using the procedure described 1341 below. 1343 When the client sends the source server the COPY_NOTIFY operation, 1344 the source server may reply to the client with a list of target 1345 addresses, names, and/or URLs and assign them to the unique triple: 1346 . If the destination uses 1347 one of these target netlocs to contact the source server, the source 1348 server will be able to uniquely identify the destination server, even 1349 if the destination server does not connect from the address specified 1350 by the client in COPY_NOTIFY. 1352 For example, suppose the network topology is as shown in Figure 3. 1353 If the source filehandle is 0x12345, the source server may respond to 1354 a COPY_NOTIFY for destination 10.11.78.56 with the URLs: 1356 nfs://10.11.78.18//_COPY/10.11.78.56/_FH/0x12345 1358 nfs://192.168.33.18//_COPY/10.11.78.56/_FH/0x12345 1360 The client will then send these URLs to the destination server in the 1361 COPY operation. Suppose that the 192.168.33.0/24 network is a high 1362 speed network and the destination server decides to transfer the file 1363 over this network. If the destination contacts the source server 1364 from 192.168.33.56 over this network using NFSv4.1, it does the 1365 following: 1367 COMPOUND { PUTROOTFH, LOOKUP "_COPY" ; LOOKUP "10.11.78.56"; LOOKUP 1368 "_FH" ; OPEN "0x12345" ; GETFH } 1370 The source server will therefore know that these NFSv4.1 operations 1371 are being issued by the destination server identified in the 1372 COPY_NOTIFY. 1374 5.1.4. Inter-Server Copy without ONC RPC and RPCSEC_GSSv3 1376 The same techniques as Section 5.1.3, using unique URLs for each 1377 destination server, can be used for other protocols (e.g. HTTP 1378 [RFC2616] and FTP [RFC0959]) as well. 1380 6. IANA Considerations 1382 This document has no actions for IANA. 1384 7. References 1386 7.1. Normative References 1388 [NFSv4.1] Shepler, S., et al., "NFS Version 4 Minor Version 1 (Work 1389 In Progress)", draft-ietf-nfsv4-minorversion1 , 2008. 1391 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 1392 Requirement Levels", BCP 14, RFC 2119, March 1997. 1394 [RFC3530] Shepler, S., Callaghan, B., Robinson, D., Thurlow, R., 1395 Beame, C., Eisler, M., and D. Noveck, "Network File System 1396 (NFS) version 4 Protocol", RFC 3530, April 2003. 1398 [RFC3986] Berners-Lee, T., Fielding, R., and L. Masinter, "Uniform 1399 Resource Identifier (URI): Generic Syntax", STD 66, 1400 RFC 3986, January 2005. 1402 [RPCSEC_GSSv3] 1403 Williams, N., "Remote Procedure Call (RPC) Security 1404 Version 3 (Work In Progress)", 1405 draft-williams-rpcsecgssv3 , 2008. 1407 7.2. Informational References 1409 [RFC0959] Postel, J. and J. Reynolds, "File Transfer Protocol", 1410 STD 9, RFC 959, October 1985. 1412 [RFC1994] Simpson, W., "PPP Challenge Handshake Authentication 1413 Protocol (CHAP)", RFC 1994, August 1996. 1415 [RFC2616] Fielding, R., Gettys, J., Mogul, J., Frystyk, H., 1416 Masinter, L., Leach, P., and T. Berners-Lee, "Hypertext 1417 Transfer Protocol -- HTTP/1.1", RFC 2616, June 1999. 1419 Appendix A. Acknowledgments 1421 Tom Talpey co-authored an unpublished version of this document. We 1422 thank Tom for his contributions, especially with regards to the 1423 asynchronous completion callback mechanism. 1425 This document was reviewed by a number of individuals. We would like 1426 to thank Pranoop Erasani, Tom Haynes, Arthur Lent, Trond Myklebust, 1427 Dave Noveck, and Nico Williams for their input and advice. 1429 Authors' Addresses 1431 James Lentini 1432 NetApp 1433 1601 Trapelo Rd, Suite 16 1434 Waltham, MA 02451 1435 USA 1437 Phone: +1 781-768-5359 1438 Email: jlentini@netapp.com 1439 Mike Eisler 1440 NetApp 1441 5765 Chase Point Circle 1442 Colorado Springs, CO 80919 1443 USA 1445 Phone: +1 719-599-9026 1446 Email: mike@eisler.com 1447 URI: http://www.eisler.com 1449 Rahul Iyer 1450 NetApp 1451 475 East Java Drive 1452 Sunnyvale, CA 94089 1453 USA 1455 Phone: +1 408-822-3980 1456 Email: iyer@netapp.com 1458 Deepak Kenchammana 1459 NetApp 1460 475 East Java Drive 1461 Sunnyvale, CA 94089 1462 USA 1464 Phone: +1 408-822-4765 1465 Email: kencham@netapp.com 1467 Anshul Madan 1468 Carnegie Mellon University 1469 The Institute for Software Research, Wean Hall 1470 5000 Forbes Avenue 1471 Pittsburgh, PA 15213 1472 USA 1474 Email: amadan@andrew.cmu.edu