AI Packet Trimming

Author: Princeton (Prince), Meta; Kesh, Meta Collection: 2025-OCP-Global-Summit-Networking

Summary

Packet trimming is a switch hardware feature designed to accelerate loss notification and recovery in AI fabric networks where every packet drop carries a significant cost. In existing deployments, when a lossy queue exceeds its threshold, the switch silently tail-drops packets, and recovery must wait for a timeout or NACK+Go-Back-N retransmission — slow mechanisms that stall collective communications. Packet trimming instead intercepts the dropped packet, truncates it to a small header-only size (e.g., 256 bytes from an original 4 KB packet), rewrites its DSCP value, and enqueues the trimmed packet to a high-priority queue (higher DWRR weight or strict priority) that traverses the same path to the destination. The destination NIC receives the trimmed packet, recognizes it by DSCP value, and immediately sends a Trim NACK back to the source in approximately 1 RTT, allowing the source to retransmit using a different SRv6 SID list that excludes the congested link.

Meta's backend AI cluster uses SRv6 for routing; packet trimming integrates tightly with this by embedding the original SID list ID in the trim NACK, so the source can identify which path caused congestion and choose an alternative. Asymmetric DSCP rewriting enables tier-specific identification: different DSCP values are applied at T0/T1 uplinks vs. downlinks based on QoS maps at each egress port, allowing the NIC to infer at which network tier the drop occurred. The SONiC implementation adds a new Switch Trimming object to Config DB, extends buffer profiles with a trim action attribute, and adds new SAI attributes for trim size, trim DSCP/TC, trim queue index, and per-flow trim disable via ACL. Trim counters are exposed per-port and per-queue via flex counters.

Sign in to read the full article.

Sign In