1. Responsibility
    1. Pass request and confirmations between adjacent layers
    2. Handle some Link Layer errors
    3. Construct frames
  2. SSP Frames
    1. Header Field
      1. The header communicates the purpose of this frame and how it will be serviced
      2. Frame Type
        1. Initiator to Target
          1. COMMAND
          2. Task Management
        2. Target to Initiator
          1. XFER_RDY
          2. RESPONSE
        3. Both
          1. Data
        4. While these can be uninterrupted transaction sequences, the SCSI target is allowed to disconnect at any time and reconnect later to finish the sequence
      3. Hashed Destination and Source Addresses
        1. Once the connection is established, there is no need for address information in the subsequent frames
        2. Allow devices to verify that the frame is still using the same address that were accepted with the request
      4. Retry Data Frames
        1. Only used with XFER_RDY frames
      5. Retransmit
        1. Indicate whether this frame is a retransmission of an earlier frame
      6. Number of fill bytes
        1. All transfers in groups of fourt bytes called dwords
        2. Indicate how many bytes were added
      7. Tag
      8. TPTT
        1. For the target to associate the buffer space for this transaction
        2. Allow it to be put into the proper buffer with minimal delay
        3. The initiator must latch the TPTT value every time it sees an XFER_RDY
      9. Data offset
        1. a data offset value that equals the sum of the data offset and data length of the previous transfer
        2. The frame with unexpected offset value
          1. Initiator
          2. Discard
          3. Target
          4. Discard
          5. Terminate the command
      10. Changing Data Pointer
        1. Indicate that the target is resending a DATA frame with a Data Offset field that may not be sequential with reference to that of the previous frame
    2. Information Unit
      1. Represent the information corresponding to the frame type
      2. COMMAND
        1. LUN
        2. Enable First Burst
        3. Task Attribute
          1. SIMPLE
          2. HEAD OF QUEUE
          3. ORDERED
          4. ACA
        4. Additional CDB Length in dwords
        5. CDB
        6. Additional CDB Bytes
      3. RESPONSE
        1. DataPres
        2. Dtatus
        3. Sense Data Length
        4. Response Data Length
        5. Response Data or Sense Data
      4. XFER_RDY
        1. Requested Offset
        2. Write Data Length
      5. Task Management
        1. LUN
        2. Task Management Function
        3. Tag of Task to be Managed
    3. Fill Bytes
      1. make the frame aligned on a dword or four-byte boundary
      2. Only the Data frame and Response frame can possibly need fill bytes
    4. CRC
      1. The CRC is computed by the transmitter
  3. SSP Error Handling
    1. General
      1. Maintain a copy of outgoing frames until the receiveer confirm them so that they cab be replayed if needed
      2. Software error recovery mechanisms are already in place for SCSI
    2. Transport Layer Errors
      1. Target errors
        1. XFER_RDY
          1. It should only go to Initiator
          2. Discard
        2. COMMAND
          1. Incomplete or badly formed
          2. Send a RESPONSE frame with Response Code field set to Invalid Frame
          3. With a tag that is already in use
          4. Send a RESPINSE frame with CHECK CONDITION
        3. TASK
          1. Too short
          2. Send a RESPONSE frame with Response Code field set to Invalid Frame
        4. DATA
          1. with unknown Tag value
          2. Discard
          3. Arrived without permission
          4. Discard
        5. Unknown frame type
          1. Discard
      2. Initiator errors
        1. COMMAND
          1. Discard
        2. TASK
          1. Discard
        3. Unsupported frame
          1. Discard
        4. DATA
          1. with an unknown Tag
          2. Discard
          3. Possibly abort the command with that tag
        5. XFER_RDY
          1. not 12 bytes long
          2. Discard the frame
          3. Abort the command
    3. Link Layer Errors Affected by Transport Layer
      1. General
        1. The frame is good at the Link Layer
          1. a ACK primitive is sent
        2. Something is not right with it
          1. a negative acknowledge, NAK, is sent
      2. COMMAND
        1. with NAK
          1. Simply repeat
        2. no ACK or NAK
          1. Initiator's ACK/NAK timeout counter will expire after 1ms(p.236)
          2. Find out what happened
      3. Inffered Response to COMMAND Frame
        1. no ACK, but an appropriate response arrives
          1. the missing ACK can be inferred from the response of the target
        2. sending a RESPONSE but not see an ACK
          1. p.237
      4. TASK
        1. an ACK/NAK timeout observed
          1. Close connection with DONE
          2. Reopen a connection
          3. Send TASK with the same tag, set RETRANSMIT bit
        2. no ACK, but a RESPONSE before ACK.NAK timeout
          1. Assumed received
      5. XFER_RDY
        1. ACK/NAK timeout
          1. Close → Reopen connection
          2. TLR set
          3. resend XFER_RDY
          4. Different TPPT
          5. RETRANSMIT set
          6. TLR not set
          7. send RESPONSE
          8. CHECK CONDICTION
          9. ABORT COMMAND
          10. ACK/NAK TIMEOUT
        2. NAK
          1. the same as before, not close the connection first
    4. Handling Errors in Non-Interlocked DATA Frames
      1. Read
        1. ACK/NAK timeout
          1. Close → Reopen connection
          2. TLR set
          3. Retransmit all the DATA frames since the last time ACK/NAK Balance occurred
          4. TLR not set
          5. send RESPONSE
          6. CHECK CONDICTION
          7. ABORT COMMAND
          8. ACK/NAK TIMEOUT
        2. NAK
          1. the same as before, not close the connection first
      2. Write
        1. ACK/NAK timeout
          1. Close → Reopen connection
          2. TLR set
          3. Retransmit all the DATA frames since the previous XFER_RDY
          4. TLR not set
          5. ABORT TASK
        2. NAK
          1. No close and reopen
          2. TLR set
          3. Retransmit all the DATA frames since the previous XFER_RDY
          4. TLR not set
          5. ABORT TASK
  4. SMP Transport Layer
    1. Only one request and one response can be sent within an SMP connection and then must be closed
    2. No flow control or permission to transmit
      1. no XFER_RDY, RRDY, DATA
    3. Both sides close the connection after the RESPONSE
  5. SSP State Machine
    1. Transport Layer Messages
      1. Initiator Communication (App ↔ Trans)
        1. p.246
        2. Requests
          1. Accept_Reject OPENs
          2. Indicate whether it wishes to accept new incoming connections
        3. Indications and Confirmations
          1. Nexux Loss
          2. Indicate that the lower layers were unable to reconnect with a device with which communication had already been established, and have given up trying
          3. Transport Reset
          4. Indicate that the Transport Layer has received a confirmation that a HARD_RESET was received on the link
      2. Target Communication (App ↔ Trans)
        1. p.247
        2. Response
          1. Send Command Complete
          2. RESPONSE frame
          3. Indicate the status of a command
          4. GOOD
          5. CHECK CONDITION
          6. etc.
          7. Task Management Function Executed
          8. RESPONSE frame
          9. Describe the status of a Task Management request
          10. Send Data_Out
          11. XFER_RDY frame
          12. Terminate Data Transfer
          13. Accept_Reject OPENs
        3. Indications and Confirmations
    2. Initiator State Machines
      1. General
        1. An initiator has only one IFT, but may have several ITS
          1. IFR: Initiator Frame Router
          2. ITS: initiator Transport Server
          3. The launching point for outgoing frame requests coming from the App.
          4. The target for the incoming frames whcih it then passes back to it
        2. Outing requests create
          1. COMMAND
          2. DATA
          3. TASK
        3. Incoming frames
          1. XFER_RDY
          2. DATA
          3. RESPONSE
      2. Outgoing Frames
      3. Incoming Frames
      4. Cancelling Requests
    3. Target State Machines
      1. General
        1. TFR: Target Frame Router
        2. TTS: Target Transport Server
    4. SMP State Machines
      1. Initiator port
        1. MT_IP: SMP Transport Layer for Initiator Ports
      2. Target port
        1. MT_TP: SMP Transport Layer for Target Ports