0% found this document useful (0 votes)
78 views53 pages

SCSI A Technical Introduction

SCSI a Technical Introduction

Uploaded by

aix42day
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
78 views53 pages

SCSI A Technical Introduction

SCSI a Technical Introduction

Uploaded by

aix42day
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 53

SCSI - The Protocol for all Storage

Architectures
Neil Edmunds,
Director
Solution Technology, Ltd.

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

Page 1

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
Copyright 2004 Storage Networking Industry Association. All Rights Reserved.

Page 2

Audience Poll
YES/NO Questions (for
example:)
Are you an end user?
Reseller?
Vendor?

Do you have networked


storage in place today?

Have you attended other


SNIA Tutorials?
At this meeting or other
SNIA event?

Have you been SNIAcertified?

NAS or SAN?
Do you plan to within 6 or
12 months?

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

Do you or your staff plan on


taking exam within 6 to 12
months?

Page 3

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
Copyright 2004 Storage Networking Industry Association. All Rights Reserved.

Page 4

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
Copyright 2004 Storage Networking Industry Association. All Rights Reserved.

Page 5

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
Copyright 2004 Storage Networking Industry Association. All Rights Reserved.

Page 6

Introduction to Standards

SCSI Standards and their impact on all storage


interfaces
SCSI The Protocol for All Storage Architectures SNW Spring 2004
Copyright 2004 Storage Networking Industry Association. All Rights Reserved.

Page 7

Standards Organizations
InternationalOrganization
Organizationfor
forStandards
Standards(ISO)
(ISO)
International
AmericanNational
NationalStandards
StandardsInstitute
Institute(ANSI)
(ANSI)
American
IEEE
IEEE

IETF
IETF

INCITS
INCITS

Ethernet
Ethernet
(802.x)
(802.x)

Internet
Internet
Protocol
Protocol

T10SCSI
SCSI
T10

IEEE-1394
IEEE-1394
(Firewire)
(Firewire)

iSCSI
iSCSI
FCIP
FCIP

T11FC
FC
T11
T13ATA
ATA
T13

iFCP
iFCP
SCSI The Protocol for All Storage Architectures SNW Spring 2004
Copyright 2004 Storage Networking Industry Association. All Rights Reserved.

Page 8

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
Copyright 2004 Storage Networking Industry Association. All Rights Reserved.

Page 9

Protocol Service Model


Client I/O System
Application
Layer

Server I/O System

SCSI
SCSI
Application
Application

SCSI
SCSI
Application
Application

Command Set
Standards

SCSITransport
Transport
SCSI
ProtocolServices
Services
Protocol

Transport
Protocol
Standards

SCSI Application
Protocol
Protocol Service Interface

Transport
Protocol
Layer

SCSITransport
Transport
SCSI
ProtocolServices
Services
Protocol

SCSI Transport
Protocol

Interconnect Service Interface


Interconnect
Layer

Interconnect
Interconnect
Services
Services

Interconnect
Interconnect
Services
Services

Interconnect
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
Copyright 2004 Storage Networking Industry Association. All Rights Reserved.

Page 10

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 80s
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
Copyright 2004 Storage Networking Industry Association. All Rights Reserved.

Page 11

SCSI Architectural Model

Characteristics of the SCSI-3 Architecture

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

Page 12

The SCSI Distributed Model

SCSI is a client-server
protocol.
The client is called the
Initiator (usually the OS I/O
subsystem) and issues
requests to the server.
The server is called the
Target (usually the SCSI
controller that is part of a
storage device) and
receives, executes and
returns Initiator requests
and their associated
responses.

Client-Server Transaction
Server
Client
Target
Initiator
Server Request
Server Response

Protocol Service Interface

Service Delivery Subsystem

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

Page 13

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
Application
Application
Application
Clients

Task Management Response

Task
Manager

Device Server Request


Device Server Response

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

Device
Server

Logical
Units

Page 14

Re-cap SCSI Terminology

SCSI is a standard that defines an


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

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

Initiator

Interface

Target
Logical Units

Page 15

SCSI Structural Model

Represents a view of the elements


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.
a Domain is made up of SCSI
devices
and a Service Delivery
Subsystem that transports
Commands, Data, and related
information

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

I/O System

Domain
ServiceDelivery
DeliverySubsystem
Subsystem
Service
SCSI
SCSI
Device
Device

SCSI
SCSI
Device
Device

SCSI
SCSI
Device
Device

