You are on page 1of 53

SCSI - The Protocol for all Storage

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

• The material contained in this tutorial is copyrighted


by the SNIA.
• Member companies and individuals may use this
material in presentations and literature under the
following conditions:
– Any slide or slides used must be reproduced without
modification
– The SNIA must be acknowledged as source of any
material used in the body of any document containing
material from these presentations.
• This presentation is a project of the SNIA Education
Committee.
SCSI – The Protocol for All Storage Architectures SNW Spring 2004 Page 2
© Copyright 2004 Storage Networking Industry Association. All Rights Reserved.
Audience Poll

• YES/NO Questions (for • Have you attended other


example:) SNIA Tutorials?
• Are you an end user? – At this meeting or other
– Reseller? SNIA event?
– Vendor? • Have you been SNIA-
• Do you have networked certified?
storage in place today? – Do you or your staff plan on
taking exam within 6 to 12
– NAS or SAN?
months?
– Do you plan to within 6 or
12 months?

SCSI – The Protocol for All Storage Architectures SNW Spring 2004 Page 3
© Copyright 2004 Storage Networking Industry Association. All Rights Reserved.
Objectives

• Brief understanding of SCSI and its history


• Understanding of industry standards and the role of
the SCSI Architecture
• Understanding the SCSI Architecture model
• Understanding the I/O Operation and the importance
behind SCSI Protocol
• Learn how parallel SCSI, Fibre Channel, and iSCSI
rely on the SCSI Architecture to support storage
applications

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 Standards and their impact on all storage


interfaces

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

Shared Command Set


Architectural Model

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

Client I/O System Server I/O System


Application SCSI SCSI Command Set
SCSI SCSI Application SCSI
Layer Application Application Standards
Application Protocol Application
Protocol Service Interface

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

• one of the most appealing feature behind the SCSI Architecture,


i.e. the SCSI language
• includes every type of storage device manufactured today; disk,
tape, CD, storage enclosures, etc…
• manufacturer independent and are common for all types of
devices
• SCSI device drivers and operating systems have utilized SCSI
Command Sets since the late 80’s
• can be used in any storage architecture including Fibre
Channel, iSCSI, InfiniBand, ATA/IDE, SATA (Serial ATA), SAS
(Serial Attached SCSI), 1394 (Firewire)

SCSI – The Protocol for All Storage Architectures SNW Spring 2004 Page 11
© Copyright 2004 Storage Networking Industry Association. All Rights Reserved.
SCSI Architectural Model

Characteristics of the SCSI-3 Architecture

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 is a client-server Client-Server Transaction


protocol. Client Server
Initiator Target
• The client is called the
Server Request
Initiator (usually the OS I/O
subsystem) and issues Server Response
requests to the server.
• The server is called the
Target (usually the SCSI Protocol Service Interface
controller that is part of a
storage device) and
receives, executes and
returns Initiator requests Service Delivery Subsystem
and their associated
responses.

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

Task Management Request


Application Task
Application Task Management Response
Manager
Application
Application Device Server Request Logical
Device
Clients Device Server Response
Server
Units

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 is a standard that defines an


interface between an Initiator (usually
a computer) and a Target (usually a Initiator
storage device such as a hard disk,
tape backup, or storage array).
• Interface refers to connectors, cables,
electrical signals, optical signals and Interface
the command protocol that allow
initiators and targets to communicate.
• Logical Units are a subset of Target Target
devices which can allow for
scalability.
Logical Units

SCSI – The Protocol for All Storage Architectures SNW Spring 2004 Page 15
© Copyright 2004 Storage Networking Industry Association. All Rights Reserved.
SCSI Structural Model

• Represents a view of the elements I/O System


comprising a SCSI I/O system as
seen by the application clients
interacting with the system.
• The fundamental object is the
SCSI Domain that represents an
I/O system. Domain
– a Domain is made up of SCSI ServiceDelivery
DeliverySubsystem
Subsystem
devices Service
– and a Service Delivery
Subsystem that transports SCSI
SCSI SCSI
SCSI SCSI
SCSI SCSI
SCSI
Commands, Data, and related Device Device Device Device
information Device Device Device Device

SCSI – The Protocol for All Storage Architectures SNW Spring 2004 Page 16
© Copyright 2004 Storage Networking Industry Association. All Rights Reserved.
Initiator Device Model

• A SCSI Initiator device contains: SCSIInitiator


