接入服务器程序流程及消息传递结构第一部分 程序功能框架:第二部分 主程序流程第三部分 数据流程:
第四部分 数据格式和结构
请求数据和响应数据结构格式内容遵守Radius通信协议格式。但是代理服务器和接入服务程序之间采用TCP通讯协议而不是UDP协议。在Radius Client 和AAA服务器之间采用UDP通信协议。
数据格式如下:包数据格式: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 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| |
| Authenticator |
| |
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Attributes ...
+-+-+-+-+-+-+-+-+-+-+-+-+- Code={1,2,3,4,5}
Identifier={1….255};(顺序号,用来识别数据包)
Authenticator: 16byte,十进制,目前为0;Attributes 数据格式为 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
| Type | Length | Value ...
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+- type={1..64}目前支持的数据为:
请求数据: code={1,4}
1=认证请求
4=计费请求
响应数据: code={2,3,5}
2=认证通过
3=认证拒绝
5=计费响应基本Attributer 包括:
type={1,2,4,32,40..51}
1=用户名称
2=用户口令
4=NAS IP 地址
32= NAS 标识
40=计费状态类型={1,2}
1=start 2=stop
41.。51=计费信息(详见RFC2866)
41 Acct-Delay-Time
42 Acct-Input-Octets
43 Acct-Output-Octets
44 Acct-Session-Id
45 Acct-Authentic
46 Acct-Session-Time
47 Acct-Input-Packets
48 Acct-Output-Packets
49 Acct-Terminate-Cause
50 Acct-Multi-Session-Id
51 Acct-Link-Count
自定义属性:(length为Value长度,不包括type+length字段,实际数值为length+2)
type=67:计费类型,length=1, value={1..4} (目前)
1: 不限时和流量
2: 计时
3:流量
4:计时加流量
type=68: 访问控制,length=1,value={0,1}
0:超时或流量切断连接
1:超时或流量不切断连接
type=69:上行带宽控制,length=4,value=(0…n);
0:不控制;
1…n: n*基本带宽单位(k)
type=70:下行带宽控制,length=4,value=(0…n); 网络字节顺序
0:不控制;
1…n: n*基本带宽单位(k)
type=71:剩余时间,length=4, 网络字节顺序(秒) 27(rfc)
type=72,剩余流量,length=4, 网络字节顺序 (单位为k)
type=80..90, 状态码: 没有用户,口令错误,其他。。具体数据格式:1.认证请求数据包:
code=1,
attribute:=
1: 用户名称
2:用户口令(加密口令)算法待定。/
4: NAS ip address
5: NAS id
2.认证通过响应数据包:
code=2;
attribute:=
1:用户名称;
67: 计费类型
switch value(67)
case 1:
none added:
case2:
71,68 is MUST, (71也可以使用27,session_timeout)
case 3:
72,68 is MUST;
case 4:
71,72,68 is MUST
69,70 可选(如无,则不做限制)3.认证拒绝响应数据包:
code=3;
attribute:=
1:用户名称
80..90: 错误状态。4:计费请求数据包:
code=4,
attribute:=
1:用户名称
40: 计费状态
switch value(40):
case 1: 计费开始:
44:计费session_id is MUST,
4:NAS ip address
case 2: 计费结束
44:计费session_id is MUST,
42 Acct-Input-Octets
43 Acct-Output-Octets
46 Acct-Session-Time
47 Acct-Input-Packets
48 Acct-Output-Packets
49 Acct-Terminate-Cause5:计费响应数据包:
code=5:
attribute:=
1,用户名称。6: 错误处理包
code=6
attribute::=
91 :网络错误
value(91) :
1: 认证服务器不可到达
2:计费服务器不可到达
3:发送超时错误
第四部分 数据格式和结构
请求数据和响应数据结构格式内容遵守Radius通信协议格式。但是代理服务器和接入服务程序之间采用TCP通讯协议而不是UDP协议。在Radius Client 和AAA服务器之间采用UDP通信协议。
数据格式如下:包数据格式: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 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| |
| Authenticator |
| |
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Attributes ...
+-+-+-+-+-+-+-+-+-+-+-+-+- Code={1,2,3,4,5}
Identifier={1….255};(顺序号,用来识别数据包)
Authenticator: 16byte,十进制,目前为0;Attributes 数据格式为 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
| Type | Length | Value ...
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+- type={1..64}目前支持的数据为:
请求数据: code={1,4}
1=认证请求
4=计费请求
响应数据: code={2,3,5}
2=认证通过
3=认证拒绝
5=计费响应基本Attributer 包括:
type={1,2,4,32,40..51}
1=用户名称
2=用户口令
4=NAS IP 地址
32= NAS 标识
40=计费状态类型={1,2}
1=start 2=stop
41.。51=计费信息(详见RFC2866)
41 Acct-Delay-Time
42 Acct-Input-Octets
43 Acct-Output-Octets
44 Acct-Session-Id
45 Acct-Authentic
46 Acct-Session-Time
47 Acct-Input-Packets
48 Acct-Output-Packets
49 Acct-Terminate-Cause
50 Acct-Multi-Session-Id
51 Acct-Link-Count
自定义属性:(length为Value长度,不包括type+length字段,实际数值为length+2)
type=67:计费类型,length=1, value={1..4} (目前)
1: 不限时和流量
2: 计时
3:流量
4:计时加流量
type=68: 访问控制,length=1,value={0,1}
0:超时或流量切断连接
1:超时或流量不切断连接
type=69:上行带宽控制,length=4,value=(0…n);
0:不控制;
1…n: n*基本带宽单位(k)
type=70:下行带宽控制,length=4,value=(0…n); 网络字节顺序
0:不控制;
1…n: n*基本带宽单位(k)
type=71:剩余时间,length=4, 网络字节顺序(秒) 27(rfc)
type=72,剩余流量,length=4, 网络字节顺序 (单位为k)
type=80..90, 状态码: 没有用户,口令错误,其他。。具体数据格式:1.认证请求数据包:
code=1,
attribute:=
1: 用户名称
2:用户口令(加密口令)算法待定。/
4: NAS ip address
5: NAS id
2.认证通过响应数据包:
code=2;
attribute:=
1:用户名称;
67: 计费类型
switch value(67)
case 1:
none added:
case2:
71,68 is MUST, (71也可以使用27,session_timeout)
case 3:
72,68 is MUST;
case 4:
71,72,68 is MUST
69,70 可选(如无,则不做限制)3.认证拒绝响应数据包:
code=3;
attribute:=
1:用户名称
80..90: 错误状态。4:计费请求数据包:
code=4,
attribute:=
1:用户名称
40: 计费状态
switch value(40):
case 1: 计费开始:
44:计费session_id is MUST,
4:NAS ip address
case 2: 计费结束
44:计费session_id is MUST,
42 Acct-Input-Octets
43 Acct-Output-Octets
46 Acct-Session-Time
47 Acct-Input-Packets
48 Acct-Output-Packets
49 Acct-Terminate-Cause5:计费响应数据包:
code=5:
attribute:=
1,用户名称。6: 错误处理包
code=6
attribute::=
91 :网络错误
value(91) :
1: 认证服务器不可到达
2:计费服务器不可到达
3:发送超时错误
第四部分 数据格式和结构
请求数据和响应数据结构格式内容遵守Radius通信协议格式。但是代理服务器和接入服务程序之间采用TCP通讯协议而不是UDP协议。在Radius Client 和AAA服务器之间采用UDP通信协议。
数据格式如下:包数据格式: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 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| |
| Authenticator |
| |
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Attributes ...
+-+-+-+-+-+-+-+-+-+-+-+-+- Code={1,2,3,4,5}
Identifier={1….255};(顺序号,用来识别数据包)
Authenticator: 16byte,十进制,目前为0;Attributes 数据格式为 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
| Type | Length | Value ...
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+- type={1..64}目前支持的数据为:
请求数据: code={1,4}
1=认证请求
4=计费请求
响应数据: code={2,3,5}
2=认证通过
3=认证拒绝
5=计费响应基本Attributer 包括:
type={1,2,4,32,40..51}
1=用户名称
2=用户口令
4=NAS IP 地址
32= NAS 标识
40=计费状态类型={1,2}
1=start 2=stop
41.。51=计费信息(详见RFC2866)
41 Acct-Delay-Time
42 Acct-Input-Octets
43 Acct-Output-Octets
44 Acct-Session-Id
45 Acct-Authentic
46 Acct-Session-Time
47 Acct-Input-Packets
48 Acct-Output-Packets
49 Acct-Terminate-Cause
50 Acct-Multi-Session-Id
51 Acct-Link-Count
自定义属性:(length为Value长度,不包括type+length字段,实际数值为length+2)
type=67:计费类型,length=1, value={1..4} (目前)
1: 不限时和流量
2: 计时
3:流量
4:计时加流量
type=68: 访问控制,length=1,value={0,1}
0:超时或流量切断连接
1:超时或流量不切断连接
type=69:上行带宽控制,length=4,value=(0…n);
0:不控制;
1…n: n*基本带宽单位(k)
type=70:下行带宽控制,length=4,value=(0…n); 网络字节顺序
0:不控制;
1…n: n*基本带宽单位(k)
type=71:剩余时间,length=4, 网络字节顺序(秒) 27(rfc)
type=72,剩余流量,length=4, 网络字节顺序 (单位为k)
type=80..90, 状态码: 没有用户,口令错误,其他。。具体数据格式:1.认证请求数据包:
code=1,
attribute:=
1: 用户名称
2:用户口令(加密口令)算法待定。/
4: NAS ip address
5: NAS id
2.认证通过响应数据包:
code=2;
attribute:=
1:用户名称;
67: 计费类型
switch value(67)
case 1:
none added:
case2:
71,68 is MUST, (71也可以使用27,session_timeout)
case 3:
72,68 is MUST;
case 4:
71,72,68 is MUST
69,70 可选(如无,则不做限制)3.认证拒绝响应数据包:
code=3;
attribute:=
1:用户名称
80..90: 错误状态。4:计费请求数据包:
code=4,
attribute:=
1:用户名称
40: 计费状态
switch value(40):
case 1: 计费开始:
44:计费session_id is MUST,
4:NAS ip address
case 2: 计费结束
44:计费session_id is MUST,
42 Acct-Input-Octets
43 Acct-Output-Octets
46 Acct-Session-Time
47 Acct-Input-Packets
48 Acct-Output-Packets
49 Acct-Terminate-Cause5:计费响应数据包:
code=5:
attribute:=
1,用户名称。6: 错误处理包
code=6
attribute::=
91 :网络错误
value(91) :
1: 认证服务器不可到达
2:计费服务器不可到达
3:发送超时错误