77
1 网络技术培训之 网络技术培训之 网络技术培训之 网络技术培训之 宽带产品技术支持部 宽带产品技术支持部 宽带产品技术支持部 宽带产品技术支持部 2002/3 Radius 原理与应用

Radius 原理与应用read.pudn.com/downloads78/ebook/299499/Radius原理...MA5100 PC VLAN1 VLAN2 ESR FE LAN SW GE POS FE 8750 ADSL PC Radius Server

  • Upload
    others

  • View
    35

  • Download
    0

Embed Size (px)

Citation preview

1

网络技术培训之网络技术培训之网络技术培训之网络技术培训之

宽带产品技术支持部宽带产品技术支持部宽带产品技术支持部宽带产品技术支持部 2002/3

Radius 原理与应用

2

主讲人:尹启龙主讲人:尹启龙主讲人:尹启龙主讲人:尹启龙 工号:工号:工号:工号:28475

3

一、基一、基一、基一、基 本本本本 概概概概 念念念念

二、二、二、二、RADIUS协议协议协议协议 概述概述概述概述

三、三、三、三、RADIUS 主要特性主要特性主要特性主要特性

四、四、四、四、RADIUS协议属性和协议属性和协议属性和协议属性和Debug信息信息信息信息

4

一、一、一、一、 基基基基 本本本本 概概概概 念念念念

基本概念

5

• AAA Authentication、Authorization、Accounting 验证、授权、记费

• PAP Password Authentication Protocol 口令验证协议

• CHAP Challenge-Handshake Authentication Protocol 盘问握手验证协议

• NAS Network Access Server 网络接入服务器

• RADIUS Remote Authentication Dial In User Service 远程验证拨入用户服务(拨入用户的远程验证服务)• TCP Transmission Control Protocol

传输控制协议• UDP User Datagram Protocol

用户数据报协议

名词解释

6

AAA可以通过两种途径实现:

1、在NAS端进行认证、授权和计费;

2、通过协议进行远程的认证、授权和记帐。实现AAA的协议有RADIUS、Kerberos、TACACS +等(我们使用的是RADIUS协议)。

PC

PC局域网局域网局域网局域网

NAS

认证服务器认证服务器认证服务器认证服务器

计费服务器计费服务器计费服务器计费服务器

Internet

AAA实现途径

7

RADIUS 是Remote Authentication Dial In User Service 的简称,MA5200、ISN8850和MD5500上目前使用RADIUS完成对PPP用户

的认证、授权和计费。

当用户想要通过某个网络(如电话网)与 NAS建立连接从而获得访问其他网络的权利时,NAS可以选择在NAS上进行本地认证计费,或把用户信息传递给RADIUS服务器,由Radius进行认证计费;RADIUS 协议规定了NAS与RADIUS 服务器之间如何传递用户信息和记账信息;RADIUS服务器负责接收用户的连接请求,完成验证,并把传递服务给用户所需的配置信息返回给NAS。

AAA实现途径

8

PAP(Password Authentication Protocol)是密码验证协议的

简称,是认证协议的一种。 用户以明文的形式把用户名和他的密码传递给NAS,NAS根据用户名在NAS端查找本地数据库,如果存在相同的用户名和密码表明验证通过,否则表明验证未通过。

本地认证——PAP

用户

(PPP) NAS(Radius Client)

Username,Password

验证结果

• 本地(本地(本地(本地(NAS))))验证验证验证验证——PAP方式:方式:方式:方式:

我查……我验……

9

CHAP(Challenge Handshake Authentication Protocol)是

查询握手验证协议的简称,是我们使用的另一种认证协议。

• 本地(本地(本地(本地(NAS))))验证验证验证验证——CHAP方式:方式:方式:方式:

本地认证——CHAP

用户

(PPP)

CHAP ID、Username、Secret Password

验证结果

Challenge、主机名、CHAP ID

NAS(Radius Client)

Secret Password = MD5(Chap ID + Password + challenge)

我查……我算……我验……

10

当用户请求上网时,服务器产生一个16字节的随机码(challenge)给用户(同时还有一个ID号,本地路由器的 hostname)。用户端得到这个包后使用自己独用的设备或软件对传来的各域进行加密,生成一个Secret Password传给NAS。NAS根据用户名查找自己本地的数据库,得到和用户端进行加密所用的一样的密码,然后根据原来的16字节的随机码进行加密,将其结果与Secret Password作比较,如果相同表明验证通过,如果

不相同表明验证失败。

本地认证——CHAP

Secret Password = MD5(Chap ID + Password + challenge)

11

• 远端(远端(远端(远端(Radius))))验证验证验证验证——PAP方式:方式:方式:方式:

用户

(PPP)

ChallengeUsername,Secret Password

验证结果

RadiusServer

Username,Password

验证结果

NAS(Radius Client)

Key

Key

远端认证——PAP

Secret password =Password XOR MD5(Challenge + Key)(Challenge就是Radius报文中的Authenticator) 我查……

我算……我验……

12

• 远端(远端(远端(远端(Radius))))验证验证验证验证——CHAP方式:方式:方式:方式:

用户

(PPP)

Username,Secret Password,Challenge,CHAP ID

RadiusServer

CHAP ID,Username,Secret Password

验证结果、授权

Challenge、主机名、CHAP ID

验证结果、授权 NAS(Radius Client)

远端认证——CHAP

Secret password = MD5(Chap ID + Password + challenge)我查……我算……我验……

13

二、二、二、二、RADIUS协议协议协议协议 概述概述概述概述

14

用户 NAS(Radius客户端) Radius服务器

Raidus(Remote Authentication Dial In User Service)是对远端拨号接入用户的认证服务,Radius服务分客户端和服务器端,通

常我们公司的接入产品支持的是客户端,负责将认证等信息按照协议的格式通过UDP包送到服务器,同时对服务器返回的信息解

释处理。

通常对Radius协议的服务端口号是1645(认证)、1646(计费)或1812(认证)、1813(计费)。

15

Packet : 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 ... +-+-+-+-+-+-+-+-+-+-+-+-+-

Attribute : 0 1 2 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+- | Type | Length | Value ... +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-

Radius协议包结构

16

各个域的解释:各个域的解释:各个域的解释:各个域的解释:

1、Code:包类型;1字节;指示RADIUS包的类型。

2、Identifier:包标识;1字节;用于匹配请求包和响应包,同一

组请求包和响应包的Identifier应相同。

3、Length:包长度;2字节;整个包的长度。

4、Authenticator:验证字;16字节;用于对包进行签名。

Radius协议包各个域解释

