You are currently viewing ECRC and LCRC in PCIe: Understanding the Differences

ECRC and LCRC in PCIe: Understanding the Differences

ECRC (End-to-End CRC) and LCRC (Link CRC) are commonly used terms in the context of PCIe. While they are sometimes mentioned together, surprisingly they are not same, it’s important to understand that they serve different purposes and should not be used interchangeably.

In this blog post, I’ll explain both ECRC and LCRC, their roles, and why they matter.

Let’s start with LCRC.
LCRC, or Link CRC, operates at the Data Link Layer. When a packet is received, the receiver recalculates the LCRC value and compares it to the value received with the packet. If the values match, it indicates the data was received correctly. If they don’t match, it means the data has been corrupted during transmission.

ECRC or the endpoint CRC is handled at the transaction layer, ECRC is generally optional. It is handled at the transaction layer.Both of them can be used to verify that the data is correct or not but there handling is different.

Below is one illustration to depict what is the logic used to check the data integrity, if at the starting when the packet start from source the CRC value is X say, once the packet reaches to destination the CRC value should still be X than only one can say the there is no corruption in the data packet which got trasnsferred from source to destination

So, what’s the difference?

It comes down to Link vs Port.
LCRC is used to detect data corruption across a PCIe link — that is, between two directly connected devices. In contrast, ECRC is used to verify data integrity from the source port all the way to the final destination port, spanning the entire communication path.

For example, in a system with PCIe switches, ECRC ensures that the Transaction Layer Packet (TLP) remains intact throughout the entire route. The source port appends the ECRC at the end of the TLP in the Transaction Layer, and the destination port verifies it by recalculating and comparing the value against the received packet.

This end-to-end integrity check is supported by a PCIe feature called Advanced Error Reporting (AER).

For example, consider water flowing from a dam. It originates from a single source and eventually reaches a common destination. However, along the way, it may travel through multiple separate pipes before merging at the bottom.

This setup can help us understand the difference between LCRC and ECRC. Think of the water as data. As it flows through individual pipes, LCRC ensures that the water exiting each pipe segment is intact—checking for any “leaks” or corruption that might have occurred during that portion of the journey.

On the other hand, ECRC, as the name suggests (End-to-End CRC), is concerned with the integrity of the water from the source all the way to the final destination. It checks that the entire stream, after traveling through all the different pipes and merging at the bottom, is still clean and uncontaminated—just as it was when it left the dam.

In terms of PCIE lets understand with the PCIE topology

In the below diagram if some device, if some device A at root complex wants to communicate to the device C at endpoint, than the packets have to be routed via the switch, than LCRC will be checked at the transport links while ECRC will be check at the endpoint where the device C lies