华为技术培训教程BA000004 Radius协议.ppt

上传人:仙人指路1688 文档编号:2432451 上传时间:2023-02-19 格式:PPT 页数:50 大小:1.09MB
返回 下载 相关 举报
华为技术培训教程BA000004 Radius协议.ppt_第1页
第1页 / 共50页
华为技术培训教程BA000004 Radius协议.ppt_第2页
第2页 / 共50页
华为技术培训教程BA000004 Radius协议.ppt_第3页
第3页 / 共50页
华为技术培训教程BA000004 Radius协议.ppt_第4页
第4页 / 共50页
华为技术培训教程BA000004 Radius协议.ppt_第5页
第5页 / 共50页
点击查看更多>>
资源描述

《华为技术培训教程BA000004 Radius协议.ppt》由会员分享,可在线阅读,更多相关《华为技术培训教程BA000004 Radius协议.ppt(50页珍藏版)》请在三一办公上搜索。

1、BA000004 Radius协议,掌握Radius协议的基本概念 掌握Radius协议的工作过程 掌握Radius包各个字段的含义,学习目标,标准RADIUS协议,RADIUS协议相关概念,概述,内容提要,NAS设备与Radius Server对接实例,概述,标准RADIUS协议,RADIUS协议相关概念,概述,内容提要,NAS设备与Radius Server对接实例,Radius:Remote Authentication Dial In User Service客户端负责将认证等信息按照协议的格式通过UDP包送到服务器,同时对服务器返回的信息解释处理。,认证端口号:1645/1812计费

2、端口号:1646/1813,Radius的作用,RADIUS的客户端通常运行于接入服务器(NAS)上,RADIUS服务器通常运行于一台工作站上,一个RADIUS服务器可以同时支持多个RADIUS客户(NAS)。RADIUS的服务器上存放着大量的信息,接入服务器(NAS)无须保存这些信息,而是通过RADUIS协议对这些信息进行访问。这些信息的集中统一的保存,使得管理更加方便,而且更加安全。RADIUS服务器可以作为一个代理,以客户的身份同其他的RADIUS服务器或者其他类型的验证服务器进行通信。用户的漫游通常就是通过RADIUS代理实现的。,Client/Server结构,NASRadius认证