17

1111))))CodeCodeCodeCode::::包的类型包的类型包的类型包的类型

包类型占1个字节,定义如下: 1 Access-Request——请求认证过程 2 Access-Accept——认证响应过程 3 Access-Reject——认证拒绝过程 4 Accounting-Request——请求计费过程 5 Accounting-Response——计费响应过程

*12 Status-Server (experimental)——实验的 *13 Status-Client (experimental)——实验的 *255 Reserved——保留的

Radius协议包:code域

18

Internet

... ...

100M

����������������

�������������

��

��������

������������

������������������������������������������

��������������������������������

��������

����������

������������

����

����������

���������������

���������������������������������������������

�����������������������

������������������

Radius

Web100M/1000M

����������

����������

��������

��������

���������������������������������������������������������������������������������� VOD

24×10Base_T

... ...

2403

... ...

2403

MA5100

PC

VLAN2VLAN1

ESR

FE

LAN SW

GEPOS

FE

8750

ADSL PC

Radius Server与NAS在全网中的位置

NAS

19

Radius

Access-Request(2)

Access-Accept / Access-Reject(3)

认证(端口:1812)

Accounting-Request (start)(5)

Accounting-Response (start)(6)

Access-Request(2)

Access-Challenge

计费(端口:1813)

NASUser

dial-in(1)

config user(4)

disconnect(7) Accounting-Request (stop)(8)

Accounting-Response (stop)(9)disconnect user(10)

NAS Radius认证计费过程

20

1、用户拨入后(1),所拨入的设备(比如NAS)将拨入用户的用户的信息(比如用户名、口令、所占用的端口等等)打包向RADIUS服务器发送(2)。

2、如果该用户是一个合法的用户,那么Radius告诉NAS该用户可以上网,同时传回该用户的配置参数(3);否则,Radius反馈NAS该用户非法的信息(3)。

3、如果该用户合法,MAS就根据从RADIUS服务器传回的配置参数配置用户(4)。如果用户非法,NAS反馈给用户出错信息并断开该用户连接(4)。

4、如果用户可以访问网络,RADIUS客户要向RADIUS服务器发送一个记费请求包表明对该用户已经开始记费(5),RADIUS服务器收到并成功记录该请求包后要给予响应(6)。

5、当用户断开连接时(连接也可以由接入服务器断开)(7),RADIUS客户向RADIUS服务器发送一个记费停止请求包,其中包含用户上网所使用网络资源的统计信息(上网时长、进/出的字节/包数等)(8),RADIUS服务器收到并成功记录该请求包后要给予响应(9)。

NAS Radius认证计费过程

21

NAS Radius认证计费过程

1、RADIUS的通信是用“请求 - 响应”方式进行的,

即:客户发送一个请求包,服务器收到包后给予响应。2、RADIUS协议采用的是UDP协议,数据包可能

会在网络上丢失,如果客户没有收到响应,那么可以重新发送该请求包。多次发送之后如果仍然收不到响应,RADIUS客户可以向备用的RADIUS服务

器发送请求包。

22

2222))))IdentifierIdentifierIdentifierIdentifier::::包标识包标识包标识包标识

包标识,用以匹配请求包和响应包。

该字段的取值范围为0~255;

协议规定:1、在任何时间,发给同一个RADIUS服务器的不同包的Identifier域不能相同,如果出现相同的情况,RADIUS将认为

后一个包是前一个包的拷贝而不对其进行处理。

2、Radius针对某个请求包的响应包应与该请求包在Identifier上相匹配(相同)。

Radius协议包:Identifier域

23

3))))Length::::包长度包长度包长度包长度

整个包长度,包括Code,Identifier,Length,Authenticator,Attributes域的长度。

Radius协议包:Length域

24

4))))Authenticator::::验证字验证字验证字验证字 该验证字分为两种: 1、请求验证字---Request Authenticator 用在请求报文中,必须为全局唯一的随机值。

2、响应验证字---Response Authenticator 用在响应报文中,用于鉴别响应报文的合法性。 响应验证字=MD5(Code+ID+Length+请求验证字+Attributes+Key)

Radius协议包:Authenticator域

加密以后你还能认出我来吗?

25

5))))Attributes::::属性属性属性属性

Radius协议包:Authenticator域

6e6564616c6e65620a01

Attribute(1)属性

长度为10字节

b e n l a d e n

上网用户:本·拉登

上网地点:阿富汗……  ……

26

三、三、三、三、RADIUS 主要特性主要特性主要特性主要特性

Radius协议主要特性

27

Radius是一种流行的AAA协议,同时其采用的是UDP协议传输模式,AAA协议在协议栈中位置如下:

Radius协议在协议栈中的位置

Radius协议

28

1111)为什么使用)为什么使用)为什么使用)为什么使用UDP????

1、 NAS和RADIUS服务器之间传递的一般是几十至上百个字节长度的数据,

用户可以容忍几秒到十几秒的验证等待时间。当处理大量用户时服务器端采用多线程,UDP简化了服务器端的实现过程。

2、 TCP是必须成功建立连接后才能进行数据传输的,这种方式在有大量用

户使用的情况下实时性不好。

3、当向主用服务器发送请求失败后,还要必须向备用的服务器发送请求。于是RADIUS要有重传机制和备用服务器机制,它所采用的定时,TCP不能

很好的满足。

Radius协议选择UDP作为传输层协议

29

2))))Client/Server结构结构结构结构

RADIUS采用客户/服务器(Client/Server)结构:

1、RADIUS的客户端通常运行于接入服务器(NAS)上,RADIUS服务器通常运行于一台工作站上,一个RADIUS服务器可以同时支持多个RADIUS客户(NAS)。

2、RADIUS的服务器上存放着大量的信息,接入服务器(NAS)无须保存这些信息,而是通过RADUIS协议对这些信息进行访问。

这些信息的集中统一的保存,使得管理更加方便,而且更加安全。

3、RADIUS服务器可以作为一个代理,以客户的身份同其他的RADIUS服务器或者其他类型的验证服务器进行通信。用户的漫游通常就是通过RADIUS代理实现的。

NAS VS Radius Client VS Server

30

3)网络安全)网络安全)网络安全)网络安全

