• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer

Microcontroller Tips

Microcontroller engineering resources, new microcontroller products and electronics engineering news

  • Products
    • 8-bit
    • 16-bit
    • 32-bit
    • 64-bit
  • Applications
    • 5G
    • Automotive
    • Connectivity
    • Consumer Electronics
    • EV Engineering
    • Industrial
    • IoT
    • Medical
    • Security
    • Telecommunications
    • Wearables
    • Wireless
  • Learn
    • eBooks / Tech Tips
    • EE Training Days
    • FAQs
    • Learning Center
    • Tech Toolboxes
    • Webinars/Digital Events
  • Resources
    • Design Guide Library
    • DesignFast
    • LEAP Awards
    • Podcasts
    • White Papers
  • Videos
    • EE Videos & Interviews
    • Teardown Videos
  • EE Forums
    • EDABoard.com
    • Electro-Tech-Online.com
  • Engineering Training Days
  • Advertise
  • Subscribe

How does the PCIe protocol stack work?

September 25, 2023 By Jeff Shepard Leave a Comment

The Peripheral Component Interconnect Express (PCIe) is a high-speed serial computer expansion bus standard. It’s the common motherboard interface in systems from personal computers to servers and storage devices and is used with graphics cards, sound cards, hard disk drive host adapters, SSDs, Wi-Fi, and Ethernet hardware connections. It uses a three-layer protocol stack to deliver high-speed and reliable data transfers.

This FAQ provides a high-level overview of the protocol’s components, their functions, and how they work in unison. The three layers as shown in Figure 1 are:

  1. The Transaction Layer (TL) connects the bus to the Application Layer and includes the Configuration Space, which manages communication, the RX and TX channels, the RX buffer, and flow-control credits. The transaction layer receives 32-bit words called double words (DWs) called transaction layer packets (TPLs) on the 32-bit interface from the device.
  2. The Data Link Layer (DLL) maintains data integrity and manages the transmission and reception of data-link layer packets (DLLPs). It generates cyclical redundancy code (CRC) values for transmissions and checks CRC during reception. It manages retry operations and initializes the flow control for DLLPs.
  3. The Physical Layer (PHY) controls the speed, lane widths, and lane numbering. It also performs clock recovery from the received data and uses CRC to help correct data errors.
PCle
Figure 1. Typical PCIe protocol stack. (Image: Intel)

Data structure and flow

The TL receives data from the application layer and the data builds up as it passes through the other layers in the stack (Figure 2). The transaction-layer packets (TPLs) received from the application layer include a header, data payload, and an optional end-to-end CRC (ECRC) that’s generated by the application logic. The DLL handles link management and adds a sequence number and a link CRC (LCRC). When the DL receives a packet, it sends an ACK (success) or NACK (failure) to the sender, which retransmits the data in the case of a NACK. The physical layer consists of two differential pairs and uses 8b/10b encoding that maps 8-bit words to 10-bit symbols to achieve DC balance. It also performs clock recovery and adds framing information.

PCle
Figure 2. Structure of PCIe packet information. (Image: Verien Design Group)

Flow control

PCIe uses a point-to-point credit policy to manage buffers. The DLL sends packets indicating the amount of receiver buffer space available in units called credits. The transmitter must ensure that the buffer space is not exceeded.

The TL prioritizes data transport by using virtual channels (VC) and traffic classes (TC). VCs are used for differential bandwidth allocation and have dedicated physical resources, including buffering, flow-control management, and so on. The packet header requires the TC, and it determines the relative priority of a given transaction. A PCIe system’s maximum data payload (MDP) is a system-wide user-defined parameter. Transmitters are not allowed to send packets that exceed the set MDP value.

PCIe transactions

Four types of transactions originate in the TL: memory, input/output (I/O), configuration, and message. Memory transactions are used for transferring data. I/O transactions provide backward compatibility with the PCI protocol, the predecessor to PCIe. The root complex uses configuration transactions to configure the system when it’s turned on.

Transactions are further classified as posted, non-posted, and completed:

  • Posted transactions don’t send a completed TLP sent to the requester. Messages and memory writes are examples of posted transactions.
  • Non-posted transactions are ones where the requester expects to receive a completion TLP from the device completing the request. Memory reads I/O reads and writes, and configuration reads and writes are examples of non-posted transactions.
  • A completed transaction is initiated by the destination when read data is available.

Summary

This FAQ has reviewed PCIe data structure and flow, flow control, and transaction types. The PCIe stack consists of the TL, DLL, and PHY layers. The DLL and PHY both use CRC for error correction.

References

Introduction to PCIe, Prodigy Technovations
PCI Express Protocol Stack, Intel
PCIe Primer, Verien Design Group

EEWorld Online related content

What is PCIe gen 6 and how do I test it? Part 1
What is PCIe gen 6 and how do I test it? Part 2

You may also like:


  • What’s a PCIe root complex?

  • How many PCIe card sizes exist today, and where are…

  • What embedded protocols can you use for optical connectivity?

  • How can you minimize BERs?

  • PCIe in the embedded world

Filed Under: FAQ, Featured, network hardware Tagged With: FAQ

Reader Interactions

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Primary Sidebar

Featured Contributions

Five challenges for developing next-generation ADAS and autonomous vehicles

Securing IoT devices against quantum computing risks

RISC-V implementation strategies for certification of safety-critical systems

What’s new with Matter: how Matter 1.4 is reshaping interoperability and energy management

Edge AI: Revolutionizing real-time data processing and automation

More Featured Contributions

EE TECH TOOLBOX

“ee
Tech Toolbox: Internet of Things
Explore practical strategies for minimizing attack surfaces, managing memory efficiently, and securing firmware. Download now to ensure your IoT implementations remain secure, efficient, and future-ready.

EE Learning Center

EE Learning Center

EE ENGINEERING TRAINING DAYS

engineering
“bills
“microcontroller
EXPAND YOUR KNOWLEDGE AND STAY CONNECTED
Get the latest info on technologies, tools and strategies for EE professionals.

RSS Current EDABoard.com discussions

  • Elektronik devre
  • Powering a USB hub: safely distributing current from a shared power supply
  • RF-DC rectifier impedance matching
  • How can I get the frequency please help!
  • 12VAC to 12VDC 5A on 250ft 12AWG

RSS Current Electro-Tech-Online.com Discussions

  • 100uF bypass Caps?
  • Fuel Auto Shutoff
  • Actin group needed for effective PCB software tutorials
  • how to work on pcbs that are thick
  • compatible eth ports for laptop

DesignFast

Design Fast Logo
Component Selection Made Simple.

Try it Today
design fast globle

Footer

Microcontroller Tips

EE World Online Network

  • 5G Technology World
  • EE World Online
  • Engineers Garage
  • Analog IC Tips
  • Battery Power Tips
  • Connector Tips
  • DesignFast
  • EDA Board Forums
  • Electro Tech Online Forums
  • EV Engineering
  • Power Electronic Tips
  • Sensor Tips
  • Test and Measurement Tips

Microcontroller Tips

  • Subscribe to our newsletter
  • Advertise with us
  • Contact us
  • About us

Copyright © 2025 · WTWH Media LLC and its licensors. All rights reserved.
The material on this site may not be reproduced, distributed, transmitted, cached or otherwise used, except with the prior written permission of WTWH Media.

Privacy Policy