SlideShare a Scribd company logo
1confidential
Agenda:
SCSI Domain
SCSI Bus Phases
SCSI Commands
SCSI Conditions
2confidential
SCSI-2 SCSI-3
I/O Process Task
Queue Task Set
Abort Tag Abort Task
Abort Abort Task
Set
Bus Device
Reset
Target Reset
3confidential
SCSI Standards
Device
Specifi
c
Comm
and
Sets
Transp
ort
Protoc
ol
Physica
l
Interfac
Shared
Command Set
Architectural
Model
4confidential
5confidential
Protocol Service Model
6confidential
Initiator & Target
Host
Adapter
Main
Memory
Host
CPU
Peripheral
Controller
Initiator TargetSCSI Bus
Logical Units
0 1 2 3 6
2
6
3
Host
Computer
Host
Adapter 0 1 2 3
6
2
6
3
Peripheral
Controller
Target
Logical Units
0 1 2 3
6
2
6
3
Peripheral
Controller
Target
Logical Units
Initiator
Host
Computer
Host
Adapter 0 1 2 3
6
2
6
3
Peripheral
Controller
Target
Logical Units
0 1 2 3
6
2
6
3
Peripheral
Controller
Target
Logical Units
Host
Adapter
Host
Computer
Initiator
Initiator
7confidential
SCSI Bus Model Analogy
Terry
“5”
Tony
“1”
Tina
“0”
Larry
“0”
Lin
“3”
Lolly
“2”
Lisa
“0”
Lilly
“0”
Irene
“7”
Ian
“6”
[Initiators]
[SCSI Bus]
[Targets]
[Logical Units]
8confidential
SCSI 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 Indicates 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
9confidential
 Communication on the SCSI bus is allowed between only two SCSI
devices at any given time
 When two SCSI devices communicate on the SCSI bus, one acts as an
initiator and the other acts as a target.
 Initiator originates an operation and the target performs the
operation.
 Each SCSI device has an SCSI ID bit assigned. When a device is
initialized, SCSI allows for automatic assignment of device IDs on the
bus, which prevents two or more devices from using the same SCSI
ID.
Bus SCSI ID Priority
Narrow 7, 6, 5, 4, 3, 2, 1, 0
Wide 7, 6, 5, 4, 3, 2, 1, 0, 15, 14, 13, 12, 11, 10, 9, 8
10confidential
SCSI Domain
11confidential
SCSI Domain
12confidential
SCSI Bus Phases
BUS FREE
phase
ARBITRATION
phase
SELECTION
phase
RESELECTION
phase
COMMAND
phase
DATA
phase
STATUS
phase
MESSAGE
phase
Devices use this layer to recognize that the bus is available.Initiators or Targets use this layer to resolve bus contention.Initiators use this layer to select the targets to start an I/O process(O)This phase instructs the target what operation to perform(O).This protocol layer transfers data to or from the device.This protocol layer gives an update of the status of the operation(O)Targets use this layer to inform initiators to transmit a message.
13confidential
SCSI Bus Phases – Flow Chart
Bus Free
Status
Message Out
Arbitration
Selection
Command
Data In or Data
Out
Message In
Reselection
Waiting Phase Bus Control Phase Information Xfer Phase
14confidential
SCSI Trace
Bus State
Absolute Timing
s.mmm_uuu_nnn
Bus Phase Transpired I - T
Data Bus
single values represent SCSI ID's, otherwise values
are in hex bytes
Event
1 00.000_000_000 Bus Free Detected 0000
2 26.032_853_700 Arbitration Start 7 0001
2 26.032_856_100 Arb_win 7 0002
2 26.033_514_100 (Atn Assertion) ATN 0003
2 26.033_521_700 Selection Start I → T 7 4 ATN 0004
2 26.033_522_600 Selection Complete I → T ATN 0005
2 26.034_161_850 I → T (Atn Negation) ATN 0006
2 26.034_833_950 Message Out I → T C0h 0007
2 26.039_035_750 Command Out I → T 08 00 01 00 01 00 0008
3 26.055_860_800 Data In I ← T 00 00 00 00 00 00 0009
3 26.055_862_300 I ← T 00 00 00 00 00 00 0010
3 26.056_494_450 I ← T 00 00 00 00 0011
4 26.056_894_350 Status In I ← T 00 0012
4 26.057_852_350 Message In I ← T 00 0013
1 26.058_426_300 Bus Free Detected 0014
Legend:
1 No One Using Bus
2 Protocol to access peripheral and start process
3 Transfer data
4 Protocol to complete process
15confidential
SCSI Domain
16confidential
SCSI Initiator
17confidential
SCSI Target
18confidential
Logical Unit
 Are a physical/virtual peripherial device addressable through a traget.
 Are the basic addressable unit on a target.
 Have a default number of zero.
 Must be sequentially numbered if there are more than one.
 Max 8 Lus(64) per target controller in SCSI-2(SCSI-3).
 One or more LU names
 A Device Server
 A Task Manager
 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.
