跳到主要内容

7. 消息编号 (Message Numbers)

  1. 消息编号 (Message Numbers)

SSH packets 的 message numbers 范围为 1 到 255. 这些 编号已按如下方式分配:

Transport layer protocol:

  1 to 19    Transport layer generic, 例如 disconnect, ignore,
debug 等
20 to 29 Algorithm negotiation
30 to 49 Key exchange method specific, 编号可为不同认证方法复用

User authentication protocol:

  50 to 59   User authentication generic
60 to 79 User authentication method specific, 编号可为不同认证方法复用

RFC 4251 SSH Protocol Architecture January 2006

Connection protocol:

  80 to 89   Connection protocol generic
90 to 127 Channel related messages

Reserved for client protocols:

  128 to 191 Reserved

Local extensions:

  192 to 255 Local extensions

这些编号范围把 SSH Transport Layer Protocol、User Authentication Protocol 和 Connection Protocol 的消息空间分开, 同时为方法特定消息和本地扩展保留空间. 实现者在分配或解析消息号时, 应结合具体子协议状态机判断消息含义, 不应仅凭数字范围接受任意消息.

其中 1 到 49 主要服务于传输层和密钥交换, 50 到 79 服务于用户认证, 80 到 127 服务于连接和通道管理, 128 到 255 则保留给客户端协议和本地扩展. 这些数字属于协议常量, 必须保持原样.