How RADIUS Works: Network Authentication, Authorization, and Accounting

Remote Authentication Dial-In User Service (RADIUS) is a networking protocol that provides centralized authentication, authorization, and accounting (AAA) for users connecting to a network. When you connect to a corporate Wi-Fi network and enter your username and password, when you authenticate to a VPN, or when an ISP verifies your broadband credentials, RADIUS is almost certainly the protocol brokering that authentication. Defined in RFC 2865 (2000) with roots going back to 1991, RADIUS remains the most widely deployed AAA protocol in networking — handling billions of authentication requests daily across enterprise networks, ISPs, and wireless carriers worldwide.

The AAA Model

RADIUS implements the three pillars of network access control:

The key insight is centralization. Without RADIUS, every network switch, wireless access point, and VPN concentrator would need its own user database. With RADIUS, all authentication decisions are made by a central server (or cluster of servers), and network devices simply act as relays between the user and the RADIUS server.

RADIUS Architecture

RADIUS uses a client-server model with three actors:

RADIUS Authentication Flow Supplicant (Laptop/Phone) NAS / AP (RADIUS Client) RADIUS Server (FreeRADIUS, NPS) User Store (LDAP/AD) 1. User credentials 2. Access-Request 3. LDAP Bind / query 4. Bind result + attrs 5. Access-Accept + VLAN, ACL 6. Network access granted EAP/802.1X UDP 1812 TCP 389/636

RADIUS Packet Types

RADIUS communication uses UDP (port 1812 for authentication, port 1813 for accounting). The protocol defines several packet types:

Authentication Packets

Accounting Packets

The Shared Secret

RADIUS uses a shared secret — a pre-configured password known to both the NAS and the RADIUS server — to authenticate communication between them and to encrypt sensitive attributes. This is separate from the user's password.

The shared secret serves two purposes:

  1. Password encryption — The user's password in an Access-Request is XORed with an MD5 hash derived from the shared secret and the request authenticator (a random 16-byte value). This is not strong encryption by modern standards.
  2. Response authentication — The server computes a Response Authenticator by hashing the response packet content with the shared secret. The NAS verifies this hash to ensure the response came from the legitimate RADIUS server and was not tampered with.

The shared secret model has known weaknesses. If the shared secret is weak (short or predictable), an attacker who captures RADIUS packets can perform offline dictionary attacks to recover it. Once the shared secret is compromised, the attacker can decrypt user passwords and forge RADIUS responses. This is why strong, randomly generated shared secrets (at least 16 characters) are essential, and why modern deployments increasingly use TLS-based alternatives (RADIUS over TLS, or RadSec).

Attribute-Value Pairs

RADIUS packets carry data in Attribute-Value Pairs (AVPs). Each attribute has a type number, length, and value. Standard attributes are defined in RFC 2865 and RFC 2866, with many vendor-specific extensions. Important attributes include:

EAP: Extensible Authentication Protocol

For modern network authentication, simple username/password (PAP/CHAP) is insufficient. EAP (RFC 3748) is a framework that runs within RADIUS, enabling sophisticated authentication methods without changing the RADIUS protocol itself. EAP packets are encapsulated in RADIUS Access-Request and Access-Challenge messages using the EAP-Message attribute.

Common EAP methods include:

PEAP Authentication (EAP inside RADIUS) RADIUS (UDP 1812) EAP (in EAP-Message attribute) TLS Tunnel (PEAP outer layer) Inner Authentication EAP-MSCHAPv2 (username + password challenge/response) Protected by TLS — not visible to NAS or network NAS forwards EAP-Message attributes between supplicant and RADIUS server — it never sees the inner credentials

802.1X Integration

The most important use of RADIUS today is IEEE 802.1X port-based network access control. 802.1X is the framework; RADIUS is the backend. Together they control access to wired and wireless networks.

In an 802.1X deployment:

  1. The supplicant (client device) connects to the network. The switch or access point blocks all traffic except EAP/802.1X frames.
  2. The authenticator (switch/AP) initiates EAP by sending an EAP-Request/Identity message.
  3. The supplicant responds with its identity (username or machine name).
  4. The authenticator encapsulates the EAP response in a RADIUS Access-Request and forwards it to the RADIUS server.
  5. The RADIUS server and supplicant exchange EAP messages (via the authenticator) to complete authentication — potentially involving multiple Access-Challenge/Request round trips for methods like PEAP.
  6. On success, the RADIUS server sends an Access-Accept with VLAN assignment and other authorization attributes. The authenticator opens the port and applies the authorized configuration.
  7. On failure, the RADIUS server sends an Access-Reject. The authenticator keeps the port blocked or places the device in a restricted guest VLAN.

This architecture means the authenticator never sees the user's credentials — it simply tunnels EAP packets between the supplicant and the RADIUS server. This is a crucial security property: a compromised access point cannot steal user passwords.

RADIUS Proxy and Roaming

RADIUS supports proxy chains where a RADIUS server forwards requests to another RADIUS server. This is essential for several use cases:

Proxy decisions are typically based on the realm — the domain portion after the @ in the username. The RADIUS server maintains a realm routing table mapping domains to upstream RADIUS servers.

RADIUS vs. TACACS+

TACACS+ (Terminal Access Controller Access-Control System Plus) is an alternative AAA protocol developed by Cisco. While RADIUS dominates network access authentication, TACACS+ is preferred for device administration — controlling who can log into network equipment (routers, switches, firewalls) and what commands they can execute.

Many organizations run both: RADIUS for user network access (Wi-Fi, VPN) and TACACS+ for network device administration.

RADIUS Accounting in Practice

RADIUS accounting provides detailed records of network usage. Accounting packets include attributes like:

ISPs use accounting data for usage-based billing. Enterprises use it for compliance auditing (tracking who accessed the network, when, and from where), security incident investigation, and capacity planning.

RadSec: RADIUS over TLS

Traditional RADIUS has significant security limitations: UDP provides no connection state, the shared secret mechanism is weak, and most of the packet is not encrypted. RadSec (RFC 6614) addresses these by running RADIUS over TLS.

RadSec provides:

RadSec is particularly important for proxy chains (like eduroam) where RADIUS packets traverse untrusted networks between institutions.

Security Considerations

RADIUS and Network Infrastructure

RADIUS is deeply embedded in network infrastructure:

Relevant RFCs

See It in Action

RADIUS infrastructure runs on networks routed via BGP. Explore the networks behind major authentication services using the god.ad BGP Looking Glass:

See BGP routing data in real time

Open Looking Glass
More Articles
How TLS/HTTPS Works: Securing the Internet's Traffic
Certificate Transparency: How CT Logs Secure the Web's PKI
How Firewalls Work: Packet Filtering, Stateful Inspection, and Beyond
What is Cross-Site Scripting (XSS)?
What is Cross-Site Request Forgery (CSRF)?
What is Server-Side Request Forgery (SSRF)?