small computer system interface scsi is: a specification a bus a protocol what is scsi?

52
Small Computer System Interface SCSI is: • a Specification • a Bus • a Protocol What is SCSI?

Upload: dwight-parsons

Post on 16-Jan-2016

217 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Small Computer System Interface SCSI is: a Specification a Bus a Protocol What is SCSI?

Small Computer System Interface

SCSI is:• a Specification• a Bus• a Protocol

What is SCSI?

Page 2: Small Computer System Interface SCSI is: a Specification a Bus a Protocol What is SCSI?

SCSI Terms

Initiator: A SCSI device that requests an operation to beperformed 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 atarget.

LUN: Logical Unit Number. An encoded three-bit identifierfor the logical unit.

Page 3: Small Computer System Interface SCSI is: a Specification a Bus a Protocol What is SCSI?

SCSI TermsSCSI 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 uniqueaddress assigned to a SCSI device.

Connect: The function which occurs when an initiatorselects a target to begin an operation.

Disconnect: The function which occurs when a target releasescontrol of the SCSI bus, allowing it to go Bus Free.

Reconnect: The function which occurs when a targets selects aninitiator to continue an operation after a disconnect.

Page 4: Small Computer System Interface SCSI is: a Specification a Bus a Protocol What is SCSI?

SCSI ConfigurationSingle Initiator, Single Target

InitiatorSCSI Bus

LUN0

LUN1

LUN2

Target

Page 5: Small Computer System Interface SCSI is: a Specification a Bus a Protocol What is SCSI?

SCSI ConfigurationSingle Initiator, Multiple Targets

Initiator 7

SCSI Bus Target 1

Target n

Target 0

SCSI Bus Terminator

T

T

Page 6: Small Computer System Interface SCSI is: a Specification a Bus a Protocol What is SCSI?

SCSI ConfigurationMultiple Initiators, Multiple Targets

Initiator 7

SCSI Bus Target 1

Target n

Target 0

Initiator 6

T

T

Page 7: Small Computer System Interface SCSI is: a Specification a Bus a Protocol What is SCSI?

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

0V

5V -SIG

TRUE

FALSE

0V

5V -SIG

TRUE FALSE

+SIG

TRUE = -SIG < 1.5V

TRUE = +SIG > -SIG

SCSI Parallel Bus Types

Page 8: Small Computer System Interface SCSI is: a Specification a Bus a Protocol What is SCSI?

SCSI Parallel Bus Protocol

Bus Phases and their SequencingMSG, 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

Page 9: Small Computer System Interface SCSI is: a Specification a Bus a Protocol What is SCSI?

SCSI Parallel Bus Signals50 Pin Bus (Narrow), 68 Pin Bus (Wide)

DB(0-7,P1) I/T 8 Bit Data Bus with Odd ParityDB(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 busACKnowledge I Indicates data byte on bus/read byte

ATtentionN I Indicates pending message for targetSELect I/T Indicates Selection/Reselection in progressBuSY I/T Indicates SCSI Bus in useReSeT I Resets all SCSI devices

MeSsaGe T Indicates Message ByteCmd/Data T Indicates Command/Msg or DataIn/Out T Indicates Data Direction

Page 10: Small Computer System Interface SCSI is: a Specification a Bus a Protocol What is SCSI?

SCSI 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 -> T 1 0 0 0 1 Data In I <- T 1 0 0 1 0 Command I -> T 1 0 0 1 1 Status I <- T 1 0 1 0 0 (Reserved) 1 0 1 0 1 (Reserved) 1 0 1 1 0 Message Out I -> T 1 0 1 1 1 Message In I <- T

Page 11: Small Computer System Interface SCSI is: a Specification a Bus a Protocol What is SCSI?

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

Page 12: Small Computer System Interface SCSI is: a Specification a Bus a Protocol What is SCSI?

SCSI Bus Phase Sequencing

any phase

Bus Free

Arbitration

Selection Reselection

Msg Out

Command

Msg In

Status Msg In

Data/Msg phases

Bus Free

RESET

Page 13: Small Computer System Interface SCSI is: a Specification a Bus a Protocol What is SCSI?
Page 14: Small Computer System Interface SCSI is: a Specification a Bus a Protocol What is SCSI?
Page 15: Small Computer System Interface SCSI is: a Specification a Bus a Protocol What is SCSI?
Page 16: Small Computer System Interface SCSI is: a Specification a Bus a Protocol What is SCSI?

SCSI Parallel Bus Protocol

REQ/ACK Handshakes for Information TransferIn phases:

REQ (Target) sends byteACK (Initiator) indicates byte has been read

Out phases:REQ (Target) asks for byteACK (Initiator) sends byte

Two Transfer ModesAsynchronousSynchronous

Page 17: Small Computer System Interface SCSI is: a Specification a Bus a Protocol What is SCSI?

Information Transfer: Asynchronous Operations

In:

REQACKData

Out:

REQACKData

Default Transfer Mode for all phases

Page 18: Small Computer System Interface SCSI is: a Specification a Bus a Protocol What is SCSI?

Information Transfer: Synchronous Operations

In:

REQACKData

Out:

REQACKData

Data Phases Only, MUST be negotiated (speed and offset)

Page 19: Small Computer System Interface SCSI is: a Specification a Bus a Protocol What is SCSI?

SCSI Operational Burst Speeds

Specification Xfer Period Bus Size Burst SpeedSCSI-1, Async - narrow 1.5 MB/secSCSI-1, Sync 200 ns narrow 5 MB/sec

SCSI-2, Async - narrow, wide 3, 6 MB/secSCSI-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/secSCSI-3+, “Fast 80” 12 ns narrow, wide 80, 160 MB/sec

Page 20: Small Computer System Interface SCSI is: a Specification a Bus a Protocol What is SCSI?

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

Page 21: Small Computer System Interface SCSI is: a Specification a Bus a Protocol What is SCSI?

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

Identify(1)

DisconnectPrivilege

LUNLUN

Reserved SCSI-2SCSI-3

ReservedLUNTAR(0)

7 6 5 4 3 2 1 0

SCSI-3 definition has support for 32 LUNs)