19confidential
SCSI Nexus
20confidential
SCSI Task Attributes
21confidential
SCSI Initiator & Target
Initiator ID
Target ID LUNInitiator ID
SCSI ID/SAS Addr/N_PortID SCSI ID/SAS Addr/N_PortID
22confidential
Protocol Services
23confidential
SCSI - No Data Xfer Commands
24confidential
SCSI – Data Xfer Commands
25confidential
SCSI CDB
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 is the SCSI Universe.
 CDBs come in various sizes, typically 6, 10, 12, or 16 bytes total.
Where to begin
the operation
How many blocks
What command
 10-byte READ command.
 This command, if successful, will move one block (512 bytes) of data to the
host computer system, from logical block address 100h (hex).
NACA, Linked
26confidential
SCSI Status Byte
Hex
Status
00 GOOD
02 CHECK CONDITION
04 CONDITION MET
08 BUSY
10 INTERMEDIATE
14 INTERMEDIATE-CON MET
18 RESERVATION CONFLICT
28 TASK SET FULL
30 ACA ACTIVE
Any time a SCSI command is sent to a
Target
 The Initiator expect a completion
Status
 This status can reflect successful or un
successful completion of the
command.
Sent during Status Phase, prior to
Command Complete Message, to indicate
success or failure of the command
sequence
27confidential
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)
28confidential
SCSI Sense Data Format SENSE KEYS
00 No Sense
01 Recovered Error
02 Not Ready
03 Medium Error
04 Hardware Error
05 Illegal Request
06 Unit Attention
07 Data Protect
08 Blank Check
09 Vendor Specific
0A Copy Abort
0B Aborted Cmd
0C Obsolete
0D Vol OverFlow
0E Miscompare
0F Reserved
Event Description:
Unexpected sense: PD 04(e0xfc/s4) Path 4433221107000000,
CDB: a1 08 0b d0 00 00 4f c2 00 b0 00 ff,
Sense: 5/24/00
Sense key ASC ASCQ
29confidential
Message System
The message system allows communication between an I and T for the
purpose of INTERFACE management.
Messages are xfered during MESSAGE IN and MESSAGE OUT phases.
One or more messages may be sent during a single MESSAGE phase,
but a message may not be split between multiple MESSAGE phases.
The first msg byte after SELECTION phase shall be an IDENTIFY,
ABORT, or BUS DEVICE RESET msg. If T receives any other msg then
bus will go to BUS FREE state.
The IDENTIFY msg establishes a logical connection, or nexus between
the I and the specified LU, I_T_L nexus, within the target.
06h - ABORT
0Dh - ABORT TAG
24h - ACA QUEUE TAG
OCh - BUS DEVICE RESET
16h - CLEAR ACA
0Eh - CLEAR QUEUE
00h - COMMAND COMPLETES
30confidential
SCSI Task Management Functions
 Abort Task : Abort the specific task(ITLQ or ITL).
 Abort Task Set : Abort all tasks for the issuing initiator(ITL).
 Clear Task Set : Abort all tasks for the issuing initiator(TL).
 Target Reset : Resets the specific target. All tasks in all the logical units
