A UEC packet over Ethernet looks superficially similar to a RoCEv2 packet from the outside. The outer headers are the same: Ethernet/IPv4/UDP. The destination UDP port for UEC is 4792 (distinct from RoCEv2's 4791). The key differences are in the transport header above UDP.
RoCEv2 uses the BTH (Base Transport Header): 12 bytes with opcode, partition key, destination QP number, and PSN (Packet Sequence Number). Above BTH, the payload type depends on the opcode (RDMA Write, RDMA Send, RDMA Read, etc.).
UEC replaces BTH with the UET header. The UET header is 20 bytes and contains:
UET header (20 bytes)
Version 4 bits UEC version (currently 1)
OpCode 8 bits Message type (Write, Send, Read, Ack, Nack, Fence...)
Flags 4 bits E=ECN-capable, C=CE-marked, S=Solicited, F=First, L=Last
DCID 24 bits Destination Context ID -- replaces QPN
SCID 24 bits Source Context ID -- replaces source QPN
Message ID 32 bits Per-source-context message sequence number
Packet Offset 32 bits Byte offset of this packet within the message
Payload Length 16 bits Data bytes in this packet
Acknowledgement 32 bits Cumulative ack + SACK bitmask field (in Ack/Nack packets)
The most important structural difference: instead of a Packet Sequence Number (PSN) that increments per packet, UEC uses a Message ID plus a Packet Offset within that message. This means the receiver can reconstruct message order even when packets arrive out of order across different paths -- it does not need to see packets in PSN order. The receiver buffers all packets for a given Message ID and presents the complete message to the application only when all offsets are accounted for.
The DCID/SCID pair replaces the QPN. Context IDs are still connection endpoints allocated at setup time, but the naming change reflects that a UEC context does not carry the same per-queue state requirements as an RDMA Queue Pair.
Message segmentation
A UEC message is segmented into packets by the sender. The maximum packet size is limited by the path MTU (typically 4096 or 8192 bytes for AI fabrics). The sender stamps each packet with the Message ID and the byte offset of the first byte in that packet within the message. The receiver buffers incoming packets indexed by offset and presents the reassembled message to the application when all gaps are filled.
For a 256 KB AllReduce gradient block at 4096-byte MTU, this produces 64 packets per message, all carrying the same Message ID. The sender can spray all 64 onto different physical paths simultaneously. Arrival order does not matter.