RADIUS协议的加密是使用MD5加密算法进行的,在RADIUS的客户端(NAS)和服务器端(Radius Server)保存了一个密钥(key),RADIUS协议利用这个密钥使用MD5算法对RADIUS中的数据进行加密处理。密钥不会在网络上传送。RADIUS的加密主要体现在两方面:1、包加密: 在RADIUS包中,有16字节的验证字(authenticator)用于对包进行签名,收到RADIUS包的一方要查看该签名的正确性。如果包的签名不正确,那么该包将被丢弃,对包进行签名时使用的也是MD5算法(利用密钥),没有密钥的人是不能构造出该签名的。2、口令加密: 在认证用户时,用户的口令不会在网上明文传送,而是使用了MD5算法对口令进行加密。没有密钥的人是无法正确加密口令的,也无法正确地对加密过的口令进行解密。

网络安全

安全第一

31

MD5是一个算法,它的输入是一段内存,输出是一个16字节的摘要,它的运算是单向的,即从输出推算不出

输入。

MD5算法

不好意思,我只会把您的手表变成兔子,

变不回去了……

32

包的签名与加密:包的签名与加密:包的签名与加密:包的签名与加密:

包的签名指的是RADIUS包中16字节的Authenticator,我们称其

为“验证字”。

认证请求包认证请求包认证请求包认证请求包RequestAuth=Authenticator,认证请求包的验证字是一个不可预测的16字节随机数。这个随机数将用于口令的加密。认证响应包认证响应包认证响应包认证响应包ResponseAuth = MD5(Code+ID+Length+Authenticator+Attributes+Key)。

记费请求包记费请求包记费请求包记费请求包RequestAcct = MD5(Code+ID+Length+16ZeroOctets+Attributes+Key)。记费响应包记费响应包记费响应包记费响应包ResponseAcct = MD5(Code+ID+Length+RequestAcct+Attributes+Key)。

包的签名与加密

33

口令的加密口令的加密口令的加密口令的加密:::: 称共享密钥(key)为Key;16字节的认证请求验证字(Authenticator)为Auth;将口令(Password)分割成16字节一段( 后一段不足16字节时用0补齐),为p1、p2等;加密后的口令块为c(1)、c(2)等。下面运算中b1、b2为中间值: b1 = MD5(Key + Auth) c(1) = p1 xor b1 b2 = MD5(Key + c(1)) c(2) = p2 xor b2 …… …… …… bi = MD5(Key+ c(i-1)) c(i) = pi xor bi那么加密后的口令为c(1)+c(2)+...+c(i)。

上面是协议规定的算法,也有的RADIUS服务器为了实现起来简单,修改了上述的算法,具体的讲,b1的算法同上,但bi=b2=b1(i>=1),其他运算不变。当用户的口令长度不超过16字节时,两种算法的结果是一样的。

口令的加密

34

• 远端(远端(远端(远端(Radius))))验证验证验证验证——PAP方式:方式:方式:方式:

用户

(PPP)

Username,Secret Password

验证结果

RadiusServer

Username,Password

验证结果

NAS(Radius Client)

远端认证——PAP

Secret password =Password XOR MD5(Challenge + Key)(Challenge就是Radius报文中的Authenticator) 我查……

我算……我验……

35

如果用户配置了RADIUS验证,其PAP验证过程如下:

采用PAP验证:用户以明文的形式把用户名和他的

密码传递给NAS。NAS把用户名和加密过的密码放到验证请求包的相应属性中传递给RADIUS服务器,根据RADIUS服务器的返回结果来决定是否允许用户上网。

远端认证——PAP

用户名、密码 放行

36

Radius

Code+ID+Length+Authenticator+Attributes

NASUser

username+password(明文)

A2=MD5(Code+ID+Length+Authenticator+Attributes+Key)

username,password username,password 数据库

Secret Password=Password XOR MD5(Challenge + Key)

查找数据库中该username及其在数据库中对应的Password;同时用收到的Secret Password XOR MD5(Authenticator+key)并与前面查到的Password比较,相同的话认证通过。

A1=MD5(Code+ID+Length+Authenticator+Attributes+Key)

比较A1与A2,相同的话用Radius反馈回来的属性去配置用户,否则将该包丢弃。

Code+ID+Length+A2+Attributes

除A2加密,其余属性为明文

除密码加密,其余属性为明文

远端认证——PAP

37

Code = 1 (Access-Request)Code = 1 (Access-Request)Code = 1 (Access-Request)Code = 1 (Access-Request)ID = 0ID = 0ID = 0ID = 0Length = 56Length = 56Length = 56Length = 56Request Authenticator = {16 octet random number}Request Authenticator = {16 octet random number}Request Authenticator = {16 octet random number}Request Authenticator = {16 octet random number}Attributes:Attributes:Attributes:Attributes: User-Name = "nemo" User-Name = "nemo" User-Name = "nemo" User-Name = "nemo" User-Password = {16 octets of Password padded at end with nulls,User-Password = {16 octets of Password padded at end with nulls,User-Password = {16 octets of Password padded at end with nulls,User-Password = {16 octets of Password padded at end with nulls, XORed XORed XORed XORed with MD5(key|Request Authenticator)} with MD5(key|Request Authenticator)} with MD5(key|Request Authenticator)} with MD5(key|Request Authenticator)} NAS-IP-Address = 192.168.1.16 NAS-IP-Address = 192.168.1.16 NAS-IP-Address = 192.168.1.16 NAS-IP-Address = 192.168.1.16 NAS-Port = 3 NAS-Port = 3 NAS-Port = 3 NAS-Port = 3

例1:用户telnet到特定的主机

例例例例1111::::1)NAS:192.168.1.16 发送 Access-Request UDP 数据包到 RADIUS Server 。 User-name User-name User-name User-name ::::nemonemonemonemo Port logging in Port logging in Port logging in Port logging in ::::3333

38

Code = 2 (Access-Accept)Code = 2 (Access-Accept)Code = 2 (Access-Accept)Code = 2 (Access-Accept)

ID = 0 (same as in Access-Request)ID = 0 (same as in Access-Request)ID = 0 (same as in Access-Request)ID = 0 (same as in Access-Request)

Length = 38Length = 38Length = 38Length = 38

Response Authenticator = {16-octet MD-5 checksum of the code (2),idResponse Authenticator = {16-octet MD-5 checksum of the code (2),idResponse Authenticator = {16-octet MD-5 checksum of the code (2),idResponse Authenticator = {16-octet MD-5 checksum of the code (2),id(0), Length (38), the Request Authenticator from above, the(0), Length (38), the Request Authenticator from above, the(0), Length (38), the Request Authenticator from above, the(0), Length (38), the Request Authenticator from above, theattributes in this reply, and the shared secret}attributes in this reply, and the shared secret}attributes in this reply, and the shared secret}attributes in this reply, and the shared secret}

Attributes:Attributes:Attributes:Attributes:

