PCIe · Module 2
Switch — Branching the Hierarchy
How PCIe expands one hierarchy path into several device paths without returning to a shared medium: the intermediate forwarding element, its upstream and downstream sides, and where traffic still converges.
Chapter 2.2 took the root of the hierarchy and Chapter 2.3 took the leaves. Between them sits a component this module has been assuming without examining:
How does PCIe expand one hierarchy path into several device paths, without returning to a shared medium?
The question has real force. A Link joins exactly two components — that is the property Module 1 spent seven chapters arguing for, and it is not negotiable. But a Root Port anchors one path, and a system needs to reach more devices than it has Root Ports. Something has to branch, and whatever does the branching must not quietly reintroduce the shared bus.
1. Upstream and Downstream
Two direction words are needed before anything else, and they are defined relative to the root rather than to any component's own geometry:
- Upstream — the direction toward the Root Complex.
- Downstream — the direction away from the Root Complex, toward the leaves.
Because a hierarchy has exactly one root, these are unambiguous everywhere in the structure. Any Link has an upstream end and a downstream end, and any component knows which of its connections faces which way.
For a Switch this produces its defining shape: one connection facing upstream, several facing downstream. The upstream connection carries everything to and from the rest of the hierarchy above it; each downstream connection leads toward one Endpoint, or toward another Switch that branches further.
That asymmetry is not incidental — it is what makes the structure a tree rather than an arbitrary graph, and it is why every device has exactly one path back toward the root.
2. Forwarding, Not Arbitrating
Here is the distinction that keeps the shared bus from sneaking back in.
An arbiter on a shared bus grants exclusive ownership of one medium to one device at a time. Everyone attaches to the same wires; the arbiter decides whose turn it is; the others wait. Sharing is inherent, and scheduling is the only lever.
A Switch does something structurally different. A transaction arrives on one Link. The Switch examines it enough to determine which of its connections that transaction should leave by, and forwards it onto that Link. Nothing was granted, nothing took a turn on a common medium, and the transaction moved from one dedicated connection to another.
The consequence follows directly: because the Switch's connections are separate Links, transfers involving different ones can be in progress at the same time. A transfer between the Switch and Endpoint 1 does not occupy the connection to Endpoint 2. On a shared bus that concurrency is impossible by construction; here it is the normal case.
How a Switch determines the appropriate outgoing Link — what information a transaction carries for that purpose and what rules govern the decision — is a substantial topic that later modules own. The architectural point here is only that a decision is made, per transaction, and that this is forwarding rather than arbitration.
3. What a Switch Does Not Do to Contention
This is the nuance worth being careful about, because the natural reading is too generous.
A Switch does not remove contention. It removes the specific kind of contention a shared medium imposes — the kind where every device competes with every other for exclusive use of common wires, regardless of whether their traffic has anything to do with each other. That is a real and large improvement.
What remains is contention where traffic genuinely converges, and a Switch has two such places:
The upstream Link. Everything below the Switch shares it. If all three Endpoints in Figure 1 are simultaneously moving data toward system memory, their traffic meets on that single upstream connection. This is Chapter 1.7's point made concrete: capacity below a Switch can exceed what the connection above it carries.
A downstream connection receiving from several sources. If traffic destined for one Endpoint arrives faster than that Endpoint's Link can carry it, it cannot all be forwarded at once.
The honest statement is therefore:
A Switch lets multiple Links operate independently. Contention can still occur when several inputs need the same output, or when traffic converges onto the upstream Link.
That is a much better position than a shared bus — contention is now confined to places you can identify on a diagram, rather than imposed on every device by the medium's existence. But "better" is not "absent," and a design that assumes otherwise will mispredict behaviour under load.
4. Depth and the Shape of the Tree
A Switch's downstream connections do not have to lead to Endpoints. One can lead to another Switch, which branches again.
That is how a hierarchy acquires depth. An Endpoint below two levels of switching is three Links from the Root Complex, and the architecture accommodates this without any component behaving differently — each Switch has the same job regardless of where it sits, because upstream and downstream are defined relative to the root rather than to local position.
Two consequences are worth noting now, though this chapter does not develop either:
- Every additional level adds a forwarding step to the path between an Endpoint and the root.
- Every level introduces another potential convergence point, since each Switch's upstream Link aggregates everything beneath it.
How systems actually get wired, how deep real fabrics go, and how to reason about complete paths across such a structure belong to later chapters — Chapter 2.7 takes the fabric-wide view, and Module 4 covers real topologies.
5. Distinguishing the Three Roles
Chapter 2.1 introduced a three-way classification — root, intermediate forwarding, termination. With all three components now defined, the distinctions can be made sharp.
Switch versus Root Complex. Both have several connections, which is where confusion begins. The difference is which domains they touch. A Switch's connections all face PCIe; it lives entirely inside the hierarchy, and its job is forwarding between its own Links. A Root Complex straddles the edge of the architecture, with Root Ports facing PCIe and its other side facing a processor and memory domain that is not PCIe at all. Remove a Switch and the devices below it become unreachable — but the hierarchy still has a root. Remove the Root Complex and there is no hierarchy for anything to attach to.
Switch versus Endpoint. An Endpoint terminates a path: traffic reaching it has arrived, and nothing lies beyond. A Switch is definitionally not terminal — its entire purpose is having somewhere else to send things. This is why an Endpoint never has to decide where a transaction goes next, while a Switch does so constantly.
The classification is worth carrying because it survives contact with unfamiliar systems. Given any component in a PCIe diagram, ask: does it bound the architecture (root), pass things along (intermediate), or consume them (termination)?
6. Common Misconceptions
7. Real Engineering Relevance
A Switch is where ingress and egress become distinct concerns, and that framing is useful well beyond PCIe.
For anyone designing or verifying a component in this position, the questions separate cleanly. On ingress: what arrived, on which connection, and where should it go? On egress: what needs to leave by this connection, and what happens when more wants to leave than it can carry at once? Those are different problems with different failure modes, and conflating them makes debugging much harder than it needs to be.
The practical diagnostic skill is localising a problem to the right level. When traffic through a switched hierarchy underperforms, the candidate explanations sit at different places:
- Link-local — something wrong with one specific connection, affecting only what traverses it.
- Convergence — the upstream Link is carrying more aggregate demand than it can serve, which looks like several devices simultaneously underperforming for no individual reason.
- Forwarding — transactions are not reaching the connection they should, which produces qualitatively different symptoms from mere slowness.
An engineer who holds Figure 1 in mind asks which of those three it is before investigating any of them. One who does not tends to investigate the device that complained loudest, which is frequently not where the problem lives.
This chapter deliberately makes no claims about how a Switch is built internally — buffering, scheduling, and the structures that implement forwarding are implementation matters, and inventing detail here would teach something not generally true.
8. Understanding Check
9. Summary
A Switch is the intermediate forwarding element of a PCIe hierarchy. It exists because Links join exactly two components, so something must branch if a system is to reach more devices than it has Root Ports — and whatever branches must not reintroduce a shared medium.
Its shape is one upstream connection and several downstream ones, with those directions defined relative to the root, which is what makes the structure a tree. It forwards rather than arbitrates: a transaction arriving on one Link is examined enough to determine which connection it should leave by, and sent onward. Because its connections are separate Links, transfers involving different ones proceed concurrently.
Contention is localized, not removed. It remains where traffic genuinely converges — most visibly on the upstream Link, which carries everything below the Switch. A Switch's downstream connection may lead to another Switch, giving the hierarchy depth, with each level adding a forwarding step and another convergence point.
Hold the model: a Switch forwards transactions between Links rather than granting ownership of one shared medium.
10. What Comes Next
Chapter 2.5 — Bridge takes a component that looks superficially similar and is architecturally quite different. A Switch forwards within one PCIe hierarchy, with PCIe on every connection. A Bridge crosses between PCIe and an interconnect that follows different rules — which is a different problem entirely, and the one that made the transition Module 1 described possible in practice.
After that, Chapter 2.6 examines how a hierarchy that can now branch and deepen gets organised and identified, and Chapters 2.7 through 2.9 take the fabric view, the Link in depth, and the full switched-architecture comparison.
Revisit Endpoint and Root Complex for the roles a Switch sits between, or PCIe Architecture Overview for the system map. Browse the full path on the PCIe tutorials index.