SCSI
SCSI
Device
Device

Page 16

Initiator Device Model

SCSIInitiator
Initiator
SCSI
Device
Device

A SCSI Initiator device contains:


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

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

Initiator
Initiator
Device
Device
Name
Name

SCSI
SCSI
Initiator
Initiator
Port
Port

Initiator
Initiator
Port
Port
Name
Name

Application
Application
Client
Client

Initiator
Initiator
Port
Port
Identifier
Identifier

Page 17

Target Device Model


A SCSI Target device contains:
Zero or more Target device
names
One or more SCSI Target
ports each containing
a Task Router,
SCSI Target Port Identifier,
and an optional Target Port
Name
One or more Logical Units

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

SCSITarget
Target
SCSI
Device
Device

Target
Target
Device
Device
Name
Name

Target
Target
Port
Port
Name
Name

SCSI
SCSI
Target
Target
Port
Port

Target
Target
Port
Port
Identifier
Identifier

Logical
Logical
Unit
Unit

Target
Target
Router
Router

Page 18

Logical Unit Model


LogicalUnit
Unit
Logical
Name
Name

LogicalUnit
Unit
Logical
Number
Number

A Logical Unit contains:

Logical
Logical
Unit
Unit
Device
Device
Server
Server

TaskSet
Set
Task
(Queue)
(Queue)

Untagged
Untagged
Task
Task

Task
Task
Manager
Manager

Tagged
Tagged
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
Copyright 2004 Storage Networking Industry Association. All Rights Reserved.

Page 19

Tasks

Task = the work to be performed by the Logical Unit


A single Command
A group of linked Commands

Initiator

Two types of SCSI Tasks


Tagged
Untagged

Untagged Task
Represented by an I_T_L nexus

Represented by an I_T_L_Q nexus

Target

Tagged Task
Nexus

Logical Units

Methodology used to uniquely identify an I/O


Operation between an Initiator, Target, Logical
Unit, and an optional Queue Tag
SCSI The Protocol for All Storage Architectures SNW Spring 2004
Copyright 2004 Storage Networking Industry Association. All Rights Reserved.

Queue

Task
Sets

Page 20

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
Copyright 2004 Storage Networking Industry Association. All Rights Reserved.

Page 21

I/O Operations

Characteristics of SCSI I/O Operations

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

Page 22

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
Copyright 2004 Storage Networking Industry Association. All Rights Reserved.

Page 23

SCSI I/O Operations

At a minimum, SCSI I/O


Operations consist of:
An Initiator issuing a
SCSI Command
A Target returning
completion Status
There is no Data
transfer between Initiator
and Target

Initiator

Target
SCSI Command
SCSI Status
Interconnecting
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
Copyright 2004 Storage Networking Industry Association. All Rights Reserved.

Page 24

Operations that move Data

When an Initiator and Target need


to exchange information
They utilize a Data phase
Data In transmits information
from the Target to the Initiator
Data Out transmits information
from the Initiator to the Target

Initiator

Data can be transmitted all at once


or take numerous Data phases to
complete information transfers
Types of Commands

Target
SCSI Command
Read or Write
Data
SCSI Status
Interconnecting
Interconnecting
Subsystem
Subsystem

Read or Write
Inquiry

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

Page 25

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
bit 7

Example
Six Byte CDB

byte 0
byte 1
byte 2
byte 3

bit 6
Reserved

byte 4

How many
byte 5
bytes to
transfer

bit 5

bit 4
bit 3
bit 2
Operation code
(MSB)
Logical block address (if required)

bit 1

Informs the Target


bit 0
where to start the
transfer
(LSB)

Transfer length (if required)


Parameter list length (if required)
Allocation length (if required)
Control byte

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

How many blocks


(512 bytes) to
transfer

Page 26

Other CDB Formats


Ten Byte CDB
bit 7

CBDs can be:

10 bytes
12 bytes
16 bytes
or even
variable
bytes in
length

byte 0
byte 1
byte 2
byte 3
byte 4
byte 5
byte 6
byte 7

bit 6

bit 5

Reserved

bit 4
bit 3
bit 2
bit 1
Operation code
Service Action (if required)

bit 0

(MSB)
Logical block address (if required)
(LSB)
Reserved
Transfer length (if required)
Parameter List Length (if required)
Allocation length (if required)
Control byte

(MSB)

byte 8
byte 9

(LSB)

Twelve Byte CDB