3、计费过程,MD5是一个算法,它的输入是一段内存中的数值,输出是一个16字节的摘要,它的运算是单向的,即从输出推算不出输入。,不好意思,我只会把您的手表变成兔子,变不回去了,MD5,MD5算法,包加密16字节的验证字(authenticator)用于对包进行签名口令加密MD5算法对口令进行加密,网络安全,称共享密钥(key)为Key;16字节的认证请求验证字(Authenticator)为Auth;将口令(Password)分割成16字节一段(最后一段不足16字节时用0补齐),为p1、p2等;加密后的口令块为c(1)、c(2)等。下面运算中b1、b2为中间值:b1=MD5(Key+Auth)c(

4、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包中16字节的Authenticator,我们称其为“验证字”。认证请求包RequestAuth=Authenticator,认证请求包的验证字是一个不可预测的16字节随机数。这个随机数将用于口令的加密。认证响应包ResponseAuth=MD5(Code+ID+Length+Authenticator+Attributes+Key)。记费请

5、求包RequestAcct=MD5(Code+ID+Length+16ZeroOctets+Attributes+Key)。记费响应包ResponseAcct=MD5(Code+ID+Length+RequestAcct+Attributes+Key)。,包的签名与加密,我查我验,本地认证PAP,Secret Password=MD5(Chap ID+Password+challenge),我查我算我验,本地认证CHAP,如果用户配置了RADIUS验证,其PAP验证过程如下:,采用PAP验证:用户以明文的形式把用户名和他的密码传递给NAS。NAS把用户名和加密过的密码放到验证请求包的相应属性中

6、传递给RADIUS服务器,根据RADIUS服务器的返回结果来决定是否允许用户上网。,用户名、密码,放行,远端PAP认证,Secret password=Password XOR MD5(Challenge Key)(Challenge就是Radius报文中的Authenticator),我查我算我验,远端认证(Radius)PAP,远端PAP认证,Secret password=MD5(Chap ID+Password+challenge),我查我算我验,远端认证(Radius)CHAP,远端CHAP认证,Radius是一种流行的AAA协议,同时其采用的是UDP协议传输模式,AAA协议在协议栈

7、中位置如下:,Radius协议,Radius协议在协议栈中的位置,为什么使用UDP?NAS和RADIUS服务器之间传递的一般是几十至上百个字节长度的数据,用户可以容忍几秒到十几秒的验证等待时间。当处理大量用户时服务器端采用多线程,UDP简化了服务器端的实现过程。TCP是必须成功建立连接后才能进行数据传输的,这种方式在有大量用户使用的情况下实时性不好。当向主用服务器发送请求失败后,还要必须向备用的服务器发送请求。于是RADIUS要有重传机制和备用服务器机制,它所采用的定时,TCP不能很好的满足。,Radius协议选择UDP作为传输层协议,标准RADIUS协议,RADIUS协议相关概念,概述,内容

8、提要,NAS设备与Radius Server对接实例,Radius协议包结构,Code:包类型;1字节;指示RADIUS包的类型。Identifier:包标识;1字节;用于匹配请求包和响应包,同一组请求包和响应包的Identifier应相同。Length:包长度;2字节;整个包的长度。Authenticator:验证字;16字节;用于对包进行签名。,Radius协议包各个域解释,1 Access-Request请求认证过程 2 Access-Accept认证响应过程 3 Access-Reject认证拒绝过程 4 Accounting-Request请求计费过程 5 Accounting-Re

9、sponse计费响应过程,code域,NAS,Radius Server与NAS在全网中的位置,1、RADIUS的通信是用“请求-响应”方式进行的,即:客户发送一个请求包,服务器收到包后给予响应。2、RADIUS协议采用的是UDP协议,数据包可能会在网络上丢失,如果客户没有收到响应,那么可以重新发送该请求包。多次发送之后如果仍然收不到响应,RADIUS客户可以向备用的RADIUS服务器发送请求包。,NASRadius认证计费过程,包标识,用以匹配请求包和响应包。该字段的取值范围为0255;协议规定:1、在任何时间,发给同一个RADIUS服务器的不同包的Identifier域不能相同,如果出现相

10、同的情况,RADIUS将认为后一个包是前一个包的拷贝而不对其进行处理。2、Radius针对某个请求包的响应包应与该请求包在Identifier上相匹配(相同)。,Identifier域,整个包长度,包括:CodeIdentifierLengthAuthenticatorAttributes,Length域,该验证字分为两种:1、请求验证字-Request Authenticator 用在请求报文中,必须为全局唯一的随机值。2、响应验证字-Response Authenticator 用在响应报文中,用于鉴别响应报文的合法性。响应验证字MD5(Code+ID+Length+请求验证字+Attri

11、butes+Key),加密以后你还能认出我来吗?,Authenticator域,Attribute(1)属性,长度为10字节,b e n l a d e n,上网用户:张三上网地点:阿富汗,Attributes域,1 User-Name 用户名2User-Password 用户密码3Chap-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-Net

12、Mask 地址掩码10 Framed-Routing 为路由器用户设置的路由方式 11 Filter-Id 过滤表的名称12 Framed-MTU 为用户配置的最大传输单元,常用报文属性,属性值属性名称 意义,13 Framed-Compression 该连接使用压缩协议14 Login-IP-Host 对login用户提供的可连接主机的ip地址15 Login-Service 对login用户可提供的服务 16 Login-TCP-Port TCP服务端口18 Reply-Message 认证服务器返回用户的信息24 State 认证服务器发送challenge包时传送的需在接 下来的认证报

13、文中回应的字符串(与Acess-Challenge相关的属性)25 Class 认证通过时认证服务器返回的字符串信息,要求在该用户的计费报文中送给计费服务器,常用报文属性,属性值 属性名称 意义,26 Vendor-Specific 可扩展属性 27 Session-Timeout 在认证通过报文或Challenge报文中,通 知NAS该用户可用的会话时长(时长预付费)28 Idle-Timeout 允许用户空闲在线的最大时长32 NAS-Identifier 标识NAS的字符串33 Proxy-State NAS通过代理服务器转发认证报文时服务 器添加在报文中的属性60 Chap-Chall

14、enge 可以代替认证字字段传送challenge的属性61 Nas-Port-Type 接入端口的类型 62 Port-Limit 服务器限制NAS为用户开放的端口数,常用报文属性,属性值 属性名称 意义,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-Sessio

15、n-Time 用户在线时长47 Acct-Input-Packets 输入包数 48 Acct-Output-Packets 输出包数 49 Acct-Terminate-Case 用户下线原因 50 Acct-Multi_Session-Id 相关计费会话标识 51 Acct-Link-Count 生成计费记录时多连接会话的会话个数,常用报文属性,属性值 属性名称 意义,RADIUS 主要特性,RADIUS协议概述,基本概念,内容提要,RADIUS协议属性和Debug信息,ISN8850与Radius对接测试用例,*0.18993140-AAA-debug-Packet:send radiu

16、s 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):0 x4d 0 xa1 0 x11 0 xbe 0 xa7 0 xc5 0 x1a 0 xa4 0 x5b 0 x29 0 xb1 0 xde 0 x34 0 x11 0 x4c 0 xf9 attribute(6)(User-Service):0 x2 attribute(7)(Framed-Protoc

17、ol):0 x1 attribute(4)(NAS-IP-Address):0 xc0a80a0a attribute(32)(NAS-Identifier):ESR attribute(127)(Connect-Id):0 xf00000e*0.18993750-AAA-debug-Packet:attribute(61)(NAS-Port-Type):0 x5 attribute(128)(Connect-Port):ESR-10000010032vlan,认证请求(code=1),*0.18993900-AAA-debug-Packet:receive radius packet fro

