RoCEv2 CNP Packet Format Example
https://community.mellanox.com/s/article/rocev2-cnp-packet-format-example
2018-12-5•Knowledge Article
This post describes the RoCE CNP packet fields, with examples.
References
- Understanding RoCEv2 Congestion Management
- HowTo Configure RoCE Congestion Control for Windows 2012
- Annex 17 RoCEv2
- Download Wireshark with RoCEv2 Support
RoCEv2 CNP Headers
Here is the RoCEv2 CNP Packet format as described in the standard Annex 17.9.3 RoCEv2
Here is a wireshark example of this packet:
Note: there is an option to Download Wireshark with RoCEv2 Support, in this case the parsing will be easier.
The CNP data starts in the UDP payload which is the BTH InfiniBand header.
Here are the fields of the BTH header aligned with the example above in hexa 0x81 00 ff ff 40 00 00 d2 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 e4 2d ad 81:
Field | Size (in bits) | Description | Example (as above) |
---|---|---|---|
OpCode | 8 |
Indicates the IBA packet type. The OpCode also specifies which extension headers follow the Base Transport Header |
0x81 = 10000001b
As described above, the CNP packet will have this OpCode. |
Solicited Event (SE) | 1 |
Indicates that an event should be generated by the responder |
0 |
MigReq (M) | 1 | Used to communicate migration state | 0 |
Pad Count (PadCnt) | 2 |
Indicates how many extra bytes are added to the payload to align to a 4 byte boundary |
0 |
Transport Header Version (TVer) |
4 | Indicates the version of the IBA Transport Headers. | 0 |
Partition Key (P_KEY) | 16 |
Indicates which logical Partition is associated with this packet |
0xffff |
F/Res1* (F/R) | 1 |
F (FECN):
Res1*: Transmitted as 0, ignored on receive. This field is not included in the invariant CRC. |
0 |
B/Res1* (B/R) | 1 |
B (BECN):
Res1*: Transmitted as 0, ignored on receive. This field is not included in the invariant CRC. see 7.8 CRCs on page 207 for details. |
1
Note: this is part of the 0x40 octet (01000000b). |
Reserved (variant) | 6 |
Transmitted as 0, ignored on receive. This field is not included in the invariant CRC. |
0 |
Destination QP (DestQP) | 24 |
Indicates the Work Queue Pair (QP) Number at the destination. |
0x0000d2 = 210 |
Acknowledge Request (A) |
1 |
Used to indicate that an acknowledge (for this packet) should be scheduled by the responder. |
0 |
Reserved | 7 |
Transmitted as 0, ignored on receive. This field is included in the invariant CRC. |
0 |
Packet Sequence Number (PSN) |
24 |
Used to detect a missing or duplicate Packet. |
0 |
Padding | 16 | All zeros | 0 |
iCRC | 4 | iCRC checksum | 0xe42dad81 |
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 基于Microsoft.Extensions.AI核心库实现RAG应用
· Linux系列:如何用heaptrack跟踪.NET程序的非托管内存泄露
· 开发者必知的日志记录最佳实践
· SQL Server 2025 AI相关能力初探
· Linux系列:如何用 C#调用 C方法造成内存泄露
· 无需6万激活码!GitHub神秘组织3小时极速复刻Manus,手把手教你使用OpenManus搭建本
· Manus爆火,是硬核还是营销?
· 终于写完轮子一部分:tcp代理 了,记录一下
· 别再用vector<bool>了!Google高级工程师:这可能是STL最大的设计失误
· 单元测试从入门到精通