SAS Protocol Basics
Serial Attached SCSI (SAS)
Serial Atttached SCSI, also known and referred to as SAS, SAS1.1, SAS2.0, SAS-2
SAS2 is an update from the previous version of SAS1.1. Several changes were implemented in this new specification. Speed-Negotiation, Connection Multiplexing (MUX), Zoning, and self-reporting Expanders are some of major additions and revisions.
SAS Speed Negotiation
Speed Negotiation in SAS was changed to allow for devices to report supported speeds, request MUX, and type of SSC supported. Speed Negotiation was broken up into several windows (SNWs) that determine what a device supports. For devices not supporting a particular window, D.C. idle is transmitted. The SNW's are SNW-1, SNW-2, SNW-3, Train-SNW, and Final-SNW. Below is a flow-chart showing the transition and decision-tree for a device during speed negotiation:

To maintain backwards compatibility with SAS1.1 devices in a SAS2 environment, SNW-1, SNW-2 and Train-SNW mirror the speed negotiation method found in SAS1.1. These windows are also referred to as 'Speed Negotiation without Training' and are described below:
SNW-1: Align(0) and Align(1) primitives are transmitted at 1.5Gbps by both devices until sychronization is achieved. Once achieved, the devices then transition into SNW-2.
SNW-2: Align(0) and Align(1) primitives are transmitted at 3.0Gbps by both devices until sychronization is achieved. Once achieved, the devices then transition into SNW-3. If one or both of the devices are SAS1.1, they will transmit D.C. Idle until the window for Final-SNW opens up.
Final-SNW: Final SNW determines the fastest link rate common to both devices. If both devices are 3.0Gbps capable and SNW-2 completed successfully, then the negotiated link rate shall be 3.0 Gbps.
For SAS2 devices, SNW-3 and Train-SNW were added to allow the devices to broadcast what features they support along with requesting a multiplexed link. The order in which the speed negotiation occurs is detailed below:
First the devices go through SNW-1 and SNW-2, and then into SNW-3. During SNW-3 the devices send a combination of COMWAKE bursts and D.C. Idles. These bursts and idles correspond to a 32 bit "packet" that lists the devices' PHY capabilities. Please see the table pictured below for a detailed list of what each bit means:
| Byte/Bit | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
| 0 | START (1b) | TX SSC TYPE | RESERVED | REQUESTED LOGICAL LINK RATE | ||||
| 1 | G1 w/o SSC | G1 w/ SSC | G2 w/o SSC | G2 w/ SSC | G3 w/o SSC | G3 w/ SSC | RESERVED | |
| 2 | RESERVED | |||||||
| 3 | RESERVED | PARITY | ||||||
An example of the 32 bit "packet" is C0FC0000 which corresponds to a SAS2 device supporting the SNW-3 (Start bit = 1), Center-Spreading SSC (1 if Center-spreading, 0 if down-spreading), 1.5/3.0/6.0 speeds with and without SSC, no requested logical link rate (more on that later), and the Parity bit was not set due to an even number of bits being set to 1.
Here's an example of a "decoded" SNW-3 capabilities bits exchange between 2 devices using BusXpert's SAS/SATA software:

Once the devices have finished SNW-3, they move into Train-SNW. Train-SNW is used to match up the devices' highest supported capabilities and synchronise the links. TRAIN and TRAIN_DONE primitives are sent for receiver matching. For example if device A had bits C0FC0000 and device B had bits C0F0000, the two devices would synchronize their link to 3Gbps with SSC. A table describing the data sent during Train-SNW is below.
| Training Pattern | Description |
| TRAIN Pattern | Sequence of 1) TRAIN primitive sequence; and 2) 58 DWORDS set to 00000000h that are transmitted scrambled and 8b10b encoded |
| TRAIN_DONE Pattern | Sequence of 1) TRAIN_DONE primitive sequence; and 2) 58 DWORDS set to 00000000h that are transmitted scrambled and 8b10b encoded |
After Train-SNW is completed, speed negotiation is finished. Below is an example of speed negotiation between 2 devices:

Connection Multiplexing:
coming soon.
| Transmitted REQUESTED LOGICAL LINK RATE field | Received REQUESTED LOGICAL LINK RATE field | Requested Logical Link Rate |
| 0h (No multiplexing) | Any | Negotiated physical link rate |
| 8h (1.5Gbps) | 8h (1.5 Gbps) | 1.5Gbps |
| 9h (3 Gbps) | ||
| Ah (6 Gbps) | ||
| Bh - Fh (future rates) | ||
| 9h (3 Gbps) | 8h (1.5 Gbps) | 1.5 Gbps |
| 9h (3 Gbps) | 3 Gbps | |
| Ah (6 Gbps) | ||
| Bh - Fh (future rates) | ||
| Ah (6 Gbps) | 8h (1.5 Gbps) | 1.5 Gbps |
| 9h (3 Gbps) | 3 Gbps | |
| Ah (6 Gbps) | 6 Gbps | |
| Bh - Fh (future rates) |