SCSI Initiator
Device
Device
– Zero or more Initiator device
names
– One or more SCSI Initiator Initiator SCSI
Initiator SCSI Application
ports each containing Device Initiator Application
Device Initiator Client
• an Initiator Port Identifier Name Port Client
Name Port
• and an optional Initiator
Port Name
Initiator
Initiator Initiator
Initiator
– One or more Application Port Port
Port Port
Clients Name Identifier
Name Identifier

SCSI – The Protocol for All Storage Architectures SNW Spring 2004 Page 17
© Copyright 2004 Storage Networking Industry Association. All Rights Reserved.
Target Device Model

• A SCSI Target device contains: SCSITarget


Target
SCSI
– Zero or more Target device Device
Device
names
– One or more SCSI Target Target SCSI Logical
Target SCSI Logical
ports each containing Device
Device Target
Target Unit
Unit
• a Task Router, Name
Name Port
Port
• SCSI Target Port Identifier,
• and an optional Target Port Target
Target Target
Target Target
Target
Name Port
Port Port
Port Router
Router
Name
Name Identifier
Identifier
– One or more Logical Units

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

Characteristics of SCSI 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

• There are two categories of Protocol Services:


- Execute Command and Confirmation Services
- Data Transfer Services
• There are three main phases of an I/O operation that
includes a data transfer:
1. Command: Send required command and
parameters via a Command Descriptor Block
(CDB)
2. Data: Transfer data in accordance with the
command
3. Status: Receive confirmation of command
execution
SCSI – The Protocol for All Storage Architectures SNW Spring 2004 Page 23
© Copyright 2004 Storage Networking Industry Association. All Rights Reserved.
SCSI I/O Operations

• At a minimum, SCSI I/O


Operations consist of:
– An Initiator issuing a Initiator Target
SCSI Command
– A Target returning SCSI Command
completion Status
– There is no “Data” SCSI Status
transfer between Initiator Interconnecting
and Target Interconnecting
Subsystem
Subsystem
• Types of Commands that do
not move Data
– Test Unit Ready
– Start/Stop Unit
– Rewind

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

• When an Initiator and Target need


to exchange information
– They utilize a Data phase
– Data In transmits information Initiator Target
from the Target to the Initiator SCSI Command
– Data Out transmits information
Read or Write
from the Initiator to the Target Data
• Data can be transmitted all at once SCSI Status
or take numerous Data phases to Interconnecting
Interconnecting
complete information transfers Subsystem
Subsystem

• 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

Informs the Target


bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0
byte 0 Operation code
“where” to start the
byte 1 Reserved (MSB) transfer
Example byte 2 Logical block address (if required)
byte 3 (LSB)
Six Byte CDB Transfer length (if required)
byte 4 Parameter list length (if required) “How many” blocks
“How many” Allocation length (if required)
(512 bytes) to
byte 5 Control byte
bytes to transfer
transfer

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

Op. Code Command Name Type


• There are standard SCSI 00h TEST UNIT READY M
Commands for: 03h
12h
REQUEST SENSE
INQUIRY
Z
M
15h MODE SELECT(6) Z
– Disk 18h COPY O
1Ah MODE SENSE(6) Z
– Tape 1Ch RECEIVE DIAGNOSTIC RESULTS O
1Dh SEND DIAGNOSTIC O
– Storage Enclosures 39h COMPARE O
– Disk Arrays 3Ah
3Bh
COPY AND VERIFY
WRITE BUFFER
O
Z
– CD 3Ch
4Ch
READ BUFFER
LOG SELECT
O
O
– WORM 4Dh
55h
LOG SENSE
MODE SELECT(10)
O
Z
– Media Changers 5Ah MODE SENSE(10) Z

– Every device imaginable or


not yet created

SCSI – The Protocol for All Storage Architectures SNW Spring 2004 Page 28
© Copyright 2004 Storage Networking Industry Association. All Rights Reserved.
SCSI Status

• Any time a SCSI Command


is sent to a Target
– The Initiator expects a
completion Status
– This status can reflect
successful or
unsuccessful completion
of the command
• The Status may indicate
– Busy or Not Ready
– Error condition exists for
another command
– Targets task set is full

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

Protocol Service Interface

SCSI Transport SCSI Transport SCSI-3


SCSI Transport SCSI Transport SCSI Transport
Protocol Services Protocol Services Parallel
Protocol Services Protocol Protocol Services Interface

Interconnect Service Interface

Interconnect Interconnect SCSI-3


