Featured Products
ASUS O!Play HDP-R1 1080p HD Digital Media Player, eSATA and; Advanced LAN Support
ASUS O!Play HDP-R1 1080p HD Digital Media Player, eSATA and; ...
Only $99.99

  Microsoft Windows XP Home Edition 32-bit Operating System, Full Version with SP3, 3pk, OEM
Microsoft Windows XP Home Edition 32-bit Operating System, ...
Only $254.99

*$20 Mail-In Rebate and $10 Instant Rebate* Black CoolMax 600W ATX12V v2.0 Computer Power Supply, SLI Ready, Support SATA, PCI-E, Model: CXI-600B
*$20 Mail-In Rebate and $10 Instant Rebate* Black CoolMax 600...
Only $69.99

Black/Blue Cooler Master Elite 310 ATX Mid Tower Computer Case RC-310-BKR2, w/ 120mm Fan and 420W PSU
Black/Blue Cooler Master Elite 310 ATX Mid Tower Computer Cas...
Only $49.99

CoolIT Domino A.L.C. Liquid CPU Cooler with High Contrast Backlit LCD. Model: DM-1000
CoolIT Domino A.L.C. Liquid CPU Cooler with High Contrast Bac...
Only $62.99

*$10 Mail-In Rebate* Black SilverStone FT-01-BW Aluminum ATX Mid-Tower Uni-body Computer Case, w/ Window.
*$10 Mail-In Rebate* Black SilverStone FT-01-BW Aluminum ATX ...
Only $199.99

In Win AMMO 2.5in SATA to USB 2.0 External Hard Drive Enclosure, RFID Technology
In Win AMMO 2.5in SATA to USB 2.0 External Hard Drive Enclosu...
Only $26.99

Enter keyword(s):

Home >> Resources - Serial ATA >> 

Comparing Serial ATA Native Command Queuing (NCQ) & ATA Tagged Command Queuing (TCQ)

Shorts: | Serial ATA II White Paper | SATA Vs Ultra ATA | What is SATA 3Gb/s? | Native Command Queuing |

Summary

Native Command Queuing (NCQ) is among the most anticipated advanced features introduced in the Serial ATA II: Extensions to Serial ATA 1.0 specification, available for download at www.serialata.org. NCQ is designed to increase performance by allowing the hard drive to accept multiple outstanding commands and optimally re-order the execution of those commands.

The general concept of allowing the hard drive the freedom to re-order commands for better performance is not new. SCSI drives have had support for command queuing for more than a decade resulting in superior random I/O performance in queued environments such as in servers and workstations. In 1997, the ATA specification added a Tagged Command Queuing (TCQ) protocol to try and achieve a similar performance benefit on random I/O that SCSI has.

When the Serial ATA 1.0 specification was completed in late 2001, the ATA TCQ protocol was not realizing the full performance potential that command queuing has for queued random I/Os. At that time only one drive manufacturer supported the ATA TCQ protocol and there was virtually no driver support for the feature. One of the reasons for the lack of adoption is that the ATA TCQ protocol has inefficiencies that can cause significant performance degradation in a lightly queued workload common in many desktop environments.

The Serial ATA II Workgroup recognized that improving random I/O performance for Serial ATA drives was important and that the ATA TCQ protocol would not meet this need. The Serial ATA II Workgroup developed the Native Command Queuing (NCQ) protocol to deliver higher random I/O performance while minimizing the inefficiencies that plague the ATA TCQ protocol.

To achieve excellent random I/O performance on highly queued workloads without incurring performance degradations on lightly queued workloads, ensure that the drive and system support Native Command Queuing.




Key Feature Comparison

There are three key features that enable a low overhead command queuing protocol – an efficient status return mechanism, low interrupt overhead, and an efficient host memory buffer selection mechanism (referred to as First Party DMA). This section compares the support for and implementation of each of these important features in Native Command Queuing and ATA TCQ.

Status Return Mechanism