are reset and Unit Attention is set.
 Logical Unit Reset : Reset the logical unit. All tasks in the specified logical
unit are reset and Unit Attention is set.
 Clear ACA: Clears ACA condition at the specified logical unit.
Because SCSI Task management functions are not commands, the request is
not sent by using a CDB and the response is not indicated by SCSI status.
31confidential
Contingent Allegiance Condition (CAC)
A Contingent Allegiance Condition is:
a Condition (state) that is Contingent (dependent) upon the Allegiance (connection)
between two entities, or components, in a SCSI-based system.
1. Make a connection (establish a Nexus)
2. Issue a command (from initiator to target)
3. Process the command (Target moves data to or from storage, if needed)
4. Receive GOOD status (00h code)
5. Close the connection (Nexus “goes away”)
What if we do not get GOOD status?
When something goes wrong, then you do NOT receive GOOD status – you most
often get back a CHECK CONDITION status (02h code) from the target. This is how
the initiator is informed that an error occurred.
32confidential
SAM Error Recovery
NACA
Normal Auto Contingent Allegiance
=0
=1
CAC
Contingent Allegiance Condition
ACAC
Auto Contingent Allegiance Condition
33confidential
Contingent Allegiance Condition(SCSI-2)
Initiator 7 Initiator 6 Initiator n
Target xLogical Unit 0
76543210
Ian asked Tom to get a file from Larry, but Larry can’t find it. Tom must
inform Ian that the request has a CAC by returning a CC (02H) code
during the STATUS IN phase. Then Tom will set an internal CAC flag (per
LUN)associated with Ian’s SCSI ID and preserve it until it is cleared by
Ian.
CAC shall be preserved for I_T_L nexus untill it is cleared.
 a hard reset condition
 an ABORT message
 a BUS DEVICE RESET message
 any subsequent commands for the I_T_L nexus, mostly
command will be REQUEST SENSE
Logical Unit 1
76543210
Logical Unit n
76543210
34confidential
Auto Contingent Allegiance Condition (SCSI-3)
The ACA (NACA=1) condition shall exist within the task set
when the logical unit completes a command by returning a
CHECK CONDITION status.
 Task set boundary.
 Preserved untill it is cleared.
 Sense data shall be returned using the “Autosense” feature.
35confidential
Reset Condition
Logical Unit Reset
Response to
a) LOGICAL UNIT RESET task management request
b) any logical unit reset event (ex: target hard reset)
1) Abort all tasks in the task set.
2) Clear -- ACA(NACA=1 i.e SCSI-3 ) or Contingent Allegiance(NACA=0 i.e SCSI-2)
3) Clear -- Disk Reservation
4) Data Xfer mode -- default async
5) Mode parameters -- restore last saved values
6) Unit Attention -- UA condition shall be set for all other devices.
36confidential
Unit Attention Condition
Reports to I that operating mode of the T has changed from the last cmd sent to the T.
Reported on all SCSI cmds except INQURY.
Cmd it is reported with is not executed.
 Each LU shall generated a UA condition, for each I, whenever the LU has been
reset by:
1. a hard reset condition
2. by a power-on reset.
3. or a BUS DEVICE RESET message
 LU shall also generate a UA condition for each I whenever one of the following
events occurs:
1. A removable medium may have been changed.
2. The mode parameters in effect for this I have been changed by another initiator.
3. The level or version of microcode has changed.
4. Tagged commands queued for the I were cleared by another I.
5. INQURY data has been changed.
6. The LU inventory has been changed.
7. A removable medium may have been changed.
8. The mode parameters in effect for this I have been changed by another initiator.
9. Tagged commands queued for this I were cleared by another I.
10. The version or level of microcode has been changed.
37confidential
Do u want to
initiate a
Task ?