Interconnect Interconnect
Services Services Parallel
Services Services
Interface

SCSI-3 Parallel Bus

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

Protocol Service Interface

SCSI Transport SCSI Transport Fibre Channel


SCSI Transport SCSI Transport SCSI Transport
Protocol Services Protocol Services Protocol (FCP)
Protocol Services Protocol Protocol Services

Interconnect Service Interface

Interconnect Interconnect Fibre Channel)


Interconnect Interconnect
Services Services
Services Services

Fibre Channel Serial Interface

SCSI – The Protocol for All Storage Architectures SNW Spring 2004 Page 33
© Copyright 2004 Storage Networking Industry Association. All Rights Reserved.
FC Characteristics

• Full-duplex, bidirectional serial links


– 1 or 2 Gb/s now – 4 and 10Gb/s later
– Up to 10km links – some cases allow 100km
• Interconnected via switches and/or hubs
– Switched fabric if switches are used
– Hubs connect loop devices and requires arbitration
– Typically referred to as a Storage Area Network (SAN)
• Requires login/logout procedures
– Process Login for SCSI Layer
– Fabric Login if switches are used
• All information is transferred in packets (frames)
• SCSI CDB, Data, and Status information is wrapped in Fibre Channel
frames
• Utilizes Sessions, Exchanges, and Sequences

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

Exchange = I/O Process

Sequence 1 Sequence 2 Sequence 3 Sequence n Last Sequence

Frame 1 Frame 1 Frame 1 Frame 1 Frame 1

Frame 2 Frame 2

Frame n Frame n

Start of Header Payload - up to 2112 bytes CRC End of


Frame Optional Header Standard Payload Frame
4 bytes 24 bytes 64 Bytes 2048 Bytes 4 bytes 4 bytes

Mandatory 6 words used to:


Word bits 31 to 24 bits 23 to 16 bits 15 to 8 bits 7 to 0
0 R_CTL D_ID identifies type of frame, where it
1 Reserved S_ID came from, where it’s going to,
2 TYPE F_CTRL
contents of payload, and other
3 SEQ_ID DF_CTL SEQ_CNT
Sequence and Exchange identifiers
4 OX_ID RX_ID
5 PARAMETER

SCSI – The Protocol for All Storage Architectures SNW Spring 2004 Page 35
© Copyright 2004 Storage Networking Industry Association. All Rights Reserved.
FCP Characteristics

• Session - no actual parallel SCSI equivalent


• Exchange = SCSI I/O Operation
• Sequence - no actual parallel SCSI equivalent
• FCP_CMD frame
– Equivalent to parallel SCSI Command Phase
• FCP_XFER_RDY frame
– No actual parallel SCSI Equivalent
• FCP_DATA frame SCSI Function FCP Equivalent
– Equivalent to parallel SCSI Data Phase I/O Operation Exchange
Protocol Service Request and Response Sequence
• FCP_RSP frame Send SCSI Command Request Unsolicited command IU (FCP_CMD)
– Equivalent to parallel SCSI Status PhaseData delivery request Data descriptor IU (FCP_XFR_RDY)
Data delivery action Solicited data IU (FCP_DATA)
Send Command Complete Response Command status IU (FCP_RSP)
REQ/ACK for Command Complete Confirmation IU (FCP_CONF)

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.

SOF Header Payload CRC EOF


24 bytes
4 bytes 24 bytes 4 bytes 4 bytes

Word Byte 0 Byte 1 Byte 2 Byte 3


0 Single Level LUN
FCP_LUN
1
2 reserved Task Codes Task Mgmt Flags Exec Mgmt Codes FCP_CNTL
3 Byte 0 of CDB Byte 1 of CDB Byte 2 of CDB Byte 3 of CDB
4 Byte 4 of CDB Byte 5 of CDB Byte 6 of CDB Byte 7 of CDB FCP_CDB
5 Byte 8 of CDB Byte 9 of CDB Byte 10 of CDB Byte 11 of CDB
6 Byte 12 of CDB Byte 13 of CDB Byte 14 of CDB Byte 15 of CDB
7 Data Length MSB Data Length Data Length Data Length LSB FCP_DL

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

SOF Header Payload CRC EOF


12 bytes
4 bytes 24 bytes 4 bytes 4 bytes

Word Byte 0 Byte 1 Byte 2 Byte 3


0 msb RELATIVE OFFSET lsb
1 msb BURST LENGTH lsb
2 reserved reserved reserved reserved

