Introduction to the RADIUS protocol
Module Objetives · Identify the elements and architecture of remote access to networks · Understand the way the RADIUS protocol works · Get to know the attributes that control different type of access technologies (dial-up, ADSL, GPRS/UMTS, CDMA 2000, etc) · Way to code attributes and RADIUS packets, and the sense of a dictionary · Cover the standard statistical information provided over SNMP · View the extensions added to the RADIUS protocol 2 All Rights Reserved © Alcatel-Lucent 2007
AAA ·Authentication § Verify that a user really is who (s)he claims to be: Password, Token Cards, Calling number, X. 509 digital certificate, SIM card, etc. ·Authorization § Check that the user can access the service (s)he is trying to: Checking against a database, a file, etc. what the user can do, and restrict his/her access to the network ·Accounting § Write down what the user has done during his connection Connection time, bytes sent/received, access service, etc. § To get statistics about user accesses, billing, etc 3 All Rights Reserved © Alcatel-Lucent 2007
Switched connection diagram PPP IP POP NAS / RAS ROUTER PSTN Modem RADIUS AAA SERVER 4 ISP (Point of Presence) User Internet Web Server USER DB All Rights Reserved © Alcatel-Lucent 2007
Different ways for the AAA · Local accounts in the NAS/RAS § Only valid for small number of users § Not valid if any user can connect at any NAS We would have to provision all users in all NAS's · Proprietary software between NAS and an external server · Protocol RADIUS for a NAS to ask the server with centralized information about all users § Or its evolution: Diameter NASREQ application · Protocol TACACS (tacacs, tacacs+, xtacacs) § Not widely implemented, apart from Cisco 5 All Rights Reserved © Alcatel-Lucent 2007
RADIUS: Basic Principles · RADIUS is not the server itself, but the protocol to exchange information · Protocol to communicate between: § a RADIUS client Typically the NAS (= Network Access Server) § a remote AAA server · Standarized by the IETF (Internet Engineering Task Force) by several RFC’s: 2865 & 2866 § And enhanced in RFC’s: 2867, 2868 & 2869, 3576. . . · Adopted by all vendors of access devices, as almost the only standard for AAA · RADIUS stands-up for: § Remote Authentication Dial-In User Service 6 All Rights Reserved © Alcatel-Lucent 2007
Authentication Data. Flow Access. Request NAS Users Database User-Name: bob Password: ge 55 gep NAS-IP: 207. 12. 4. 1 Select User. ID=bob Access-Accept User. ID: bob Password: ge 55 gep Framed-IPAddress=217. 213. 21 RADIUS. 5 Session. Timeout=3600 Framed[other attributes] Address=217. 213. 21. 5 User dials modem pool and establishes connection 7 Server Bob password=ge 55 gep Timeout = 3600 [other attributes] Internet PPP connection established All Rights Reserved © Alcatel-Lucent 2007
Accounting Data. Flow (Start) Sun May 10 20: 47: 41 1998 Acct-Status-Type = Start User-Name = bob Framed. Address=217. 213. 21. 5 … Account-Request NAS Acct-Status-Type = Start User-Name = bob Framed-Address = 217. 213. 21. 5 … Acknowledgement RADIUS ISP Accounting Database Server Internet PPP session The Accounting “Start” Record 8 All Rights Reserved © Alcatel-Lucent 2007
Accounting Data. Flow (Stop) Sun May 10 20: 50: 49 1998 Acct-Status-Type = Stop User-Name = bob Acct-Session-Time = 1432 …. . . Account-Request NAS Acct-Status-Type = Stop User-Name = bob Acct-Session-Time = 1432 Acknowledgement RADIUS server Internet The user disconnects The Accounting “Stop” Record 9 All Rights Reserved © Alcatel-Lucent 2007 ISP Accounting Database
Fault Tolerance • Based on retransmissions by the Radius Client The first RADIUS server The NAS selectsrouterand The reply selects thethe The NAS is the third The NAS received get request does not replies but selects first RADIUSserver second. RADIUS ends list to the server onserver the transaction the RADIUS server drops the reply Radius Servers List Authentication Accounting Auth_Timer Acct_Timer 10. 0. 1. 1 1) 10. 0. 1. 3 3 10 10. 0. 1. 2 2) 10. 0. 1. 4 3 10 10. 0. 1. 3 3) 10. 0. 1. 5 3 10 * 10 All Rights Reserved © Alcatel-Lucent 2007 10. 0. 1. 1 The retransmission strategy is not standardized: * some NAS’s fail over to another 10. 0. 1. 2 RADIUS server as soon as a timeout occurs * some NAS’s retry 1 or 2 times to the same RADIUS server 10. 0. 1. 3 before failing over
Information from NAS -> server for authentication · Information related to RADIUS client (NAS) § NAS-Ip-Address, or unique identification (NAS-Id) · Information to authenticate the user connecting: § User-Name & Password · Information about the connection itself (for authorization): § Calling number, called number (or APN for GPRS/UMTS), § Modem/port taking the connection (NAS-Port) § Type of session (PPP, SLIP, . . . ) § Type of connection (POTS, ISDN, ADSL, UMTS, GPRS, etc. ) 11 All Rights Reserved © Alcatel-Lucent 2007
Authentication process in the server (I) · 1. - Decode the user's password (it travels encrypted) § Using the "shared secret key", known both by client and server · 2. - Search the user connection profile in: § § § Plain text file External SQL database LDAP server /etc/passwd file in UNIX User accounts in Windows Domains Etc. · 3. - Authenticate the user 12 All Rights Reserved © Alcatel-Lucent 2007
Authentication process in the server (& II) · 4. - Optionally, check extra data (check-items) § § Type of connection (POTS, ISDN, ADSL, cable, UMTS, etc. ) Time of day Calling number, called number etc. · 5. - Send Accept/Reject to the NAS with the right attibutes for this user session (reply-items) § § § 13 Idle and session timeout IP filters for this user Indication of IP address to assign to user For ISDN, max. number of channels to bond together (MLPPP) etc. All Rights Reserved © Alcatel-Lucent 2007
Communication UDP ports · Communication between client and server is done over UDP/IP · RADIUS authentication and accounting servers are listening on 2 different ports § Servers can listen on any port, but it is advisable to use the standard ones (defined in RFC's) UDP Ports Authentication Accounting New 1812 1813 Old 1645 1646 · RADIUS clients can send requests on any source UDP port they have available. Not limited in RFC's § All requests need not come from same port, and usually don´t § Though NAS's can be configured to send all request with the same source UDP port Only advisable for firewall restrictions 14 All Rights Reserved © Alcatel-Lucent 2007
¿Why UDP? · In RADIUS it is not necessary the retransmision feature provided by TCP § If client doesn´t get an answer, it sends another one to a secondary server § The response to a retransmitted TCP request, could arrive too late · Simplifies server implementation § Specially for multi-threaded servers · Reduces network traffic § UDP has less overhead than TCP § UDP needs not establish a session before sending data 15 All Rights Reserved © Alcatel-Lucent 2007 R F C 2 8 6 5
PPP overview and traditional authentication methods · This Point-to-Point Protocol (PPP) allows sending several protocols above its headers · The establishment of the PPP link requires certain handshaking. § LCP - Link Control Messages To determine MLPPP, the MTU and decide the authentication algorithm for the user § Authentication - It will depend on the protocol used: PAP, CHAP, MSCHAPv 2, EAP During this stage, the RADIUS server is contacted by the NAS § NCP - Network Control Protocol, to negotiate extra parameters IPCP, the IP address assigned to the user CCP, if the data is going to be compressed ECP, if the data is going to be encrypted 16 All Rights Reserved © Alcatel-Lucent 2007
Password Authentication Protocol (PAP) · The password travels in the clear (unencrypted) § The password can be stored hashed in the RADIUS server · Users credentials are verified only once § At the beginning of the connection Initiator Responder RADIUS server PAP-Auth-Request #1 (Name=jsmith, Passwd=red) Access-Request User-Name=jsmith User-Password=red PAP-Auth-Success #1 (Message="00") PAP-Auth-Failure #1 (Message="Incorrect Password") 17 All Rights Reserved © Alcatel-Lucent 2007 Access-Accept Access-Reject
Challenge Handshake Authentication Protocol (CHAP) · User password is hashed using MD 5 and a random challenge generated by the NAS (PPP responder) § The password cannot be stored hashed in the RADIUS server · Optionally, the user can be authenticated several times during the lifetime of the session Initiator Responder CHAP-Auth-Challenge #1 (Chall. Length=16, Challenge Value= 0 c 7 d 203. . a 8, Name= tnt 2) Auth-Response #1 (Chall. Length=16, Challenge Value= 016 b 89. . 91, Name= john) RADIUS server Access-Request User-Name=john CHAP-Password=016 b 89. . 91 [CHAP-Challenge*=0 c 7 d 203. . . a 8] CHAP-Auth-Success #1 (Message="00") CHAP-Auth-Failure #1 (Message="Incorrect Password") 18 All Rights Reserved © Alcatel-Lucent 2007 Access-Accept Access-Reject
LCP handshaking · In the LCP handshaking, the user and the NAS determine the authentication protocol to use: § The user may accept the proposal from the server § The user may reject the server proposal, and expect to receive a new proposal Initiator Responder Authenticator Config-Request #1 (MRU=1524, auth=PAP, . . . ) Config-Ack #2 (MRU=1524, auth=PAP, . . . ) Config-Request #1 (MRU=1524, auth=PAP, . . . ) Config-Reject #1 (auth=PAP) Config-Request #2 (MRU=1524, auth=CHAP/MD 5) Config-Ack #2 (MRU=1524, auth=CHAP/MD 5) 19 All Rights Reserved © Alcatel-Lucent 2007
Hashing of password · The user password can only be hashed once (MD 5, SHA 1, etc) § either at database storage or when the user transmits it As the hash algorithms are not reversible § However, passwords can be stored encrypted (3 DES, AES, …) User password typed in this connection attempt PAP | CHAP User password provisioned for this user Read from database, text file, . . Sent from NAS Stored in the users’ database (text file, SQL, LDAP, etc) In the clear Auth. algorithm used PAP, telnet/SSH. . . {User-Password(2)} CHAP, Eap-MD 5. . . Hashed (MD 5, SHA 1) OK OK OK X {Chap-Password(3), . . . } 20 All Rights Reserved © Alcatel-Lucent 2007
RADIUS packet format 1 -4 Type 3 2 1 Identifier 21 -. . . Length Attributes Identifies the packet, along with source IP address and UDP port. Used to detect duplicate packets 21 bytes Authenticator 5 -20 * 4 Length of RADIUS packet 20 < length < 4096 bytes - In auth requests: to encrypt user password using the shared secret key (usually a random value) - In replies and accounting: to authenticate the message itself. Similar to a digital signature All Rights Reserved © Alcatel-Lucent 2007
RADIUS packet types · Access-Request (1) - Authentication requests from NAS to server · Access-Accept (2) - Response from server to NAS accepting the user session · Access-Reject (3) - Response from server to NAS rejecting the user session · Access-Challenge (11) - Request form server to NAS, asking for additional info from the user § Used in token/crypto cards, and for EAP · Account-Request (4) - The NAS sends accounting information to the server · Account-Response (5) - The server ACKs the acct packet to the NAS 22 All Rights Reserved © Alcatel-Lucent 2007 R F C 2 8 6 5
Authenticator field in auth · The ‘Authenticator’ field serves to 2 purposes depending if it is a request or an accept/reject § Encryption of some attributes: User-Password § Server authentication Client Server Authenticator field Random num. Hash MD 5 Shared key XOR PAP Passwd(clear text) Request Authenticator Shared key Hash MD 5 Response packet (without authenticator) 23 X Discard packet Hash MD 5 Attrib. User-Password XOR Access-Request Authenticator Field Clear Passwd Request Authenticator Hash MD 5 Access-Accept/Reject Match? Server Authenticated All Rights Reserved © Alcatel-Lucent 2007 Shared key Response packet (without authenticator)
Authenticator field in acct · For accounting the authenticator only provides: Authentication of client and server – Similar to a digital signature Client Server Acct packet (without authenticator) Hash MD 5 Authenticator field Shared key Match? Discard Request Authenticator Shared key Hash MD 5 Acct packet (without authenticator) X Discard packet 24 Acct packet Account-Request Authenticator field Account-Response Match? Authenticated All Rights Reserved © Alcatel-Lucent 2007 (without authenticator) Shared key X Client Authenticated Request Authenticator Hash MD 5 Shared key Acct packet (without authenticator)
Example of successful auth: Dial-in user with PAP Access-Request (1) - ID=1 User-Name (1) = ”pepe" User-Password (2) = 5 E%&gn)8 NAS-IP-Address (4) = 192. 168. 20. 2 NAS-Port (5) = 20 Service-Type (6) = Framed (2) Framed-Protocol (7) = PPP (1) NAS-Port-Type (61) = Async (0) Called-Station-Id (30) = 917529000 Calling-Station-Id (31) = 918078419 RADIUS client - NAS- PSTN POTS Modem IP RADIUS server Access-Accept (2) - ID=1 Service-Type (6) = Framed (2) Framed-Protocol (7) = PPP (1) Framed-IP-Address (8) = 255. 254 Framed-IP-Netmask (9) = 255 Framed-Routing (10) = None (0) Framed-Compression (13) = VJ TCP/IP (1) Framed-MTU (12) = 1500 Session-Timeout (27) = 7200 * 25 All Rights Reserved © Alcatel-Lucent 2007
Example of an PPPo. A (ADSL) connection Access-Request (1) - ID=1 For ADSL with PPPo. A, there is no Called-Station-Id or Calling-Station Id. For PPPo. E, they represent the Ethernet MAC addresses User-Name = "user 11@aunadsl" CHAP-Password = "