bit 7
byte 0
byte 1
byte 2
byte 3
byte 4
byte 5
byte 6
byte 7
byte 8
byte 9
byte 10
byte 11

bit 6
Reserved

bit 5

bit 4
bit 3
bit 2
bit 1
Operation code
Service Action (if required)

bit 0

(MSB)
Logical block address (if required)
(LSB)
(MSB)

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

Transfer length (if required)


Parameter list length (if required)
Allocation length (if required)
Reserved
Control byte

(LSB)

Page 27

SCSI Commands all Devices


There are standard SCSI
Commands for:

Disk
Tape
Storage Enclosures
Disk Arrays
CD
WORM
Media Changers
Every device imaginable or
not yet created

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

Op. Code
00h
03h
12h
15h
18h
1Ah
1Ch
1Dh
39h
3Ah
3Bh
3Ch
4Ch
4Dh
55h
5Ah

Command Name
TEST UNIT READY
REQUEST SENSE
INQUIRY
MODE SELECT(6)
COPY
MODE SENSE(6)
RECEIVE DIAGNOSTIC RESULTS
SEND DIAGNOSTIC
COMPARE
COPY AND VERIFY
WRITE BUFFER
READ BUFFER
LOG SELECT
LOG SENSE
MODE SELECT(10)
MODE SENSE(10)

Type
M
Z
M
Z
O
Z
O
O
O
O
Z
O
O
O
Z
Z

Page 28

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
Copyright 2004 Storage Networking Industry Association. All Rights Reserved.

Page 29

Parallel SCSI

Initiator

SCSI
SCSI
Application
Application

Target
SCSI Application
Protocol

SCSI
SCSI
Application
Application

Command Set
Standards

SCSI Transport
SCSI Transport
Protocol Services
Protocol Services

SCSI-3
Parallel
Interface

Interconnect
Interconnect
Services
Services

SCSI-3
Parallel
Interface

Protocol Service Interface

SCSI Transport
SCSI Transport
Protocol Services
Protocol Services

SCSI Transport
Protocol
Interconnect Service Interface

Interconnect
Interconnect
Services
Services
SCSI-3 Parallel Bus

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

Page 30

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 IDs 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
Copyright 2004 Storage Networking Industry Association. All Rights Reserved.

Page 31

Read Command Example


Initiator

Initiator connects to Target


Once Initiator connects to
Target, the Target is in control
of the I/O Process

Initiator sends CDB information


via Command Phases
Target returns requested
information via Data Phase
Target returns completion
information via Status Phase
Target Disconnects via Message
Phase

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

Target
Connectio
n
Arbitrate a
nd Select
CDB 0x28
00

00 10 00 00

00 0A 00 00
Command
Phase

n
Informatio
d
a
e
R
d
te
s
Reque
Data Phase
n
Informatio
d
a
e
R
d
te
s
Reque
Data Phase
tion 0x00
a
m
r
fo
In
n
Completio
se
Status Pha
tion 0x00
Disconnec
hase
Message P

Page 32

Fibre Channel

Originator

SCSI
SCSI
Application
Application

Responder
SCSI Application
Protocol

SCSI
SCSI
Application
Application

Command Set
Standards

SCSI Transport
SCSI Transport
Protocol Services
Protocol Services

Fibre Channel
Protocol (FCP)

Interconnect
Interconnect
Services
Services

Fibre Channel)

Protocol Service Interface

SCSI Transport
SCSI Transport
Protocol Services
Protocol Services

SCSI Transport
Protocol
Interconnect Service Interface

Interconnect
Interconnect
Services
Services
Fibre Channel Serial Interface

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

Page 33

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
Copyright 2004 Storage Networking Industry Association. All Rights Reserved.

Page 34

Fibre Channel Hierarchy


Session
Exchange = I/O Process

Start of
Frame
4 bytes

Sequence 1

Sequence 2

Sequence 3

Sequence n

Frame 1

Frame 1

Frame 1

Frame 1

Frame 2

Frame 2

Frame n

Frame n

Payload - up to 2112 bytes

Header
24 bytes

Optional Header

Standard Payload

64 Bytes

2048 Bytes

CRC

End of

4 bytes

Frame
4 bytes

Last Sequence
Frame 1

Mandatory 6 words used to:


Word

bits 31 to 24

R_CTL

D_ID

Reserved

S_ID

TYPE

F_CTRL

SEQ_ID

4
5

bits 23 to 16

bits 15 to 8

DF_CTL
OX_ID

bits 7 to 0