A command queuing protocol must define how to tell the host that a command is complete; this is commonly referred to as the status return mechanism. The status return mechanism should allow the drive to efficiently complete commands in an out-of-order fashion.

Native Command Queuing has a status return mechanism that is race-free and without host handshakes. The drive may issue command completions for multiple commands back-to-back or even at the same time. This key feature is possible because the protocol was designed to not require a handshake from the host on a command completion. The status mechanism allows the device to "pile on" completions if two commands finish closely in time and it still allows the host to positively know which of the 32 commands have completed. As an example of the efficiency of this scheme, the drive can return successful status for all 32 commands simultaneously in a single 64-bit packet.

In contrast, the ATA TCQ protocol requires a handshake between the host and device for each and every command completion. To complete a command, the host actually has to issue a new command, called Service, to the device to determine the command to complete. There is no mechanism in ATA TCQ to complete multiple commands at the same time or back-to-back without host intervention. This overhead adds a significant amount of latency to this protocol.

Interrupt Overhead

A key to good performance in any data transfer protocol is minimizing the number of interrupts taken by the host in order to satisfy a request. Each interrupt that is taken increases CPU utilization and latency because the software interrupt service routine does not run immediately. Interrupt service latency can vary from microseconds to milliseconds depending on the current utilization of the system.

Native Command Queuing was designed to minimize the number of interrupts per I/O and has a maximum of one interrupt per command. The number of interrupts per command is often less than one when interrupts are aggregated. Interrupts may be aggregated (combined) by the drive explicitly if it completes multiple commands at the same time. Additionally, if the drive completes multiple commands in a short time span, the individual interrupts for each command are automatically aggregated into one interrupt by the host controller. In a highly queued workload this situation can occur frequently since interrupt service latency may be long in comparison to the time between command completions.

In contrast, ATA TCQ has two interrupts for every command. There is no means to aggregate these interrupts because each step in the ATA TCQ protocol requires a host handshake. There is one interrupt for setting up the DMA engine for a data transfer and another interrupt for completing the command.




Host Memory Buffer Selection (First Party DMA)

Command queuing is designed to allow the drive to select which command to perform a data transfer for next. Allowing the drive to determine the next transfer and directly select the corresponding host memory buffer is called First Party DMA.

Native Command Queuing has First Party DMA support – the drive can directly select the DMA context for a subsequent data transfer without host software intervention. The drive selects the DMA context by sending a packet to the host controller specifying the tag/identifier of the command that the data transfer is for. The host controller hardware then loads the scatter/gather table pointer for that command (based on the tag value) into the DMA engine. Then the DMA transfer may immediately proceed.

ATA TCQ does not support First Party DMA. In the TCQ protocol, the drive causes an interrupt when it is ready to transfer data. The host processes the interrupt and determines that the SERV bit is set in the Status register. This means that the drive is ready to proceed with the data transfer for a particular command. Next the host must issue the Service command to the device to determine the tag of the command the data transfer is for. After the Service command is complete, the host can setup the DMA engine for that command. The interrupt service latency and Service command overhead can be a substantial performance penalty.

Host Controller Interface

To take full advantage of a good queuing protocol, the host controller (programming) interface needs to be geared towards a queued programming model. If the programming interface only allows the driver to issue one command at a time and does not automate DMA engine setup, it will be difficult to achieve maximum benefit from a queuing protocol.

Intel is leading an industry effort to define the Advanced Host Controller Interface (AHCI) for Serial ATA. This programming interface enables software to take advantage of all of the advanced features in Serial ATA 1.0 and Serial ATA II.

AHCI has full support for Native Command Queuing. AHCI provides a "command list" where software can build up to 32 commands with scatter/gather tables for each that the host controller will automatically issue to the device appropriately. This avoids latency and overhead from software being involved in explicitly issuing each and every command. AHCI also includes full automation for selecting the appropriate DMA engine context when the device issues a First Party DMA request. Thus software is only involved in constructing the command and completing the command to the OS. By keeping software "out of the way" the performance of the solution is increased.

