Authentication, Authorization and Accounting (AAA)

AAA answers three questions at every login: authentication, who is the user; authorization, what may the user do; and accounting, what did the user do. A central AAA server holds the users and policies, so every router and switch asks one place. Devices talk to it with TACACS+, one vendor's protocol over TCP 49, or RADIUS, the standard over UDP.

In Daveth Pro (Network)16 min video

By , founder of Daveth · Updated

Opening frame of the video walkthrough of Authentication, Authorization and Accounting (AAA)

Watch this lesson

16 min · Video walkthrough

In Daveth Pro (Network)

The full 16 min walkthrough is in Daveth Pro (Network). See what the plan opens

What this page answers

What is AAA (authentication, authorization and accounting)?

Three questions at every login: who is the user, what is the user allowed to do, and a record of what the user did. Together they are AAA, said triple-A. Read it in “Three questions at every login”

What is the difference between TACACS+ and RADIUS?

TACACS+ is one vendor's protocol over TCP port 49 that keeps the three functions separate. RADIUS is standards-based, over UDP ports 1812 and 1813, and combines authentication and authorization. Read it in “TACACS+ or RADIUS”

Three questions at every login

Wednesday, month seven. Lena spends the morning at the branch with Jo, and asks about BR1: "Who can change this router? And if someone did, how would you know who?" Today the honest answer is short. BR1's vty lines still take Telnet with one shared password, set in month three and given to Jo, so that Jo could read the interface labels, and to the fibre installer, to test the link. Lena adds BR1 to Monday's list, next to R1. Everyone who knows the password looks the same to BR1.

Network drawing: the branch, the office, head office, Jo, BSW1, BR1, R1, R3, HQD, RAD1

Jo at the branch, through BSW1 to BR1; BR1's fibre to R1 at the office, R1 to R3 at head office, and RAD1, the AAA server, on HQD. BR1's backup line to R3 is left out.

Lena's question has three parts, and each has a name. Together they are AAA: authentication, authorization and accounting, said "triple-A".

  • Authentication: who is the user?
  • Authorization: what is the user allowed to do?
  • Accounting: what did the user do?

AAA manages what users do on systems and through them. It uses standardized methods to ask users for their credentials before access is allowed or authorized, and accounting records what they then do. It is commonly used to control and monitor logins to network devices: routers, switches, firewalls.

BR1 already does a crude version of the first two. The password on its console and vty lines authenticates, after a fashion: anyone who knows it logs in, with user-level (EXEC) rights, and the enable secret authorizes a higher level. But the password proves that someone knew it, not who they were. If someone changed the configuration or reloaded the router, you might never know who. A username fixes that (02.7, 08.1.2): the log message a router writes when someone leaves configuration mode then names the person, as in "Configured from console by maya on vty0" (console here just means the command line; vty0 is the SSH or Telnet line maya used). But usernames kept on each router mean every person on every router. A new colleague is added everywhere, a changed password is changed everywhere, and when someone leaves, somebody has to remember every device they were on.

If you've ever stayed in a hotel, you've met all three: the front desk checks your ID, your key card opens your room and the gym but not the kitchen, and the lock system logs every swipe. (Where it stops: once a hotel card is programmed, each lock decides alone. A router asks the central server again, every time.)

One server for every router

The answer that scales is AAA that is centralized, standardized, resilient and flexible: a central AAA server. It holds a database of the users and their passwords, and the policies saying what each user may do. People come and go, and their accounts change in one place; every router and switch asks the server, so each gets up-to-date information about the user. The server can also make people change their passwords regularly, let them do it themselves, cut someone off the day they leave, and ask for more than one factor (08.1.1). Each login costs the router a little extra work, asking the server, but the day-to-day administration of usernames and passwords becomes much lighter, and many production networks run their switches and routers this way. It is why 08.1.2 ended where it did: wherever a server can check a login, let it, and keep the passwords on the devices down to the few you can't avoid.

The company already has one. RAD1, at head office on VLAN 98, has answered the Wi-Fi controller's questions about Staff logins since month two (03.5.3). Ravi's plan starts with BR1, this afternoon: logins to BR1 move to SSH and are checked by RAD1, where maya and ravi have full rights and jo can run show commands only. Jo can still read the labels; writing new ones now means asking Maya, which Jo is taking well. The shared password goes. R1 and R3 follow next week.

RAD1 got its name from its first job, and kept it when it got the second, the way people keep theirs after a promotion.

Each side has a set role. BR1 is the AAA client, called a network access device (NAD) or network access server (NAS): it asks the user for credentials, passes them to the server, and acts on the reply. The server has three possible replies.

Accept lets the user in. Reject refuses them. Challenge means the server wants more credentials before it decides, as in multifactor authentication: RAD1 isn't set up for a second factor yet, so the middle button is a what-if.

Network drawing: Jo logs in to BR1. BR1 never decides alone: it passes the username and password to RAD1 and relays the answer.

Each leg has its own protocol. Between Jo and BR1 it's SSH, which needs a username login (08.1.2); Telnet would also carry it, as clear text. Between BR1 and RAD1 it's TACACS+ or RADIUS, and both encrypt the password on the way.

TACACS+ or RADIUS

On the server's leg there are two choices. AAA servers usually speak two protocols to the routers, switches and controllers that ask them, and they differ in ways that matter for BR1.

TACACS+RADIUS
Defined byproprietary: one vendor's own protocolstandards-based
The three functionskeeps authentication, authorization and accounting separatecombines authentication and authorization
Carried overTCP port 49UDP port 1812, and 1813 for accounting
Encryptionsecure and encryptednot completely encrypted: the password is, the whole message isn't
Typical useoften logins to routers and switches, with a decision per commandcommon for network access, such as 802.1x on Wi-Fi

TACACS+ keeps the three functions separate, so a router can ask about the login, then ask again about each command, then send a record of it: the fine-grained control that logins to routers and switches want. RADIUS, the standard, combines authentication and authorization into one, and is common for network access, such as 802.1x on Staff Wi-Fi (03.5.3). RAD1, like most AAA servers, speaks both: Wi-Fi keeps RADIUS, and BR1's logins use TACACS+. Be exact about encryption: TACACS+ encrypts the body of each message, while RADIUS encrypts the password but not the whole message. Neither one protects a password written on a sticky note.