Service-Type = Login-User Service-Type = Login-User Service-Type = Login-User Service-Type = Login-User

Login-Service = Telnet Login-Service = Telnet Login-Service = Telnet Login-Service = Telnet

Login-Host = 192.168.1.3 Login-Host = 192.168.1.3 Login-Host = 192.168.1.3 Login-Host = 192.168.1.3

2)RADIUS server 验证了 nemo, 并且发送了 Access-Accept UDP 数据包到接入服务器,告诉把用户 nemo 登陆到主机 192.168.1.3.

例1:用户telnet到特定的主机

39

• 远端(远端(远端(远端(Radius))))验证验证验证验证——CHAP方式:方式:方式:方式:

用户

(PPP)

Username,Secret Password,Challenge,CHAP ID

RadiusServer

CHAP ID,Username,Secret Password

验证结果、授权

Challenge、主机名、CHAP ID

验证结果、授权 NAS(Radius Client)

远端认证——CHAP

Secret password = MD5(Chap ID + Password + challenge)我查……我算……我验……

40

采用CHAP验证: 当用户请求上网时, NAS产生一个16字节的随机码给用户(同时还有一个ID号,本地路由器的 hostname)。 用户端得到这个包后使用自己独有的设备或软件对传来的各域进行加密,生成一个response传给NAS, NAS把传回来的CHAP ID和Response分别作为用户名和密码,并把原来的 16字节随机码传给RADIUS服务器。 RADIUS根据用户名在服务器端查

找数据库,得到和用户端进行加密所用的一样的密码,然后根据传来的16字节的随机码进行加密,将其结果与传来的Password作比较,如果相同表明验证通过,如果不相同表明验证失败。另外如果验证成功,RADIUS服务器同样也可以生成一个 16字节的随机码对用户进行询问(Challenge)——该方式暂不支持。

如果用户配置了RADIUS验证,其CHAP验证过程如下:

远端认证——CHAP

41

Radius

Code+ID+Length+Authenticator+Attributes

NASUser

CHAP ID+MD5(Authenticator+Password+CHAP ID)

A2=MD5(Code+ID+Length+Authenticator+Attributes+Key)

username,password username,password 数据库

密码:CHAP ID+MD5(Authenticator+Password+CHAP ID),其余属性为明文

查找数据库中该username及其在数据库中对应的Password,对该Password进行如下MD5加密:MD5(Authenticator+Password+CHAP ID),并与NAS上报的密码比较,相同的话认证通过。

A1=MD5(Code+ID+Length+Authenticator+Attributes+Key)

比较A1与A2,相同的话用Radius反馈回来的属性去配置用户,否则将该包丢弃。

Code+ID+Length+A2+Attributes

除A2加密,其余属性为明文

CHAP ID+Authenticator

远端认证——CHAP

42

例2:用户端进行CHAP验证

Code = 1 (Access-Request)Code = 1 (Access-Request)Code = 1 (Access-Request)Code = 1 (Access-Request)ID = 1ID = 1ID = 1ID = 1Length = 71Length = 71Length = 71Length = 71Request Authenticator = {16 octet random number also used as CHAP challenge}Request Authenticator = {16 octet random number also used as CHAP challenge}Request Authenticator = {16 octet random number also used as CHAP challenge}Request Authenticator = {16 octet random number also used as CHAP challenge}Attributes:Attributes:Attributes:Attributes: User-Name = "floppy" User-Name = "floppy" User-Name = "floppy" User-Name = "floppy" CHAP-Password = {1 octet CHAP ID followed by 16 octet CHAP response}CHAP-Password = {1 octet CHAP ID followed by 16 octet CHAP response}CHAP-Password = {1 octet CHAP ID followed by 16 octet CHAP response}CHAP-Password = {1 octet CHAP ID followed by 16 octet CHAP response} NAS-IP-Address = 192.168.1.16 NAS-IP-Address = 192.168.1.16 NAS-IP-Address = 192.168.1.16 NAS-IP-Address = 192.168.1.16 NAS-Port = 20 NAS-Port = 20 NAS-Port = 20 NAS-Port = 20 Service-Type = Framed-User Service-Type = Framed-User Service-Type = Framed-User Service-Type = Framed-User Framed-Protocol = PPP Framed-Protocol = PPP Framed-Protocol = PPP Framed-Protocol = PPP

例例例例2222::::接入服务器 192.168.1.16 发送一个 Access-Request UDP 数据包到 RADIUS Server 。 User-name User-name User-name User-name ::::floppy floppy floppy floppy Port logging in Port logging in Port logging in Port logging in ::::20 20 20 20 Protocol Protocol Protocol Protocol ::::PPPPPPPPPPPP接入服务器发送的数据包包含属性Service-Type = Framed user,Framed-Protocol=PPP暗示 RADIUS server 这个用户要使用PPP服务。

43

Code = 2 (Access-Accept)Code = 2 (Access-Accept)Code = 2 (Access-Accept)Code = 2 (Access-Accept)ID = 1 (same as in Access-Request)ID = 1 (same as in Access-Request)ID = 1 (same as in Access-Request)ID = 1 (same as in Access-Request)Length = 56Length = 56Length = 56Length = 56

Response Authenticator = {16-octet MD-5 checksum of the codeResponse Authenticator = {16-octet MD-5 checksum of the codeResponse Authenticator = {16-octet MD-5 checksum of the codeResponse Authenticator = {16-octet MD-5 checksum of the code(2),id (1), Length (56), the Request Authenticator from above, the(2),id (1), Length (56), the Request Authenticator from above, the(2),id (1), Length (56), the Request Authenticator from above, the(2),id (1), Length (56), the Request Authenticator from above, theattributes in this reply, and the key}attributes in this reply, and the key}attributes in this reply, and the key}attributes in this reply, and the key}

Attributes:Attributes:Attributes:Attributes: Service-Type = Framed-User Service-Type = Framed-User Service-Type = Framed-User Service-Type = Framed-User Framed-Protocol = PPP Framed-Protocol = PPP Framed-Protocol = PPP Framed-Protocol = PPP Framed-IP-Address = 255.255.255.254 Framed-IP-Address = 255.255.255.254 Framed-IP-Address = 255.255.255.254 Framed-IP-Address = 255.255.255.254 Framed-Routing = None Framed-Routing = None Framed-Routing = None Framed-Routing = None Framed-Compression = 1 (VJ TCP/IP Header Compression) Framed-Compression = 1 (VJ TCP/IP Header Compression) Framed-Compression = 1 (VJ TCP/IP Header Compression) Framed-Compression = 1 (VJ TCP/IP Header Compression) Framed-MTU = 1500 Framed-MTU = 1500 Framed-MTU = 1500 Framed-MTU = 1500

