[socket] Support for Payload Protocol Identifier for SCTP sockets in standard socket library
還沒有人認領這個 Issue。
- 主要語言
- Python
- 星號
- 77.2k
- 分支
- 36k
- PR 合併指標
- PR 指標待擷取
描述
Feature or enhancement
Currently is there a way to specify the payload protocol identifier for an SCTP socket created using the socket library?
For example, the SCTP socket object created as sock_amf = socket.socket(socket.AF_INET, socket.SOCK_STREAM, socket.IPPROTO_SCTP) exposes sock_amf.send(bytes, flags) but has no way to mention the payload protocol identifier as mentioned in https://www.rfc-editor.org/rfc/rfc9260.html#section-3.3.1-3.20.1
Payload Protocol Identifier: 32 bits (unsigned integer)
This value represents an application (or upper layer) specified protocol identifier. This value is passed to SCTP by its upper layer and sent to its peer. This identifier is not used by SCTP but can be used by certain network entities, as well as by the peer application, to identify the type of information being carried in this DATA chunk. This field MUST be sent even in fragmented DATA chunks (to make sure it is available for agents in the middle of the network). Note that this field is not touched by an SCTP implementation; the upper layer is responsible for the host to network byte order conversion of this field.
The value 0 indicates that no application identifier is specified by the upper layer for this payload data.
At present the default value of 0 is being set when the data chunk is formed.
Sample packet capture for one such instance.

Pitch
If such an option was there, we could directly implement protocols that require specific ppid with the standard socket library (without having to depend on 3rd party bindings of SCTP C library).
Say for example the NGAP protocol used in 5G which uses
SCTP (IETF RFC 4960 [2]) shall be supported as the transport layer of NG-C signaling bearer. The Payload Protocol
Identifier (ppid) assigned by IANA to be used by SCTP for the application layer protocol NGAP is 60, and 66 for
DTLS over SCTP (IETF RFC 6083 [8])
貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
研究方向
從 issue 中描述的標準 socket.socket(..., IPPROTO_SCTP) 和 send(bytes, flags) 入口點開始,然後閱讀其中引用的 RFC 9260 PPID 要求。確定標準 socket API 如何接受 PPID,並驗證產生的 SCTP DATA chunk 攜帶該 PPID,包括提到的 NGAP 值。issue 中未確定任何原始檔或測試。
由索引模型根據 Issue 內容生成。
評估
- 技術堆疊
- python
- 領域
- networking
- Issue 類型
- 功能
- 難度
- 5/5
- 預估耗時
- 一週以上
- 活躍度
- 停滯
- 描述清晰度
- 需要釐清
- 新手友好度
- 35/100