SCSI Message SystemUnit Selection & Identification

Page 22: Small Computer System Interface SCSI is: a Specification a Bus a Protocol What is SCSI?

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 SystemBus Operational Management

Page 23: Small Computer System Interface SCSI is: a Specification a Bus a Protocol What is SCSI?

SCSI Message SystemData 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]}]

Page 24: Small Computer System Interface SCSI is: a Specification a Bus a Protocol What is SCSI?

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 PointersActive -> Saved

Restore Data PointersSaved -> Active

Modify Data PointersActive += arg[4]

Page 25: Small Computer System Interface SCSI is: a Specification a Bus a Protocol What is SCSI?

SCSI Message SystemCommand 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

Page 26: Small Computer System Interface SCSI is: a Specification a Bus a Protocol What is SCSI?

SCSI Message SystemCommand 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

Page 27: Small Computer System Interface SCSI is: a Specification a Bus a Protocol What is SCSI?

SCSI Message SystemMultiple Command Sequencing

Command Queuing- Allows multiple commands to be processed by a Target- I_T_L_Q nexus requires extended connection sequence:

IdentifyQueue Tag, one of the following

Simple Queue Tag [0x20]Head of Queue Tag [0x21]Ordered Queue Tag [0x22]

Queue IDUnique single byte value

- Reselection uses Simple Queue Tag Message only

Page 28: Small Computer System Interface SCSI is: a Specification a Bus a Protocol What is SCSI?

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 Message SystemMultiple Command Sequencing

Page 29: Small Computer System Interface SCSI is: a Specification a Bus a Protocol What is SCSI?

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)

Page 30: Small Computer System Interface SCSI is: a Specification a Bus a Protocol What is SCSI?

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

Page 31: Small Computer System Interface SCSI is: a Specification a Bus a Protocol What is SCSI?

• 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

Page 32: Small Computer System Interface SCSI is: a Specification a Bus a Protocol What is SCSI?

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 Code15-17 Sense Key Specific18-xx Additional Sense Bytes

SCSI Sense Data Format

Page 33: Small Computer System Interface SCSI is: a Specification a Bus a Protocol What is SCSI?

0x0: No Sense 0x8: Blank Check0x1: Recovered Error 0x9: Vendor Specific0x2: Not Ready 0xA: Copy Aborted0x3: Medium Error 0xB: Aborted Command0x4: Hardware Error 0xC: Equal0x5: Illegal Request 0xD: Volume Overflow0x6: Unit Attention 0xE: Miscompare0x7: Data Protect 0xF: Reserved

Sense Data Shorthand: SKey/ASC/ASCQ3/11/01: Medium Error, Read Retries Exhausted5/20/00: Illegal Command, Invalid Operation CodeD/47/00: Aborted Command, SCSI Parity Error

SCSI Sense Keys

Page 34: Small Computer System Interface SCSI is: a Specification a Bus a Protocol What is SCSI?

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.

Unit Attention Condition

Page 35: Small Computer System Interface SCSI is: a Specification a Bus a Protocol What is SCSI?

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 Commands

Page 36: Small Computer System Interface SCSI is: a Specification a Bus a Protocol What is SCSI?

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

SCSI CDB: Byte 0

Page 37: Small Computer System Interface SCSI is: a Specification a Bus a Protocol What is SCSI?