18、m 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):0 x258 attribute(5)(NAS-Port):0 x1513d attribute(25)(Class):128 attribute(6)(User-Service):0 x2 attribute(7)(Framed-Protocol):0 x1 attribute(13)(Framed-Compression):0 x1 attribu

19、te(10)(Framed-Routing):0 x1*0.18994520-AAA-debug-Packet:attribute(11)(Framed-Filter):1,认证响应(code=2),*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):0 x1 attribute(32)(NAS-Name):ESR

20、 attribute(8)(Framed-Address):0 xa0a0a01 attribute(7)(Framed-Protocol):0 x1 attribute(1)(User-name):user1 attribute(5)(NAS-Port):0 x0 attribute(61)(NAS-Port-Type):0 x5 attribute(44)(Acct-Session-Id):03082027130000000011*0.18995400-AAA-debug-Packet:attribute(45)(Acct-Authentic):0 x1 attribute(193)(Ac

21、ct-Timestamp):0 x4a31 attribute(41)(Acct-Delay-Time):0 x0,计费开始,1RADIUS2Local3Remote,5Virtual,计费开始请求(code=4),*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,计费响应(code=5),*0.18993900-AAA-debug-Packet:receive

22、 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):0 xb4 attribute(5)(NAS-Port):0 x1513d attribute(25)(Class):128 attribute(2)(Password):0 x4e 0 x4f 0 x50 0 x41 0 x53 0 x53 0 x57 0 x44 attribute(6)(User-Service

23、):0 x2 attribute(7)(Framed-Protocol):0 x1 attribute(13)(Framed-Compression):0 x1 attribute(10)(Framed-Routing):0 x1*0.18994520-AAA-debug-Packet:attribute(11)(Framed-Filter):1,实时计费间隔为180秒,实时计费之认证响应(code=2),分解动作之一:*0.169338370-AAA-debug-Packet:send radius packet to 192.168.10.4:1813 code=4 id=31 lengt