More Related Content

PDF
Detailed iSCSI presentation
PPTX
Network Attached Storage (NAS)
PDF
Process Scheduler and Balancer in Linux Kernel
PPTX
iSCSI (Internet Small Computer System Interface)
PDF
Google Kubernetes Engine (GKE) deep dive
PDF
Embedded Android : System Development - Part III (Audio / Video HAL)
PPT
Glibc malloc internal
PPTX
CLOUD STORAGE.pptx
Detailed iSCSI presentation
Network Attached Storage (NAS)
Process Scheduler and Balancer in Linux Kernel
iSCSI (Internet Small Computer System Interface)
Google Kubernetes Engine (GKE) deep dive
Embedded Android : System Development - Part III (Audio / Video HAL)
Glibc malloc internal
CLOUD STORAGE.pptx

What's hot (20)

PDF
LinuxIO-Introduction-FUDCon-2015
PPTX
Linux Network Stack
PPTX
The TCP/IP Stack in the Linux Kernel
PDF
introduction to linux kernel tcp/ip ptocotol stack
PDF
iSCSI Protocol and Functionality
PPT
Pcie drivers basics
PDF
CCNA CheatSheet
PDF
Ccnp presentation [Day 1-3] Class
PDF
Project ACRN: SR-IOV implementation
PPTX
SCSI Interfaces
PDF
Interrupts
PDF
Tutorial WiFi driver code - Opening Nuts and Bolts of Linux WiFi Subsystem
PPT
Cisco Switch Security
PPTX
Linux Interrupts
PDF
Network Drivers
PDF
LCA13: Power State Coordination Interface
PDF
LAS16-200: SCMI - System Management and Control Interface
PDF
LinuxCon 2015 Linux Kernel Networking Walkthrough
PDF
Linux Networking Explained
LinuxIO-Introduction-FUDCon-2015
Linux Network Stack
The TCP/IP Stack in the Linux Kernel
introduction to linux kernel tcp/ip ptocotol stack
iSCSI Protocol and Functionality
Pcie drivers basics
CCNA CheatSheet
Ccnp presentation [Day 1-3] Class
Project ACRN: SR-IOV implementation
SCSI Interfaces
Interrupts
Tutorial WiFi driver code - Opening Nuts and Bolts of Linux WiFi Subsystem
Cisco Switch Security
Linux Interrupts
Network Drivers
LCA13: Power State Coordination Interface
LAS16-200: SCMI - System Management and Control Interface
LinuxCon 2015 Linux Kernel Networking Walkthrough
Linux Networking Explained
Ad

Viewers also liked (6)

PDF
TECHNICAL BRIEF▶ NDMP Backups with Backup Exec 2014
PPTX
Avamar weekly webcast
PDF
Using VMware Infrastructure for Backup and Restore
PPTX
Storage Devices And Backup Media
PPTX
Understanding das-nas-san
PDF
Understanding RAID Levels (RAID 0, RAID 1, RAID 2, RAID 3, RAID 4, RAID 5)
TECHNICAL BRIEF▶ NDMP Backups with Backup Exec 2014
Avamar weekly webcast
Using VMware Infrastructure for Backup and Restore
Storage Devices And Backup Media
Understanding das-nas-san
Understanding RAID Levels (RAID 0, RAID 1, RAID 2, RAID 3, RAID 4, RAID 5)
Ad

Similar to SCSI Protocol (20)

