PCI Express is the main interconnect inside almost every computer: CPU to SSD, GPU, network card, accelerator and memory expander. It looks to software exactly like the old parallel PCI bus (the same configuration space, address windows and memory-mapped registers), but physically it is a tree of point-to-point serial links, each made of one or more lanes, carrying packets. This page explains why it was built that way, how a system is wired and discovered, how packets move, and how the generations from 2.5 GT/s to 128 GT/s fit together. The generation pages then follow one real system each, down to individual signals.
Before PCIe: PCI: how the parallel bus works. Deep dives: Gen 4 · NVMe SSD · Gen 5 · GPU x16 · Gen 6 · CXL memory, PAM4, FLITs. Specification: PCI Express Base Specification [1].
PCI (1992) was a shared, parallel, synchronous bus: 32 (or 64) address/data lines, a common clock, and control signals that every slot connects to. One device talks at a time after winning arbitration. It worked well at 33 MHz. Pushing it faster hit physical limits that no amount of protocol work could fix:
PCI-X (1998, 64-bit at 66–133 MHz) registered every input and output to the clock and accepted fewer slots per bus; PCI-X 2.0 (2003) added double- and quad-data-rate transfers (266 and 533 MT/s) with source-synchronous strobes and 1.5 V signaling. Both inherited the shared-bus limits. PCI Express (first specification 2002, 1.0a in 2003) kept the software model and replaced the physical layer: one dedicated link per device, differential pairs with embedded clocks so skew between lanes no longer matters, packets instead of bus cycles, and interrupts and errors carried as messages.
How the parallel bus actually ran a transfer, clock by clock: PCI primer →
Illustrative common-clock budget (not PCI specification values): period ≥ clock-to-out (≈ 2 ns) + settling per extra load (≈ 1.2 ns each) + skew + setup/hold (≈ 1.5 ns) + clock skew (≈ 0.5 ns). A serial lane carries its own clock in the data, so none of these terms depend on the other lanes.
| PCI | PCI-X | PCIe Gen 1 x1 | PCIe Gen 1 x16 | |
|---|---|---|---|---|
| Topology | Shared bus | Shared bus (at most 2 slots) | Point to point | Point to point |
| Signaling | 3.3/5 V single-ended, reflected wave | 3.3 V single-ended; PCI-X 2.0 DDR/QDR at 1.5 V with source-synchronous strobes | Differential, 2.5 GT/s, embedded clock | Same, 16 lanes |
| Peak bandwidth | 133 MB/s (32-bit/33) – 533 MB/s (64-bit/66), shared | 1.06 GB/s (133 MHz) – 4.27 GB/s (533 MT/s), shared | 250 MB/s each way, dedicated | 4 GB/s each way, dedicated |
| Signal pins (data path) | ≈ 50 (32-bit) / ≈ 90 (64-bit) | ≈ 90 | 4 | 64 |
| Interrupts | INTA#–INTD# wires | Wires, MSI optional | MSI / MSI-X messages (legacy INTx emulated as messages) | Same |
| Duplex | Half (one transfer at a time) | Half | Full | Full |
PCIe defines three layers: Transaction, Data Link and Physical. The device driver, the OS and the device's own command set (NVMe, a GPU's command rings, a NIC's descriptors) sit above them. The mapping to OSI is the usual approximation; PCIe was not designed against it. Click a layer; the sections below carry the same tags.
A PCIe system is a tree. The root complex in the CPU connects the processor and memory to one or more root ports. Each port drives one link. A link ends at either an endpoint (an SSD, GPU, NIC) or a switch, which has one upstream port and several downstream ports and forwards packets between them. A device can contain up to 8 functions (independent PCI devices sharing one link; up to 256 with ARI), and SR-IOV lets one physical function present many virtual ones.
Each function is identified by its Bus:Device.Function (BDF): 8-bit bus, 5-bit device, 3-bit function, for example 03:00.0. Every link is its own bus; inside a switch there is one more internal bus. Requests are routed by address (memory TLPs go to whoever owns that address range) or by ID (configuration requests and completions go to a BDF).
Every function has a configuration space: 256 bytes compatible with PCI, extended to 4 KB in PCIe. The first 64 bytes are a standard header: Vendor and Device ID, Class Code (what kind of device), Command and Status registers, and the Base Address Registers. After that come capability structures in linked lists: PCIe capability (link speed and width), MSI/MSI-X, power management, AER error reporting, and others in the extended space.
The CPU reaches config space through ECAM: a memory region where each function's 4 KB appears at an address computed from its BDF. A load from that address becomes a configuration-read TLP.
Address = base + bus·220 + device·215 + function·212 + register. 256 buses × 1 MB = 256 MB of address space for the whole tree.
| Term | Meaning |
|---|---|
| Lane | Two differential pairs, one per direction (dual simplex). The basic unit of width. |
| Link | The lanes between two ports: x1, x2, x4, x8 or x16. Bytes of a packet are dealt across them round-robin (byte 0 on lane 0, byte 1 on lane 1, …). |
| GT/s | Gigatransfers per second per lane: symbols on the wire, before encoding overhead. With NRZ (Gen 1–5) one transfer is one bit; with PAM4 (Gen 6–7) a symbol carries two bits and the rate is quoted in bits. |
| Embedded clock | The receiver's CDR (clock and data recovery) locks to the transitions in the data; encoding and scrambling guarantee there are enough of them. |
| Training | At power-up the LTSSM state machine in each port detects the partner, agrees on width and lane order, corrects polarity, brings the link up at 2.5 GT/s, then raises the rate and equalizes. Detail on the Gen 4 page → |
| Bifurcation | A x16 root port configured as 2 × x8 or 4 × x4 links, for example to drive several SSDs from one slot. |
Every PCIe port, in a CPU, SSD controller or GPU, splits into the same blocks. The controller is digital logic: the Transaction and Data Link layers and the logical part of the Physical layer. The PHY is the mixed-signal SerDes: the electrical part of the Physical layer. Between them sits a standard interface, PIPE (PHY Interface for PCI Express, an Intel specification also used for USB, SATA, DisplayPort and USB4), so a controller from one vendor can be paired with a PHY from another. The specification itself splits the Physical layer into a logical sub-block (state machines, framing, training sequences) and an electrical sub-block (analog transmit and receive).
Everything on a link is a packet. Transaction Layer Packets (TLPs) carry requests and data between endpoints of a transaction. Data Link Layer Packets (DLLPs) stay on one link: acknowledgements, flow-control credits and power management. TLPs fall into three classes, and the difference matters for performance and ordering.
| TLP | Class | Routed by | Used for |
|---|---|---|---|
| MWr | Posted: no reply | Address | Register writes, DMA writes into host memory, MSI/MSI-X interrupts |
| Msg, MsgD | Posted | Address, ID, or implicit | Legacy INTx emulation, error and power-management messages, vendor messages |
| MRd | Non-posted: needs a completion | Address | Register reads, DMA reads of host memory |
| CfgRd0/1, CfgWr0/1 | Non-posted | ID (BDF) | Configuration space access (Type 1 is forwarded by bridges, Type 0 is for the local bus) |
| IORd, IOWr | Non-posted | Address | Legacy I/O space; rarely used |
| FetchAdd, Swap, CAS | Non-posted | Address | Atomic operations on host or device memory |
| Cpl, CplD | Completion | ID + tag | Answers to non-posted requests, with or without data |
Each receiver advertises credits for its buffers, separately for headers and data of posted, non-posted and completion traffic (PH, PD, NPH, NPD, CplH, CplD). One header credit holds one TLP header; one data credit holds 16 bytes. A transmitter may send a TLP only if enough credits remain, and the receiver returns credits with UpdateFC DLLPs as it frees buffer space. No packet is ever dropped for lack of room. Try it:
Every PCIe device driver uses the same four mechanisms. This walkthrough shows each once, for a generic device whose registers sit behind BAR0.
PCIe saves power at two levels. Device states (D0 to D3) are set by software and describe the whole function. Link states (L0 to L3) describe the link; the Data Link layer negotiates entry with power-management DLLPs and tells the Physical layer when to idle its transmitters. With ASPM (Active State Power Management) the hardware enters L0s or L1 on its own when the link is idle, without software involvement.
| Link state | What is off | Exit | Entered by |
|---|---|---|---|
| L0 | Nothing: normal operation | — | — |
| L0p (Gen 6+) | Some lanes, while the rest keep carrying traffic | Lanes return without retraining or stopping traffic | Hardware, by bandwidth demand |
| L0s | One direction's transmitter (electrical idle) | Sub-microsecond to a few µs | ASPM; not used in FLIT mode |
| L1 | Both directions idle; PLLs may stay on | Microseconds, through Recovery | ASPM, or software when a device goes to D3 |
| L1.1 / L1.2 | REFCLK can stop (CLKREQ# released); L1.2 also turns off common-mode keepers | Tens of µs | ASPM with L1 substates; key for laptops and phones |
| L2 / L3 | Main power off; L2 keeps auxiliary power for wake | Full reset and retraining | System sleep or power-off |
Device states: D0 (on), D1 and D2 (optional, lighter sleep), D3hot (off but still powered and configurable), D3cold (power removed; wake by WAKE# or an in-band beacon). Exit latencies above are typical; each device advertises its own in its capability registers.
| Gen | Spec year | Rate per lane | Signaling | Encoding | Per lane, each way | x16, each way | Main change | Primer |
|---|---|---|---|---|---|---|---|---|
| 1 | 2002 (1.0a 2003) | 2.5 GT/s | NRZ | 8b/10b | 250 MB/s | 4 GB/s | Serial, point to point | |
| 2 | 2007 | 5 GT/s | NRZ | 8b/10b | 500 MB/s | 8 GB/s | Double rate; −6 dB de-emphasis option | |
| 3 | 2010 | 8 GT/s | NRZ | 128b/130b | 985 MB/s | 15.8 GB/s | New encoding instead of 10 GT/s; TX equalization negotiation | |
| 4 | 2017 | 16 GT/s | NRZ | 128b/130b | 1.97 GB/s | 31.5 GB/s | Lane margining, expanded (10-bit) tags and scaled credits, retimer support | Gen 4 → |
| 5 | 2019 | 32 GT/s | NRZ | 128b/130b | 3.94 GB/s | 63 GB/s | Precoding, alternate protocols (CXL) | Gen 5 → |
| 6 | 2022 | 64 GT/s | PAM4 | FLIT + FEC | ≈ 7.4–7.6 GB/s | ≈ 118–121 GB/s | PAM4, 256 B FLITs, FEC, L0p | Gen 6 → |
| 7 | 2025 | 128 GT/s | PAM4 | FLIT + FEC | ≈ 14.8–15.1 GB/s | ≈ 236–242 GB/s | Double symbol rate (64 GBd); optical links via the Optical Aware Retimer ECN |
Bandwidths are after line encoding, before TLP header overhead. For Gen 6–7 the range depends on what counts as payload in a 256-byte FLIT: 236 bytes of TLPs (lower figure) or 242 bytes including the data-link bytes (upper figure, the one most references quote). Marketing figures often add both directions together, for example "256 GB/s" for Gen 6 x16 and "512 GB/s" for Gen 7 x16.
Why Gen 6 switched to PAM4. NRZ beyond 32 GT/s would push the Nyquist frequency to 32 GHz, where board and connector loss is prohibitive. PAM4 keeps 16 GHz by sending two bits per symbol on four levels, but each of its three eyes is a third the height of an NRZ eye, an SNR penalty of about 9.5 dB that makes crosstalk and reflections matter more and raises the raw error rate; hence FEC. Gen 7 keeps PAM4 and doubles the symbol rate to 64 GBd. PCI-SIG announced it in 2022 and released it in 2025, targeting the same reach as Gen 6: about 4–14 inches of system board plus 2–4 inches of add-in card through one connector.
Why the encodings changed: 8b/10b (Gen 1–2) guarantees transitions and DC balance but costs 20 %. Gen 3 chose 128b/130b with scrambling (1.5 % overhead) at 8 GT/s rather than going to 10 GT/s with 8b/10b, which delivered the doubling without the harder channel. Gen 6 doubled again without raising the symbol rate by moving to PAM4, and switched to fixed-size FLITs with forward error correction because PAM4's raw error rate is far higher. Each page linked in the table shows one of these steps in detail.
| Form factor | Lanes | Typical devices | Notes |
|---|---|---|---|
| CEM add-in card (slot) | x1, x4, x8, x16 | GPUs, NICs, HBAs, accelerators | 75 W from the slot (12 V + 3.3 V), more via auxiliary connectors (12V-2x6 up to 600 W). A smaller card fits a larger slot. |
| M.2 (M key / B key) | x2, x4 | NVMe SSDs, Wi-Fi (E key, x1) | 3.3 V only; 2230 to 22110 lengths. B key can also carry SATA or USB. |
| U.2 / U.3 (SFF-8639) | x4 (or 2 × x2) | 2.5-inch enterprise SSDs | Hot-pluggable; U.3 (SFF-TA-1001) lets one backplane connector serve SAS, SATA and NVMe drives. |
| EDSFF: E1.S, E1.L, E3.S, E3.L | x4, x8, x16 | Data-center SSDs, CXL memory modules, accelerators | Designed for airflow and density; E3 also carries CXL devices. |
| OCuLink (SFF-8611) | x4, x8 | External GPU docks, storage cabling | Compact cabled PCIe connector. |
| MCIO (SFF-TA-1016), CopprLink | x4 to x16 | Server internal and rack cables | CopprLink (PCI-SIG, 2024) at 32 and 64 GT/s: internal cables on SFF-TA-1016 up to 1 m, external on SFF-TA-1032 up to 2 m. |
| Chip-down | any | Switches, retimers, SSD controllers, Ethernet PHYs on the same board | No connector: the shortest, cleanest channel. |
| Tunnelled: Thunderbolt / USB4 | virtual | External enclosures, docks | PCIe packets carried inside the USB4 transport; the OS sees a normal PCIe hierarchy with hot-plug. |
| PCIe | USB 3.x / USB4 | Ethernet | CXL | NVLink | |
|---|---|---|---|---|---|
| Purpose | CPU ↔ devices inside a system | Hot-plug peripherals over cables | Networks between systems | Coherent memory and accelerators | GPU ↔ GPU (and CPU) bandwidth |
| Who moves data | Devices master DMA into memory | Host schedules every transfer | Either end; packets may be dropped | Loads and stores via the CPU's coherent fabric | GPU memory accesses |
| Addressing | Memory addresses and BDF | Device address + endpoint | MAC / IP addresses | Host physical addresses | GPU memory addresses |
| Reach | Board, slot, short cable | Up to a few metres | Metres to kilometres | Board, slot (and switch) | Board, rack (switch) |
| Physical layer | Its own | Its own (USB4 tunnels PCIe) | Its own (many PHYs) | PCIe's (Gen 5/6 PHY) | Proprietary SerDes |
| Primer | this page | USB 3.1 → | Automotive Ethernet → | Gen 6 + CXL → |
It is point to point and terminated (no stubs from other slots), differential (common-mode noise rejected), and carries its own clock (no common-clock or bit-to-bit skew budget). The only timing that matters is within one pair.
Bus 3, device 0, function 0. Software enumerates depth first from bus 0, assigning bus numbers to each bridge's secondary side; the device sits on the bus behind the bridge (root port or switch port) that was given bus 3. Its config space is at ECAM base + 3·220.
Mask the low 4 type bits: FFFF_C000h. Invert and add one: 0000_4000h = 16 KB. Bit 0 = 0 means memory space, bits 2:1 = 00 means 32-bit, bit 3 = 0 means non-prefetchable.
A read is non-posted: the CPU waits for a completion that takes a full round trip (often a microsecond or more through switches), while a write is posted and costs almost nothing. Fast designs have the device write status into host memory, where the CPU can read it from cache.
Each lane recovers its own clock, and the receiver realigns the lanes using known boundaries in the training sequences and data blocks, absorbing several nanoseconds of skew. Only the two wires of each pair must match.