Title: What%20is%20SCSI?
1What is SCSI?
Small Computer System Interface
- SCSI is
- a Specification
- a Bus
- a Protocol
2SCSI Terms
Initiator A SCSI device that requests an
operation to be performed by another SCSI
device. Host Adapter A Controller Board that
translates host I/O requests into SCSI
requests. Target A SCSI device that performs
an operation as requested by an
initiator. Logical Unit A Physical or Virtual
device addressable through a target. LUN Logi
cal Unit Number. An encoded three-bit
identifier for the logical unit.
3SCSI Terms
SCSI Device A Host Adapter or Intelligent
Peripheral which can be attached to a SCSI
bus. SCSI Address The hex representation (0-7
or 0-F) of the unique address assigned to a
SCSI device. Connect The function which occurs
when an initiator selects a target to begin an
operation. Disconnect The function which occurs
when a target releases control of the SCSI bus,
allowing it to go Bus Free. Reconnect The
function which occurs when a targets selects
an initiator to continue an operation after a
disconnect.
4SCSI Configuration Single Initiator, Single Target
LUN0
Initiator
Target
LUN1
SCSI Bus
LUN2
5SCSI Configuration Single Initiator, Multiple
Targets
Target 0
Initiator 7
Target 1
SCSI Bus
Target n
SCSI Bus Terminator
6SCSI Configuration Multiple Initiators, Multiple
Targets
Target 0
Initiator 7
Target 1
SCSI Bus
Initiator 6
Target n
7SCSI Parallel Bus Types
Single-Ended - Single Signal Level - 6m max.
bus length - No Fast Timings - Uses Even bus
pins only Differential - Dual Signal Level -
25m max. bus length - Fast Timings - Uses all
pins on bus LVDS (SCSI-3) - 3VDC Diff Bus
5V
-SIG
FALSE
TRUE
0V
TRUE -SIG lt 1.5V
5V
-SIG
TRUE
FALSE
SIG
0V
TRUE SIG gt -SIG
8SCSI Parallel Bus Protocol
- Bus Phases and their Sequencing
- MSG, C/D, I/O collectively known as Bus Phase
- Initiator and Target Roles
- Initiator Begins an Operation
- Target controls operation via Bus Phase and REQ
- Initiator can disrupt sequence with ATN and RST
9SCSI Parallel Bus Signals 50 Pin Bus (Narrow), 68
Pin Bus (Wide)
DB(0-7,P1) I/T 8 Bit Data Bus with Odd
Parity DB(8-15, P2) I/T 2nd 8 Bit Data Bus with
Odd Parity (Wide Only) REQuest T Asking for data
byte to be sent/on bus ACKnowledge I Indicates
data byte on bus/read byte ATtentionN I Indicates
pending message for target SELect I/T Indicates
Selection/Reselection in progress BuSY I/T Indica
tes SCSI Bus in use ReSeT I Resets all SCSI
devices MeSsaGe T Indicates Message
Byte Cmd/Data T Indicates Command/Msg or
Data In/Out T Indicates Data Direction
10SCSI Bus Phases
BSY SEL MSG C/D I/O Definition 0
x x x x Bus Free (Idle) 1 1 x
x 0 Selection 1 1 x x
1 Reselection 1 0 0 0 0 Data Out I
-gt T 1 0 0 0 1 Data In I lt- T 1
0 0 1 0 Command I -gt T 1 0 0
1 1 Status I lt- T 1 0 1 0
0 (Reserved) 1 0 1 0 1 (Reserved)
1 0 1 1 0 Message Out I -gt T 1 0
1 1 1 Message In I lt- T
11Asynchronous Bus Conditions
Attention Condition - Initiator asserts ATN to
indicate pending message for target - Next Bus
Phase change will be to Message Out phase Reset
Condition - Initiator asserts RESET for 25
usec - Devices currently on the SCSI bus will
immediately release - All devices are reset -
All outstanding commands are cleared
12SCSI Bus Phase Sequencing
Arbitration
Bus Free
Selection
Reselection
Msg Out
Msg In
any phase
Command
Data/Msg phases
RESET
Bus Free
Status
Msg In
13(No Transcript)
14(No Transcript)
15(No Transcript)
16SCSI Parallel Bus Protocol
REQ/ACK Handshakes for Information Transfer In
phases REQ (Target) sends byte ACK
(Initiator) indicates byte has been read Out
phases REQ (Target) asks for byte ACK
(Initiator) sends byte Two Transfer
Modes Asynchronous Synchronous
17Information Transfer Asynchronous Operations
In REQ ACK Data Out REQ ACK Data
Default Transfer Mode for all phases
18Information Transfer Synchronous Operations
In REQ ACK Data Out REQ ACK Data
Data Phases Only, MUST be negotiated (speed and
offset)
19SCSI Operational Burst Speeds
Specification Xfer Period Bus Size Burst
Speed SCSI-1, Async - narrow 1.5
MB/sec SCSI-1, Sync 200 ns narrow 5
MB/sec SCSI-2, Async - narrow, wide 3,
6 MB/sec SCSI-2, Sync 200 ns narrow, wide 5,
10 MB/sec SCSI-2, Fast SCSI 100 ns narrow,
wide 10, 20 MB/sec SCSI-3, Ultra SCSI 50
ns narrow, wide 20, 40 MB/sec SCSI-3, Fast
40 25 ns narrow, wide 40, 80
MB/sec SCSI-3, Fast 80 12 ns narrow,
wide 80, 160 MB/sec
20SCSI Message System
Performs the following functions - Unit
Selection and Identification - Bus Operations
Management - Data Checkpointing Error
Recovery - Command Termination (Initiator) -
Command Termination (Target) - Multiple Command
Management
21SCSI Message System Unit Selection
Identification
Identify - First message sent after
Selection/Reselection - Selects LUN on target
for connection - Establishes the connection
(nexus) between the Initiator and the
Target LUN (I_T_L nexus) - Disconnect
Privilege granted here, by Initiator
7
6
5
4
3
2
1
0
SCSI-2 SCSI-3
LUN
Reserved
Reserved
Identify (1)
Disconnect Privilege
LUNTAR (0)
LUN
SCSI-3 definition has support for 32 LUNs)
22SCSI Message System Bus Operational Management
Synchronous Data Transfer Request (SDTR) -
Starts negotiation for Sync Data Transfer
Agreement - Init sends packet 0x01, 0x03, 0x01,
period, offset, Targets responds with
values that it supports - Good until Reset or
WDTR Wide Data Transfer Request (WDTR) - Starts
negotiation for Wide Data Transfers, similar to
above - Initiator sends packet 0x01, 0x02,
0x03, width Ignore Wide Residue 0x23,
size - Sent to indicate odd byte data
transfer on Wide bus Disconnect 0x04 - Sent
to indicate a temporary release of the bus
23SCSI Message System Data Checkpointing Error
Recovery
Error Recovery - Initiator Detected Error
0x05 - Message Parity Error 0x09 - Message
Reject 0x07 - NOP 0x08 Data
Checkpointing - Save Data Pointers 0x02 -
Restore Pointers 0x03 - Modify Data Pointers
0x01, 0x05, 0x00, arg4
24SCSI Pointers
All pointers stored within the Initiator Two
sets of pointers (active and saved) for Command,
Data, Status for each Logical Unit
Save Data Pointers Active -gt Saved Restore Data
Pointers Saved -gt Active Modify Data
Pointers Active arg4
25SCSI Message System Command Termination (Target)
Command Complete 0x00 - Indicates current
command is done, with or without error - Also
terminates connection Target goes Bus Free
next Linked Command Complete 0x0A - Used for
Linked Commands (multiple commands per
connection) - Target goes to Command phase for
next CDB, instead of Bus Free Linked Command
Complete w/Flag 0x0B - Sent on Linked Commands
with Flag bit set in CDB - Generally unused
26SCSI Message System Command Termination
(Initiator)
Abort 0x06 - Clears current connection Abort
Tag 0x0D - Clears current tagged
connection Clear Queue 0x0E - Clears all
outstanding tagged commands for this
Initiator Bus Device Reset 0x0C - Clears all
outstanding commands for all Initiators (Bus
Reset) - Clears all commands for all Initiators
on all targets
27SCSI Message System Multiple Command Sequencing
Command Queuing - Allows multiple commands to be
processed by a Target - I_T_L_Q nexus requires
extended connection sequence Identify Queue
Tag, one of the following Simple Queue Tag
0x20 Head of Queue Tag 0x21 Ordered
Queue Tag 0x22 Queue ID Unique single byte
value - Reselection uses Simple Queue Tag
Message only
28SCSI Message System Multiple Command Sequencing
Simple Queue Tag 0x20 - Target may execute
commands in any order Ordered Queue Tag
0x22 - Delimits any order sets - Finish all
commands before starting this - If multiple
cmds, execution is FIFO Head of Queue Tag
0x21 - This command to be executed next - If
multiple cmds, execution is LIFO
29SCSI Status Byte
Sent during Status Phase, prior to Command
Complete Message, to indicate success or
failure of the command sequence. GOOD 0x00 -
Cmd completed without error CHECK CONDITION
0x02 - Cmd complete with error, see Sense Data
for details BUSY 0x08 - Unable to process
command at present time (Try again later)
30SCSI Status Byte
INTERMEDIATE 0x10 - Linked command complete
without error RESERVATION CONFLICT 0x18 -
Device reserved by another initiator QUEUE FULL
0x28 - Maximum number of Queued Cmds in use
31SCSI Sense Data
- A special data packet specifying error status
and location(s) - Separate copy maintained by Target for each
Initiator - Retrieved by Request Sense command
- Must be retrieved immediately after a CHECK
CONDITION, - or sense data is lost
- All queued commands are suspended after CHECK
CONDITION, - until Sense Data is retrieved (Contingent
Allegiance)
32SCSI Sense Data Format
0 Valid Error Code (0x70 or 0x71)
1 Segment Number 2 FM
EOM ILI (R) Sense Key 3-6
Information Bytes 7 Additional Sense
Length 8-11 Command Specific Information
12 Additional Sense Code 13
Additional Sense Code Qualifier 14 Field
Replaceable Unit Code 15-17 Sense
Key Specific 18-xx Additional Sense
Bytes
33SCSI Sense Keys
0x0 No Sense 0x8 Blank Check 0x1 Recovered
Error 0x9 Vendor Specific 0x2 Not
Ready 0xA Copy Aborted 0x3 Medium
Error 0xB Aborted Command 0x4 Hardware
Error 0xC Equal 0x5 Illegal Request 0xD
Volume Overflow 0x6 Unit Attention 0xE
Miscompare 0x7 Data Protect 0xF Reserved
Sense Data Shorthand SKey/ASC/ASCQ 3/11/01 Medi
um Error, Read Retries Exhausted 5/20/00 Illegal
Command, Invalid Operation Code D/47/00 Aborted
Command, SCSI Parity Error
34Unit Attention Condition
First sense packet after any of the following -
Power-on - Reset - Mode/Inquiry parameters
changed - Runtime firmware change - Commands
cleared by another initiator Reports to
initiator that operating mode of the Target has
changed from the last command sent to the
Target. Reported on all SCSI Commands except
Inquiry. Command it is reported with is not
executed.
35SCSI Commands
Divided into categories based on device type -
All Device Types - Direct Access Devices
(disks) - Sequential Access Devices (tapes) -
Processor Devices (Sauna SPs) Standardized
command set and structure Some commands
mandatory, others optional
36SCSI CDB Byte 0
7
6
5
4
3
2
1
0
Group Code
Command Code
Group Code Command Description 0 6 Byte
Commands 1 10 Byte Commands
2 10 Byte Commands 3-4
Reserved 5 12 Byte commands
6-7 Vendor Specific
37SCSI CDB Format
0 Operation Code 1
LUN LBA (MSB) 2 LBA 3
LBA (LSB) 4 Transfer/Parameter/Allocation
Length 5 Control Byte
0 0 Operation Code 1 1
LUN Reserved 2-5 2-5 LBA 6
Reserved 7-8 6-9 Transfer/Parameter/Allocation
Length 10 Reserved 9 11
Control Byte
38SCSI CDB Control byte
7
6
5
4
3
2
1
0
Vendor Unique
Reserved
Flag
Link
Flag Indicates Target should return Linked
CCw/Flag Msg Link Used to continue I/O process
across multiple commands
39SCSI Commands All Device Types
Change Definition 0x40 - Sets target in
SCSI-1, CCS or SCSI-2 mode Inquiry 0x12 -
Returns Target ID packet (Device Type, Vendor,
Model, etc.) Log Sense/Select 0x4D/0x4C -
Sets/Reports Logged Statistical Information (soft
error rates) Mode Sense(6,10)/Select(6,10)
0x1A,0x5A/0x15,0x55 - Sets/Reports
Configuration and Runtime Parameters
40SCSI Disk Mode Sense Pages
Page 0x01 Error Recovery Page - Error Recovery
Strategies Page 0x03 Format Device Page - Disk
Format Parameters (Zoning, Tracks/Zone,
etc.) Page 0x04 Rigid Disk Drive Geometry
Page - Disk Physical Geometry ( Cyls, Heads,
etc.) Page 0x08 Caching Mode Page - Read/Write
Caching control Page 0x0A Control Mode Page -
Exception Handing Queue Handling parameters
41SCSI Commands All Device Types
Request Sense 0x03 - Returns Sense Data to
Initiator Test Unit Ready 0x00 - Returns
Target readiness to accept I/O commands Write
Buffer 0x3B - Used to update Target run-time
firmware
42SCSI Disk Commands
Force Reserve 0xE4 - Force Reservation,
overriding normal SCSI protocol Format Unit
0x04 - Formats disk, according to Mode
Parameters Prefetch 0x34 - Read disk, place
data into cache Read (6,10) 0x08, 0x28 - Read
disk, transfer data to Initiator Read Capacity
0x25 - Returns size of disk, in LBAs
43SCSI Disk Commands
Reassign Blocks 0x07 - Remaps specified
LBA(s) Reserve, Release 0x16, 0x17 - Locks
Disk for exclusive access by this
Initiator Rezero Unit 0x01 - Seeks to LBA
0 Start/Stop Unit 0x1B - Command to spin
up/down disk Synchronize Cache 0x35 - Flush
cache to disk, cache remains enabled
44SCSI Disk Commands
Verify 0x2F - Verify LBA(s) on disk with
passed data Write (6,10) 0x0A, 0x2A - Write
specified LBA(s) with passed data Write and
Verify 0x2E - Treated the same as a Write
command Write Same 0x41 - Writes passed
sector to multiple LBA(s) on disk
45Sample SCSI Command
Bus Free Arbitration/80 (7) Select w/ATN/81
(7,0) Message Out/80 (Identify) Command/08
(Read) 00 34 22 01 00 Data In/00 01 02 03 04 05
06 07... Status/00 (Good) Message In/00
(Command Complete) Bus Free
46Sample SCSI Command with Disconnect
Bus Free Arbitration/80 (7) Select w/ATN/81
(7,0) Message Out/C0 (Identify) Command/08
(Read) 00 34 22 01 00 Message In/04
(Disconnect) Bus Free Arbitration/01
(0) Reselection/81 (7,0) Message In/80
(Identify) Data In/00 01 02 03 04 05 06
07... Status/00 (Good) Message In/00 (Command
Complete) Bus Free
47Sample SCSI Command with Parity Error
Bus Free Arbitration/80 (7) Select w/ATN/81
(7,0) Message Out/C0 (Identify) Command/08
(Read) 00 34 22 01 00 Message In/04
(Disconnect) Bus Free Arbitration/01
(0) Reselection/81 (7,0) Message In/80
(Identify) Data In/00 01 02 03 04 05 06
07... Message Out/05 (Initiator Detected
Error) Message In/03 (Restore Pointers) Data
In/00 01 02 03 04 05 06 07... Status/00
(Good) Message In/00 (Command Complete) Bus Free
48Sample SCSI Queued Command
Bus Free Arbitration/80 (7) Select w/ATN/81
(7,0) Message Out w/ATN /C0 (Identify) Message
Out w/ATN /20 (Simple Tag) Message Out/00 (Tag
ID) Command/08 (Read) 00 34 22 01 00 Message
In/04 (Disconnect) Bus Free Arbitration/01
(0) Reselection/81 (7,0) Message In/80
(Identify) Message In/20 (Simple Tag) Message
In/00 (Tag ID) Data In/00 01 02 03 04 05 06
07... Status/00 (Good) Message In/00 (Command
Complete) Bus Free
49Sample SCSI Linked Command
Bus Free Arbitration/80 (7) Select w/ATN/81
(7,0) Message Out/80 (Identify) Command/08
(Read) 00 34 22 01 01 Data In/00 01 02 03 04 05
06 07... Status/10 (Intermediate/Good) Message
In/0A (Linked Command Complete) Command/08
(Read) 03 22 68 01 00 Data In/00 01 02 03 04 05
06 07... Status/00 (Good) Message In/00
(Command Complete) Bus Free
50Processor SCSI Commands
Send 0x0A - Send data packet Test Unit Ready
0x00 - Test readiness to send/receive
data Used by SP when acting as an Initiator to
send Unsolicited Errors Also used by SP for
communication to the peer SP
51The Future of SCSI
SCSI-1 14 Chapters, 212 pages Narrow Parallel
Bus, 5 Device Types (sketchy) SCSI-2 18
Chapters, 438 Pages Wide/Fast Parallel Bus, 10
Device Types SCSI-3 Family of 20
Specifications, 1400 Pages Faster Parallel
Buses Low Voltage Parallel Bus (LVDS) Serial
Bus Protocols
52SCSI-3
Common Access Method (CAM-3)
Medium Changer Commands (SMC)
Block Commands (SBC)
Stream Commands (SSC)
Graphic Commands (SGC)
Controller Commands (SCC)
Multi-Media Commands (MMC)
SCSI-3 Primary Commands (SPC)
SCSI-3 Architecture Model (SAM)
Interlocked Protocol (SIP)
Fiber Channel Protocol (FCP)
Serial Bus Protocol (SBP)
SSA SCSI-3 Protocol (SSA-S3P)
Generic Packetized Protocol (GPP)
Fast-20 Parallel I/F (Fast-20)
Parallel Interface (SPI, SPI-2)
Fibre Channel (FC-PH)
High Perf. Serial Bus (P1394)
SSA-TL1/2 SSA-PH1/2
Almost any Packet Interface