PDF
10.1.1.48.4087
PDF
CCNA Quick Notes
PPTX
Zenith Networks: Jump Start JUNOS
TXT
Practice
PPS
Ccna Imp Guide
PPTX
UNIT-2 PPT Data link layer.pptx
PDF
Final Report
PDF
PPTX
UNIT 5- UNDERSTANDING THE SYSTEM DESIGN PROCESS.pptx
PDF
Best practices for catalyst 4500 4000, 5500-5000, and 6500-6000 series switch...
PDF
ParallelLogicToEventDrivenFirmware_Doin
PDF
SDN Fundamentals - short presentation
PDF
Awesome_fuzzing_for _pentester_red-pill_2017
DOC
NAVEEN UART BATCH 43
PPT
I/O System
PPTX
IO hardware
DOCX
Pre-Compliance Accreditation Tool for Python
PPT
Basics to Configure NW Device
PDF
6-OSI Model - ISO - Organization for Standardization.
10.1.1.48.4087
CCNA Quick Notes
Zenith Networks: Jump Start JUNOS
Practice
Ccna Imp Guide
UNIT-2 PPT Data link layer.pptx
Final Report
UNIT 5- UNDERSTANDING THE SYSTEM DESIGN PROCESS.pptx
Best practices for catalyst 4500 4000, 5500-5000, and 6500-6000 series switch...
ParallelLogicToEventDrivenFirmware_Doin
SDN Fundamentals - short presentation
Awesome_fuzzing_for _pentester_red-pill_2017
NAVEEN UART BATCH 43
I/O System
IO hardware
Pre-Compliance Accreditation Tool for Python
Basics to Configure NW Device
6-OSI Model - ISO - Organization for Standardization.

Recently uploaded (20)

PDF
Encapsulation theory and applications.pdf
PDF
cuic standard and advanced reporting.pdf
PPTX
MYSQL Presentation for SQL database connectivity
PPTX
sap open course for s4hana steps from ECC to s4
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PPTX
Programs and apps: productivity, graphics, security and other tools
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
Spectral efficient network and resource selection model in 5G networks
PPTX
Spectroscopy.pptx food analysis technology
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
Approach and Philosophy of On baking technology
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
Empathic Computing: Creating Shared Understanding
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Encapsulation theory and applications.pdf
cuic standard and advanced reporting.pdf
MYSQL Presentation for SQL database connectivity
sap open course for s4hana steps from ECC to s4
Unlocking AI with Model Context Protocol (MCP)
Per capita expenditure prediction using model stacking based on satellite ima...
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Programs and apps: productivity, graphics, security and other tools
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Spectral efficient network and resource selection model in 5G networks
Spectroscopy.pptx food analysis technology
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
NewMind AI Weekly Chronicles - August'25 Week I
Approach and Philosophy of On baking technology
Diabetes mellitus diagnosis method based random forest with bat algorithm
Empathic Computing: Creating Shared Understanding
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx

