python / python/cpython

[socket] Support for Payload Protocol Identifier for SCTP sockets in standard socket library

未关闭
#99,286 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

stdlib topic-socket type-feature
主要语言
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.

image

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])

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 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

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。