-
Notifications
You must be signed in to change notification settings - Fork 2
/
rfc
4259 lines (2717 loc) · 143 KB
/
rfc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
[Docs] [txt|pdf] [draft-ietf-radius...] [Diff1] [Diff2] [Errata]
Updated by: 2868, 3575, 5080, 6929 DRAFT STANDARD
Errata Exist
Network Working Group C. Rigney
Request for Comments: 2865 S. Willens
Obsoletes: 2138 Livingston
Category: Standards Track A. Rubens
Merit
W. Simpson
Daydreamer
June 2000
Remote Authentication Dial In User Service (RADIUS)
Status of this Memo
This document specifies an Internet standards track protocol for the
Internet community, and requests discussion and suggestions for
improvements. Please refer to the current edition of the "Internet
Official Protocol Standards" (STD 1) for the standardization state
and status of this protocol. Distribution of this memo is unlimited.
Copyright Notice
Copyright (C) The Internet Society (2000). All Rights Reserved.
IESG Note:
This protocol is widely implemented and used. Experience has shown
that it can suffer degraded performance and lost data when used in
large scale systems, in part because it does not include provisions
for congestion control. Readers of this document may find it
beneficial to track the progress of the IETF's AAA working group,
which may develop a successor protocol that better addresses the
scaling and congestion control issues.
Abstract
This document describes a protocol for carrying authentication,
authorization, and configuration information between a Network Access
Server which desires to authenticate its links and a shared
Authentication Server.
Implementation Note
This memo documents the RADIUS protocol. The early deployment of
RADIUS was done using UDP port number 1645, which conflicts with the
"datametrics" service. The officially assigned port number for
RADIUS is 1812.
Rigney, et al. Standards Track [Page 1]
RFC 2865 RADIUS June 2000
Table of Contents
1. Introduction .......................................... 3
1.1 Specification of Requirements ................... 4
1.2 Terminology ..................................... 5
2. Operation ............................................. 5
2.1 Challenge/Response .............................. 7
2.2 Interoperation with PAP and CHAP ................ 8
2.3 Proxy ........................................... 8
2.4 Why UDP? ........................................ 11
2.5 Retransmission Hints ............................ 12
2.6 Keep-Alives Considered Harmful .................. 13
3. Packet Format ......................................... 13
4. Packet Types .......................................... 17
4.1 Access-Request .................................. 17
4.2 Access-Accept ................................... 18
4.3 Access-Reject ................................... 20
4.4 Access-Challenge ................................ 21
5. Attributes ............................................ 22
5.1 User-Name ....................................... 26
5.2 User-Password ................................... 27
5.3 CHAP-Password ................................... 28
5.4 NAS-IP-Address .................................. 29
5.5 NAS-Port ........................................ 30
5.6 Service-Type .................................... 31
5.7 Framed-Protocol ................................. 33
5.8 Framed-IP-Address ............................... 34
5.9 Framed-IP-Netmask ............................... 34
5.10 Framed-Routing .................................. 35
5.11 Filter-Id ....................................... 36
5.12 Framed-MTU ...................................... 37
5.13 Framed-Compression .............................. 37
5.14 Login-IP-Host ................................... 38
5.15 Login-Service ................................... 39
5.16 Login-TCP-Port .................................. 40
5.17 (unassigned) .................................... 41
5.18 Reply-Message ................................... 41
5.19 Callback-Number ................................. 42
5.20 Callback-Id ..................................... 42
5.21 (unassigned) .................................... 43
5.22 Framed-Route .................................... 43
5.23 Framed-IPX-Network .............................. 44
5.24 State ........................................... 45
5.25 Class ........................................... 46
5.26 Vendor-Specific ................................. 47
5.27 Session-Timeout ................................. 48
5.28 Idle-Timeout .................................... 49
5.29 Termination-Action .............................. 49
Rigney, et al. Standards Track [Page 2]
RFC 2865 RADIUS June 2000
5.30 Called-Station-Id ............................... 50
5.31 Calling-Station-Id .............................. 51
5.32 NAS-Identifier .................................. 52
5.33 Proxy-State ..................................... 53
5.34 Login-LAT-Service ............................... 54
5.35 Login-LAT-Node .................................. 55
5.36 Login-LAT-Group ................................. 56
5.37 Framed-AppleTalk-Link ........................... 57
5.38 Framed-AppleTalk-Network ........................ 58
5.39 Framed-AppleTalk-Zone ........................... 58
5.40 CHAP-Challenge .................................. 59
5.41 NAS-Port-Type ................................... 60
5.42 Port-Limit ...................................... 61
5.43 Login-LAT-Port .................................. 62
5.44 Table of Attributes ............................. 63
6. IANA Considerations ................................... 64
6.1 Definition of Terms ............................. 64
6.2 Recommended Registration Policies ............... 65
7. Examples .............................................. 66
7.1 User Telnet to Specified Host ................... 66
7.2 Framed User Authenticating with CHAP ............ 67
7.3 User with Challenge-Response card ............... 68
8. Security Considerations ............................... 71
9. Change Log ............................................ 71
10. References ............................................ 73
11. Acknowledgements ...................................... 74
12. Chair's Address ....................................... 74
13. Authors' Addresses .................................... 75
14. Full Copyright Statement .............................. 76
1. Introduction
This document obsoletes RFC 2138 [1]. A summary of the changes
between this document and RFC 2138 is available in the "Change Log"
appendix.
Managing dispersed serial line and modem pools for large numbers of
users can create the need for significant administrative support.
Since modem pools are by definition a link to the outside world, they
require careful attention to security, authorization and accounting.
This can be best achieved by managing a single "database" of users,
which allows for authentication (verifying user name and password) as
well as configuration information detailing the type of service to
deliver to the user (for example, SLIP, PPP, telnet, rlogin).
Rigney, et al. Standards Track [Page 3]
RFC 2865 RADIUS June 2000
Key features of RADIUS are:
Client/Server Model
A Network Access Server (NAS) operates as a client of RADIUS. The
client is responsible for passing user information to designated
RADIUS servers, and then acting on the response which is returned.
RADIUS servers are responsible for receiving user connection
requests, authenticating the user, and then returning all
configuration information necessary for the client to deliver
service to the user.
A RADIUS server can act as a proxy client to other RADIUS servers
or other kinds of authentication servers.
Network Security
Transactions between the client and RADIUS server are
authenticated through the use of a shared secret, which is never
sent over the network. In addition, any user passwords are sent
encrypted between the client and RADIUS server, to eliminate the
possibility that someone snooping on an unsecure network could
determine a user's password.
Flexible Authentication Mechanisms
The RADIUS server can support a variety of methods to authenticate
a user. When it is provided with the user name and original
password given by the user, it can support PPP PAP or CHAP, UNIX
login, and other authentication mechanisms.
Extensible Protocol
All transactions are comprised of variable length Attribute-
Length-Value 3-tuples. New attribute values can be added without
disturbing existing implementations of the protocol.
1.1. Specification of Requirements
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
"SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
document are to be interpreted as described in BCP 14 [2]. These key
words mean the same thing whether capitalized or not.
An implementation is not compliant if it fails to satisfy one or more
of the must or must not requirements for the protocols it implements.
An implementation that satisfies all the must, must not, should and
Rigney, et al. Standards Track [Page 4]
RFC 2865 RADIUS June 2000
should not requirements for its protocols is said to be
"unconditionally compliant"; one that satisfies all the must and must
not requirements but not all the should or should not requirements
for its protocols is said to be "conditionally compliant".
A NAS that does not implement a given service MUST NOT implement the
RADIUS attributes for that service. For example, a NAS that is
unable to offer ARAP service MUST NOT implement the RADIUS attributes
for ARAP. A NAS MUST treat a RADIUS access-accept authorizing an
unavailable service as an access-reject instead.
1.2. Terminology
This document frequently uses the following terms:
service The NAS provides a service to the dial-in user, such as PPP
or Telnet.
session Each service provided by the NAS to a dial-in user
constitutes a session, with the beginning of the session
defined as the point where service is first provided and
the end of the session defined as the point where service
is ended. A user may have multiple sessions in parallel or
series if the NAS supports that.
silently discard
This means the implementation discards the packet without
further processing. The implementation SHOULD provide the
capability of logging the error, including the contents of
the silently discarded packet, and SHOULD record the event
in a statistics counter.
2. Operation
When a client is configured to use RADIUS, any user of the client
presents authentication information to the client. This might be
with a customizable login prompt, where the user is expected to enter
their username and password. Alternatively, the user might use a
link framing protocol such as the Point-to-Point Protocol (PPP),
which has authentication packets which carry this information.
Once the client has obtained such information, it may choose to
authenticate using RADIUS. To do so, the client creates an "Access-
Request" containing such Attributes as the user's name, the user's
password, the ID of the client and the Port ID which the user is
accessing. When a password is present, it is hidden using a method
based on the RSA Message Digest Algorithm MD5 [3].
Rigney, et al. Standards Track [Page 5]
RFC 2865 RADIUS June 2000
The Access-Request is submitted to the RADIUS server via the network.
If no response is returned within a length of time, the request is
re-sent a number of times. The client can also forward requests to
an alternate server or servers in the event that the primary server
is down or unreachable. An alternate server can be used either after
a number of tries to the primary server fail, or in a round-robin
fashion. Retry and fallback algorithms are the topic of current
research and are not specified in detail in this document.
Once the RADIUS server receives the request, it validates the sending
client. A request from a client for which the RADIUS server does not
have a shared secret MUST be silently discarded. If the client is
valid, the RADIUS server consults a database of users to find the
user whose name matches the request. The user entry in the database
contains a list of requirements which must be met to allow access for
the user. This always includes verification of the password, but can
also specify the client(s) or port(s) to which the user is allowed
access.
The RADIUS server MAY make requests of other servers in order to
satisfy the request, in which case it acts as a client.
If any Proxy-State attributes were present in the Access-Request,
they MUST be copied unmodified and in order into the response packet.
Other Attributes can be placed before, after, or even between the
Proxy-State attributes.
If any condition is not met, the RADIUS server sends an "Access-
Reject" response indicating that this user request is invalid. If
desired, the server MAY include a text message in the Access-Reject
which MAY be displayed by the client to the user. No other
Attributes (except Proxy-State) are permitted in an Access-Reject.
If all conditions are met and the RADIUS server wishes to issue a
challenge to which the user must respond, the RADIUS server sends an
"Access-Challenge" response. It MAY include a text message to be
displayed by the client to the user prompting for a response to the
challenge, and MAY include a State attribute.
If the client receives an Access-Challenge and supports
challenge/response it MAY display the text message, if any, to the
user, and then prompt the user for a response. The client then re-
submits its original Access-Request with a new request ID, with the
User-Password Attribute replaced by the response (encrypted), and
including the State Attribute from the Access-Challenge, if any.
Only 0 or 1 instances of the State Attribute SHOULD be
Rigney, et al. Standards Track [Page 6]
RFC 2865 RADIUS June 2000
present in a request. The server can respond to this new Access-
Request with either an Access-Accept, an Access-Reject, or another
Access-Challenge.
If all conditions are met, the list of configuration values for the
user are placed into an "Access-Accept" response. These values
include the type of service (for example: SLIP, PPP, Login User) and
all necessary values to deliver the desired service. For SLIP and
PPP, this may include values such as IP address, subnet mask, MTU,
desired compression, and desired packet filter identifiers. For
character mode users, this may include values such as desired
protocol and host.
2.1. Challenge/Response
In challenge/response authentication, the user is given an
unpredictable number and challenged to encrypt it and give back the
result. Authorized users are equipped with special devices such as
smart cards or software that facilitate calculation of the correct
response with ease. Unauthorized users, lacking the appropriate
device or software and lacking knowledge of the secret key necessary
to emulate such a device or software, can only guess at the response.
The Access-Challenge packet typically contains a Reply-Message
including a challenge to be displayed to the user, such as a numeric
value unlikely ever to be repeated. Typically this is obtained from
an external server that knows what type of authenticator is in the
possession of the authorized user and can therefore choose a random
or non-repeating pseudorandom number of an appropriate radix and
length.
The user then enters the challenge into his device (or software) and
it calculates a response, which the user enters into the client which
forwards it to the RADIUS server via a second Access-Request. If the
response matches the expected response the RADIUS server replies with
an Access-Accept, otherwise an Access-Reject.
Example: The NAS sends an Access-Request packet to the RADIUS Server
with NAS-Identifier, NAS-Port, User-Name, User-Password (which may
just be a fixed string like "challenge" or ignored). The server
sends back an Access-Challenge packet with State and a Reply-Message
along the lines of "Challenge 12345678, enter your response at the
prompt" which the NAS displays. The NAS prompts for the response and
sends a NEW Access-Request to the server (with a new ID) with NAS-
Identifier, NAS-Port, User-Name, User-Password (the response just
entered by the user, encrypted), and the same State Attribute that
Rigney, et al. Standards Track [Page 7]
RFC 2865 RADIUS June 2000
came with the Access-Challenge. The server then sends back either an
Access-Accept or Access-Reject based on whether the response matches
the required value, or it can even send another Access-Challenge.
2.2. Interoperation with PAP and CHAP
For PAP, the NAS takes the PAP ID and password and sends them in an
Access-Request packet as the User-Name and User-Password. The NAS MAY
include the Attributes Service-Type = Framed-User and Framed-Protocol
= PPP as a hint to the RADIUS server that PPP service is expected.
For CHAP, the NAS generates a random challenge (preferably 16 octets)
and sends it to the user, who returns a CHAP response along with a
CHAP ID and CHAP username. The NAS then sends an Access-Request
packet to the RADIUS server with the CHAP username as the User-Name
and with the CHAP ID and CHAP response as the CHAP-Password
(Attribute 3). The random challenge can either be included in the
CHAP-Challenge attribute or, if it is 16 octets long, it can be
placed in the Request Authenticator field of the Access-Request
packet. The NAS MAY include the Attributes Service-Type = Framed-
User and Framed-Protocol = PPP as a hint to the RADIUS server that
PPP service is expected.
The RADIUS server looks up a password based on the User-Name,
encrypts the challenge using MD5 on the CHAP ID octet, that password,
and the CHAP challenge (from the CHAP-Challenge attribute if present,
otherwise from the Request Authenticator), and compares that result
to the CHAP-Password. If they match, the server sends back an
Access-Accept, otherwise it sends back an Access-Reject.
If the RADIUS server is unable to perform the requested
authentication it MUST return an Access-Reject. For example, CHAP
requires that the user's password be available in cleartext to the
server so that it can encrypt the CHAP challenge and compare that to
the CHAP response. If the password is not available in cleartext to
the RADIUS server then the server MUST send an Access-Reject to the
client.
2.3. Proxy
With proxy RADIUS, one RADIUS server receives an authentication (or
accounting) request from a RADIUS client (such as a NAS), forwards
the request to a remote RADIUS server, receives the reply from the
remote server, and sends that reply to the client, possibly with
changes to reflect local administrative policy. A common use for
proxy RADIUS is roaming. Roaming permits two or more administrative
entities to allow each other's users to dial in to either entity's
network for service.
Rigney, et al. Standards Track [Page 8]
RFC 2865 RADIUS June 2000
The NAS sends its RADIUS access-request to the "forwarding server"
which forwards it to the "remote server". The remote server sends a
response (Access-Accept, Access-Reject, or Access-Challenge) back to
the forwarding server, which sends it back to the NAS. The User-Name
attribute MAY contain a Network Access Identifier [8] for RADIUS
Proxy operations. The choice of which server receives the forwarded
request SHOULD be based on the authentication "realm". The
authentication realm MAY be the realm part of a Network Access
Identifier (a "named realm"). Alternatively, the choice of which
server receives the forwarded request MAY be based on whatever other
criteria the forwarding server is configured to use, such as Called-
Station-Id (a "numbered realm").
A RADIUS server can function as both a forwarding server and a remote
server, serving as a forwarding server for some realms and a remote
server for other realms. One forwarding server can act as a
forwarder for any number of remote servers. A remote server can have
any number of servers forwarding to it and can provide authentication
for any number of realms. One forwarding server can forward to
another forwarding server to create a chain of proxies, although care
must be taken to avoid introducing loops.
The following scenario illustrates a proxy RADIUS communication
between a NAS and the forwarding and remote RADIUS servers:
1. A NAS sends its access-request to the forwarding server.
2. The forwarding server forwards the access-request to the remote
server.
3. The remote server sends an access-accept, access-reject or
access-challenge back to the forwarding server. For this example,
an access-accept is sent.
4. The forwarding server sends the access-accept to the NAS.
The forwarding server MUST treat any Proxy-State attributes already
in the packet as opaque data. Its operation MUST NOT depend on the
content of Proxy-State attributes added by previous servers.
If there are any Proxy-State attributes in the request received from
the client, the forwarding server MUST include those Proxy-State
attributes in its reply to the client. The forwarding server MAY
include the Proxy-State attributes in the access-request when it
forwards the request, or MAY omit them in the forwarded request. If
the forwarding server omits the Proxy-State attributes in the
forwarded access-request, it MUST attach them to the response before
sending it to the client.
Rigney, et al. Standards Track [Page 9]
RFC 2865 RADIUS June 2000
We now examine each step in more detail.
1. A NAS sends its access-request to the forwarding server. The
forwarding server decrypts the User-Password, if present, using
the shared secret it knows for the NAS. If a CHAP-Password
attribute is present in the packet and no CHAP-Challenge attribute
is present, the forwarding server MUST leave the Request-
Authenticator untouched or copy it to a CHAP-Challenge attribute.
'' The forwarding server MAY add one Proxy-State attribute to the
packet. (It MUST NOT add more than one.) If it adds a Proxy-
State, the Proxy-State MUST appear after any other Proxy-States in
the packet. The forwarding server MUST NOT modify any other
Proxy-States that were in the packet (it may choose not to forward
them, but it MUST NOT change their contents). The forwarding
server MUST NOT change the order of any attributes of the same
type, including Proxy-State.
2. The forwarding server encrypts the User-Password, if present,
using the secret it shares with the remote server, sets the
Identifier as needed, and forwards the access-request to the
remote server.
3. The remote server (if the final destination) verifies the user
using User-Password, CHAP-Password, or such method as future
extensions may dictate, and returns an access-accept, access-
reject or access-challenge back to the forwarding server. For
this example, an access-accept is sent. The remote server MUST
copy all Proxy-State attributes (and only the Proxy-State
attributes) in order from the access-request to the response
packet, without modifying them.
4. The forwarding server verifies the Response Authenticator using
the secret it shares with the remote server, and silently discards
the packet if it fails verification. If the packet passes
verification, the forwarding server removes the last Proxy-State
(if it attached one), signs the Response Authenticator using the
secret it shares with the NAS, restores the Identifier to match
the one in the original request by the NAS, and sends the access-
accept to the NAS.
A forwarding server MAY need to modify attributes to enforce local
policy. Such policy is outside the scope of this document, with the
following restrictions. A forwarding server MUST not modify existing
Proxy-State, State, or Class attributes present in the packet.
Rigney, et al. Standards Track [Page 10]
RFC 2865 RADIUS June 2000
Implementers of forwarding servers should consider carefully which
values it is willing to accept for Service-Type. Careful
consideration must be given to the effects of passing along Service-
Types of NAS-Prompt or Administrative in a proxied Access-Accept, and
implementers may wish to provide mechanisms to block those or other
service types, or other attributes. Such mechanisms are outside the
scope of this document.
2.4. Why UDP?
A frequently asked question is why RADIUS uses UDP instead of TCP as
a transport protocol. UDP was chosen for strictly technical reasons.
There are a number of issues which must be understood. RADIUS is a
transaction based protocol which has several interesting
characteristics:
1. If the request to a primary Authentication server fails, a
secondary server must be queried.
To meet this requirement, a copy of the request must be kept above
the transport layer to allow for alternate transmission. This
means that retransmission timers are still required.
2. The timing requirements of this particular protocol are
significantly different than TCP provides.
At one extreme, RADIUS does not require a "responsive" detection
of lost data. The user is willing to wait several seconds for the
authentication to complete. The generally aggressive TCP
retransmission (based on average round trip time) is not required,
nor is the acknowledgement overhead of TCP.
At the other extreme, the user is not willing to wait several
minutes for authentication. Therefore the reliable delivery of
TCP data two minutes later is not useful. The faster use of an
alternate server allows the user to gain access before giving up.
3. The stateless nature of this protocol simplifies the use of UDP.
Clients and servers come and go. Systems are rebooted, or are
power cycled independently. Generally this does not cause a
problem and with creative timeouts and detection of lost TCP
connections, code can be written to handle anomalous events. UDP
however completely eliminates any of this special handling. Each
client and server can open their UDP transport just once and leave
it open through all types of failure events on the network.
Rigney, et al. Standards Track [Page 11]
RFC 2865 RADIUS June 2000
4. UDP simplifies the server implementation.
In the earliest implementations of RADIUS, the server was single
threaded. This means that a single request was received,
processed, and returned. This was found to be unmanageable in
environments where the back-end security mechanism took real time
(1 or more seconds). The server request queue would fill and in
environments where hundreds of people were being authenticated
every minute, the request turn-around time increased to longer
than users were willing to wait (this was especially severe when a
specific lookup in a database or over DNS took 30 or more
seconds). The obvious solution was to make the server multi-
threaded. Achieving this was simple with UDP. Separate processes
were spawned to serve each request and these processes could
respond directly to the client NAS with a simple UDP packet to the
original transport of the client.
It's not all a panacea. As noted, using UDP requires one thing which
is built into TCP: with UDP we must artificially manage
retransmission timers to the same server, although they don't require
the same attention to timing provided by TCP. This one penalty is a
small price to pay for the advantages of UDP in this protocol.
Without TCP we would still probably be using tin cans connected by
string. But for this particular protocol, UDP is a better choice.
2.5. Retransmission Hints
If the RADIUS server and alternate RADIUS server share the same
shared secret, it is OK to retransmit the packet to the alternate
RADIUS server with the same ID and Request Authenticator, because the
content of the attributes haven't changed. If you want to use a new
Request Authenticator when sending to the alternate server, you may.
If you change the contents of the User-Password attribute (or any
other attribute), you need a new Request Authenticator and therefore
a new ID.
If the NAS is retransmitting a RADIUS request to the same server as
before, and the attributes haven't changed, you MUST use the same
Request Authenticator, ID, and source port. If any attributes have
changed, you MUST use a new Request Authenticator and ID.
A NAS MAY use the same ID across all servers, or MAY keep track of
IDs separately for each server, it is up to the implementer. If a
NAS needs more than 256 IDs for outstanding requests, it MAY use
Rigney, et al. Standards Track [Page 12]
RFC 2865 RADIUS June 2000
additional source ports to send requests from, and keep track of IDs
for each source port. This allows up to 16 million or so outstanding
requests at one time to a single server.
2.6. Keep-Alives Considered Harmful
Some implementers have adopted the practice of sending test RADIUS
requests to see if a server is alive. This practice is strongly
discouraged, since it adds to load and harms scalability without
providing any additional useful information. Since a RADIUS request
is contained in a single datagram, in the time it would take you to
send a ping you could just send the RADIUS request, and getting a
reply tells you that the RADIUS server is up. If you do not have a
RADIUS request to send, it does not matter if the server is up or
not, because you are not using it.
If you want to monitor your RADIUS server, use SNMP. That's what
SNMP is for.
3. Packet Format
Exactly one RADIUS packet is encapsulated in the UDP Data field [4],
where the UDP Destination Port field indicates 1812 (decimal).
When a reply is generated, the source and destination ports are
reversed.
This memo documents the RADIUS protocol. The early deployment of
RADIUS was done using UDP port number 1645, which conflicts with the
"datametrics" service. The officially assigned port number for
RADIUS is 1812.
Rigney, et al. Standards Track [Page 13]
RFC 2865 RADIUS June 2000
A summary of the RADIUS data format is shown below. The fields are
transmitted from left to right.
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
The Code field is one octet, and identifies the type of RADIUS
packet. When a packet is received with an invalid Code field, it
is silently discarded.
RADIUS Codes (decimal) are assigned as follows:
1 Access-Request
2 Access-Accept
3 Access-Reject
4 Accounting-Request
5 Accounting-Response
11 Access-Challenge
12 Status-Server (experimental)
13 Status-Client (experimental)
255 Reserved
Codes 4 and 5 are covered in the RADIUS Accounting document [5].
Codes 12 and 13 are reserved for possible use, but are not further
mentioned here.
Identifier
The Identifier field is one octet, and aids in matching requests
and replies. The RADIUS server can detect a duplicate request if
it has the same client source IP address and source UDP port and
Identifier within a short span of time.
Rigney, et al. Standards Track [Page 14]
RFC 2865 RADIUS June 2000
Length
The Length field is two octets. It indicates the length of the
packet including the Code, Identifier, Length, Authenticator and
Attribute fields. Octets outside the range of the Length field
MUST be treated as padding and ignored on reception. If the
packet is shorter than the Length field indicates, it MUST be
silently discarded. The minimum length is 20 and maximum length
is 4096.
Authenticator
The Authenticator field is sixteen (16) octets. The most
significant octet is transmitted first. This value is used to
authenticate the reply from the RADIUS server, and is used in the
password hiding algorithm.
Request Authenticator
In Access-Request Packets, the Authenticator value is a 16
octet random number, called the Request Authenticator. The
value SHOULD be unpredictable and unique over the lifetime of a
secret (the password shared between the client and the RADIUS
server), since repetition of a request value in conjunction
with the same secret would permit an attacker to reply with a
previously intercepted response. Since it is expected that the
same secret MAY be used to authenticate with servers in
disparate geographic regions, the Request Authenticator field
SHOULD exhibit global and temporal uniqueness.
The Request Authenticator value in an Access-Request packet
SHOULD also be unpredictable, lest an attacker trick a server
into responding to a predicted future request, and then use the
response to masquerade as that server to a future Access-
Request.
Although protocols such as RADIUS are incapable of protecting
against theft of an authenticated session via realtime active
wiretapping attacks, generation of unique unpredictable
requests can protect against a wide range of active attacks
against authentication.
The NAS and RADIUS server share a secret. That shared secret
followed by the Request Authenticator is put through a one-way
MD5 hash to create a 16 octet digest value which is xored with
the password entered by the user, and the xored result placed
Rigney, et al. Standards Track [Page 15]
RFC 2865 RADIUS June 2000
in the User-Password attribute in the Access-Request packet.
See the entry for User-Password in the section on Attributes
for a more detailed description.
Response Authenticator
The value of the Authenticator field in Access-Accept, Access-
Reject, and Access-Challenge packets is called the Response
Authenticator, and contains a one-way MD5 hash calculated over
a stream of octets consisting of: the RADIUS packet, beginning
with the Code field, including the Identifier, the Length, the
Request Authenticator field from the Access-Request packet, and
the response Attributes, followed by the shared secret. That
is, ResponseAuth =
MD5(Code+ID+Length+RequestAuth+Attributes+Secret) where +
denotes concatenation.
Administrative Note
The secret (password shared between the client and the RADIUS
server) SHOULD be at least as large and unguessable as a well-
chosen password. It is preferred that the secret be at least 16
octets. This is to ensure a sufficiently large range for the
secret to provide protection against exhaustive search attacks.
The secret MUST NOT be empty (length 0) since this would allow
packets to be trivially forged.
A RADIUS server MUST use the source IP address of the RADIUS UDP
packet to decide which shared secret to use, so that RADIUS
requests can be proxied.
When using a forwarding proxy, the proxy must be able to alter the
packet as it passes through in each direction - when the proxy
forwards the request, the proxy MAY add a Proxy-State Attribute,
and when the proxy forwards a response, it MUST remove its Proxy-
State Attribute if it added one. Proxy-State is always added or
removed after any other Proxy-States, but no other assumptions
regarding its location within the list of attributes can be made.
Since Access-Accept and Access-Reject replies are authenticated on
the entire packet contents, the stripping of the Proxy-State
attribute invalidates the signature in the packet - so the proxy
has to re-sign it.
Further details of RADIUS proxy implementation are outside the
scope of this document.
Rigney, et al. Standards Track [Page 16]
RFC 2865 RADIUS June 2000
4. Packet Types
The RADIUS Packet type is determined by the Code field in the first
octet of the Packet.
4.1. Access-Request
Description
Access-Request packets are sent to a RADIUS server, and convey
information used to determine whether a user is allowed access to
a specific NAS, and any special services requested for that user.
An implementation wishing to authenticate a user MUST transmit a
RADIUS packet with the Code field set to 1 (Access-Request).
Upon receipt of an Access-Request from a valid client, an
appropriate reply MUST be transmitted.
An Access-Request SHOULD contain a User-Name attribute. It MUST
contain either a NAS-IP-Address attribute or a NAS-Identifier
attribute (or both).
An Access-Request MUST contain either a User-Password or a CHAP-
Password or a State. An Access-Request MUST NOT contain both a
User-Password and a CHAP-Password. If future extensions allow
other kinds of authentication information to be conveyed, the
attribute for that can be used in an Access-Request instead of
User-Password or CHAP-Password.
An Access-Request SHOULD contain a NAS-Port or NAS-Port-Type
attribute or both unless the type of access being requested does
not involve a port or the NAS does not distinguish among its
ports.
An Access-Request MAY contain additional attributes as a hint to
the server, but the server is not required to honor the hint.
When a User-Password is present, it is hidden using a method based
on the RSA Message Digest Algorithm MD5 [3].
Rigney, et al. Standards Track [Page 17]
RFC 2865 RADIUS June 2000
A summary of the Access-Request packet format is shown below. The
fields are transmitted from left to right.
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 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| |
| Request Authenticator |
| |
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Attributes ...
+-+-+-+-+-+-+-+-+-+-+-+-+-
Code
1 for Access-Request.
Identifier
The Identifier field MUST be changed whenever the content of the
Attributes field changes, and whenever a valid reply has been
received for a previous request. For retransmissions, the
Identifier MUST remain unchanged.
Request Authenticator
The Request Authenticator value MUST be changed each time a new
Identifier is used.
Attributes
The Attribute field is variable in length, and contains the list
of Attributes that are required for the type of service, as well
as any desired optional Attributes.
4.2. Access-Accept
Description
Access-Accept packets are sent by the RADIUS server, and provide
specific configuration information necessary to begin delivery of