SCSI Protocol

  • 1. 1confidential Agenda: SCSI Domain SCSI Bus Phases SCSI Commands SCSI Conditions
  • 2. 2confidential SCSI-2 SCSI-3 I/O Process Task Queue Task Set Abort Tag Abort Task Abort Abort Task Set Bus Device Reset Target Reset
  • 6. 6confidential Initiator & Target Host Adapter Main Memory Host CPU Peripheral Controller Initiator TargetSCSI Bus Logical Units 0 1 2 3 6 2 6 3 Host Computer Host Adapter 0 1 2 3 6 2 6 3 Peripheral Controller Target Logical Units 0 1 2 3 6 2 6 3 Peripheral Controller Target Logical Units Initiator Host Computer Host Adapter 0 1 2 3 6 2 6 3 Peripheral Controller Target Logical Units 0 1 2 3 6 2 6 3 Peripheral Controller Target Logical Units Host Adapter Host Computer Initiator Initiator
  • 7. 7confidential SCSI Bus Model Analogy Terry “5” Tony “1” Tina “0” Larry “0” Lin “3” Lolly “2” Lisa “0” Lilly “0” Irene “7” Ian “6” [Initiators] [SCSI Bus] [Targets] [Logical Units]
  • 8. 8confidential SCSI 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 Indicates 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
  • 9. 9confidential  Communication on the SCSI bus is allowed between only two SCSI devices at any given time  When two SCSI devices communicate on the SCSI bus, one acts as an initiator and the other acts as a target.  Initiator originates an operation and the target performs the operation.  Each SCSI device has an SCSI ID bit assigned. When a device is initialized, SCSI allows for automatic assignment of device IDs on the bus, which prevents two or more devices from using the same SCSI ID. Bus SCSI ID Priority Narrow 7, 6, 5, 4, 3, 2, 1, 0 Wide 7, 6, 5, 4, 3, 2, 1, 0, 15, 14, 13, 12, 11, 10, 9, 8
  • 12. 12confidential SCSI Bus Phases BUS FREE phase ARBITRATION phase SELECTION phase RESELECTION phase COMMAND phase DATA phase STATUS phase MESSAGE phase Devices use this layer to recognize that the bus is available.Initiators or Targets use this layer to resolve bus contention.Initiators use this layer to select the targets to start an I/O process(O)This phase instructs the target what operation to perform(O).This protocol layer transfers data to or from the device.This protocol layer gives an update of the status of the operation(O)Targets use this layer to inform initiators to transmit a message.
  • 13. 13confidential SCSI Bus Phases – Flow Chart Bus Free Status Message Out Arbitration Selection Command Data In or Data Out Message In Reselection Waiting Phase Bus Control Phase Information Xfer Phase
  • 14. 14confidential SCSI Trace Bus State Absolute Timing s.mmm_uuu_nnn Bus Phase Transpired I - T Data Bus single values represent SCSI ID's, otherwise values are in hex bytes Event 1 00.000_000_000 Bus Free Detected 0000 2 26.032_853_700 Arbitration Start 7 0001 2 26.032_856_100 Arb_win 7 0002 2 26.033_514_100 (Atn Assertion) ATN 0003 2 26.033_521_700 Selection Start I → T 7 4 ATN 0004 2 26.033_522_600 Selection Complete I → T ATN 0005 2 26.034_161_850 I → T (Atn Negation) ATN 0006 2 26.034_833_950 Message Out I → T C0h 0007 2 26.039_035_750 Command Out I → T 08 00 01 00 01 00 0008 3 26.055_860_800 Data In I ← T 00 00 00 00 00 00 0009 3 26.055_862_300 I ← T 00 00 00 00 00 00 0010 3 26.056_494_450 I ← T 00 00 00 00 0011 4 26.056_894_350 Status In I ← T 00 0012 4 26.057_852_350 Message In I ← T 00 0013 1 26.058_426_300 Bus Free Detected 0014 Legend: 1 No One Using Bus 2 Protocol to access peripheral and start process 3 Transfer data 4 Protocol to complete process
  • 18. 18confidential Logical Unit  Are a physical/virtual peripherial device addressable through a traget.  Are the basic addressable unit on a target.  Have a default number of zero.  Must be sequentially numbered if there are more than one.  Max 8 Lus(64) per target controller in SCSI-2(SCSI-3).  One or more LU names  A Device Server  A Task Manager  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.
  • 21. 21confidential SCSI Initiator & Target Initiator ID Target ID LUNInitiator ID SCSI ID/SAS Addr/N_PortID SCSI ID/SAS Addr/N_PortID
  • 23. 23confidential SCSI - No Data Xfer Commands
  • 25. 25confidential SCSI CDB 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 is the SCSI Universe.  CDBs come in various sizes, typically 6, 10, 12, or 16 bytes total. Where to begin the operation How many blocks What command  10-byte READ command.  This command, if successful, will move one block (512 bytes) of data to the host computer system, from logical block address 100h (hex). NACA, Linked
  • 26. 26confidential SCSI Status Byte Hex Status 00 GOOD 02 CHECK CONDITION 04 CONDITION MET 08 BUSY 10 INTERMEDIATE 14 INTERMEDIATE-CON MET 18 RESERVATION CONFLICT 28 TASK SET FULL 30 ACA ACTIVE Any time a SCSI command is sent to a Target  The Initiator expect a completion Status  This status can reflect successful or un successful completion of the command. Sent during Status Phase, prior to Command Complete Message, to indicate success or failure of the command sequence
  • 27. 27confidential 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)
  • 28. 28confidential SCSI Sense Data Format SENSE KEYS 00 No Sense 01 Recovered Error 02 Not Ready 03 Medium Error 04 Hardware Error 05 Illegal Request 06 Unit Attention 07 Data Protect 08 Blank Check 09 Vendor Specific 0A Copy Abort 0B Aborted Cmd 0C Obsolete 0D Vol OverFlow 0E Miscompare 0F Reserved Event Description: Unexpected sense: PD 04(e0xfc/s4) Path 4433221107000000, CDB: a1 08 0b d0 00 00 4f c2 00 b0 00 ff, Sense: 5/24/00 Sense key ASC ASCQ
  • 29. 29confidential Message System The message system allows communication between an I and T for the purpose of INTERFACE management. Messages are xfered during MESSAGE IN and MESSAGE OUT phases. One or more messages may be sent during a single MESSAGE phase, but a message may not be split between multiple MESSAGE phases. The first msg byte after SELECTION phase shall be an IDENTIFY, ABORT, or BUS DEVICE RESET msg. If T receives any other msg then bus will go to BUS FREE state. The IDENTIFY msg establishes a logical connection, or nexus between the I and the specified LU, I_T_L nexus, within the target. 06h - ABORT 0Dh - ABORT TAG 24h - ACA QUEUE TAG OCh - BUS DEVICE RESET 16h - CLEAR ACA 0Eh - CLEAR QUEUE 00h - COMMAND COMPLETES
  • 30. 30confidential SCSI Task Management Functions  Abort Task : Abort the specific task(ITLQ or ITL).  Abort Task Set : Abort all tasks for the issuing initiator(ITL).  Clear Task Set : Abort all tasks for the issuing initiator(TL).  Target Reset : Resets the specific target. All tasks in all the logical units are reset and Unit Attention is set.  Logical Unit Reset : Reset the logical unit. All tasks in the specified logical unit are reset and Unit Attention is set.  Clear ACA: Clears ACA condition at the specified logical unit. Because SCSI Task management functions are not commands, the request is not sent by using a CDB and the response is not indicated by SCSI status.
  • 31. 31confidential Contingent Allegiance Condition (CAC) A Contingent Allegiance Condition is: a Condition (state) that is Contingent (dependent) upon the Allegiance (connection) between two entities, or components, in a SCSI-based system. 1. Make a connection (establish a Nexus) 2. Issue a command (from initiator to target) 3. Process the command (Target moves data to or from storage, if needed) 4. Receive GOOD status (00h code) 5. Close the connection (Nexus “goes away”) What if we do not get GOOD status? When something goes wrong, then you do NOT receive GOOD status – you most often get back a CHECK CONDITION status (02h code) from the target. This is how the initiator is informed that an error occurred.
  • 32. 32confidential SAM Error Recovery NACA Normal Auto Contingent Allegiance =0 =1 CAC Contingent Allegiance Condition ACAC Auto Contingent Allegiance Condition
  • 33. 33confidential Contingent Allegiance Condition(SCSI-2) Initiator 7 Initiator 6 Initiator n Target xLogical Unit 0 76543210 Ian asked Tom to get a file from Larry, but Larry can’t find it. Tom must inform Ian that the request has a CAC by returning a CC (02H) code during the STATUS IN phase. Then Tom will set an internal CAC flag (per LUN)associated with Ian’s SCSI ID and preserve it until it is cleared by Ian. CAC shall be preserved for I_T_L nexus untill it is cleared.  a hard reset condition  an ABORT message  a BUS DEVICE RESET message  any subsequent commands for the I_T_L nexus, mostly command will be REQUEST SENSE Logical Unit 1 76543210 Logical Unit n 76543210
  • 34. 34confidential Auto Contingent Allegiance Condition (SCSI-3) The ACA (NACA=1) condition shall exist within the task set when the logical unit completes a command by returning a CHECK CONDITION status.  Task set boundary.  Preserved untill it is cleared.  Sense data shall be returned using the “Autosense” feature.
  • 35. 35confidential Reset Condition Logical Unit Reset Response to a) LOGICAL UNIT RESET task management request b) any logical unit reset event (ex: target hard reset) 1) Abort all tasks in the task set. 2) Clear -- ACA(NACA=1 i.e SCSI-3 ) or Contingent Allegiance(NACA=0 i.e SCSI-2) 3) Clear -- Disk Reservation 4) Data Xfer mode -- default async 5) Mode parameters -- restore last saved values 6) Unit Attention -- UA condition shall be set for all other devices.
  • 36. 36confidential Unit Attention Condition Reports to I that operating mode of the T has changed from the last cmd sent to the T. Reported on all SCSI cmds except INQURY. Cmd it is reported with is not executed.  Each LU shall generated a UA condition, for each I, whenever the LU has been reset by: 1. a hard reset condition 2. by a power-on reset. 3. or a BUS DEVICE RESET message  LU shall also generate a UA condition for each I whenever one of the following events occurs: 1. A removable medium may have been changed. 2. The mode parameters in effect for this I have been changed by another initiator. 3. The level or version of microcode has changed. 4. Tagged commands queued for the I were cleared by another I. 5. INQURY data has been changed. 6. The LU inventory has been changed. 7. A removable medium may have been changed. 8. The mode parameters in effect for this I have been changed by another initiator. 9. Tagged commands queued for this I were cleared by another I. 10. The version or level of microcode has been changed.
  • 37. 37confidential Do u want to initiate a Task ?