SCSI – The Protocol for All Storage Architectures SNW Spring 2004 Page 38
© Copyright 2004 Storage Networking Industry Association. All Rights Reserved.
FCP_DATA frame

• The Data Payload can be variable up to 2048 bytes


in length.

SOF Header Payload CRC EOF


128 to 2048 bytes
4 bytes 24 bytes 4 bytes 4 bytes

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.

SOF Header Payload CRC EOF


Up to 256 bytes
4 bytes 24 bytes 4 bytes 4 bytes

Word Byte 0 Byte 1 Byte 2 Byte 3


0 Reserved
1
2 reserved reserved Validity Flags SCSI Status byte FCP_STATUS

3 MSB LSB FCP_RESID


4 MSB LSB FCP_SNS_LEN
5 MSB LSB FCP_RSP_LEN

6 reserved reserved reserved RSP_CODE


FCP_RSP_INFO
7 reserved reserved reserved reserved
8 Byte 0 Sense Data Byte 1 Sense Data ... ... FCP_SNS_INFO
n ... ... ... Byte n Sense Data

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)

session via login protocol


FCP_CMD
• Originator sends Write command Frame (Wr
Command ite)
Phase
to responder
e
• Responder replies with a ready to P _ XF E R _RDY Fram
FC
r ea dy for Data)
receive response (Responde
r is

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

Protocol Service Interface

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

iSCSI Interconnect Interconnect


Interconnect Interconnect
Gateway Services
Services
Services
Services
Internet
TCP TCP Engineering
FC
FCSAN
SAN
TCP TCP
Task
IP IP Force
IP IP Standards

Data Link Data Link


Data Link Data Link

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

Protocol Service Interface

iSCSI Transport iSCSI Transport


iSCSI Transport iSCSI Transport iSCSI Transport
Protocol Services Protocol Services
Protocol Services Protocol Protocol Services PDU Header PDU Data
Interconnect Service Interface

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

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 .|I| 0x01 F|R|W|. .| ATTR Reserved
4 TotalAHSLength DataSegmentLength
8+ Logical Unit Number (LUN)
16 Initiator Task Tag
20 Expected Data Transfer Length
24 CmdSN
28 ExpStatSN
32+ SCSI Command Descriptor Block (CDB)
48 AHS (if any) + Header-Digest (Optional)
+ DataSegment (Command Data)+ Data-Digest (Optional)

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)

must establish a session via


Command
login protocol PDU (Write
)
Command
Phase
• Initiator sends Write command
to Target R2T PDU )
• Target replies with a ready to r ge t is r eady for Data
(Ta
transmit R2T response Data-Out P
DU
Data Phase
• Initiator sends Data frames

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)

in iSCSI they must establish a Command


PDU (Read
session via login protocol Command
Phase
)

• Initiator sends Read command


to Target U
Data-In PD
• Target sends Data frames Data Phase

Sequence
• When all Data is transferred, U
Data-In PD
Target sends Status to Initiator Data Phase

• Session could end at this point PDU


Response
se
but typically doesn’t Status Pha

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 is the language of LOVE


• Every storage architecture utilizes the SCSI model
• SCSI Commands sets are available for every type of storage device
even including host-to-host
• An I/O Process is interface independent and is made up of:
– Command Phase
– Optional Data Phase
– and a Status Phase
• SCSI language is here to stay and will be integrated in every storage
architecture
• For more information on standards see: incits.org, t10.org, t11.org,
t13.org, ietf.org, scsita.org, fibrechannel.org

SCSI – The Protocol for All Storage Architectures SNW Spring 2004 Page 52
© Copyright 2004 Storage Networking Industry Association. All Rights Reserved.
Credit Slide

• Please send any questions or comments on this presentation to:


snia-snw-scsi@snia.org
• Many thanks to the following SNIA members for their
contributions to this tutorial:
Developer: David Deming, Solution Technology,
ddeming@soltechnology.com
Reviewers:
Rob Elliott, HP, elliott@hp.com
LeRoy Budnik, Knowledge Transfer, lbudnik@ktilwf04.knowledgetransfer.net
Charles Curtis, HP, charles.curtis@hp.com
Antolin Agatep, Xilinx, Antolin.Agatep@xilinx.com

SCSI – The Protocol for All Storage Architectures SNW Spring 2004 Page 53
© Copyright 2004 Storage Networking Industry Association. All Rights Reserved.

You might also like