It is a client-server protocol. Client is called “Initiator”, normally it is a Computer with HBA (Host Bus Adapter use to connect the targets like Disks). Server is called “Target”, normally it is a device such as hard disk, CD-ROM Driver, Tape Drive, Printer, etc.
The SCSI architecture model is called “SAM”. It has four layers.
Device Specific Command Sets
Shared Command Set
1. Physical Interface – the one that really physically connect Initiator with Target. Parallel interface, Fibre Channel, Ethernet (TCP/IP), IEEE 1394 are some of the examples.
2. Transport Protocols – Services and protocols with which Initiator communicates with Target. Examples are FCP, iSCSI, SAS, etc.
3. Shared Command Set – Primary commands common for any SCSI device. All SCSI device must support this command set
4. Device Specific Command Sets – This is also called Application layer. The commands originates from this layer in case of Initiator and processed in case of Target. SBC (for disk drives), SSC (streaming devices like Tape drives), MMC (DVD drive) are some of the examples.
Initiator is basically OS I/O Subsystem and HBA, through which it sends request to Target. A single initiator can have multiple Application clients (i.e one computer can have multiple application clients like disk drive client, tape drive client and DVD drive clients.
Initiator can have one or more ports and one or more application clients.
It is basically the SCSI device which receives, executes and returns initiator requests and their associated responses. A Target has one Task manager, one Device Server and one or more Logical Units.
Logical Unit is basically a minimal unit to represent a device. Normally Hard disk drive has one Logical Unit only. A storage device can expose more than one logical unit, so that the client can consider them as multiple storage units (e.g. when a hard disk exposes two logical units, it is considered as two different disk devices by Initiator) This is useful for scalability. They are numbered, which is called as LUN (Logical Unit Number).
Task manager does the job of controlling the sequencing of tasks within a Logical Unit. It does task management functions like terminating a issued task by initiator, reset the logical unit, etc.
Device Server is the one which executes the commands on specific LUN.
Task Sets is the one which contains different kind of tasks (data structures in practical) as Queue, which represents the work to be performed on Target.
There are two types of tasks – Tagged and Untagged. Untagged tasks are represented by I_T_L nexus, i.e there is no specific queuing requirement for this task. Tagged tasks are represented by I_T_L_Q nexus.
Task attributes are four types.
- 1. Simple – Target can execute in any order
- 2. Ordered – Target must execute all task prior to executing this ordered task
- 3. Head of Queue (HOQ) – Insert this task into front of queue
- 4. Auto Contingent Allegiance (ACA) – Used during target in error condition
Three phases of I/O operation are,
- 1. Command sent via CDB (Command Descriptor Block)
- 2. Data transfer – Read/Write and Inquiry commands are example for data transfer. Control Commands like Test Unit Ready, Start/Stop Unit and Rewind does not have Data transfer phase.
- 3. Status received from Device
Command Descriptor Block (CDB):
- The first byte of CDB is Operation code
- The last byte is Control Byte
- CDB can be of length 6, 10, 12, 16 or variable
- Inquiry and Test Unit Ready are mandatory commands
- Check Condition – Error condition exists for another command
- Task Set Full