Editor's Notes

  • #12: The logical unit processes the commands sent by a SCSI initiator. A logical unit has two components, a device server and a task manager. The device server addresses client requests, and the task manager performs management functions. The SCSI initiator device is comprised of an application client and task management function, which initiates device service and task management requests.The I initiates command and task management requests. Depending on the transport protocol and physical interface used, the I may also initiate protocol or interface specific requests.Examples of I requests are: write, read data, format a portion if the disk or return information about the storage device.By contrast, T simply respond to I requests and generally do not originate requests of their own.
  • #13: SCSI bus can be in only one phase at a given time.
  • #15: ATN – Attention – Causes a msg out.
  • #19: Associated with each T are one or more Logical Units(e.g disk drive) that are the ultimate recipient of I requests. A LU is an entity that implements one of the device functional models described in the SCSI command standards and process SCSI commands such as reading from or writing to the media.
  • #22: Initiator ID - a number from 0 to 15 with the most common value being 7.Target ID - a number from 0 to 15LUN - a number that specifies a device addressable through a target.
  • #26: Control byte is used for error handling (NACA bit), linked commands and vendor specific bits.sg_raw -r 1k /dev/sdc 12 00 00 00 60 00 (inqury)sg_inq /dev/sdcsg_raw /dev/sdc 28 00 00 00 01 00 00 00 01 00 (read)
  • #31: The SCSI architecture provides several task management functions that can be used to affect the state of the one or more tasks in the target. The I sends the task management request to the targetand the T returns a response indicating the completion of the request.
  • #32: The other part you are supposed to know is that the target has generated some sense data, which will explain why the error occurred.  And this is where the CAC and Nexus part comes in – the target is supposed to keep the sense information based on the nexus, and that particular command.
  • #34: While the CAC exists, the T will preserve the sense data for the I.Execution of all tagged I/O processes for the I_T_L nexus for which the CAC exists shall be suspended untill the CAC is cleared.