
RoCEv2 congestion management depends on timely feedback between Ethernet switches and network adapters. In a high-throughput fabric, multiple senders may transmit RDMA traffic toward the same receiver or switch egress port, causing queue occupancy to rise faster than available bandwidth can drain it. Explicit Congestion Notification (ECN) allows switches to signal this condition by marking packets instead of relying exclusively on packet drops. The receiving network adapter then generates a Congestion Notification Packet (CNP), allowing the original sender to adjust its transmission rate.
In a typical RoCEv2 deployment using Data Center Quantized Congestion Notification (DCQCN), ECN marking is the network-side detection mechanism, CNP is the feedback message, and the sender's congestion-control algorithm determines the rate response. These functions must work together across the switch fabric and endpoint NICs.
1. The Role of ECN in RoCEv2 Congestion Management
RoCEv2 carries RDMA traffic over UDP/IP, allowing RDMA communication to operate across routed Ethernet networks. Unlike conventional loss-based congestion control, RoCEv2 deployments commonly use explicit network feedback to help endpoints react before congestion causes extensive packet loss or excessive queueing delay.
ECN provides the initial congestion signal. A switch monitors traffic queues and, when configured congestion conditions are reached, changes the ECN field of eligible packets to indicate Congestion Experienced (CE). The packet continues toward its destination with the congestion information preserved.
The destination NIC interprets the CE marking and can generate a CNP addressed to the original sender. The sender then adjusts the transmission rate associated with the affected Queue Pair (QP), reducing the traffic load contributing to congestion.
2. ECN Field and Its Four Codepoints
The ECN field occupies two bits in the IPv4 or IPv6 header. These bits identify whether a packet is ECN-capable and whether congestion has been experienced along its path.
| ECN Bits | Codepoint | Meaning | Typical Interpretation |
|---|---|---|---|
| 00 | Not-ECT | Not ECN-Capable Transport | The packet is not marked as ECN-capable. |
| 01 | ECT(1) | ECN-Capable Transport | The packet can receive an ECN congestion indication. |
| 10 | ECT(0) | ECN-Capable Transport | The packet can receive an ECN congestion indication. |
| 11 | CE | Congestion Experienced | A network device has marked the packet to report congestion. |
ECT(0) and ECT(1) both indicate ECN capability under the general IP ECN framework. The CE codepoint indicates that congestion has been experienced. The exact ECN codepoint selected by an RDMA implementation should be verified against its RoCEv2 specification, NIC firmware and switch configuration.
A switch should only apply CE marking to eligible ECN-capable packets. If a packet is Not-ECT, ordinary ECN marking cannot provide the intended congestion notification. The treatment of such traffic depends on the switch's queue and drop policy.
3. How Switches Perform ECN Marking
The switch acts as the Congestion Point (CP) in the DCQCN feedback loop. It monitors queue occupancy, particularly the egress queue associated with a congested output port. When the queue reaches configured thresholds, the switch begins marking eligible packets.
Many implementations use an Active Queue Management (AQM) mechanism such as Weighted Random Early Detection (WRED). Rather than waiting until a queue is completely full, the switch can increase the probability of ECN marking as queue occupancy rises.
Typical ECN threshold behavior
Below the minimum threshold: Packets are forwarded without congestion marking.
Between the minimum and maximum thresholds: The probability of CE marking increases as queue occupancy grows.
At or above the maximum threshold: Marking probability may reach its configured maximum. Depending on the platform and queue state, packets may still be dropped if the queue cannot accept additional traffic.
In a common DCQCN model, the minimum threshold is represented by Kmin, the maximum threshold by Kmax, and the maximum marking probability by Pmax. The precise marking curve, averaging method and supported threshold units depend on the switch ASIC and operating system.
4. The RoCEv2 ECN-to-CNP Feedback Process
ECN marking becomes useful to RoCEv2 only when the receiving endpoint can identify the congestion indication and return feedback to the transmitting endpoint. The process typically follows these stages:
ECN-capable packet transmission: The source NIC sends RoCEv2 packets with an ECN-capable codepoint in the IP header.
Queue congestion detection: A switch monitors its egress queue and identifies increasing congestion.
CE marking: The switch marks eligible packets with the CE codepoint and forwards them toward the destination.
Destination notification: The receiving NIC detects the CE-marked RoCEv2 packet and generates a CNP according to its congestion-control implementation.
CNP return: The CNP travels from the destination side toward the original sender.
Sender rate adjustment: The source NIC processes the CNP and reduces the transmission rate associated with the affected QP.
Rate recovery: When congestion feedback subsides, the sender gradually increases its rate according to the configured congestion-control algorithm.
This is a closed-loop process. The switch identifies congestion, the receiver communicates the event, and the sender changes its traffic injection rate. The loop continues as network conditions change.
5. Congestion Notification Packet (CNP)
A CNP is a RoCEv2 control packet used to communicate congestion information from the receiving side to the original sender. It is distinct from the CE-marked data packet: the CE-marked packet carries the congestion indication toward the destination, while the CNP carries feedback back toward the source.
The receiving NIC typically generates the CNP in hardware. This allows congestion feedback to be processed without requiring the host application to inspect every incoming packet. The notification identifies the relevant QP so that the sender can apply rate control to the affected traffic.
CNP delivery is an important part of the feedback loop. If CNP packets are delayed, dropped or assigned an unsuitable traffic class, the sender may react later than intended. This can allow queue occupancy to remain elevated for longer.
| Packet Type | Direction | Function | Processing Location |
|---|---|---|---|
| RoCEv2 data packet | Source to destination | Carries RDMA payload and ECN capability information. | Switches and destination NIC |
| CE-marked data packet | Source to destination | Reports that congestion was encountered along the forwarding path. | Destination NIC |
| CNP | Destination to source | Notifies the sender of congestion associated with a QP. | Source NIC |
6. DCQCN and Sender Rate Adjustment
Data Center Quantized Congestion Notification (DCQCN) is a congestion-control algorithm commonly associated with RoCEv2 deployments. It coordinates switch-side ECN marking with endpoint-generated CNP feedback and sender-side rate adaptation.
DCQCN describes three functional roles:
Congestion Point (CP): Usually a switch that monitors egress queues and marks eligible packets when congestion conditions are met.
Notification Point (NP): The receiving NIC that detects congestion-marked packets and generates CNP feedback.
Reaction Point (RP): The sending NIC that processes CNP messages and adjusts its transmission rate.
The sender's rate-control logic generally includes three related operations:
Alpha update
The sender maintains an alpha value that reflects congestion feedback over time. CNP reception influences this value, allowing the algorithm to adjust its response according to recent congestion conditions.
Rate decrease
When congestion notifications are received, the sender reduces the transmission rate for the affected QP. The reduction is controlled by algorithm parameters and implementation-specific logic.
Rate increase
When congestion notifications stop arriving, the sender can gradually recover its transmission rate. DCQCN implementations may use staged recovery, including fast recovery and additive or more aggressive increase phases.
The objective is to reduce congestion without permanently restricting link utilization. The sender should respond to congestion while recovering capacity when the network can support a higher sending rate.
7. ECN Marking Thresholds and Queue Management
ECN threshold selection has a direct influence on when congestion feedback begins. If marking starts too late, queues may grow substantially before the sender receives useful feedback. If marking starts too early, the fabric may generate excessive congestion notifications and unnecessarily reduce transmission rates.
Several factors should be considered when selecting ECN thresholds:
Port bandwidth: Higher-speed links can accumulate significant data during short congestion intervals.
Queue depth: Available buffer capacity determines how much traffic can be absorbed during bursts.
Traffic burst duration: Synchronized RDMA traffic can create short but intense queue spikes.
Round-trip feedback delay: Switch marking, packet forwarding, CNP generation and sender reaction all take time.
Traffic distribution: Many-to-one traffic patterns can create congestion even when overall fabric utilization appears moderate.
ASIC implementation: Queue measurement, threshold granularity, marking probability and buffer accounting differ across platforms.
Thresholds should be evaluated using actual queue telemetry and workload testing. A configuration that performs well under steady traffic may behave differently during synchronized collective communication or large-scale storage transfers.
8. ECN Marking and Priority Flow Control
ECN and Priority Flow Control (PFC) address congestion from different angles. ECN provides explicit congestion feedback to the endpoints, while PFC can pause traffic belonging to a specific priority on an individual Ethernet link.
| Characteristic | ECN | PFC |
|---|---|---|
| Primary function | Signals congestion through packet marking. | Temporarily pauses transmission for a selected priority. |
| Feedback mechanism | CE marking followed by endpoint congestion notification. | Link-level pause frames. |
| Rate adjustment | Sender congestion-control logic adjusts the sending rate. | Traffic resumes when the pause condition clears. |
| Scope | Congestion indication can influence end-to-end sender behavior. | Applies to a priority on a directly connected link. |
| Potential risk | Incorrect thresholds can cause delayed or excessive rate reduction. | Pause propagation, head-of-line blocking and congestion spreading. |
In many lossless RoCEv2 designs, ECN and PFC are configured as complementary mechanisms. ECN and DCQCN provide proactive congestion management, while PFC may protect selected traffic classes against packet loss during transient congestion.
However, PFC is not a universal requirement for every RoCEv2 implementation. Network design depends on NIC capabilities, switch support, workload behavior and the selected congestion-control architecture. Enabling PFC without appropriate buffer and priority planning can introduce additional operational risks.
9. QoS and Traffic Classification for ECN
ECN marking is only effective when RoCEv2 traffic is classified into the intended switch queues and receives the correct congestion-management policy. Incorrect classification can cause RDMA packets to bypass the configured ECN policy or enter a queue with unsuitable thresholds.
A consistent QoS design should address the following elements:
Traffic identification: Identify RoCEv2 traffic using the intended classification criteria, such as UDP destination port and configured DSCP or other policy attributes.
Priority mapping: Maintain consistent mappings between NIC traffic classes, DSCP, VLAN PCP and switch hardware queues.
Queue assignment: Place RDMA traffic in the queue configured for the intended congestion-management behavior.
ECN policy: Enable marking on the correct queue and verify that the marking thresholds are active.
Return-path treatment: Ensure CNP packets can reach the source NIC without being unintentionally delayed by unsuitable QoS policies.
DSCP and VLAN PCP are classification and priority fields, not substitutes for the two-bit IP ECN field. A packet can carry both QoS classification information and ECN congestion information, and both must be handled correctly throughout the network.
10. ECN Marking Across a Multi-Hop Fabric
RoCEv2 traffic commonly crosses multiple leaf and spine switches. Each relevant switch may encounter congestion on its own egress queues. Consequently, a packet can experience congestion at different points along its path.
Network devices must preserve the ECN congestion indication as packets move through the fabric. Once a packet has been marked CE, downstream forwarding should not erase that indication. Otherwise, the receiving NIC may fail to generate the expected congestion feedback.
For VXLAN or other encapsulated forwarding environments, the treatment of ECN in outer and inner IP headers also matters. Tunnel encapsulation and decapsulation behavior must preserve or propagate congestion information according to the applicable ECN tunneling rules and platform implementation.
Multi-hop verification should therefore include both the original RoCEv2 traffic and any encapsulation headers used by the fabric. A correct marking policy on one leaf switch does not prove that congestion feedback will survive the complete forwarding path.
11. Common ECN Configuration Problems
ECN-related problems can originate in the switch, the endpoint NIC or the QoS configuration connecting them. The following issues are particularly important in RoCEv2 deployments.
| Problem | Possible Cause | Potential Effect |
|---|---|---|
| CE markings are not observed | ECN disabled, incorrect queue mapping or thresholds not reached. | Congestion may not trigger the expected endpoint feedback. |
| Excessive CE marking | Thresholds too low or marking probability too aggressive. | Frequent CNP generation and unnecessary rate reduction. |
| CNP packets are missing | Receiver NIC behavior, firmware configuration or CNP delivery problems. | The sender may not receive timely congestion information. |
| Sender rate does not decrease | Congestion-control mode not active or CNP not associated with the expected QP. | Traffic injection may remain high despite congestion. |
| Uneven throughput across QPs | Different congestion conditions, flow distribution or endpoint rate-control behavior. | Uneven link utilization and inconsistent application performance. |
| Congestion persists after rate reduction | Multiple senders, insufficient capacity or delayed feedback. | Queue occupancy may remain elevated. |
| ECN behavior changes across hops | Header rewriting, tunnel handling or inconsistent QoS policies. | Congestion indications may not reach the destination correctly. |
12. Monitoring ECN and CNP Behavior
Monitoring should cover the complete congestion feedback loop rather than relying on a single switch counter. A useful diagnostic process correlates queue occupancy, ECN marking, CNP activity and sender rate changes over the same time interval.
Switch-side monitoring
Monitor egress queue occupancy and queue-depth trends.
Inspect ECN marking counters for the relevant traffic class.
Check WRED or AQM threshold configuration and marking statistics.
Review packet-drop counters to determine whether congestion has progressed beyond marking.
Verify that RoCEv2 packets enter the intended queue on every relevant switch.
NIC-side monitoring
Check received CE-marked packet counters where supported.
Inspect generated and received CNP statistics.
Monitor QP-level congestion-control counters and rate changes.
Review NIC firmware, driver and congestion-control configuration.
Correlate rate adjustments with application throughput and latency.
Counter names and availability vary by switch vendor, NIC family, firmware and operating system. Monitoring tools should be interpreted according to the documentation for the actual hardware and software versions in use.
13. A Practical ECN Validation Workflow
ECN configuration should be validated under controlled traffic conditions before the fabric is used for production RDMA workloads. A staged validation process makes it easier to identify whether a problem originates in packet marking, notification delivery or sender response.
Confirm endpoint capability: Verify that both source and destination NICs support the intended RoCEv2 congestion-control mechanism and compatible firmware.
Verify traffic classification: Confirm that RoCEv2 data packets enter the intended QoS queue throughout the fabric.
Inspect ECN configuration: Check the queue's ECN enablement, threshold values and marking behavior.
Observe congestion marking: Use switch counters and packet analysis to verify that eligible packets receive CE markings when congestion conditions are present.
Verify CNP generation: Confirm that the destination NIC detects the CE indication and generates the corresponding CNP.
Check CNP delivery: Verify that feedback reaches the source NIC through the expected return path.
Observe sender response: Confirm that the affected QP changes its transmission rate in response to congestion feedback.
Test recovery: Reduce the offered load and observe whether the sender gradually increases its rate as congestion subsides.
Repeat with representative workloads: Validate behavior under different traffic patterns, including many-to-one transfers and bursty RDMA workloads.
Testing should also include sustained traffic and short-duration bursts. A fabric that performs well during a simple bandwidth test may still experience queue buildup under synchronized distributed-computing workloads.
14. ECN in 400G and 800G AI Data Center Fabrics
High-speed AI data center networks place additional demands on congestion management. Distributed training workloads generate substantial east-west traffic as GPUs exchange data through collective communication operations such as AllReduce, AllGather and ReduceScatter.
When many endpoints transmit toward a shared destination or uplink, short periods of traffic synchronization can create queue buildup even when average network utilization is below the nominal link capacity. At 400G and 800G, the volume of data arriving during a short feedback interval can be significant.
ECN marking and DCQCN help the fabric communicate congestion to individual senders, allowing their NICs to adjust transmission rates. Their effectiveness depends on accurate queue measurement, suitable marking thresholds, timely CNP delivery and consistent endpoint behavior.
As networks evolve toward higher port speeds and larger GPU clusters, operators should validate congestion-control behavior using realistic traffic patterns rather than relying solely on nominal bandwidth specifications. Switch buffer architecture, NIC processing capabilities, queue mapping and congestion-control parameter compatibility all influence the result.
15. ECN Marking and Congestion Notification Design Checklist
A reliable RoCEv2 congestion-management design should verify the following areas before deployment:
ECN capability is supported and enabled on the intended RoCEv2 traffic.
Switches identify the correct egress queues as congestion points.
ECN thresholds and marking probabilities match the switch platform and expected workload.
CE markings are preserved across all forwarding hops and applicable tunnels.
Destination NICs correctly detect congestion indications and generate CNP packets.
CNP traffic receives appropriate classification and forwarding treatment.
Source NICs apply congestion feedback to the correct QPs.
DCQCN parameters are compatible with NIC firmware and driver capabilities.
ECN and PFC policies are coordinated where both mechanisms are deployed.
Switch and NIC telemetry provide sufficient visibility into queue occupancy, marking, notification and rate adjustment.
Validation includes bursty traffic, many-to-one patterns and representative AI or storage workloads.
16. Conclusion
ECN marking and congestion notification form an essential part of many RoCEv2 congestion-control designs. Switches identify queue congestion and mark eligible packets with the CE codepoint. Destination NICs detect those markings and generate CNP feedback, while source NICs use the notifications to adjust QP transmission rates through mechanisms such as DCQCN.
Reliable operation requires more than enabling ECN on a switch. Queue thresholds, QoS classification, ECN preservation, CNP delivery, NIC capabilities and endpoint rate-control behavior must be coordinated across the complete fabric. These considerations become increasingly important in 400G and 800G networks, where bursty traffic and synchronized AI workloads can place substantial pressure on shared network resources.
Reliable RoCEv2 performance depends on coordinated network design, switch configuration and compatible optical connectivity. For optical transceiver and connectivity requirements for 400G and 800G data center deployments, view optical transceiver solutions or Contact C-LIGHT.
TEL:+86 132 6656 7067




















































>
>
>
>
>
>
>
>