SEQ_CNT

identifies type of frame, where it


came from, where its going to,
contents of payload, and other
Sequence and Exchange identifiers

RX_ID
PARAMETER

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

Page 35

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
Equivalent to parallel SCSI Data Phase

FCP_RSP frame

SCSI Function

FCP Equivalent

I/O Operation

Exchange

Protocol Service Request and Response

Sequence

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
Copyright 2004 Storage Networking Industry Association. All Rights Reserved.

Page 36

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

4 bytes

24 bytes

Word
0
1

Byte 0

reserved

3
4
5
6

CRC

Payload
24 bytes

Byte 1

EOF

4 bytes 4 bytes

Byte 2

Byte 3

Single Level LUN

Task Codes

FCP_LUN
Task Mgmt Flags

Exec Mgmt Codes

Byte 0 of CDB Byte 1 of CDB Byte 2 of CDB Byte 3 of CDB


Byte 4 of CDB Byte 5 of CDB Byte 6 of CDB Byte 7 of CDB
Byte 8 of CDB Byte 9 of CDB Byte 10 of CDB Byte 11 of CDB
Byte 12 of CDB Byte 13 of CDB Byte 14 of CDB Byte 15 of CDB

7 Data Length MSB

Data Length

Data Length

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

Data Length LSB

FCP_CNTL
FCP_CDB

FCP_DL

Page 37

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

4 bytes

24 bytes

Word
0
1
2

CRC

Payload
12 bytes

Byte 0
msb
msb
reserved

Byte 1
RELATIVE
BURST
reserved

EOF

4 bytes 4 bytes

Byte 2
OFFSET
LENGTH
reserved

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

Byte 3
lsb
lsb
reserved

Page 38

FCP_DATA frame
The Data Payload can be variable up to 2048 bytes
in length.

SOF

Header

4 bytes

24 bytes

Payload
128 to 2048 bytes

CRC

EOF

4 bytes 4 bytes

FCP_DATA
FCP_DATA
128
128to
to2048
2048bytes
bytes

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

Page 39

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

4 bytes

24 bytes
Word
0
1

Byte 0

reserved

3
4
5

MSB
MSB
MSB

6
7

reserved
reserved

8
n

CRC

Payload
Up to 256 bytes

Byte 1

EOF

4 bytes 4 bytes
Byte 2

Byte 3
Reserved

reserved

Validity Flags

SCSI Status byte


LSB
LSB
LSB

reserved
reserved

Byte 0 Sense Data Byte 1 Sense Data


...
...

FCP_STATUS
FCP_RESID
FCP_SNS_LEN
FCP_RSP_LEN

reserved
reserved

RSP_CODE
reserved

FCP_RSP_INFO

...
...

...
Byte n Sense Data

FCP_SNS_INFO

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

Page 40

Write Command Example

Responder
Establish Session
(outside scope of this presentation)