0 Operation Code1 [LUN] LBA (MSB)2 LBA3 LBA (LSB)4 Transfer/Parameter/Allocation Length5 Control Byte

0 0 Operation Code 1 1 [LUN] Reserved2-5 2-5 LBA 6 Reserved7-8 6-9 Transfer/Parameter/Allocation Length

10 Reserved 9 11 Control Byte

SCSI CDB Format

Page 38: Small Computer System Interface SCSI is: a Specification a Bus a Protocol What is SCSI?

7 6 5 4 3 2 1 0VendorUnique

Reserved Flag

Link

FlagIndicates Target should return Linked CCw/Flag Msg

LinkUsed to continue I/O process across multiple commands

SCSI CDB: Control byte

Page 39: Small Computer System Interface SCSI is: a Specification a Bus a Protocol What is SCSI?

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 Commands: All Device Types

Page 40: Small Computer System Interface SCSI is: a Specification a Bus a Protocol What is SCSI?

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 Disk Mode Sense Pages

Page 41: Small Computer System Interface SCSI is: a Specification a Bus a Protocol What is SCSI?

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 Commands: All Device Types

Page 42: Small Computer System Interface SCSI is: a Specification a Bus a Protocol What is SCSI?

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

Page 43: Small Computer System Interface SCSI is: a Specification a Bus a Protocol What is SCSI?

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

Page 44: Small Computer System Interface SCSI is: a Specification a Bus a Protocol What is SCSI?

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

SCSI Disk Commands

Page 45: Small Computer System Interface SCSI is: a Specification a Bus a Protocol What is SCSI?

Bus FreeArbitration/80 (7)Select w/ATN/81 (7,0)Message Out/80 (Identify)Command/08 (Read) 00 34 22 01 00Data In/00 01 02 03 04 05 06 07...Status/00 (Good)Message In/00 (Command Complete)

Bus Free

Sample SCSI Command

Page 46: Small Computer System Interface SCSI is: a Specification a Bus a Protocol What is SCSI?

Bus FreeArbitration/80 (7)Select w/ATN/81 (7,0)Message Out/C0 (Identify)Command/08 (Read) 00 34 22 01 00Message In/04 (Disconnect)

Bus FreeArbitration/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 Disconnect

Page 47: Small Computer System Interface SCSI is: a Specification a Bus a Protocol What is SCSI?

Bus FreeArbitration/80 (7)Select w/ATN/81 (7,0)Message Out/C0 (Identify)Command/08 (Read) 00 34 22 01 00Message In/04 (Disconnect)

Bus FreeArbitration/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 Command with Parity Error

Page 48: Small Computer System Interface SCSI is: a Specification a Bus a Protocol What is SCSI?

Bus FreeArbitration/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 00Message In/04 (Disconnect)

Bus FreeArbitration/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

Sample SCSI Queued Command

Page 49: Small Computer System Interface SCSI is: a Specification a Bus a Protocol What is SCSI?

Bus FreeArbitration/80 (7)Select w/ATN/81 (7,0)Message Out/80 (Identify)Command/08 (Read) 00 34 22 01 01Data 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 00Data In/00 01 02 03 04 05 06 07...Status/00 (Good)Message In/00 (Command Complete)

Bus Free

Sample SCSI Linked Command

Page 50: Small Computer System Interface SCSI is: a Specification a Bus a Protocol What is SCSI?

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

Processor SCSI Commands

Page 51: Small Computer System Interface SCSI is: a Specification a Bus a Protocol What is SCSI?

SCSI-114 Chapters, 212 pagesNarrow Parallel Bus, 5 Device Types (sketchy)

SCSI-218 Chapters, 438 PagesWide/Fast Parallel Bus, 10 Device Types

SCSI-3Family of ~20 Specifications, ~1400 PagesFaster Parallel BusesLow Voltage Parallel Bus (LVDS)Serial Bus Protocols

The Future of SCSI

Page 52: Small Computer System Interface SCSI is: a Specification a Bus a Protocol What is SCSI?

Common Access Method (CAM-3)

Block Commands

(SBC)

StreamCommands

(SSC)

GraphicCommands

(SGC)

Medium Changer

Commands(SMC)

ControllerCommands

(SCC)

Multi-MediaCommands

(MMC)

SCSI-3 Primary Commands (SPC)

SCSI-3 Architecture Model (SAM)

InterlockedProtocol

(SIP)

Fiber ChannelProtocol(FCP)

Serial BusProtocol(SBP)

SSA SCSI-3Protocol

(SSA-S3P)

GenericPacketizedProtocol(GPP)

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

ParallelInterface

(SPI, SPI-2)

FibreChannel(FC-PH)

High Perf.Serial Bus(P1394)

SSA-TL1/2

SSA-PH1/2

Almost anyPacket Interface

SCSI-3