RADIUS server 验证 floppy, 并发送Access-Accept UDP 数据包到 NAS 告诉NAS可以允许PPP服务并从它的动态地址池中分配一个网络地址给用户。

例2:用户端进行CHAP验证

44

4)灵活的验证机制)灵活的验证机制)灵活的验证机制)灵活的验证机制

RADIUS协议允许服务器支持多种验证方式,比如PPP的PAP和CHAP、UNIX登录以及其他认证机制。

通常的RADIUS服务器都支持PAP,但有些RADIUS服务器不支持CHAP,原因在于有些RADIUS服务器在保存用户的口令时是加密保存的。而要验证一个CHAP用户的合法性,必须能够获得该用户的明文口令才行。

验证机制

45

5)扩展性)扩展性)扩展性)扩展性

RADIUS协议具有很好的扩展性。RADIUS包是由包头和一定数目的属性(Attribute)构成的。新属性的增加不会影响到现有协议的实现。

通常的NAS厂家在生产NAS时,还同时开发与之配套的RADIUS服务器。为了提供一些功能,常常要定义一些非标准的(RFC上没有定义过的)属性。关于各个厂家有那些扩展的属性,一般可以从相应的RADIUS服务器的字典(dictionary)文件中找到。

扩展性

46

NAS

Radius计费服务器本地话单池

No Reponse

话单

话单

计费保护计费保护计费保护计费保护:

由于计费是个用户敏感的问题 ,我们提供的计费信息要求准确外更要求完备,不能丢失话单,而 Radius计费服务器的计费很容易受通讯不畅或计费服务器工作超负荷等意外因素的影响而丢失话单 , 为此我们提供了本地计费的保护能力,即话单从NAS发送出去以后如果没有收到计费服务器的确认信息我们就认为计费失败 ,并将该话单( 不论是实时计费中间话单还是离线话单 )送到本地话单池中。

47

四、四、四、四、RADIUS协议属性和协议属性和协议属性和协议属性和Debug信息信息信息信息

Radius协议主要特性

48

属性值  属性名称 意义1   User-Name 用户名2    User-Password   用户密码3    Chap-Password   Chap认证方式中的用户密码4 Nas-IP-Address Nas的ip地址5 Nas-Port 用户接入端口号6   Service-Type 服务类型7   Framed-Protocol    协议类型8 Framed-IP-Address 为用户提供的IP地址9 Framed-IP-NetMask 地址掩码10 Framed-Routing 为路由器用户设置的路由方式

11 Filter-Id 过滤表的名称12 Framed-MTU 为用户配置的 大传输单元

• 认证报文的常用属性(认证报文的常用属性(认证报文的常用属性(认证报文的常用属性(1):):):):

49

属性值 属性名称 意义13 Framed-Compression 该连接使用压缩协议14 Login-IP-Host 对login用户提供的可连接主机的ip地址15 Login-Service 对login用户可提供的服务16 Login-TCP-Port TCP服务端口18 Reply-Message 认证服务器返回用户的信息24 State 认证服务器发送challenge包时传送的需在接下来的认证报文中回应的字符串(与Acess-Challenge相关的属性)25 Class 认证通过时认证服务器返回的字符串信息,

要求在该用户的计费报文中送给计费服务器

• 认证报文的常用属性(认证报文的常用属性(认证报文的常用属性(认证报文的常用属性(2):):):):

50

属性值 属性名称 意义26 Vendor-Specific 可扩展属性27 Session-Timeout 在认证通过报文或Challenge报文中,通知NAS该用户可用的会话时长 (时长预付费)28 Idle-Timeout 允许用户空闲在线的 大时长32 NAS-Identifier 标识NAS的字符串33 Proxy-State NAS通过代理服务器转发认证报文时服务

器添加在报文中的属性60 Chap-Challenge 可以代替认证字字段传送challenge的属性61 Nas-Port-Type 接入端口的类型62 Port-Limit 服务器限制NAS为用户开放的端口数

• 认证报文的常用属性(认证报文的常用属性(认证报文的常用属性(认证报文的常用属性(3):):):):

51

属性值 属性名称 意义40 Acct-Status-Type 计费请求报文的类型41 Acct-Delay-Time Radius客户端发送计费报文耗费的时间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-Case 用户下线原因 50 Acct-Multi_Session-Id 相关计费会话标识 51 Acct-Link-Count 生成计费记录时多连接会话的会话个数

• 认证报文的常用属性(认证报文的常用属性(认证报文的常用属性(认证报文的常用属性(4):):):):

52

光口0

光口1

BTS0BTS1

COM0

COM1

ETH

MMXAMA5100

光 纤

LPUC ISN8850

ETH

SIO

MPUA

Radius Server

SPUA

0 # 3 # 10 # 7 #13 #

LPUI

组网图组网图组网图组网图1

10/0/0

LANC

10 #

PC1

13/0/0

53

• 如何在如何在如何在如何在NAS中查看中查看中查看中查看Radius报文信息?报文信息?报文信息?报文信息?

以ISN8850 5008SP1为例:

ESR#debug radius packet

ESR#terminal debugging

% Current terminal debugging is on

54

55

• 用户上线用户上线用户上线用户上线————————第一式:第一式:第一式:第一式:LCPLCPLCPLCP链路协商链路协商链路协商链路协商ESR#*0.18990450-PPP-debug-debug2: PPP Event: Virtual-Template1:1 LCP Open Event state initial*0.18990590-PPP-debug-debug2: PPP Event: Virtual-Template1:1 LCP Lower Up Event state starting*0.18990730-PPP-debug-debug2: PPP Event: Virtual-Template1:1 LCP RCR+(Receive Config Good Request) Event state reqsent*0.18992950-PPP-debug-debug2: PPP Event: Virtual-Template1:1 LCP TO+(Timeout with counter > 0) Event state acksent , Retransmit = 2

56

*0.18993140-AAA-debug-Packet:send radius packet to 192.168.10.4:1812 code=1 id=19 length=102 75 17 0 0 9b a 0 0 20 18 0 0 5a 20 0 0 attribute(1)(User-name):user1 attribute(2)(Password): 0x4d 0xa1 0x11 0xbe 0xa7 0xc5 0x1a 0xa4 0x5b 0x290xb1 0xde 0x34 0x11 0x4c 0xf9 attribute(6)(User-Service): 0x2 attribute(7)(Framed-Protocol): 0x1 attribute(4)(NAS-IP-Address): 0xc0a80a0a attribute(32)(NAS-Identifier):ESR attribute(127)(Connect-Id): 0xf00000e*0.18993750-AAA-debug-Packet: attribute(61)(NAS-Port-Type): 0x5 attribute(128)(Connect-Port):ESR-10000010032@vlan