The legacy Bus-master IDE host controller interface is the standard Parallel ATA programming interface and is typically used with ATA TCQ. With this interface, software must explicitly issue each and every command. There is no ability for software to pre-construct the commands to be issued to the device and have the host controller send them automatically. In addition, the interrupt taken to select the DMA engine context in ATA TCQ must be handled explicitly by software. There is a non-deterministic latency until the interrupt service routine can run and then software must issue the Service command to determine the queued command to transfer data for and then must select the appropriate DMA engine context. The non-deterministic overhead associated with programming the DMA engine causes significant performance degradation in a lightly queued workload.




Conclusion

Native Command Queuing is an efficient protocol that has a race-free status return mechanism, low interrupt overhead (<= 1 interrupt per command), and supports First Party DMA. Native Command Queuing addresses the shortcomings of ATA TCQ.

The shortcomings of ATA TCQ include high overhead, two interrupts per command, a large number of host handshakes, and no support for First Party DMA. The issues with ATA TCQ can cause performance degradation in lightly queued workloads where the benefit of queuing is outweighed by the significant overhead of the protocol.

The host controller interface used in a system has a significant impact on the queuing protocol benefits. The Advanced Host Controller Interface for Serial ATA was designed to take full advantage of the Native Command Queuing benefits.

Make sure that your next system has AHCI and supports Native Command Queuing to achieve excellent queued random I/O performance.

