idnits 2.17.1 draft-satran-iscsi-00.txt: ** The Abstract section seems to be numbered Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- ** Looks like you're using RFC 2026 boilerplate. This must be updated to follow RFC 3978/3979, as updated by RFC 4748. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- ** The document seems to lack a 1id_guidelines paragraph about 6 months document validity -- however, there's a paragraph with a matching beginning. Boilerplate error? ** The document seems to lack a 1id_guidelines paragraph about the list of Shadow Directories. == No 'Intended status' indicated for this document; assuming Proposed Standard == It seems as if not all pages are separated by form feeds - found 0 form feeds but 46 pages Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- ** The abstract seems to contain references ([SAM2]), which it shouldn't. Please replace those with straight textual mentions of the documents in question. == There are 3 instances of lines with non-RFC2606-compliant FQDNs in the document. ** The document seems to lack a both a reference to RFC 2119 and the recommended RFC 2119 boilerplate, even if it appears to use RFC 2119 keywords. RFC 2119 keyword, line 149: '..., the initiator and target MAY wish to...' RFC 2119 keyword, line 157: '... has occured, the target MAY authorize...' RFC 2119 keyword, line 203: '...ection shutdowns MUST only occur when ...' RFC 2119 keyword, line 204: '...ection. A target SHOULD respond rapidl...' RFC 2119 keyword, line 216: '...ived the FIN, it SHOULD not add any mo...' Miscellaneous warnings: ---------------------------------------------------------------------------- == Using lowercase 'not' together with uppercase 'MUST', 'SHALL', 'SHOULD', or 'RECOMMENDED' is not an accepted usage according to RFC 2119. Please use uppercase 'NOT' together with RFC 2119 keywords (if that is what you mean). Found 'SHOULD not' in this paragraph: A target may wish to close a TCP data connection. Once an initiator has received the FIN, it SHOULD not add any more data to be sent onto that connection and should close its half of the connection when it is done sending the pending data. -- The document seems to lack a disclaimer for pre-RFC5378 work, but may have content which was first submitted before 10 November 2008. If you have contacted all the original authors and they are all willing to grant the BCP78 rights to the IETF Trust, then this is fine, and you can ignore this comment. If not, you may need to add the pre-RFC5378 disclaimer. (See the Legal Provisions document at https://trustee.ietf.org/license-info for more information.) -- The document date (February 2000) is 8838 days in the past. Is this intentional? Checking references for intended status: Proposed Standard ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) -- Missing reference section? 'SAM2' on line 1593 looks like a reference -- Missing reference section? 'TLS' on line 1710 looks like a reference -- Missing reference section? 'RDMA' on line 1592 looks like a reference -- Missing reference section? 'ALTC' on line 1596 looks like a reference -- Missing reference section? 'CAM' on line 1597 looks like a reference -- Missing reference section? 'CRC' on line 1598 looks like a reference -- Missing reference section? 'RFC793' on line 1599 looks like a reference -- Missing reference section? 'RFC1122' on line 1600 looks like a reference -- Missing reference section? 'SBC' on line 1602 looks like a reference -- Missing reference section? 'SCSI2' on line 1603 looks like a reference -- Missing reference section? 'SPC' on line 1604 looks like a reference Summary: 6 errors (**), 0 flaws (~~), 4 warnings (==), 13 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 1 Internet-Draft J. Satran 2 D. Smith 3 Expires 14 August 2000 K. Meth 4 IBM 5 C. Sapuntzakis 6 Cisco Systems 7 M. Toledano 8 P. Sarkar 9 C. Fuente 10 IBM 11 E. Zeidner 12 SanGate 13 February 2000 15 SCSI/TCP (SCSI over TCP) 17 Status of this Memo 19 This document is an Internet-Draft and is in full conformance with 20 all provisions of Section 10 of RFC2026. 22 Internet-Drafts are working documents of the Internet Engineering 23 Task Force (IETF), its areas, and its working groups. Note that 24 other groups may also distribute working documents as Internet- 25 Drafts. 27 Internet-Drafts are draft documents valid for a maximum of six 28 months and may be updated, replaced, or obsoleted by other docu- 29 ments at any time. It is inappropriate to use Internet-Drafts as 30 reference material or to cite them other than as "work in pro- 31 gress." 33 The list of current Internet-Drafts can be accessed at 34 http://www.ietf.org/ietf/1id-abstracts.txt 36 The list of Internat-Draft Shadow Directories can be accessed at 37 http://www.ietf.org/shadow.html. 39 SCSI/TCP February 2000 41 Table of Contents 43 1. Abstract 44 2. Overview 45 2.1. SCSI Concepts 46 2.2. SCSI/TCP Functional Overview 47 2.3. SCSI/TCP Login 48 2.4. SCSI/TCP Full Feature Phase 49 2.5. SCSI/TCP Connection Termination 50 2.6. Naming 51 3. Message Formats 52 3.1. Template Header 53 3.2. SCSI Command 54 3.3. SCSI Response 55 3.4. Asynchronous Event 56 3.5. SCSI Task Management Message 57 3.6. SCSI Task Management Response 58 3.7. Ready To Transfer (RTT) 59 3.8. SCSI Data 60 3.9. Text Command 61 3.10. Text Response 62 3.11. Login Command 63 3.12. Login Response 64 3.13. Open Data Connections Command 65 3.14. Open Data Connections Response 66 3.15. Ping Command 67 3.16. Ping Response 68 3.17. Third Party Commands 69 3.18. Opcode Not Understood 70 4. Error Handling SCSI/TCP 71 5. Notes to Implementors 72 5.1. Small TCP Segments 73 5.2. Multiple Network Adapters 74 5.3. Autosense 75 5.4. TCP RDMA option 76 5.5. Data Connections Options 77 6. Security Considerations 78 6.1. Data Integrity 79 6.2. Login Process 80 6.3. IANA Considerations 81 7. Authors' Addresses 82 8. References and Bibliography 83 9. Appendix A - Examples 84 9.1. Read operation example 85 9.2. Write operation example 86 10. Appendix B - Login/Text keys 88 SCSI/TCP February 2000 90 1. Abstract 92 The Small Computer Systems Interface (SCSI) is a popular family of 93 protocols for communicating with I/O devices, especially storage 94 devices. 96 This memo describes a transport protocol for SCSI that operates on 97 top of TCP. 99 The SCSI/TCP protocol aims to be fully compliant with the require- 100 ments laid out in the SCSI Architecture Model - 2 [SAM2] document. 102 2. Overview 104 2.1. SCSI Concepts 106 The endpoint of most SCSI commands is a "logical unit" (LUN). Exam- 107 ples of logical units include hard drives, tape drives, CD and DVD 108 drives, even printers and processors. 110 A "target" is a collection of logical units and is directly 111 addressable on the network. The target corresponds to the server in 112 the client-server model. 114 An "initiator" creates and sends SCSI commands to the target. The 115 initiator corresponds to the client in the client-server model. 117 A "task" is a linked set of SCSI commands. Some LUNs support multi- 118 ple simultaneous tasks. The target uses a "task tag" to distinguish 119 between simultaneous tasks. Only one command in a task can be out- 120 standing at any given time. 122 A SCSI command results in a data phase and a response phase. In the 123 data phase, information travels either from the initiator to the 124 target, as in a WRITE command, or from target to initiator, as in a 125 READ command. In the response phase, the target returns the final 126 status of the operation, including any errors. A response ter- 127 minates a SCSI command. 129 2.2. SCSI/TCP Functional Overview 131 Communication between initiator and target occurs over one or more 132 TCP connections. The first TCP connection opened is designated a 133 control connection and used for sending control messages, SCSI com- 134 mands, and parameters. Additional connections may be opened for 135 sending data from the SCSI data phases. 137 SCSI/TCP February 2000 139 2.3. SCSI/TCP Login 141 The purpose of SCSI/TCP login is to create a connection, authenti- 142 cate the parties, and authorize the initiator to send SCSI com- 143 mands. 145 The targets listen on a well-known TCP port for incoming connec- 146 tions. The initiator begins the login process by connecting to 147 that well-known TCP port. 149 As part of the login process, the initiator and target MAY wish to 150 authenticate each other. This can occur in many different ways. For 151 example, the endpoints may wish to check the IP address of the 152 other party. If the TCP connection uses transport layer security 153 [TLS], certificates may be used to identify the endpoints. Also, 154 SCSI/TCP includes commands for identifying the initiator and pass- 155 ing an authenticator to the target (see Appendix B). 157 Once suitable authentication has occured, the target MAY authorize 158 the initiator to send SCSI commands. How the target chooses to 159 authorize an initiator is beyond the scope of this document. 161 The target indicates a succesful authentication and authorization 162 by sending a login response with "accept login". 164 After authentication and authorization, other parameters may be 165 negotiated using the highly extensible Text Command message that 166 allows arbitrary key:value pairs to be passed. 168 Finally, if any other TCP control or data connections between the 169 initiator and target are currently open, they will be forced closed 170 (TCP RST), flushing unacknowledged data. 172 2.4. SCSI/TCP Full Feature Phase 174 Once the initiator is authorized to do so, the connection is in 175 SCSI/TCP full feature phase. The initiator may send SCSI commands 176 to the various LUNs on the target. 178 SCSI commands are encapsulated in messages that go over the control 179 connection. 181 Data phases associated with SCSI commands go over separate data 182 connections. Initiators may explicitly request the establishment of 183 data connections to targets using the "Open Data Connections" mes- 184 sage. A Target responds by granting some number of data connec- 185 tions, (to be established using the well known SCSI/TCP data port), 186 and by providing a cookie for the initiator to produce upon 188 SCSI/TCP February 2000 190 establishment of its data connections. 192 The targets listen on another well-known TCP port for incoming 193 SCSI/TCP data connections. The initiator connects to the well-known 194 SCSI/TCP data connection port and provides the cookie it received 195 in the "Open Data Connections" response. The cookie occupies the 196 first 8 bytes of data sent by the initiator through the data con- 197 nection. The target uses the cookie to match a newly established 198 data channel with its corresponding control channel. 200 2.5. SCSI/TCP Connection Termination 202 Graceful connection shutdowns are done by sending TCP FINs. Grace- 203 ful connection shutdowns MUST only occur when there are no out- 204 standing tasks on the connection. A target SHOULD respond rapidly 205 to a FIN from the initiator by closing its half of the connection. 207 Usually, the initiator will initiate the closing of data channels 208 when it no longer needs them for its data transfer operations. 209 Similarly, an initiator may initiate the closing of its control 210 channel when it has finished all operations with the target device. 212 The closing of one data channel has no effect on other data chan- 213 nels connecting the initiator and the target. 215 A target may wish to close a TCP data connection. Once an initiator 216 has received the FIN, it SHOULD not add any more data to be sent 217 onto that connection and should close its half of the connection 218 when it is done sending the pending data. 220 In the case where a control channel is closed, the target should 221 clean up all of its state associated with the corresponding initia- 222 tor; all outstanding tasks are cancelled and all resources that 223 were allocated for the initiator can be freed. Any open data con- 224 nections should be forcibly closed (using TCP RST). 226 2.6. Naming 228 Domain names, not IPv4 addresses, identify initiator and target 229 interfaces. 231 In order to express an address that is to be resolved locally 232 (without a DNS server), standard conventions are to be used. For 233 example, a domain name of the form d.c.b.a.in-addr.arpa. might 234 represent the IPv4 address a.b.c.d. 236 SCSI/TCP February 2000 238 3. Message Formats 240 All multi-byte integers specified in formats defined in this docu- 241 ment are to be represented in network byte order (i.e., big 242 endian). 244 3.1. Template Header 246 All SCSI/TCP messages and responses have a header of the same 247 length (consisting of 40 bytes). Additional data may be added, as 248 necessary, beginning with byte 40. The fields of Opcode and Length 249 appear in all message and response headers. The other most commonly 250 used fields are Initiator Task Tag, Logical Unit Number, and Flags, 251 which, when used, always appear in the same location of the header. 253 Byte / 0 | 1 | 2 | 3 | 254 / | | | | 255 |7 6 5 4 3 2 1 0|7 6 5 4 3 2 1 0|7 6 5 4 3 2 1 0|7 6 5 4 3 2 1 0| 256 +---------------+---------------+---------------+---------------+ 257 0| Opcode | Reserved (0) | Length of Data After Header | 258 +---------------+---------------+---------------+---------------+ 259 4| Initiator Task Tag | 260 +---------------+---------------+---------------+---------------+ 261 8| Logical Unit Number (LUN) | 262 + + 263 12| | 264 +---------------+---------------+---------------+---------------+ 265 16| Flags | Reserved (0) | 266 +---------------+---------------+---------------+---------------+ 267 20/ Opcode-specific data / 268 +/ / 269 +---------------+---------------+---------------+---------------+ 270 40 272 3.1.1. Opcode 274 The Opcode indicates which SCSI/TCP type of message or response is 275 encapsulated by the header. Valid opcodes for messages (sent by 276 initiator to target) are: 277 0x00 Ping Command (from initiator to target) 278 0x01 SCSI Command (encapsulates a SCSI Command Block) 279 0x02 SCSI Task Management Message 280 0x03 Login Command 281 0x04 Open Data Connections Command 282 0x05 Text Command 284 SCSI/TCP February 2000 286 Valid opcodes for responses (sent by target to initiator) are: 287 0x80 Ping Response (from target to initiator) 288 0x81 SCSI Response (contains SCSI status and possibly sense 289 informaton or other response information) 290 0x82 SCSI Task Management Response 291 0x83 Login Response 292 0x84 Open Data Connections Response 293 0x85 Text Response 294 0x86 Ready To Transfer (RTT - sent by target to initiator when 295 it is ready to receive data from initiator) 296 0x87 Asynchronous Event (sent by target to initiator to indi- 297 cate certain special conditions) 298 0x88 Opcode Not Understood 300 3.1.2. Length 302 The Length field indicates the number of bytes, beyond the 40 byte 303 header, that are being sent together with this message header. It 304 is anticipated that most SCSI/TCP messages and responses (not 305 counting data transfer messages) will not need more than the 40 306 byte header, and hence the Length field will contain the value 0. 307 All messages using this header are sent over the control channel. 308 Bulk data transfers are performed over the data channels, and have 309 a different header format. 311 Large amounts of data accompanying a SCSI command should not be 312 sent over the control channel. If too much data is sent over the 313 control channel, there is the possibility that it would fill the 314 TCP window, thus preventing other critical control commands from 315 passing through the control channel. The control channel should be 316 kept open at all times so that important messages can always pass 317 through. (These may include a message to cancel a data transfer or 318 to reset a device that has somehow entered a bad state). The Length 319 field is, therefore, intentionally limited to 16 bits, allowing 320 only up to 64KB of data to be passed with any particular control 321 message. Any large data transfers for READ and WRITE operations 322 (including unsolicited WRITE operations) should be sent over the 323 data channels. 325 3.1.3. LUN 327 The LUN specifies the Logical Unit for which the command is tar- 328 geted. If the command does not relate to a Logical Unit, this 329 field is either ignored or may be used for some other purpose. 330 According to [SAM2], a Logical Unit Number can take up to a 64-bit 331 field that identifies the Logical Unit within a target device. The 332 exact format of this field can be found in the [SAM2] document. 334 SCSI/TCP February 2000 336 3.1.4. Initiator Task Tag 338 The initiator assigns a Task Id (or tag) to each SCSI task that it 339 issues. This Tag is a initiator-wide unique identifier that can be 340 used to uniquely identify the Task. 342 3.1.5. Flags and additional information 344 These field have different meanings for different messages. 346 SCSI/TCP February 2000 348 3.2. SCSI Command 350 Byte / 0 | 1 | 2 | 3 | 351 / | | | | 352 |7 6 5 4 3 2 1 0|7 6 5 4 3 2 1 0|7 6 5 4 3 2 1 0|7 6 5 4 3 2 1 0| 353 +---------------+---------------+---------------+---------------+ 354 0| Opcode (0x01) | Reserved (0) | Length | 355 +---------------+---------------+---------------+---------------+ 356 4| Initiator Task Tag | 357 +---------------+---------------+---------------+---------------+ 358 8| Logical Unit Number (LUN) | 359 + + 360 12| | 361 +---------------+---------------+---------------+---------------+ 362 16|Rsrvd (0)|A|R|W|Rsrved(0)|ATTR | Reserved (0) | 363 +---------------+---------------+---------------+---------------+ 364 20| Expected Data Transfer Length | 365 +---------------+---------------+---------------+---------------+ 366 24| SCSI Command Block (SCB) | 367 + + 368 28| | 369 + + 370 32| | 371 + + 372 36| | 373 +---------------+---------------+---------------+---------------+ 374 40/ Additional Data (Command Dependent) / 375 +/ / 376 +---------------+---------------+---------------+---------------+ 378 3.2.1. Flags 380 The Flags field for a SCSI Command consists of two bytes. (In gen- 381 eral, one byte is used for data flow information while the other 382 byte is used for Task Attributes information.) 383 Byte 16 384 b0 (W) set when data is expected to flow from initiator to 385 target (write). 386 b1 (R) set when data is expected to flow from target to ini- 387 tiator (read). 388 b2 (A) set to turn off Autosense for this command (see 389 [SAM2]). 390 b3-7 not used (should be set to 0). 392 Autosense refers to the automatic return of sense data to the ini- 393 tiator in case a command did not complete successfully. If 395 SCSI/TCP February 2000 397 autosense is turned off, the initiator must explicitly request that 398 sense data be sent to it after some command has completed with a 399 CHECK CONDITION status. 400 Byte 17 401 b0-2 used to indicate Task Attributes. 402 b3-7 not used (should be set to 0). 404 3.2.2. Task Attributes 406 The Task Attribute field (ATTR) can have one of the following 407 integer values (see [SAM2] for details): 409 0 Untagged 410 1 Simple 411 2 Ordered 412 3 Head of Queue 413 4 ACA 415 3.2.3. Expected Data Transfer Length 417 The Expected Data Transfer Length field states the number of bytes 418 expected to be sent over the data channel for this SCSI operation. 419 (The SCSI command itself is sent over the control channel.) 421 For a WRITE operation, the initiator uses this field to specify the 422 number of bytes of data it expects to transfer for this operation 423 over the data channel(s) (not counting data headers). 425 For a READ operation, the initiator uses this field to specify the 426 number of bytes of data it expects the target to transfer to the 427 initiator over the data channel(s). 429 If no data will be transferred over the data channels for this SCSI 430 operation, this field should be set to 0. 432 If data is sent together with the SCSI command over the control 433 channel, the byte count should be included in the Length field 434 (bytes 2-3). 436 The target knows to expect data for this SCSI command over the data 437 channel by receiving a non-zero value in the Expected Data Transfer 438 Length field. 440 Note that large amounts of data should be sent exclusively over the 441 data channels so as not to clog the control channel. It is desired 443 SCSI/TCP February 2000 445 that the control channel be available at all times in order to be 446 able to send critical messages (such as to interrupt the current 447 data transfer). Upon completion of a data transfer, the target will 448 inform the initiator of how many bytes were actually processed 449 (sent or received) by the target. 451 3.2.4. SCSI Command Block (SCB) 453 There are 16 bytes in the SCB field, designed to accomodate the 454 largest currently defined SCB. 456 If, in the future, larger SCB's are allowed, the spill-over of the 457 SCB may extend beyond the 40-byte boundary, followed by the data or 458 parameters for the SCB. The target will use the SCSI/TCP Length 459 field plus the information in the SCB to figure out how many addi- 460 tional bytes are part of the SCB, with the remaining bytes serving 461 as the data and parameters of the SCB. 463 3.2.5. Command Data 465 Some SCSI commands require additional parameters or data to accom- 466 pany the SCSI command. This data may be placed beyond the 40-byte 467 boundary of the SCSI/TCP header. The Length field is set to the 468 length of this data beyond the 40-byte header. Note that the Length 469 field is intentionally limited to 2 bytes, thus limiting the amount 470 of data to 64K. 472 Any SCSI command whose data/parameters require more than 64K beyond 473 the 16 byte SCB must utilize one of the data connections to perform 474 the data transfer. 476 SCSI/TCP February 2000 478 3.3. SCSI Response 480 Byte / 0 | 1 | 2 | 3 | 481 / | | | | 482 |7 6 5 4 3 2 1 0|7 6 5 4 3 2 1 0|7 6 5 4 3 2 1 0|7 6 5 4 3 2 1 0| 483 +---------------+---------------+---------------+---------------+ 484 0| Opcode (0x81) | Reserved (0) | Length | 485 +---------------+---------------+---------------+---------------+ 486 4| Initiator Task Tag | 487 +---------------+---------------+---------------+---------------+ 488 8| Logical Unit Number (LUN) | 489 + + 490 12| | 491 +---------------+---------------+---------------+---------------+ 492 16| Rsrved(0) |O|U| Reserved (0) | Reserved (0) | 493 +---------------+---------------+---------------+---------------+ 494 20| Residual Count | 495 +---------------+---------------+---------------+---------------+ 496 24| Command Status|SCSI/TCP Status| Reserved (0) | 497 +---------------+---------------+---------------+---------------+ 498 28/ Reserved (0) / 499 +/ / 500 +---------------+---------------+---------------+---------------+ 501 40/ Response or Sense Data (optional) / 502 +/ / 503 +---------------+---------------+---------------+---------------+ 505 3.3.1. Flags 507 The SCSI Response has its own set of flags, that differs from the 508 flags for a SCSI Command. 509 Byte 16 510 b0 (U) set for Residual Underflow. In this case, the Resi- 511 dual Count indicates how many bytes were not transferred 512 out of those expected to be transferred. 513 b1 (O) set for Residual Overflow. In this case, the Residual 514 Count indicates how many bytes could not be transferred 515 because the initiator's Expected Data Transfer Length was 516 too small. 517 b2-7 not used (should be set to 0). 518 Bits 0 and 1 are mutually exclusive. 520 3.3.2. Residual Count 522 The Residual Count field is valid only in case either the Residual 523 Underflow bit or Residual Overflow bit is set. If neither bit is 525 SCSI/TCP February 2000 527 set, the Residual Count field will be 0. 529 If the Residual Underflow bit is set, the Residual Count indicates 530 how many bytes were not transferred out of those expected to be 531 transferred. 533 If the Residual Overflow bit is set, the Residual Count indicates 534 how many bytes could not be transferred because the initiator's 535 Expected Data Transfer Length was too small. 537 3.3.3. Command Status 539 The Command Status field is used to report the SCSI status of the 540 command (as specified in [SAM2]). 542 3.3.4. SCSI/TCP Status 544 The SCSI/TCP Status field is used to report the status of the com- 545 mand before it was sent to the LUN. The values are given below. 547 1 Non-existant LUN 549 3.3.5. Response or Sense Data 551 If Autosense was not disabled in the originating SCB and the Com- 552 mand Status was CHECK CONDITION (0x02), then the response field 553 will contain sense data for the failed command. 555 If the Command Status is Good (0x00) and there are no data streams 556 opened, then the Response Data field will contain data from the 557 data phase of the SCB. 559 The Length parameter specifies the number of bytes in this field. 560 If no error occured, and no data is needed for the response to the 561 SCSI Command the Length field is 0. 563 Note that if the Command Status was CHECK CONDITION but Autosense 564 was disabled, then sense data must be explicitly requested by the 565 initiator with a new SCSI command. 567 SCSI/TCP February 2000 569 3.4. Asynchronous Event 571 An Asynchronous Event may be sent from the target to the initiator 572 without corresponding to a particular command. The target specifies 573 the status for the event and sense data. 575 Byte / 0 | 1 | 2 | 3 | 576 / | | | | 577 |7 6 5 4 3 2 1 0|7 6 5 4 3 2 1 0|7 6 5 4 3 2 1 0|7 6 5 4 3 2 1 0| 578 +---------------+---------------+---------------+---------------+ 579 0| Opcode (0x87) | Reserved (0) | Length | 580 +---------------+---------------+---------------+---------------+ 581 4| Reserved (0) | 582 +---------------+---------------+---------------+---------------+ 583 8| Logical Unit Number (LUN) | 584 + + 585 12| | 586 +---------------+---------------+---------------+---------------+ 587 16| Reserved (0) | 588 + + 589 20| | 590 +---------------+---------------+---------------+---------------+ 591 24| Command Status|SCSI/TCP Status| Reserved (0) | 592 +---------------+---------------+---------------+---------------+ 593 28|Event Indicator| Reserved (0) | 594 +---------------+---------------+---------------+---------------+ 595 32| Reserved (0) | 596 + + 597 36| | 598 +---------------+---------------+---------------+---------------+ 599 40/ Sense Data / 600 +/ / 601 +---------------+---------------+---------------+---------------+ 603 3.4.1. SCSI/TCP Status 605 Some Asynchronous Events are strictly related to SCSI/TCP while 606 others are related to SAM-2. The codes returned for SCSI/TCP Asyn- 607 chronous Events are: 609 2 Target is being reset. 610 3 Expired cookie was used to establish a data connection. 612 3.4.2. Event Indicator 614 The following values are defined. (See [SAM2] for details.) 616 SCSI/TCP February 2000 618 1 An error condition was encountered after command comple- 619 tion. 620 2 A newly initialized device is available. 621 3 Some other type of unit attention condition has occured. 622 4 An asynchronous event has occured. 624 Sense Data accompanying the report identifies the condition. The 625 Length parameter is set to the length of the Sense Data. 627 SCSI/TCP February 2000 629 3.5. SCSI Task Management Message 631 Byte / 0 | 1 | 2 | 3 | 632 / | | | | 633 |7 6 5 4 3 2 1 0|7 6 5 4 3 2 1 0|7 6 5 4 3 2 1 0|7 6 5 4 3 2 1 0| 634 +---------------+---------------+---------------+---------------+ 635 0| Opcode (0x02) | Reserved (0) | Length | 636 +---------------+---------------+---------------+---------------+ 637 4| Initiator Task Tag | 638 +---------------+---------------+---------------+---------------+ 639 8| Logical Unit Number (LUN) | 640 + + 641 12| | 642 +---------------+---------------+---------------+---------------+ 643 16| Msg indicator | Reserved (0) | 644 +---------------+---------------+---------------+---------------+ 645 20/ Reserved (0) / 646 +/ / 647 +---------------+---------------+---------------+---------------+ 648 40 650 3.5.1. Msg Indicator 652 The Task Management functions provide an initiator with a way to 653 explicitly control the execution of one or more Tasks. The Task 654 Management functions are summarized as follows (for a more detailed 655 description see the [SAM2] document): 656 1 Abort Task---aborts the task identified by the Task Tag 657 field. 658 2 Abort Task Set---aborts all Tasks issued by this initia- 659 tor on the Logical Unit. 660 3 Clear ACA---clears the Auto Contingent Allegiance condi- 661 tion. 662 4 Clear Task Set---Aborts all Tasks (from all initiators) 663 for the Logical Unit. 664 5 Logical Unit Reset. 665 6 Target Reset. 667 For the functions above except , a SCSI Task Manage- 668 ment Response is returned, using the Initiator Task Tag to identify 669 the operation for which it is responding. 671 For the function, the target cancels all pending 672 operations. The target may send an Asynchronous Event to all 673 attached initiators notifying them that the target is being reset. 674 The target then closes all of its TCP connections. 676 SCSI/TCP February 2000 678 3.6. SCSI Task Management Response 680 Byte / 0 | 1 | 2 | 3 | 681 / | | | | 682 |7 6 5 4 3 2 1 0|7 6 5 4 3 2 1 0|7 6 5 4 3 2 1 0|7 6 5 4 3 2 1 0| 683 +---------------+---------------+---------------+---------------+ 684 0| Opcode (0x82) | Reserved (0) | Length | 685 +---------------+---------------+---------------+---------------+ 686 4| Initiator Task Tag | 687 +---------------+---------------+---------------+---------------+ 688 8| Logical Unit Number (LUN) | 689 + + 690 12| | 691 +---------------+---------------+---------------+---------------+ 692 16| Msg indicator | Reserved (0) | Reserved (0) | 693 +---------------+---------------+---------------+---------------+ 694 20| Reserved (0) | 695 +---------------+---------------+---------------+---------------+ 696 24| Response | Reserved (0) | 697 +---------------+---------------+---------------+---------------+ 698 28/ Reserved (0) / 699 +/ / 700 +---------------+---------------+---------------+---------------+ 701 40 703 For the functions , the target performs the requested 705 Task Management function and sends a SCSI Task Management Response 706 back to the initiator. The target includes all of the information 707 the initiator provided in the SCSI Task Management Message, so the 708 initiator can know exactly which SCSI Task Management Message was 709 serviced. In addition, the target provides a Response indication 710 which may take on the following values: 711 0 Function Complete 712 1 Function Rejected 714 For the function, the target cancels all pending 715 operations. The target may send an Asynchronous Event to all 716 attached initiators notifying them that the target is being reset. 717 The target then closes all of its TCP connections. 719 SCSI/TCP February 2000 721 3.7. Ready To Transfer (RTT) 723 When an initiator has submitted a SCSI Command with data passing 724 from the initiator to the target (write), the target may specify 725 which blocks of data it is ready to receive. In general, the target 726 may request the data blocks be delivered in whatever order is con- 727 venient for the target at that particular instant. This information 728 is passed from the target to the initiator in the Ready To Transfer 729 (RTT) message. 731 In order to allow write operations without RTT, the initiator and 732 target must have agreed to do so by both sending the AllowNoRTT:yes 733 key-pair attribute to each other (either during Login or through 734 the Text Command/Response mechanism). 736 Byte / 0 | 1 | 2 | 3 | 737 / | | | | 738 |7 6 5 4 3 2 1 0|7 6 5 4 3 2 1 0|7 6 5 4 3 2 1 0|7 6 5 4 3 2 1 0| 739 +---------------+---------------+---------------+---------------+ 740 0| Opcode (0x86) | Reserved (0) | Length | 741 +---------------+---------------+---------------+---------------+ 742 4| Initiator Task Tag | 743 +---------------+---------------+---------------+---------------+ 744 8| Reserved (0) | 745 + + 746 12| | 747 + + 748 16| | 749 +---------------+---------------+---------------+---------------+ 750 20| Expected Data Transfer Length | 751 +---------------+---------------+---------------+---------------+ 752 24| Data Offset | 753 +---------------+---------------+---------------+---------------+ 754 28| Target Transfer Tag | 755 +---------------+---------------+---------------+---------------+ 756 32| Reserved (0) | 757 + + 758 36| | 759 +---------------+---------------+---------------+---------------+ 760 40 762 3.7.1. Expected Data Transfer Length and Data Offset 764 The target specifies how many bytes it wants the initiator to send 765 as a result of this RTT message. The target may request the data 766 from the initiator in several chunks, not necessarily in the origi- 767 nal order of the data. The target, therefore, also specifies a 769 SCSI/TCP February 2000 771 Data Offset indicating the point at which the data transfer should 772 begin. 774 3.7.2. Target Transfer Tag 776 The target assigns its own tag to each RTT request that it sends to 777 the initiator. This can be used by the target to identify data it 778 receives, and can also be used as an RDMA tag [RDMA]. 780 SCSI/TCP February 2000 782 3.8. SCSI Data 784 The initiator and target send data in messages over data 785 channel(s). The typical data transfer specifies the length of the 786 data payload, the Transfer Tag provided by the receiver for this 787 data transfer, and a buffer offset. After sending the data for a 788 particular SCSI command through a data channel, an end-of-data 789 indication must be sent in that data channel. The end-of-data 790 indication consists of a SCSI Data header specifying a zero length 791 data payload. Note that the end-of-data indication must be sent in 792 each data channel over which data was sent for the particular SCSI 793 command. The end-of-data marker indicates that no more data for 794 this command will pass through this data channel. The end-of-data 795 indication SCSI Data header sent from a target to an initiator may 796 optionally also contain the Command Status for the data transfer. 797 In this case Sense Data cannot be sent together with the Command 798 Status. The typical SCSI Data message has the following format: 800 Byte / 0 | 1 | 2 | 3 | 801 / | | | | 802 |7 6 5 4 3 2 1 0|7 6 5 4 3 2 1 0|7 6 5 4 3 2 1 0|7 6 5 4 3 2 1 0| 803 +---------------+---------------+---------------+---------------+ 804 0| Length | 805 +---------------+---------------+---------------+---------------+ 806 4| Transfer Tag | 807 +---------------+---------------+---------------+---------------+ 808 8| Buffer Offset | 809 +---------------+---------------+---------------+---------------+ 810 12. Payload . 811 +. . 812 . . 813 +---------------+---------------+---------------+---------------+ 815 The end-of-data indication has the following format: 817 Byte / 0 | 1 | 2 | 3 | 818 / | | | | 819 |7 6 5 4 3 2 1 0|7 6 5 4 3 2 1 0|7 6 5 4 3 2 1 0|7 6 5 4 3 2 1 0| 820 +---------------+---------------+---------------+---------------+ 821 0| Length (0) | 822 +---------------+---------------+---------------+---------------+ 823 4| Transfer Tag | 824 +---------------+---------------+---------------+---------------+ 825 8| Command Status| Reserved (0) | Rsvrd (0) |D|C| Reserved (0) | 826 +---------------+---------------+---------------+---------------+ 828 SCSI/TCP February 2000 830 3.8.1. Length 832 The length field specifies the total number of bytes in the follow- 833 ing payload. 835 3.8.2. Transfer Tag 837 The Transfer Tag identifies the operation to which this data 838 transfer belongs. 840 When the transfer is from the target to the initiator, the Transfer 841 Task Tag is the Initiator Task Tag that was sent with the SCSI com- 842 mand. 844 When the transfer is from the initiator to the target, the Transfer 845 Task Tag is the Target Transfer Tag when RTT is enabled, or the 846 Initiator Task Tag when RTT is disabled. 848 3.8.3. Buffer Offset 850 The Buffer Offset field contains the offset of the following data 851 against the complete data transfer. If the data transfer is not 852 split over multiple Data transmissions, then this field will be 853 zero. 855 3.8.4. Status Flags 857 The Status Flags field indicates how to interpret the Command 858 Status field, when the end-of-data indicator is sent from a target 859 to an initiator. 860 Byte 10 861 b0 (C) set when status is sent over the control channel. In 862 this case, the Command Status field is gnored. 863 b1 (D) set when status is sent over this data channel. 864 b2-7 not used (should be set to 0). 865 Bits b0 and b1 are mutually exclusive. It is permissable to not 866 set any flag, in which case the Command Status field is ignored. 868 For an end-of-data indicator sent from an initiator to a target (as 869 for a WRITE operation), the Status Flags and Command Status fields 870 should be set to zero. 872 3.8.5. Command Status 874 SCSI/TCP February 2000 876 3.9. Text Command 878 The Text Command is provided to allow the exchange of information 879 and for future extensions. It permits the initiator to inform a 880 target of its capabilities or to request some special operations. 882 Byte / 0 | 1 | 2 | 3 | 883 / | | | | 884 |7 6 5 4 3 2 1 0|7 6 5 4 3 2 1 0|7 6 5 4 3 2 1 0|7 6 5 4 3 2 1 0| 885 +---------------+---------------+---------------+---------------+ 886 0| Opcode (0x05) | Reserved (0) | Length | 887 +---------------+---------------+---------------+---------------+ 888 4| Initiator Task Tag | 889 +---------------+---------------+---------------+---------------+ 890 8/ Reserved (0) / 891 +/ / 892 +---------------+---------------+---------------+---------------+ 893 40/ Text / 894 +/ / 895 +---------------+---------------+---------------+---------------+ 897 3.9.1. Length 899 The length, in bytes, of the Text field. 901 3.9.2. Initiator Task Tag 903 The initiator assigned identifier for this Text Command. 905 3.9.3. Text 907 The initiator sends the target a set of key:value pairs in UTF-8 908 unicode format. The key and value are separated by a ':' (0x3A) 909 delimiter. Many key:value pairs can be included in the Text block 910 by separating them with nul '\0' (0x00) delimiters. Some basic 911 key:value pairs are described in Appendix B. 913 The target responds by sending its response back to the initiator. 914 The target and initiator can then perform some advanced operations 915 based on their common capabalities. 917 Manufacturers may introduce new keys by prefixing them with their 918 (reversed) domain name, for example, 920 com.foo.bar.do_something:0000000000000003 922 Any key that the target does not understand may be ignored without 924 SCSI/TCP February 2000 926 affecting basic function. Once the target has processed all the 927 key:value pairs, it reponds with the Text Response command, listing 928 the parameters that it supports. It is recommended that Text opera- 929 tions that will take a long time should be placed in their own Text 930 command. 932 If the Text Response does not contain a key that was requested, the 933 initiator must assume that the key was not understood by the tar- 934 get. 936 SCSI/TCP February 2000 938 3.10. Text Response 940 The Text Response message contains the responses of the target to 941 the initiator's Text Command. The format of the Text field matches 942 that of the Text Command. 944 Byte / 0 | 1 | 2 | 3 | 945 / | | | | 946 |7 6 5 4 3 2 1 0|7 6 5 4 3 2 1 0|7 6 5 4 3 2 1 0|7 6 5 4 3 2 1 0| 947 +---------------+---------------+---------------+---------------+ 948 0| Opcode (0x85) | Reserved (0) | Length | 949 +---------------+---------------+---------------+---------------+ 950 4| Initiator Task Tag | 951 +---------------+---------------+---------------+---------------+ 952 8/ Reserved (0) / 953 +/ / 954 +---------------+---------------+---------------+---------------+ 955 40/ Text Response / 956 +/ / 957 +---------------+---------------+---------------+---------------+ 959 3.10.1. Length 961 The length, in bytes, of the Text Response field. 963 3.10.2. Initiator Task Tag 965 The Initiator Task Tag matches the tag used in the initial Text 966 Command and is used by the initiator to connect Text Commands with 967 the appropriate Text Responses. 969 3.10.3. Text Response 971 The Text Response field contains responses in the same key:value 972 format as the Text Command. Appendix B lists some basic Text Com- 973 mands and their Responses. 975 SCSI/TCP February 2000 977 3.11. Login Command 979 After establishing a TCP connection between an initiator and a tar- 980 get, the initiator should issue a Login Command to gain further 981 access to the target's resources. 983 Byte / 0 | 1 | 2 | 3 | 984 / | | | | 985 |7 6 5 4 3 2 1 0|7 6 5 4 3 2 1 0|7 6 5 4 3 2 1 0|7 6 5 4 3 2 1 0| 986 +---------------+---------------+---------------+---------------+ 987 0| Opcode (0x03) | Reserved (0) | Length | 988 +---------------+---------------+---------------+---------------+ 989 4| Initiator Task Tag | 990 +---------------+---------------+---------------+---------------+ 991 4/ Reserved (0) / 992 +/ / 993 +---------------+---------------+---------------+---------------+ 994 40/ Login Parameters in Text Command Format / 995 +/ / 996 +---------------+---------------+---------------+---------------+ 998 The initiator may provide some basic parameters in order to enable 999 the target to determine if the initiator may in fact use the 1000 target's resources. 1002 The format of the parameters is as specified for the Text Command. 1004 Targets may require keys to indicate the Domain Name of the initia- 1005 tor and the target, and perhaps also an Authenticator key. 1007 The initiator may also provide additional parameters to the target 1008 in Text Command format, if the initiator so desires. 1010 Keys and their explanations are listed in Appendix B. An example of 1011 the parameters passed is: 1013 Initiator:my.org/me 1014 Target:diskfarm.your.org 1015 Authenticator:open-sesame 1017 SCSI/TCP February 2000 1019 3.12. Login Response 1021 The target responds to the Login Command with a Login Response. It 1022 is sufficient for the target to respond with a Status indicating 1023 that the Login is accepted. 1025 In fact, the target may completely ignore the parameters that were 1026 sent to it and may provide service to any initiator that connects 1027 to it. The target may also send back parameters to the initiator in 1028 Text Command format, if the target so desires. 1030 In particular, the target may want to provide its Authenticator 1031 key, so that the initiator can be sure that it is in fact talking 1032 with the correct target. 1034 The initiator can request that the target provide the Authenticator 1035 parameter by specifying the SendAuthenticator:yes key:value pair. 1037 Byte / 0 | 1 | 2 | 3 | 1038 / | | | | 1039 |7 6 5 4 3 2 1 0|7 6 5 4 3 2 1 0|7 6 5 4 3 2 1 0|7 6 5 4 3 2 1 0| 1040 +---------------+---------------+---------------+---------------+ 1041 0| Opcode (0x83) | Reserved (0) | Length | 1042 +---------------+---------------+---------------+---------------+ 1043 4| Initiator Task Tag | 1044 +---------------+---------------+---------------+---------------+ 1045 8/ Reserved (0) / 1046 +/ / 1047 +---------------+---------------+---------------+---------------+ 1048 24| Status | Reserved (0) | 1049 +---------------+---------------+---------------+---------------+ 1050 28/ Reserved (0) / 1051 +/ / 1052 +---------------+---------------+---------------+---------------+ 1053 40/ Login Parameters in Text Command Format / 1054 +/ / 1055 +---------------+---------------+---------------+---------------+ 1057 The format of the Login Response is the same as the Text Response, 1058 with the addition of one field. 1060 3.12.1. Status 1062 The Status returned in a Login Response is one of the following: 1063 0 accept login (will now accept SCSI commands) 1064 1 reject login 1065 2 additional authentication required 1066 In the case that the Status is "accept login" the initiator may 1068 SCSI/TCP February 2000 1070 proceed to issue SCSI commands. In the case that the Status is 1071 "reject login" the target will immediately close down its end of 1072 the TCP conneciton. 1074 In the case that the Status is "additional authentication required" 1075 the initiator must provide additional authentication information by 1076 issuing the Text Command with the appropriate key:value pairs. 1077 (This may be required if the authentication method is based on a 1078 challenge/response algorithm.) Upon receipt of the necessary 1079 authentication, the target will issue a Login Response with the 1080 "accept login" Status. SCSI Commands will not be accepted until 1081 the target provides a Login Response with the "accept login" 1082 Status. 1084 SCSI/TCP February 2000 1086 3.13. Open Data Connections Command 1088 Byte / 0 | 1 | 2 | 3 | 1089 / | | | | 1090 |7 6 5 4 3 2 1 0|7 6 5 4 3 2 1 0|7 6 5 4 3 2 1 0|7 6 5 4 3 2 1 0| 1091 +---------------+---------------+---------------+---------------+ 1092 0| Opcode (0x04) | Reserved (0) | Length (0) | 1093 +---------------+---------------+---------------+---------------+ 1094 4| Initiator Task Tag | 1095 +---------------+---------------+---------------+---------------+ 1096 8/ Reserved (0) / 1097 +/ / 1098 +---------------+---------------+---------------+---------------+ 1099 20| Number of Data Connections Requested | 1100 +---------------+---------------+---------------+---------------+ 1101 24/ Reserved (0) / 1102 +/ / 1103 +---------------+---------------+---------------+---------------+ 1104 40 1106 The initiator requests that some number of data connections (TCP 1107 channels) be opened. These may be opened on any network address 1108 belonging to the initiator. 1110 3.13.1. Initiator Task Tag 1112 An initiator assigned identification number for this operation. 1114 SCSI/TCP February 2000 1116 3.14. Open Data Connections Response 1118 The target responds with the number of data connections it is wil- 1119 ling to grant in response to the Open Data Connections Command. 1121 Byte / 0 | 1 | 2 | 3 | 1122 / | | | | 1123 |7 6 5 4 3 2 1 0|7 6 5 4 3 2 1 0|7 6 5 4 3 2 1 0|7 6 5 4 3 2 1 0| 1124 +---------------+---------------+---------------+---------------+ 1125 0| Opcode (0x84) | Reserved (0) | Length | 1126 +---------------+---------------+---------------+---------------+ 1127 4| Initiator Task Tag | 1128 +---------------+---------------+---------------+---------------+ 1129 8/ Reserved (0) / 1130 +/ / 1131 +---------------+---------------+---------------+---------------+ 1132 20| Number of Data Connections Granted | 1133 +---------------+---------------+---------------+---------------+ 1134 24| Reserved (0) | 1135 +/ / 1136 +---------------+---------------+---------------+---------------+ 1137 40| Cookie | 1138 +/ / 1139 +---------------+---------------+---------------+---------------+ 1140 72/ Target Address Names (and counts) for Data Connections / 1141 +/ / 1142 +---------------+---------------+---------------+---------------+ 1144 3.14.1. Cookie 1146 The target provides the initiator with a 32 byte entity (referred 1147 to here as a "cookie"), which the initiator will later use to iden- 1148 tify itself to the target. The initiator will open data connections 1149 and will provide the cookie back to the target, so that the target 1150 can map a newly established data connection to an existing control 1151 connection. Upon establishing the data connection, the initiator 1152 must send the cookie as the first bytes of data sent through the 1153 data connection. 1155 Cookies might be valid for only a short period of time (as deter- 1156 mined by the target). If a long time passes (as determined by the 1157 target) after the Open Data Connections Response and a data connec- 1158 tion has not been established, the target may invalidate the 1159 cookie. If an initiator tries to use a cookie that has expired, 1160 the target immediately closes the data connection. The target may 1161 send an Asynchronous Event to the initiator (over the corresponding 1162 control connection) to inform it that an expired cookie was used. 1164 SCSI/TCP February 2000 1166 3.14.2. Target Address Names 1168 The target may have several addresses through which it allows data 1169 connections. The target may also allow a different number of conne- 1170 tions to each of those addresses, based, perhaps, on the bandwidth 1171 of the connections that those addresses represent. These are 1172 specified in the Target Address Names field in Text Command format. 1173 For each target address to be used for data connections, the target 1174 specifies the Name of the address and number of connections allowed 1175 on that address with a colon ':' separating Address Name from the 1176 number of connetions. The target may also specify the number of 1177 connections without specifying the address, thereby implying use of 1178 the same Domain Name that was used for the control connection over 1179 which the Open Data Connections Command arrived. In this case, no 1180 Address Name preceeds the colon; only the number of connections 1181 follows the colon in Text format. Entries are separated by nul 1182 '\0' (0x00). For example: 1184 name1.trg.org:3 1185 :2 1186 name3.trg.org/disk3:4 1188 This example indicates that 3 data channels may be opened at the 1189 address named "name1.trg.org" and 4 data channels may be opened at 1190 the address named "name3.trg.org/disk3." In addition, 2 data con- 1191 nections may be made at the address that was used for the control 1192 connection. 1194 Note that the sum of the individually specified numbers (per-target 1195 address) for data connections as they appear in the Text format may 1196 be more than the number specified in the "Number of Data Connec- 1197 tions Granted" field. The target simply specifies where it it con- 1198 venient for the target to receive data connections. Upon establish- 1199 ing the granted number of data connections, the target may disallow 1200 any further data connections from the initiator. 1202 3.14.3. Length 1204 The Length parameter contains the length of the cookie plus the 1205 total length of the Text containing address and connection informa- 1206 tion. 1208 SCSI/TCP February 2000 1210 3.15. Ping Command 1212 Byte / 0 | 1 | 2 | 3 | 1213 / | | | | 1214 |7 6 5 4 3 2 1 0|7 6 5 4 3 2 1 0|7 6 5 4 3 2 1 0|7 6 5 4 3 2 1 0| 1215 +---------------+---------------+---------------+---------------+ 1216 0| Opcode (0x0) | Reserved (0) | Length | 1217 +---------------+---------------+---------------+---------------+ 1218 4| Initiator Task Tag | 1219 +---------------+---------------+---------------+---------------+ 1220 8/ Reserved (0) / 1221 +/ / 1222 +---------------+---------------+---------------+---------------+ 1223 40/ Ping Data (optional) / 1224 +/ / 1225 +---------------+---------------+---------------+---------------+ 1227 The Ping Command can be used to verify that a control connection is 1228 still active. This command may be useful in the case where an ini- 1229 tiator has been waiting a long time for the response to some com- 1230 mand, and the initiator suspects that there is some problem with 1231 the connection. 1233 When a target receives the Ping Command, it should respond with a 1234 Ping Response, duplicating the data that was provided in the Ping 1235 Command, if present. 1237 If the initiator does not receive the Ping Response within some 1238 period of time (determined by the initiator), or if the data 1239 returned by the Ping Response is different from the data that was 1240 in the Ping Command, the initiator may conclude that there is a 1241 problem with the control connection. The initiator will then close 1242 the control connection and may try to establish a new control con- 1243 nection. 1245 3.15.1. Length 1247 The length of the optional Ping Data. 1249 3.15.2. Initiator Task Tag 1251 An initiator assigned identifier for the operation. 1253 3.15.3. Ping Data 1255 Binary data that will be reflected in the Ping Response. 1257 SCSI/TCP February 2000 1259 3.16. Ping Response 1261 Byte / 0 | 1 | 2 | 3 | 1262 / | | | | 1263 |7 6 5 4 3 2 1 0|7 6 5 4 3 2 1 0|7 6 5 4 3 2 1 0|7 6 5 4 3 2 1 0| 1264 +---------------+---------------+---------------+---------------+ 1265 0| Opcode (0x80) | Reserved (0) | Length | 1266 +---------------+---------------+---------------+---------------+ 1267 4| Initiator Task Tag | 1268 +---------------+---------------+---------------+---------------+ 1269 8/ Reserved (0) / 1270 +/ / 1271 +---------------+---------------+---------------+---------------+ 1272 40/ Return Ping Data / 1273 +/ / 1274 +---------------+---------------+---------------+---------------+ 1276 When a target receives the Ping Command, it should respond with a 1277 Ping Response, duplicating the data and Initiator Task Tag that was 1278 provided in the Ping Command, if present. 1280 SCSI/TCP February 2000 1282 3.17. Third Party Commands 1284 There are some third-party SCSI commands, such as COPY and EXTENDED 1285 COPY, that require one target (Target A) to act as an initiator to 1286 other targets (e.g., Target B). Some such commands can be extended 1287 in a straightforward way to accommodate new forms of addressing, 1288 and this should be done to address targets using SCSI/TCP. These 1289 extensions are not straightforward for all commands, and they may 1290 not be able to encompass the full name space and authentication 1291 information needed for SCSI/TCP in some contexts. Thus SCSI/TCP 1292 also provides a facility for assigning local short-form aliases to 1293 full addressing/authorization information for targets, and the 1294 aliases can be used in the SCSI commands and parameter data. The 1295 alias information is specified as Text following the header of the 1296 SCSI command specifying the third-party command. The header will 1297 thus appear as follows: 1299 Byte / 0 | 1 | 2 | 3 | 1300 / | | | | 1301 |7 6 5 4 3 2 1 0|7 6 5 4 3 2 1 0|7 6 5 4 3 2 1 0|7 6 5 4 3 2 1 0| 1302 +---------------+---------------+---------------+---------------+ 1303 0| Opcode (0x01) | Reserved (0) | Length (!= 0) | 1304 +---------------+---------------+---------------+---------------+ 1305 4| Initiator Task Tag | 1306 +---------------+---------------+---------------+---------------+ 1307 8| Logical Unit Number (LUN) | 1308 + + 1309 12| | 1310 +---------------+---------------+---------------+---------------+ 1311 16| Flags |Task Attributes| Reserved (0) | 1312 +---------------+---------------+---------------+---------------+ 1313 20| Expected Data Transfer Length | 1314 +---------------+---------------+---------------+---------------+ 1315 24| SCSI Command Block (SCB) | 1316 + + 1317 28| | 1318 + + 1319 32| | 1320 + + 1321 36| | 1322 +---------------+---------------+---------------+---------------+ 1323 40/ Data/Parameters for SCB / 1324 +/ Parameters needed for Target B / 1325 / / 1326 +---------------+---------------+---------------+---------------+ 1328 The Length field will not be zero. Rather, it will contain the 1329 length of the alias information which may include the name of 1331 SCSI/TCP February 2000 1333 Target B and an Authentication key in Text Command format. An exam- 1334 ple of the data for this command might be: 1336 LocalName:TargetB 1337 FullName:disk2.sj.foo.com 1338 OriginalAuthenticator:open-sesame 1340 If the SCSI command requires data/parameters beyond the 16-byte 1341 SCB, the target can figure this out by examining the particular 1342 SCSI command and the other contents of the SCB. Any data (as 1343 specified by the Length parameter) beyond what is needed for the 1344 specific SCSI command are parameters in Text Command format needed 1345 to connect to Target B. 1347 Upon receiving a third-party command, Target A will perform login 1348 operations with the identified targets. In effect, Target A will 1349 become an initiator to Target B. Among the parameters provided to 1350 Target B, Target A may specify the authentication information from 1351 the initiator. The Text provided by Target A when it performs the 1352 Login command to Target B may contain the keys Target (referring to 1353 Target B) and Initiator (referring to Target A), and it may also 1354 contain the keys Authenticator (of Target A), OriginalInitiator and 1355 OriginalAuthenticator (referring to authenticator of the original 1356 initiator). 1358 SCSI/TCP February 2000 1360 3.18. Opcode Not Understood 1362 Byte / 0 | 1 | 2 | 3 | 1363 / | | | | 1364 |7 6 5 4 3 2 1 0|7 6 5 4 3 2 1 0|7 6 5 4 3 2 1 0|7 6 5 4 3 2 1 0| 1365 +---------------+---------------+---------------+---------------+ 1366 0| Opcode (0x88) | Reserved (0) | Length | 1367 +---------------+---------------+---------------+---------------+ 1368 4/ Reserved (0) / 1369 +/ / 1370 +---------------+---------------+---------------+---------------+ 1371 40/ Header of Bad Message / 1372 +/ / 1373 +---------------+---------------+---------------+---------------+ 1374 80 1376 It may happen that a target receives a message with an Opcode that 1377 it doesn't recognize. This may occur because of a new version of 1378 the protocol that defines a new Opcode, or because of some corrup- 1379 tion of a message header. 1381 The target returns the header of the message with the unrecognized 1382 opcode as the data of the response. 1384 SCSI/TCP February 2000 1386 4. Error Handling SCSI/TCP 1388 The following errors might be detected by the initiator and tar- 1389 gets: 1390 - TCP connection termination with outstanding operations pending 1391 - Operation timed out 1392 - Illegal field format---could be an implementation error or a 1393 data stream synchronization error. 1395 Initiators that detect one of the above errors will take the fol- 1396 lowing actions: 1397 - Reset the TCP connection. 1398 - Terminate all outstanding requests on behalf of the LUNs on 1399 the target with the error. 1400 - Reestablish the session by: 1401 - Opening a new TCP connection. 1402 - Performing the login process. 1404 Note: After the initiator resets its TCP connection, the target 1405 connection may remain active. If a new TCP connection is opened by 1406 the initiator, it can lead to two active connections at the target 1407 side for the same initiator. The target is not aware of the cleanup 1408 actions taken by the initiator. To avoid this situation, the target 1409 has to check on every Login to see whether or not it established an 1410 already existing session. If the session already exists, the tar- 1411 get performs cleanup actions (described in the following paragraph) 1412 for the old session before performing the new Login. 1414 A target that detects one of the above errors will take the follow- 1415 ing actions: 1417 - Reset the TCP connection. 1418 - Abort all Tasks in the task set for the corresponding initia- 1419 tor. 1421 SCSI/TCP February 2000 1423 5. Notes to Implementors 1425 This protocol was designed to take advantage of the Remote DMA TCP 1426 options [RDMA], although it can still operate effectively without 1427 this TCP extension. This section notes some of the performance con- 1428 siderations of the SCSI/TCP protocol. 1430 5.1. Small TCP Segments 1432 It is recommended that TCP segments be limited in size to no more 1433 than 8K bytes. One reason is to ensure that segments won't get bro- 1434 ken into smaller packets, thereby possibly breaking the assumptions 1435 for RDMA and the information in the RDMA header. Another reason we 1436 recommend small segments is to allow a stronger type of checksum, 1437 possibly utilizing CRC, which is practical only for smaller seg- 1438 ments. 1440 5.2. Multiple Network Adapters 1442 The SCSI/TCP protocol assumes that the Task Tags will also serve as 1443 RDMA tags. The SCSI/TCP protocol allows multiple data connections, 1444 not all of which need go over the same network adapter. If multiple 1445 network connections are to be utilized with RDMA, the SCSI/TCP pro- 1446 tocol requires that the Task Tag (RDMA Tag) contain sufficient 1447 information (and sufficient support from the various network 1448 adapters) to allow data to arrive on any of the data connections, 1449 even if they are not all through the same network adapter. 1451 5.3. Autosense 1453 Autosense refers to the automatic return of sense data to the ini- 1454 tiator in case a command did not complete successfully. If 1455 autosense is turned off, the initiator must explicitly request that 1456 sense data be sent to it after some command has completed with a 1457 CHECK CONDITION status. The default for SCSI/TCP is to work with 1458 Autosense enabled. 1460 Note that even if a SCSI target/LUN does not support Autosense, it 1461 may still be possible for SCSI/TCP to work with Autosense. This 1462 can be accomplished as follows. Whenever a CHECK CONDITION status 1463 is about to be returned, the SCSI/TCP component on the target 1464 immediately queries the target/LUN for the sense data. SCSI/TCP can 1465 then return the sense data to the initiator together with the CHECK 1466 CONDITION status. It is not necessary for SCSI/TCP to wait for the 1467 initiator to explicitly request the sense data; the target SCSI/TCP 1468 code can perform this operation automatically, even for 1469 devices/LUNs that do not ordinarily provide automatic sense data. 1471 SCSI/TCP February 2000 1473 5.4. TCP RDMA option 1475 The TCP RDMA option [RDMA] is an annotation on individual TCP seg- 1476 ments that can reduce the number of copies necessary at the 1477 receiver. The RDMA option succinctly describes the portion of a TCP 1478 payload that holds bulk data. 1480 In SCSI/TCP, all bulk data transfers occur over the data connec- 1481 tions. Thus, RDMA options will only appear on the data connection. 1483 To disambiguate between multiple transfers on a TCP connection, a 1484 48-bit RDMA ID (RID) appears in the TCP option. In the case of 1485 SCSI/TCP, the upper 16 bits of the RID are zero and the lower bits 1486 are the same as the Transfer Tag on the data message. 1488 In the case of an initiator to target data phase without ready-to- 1489 transfer (RTT), the unsolicited bit should be set in the RDMA 1490 option. 1492 5.5. Data Connection Options 1494 Some targets may want to inform (or negotiate with) an initiator 1495 concerning some parameters related to bandwidth, Quality of Ser- 1496 vice, or some other available features on its various network con- 1497 nections. These are exchanged between the initiator and the target 1498 using Text Commands and Responses. These should be exchanged after 1499 a successful login, but before any data connections are esta- 1500 blished. 1502 SCSI/TCP February 2000 1504 6. Security Considerations 1506 6.1. Data Integrity 1508 We assume that end-to-end data integrity can be assured by TCP, by 1509 adding a more powerful checksum option whenever this is considered 1510 important, or replacing the checksum by a weaker one (or even "nul- 1511 lifying it") for applications in which data integrity is not impor- 1512 tant and recovery from data errors could be harmful (e.g., audio or 1513 video distribution streams). 1515 6.2. Login Process 1517 In some environments, a target will not be interested in authenti- 1518 cating the initiator. In this case, the target can simply ignore 1519 some or all of the parameters sent in a Login Command, and the tar- 1520 get can simply reply with a basic Login Response indicating a suc- 1521 cessful login. 1523 Some targets may want to perform some kind of authentication. The 1524 Authenticator key is defined for this purpose. Various authentica- 1525 tion schemes can be used, including encrypted passwords and trusted 1526 certificate authorities. 1528 Once the initiator and target are confident of the identity of the 1529 attached party, the established control channel is considered 1530 secure. The initiator then proceeds to request (over the secure 1531 control channel) the allocation of data channels. The target pro- 1532 vides the initiator with a cookie that must be used when establish- 1533 ing a data channel. This enables the target to match a data chan- 1534 nel to its corresponding control channel. The target may set a 1535 time limit to the validity of a cookie that it has provided for 1536 data connections. 1538 It is anticipated that most target devices will not bother with all 1539 of the possible checks, but the protocol provides sufficient means 1540 to perform the checks, if required by the target. 1542 6.3. IANA Considerations 1544 There will be a well known port for SCSI/TCP control connections 1545 and a well known port for SCSI/TCP data connections. These well 1546 known ports will have to be registered with IANA. 1548 A checksum type will also have to be registered with IANA. 1550 SCSI/TCP February 2000 1552 7. Authors' Addresses 1554 Julian Satran 1555 Kalman Meth 1556 Meir Toledano 1557 IBM, Haifa Research Lab 1558 MATAM - Advanced Technology Center 1559 Haifa 31905, Israel 1560 Phone +972 4 829 6211 1561 Email: satran@il.ibm.com meth@il.ibm.com 1562 toledano@il.ibm.com 1564 Daniel F. Smith 1565 Prasenjit Sarkar 1566 Carlos Fuente 1567 IBM Almaden Research Center 1568 650 Harry Road 1569 San Jose, CA 95120-6099, USA 1570 Phone: +1 408 927 2072 1571 Email: dfsmith@almaden.ibm.com psarkar@almaden.ibm.com 1572 carlos_fuente@us.ibm.com 1574 Costa Sapuntzakis 1575 Cisco Systems, Inc. 1576 170 W. Tasman Drive 1577 San Jose, CA 95134, USA 1578 Phone: +1 408 525 5497 1579 Email: csapuntz@cisco.com 1581 Efri Zeidner 1582 SanGate 1583 Israel 1585 Comments may be sent to Julian Satran, Daniel Smith, Costa 1586 Sapuntzakis, or Kalman Meth. 1588 SCSI/TCP February 2000 1590 8. References and Bibliography 1592 [RDMA] Internet Draft: TCP RDMA option (work in progress) 1593 [SAM2] ANSI X3.270-1998, SCSI-3 Architecture Model (SAM-2) 1594 [TLS] The TLS Protocol, RFC 2246, T. Dierks et al. 1596 [ALTC] Internet Draft: Alternative checksums (work in progress) 1597 [CAM] ANSI X3.232-199X, Common Access Method-3 (Cam-3) 1598 [CRC] ISO 3309, High-Level Data Link Control (CRC 32) 1599 [RFC793] Transmission Control Protocol, RFC 793 1600 [RFC1122] Requirements for Internet Hosts -- Communication Layer, 1601 RFC 1122, R. Braden (editor) 1602 [SBC] ANSI X3.306-199X, SCSI-3 Block Commands (SBC) 1603 [SCSI2] ANSI X3.131-1994, SCSI-2 1604 [SPC] ANSI X3.301-199X, SCSI-3 Primary Commands (SPC) 1606 SCSI/TCP February 2000 1608 9. Appendix A - Examples 1610 9.1. Read operation example 1612 +------------------+-----------------------+----------------------+ 1613 |Initiator Function| Message Type | Target Function | 1614 +------------------+-----------------------+----------------------+ 1615 | Command request |SCSI Command (READ)>>> | | 1616 | (read) | (on control channel) | | 1617 +------------------+-----------------------+----------------------+ 1618 | | | Prepare Data Transfer| 1619 +------------------+-----------------------+----------------------+ 1620 | Receive Data | <<< SCSI Data | Send Data | 1621 | | (on data channel) | | 1622 +------------------+-----------------------+----------------------+ 1623 | Receive Data | <<< SCSI Data | Send Data | 1624 | | (on data channel) | | 1625 +------------------+-----------------------+----------------------+ 1626 | Receive Data | <<< SCSI Data | Send Data | 1627 | | (on data channel) | | 1628 +------------------+-----------------------+----------------------+ 1629 | | <<< SCSI Response |Send Status and Sense | 1630 | | (on control channel) | | 1631 +------------------+-----------------------+----------------------+ 1632 | Command Complete | | | 1633 +------------------+-----------------------+----------------------+ 1635 SCSI/TCP February 2000 1637 9.2. Write operation example 1639 +------------------+-----------------------+---------------------+ 1640 |Initiator Function| Message Type | Target Function | 1641 +------------------+-----------------------+---------------------+ 1642 | Command request |SCSI Command (WRITE)>>>| Receive command | 1643 | (write) | (on control channel) | and queue it | 1644 +------------------+-----------------------+---------------------+ 1645 | | | Process old commands| 1646 +------------------+-----------------------+---------------------+ 1647 | | | Ready to process | 1648 | | <<< RTT | WRITE command | 1649 | | (on control channel) | | 1650 +------------------+-----------------------+---------------------+ 1651 | Send Data | SCSI Data >>> | Receive Data | 1652 | | (on data channel) | | 1653 +------------------+-----------------------+---------------------+ 1654 | Send Data | SCSI Data >>> | Receive Data | 1655 | | (on data channel) | | 1656 +------------------+-----------------------+---------------------+ 1657 | | <<< RTT | | 1658 | | (on control channel) | | 1659 +------------------+-----------------------+---------------------+ 1660 | Send Data | SCSI Data >>> | Receive Data | 1661 | | (on data channel) | | 1662 +------------------+-----------------------+---------------------+ 1663 | | <<< SCSI Response |Send Status and Sense| 1664 | | (on control channel) | | 1665 +------------------+-----------------------+---------------------+ 1666 | Command Complete | | | 1667 +------------------+-----------------------+---------------------+ 1669 SCSI/TCP February 2000 1671 10. Appendix B - Login/Text keys 1673 10.1. Target 1675 Target:domainname[/modifier] 1677 Examples: 1679 Target:disk-array.sj-bldg-h.cisco.com 1680 Target:disk-array.sj-bldg-h.cisco.com/disk3 1682 This key is provided by the initiator of the TCP connection to the 1683 remote endpoint. The Target key specifies the domain name of the 1684 target, since that information is not available from the TCP layer. 1685 The target is not required to support this key. 1687 The initiator should send this key in the first login message. The 1688 Target key might be used by application layer proxies to learn the 1689 intended endpoint of the conversation. 1691 10.2. Initiator 1693 Initiator:domainname/principal 1695 Examples: 1697 Initiator:sample.foobar.org/ 1698 Initiator:sample.foobar.org/fred 1699 Initiator:/fred 1700 Initiator:/ 1702 The Initiator key enables the initiator to identify itself to the 1703 remote endpoint. A zero-length principal is valid and indicates 1704 that the initiator has no specific principal to communicate to the 1705 target. The domain name should be that of the initiator. A zero- 1706 length domain name is interpreted as "other side of TCP connec- 1707 tion". The target may silently ignore this call if it does not sup- 1708 port it. 1710 For more security, a certificate-based protocol [TLS] may be used 1711 on the channel and take precedence over this protocol. 1713 SCSI/TCP February 2000 1715 10.3. Authenticator 1717 Authenticator: 1719 Examples: 1721 Authenticator:open-sesame 1723 The authenticator is a secret that the initiator uses to gain 1724 access to the target's LUNs. 1726 10.4. SendAuthenticator 1728 SendAuthenticator:yes Response: Authenticator: 1730 Examples: 1732 SendAuthenticator:yes 1733 -> Authenticator:alakazam 1735 The SendAuthenticator key is used to request from the party on the 1736 other side of the TCP connection to send its Authenticator. 1737 SCSI/TCP devices may refuse to grant access until proper authenti- 1738 cation has been performed by the parties involved. 1740 10.5. AllowNoRTT 1742 AllowNoRTT: Response: AllowNoRTT: 1744 Examples: 1746 AllowNoRTT:yes 1747 -> AllowNoRTT:yes 1749 The AllowNoRTT key is used to allow an initiator to send data to a 1750 target without the target having sent an RTT to the initiator. The 1751 default action is that RTT is required, unless both the initiator 1752 and the target send this key-pair attribute specifying 1753 AllowNoRTT:yes. Once AllowNoRTT has been set to 'yes', it cannot 1754 be set back to 'no'. 1756 10.6. OriginalInitiator 1758 OriginalInitiator:domainname/principal 1760 SCSI/TCP February 2000 1762 Examples: 1764 OriginalInitiator:sample.foobar.org/fred 1766 The OriginalInitiator key is used to perform a proxy login from one 1767 target to another target in order to perform a third-party opera- 1768 tion (like COPY) for some initiator. The first target acts as the 1769 initiator for the second target, but it must provide the authoriza- 1770 tion information of the original initiator. 1772 10.7. Target2 1774 Target2:domainname[/modifier] 1776 Examples: 1778 Target2:sample.foobar.org 1779 Target2:sample.foobar.org/disk2 1781 The target2 key is used in a third-party SCSI command (like COPY) 1782 between targets that do not lie on the same SCSI fabric. The ini- 1783 tiator must specify the name of the distant target to the original 1784 target, so that the original target can Login to the distant target 1785 and then perform the third-party command. 1787 Expires 14 August 2000