• 用户上线用户上线用户上线用户上线————————第二式:认证请求(第二式:认证请求(第二式:认证请求(第二式:认证请求(code=1code=1code=1code=1))))

57

• 用户上线用户上线用户上线用户上线————————第三式:认证响应(第三式:认证响应(第三式:认证响应(第三式:认证响应(code=2code=2code=2code=2))))

*0.18993900-AAA-debug-Packet:receive radius packet from 192.168.10.4:1812 code=2 id=19 length=74 18 4c ac 52 e4 99 a5 5f 68 ac 8e 23 3c 70 d 75 attribute(85)(Realtime-Interval): 0x258 attribute(5)(NAS-Port): 0x1513d attribute(25)(Class):128 attribute(6)(User-Service): 0x2 attribute(7)(Framed-Protocol): 0x1 attribute(13)(Framed-Compression): 0x1 attribute(10)(Framed-Routing): 0x1*0.18994520-AAA-debug-Packet: attribute(11)(Framed-Filter):1

58

• 用户上线用户上线用户上线用户上线————————第四式:计费开始请求(第四式:计费开始请求(第四式:计费开始请求(第四式:计费开始请求(code=4code=4code=4code=4))))*0.18994810-AAA-debug-Packet:send radius packet to 192.168.10.4:1813 code=4 id=20 length=102 ef 31 f 3 54 52 71 71 46 a2 98 d 4 87 ca 8 attribute(40)(Acct-Status-Type): 0x1 attribute(32)(NAS-Name):ESR attribute(8)(Framed-Address): 0xa0a0a01 attribute(7)(Framed-Protocol): 0x1 attribute(1)(User-name):user1 attribute(5)(NAS-Port): 0x0 attribute(61)(NAS-Port-Type): 0x5 attribute(44)(Acct-Session-Id):03082027130000000011*0.18995400-AAA-debug-Packet: attribute(45)(Acct-Authentic): 0x1 attribute(193)(Acct-Timestamp): 0x4a31 attribute(41)(Acct-Delay-Time): 0x0

计费开始

1—RADIUS2—Local3—Remote

5—Virtual

59

• 用户上线用户上线用户上线用户上线————————第五式:计费响应(第五式:计费响应(第五式:计费响应(第五式:计费响应(code=5code=5code=5code=5))))

*0.18995750-AAA-debug-Packet:receive radius packet from 192.168.10.4:1813 code=5 id=20 length=20 18 ce 52 6a b7 f5 0 3 71 74 16 a5 bc 42 c0 8a

60

*0.18993900-AAA-debug-Packet:receive radius packet from 192.168.10.4:1812 code=2 id=19 length=74 18 4c ac 52 e4 99 a5 5f 68 ac 8e 23 3c 70 d 75 attribute(85)(Realtime-Interval): 0xb4 attribute(5)(NAS-Port): 0x1513d attribute(25)(Class):128 attribute(2)(Password): 0x4e 0x4f 0x50 0x41 0x53 0x53 0x57 0x44 attribute(6)(User-Service): 0x2 attribute(7)(Framed-Protocol): 0x1 attribute(13)(Framed-Compression): 0x1 attribute(10)(Framed-Routing): 0x1*0.18994520-AAA-debug-Packet: attribute(11)(Framed-Filter):1

• 用户上线用户上线用户上线用户上线————————第六式:实时计费之认证响应(第六式:实时计费之认证响应(第六式:实时计费之认证响应(第六式:实时计费之认证响应(code=2code=2code=2code=2))))

实时计费间隔为180秒

61

分解动作之一:

*0.169338370-AAA-debug-Packet:send radius packet to 192.168.10.4:1813 code=4 id=31 length=207 e4 67 7f f5 9d ec b4 82 d6 15 35 5d ea bd b0 ac attribute(40)(Acct-Status-Type): 0x3 attribute(25)(Class):128 attribute(32)(NAS-Name):ESR attribute(8)(Framed-Address): 0xa0a0a01 attribute(7)(Framed-Protocol): 0x1 attribute(1)(User-name):user1 attribute(5)(NAS-Port): 0x28000060 attribute(61)(NAS-Port-Type): 0x5

• 用户在线用户在线用户在线用户在线————————第七式:实时计费之计费请求(第七式:实时计费之计费请求(第七式:实时计费之计费请求(第七式:实时计费之计费请求(code=4code=4code=4code=4))))

实时计费包

62

• 用户在线用户在线用户在线用户在线————————第七式:实时计费之计费请求(第七式:实时计费之计费请求(第七式:实时计费之计费请求(第七式:实时计费之计费请求(code=4code=4code=4code=4))))分解动作之二:*0.169338940-AAA-debug-Packet: attribute(44)(Acct-Session-Id):03101407580000000102 attribute(45)(Acct-Authentic): 0x1 attribute(193)(Acct-Timestamp): 0x2957a attribute(55)(Event-Timestamp): 0x0 0x2 0x95 0x7a attribute(41)(Acct-Delay-Time): 0x0 attribute(87)(Nas-Port-Id):slot=10;subslot=0;port=0;VPI=1;VCI=32; attribute(6)(User-Service): 0x2 attribute(7)(Framed-Protocol): 0x1 attribute(42)(Acct-Input-Octets): 0x7fd4*0.169339520-AAA-debug-Packet: attribute(43)(Acct-Output-Octets): 0x6174 attribute(47)(Acct-Input-Packets): 0x122 attribute(48)(Acct-Output-Packets): 0x10e attribute(52)(Acct-Input-Gigawords): 0x0 attribute(53)(Acct-output-Gigawords): 0x0 attribute(46)(Acct-Session-Time): 0x12c

用户上传字节

用户下载字节

用户计费时长

63

分解动作之一:

*0.19379310-AAA-debug-Packet:send radius packet to 192.168.10.4:1813 code=4 id=26 length=168 1c cb 87 52 97 a2 72 7b 76 32 cb db 49 3c a3 49 attribute(40)(Acct-Status-Type): 0x2 attribute(32)(NAS-Name):ESR attribute(8)(Framed-Address): 0xa0a0a01 attribute(7)(Framed-Protocol): 0x1 attribute(1)(User-name):user1 attribute(5)(NAS-Port): 0x0 attribute(61)(NAS-Port-Type): 0x5 attribute(44)(Acct-Session-Id):03082033090000000014

