Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

SCSI Protocol

7,496 views

Published on

Published in: Technology

SCSI Protocol

  1. 1. 1confidential Agenda: SCSI Domain SCSI Bus Phases SCSI Commands SCSI Conditions
  2. 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
  3. 3. 3confidential SCSI Standards Device Specifi c Comm and Sets Transp ort Protoc ol Physica l Interfac Shared Command Set Architectural Model
  4. 4. 4confidential
  5. 5. 5confidential Protocol Service Model
  6. 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. 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. 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. 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
  10. 10. 10confidential SCSI Domain
  11. 11. 11confidential SCSI Domain
  12. 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. 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. 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
  15. 15. 15confidential SCSI Domain
  16. 16. 16confidential SCSI Initiator
  17. 17. 17confidential SCSI Target
  18. 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.
  19. 19. 19confidential SCSI Nexus
  20. 20. 20confidential SCSI Task Attributes
  21. 21. 21confidential SCSI Initiator & Target Initiator ID Target ID LUNInitiator ID SCSI ID/SAS Addr/N_PortID SCSI ID/SAS Addr/N_PortID
  22. 22. 22confidential Protocol Services
  23. 23. 23confidential SCSI - No Data Xfer Commands
  24. 24. 24confidential SCSI – Data Xfer Commands
  25. 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. 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. 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. 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. 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. 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. 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. 32. 32confidential SAM Error Recovery NACA Normal Auto Contingent Allegiance =0 =1 CAC Contingent Allegiance Condition ACAC Auto Contingent Allegiance Condition
  33. 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. 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. 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. 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. 37. 37confidential Do u want to initiate a Task ?

×