Sie sind auf Seite 1von 52

What is SCSI?

Small Computer System Interface


SCSI is:
a Specification
a Bus
a Protocol

SCSI 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:

Logical Unit Number. An encoded three-bit identifier


for the logical unit.

SCSI 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.

SCSI Configuration
Single Initiator, Single Target

LUN0

Initiator

SCSI Bus

Target

LUN1

LUN2

SCSI Configuration
Single Initiator, Multiple Targets

Target 0

Initiator 7
SCSI Bus

T
SCSI Bus Terminator

Target 1

Target n

SCSI Configuration
Multiple Initiators, Multiple Targets

Initiator 7

Target 0

SCSI Bus

Initiator 6
T

Target 1

Target n

SCSI Parallel Bus Types


Single-Ended
5V
-SIG
- Single Signal Level
FALSE
- 6m max. bus length
- No Fast Timings
TRUE
- Uses Even bus pins only
0V
Differential
TRUE = -SIG < 1.5V
- Dual Signal Level
5V
- 25m max. bus length
-SIG
- Fast Timings
- Uses all pins on bus
TRUE
FALSE
LVDS (SCSI-3+)
- 3VDC Diff Bus

0V

+SIG
TRUE = +SIG > -SIG

SCSI 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

SCSI Parallel Bus Signals


50 Pin Bus (Narrow), 68 Pin Bus (Wide)
DB(0-7,P1) I/T
DB(8-15, P2) I/T

8 Bit Data Bus with Odd Parity


2nd 8 Bit Data Bus with Odd Parity (Wide Only)

REQuest
T
ACKnowledge I

Asking for data byte to be sent/on bus


Indicates data byte on bus/read byte

ATtentionN
SELect
BuSY
ReSeT

I
I/T
I/T
I

Indicates pending message for target


Indicates Selection/Reselection in progress
Indicates SCSI Bus in use
Resets all SCSI devices

MeSsaGe
Cmd/Data
In/Out

T
T
T

Indicates Message Byte


Indicates Command/Msg or Data
Indicates Data Direction

SCSI Bus Phases


BSY
0

SEL
x

MSG C/D
x
x

1
1

1
1

x
x

1
1
1
1
1
1
1
1

0
0
0
0
0
0
0
0

0
0
0
0
1
1
1
1

I/O
x

Definition
Bus Free (Idle)

x
x

0
1

Selection
Reselection

0
0
1
1
0
0
1
1

0
1
0
1
0
1
0
1

Data Out
Data In
Command
Status
(Reserved)
(Reserved)
Message Out
Message In

I -> T
I <- T
I -> T
I <- T
I -> T
I <- T

Asynchronous 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

SCSI Bus Phase Sequencing


Bus Free

Arbitration

Selection

Reselection

Msg Out

Msg In

any phase

Data/Msg phases

RESET

Command
Status

Msg In

Bus Free

SCSI 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

Information Transfer: Asynchronous Operations


In:
REQ
ACK
Data
Out:
REQ
ACK
Data
Default Transfer Mode for all phases

Information Transfer: Synchronous Operations


In:
REQ
ACK
Data
Out:
REQ
ACK
Data
Data Phases Only, MUST be negotiated (speed and offset)

SCSI Operational Burst Speeds


Specification
SCSI-1, Async
SCSI-1, Sync

Xfer Period Bus Size


Burst Speed
narrow
1.5 MB/sec
200 ns
narrow
5 MB/sec

SCSI-2, Async
SCSI-2, Sync

narrow, wide 3, 6 MB/sec


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
SCSI-3+, Fast 80

25 ns
12 ns

narrow, wide 40, 80 MB/sec


narrow, wide 80, 160 MB/sec

SCSI 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

SCSI 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

Identify

(1)

Disconnect LUNTAR
Privilege
(0)

4
Reserved

Reserved

LUN

LUN

SCSI-3 definition has support for 32 LUNs)

SCSI-2
SCSI-3

SCSI 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

SCSI 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, {arg[4]}]

SCSI 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 -> Saved
Restore Data Pointers
Saved -> Active
Modify Data Pointers
Active += arg[4]

SCSI 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

SCSI 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

SCSI 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

SCSI 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

SCSI 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)

SCSI 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

SCSI 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)

SCSI Sense Data Format


0
1
2
3-6
7
8-11
12
13
14
15-17
18-xx

Valid

Error Code (0x70 or 0x71)


Segment Number
FM EOM ILI (R) Sense Key
Information Bytes
Additional Sense Length
Command Specific Information
Additional Sense Code
Additional Sense Code Qualifier
Field Replaceable Unit Code
Sense Key Specific
Additional Sense Bytes

SCSI Sense Keys


0x0: No Sense
0x1: Recovered Error
0x2: Not Ready
0x3: Medium Error
0x4: Hardware Error
0x5: Illegal Request
0x6: Unit Attention
0x7: Data Protect

0x8: Blank Check


0x9: Vendor Specific
0xA: Copy Aborted
0xB: Aborted Command
0xC: Equal
0xD: Volume Overflow
0xE: Miscompare
0xF: Reserved

Sense Data Shorthand:


SKey/ASC/ASCQ
3/11/01:
Medium Error, Read Retries Exhausted
5/20/00:
Illegal Command, Invalid Operation Code
D/47/00:
Aborted Command, SCSI Parity Error

Unit 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.

SCSI 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

SCSI CDB: Byte 0


7

Group Code

Group Code
0
1
2
3-4
5
6-7

Command Code

Command Description
6 Byte Commands
10 Byte Commands
10 Byte Commands
Reserved
12 Byte commands
Vendor Specific

SCSI CDB Format


0
1
2
3
4
5
0
1
2-5
6
7-8
9

Operation Code
[LUN]
LBA (MSB)
LBA
LBA (LSB)
Transfer/Parameter/Allocation Length
Control Byte
0
1
2-5
6-9
10
11

Operation Code
[LUN]
Reserved
LBA
Reserved
Transfer/Parameter/Allocation Length
Reserved
Control Byte

SCSI CDB: Control byte


7

6
Vendor
Unique

Reserved

Fla Link
g

Flag
Indicates Target should return Linked CCw/Flag Msg
Link
Used to continue I/O process across multiple commands

SCSI 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

SCSI 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

SCSI 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

SCSI 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

SCSI 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

SCSI 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

Sample 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

Sample 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

Sample 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

Sample SCSI Queued Command


Bus Free

Bus Free

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

Sample 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

Processor 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

The 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

SCSI-3
Common Access Method (CAM-3)
Block
Commands
(SBC)

Stream
Commands
(SSC)

Graphic
Commands
(SGC)

Medium
Changer
Commands
(SMC)

Controller
Commands
(SCC)

Multi-Media
Commands
(MMC)

SCSI-3 Primary Commands (SPC)


SCSI-3 Architecture Model (SAM)

Fast-20
Parallel I/F
(Fast-20)

Interlocked
Protocol
(SIP)

Fiber Channel
Protocol
(FCP)

Serial Bus
Protocol
(SBP)

SSA SCSI-3
Protocol
(SSA-S3P)

Parallel
Interface
(SPI, SPI-2)

Fibre
Channel
(FC-PH)

High Perf.
Serial Bus
(P1394)

SSA-TL1/2
SSA-PH1/2

Generic
Packetized
Protocol
(GPP)
Almost any
Packet Interface

Das könnte Ihnen auch gefallen