(Source: http://www.serialata.org)


Related Items: | Standard Drives (IDE/PATA) | Serial ATA Hard Drives | Standard IDE(PATA) Hard Drive Controllers | SATA Hard Drive Controllers | IDE(PATA) Mobile Racks | SATA Mobile Racks |


Customer Feedback through Yahoo!
Join our Newsletter

Shipping Policy Customer Services Payment Policy
  • Est. Shipping Cost
  • Time-in-Transit Map
  • FAQ - Shipping
  • Top Reasons for Delays
  • UPS, FedEx, Postal Office
  • Walk-in Sales
  • APO/FPO Shipping
  • International
  • Tracking Orders
  • Return Rates
  • Store Statistics
  • Customer Satisfaction
  • Account Applications
  • Frequent Errors
  • FAQ-Services
  • FAQ-Tech Support
  • Newsletter
  • Order Status
  • Credit Card via Phone
  • Purchase Order
  • Prepay, PayPal
  • Resellers
  • Corporate
  • Schools, Government
  • Terms & Conditions
  • Price & Tax
  • FAQ-Payment
  • Top Brands
    Abit, Acer, AMD, Antec, AOpen, Asus, ATI, Biostar, Buffalo, Cooler Master, Corsair, Creative, Dell, D-Link, Enermax, FSP, Gigabyte, Hauppauge, HP, Intel, InWin, Kingston, Lenovo, Lian-Li, Linksys, Lite-On, Logisys, Logitech, Maxtor, Microsoft, MSI, Mushkin, Netgear, OCZ, Seagate, Shuttle, Sony, SuperMicro, ThermalTake, Vantec, ViewSonic, Western Digital, XFX, Zalman.

    Have a question about our products, services or technical issues?
    Find the answer instantly! Type your question or key words in English:
                
                 (Recommended for finding a product in our web store or FAQ pages).
                
                (Recommended for sales, tech-support, & CS questions).
                 Advanced Search in HelpDesk
    95% email/ phone questions already have answers on our web site.
    Please check the answer online before calling or e-mailing.

    Directron.NET- Help Desk Directron.ORG - Resources Short Cuts
  • Sales Support
  • Tech Support
  • Knowledge Base
  • Customer Service
  • Open Forums
  • How to Choose?
  • FAQs, Glossary
  • BYO
  • Installation
  • How to Upgrade?
  • Troubleshooting
  • Drivers
  • Top Sellers
  • New Products
  • Future Products
  • Quiet Computers
  • Water Cooling
  • Overclocking
  • Case Painting
  • Copyright (c) 1997-2009 Directron.com, Inc., Houston, Texas
    Buy - Sell - Trade - Build - Repair - Upgrade - Help - Troubleshoot - Shopping
    Computers - Laptops - Servers - Hardware - Parts - Software - Peripherals - Services
    High Quality - Low Prices - Discount Shop - Large Selection - Free Products - Fast Shipping
    Affiliates: Dallas Computer Store - San Antonio Computer Store - K12 Education Computer Systems
       My Cart

    Enter Order #:
     

    Similar Items
    Microsoft Natural Ergonomic Keyboard 4000 wired Keyboard, Mod...
    Only $19.99

    WD Caviar Green 3.5in 1TB SATA 3.0Gb/s Internal Hard Drive, 7...
    Only $78.99

    Cooler Master Sentinel Advance Gaming Mouse SGM-6000-KLLW1-GP...
    Only $45.99

    Black ASUS USB Optical Mouse mini-N6 and USB Keyboard 820-001...
    Only $5.99

    A-DATA Turbo 4GB microSDHC Class 6 Flash Card, P/N: AUSDH4GCL...
    Only $5.99

    Sabrent All in 1 USB 2.0 External Flash Memory Mini Multi Car...
    Only $2.99

    Black MSI U100-641US 10-inch Wide Wind Netbook, Intel Atom N2...
    Only $249.99

    Syba Combination Laptop Security Lock, Model: SY-NBK65004...
    Only $3.99

    *$5 Mail-In Rebate* Black/Blue OCZ Equalizer USB Laser Gaming...
    Only $9.99

    eMachines EL1300G-02W Slim Line Desktop System, 20in Widescre...
    Only $329.99

    *$5 Mail-In Rebate* Copper CoolMax 2.5in Aluminum SATA HDD En...
    Only $6.99

    Acer AspireRevo 1600 AR1600-U910H Desktop PC PT.SCL05.004, In...
    Only $199.99

    *$15 Mail-In Rebate* Thermaltake BlacX HDD Docking Station ST...
    Only $34.99

    Sabrent High Resolution 1680x1050 TV Tuner Box with Picture i...
    Only $29.99

    Memorex 16X 4.7GB DVD-R Blank Media, 50-Pack Spindle, P/N: 32...
    Only $8.99

    TP-Link 54M Wireless Router TL-WR340G, IEEE 802.11g/b, w/ 4-P...
    Only $14.99

    Kinamax USB 2.0 Webcam Camera WCM-6LNV, 6-LED Infrared Night...
    Only $9.99

    *$15 Mail-In Rebate* Thermaltake Massive23 ST Notebook/Laptop...
    Only $29.99

    Black Shuttle Black XPC Barebone System SN78SH7, nVidia GeFor...
    Only $199.99

    Cooler Master Silent Pro M 850W ATX12V / EPS12V Computer Powe...
    Only $114.99

    Black Cooler Master Storm Scout ATX Mid Tower Computer Case S...
    Only $68.99

    Cooler Master V8 CPU Cooler RR-UV8-XBU1-GP, for Intel Core i7...
    Only $37.99

    Black Cooler Master Notepal X2 Notebook Cooler, Up to 17in No...
    Only $15.99

    Kingston HyperX 4GB(2x2GB) DDR3 Dual Channel Kit Memory KHX20...
    Only $94.99

    *$15 Mail-In Rebate* OCZ Technology 1GB DDR3 1066 (PC3-8500)...
    Only $14.99

    Pink MSI Wind U100-427US 10in WSVGA Netbook 9S7-N01153-427, I...
    Only $249.99

    Silver Blue MSI Wind U100-013US 10in WSVGA Netbook 9S7-N01158...
    Only $249.99

    Black Broadway Com Corp Sonic SECC Steel ATX Mid Tower Comput...
    Only $19.99

    PNY Optima 2GB DDR2 667 (PC2-5300) System Memory, 240-pin DIM...
    Only $33.99

    Holiday Combo Deal 2: ASUS P5G41-M-LE/CSM Motherboard with In...
    Only $99.99