跳到主要内容

认证

4.2. 认证​

描述

Authenticate 分组用于启动密码认证协议. 随 Authentication-Type 配置选项进一步指定密码认证协议发送了 LCP Configure-Ack 分组的实现, 必须在认证阶段发送一个 Authenticate 分组. 接收到随上述配置选项的 Configure-Ack 的实现, 应当预期远端在这一阶段发送 Authenticate 分组. 发送 Authenticate 分组时, Code 字段置为 1 (Authenticate), Peer-ID 和 Password 字段按需要填写. 接收到 Authenticate 后, MUST 发送某种类型的 Authenticate 应答.

Authenticate 分组格式的摘要如下所示. 各字段从左到右传输.

 0                   1                   2                   3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Code | Identifier | Length |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Peer-ID Length| Peer-Id ...
+-+-+-+-+-+-+-+-+-+-+-+-+
| Passwd-Length | Password ...
+-+-+-+-+-+-+-+-+-+-+-+-+-+

Code

1 for Authenticate.

Identifier

Identifier 字段为一个八位组, 用于辅助匹配请求和应答. 每次发送与前一请求不同的 Authenticate 时, Identifier 字段都应当改变.

Peer-ID-Length

Peer-ID-Length 字段为一个八位组, 指示 Peer-ID 字段的长度

Peer-ID

Peer-ID 字段为零个或多个八位组, 指示待认证的对端的名称.

Passwd-Length

Passwd-Length 字段为一个八位组, 指示 Password 字段的长度

Password

Password 字段为零个或多个八位组, 指示用于认证的密码.