• 用户下线用户下线用户下线用户下线————————第八式:计费结束请求(第八式:计费结束请求(第八式:计费结束请求(第八式:计费结束请求(code=4code=4code=4code=4))))

计费结束

64

分解动作之二:*0.19379900-AAA-debug-Packet: attribute(45)(Acct-Authentic): 0x1 attribute(193)(Acct-Timestamp): 0x4bb3 attribute(41)(Acct-Delay-Time): 0x0 attribute(49)(Acct-Terminate-Cause): 0x1 attribute(111)(Input-Kilobytes-Before-Tariff-Switch): 0x4 attribute(115)(Input-Kilobytes-After-Tariff-Switch): 0x4 attribute(112)(Output-Kilobytes-Before-Tariff-Switch): 0x0 attribute(116)(Output-Kilobytes-After-Tariff-Switch): 0x0*0.19380460-AAA-debug-Packet: attribute(113)(Input-Packets-Before-Tariff-Switch): 0x29 attribute(117)(Input-Packets-After-Tariff-Switch): 0x29 attribute(114)(Output-Packets-Before-Tariff-Switch): 0x0 attribute(118)(Output-Packets-After-Tariff-Switch): 0x0 attribute(72)(Time-Befor-Tariff-Switch): 0x1d attribute(73)(Time-After-Tariff-Switch): 0x1d

• 用户下线用户下线用户下线用户下线————————第八式:计费结束请求(第八式:计费结束请求(第八式:计费结束请求(第八式:计费结束请求(code=4code=4code=4code=4))))

65

*0.19380930-AAA-debug-Packet:receive radius packet from 192.168.10.4:1813 code=5 id=26 length=20 18 98 f0 cd 92 45 59 12 51 c3 e 33 f6 68 4 f6

• 用户下线用户下线用户下线用户下线————————第九式:计费响应(第九式:计费响应(第九式:计费响应(第九式:计费响应(code=5code=5code=5code=5))))

66

*0.82764120-AAA-debug-Packet:send radius packet to 192.168.10.4:1812 code=1 id=46 length=102 ea b 0 0 2 78 0 0 57 39 0 0 f6 37 0 0 attribute(1)(User-name):user2 attribute(2)(Password): 0x69 0x4 0xf1 0x8c 0xeb 0x81 0x15 0x71 0xe2 0xd0 0x15 0xb0 0x20 0xee 0x9a 0x55 …… ……*0.82764970-AAA-debug-Packet:receive radius packet from 192.168.10.4:1812 code=3 id=46 length=59 62 d1 7c 55 77 94 f5 21 52 40 77 c1 e7 4c 5e 53 attribute(18)(Reply-Message):!!!the password of this user is wrong

• 用户上线用户上线用户上线用户上线————————败招之一:密码错误败招之一:密码错误败招之一:密码错误败招之一:密码错误

67

*0.82897520-AAA-debug-Packet:send radius packet to 192.168.10.4:1812 code=1 id=48 length=100 73 57 0 0 d5 45 0 0 47 36 0 0 d4 8 0 0 attribute(1)(User-name):abc attribute(2)(Password): 0x90 0x5d 0xe4 0x8b 0x9f 0xbe 0xb 0x8c 0xf7 0xea 0xc4 0x17 0xd6 0x5 0x9c 0x23 …… ……*0.82898270-AAA-debug-Packet:receive radius packet from 192.168.10.4:1812 code=3 id=48 length=57 de e1 1c fc 98 cc aa e8 64 ec 42 25 49 52 70 28 attribute(18)(Reply-Message):!!!no this username in the database

• 用户上线用户上线用户上线用户上线————————败招之二:非法用户败招之二:非法用户败招之二:非法用户败招之二:非法用户

68

• CHAP认证:认证:认证:认证:

*0.83248920-AAA-debug-Packet:send radius packet to 192.168.10.4:1812 code=1 id=49 length=121 d1 c9 52 9b a5 26 fe 87 68 34 1d e6 8a 72 a1 27 attribute(1)(User-name):user1 attribute(3)(Challenge-Response): 0x1 0x7d 0x2f 0x15 0x11 0x97 0x7b 0x48 0xc0 0xec 0xb7 0x63 0x34 0x81 0x48 0xd9 0x9d attribute(60)(CHAP-Challenge): 0xd1 0xc9 0x52 0x9b 0xa5 0x26 0xfe 0x87 0x680x34 0x1d 0xe6 0x8a 0x72 0xa1 0x27 attribute(6)(User-Service): 0x2*0.83249500-AAA-debug-Packet: attribute(7)(Framed-Protocol): 0x1 attribute(4)(NAS-IP-Address): 0xc0a80a0a attribute(32)(NAS-Identifier):ESR attribute(127)(Connect-Id): 0xf00001c attribute(61)(NAS-Port-Type): 0x5 attribute(128)(Connect-Port):ESR-10000010032@vlan

69

• NAS分配分配分配分配IP地址地址地址地址::::

*0.18993900-AAA-debug-Packet:receive radius packet from 192.168.10.4:1812 code=2 id=19 length=74 18 4c ac 52 e4 99 a5 5f 68 ac 8e 23 3c 70 d 75 attribute(85)(Realtime-Interval): 0x258 attribute(5)(NAS-Port): 0x1513d attribute(25)(Class):128 attribute(2)(Password): 0x4e 0x4f 0x50 0x41 0x53 0x53 0x57 0x44 attribute(6)(User-Service): 0x2 attribute(7)(Framed-Protocol): 0x1 attribute(13)(Framed-Compression): 0x1 attribute(10)(Framed-Routing): 0x1*0.18994520-AAA-debug-Packet: attribute(11)(Framed-Filter):1

认证响应包中无Framed-IP-Address,证明用户IP未由Radius分配,只好由NAS自行分配。

这么小气,连个IP都不给,只好自己

解决了!

NAS

你长得这么丑,有IP也不给!

Radius

70

• NAS分配分配分配分配IP地址地址地址地址::::

*0.18994810-AAA-debug-Packet:send radius packet to 192.168.10.4:1813 code=4 id=20 length=102 ef 31 f 3 54 52 71 71 46 a2 98 d 4 87 ca 8 attribute(40)(Acct-Status-Type): 0x1 attribute(32)(NAS-Name):ESR attribute(8)(Framed-Address): 0xa0a0a01 attribute(7)(Framed-Protocol): 0x1 attribute(1)(User-name):user1 attribute(5)(NAS-Port): 0x0 attribute(61)(NAS-Port-Type): 0x5 attribute(44)(Acct-Session-Id):03082027130000000011*0.18995400-AAA-debug-Packet: attribute(45)(Acct-Authentic): 0x1 attribute(193)(Acct-Timestamp): 0x4a31 attribute(41)(Acct-Delay-Time): 0x0

