Professional Documents
Culture Documents
Architectures
Neil Edmunds,
Director
Solution Technology, Ltd.
SCSI – The Protocol for All Storage Architectures SNW Spring 2004 Page 1
© Copyright 2004 Storage Networking Industry Association. All Rights Reserved.
SNIA Legal Notices
SCSI – The Protocol for All Storage Architectures SNW Spring 2004 Page 3
© Copyright 2004 Storage Networking Industry Association. All Rights Reserved.
Objectives
SCSI – The Protocol for All Storage Architectures SNW Spring 2004 Page 4
© Copyright 2004 Storage Networking Industry Association. All Rights Reserved.
Brief History
• SCSI-1: In the beginning – 1987
– SCSI was adapted from the SASI Interface (1979)
– Specified a physical interface, transport protocol, and
standard command for disk, tape, and other storage
devices
• SCSI-2: Second coming of SCSI
– Speed and bus width enhancements
– Multi-threading commands and transport protocol
cleanup
– Added more storage device type command sets
• SCSI-3: Today and beyond
– More speed: Ultra-2/Ultra-160/Ultra-320
– Separation of Physical Interface, Transport Protocols,
and the SCSI Command Sets
SCSI – The Protocol for All Storage Architectures SNW Spring 2004 Page 5
© Copyright 2004 Storage Networking Industry Association. All Rights Reserved.
SCSI Today and the Future
• SCSI Language
– SCSI is the Language of Love
– Every architecture uses the SCSI command sets
– Every architecture uses the SCSI upper layer protocol
• SCSI Transport
– Defines protocol mapping and control of SCSI language
– Fibre Channel Protocol (FCP), Serial Storage
Architecture (SSA), Serial Bus Protocol (SBP), iSCSI,
Serial ATA (SATA), Serial Attached SCSI (SAS)
• SCSI Physical Architectures
– Serial SCSI – the future of the SCSI physical interface
– Fibre Channel, SSA, 1394, ATAPI, TCP/IP
SCSI – The Protocol for All Storage Architectures SNW Spring 2004 Page 6
© Copyright 2004 Storage Networking Industry Association. All Rights Reserved.
Introduction to Standards
SCSI – The Protocol for All Storage Architectures SNW Spring 2004 Page 7
© Copyright 2004 Storage Networking Industry Association. All Rights Reserved.
Standards Organizations
InternationalOrganization
International Organizationfor
forStandards
Standards(ISO)
(ISO)
AmericanNational
American NationalStandards
StandardsInstitute
Institute(ANSI)
(ANSI)
IEEE
IEEE IETF
IETF INCITS
INCITS
Ethernet Internet
Internet T10––SCSI
T10 SCSI
Ethernet
(802.x) Protocol
Protocol
(802.x) T11––FC
FC
T11
IEEE-1394 iSCSI
iSCSI
IEEE-1394 T13––ATA
ATA
(Firewire)
(Firewire) T13
FCIP
FCIP
iFCP
iFCP
SCSI – The Protocol for All Storage Architectures SNW Spring 2004 Page 8
© Copyright 2004 Storage Networking Industry Association. All Rights Reserved.
SCSI Standards
Device
Specific
Command
Sets
Transport
Protocols
Physical
Interfaces
SCSI – The Protocol for All Storage Architectures SNW Spring 2004 Page 9
© Copyright 2004 Storage Networking Industry Association. All Rights Reserved.
Protocol Service Model
Transport SCSITransport
Transport SCSITransport
Transport Transport
Protocol SCSI SCSI Transport SCSI Protocol
Layer
ProtocolServices
Protocol Services Protocol ProtocolServices
Protocol Services Standards
Interconnect Service Interface
Interconnect Interconnect
Interconnect Interconnect
Interconnect Interconnect
Layer Services
Services Services
Services Standards
¾ Application layer: Clients and servers that originate and process SCSI I/O operations by means of a SCSI application protocol
¾ Transport protocol layer: Services and protocols through which clients and servers communicate
¾ Interconnect layer: Services, signaling mechanism and interconnect subsystem needed for the physical transfer of data from
sender to receiver.
SCSI – The Protocol for All Storage Architectures SNW Spring 2004 Page 10
© Copyright 2004 Storage Networking Industry Association. All Rights Reserved.
SCSI Command Sets
SCSI – The Protocol for All Storage Architectures SNW Spring 2004 Page 11
© Copyright 2004 Storage Networking Industry Association. All Rights Reserved.
SCSI Architectural Model
SCSI – The Protocol for All Storage Architectures SNW Spring 2004 Page 12
© Copyright 2004 Storage Networking Industry Association. All Rights Reserved.
The SCSI Distributed Model
SCSI – The Protocol for All Storage Architectures SNW Spring 2004 Page 13
© Copyright 2004 Storage Networking Industry Association. All Rights Reserved.
Client-Server Model
• A single Initiator can have multiple Application Clients.
• Targets have ONE Task Manager and one or more Logical Units (LU), which are
numbered (LUN). The Task Manager:
– controls the sequencing of one or more tasks within a LU
– carries out the task management functions
– has the authority to modify Service Requests that have already been received by
the target
• The Device Server processes operations and directs them to a specific LUN.
Initiator Target
SCSI – The Protocol for All Storage Architectures SNW Spring 2004 Page 14
© Copyright 2004 Storage Networking Industry Association. All Rights Reserved.
Re-cap SCSI Terminology
SCSI – The Protocol for All Storage Architectures SNW Spring 2004 Page 15
© Copyright 2004 Storage Networking Industry Association. All Rights Reserved.
SCSI Structural Model
SCSI – The Protocol for All Storage Architectures SNW Spring 2004 Page 16
© Copyright 2004 Storage Networking Industry Association. All Rights Reserved.
Initiator Device Model
SCSI – The Protocol for All Storage Architectures SNW Spring 2004 Page 17
© Copyright 2004 Storage Networking Industry Association. All Rights Reserved.
Target Device Model
SCSI – The Protocol for All Storage Architectures SNW Spring 2004 Page 18
© Copyright 2004 Storage Networking Industry Association. All Rights Reserved.
Logical Unit Model Logical
Logical
Unit
Unit
LogicalUnit
Logical Unit LogicalUnit
Logical Unit Device
Device TaskSet
Task Set Task
Task
Name
Name Number
Number Server
Server (Queue)
(Queue) Manager
Manager
Untagged
Untagged Tagged
• A Logical Unit contains: Task
Tagged
Task
Task Task
– A Logical Unit Number
• If access controls are not in effect, one Logical Unit Number per
Logical Unit; or
• If access controls are in effect, one Logical Unit Number per SCSI
Initiator port that has access rights plus one default Logical Unit
Number per Logical Unit;
– One or more Logical Unit names
– A Device Server
– A Task Manager; and
– One or more Task Sets each of which may contain zero or more
untagged tasks or a combination of zero or more tagged tasks and
zero or more untagged tasks.
SCSI – The Protocol for All Storage Architectures SNW Spring 2004 Page 19
© Copyright 2004 Storage Networking Industry Association. All Rights Reserved.
Tasks
• Task = the work to be performed by the Logical Unit
– A single Command
Initiator
– A group of linked Commands
• Two types of SCSI Tasks
– Tagged
– Untagged
• Untagged Task
– Represented by an I_T_L nexus
• Tagged Task Target
– Represented by an I_T_L_Q nexus
Logical Units
• Nexus
– Methodology used to uniquely identify an I/O Task
Queue Sets
Operation between an Initiator, Target, Logical
Unit, and an optional Queue Tag
SCSI – The Protocol for All Storage Architectures SNW Spring 2004 Page 20
© Copyright 2004 Storage Networking Industry Association. All Rights Reserved.
Task Attributes
• There are four types of Task attributes that can affect how the Target
executes each task
– Simple
• Target can execute in any order
• Target will typically apply a performance algorithm to numerous
simple tasks
– Ordered
• Target must execute all ordered tasks in the order they are received
• Any task prior to ordered must be executed before ordered task
– Head of queue
• Informs Target to insert the task into the front of the queue
– Auto Contingent Allegiance (ACA)
• Used when the Target enters into an error condition for a command
that has previously executed
SCSI – The Protocol for All Storage Architectures SNW Spring 2004 Page 21
© Copyright 2004 Storage Networking Industry Association. All Rights Reserved.
I/O Operations
SCSI – The Protocol for All Storage Architectures SNW Spring 2004 Page 22
© Copyright 2004 Storage Networking Industry Association. All Rights Reserved.
I/O Operation Model
SCSI – The Protocol for All Storage Architectures SNW Spring 2004 Page 24
© Copyright 2004 Storage Networking Industry Association. All Rights Reserved.
Operations that move Data
• Types of Commands
– Read or Write
– Inquiry
SCSI – The Protocol for All Storage Architectures SNW Spring 2004 Page 25
© Copyright 2004 Storage Networking Industry Association. All Rights Reserved.
Command Descriptor Block
• A Command is executed by sending a Command Descriptor Block
(CDB) to the Target
• For each CDB
– The first byte of the CDB is the Operation Code
– The last byte of the CDB is the Control Byte
– The format of the Operation Code and Control Byte is identical
for every SCSI Command in the SCSI Universe
SCSI – The Protocol for All Storage Architectures SNW Spring 2004 Page 26
© Copyright 2004 Storage Networking Industry Association. All Rights Reserved.
Other CDB Formats
Ten Byte CDB
bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0
byte 0 Operation code
byte 1 Reserved Service Action (if required)
• CBDs can be: byte 2
byte 3
(MSB)
Logical block address (if required)
– 10 bytes byte 4
byte 5 (LSB)
byte 6 Reserved
– 12 bytes byte 7 (MSB) Transfer length (if required)
Parameter List Length (if required)
– 16 bytes byte 8 Allocation length (if required) (LSB)
byte 9 Control byte
– or even Twelve Byte CDB
variable bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0
byte 0 Operation code
bytes in byte 1 Reserved Service Action (if required)
byte 2 (MSB)
length byte 3 Logical block address (if required)
byte 4
byte 5 (LSB)
byte 6 (MSB)
byte 7 Transfer length (if required)
byte 8 Parameter list length (if required)
byte 9 Allocation length (if required) (LSB)
byte 10 Reserved
byte 11 Control byte
SCSI – The Protocol for All Storage Architectures SNW Spring 2004 Page 27
© Copyright 2004 Storage Networking Industry Association. All Rights Reserved.
SCSI Commands all Devices
SCSI – The Protocol for All Storage Architectures SNW Spring 2004 Page 28
© Copyright 2004 Storage Networking Industry Association. All Rights Reserved.
SCSI Status
SCSI – The Protocol for All Storage Architectures SNW Spring 2004 Page 29
© Copyright 2004 Storage Networking Industry Association. All Rights Reserved.
Parallel SCSI
Initiator Target
SCSI SCSI Application SCSI Command Set
SCSI SCSI
Application Protocol Application Standards
Application Application
SCSI – The Protocol for All Storage Architectures SNW Spring 2004 Page 30
© Copyright 2004 Storage Networking Industry Association. All Rights Reserved.
Parallel SCSI Characteristics
• Half-duplex, daisy chained, shared bus, requires signal termination
• Separate control and data signals
• Information can only go in one direction at a time
– Each piece (byte) of information if acknowledged
– Information transfers are interlocked
• A connection protocol is used before any information transfers
– Arbitration, Selection, and Message phases
– Uses SCSI ID’s to identify devices
• Utilizes protocol “bus” phases to accomplish information transfers
– Command (CDB), Data, or Status
• Can multi-task by disconnecting
SCSI – The Protocol for All Storage Architectures SNW Spring 2004 Page 31
© Copyright 2004 Storage Networking Industry Association. All Rights Reserved.
Read Command Example
Initiator Target
• Initiator connects to Target Connectio
Arbitrate a n
– Once Initiator connects to nd Select
Target, the Target is in control CDB 0x28
00 00 10 00 00
of the I/O Process Command 00 0A 00 00
Phase
• Initiator sends CDB information
n
via Command Phases te d R e ad Informatio
Reque s
• Target returns requested Data Phase
information via Data Phase n
te d R e ad Informatio
Reque s
• Target returns completion Data Phase
information via Status Phase
n Info rm a tion 0x00
• Target Disconnects via Message Completio se
Status Pha
Phase tion 0x00
Disconnec
hase
Message P
SCSI – The Protocol for All Storage Architectures SNW Spring 2004 Page 32
© Copyright 2004 Storage Networking Industry Association. All Rights Reserved.
Fibre Channel
Originator Responder
SCSI SCSI Application SCSI Command Set
SCSI SCSI
Application Protocol Application Standards
Application Application
SCSI – The Protocol for All Storage Architectures SNW Spring 2004 Page 33
© Copyright 2004 Storage Networking Industry Association. All Rights Reserved.
FC Characteristics
SCSI – The Protocol for All Storage Architectures SNW Spring 2004 Page 34
© Copyright 2004 Storage Networking Industry Association. All Rights Reserved.
Fibre Channel Hierarchy
Session
Frame 2 Frame 2
Frame n Frame n
SCSI – The Protocol for All Storage Architectures SNW Spring 2004 Page 35
© Copyright 2004 Storage Networking Industry Association. All Rights Reserved.
FCP Characteristics
SCSI – The Protocol for All Storage Architectures SNW Spring 2004 Page 36
© Copyright 2004 Storage Networking Industry Association. All Rights Reserved.
FCP_CMD frame
• The FCP_CMND frame is normally sent as a single-frame
sequence, which is the first sequence of an exchange.
• The FCP_CMND contains all the necessary information to
start the I/O Process.
SCSI – The Protocol for All Storage Architectures SNW Spring 2004 Page 37
© Copyright 2004 Storage Networking Industry Association. All Rights Reserved.
FCP_XFER_RDY frame
• FCP_XFER_RDY specifies the relative offset and length
of any following data sequence
• Optional for READ operations
• Required for WRITE operation
SCSI – The Protocol for All Storage Architectures SNW Spring 2004 Page 38
© Copyright 2004 Storage Networking Industry Association. All Rights Reserved.
FCP_DATA frame
FCP_DATA
FCP_DATA
128
128to
to2048
2048bytes
bytes
SCSI – The Protocol for All Storage Architectures SNW Spring 2004 Page 39
© Copyright 2004 Storage Networking Industry Association. All Rights Reserved.
FCP_RSP frame
• The FCP_RSP frame defines the data structure containing the SCSI
status byte, SCSI autosense data, and the FCP response code.
• This frame signals the completion of a SCSI command or task
management function.
SCSI – The Protocol for All Storage Architectures SNW Spring 2004 Page 40
© Copyright 2004 Storage Networking Industry Association. All Rights Reserved.
Write Command Example
• Before devices can communicate Originator Responder
in FC they must establish a Establish Session
(outside scope of this presentation)
Exchange
• Originator sends Data frames FCP_DATA
Frame
Data Phase
• When all Data is transferred,
Sequence
Responder sends Status to FCP_DATA
Frame
Data Phase
Originator
• Session could end at this point Frame
FCP_RSP
but typically doesn’t Status Pha
se
Remove Session
(outside scope of this presentation)
SCSI – The Protocol for All Storage Architectures SNW Spring 2004 Page 41
© Copyright 2004 Storage Networking Industry Association. All Rights Reserved.
iSCSI
Initiator Target
SCSI SCSI Command Set
SCSI SCSI Application SCSI
Application Application Standards
Application Protocol Application
IP
IP iSCSI Transport
iSCSI Transport
Protocol Services iSCSI Transport
iSCSI Transport
iSCSI Transport
Protocol Services
iSCSI
Protocol
Protocol Services Protocol Protocol Services
Network
Network Interconnect Service Interface
Standard
IP Network
SCSI – The Protocol for All Storage Architectures SNW Spring 2004 Page 42
© Copyright 2004 Storage Networking Industry Association. All Rights Reserved.
iSCSI Characteristics
• iSCSI is a SCSI transport protocol for mapping of block oriented storage data
over TCP/IP networks.
• Storage generally identified for this application include disk, tape arrays and
tape libraries.
• IP networks most applicable for this purpose are Gigabit Ethernet and in the
future 10 Gigabit Ethernet, however for low performance applications 10/100bT
will work.
• The iSCSI layer encapsulates the SCSI CDB into a iSCSI Protocol Data Unit
(PDU) and forwards it to the Transmission Control Protocol (TCP) layer.
• The communications between the Initiator and Target will occur over one or
more TCP connections.
• The TCP connections form a session and will carry the iSCSI PDU’s. The
sessions are given an ID called a Connection ID (CID). There are two parts of
the ID, Initiator Session ID (ISID) and Target ID (TSID) and together make up
an “I_T nexus”.
SCSI – The Protocol for All Storage Architectures SNW Spring 2004 Page 43
© Copyright 2004 Storage Networking Industry Association. All Rights Reserved.
iSCSI Encapsulation
Initiator Target
SCSI SCSI Data Data Data
SCSI SCSI Application SCSI
Application Application
Application Protocol Application
Interconnect Interconnect
Interconnect Interconnect
Services Services
Services Services
CHK
TCP
TCP TCP
TCP Header
TCP Segment
TCP
IP IP IP
IP IP IP Packet (Datagrams)
Header
Data Link Data Link
Data Link
FCS
Data Link Ethernet
Header
Ethernet Frame
IP Network
SCSI – The Protocol for All Storage Architectures SNW Spring 2004 Page 44
© Copyright 2004 Storage Networking Industry Association. All Rights Reserved.
SCSI Command PDU
SCSI – The Protocol for All Storage Architectures SNW Spring 2004 Page 45
© Copyright 2004 Storage Networking Industry Association. All Rights Reserved.
SCSI Response PDU
Byte 0 Byte 1 Byte 2 Byte 3
Byte 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7
0 .|.| 0x21 1|. .|o|u|O|U|. Response Status
4 TotalAHSLength DataSegmentLength
8+ Reserved
16 Initiator Task Tag
20 SNACK Tag or Reserved
24 StatSN
28 ExpCmdSN
32 MaxCmdSN
36 ExpDataSN or Reserved
40 Bi-directional Read Residual Count or Reserved
44 Residual Count or Reserved
48 Header-Digest (Optional)
+ Data Segment (Optional) + Data-Digest (Optional)
SCSI – The Protocol for All Storage Architectures SNW Spring 2004 Page 46
© Copyright 2004 Storage Networking Industry Association. All Rights Reserved.
SCSI Data-out PDU
Byte 0 Byte 1 Byte 2 Byte 3
Byte 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7
0 .|.| 0x05 F| Reserved
4 TotalAHSLength DataSegmentLength
8+ LUN or Reserved
16 Initiator Task Tag
20 Target Transfer Tag or 0xFFFFFFFF
24 Reserved
28 ExpStatSN
32 Reserved
36 DataSN
40 Buffer Offset
44 Reserved
48 Header-Digest (Optional)
+ DataSegment + Data-Digest (Optional)
SCSI – The Protocol for All Storage Architectures SNW Spring 2004 Page 47
© Copyright 2004 Storage Networking Industry Association. All Rights Reserved.
SCSI Data-in PDU
Byte 0 Byte 1 Byte 2 Byte 3
Byte 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7
0 .|.| 0x25 F|A|0 0 0|O|U|S Reserved Status or Rsvd
4 TotalAHSLength DataSegmentLength
8+ LUN or Reserved
16 Initiator Task Tag
20 Target Transfer Tag or 0xFFFFFFFF
24 StatSN or Reserved
28 ExpCmdSN
32 MaxCmdSN
36 DataSN
40 Buffer Offset
44 Residual Count
48 Header-Digest (Optional)
+ DataSegment + Data-Digest (Optional)
SCSI – The Protocol for All Storage Architectures SNW Spring 2004 Page 48
© Copyright 2004 Storage Networking Industry Association. All Rights Reserved.
Ready To Transfer (R2T)
Byte 0 Byte 1 Byte 2 Byte 3
Byte 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7
0 .|.| 0x31 1| Reserved
4 TotalAHSLength DataSegmentLength
8+ LUN
16 Initiator Task Tag
20 Target Task Tag
24 StatSN
28 ExpCmdSN
32 MaxCmdSN
36 R2TSN
40 Buffer Offset
44 Desired Data Transfer Length
48 Header-Digest (Optional)
SCSI – The Protocol for All Storage Architectures SNW Spring 2004 Page 49
© Copyright 2004 Storage Networking Industry Association. All Rights Reserved.
Write Command Example
• Before devices can Initiator Target
communicate in iSCSI they Establish Session
(outside scope of this presentation)
Sequence
• When all Data is transferred, Data-Out P
DU
Data Phase
Target sends Status to Initiator
• Session could end at this point PDU
Response
but typically doesn’t Status Pha
se
Remove Session
(outside scope of this presentation)
SCSI – The Protocol for All Storage Architectures SNW Spring 2004 Page 50
© Copyright 2004 Storage Networking Industry Association. All Rights Reserved.
Read Command Example
Initiator Target
Establish Session
• Before devices can communicate (outside scope of this presentation)
Sequence
• When all Data is transferred, U
Data-In PD
Target sends Status to Initiator Data Phase
Remove Session
(outside scope of this presentation)
SCSI – The Protocol for All Storage Architectures SNW Spring 2004 Page 51
© Copyright 2004 Storage Networking Industry Association. All Rights Reserved.
Summary
SCSI – The Protocol for All Storage Architectures SNW Spring 2004 Page 52
© Copyright 2004 Storage Networking Industry Association. All Rights Reserved.
Credit Slide
SCSI – The Protocol for All Storage Architectures SNW Spring 2004 Page 53
© Copyright 2004 Storage Networking Industry Association. All Rights Reserved.