FCP_CMD
Frame (Wr
ite)
Command
Phase
e
_RDY Fram
R
E
F
X
_
P
C
F
for Data)
y
d
a
e
r
is
r
(Responde
FCP_DATA
Frame
Data Phase
FCP_DATA
Frame
Data Phase

Sequence

Originator

Exchange

Before devices can communicate


in FC they must establish a
session via login protocol
Originator sends Write command
to responder
Responder replies with a ready to
receive response
Originator sends Data frames
When all Data is transferred,
Responder sends Status to
Originator
Session could end at this point
but typically doesnt

Frame
FCP_RSP
se
Status Pha
Remove Session
(outside scope of this presentation)

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

Page 41

iSCSI

Initiator

SCSI
SCSI
Application
Application

Target
SCSI Application
Protocol

SCSI
SCSI
Application
Application

Command Set
Standards

iSCSI Transport
iSCSI Transport
Protocol Services
Protocol Services

iSCSI
Protocol
Standard

Protocol Service Interface

IP
IP
Network
Network
iSCSI
Gateway

FC
FCSAN
SAN

iSCSI Transport
iSCSI Transport
Protocol Services
Protocol Services

iSCSI Transport
Protocol
Interconnect Service Interface

Interconnect
Interconnect
Services
Services

Interconnect
Interconnect
Services
Services

TCP
TCP

TCP
TCP

IP
IP

IP
IP

Data Link
Data Link

Data Link
Data Link

Internet
Engineering
Task
Force
Standards

IP Network

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

Page 42

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 PDUs. 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
Copyright 2004 Storage Networking Industry Association. All Rights Reserved.

Page 43

iSCSI Encapsulation
Initiator

SCSI
SCSI
Application
Application

Target
SCSI Application
Protocol

SCSI
SCSI
Application
Application

Data

Data

Data

Protocol Service Interface

iSCSI Transport
iSCSI Transport
Protocol Services
Protocol Services

iSCSI Transport
Protocol

iSCSI Transport
iSCSI Transport
Protocol Services
Protocol Services

PDU Header

PDU Data

Interconnect
Interconnect
Services
Services

TCP
TCP

TCP
TCP

IP
IP

IP
IP

Data Link
Data Link

Data Link
Data Link

TCP
Header
IP
Header
Ethernet
Header

TCP Segment
IP Packet (Datagrams)

Ethernet Frame

FCS

Interconnect
Interconnect
Services
Services

CHK

Interconnect Service Interface

IP Network

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

Page 44

SCSI Command PDU

Byte
0
4
8+
16

Byte 0

Byte 1

Byte 2

Byte 3

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

.|I|

0x01

F|R|W|. .| ATTR

Reserved

TotalAHSLength

DataSegmentLength
Logical Unit Number (LUN)
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
Copyright 2004 Storage Networking Industry Association. All Rights Reserved.

Page 45

SCSI Response PDU


Byte
0
4
8+
16

Byte 0

Byte 1

Byte 2

Byte 3

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

Response

Status

.|.|

0x21

1|. .|o|u|O|U|.

TotalAHSLength

DataSegmentLength
Reserved
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
Copyright 2004 Storage Networking Industry Association. All Rights Reserved.

Page 46

SCSI Data-out PDU


Byte
0
4
8+
16

Byte 0

Byte 1

Byte 2

Byte 3

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

.|.|

0x05

F|

Reserved

TotalAHSLength

DataSegmentLength
LUN or Reserved
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
Copyright 2004 Storage Networking Industry Association. All Rights Reserved.

Page 47

SCSI Data-in PDU


Byte
0
4
8+
16

Byte 0

Byte 1

Byte 2

Byte 3

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

Reserved

Status or Rsvd

.|.|

0x25

F|A|0 0 0|O|U|S

TotalAHSLength

DataSegmentLength
LUN or Reserved
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
Copyright 2004 Storage Networking Industry Association. All Rights Reserved.

Page 48

Ready To Transfer (R2T)


Byte
0
4
8+
16

Byte 0

Byte 1

Byte 2

Byte 3

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

.|.|

0x31

1|

Reserved

TotalAHSLength

DataSegmentLength
LUN
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
Copyright 2004 Storage Networking Industry Association. All Rights Reserved.

Page 49

Write Command Example

Initiator

Target
Establish Session
(outside scope of this presentation)

Command
PDU (Write
)
Command
Phase
R2T PDU
)
dy for Data
a
e
r
is
t
e
g
r
(Ta
Data-Out P
DU
Data Phase
Data-Out P
DU
Data Phase

Sequence

Before devices can


communicate in iSCSI they
must establish a session via
login protocol
Initiator sends Write command
to Target
Target replies with a ready to
transmit R2T response
Initiator sends Data frames
When all Data is transferred,
Target sends Status to Initiator
Session could end at this point
but typically doesnt

PDU
Response
se
Status Pha
Remove Session
(outside scope of this presentation)

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

Page 50

Read Command Example


Initiator

Establish Session
(outside scope of this presentation)

Command
PDU (Read
)
Command
Phase

Sequence

Before devices can communicate


in iSCSI they must establish a
session via login protocol
Initiator sends Read command
to Target
Target sends Data frames
When all Data is transferred,
Target sends Status to Initiator
Session could end at this point
but typically doesnt

Target

U
Data-In PD
Data Phase
U
Data-In PD
Data Phase
PDU
Response
se
Status Pha

Remove Session
(outside scope of this presentation)

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

Page 51

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
Copyright 2004 Storage Networking Industry Association. All Rights Reserved.

Page 52

Credit Slide

Please send any questions or comments on this presentation to:


[email protected]
Many thanks to the following SNIA members for their
contributions to this tutorial:
Developer: David Deming, Solution Technology,
[email protected]
Reviewers:
Rob Elliott, HP, [email protected]
LeRoy Budnik, Knowledge Transfer, [email protected]
Charles Curtis, HP, [email protected]
Antolin Agatep, Xilinx, [email protected]

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

Page 53

You might also like