好心痛啊,我又损失了一个IP!

NAS

71

• Radius分配分配分配分配IP地址地址地址地址::::

*0.280622150-AAA-debug-Packet:receive radius packet from 192.168.10.4:1812 code=2 id=171 length=112 de 54 fd 69 46 2f c6 6b b8 aa ee d3 14 f8 7 3 attribute(85)(Realtime-Interval): 0xb4 attribute(28)(Idle-TimeOut): 0x1517f attribute(27)(Session-TimeOut): 0x1517f attribute(25)(Class):128 attribute(8)(Framed-Address): 0xa0a0a01 attribute(2)(Password): 0x4e 0x4f 0x50 0x41 0x53 0x53 0x57 0x44 attribute(6)(User-Service): 0x2*0.280622770-AAA-debug-Packet: attribute(7)(Framed-Protocol): 0x1 attribute(13)(Framed-Compression): 0x1 attribute(10)(Framed-Routing): 0x1

有,有,有,要多少都有……

Radius

请问你有IP吗?

NAS

72

• Radius分配分配分配分配IP地址地址地址地址::::*0.280623570-AAA-debug-Packet:send radius packet to 192.168.10.4:1813 code=4 id=172 length=193 3 8 12 5 a4 a6 a8 3f fc 20 44 3 e2 9e 86 38 attribute(40)(Acct-Status-Type): 0x1 attribute(25)(Class):128 attribute(32)(NAS-Name):ESR attribute(8)(Framed-Address): 0xa0a0a01 attribute(7)(Framed-Protocol): 0x1 attribute(1)(User-name):user21 attribute(5)(NAS-Port): 0x28000060 attribute(61)(NAS-Port-Type): 0x5 attribute(44)(Acct-Session-Id):03112107360000000157 attribute(45)(Acct-Authentic): 0x1 attribute(193)(Acct-Timestamp): 0x4482d attribute(55)(Event-Timestamp): 0x0 0x4 0x48 0x2d attribute(41)(Acct-Delay-Time): 0x0 attribute(87)(Nas-Port-Id):slot=10;subslot=0;port=0;VPI=1;VCI=32; attribute(6)(User-Service): 0x2 attribute(7)(Framed-Protocol): 0x1

73

• NAS-IP-Address / NAS-Port / NAS-Identifier / NAS-Port-Type / NAS-Port-ID/ NAS-Port-ID/ NAS-Port-ID/ NAS-Port-ID::::

*0.624755570-AAA-debug-Packet:send radius packet to 192.168.10.4:1812 code=1 id=132 length=120 c4 72 0 0 de 13 0 0 cf 68 0 0 ed 58 0 0 attribute(1)(User-name):user1 attribute(2)(Password): 0x1e 0x9 0xe6 0x8e 0x5f 0xf2 0x1f 0xdf 0xf8 0x53 0x210x84 0x87 0x1 0xb9 0x37 attribute(6)(User-Service): 0x2 attribute(7)(Framed-Protocol): 0x1 attribute(4)(NAS-IP-Address): 0xc0a80a0a attribute(32)(NAS-Identifier):ESR attribute(5)(NAS-Port): 0x28000060*0.624756170-AAA-debug-Packet: attribute(61)(NAS-Port-Type): 0x5 attribute(87)(Nas-Port-Id):slot=10;subslot=0;port=0;VPI=1;VCI=32;

NAS IP地址,标识,

端口,端口类型,端口ID

74

• Service-Type / Frame-Protocol::::

*0.18993140-AAA-debug-Packet:send radius packet to 192.168.10.4:1812 code=1 id=19 length=102 75 17 0 0 9b a 0 0 20 18 0 0 5a 20 0 0 attribute(1)(User-name):user1 attribute(2)(Password): 0x4d 0xa1 0x11 0xbe 0xa7 0xc5 0x1a 0xa4 0x5b 0x290xb1 0xde 0x34 0x11 0x4c 0xf9 attribute(6)(Service-Type): 0x2 attribute(7)(Framed-Protocol): 0x1 attribute(4)(NAS-IP-Address): 0xc0a80a0a attribute(32)(NAS-Identifier):ESR attribute(127)(Connect-Id): 0xf00000e*0.18993750-AAA-debug-Packet: attribute(61)(NAS-Port-Type): 0x5 attribute(128)(Connect-Port):ESR-10000010032@vlan

服务类型和协议类型

75

• Session-Timeout / Idle-Timeout::::

*0.103981490-AAA-debug-Packet:receive radius packet from 192.168.10.4:1812 code=2 id=192 length=77 ae b 6a 56 60 0 16 5b 21 98 73 2a f3 5b ac f7 attribute(85)(Realtime-Interval): 0xa attribute(28)(Idle-TimeOut): 0x14 attribute(46)(Session-Timeout): 0x3c attribute(25)(Class):128 attribute(2)(Password): 0x4e 0x4f 0x50 0x41 0x53 0x53 0x57 0x44 attribute(6)(User-Service): 0x2 attribute(7)(Framed-Protocol): 0x1*0.103982060-AAA-debug-Packet: attribute(13)(Framed-Compression): 0x1 attribute(10)(Framed-Routing): 0x1

大空闲时间和时长预付费

76

…… …… …… attribute(44)(Acct-Session-Id):03101407580000000102 attribute(45)(Acct-Authentic): 0x1 attribute(193)(Acct-Timestamp): 0x2957a attribute(55)(Event-Timestamp): 0x0 0x2 0x95 0x7a attribute(41)(Acct-Delay-Time): 0x0 attribute(87)(Nas-Port-Id):slot=10;subslot=0;port=0;VPI=1;VCI=32; attribute(6)(User-Service): 0x2 attribute(7)(Framed-Protocol): 0x1 attribute(42)(Acct-Input-Octets): 0x7fd4*0.169339520-AAA-debug-Packet: attribute(43)(Acct-Output-Octets): 0x6174 attribute(47)(Acct-Input-Packets): 0x122 attribute(48)(Acct-Output-Packets): 0x10e attribute(52)(Acct-Input-Gigawords): 0x0 attribute(53)(Acct-output-Gigawords): 0x0 attribute(46)(Acct-Session-Time): 0x12c

• Acct-Session-ID / Acct-Authentic::::

计费会话标识和用户认证方式

77