24、h=207 e4 67 7f f5 9d ec b4 82 d6 15 35 5d ea bd b0 ac attribute(40)(Acct-Status-Type):0 x3 attribute(25)(Class):128 attribute(32)(NAS-Name):ESR attribute(8)(Framed-Address):0 xa0a0a01 attribute(7)(Framed-Protocol):0 x1 attribute(1)(User-name):user1 attribute(5)(NAS-Port):0 x28000060 attribute(61)(NA

25、S-Port-Type):0 x5,实时计费包,实时计费之计费请求(code=4),分解动作之二:*0.169338940-AAA-debug-Packet:attribute(44)(Acct-Session-Id):03101407580000000102 attribute(45)(Acct-Authentic):0 x1 attribute(193)(Acct-Timestamp):0 x2957a attribute(55)(Event-Timestamp):0 x0 0 x2 0 x95 0 x7a attribute(41)(Acct-Delay-Time):0 x0 attri

26、bute(87)(Nas-Port-Id):slot=10;subslot=0;port=0;VPI=1;VCI=32;attribute(6)(User-Service):0 x2 attribute(7)(Framed-Protocol):0 x1 attribute(42)(Acct-Input-Octets):0 x7fd4*0.169339520-AAA-debug-Packet:attribute(43)(Acct-Output-Octets):0 x6174 attribute(47)(Acct-Input-Packets):0 x122 attribute(48)(Acct-O

27、utput-Packets):0 x10e attribute(52)(Acct-Input-Gigawords):0 x0 attribute(53)(Acct-output-Gigawords):0 x0 attribute(46)(Acct-Session-Time):0 x12c,用户上传字节,用户下载字节,用户计费时长,实时计费之计费请求(code=4),*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

28、 76 32 cb db 49 3c a3 49 attribute(40)(Acct-Status-Type):0 x2 attribute(32)(NAS-Name):ESR attribute(8)(Framed-Address):0 xa0a0a01 attribute(7)(Framed-Protocol):0 x1 attribute(1)(User-name):user1 attribute(5)(NAS-Port):0 x0 attribute(61)(NAS-Port-Type):0 x5 attribute(44)(Acct-Session-Id):030820330900

29、00000014,计费结束,计费结束请求(code=4),分解动作之二:*0.19379900-AAA-debug-Packet:attribute(45)(Acct-Authentic):0 x1 attribute(193)(Acct-Timestamp):0 x4bb3 attribute(41)(Acct-Delay-Time):0 x0 attribute(49)(Acct-Terminate-Cause):0 x1 attribute(111)(Input-Kilobytes-Before-Tariff-Switch):0 x4 attribute(115)(Input-Kilob

30、ytes-After-Tariff-Switch):0 x4 attribute(112)(Output-Kilobytes-Before-Tariff-Switch):0 x0 attribute(116)(Output-Kilobytes-After-Tariff-Switch):0 x0*0.19380460-AAA-debug-Packet:attribute(113)(Input-Packets-Before-Tariff-Switch):0 x29 attribute(117)(Input-Packets-After-Tariff-Switch):0 x29 attribute(1

31、14)(Output-Packets-Before-Tariff-Switch):0 x0 attribute(118)(Output-Packets-After-Tariff-Switch):0 x0 attribute(72)(Time-Befor-Tariff-Switch):0 x1d attribute(73)(Time-After-Tariff-Switch):0 x1d,计费结束请求(code=4),*0.19380930-AAA-debug-Packet:receive radius packet from 192.168.10.4:1813 code=5 id=26 leng

32、th=20 18 98 f0 cd 92 45 59 12 51 c3 e 33 f6 68 4 f6,计费响应(code=5),*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):0 x69 0 x4 0 xf1 0 x8c 0 xeb 0 x81 0 x15 0 x71 0 xe

33、2 0 xd0 0 x15 0 xb0 0 x20 0 xee 0 x9a 0 x55*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,问题一:密码错误,*0.82897520-AAA-debug-Packet:send radi

34、us 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):0 x90 0 x5d 0 xe4 0 x8b 0 x9f 0 xbe 0 xb 0 x8c 0 xf7 0 xea 0 xc4 0 x17 0 xd6 0 x5 0 x9c 0 x23*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,问题二:非法用户,

展开阅读全文
相关资源
猜你喜欢
相关搜索
资源标签

当前位置:首页 > 建筑/施工/环境 > 项目建议


备案号:宁ICP备20000045号-2

经营许可证:宁B2-20210002

宁公网安备 64010402000987号