> For the complete documentation index, see [llms.txt](https://docs.cennso.com/components/smc/latest/llms.txt) (all documentation: [llms.txt](https://docs.cennso.com/llms.txt)). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.cennso.com/components/smc/latest/guides/aaa/overview.md).

# AAA Configuration Overview

> [!IMPORTANT]
> The SMC helm chart uses the `aaa` configuration section for multiple distinct concerns. This document clarifies the differences and provides a navigation guide through the documentation structure.

## Understanding the Three Concerns

The `aaa` configuration section in SMC encompasses three fundamentally different concerns that have been historically grouped together due to their use of common infrastructure:

### 1. True AAA (Authentication, Authorisation, Accounting)

AAA protocols provide identity and session management for network access:

- **RADIUS** - Remote Authentication Dial-In User Service ([IETF RFC 2865](https://www.rfc-editor.org/rfc/rfc2865.html), [RFC 2866](https://www.rfc-editor.org/rfc/rfc2866.html))
- **Diameter NASREQ** - Network Access Server Requirements ([IETF RFC 7155](https://www.rfc-editor.org/rfc/rfc7155.html))

**Purpose:** Verify user identity (`Who are you?`), control access (`What can you access?`), and track usage (`How much did you use?`).

**Use cases:**
- Authenticate subscribers before network access
- Verify device credentials (IMEI/IMEISV)
- Track session establishment and termination for security auditing
- Generate usage records for network operations (not billing)

### 2. Policy Control

Policy interfaces govern how traffic is treated within the network:

- **Gx** - Diameter-based policy control for 4G (3GPP TS 29.212)
- **Npcf** - HTTP/2-based policy control for 5G (3GPP TS 29.512)
- **PCC Rules** - Unified policy rule abstraction layer

**Purpose:** Apply traffic policies, QoS parameters, and service authorisation decisions to user sessions.

**Use cases:**
- Enforce quality of service (QoS) parameters
- Apply bandwidth limits per service
- Control which applications or services users can access
- Install dynamic rules based on subscriber profile or network conditions

### 3. Charging

Charging interfaces enable revenue collection and quota management:

- **Rf** - Diameter offline charging for CDR generation (3GPP TS 32.299)
- **Ro** - Diameter online charging for real-time credit control (3GPP TS 32.299)
- **RADIUS Accounting** - Usage tracking for billing systems

**Purpose:** Collect billing information and manage subscriber credit in real-time.

**Use cases:**
- Generate Call Detail Records (CDRs) for offline billing
- Enforce prepaid quotas with online charging
- Collect usage data per rating group for differentiated billing
- Integrate with Online Charging System (OCS) or Billing Systems

## Why Are These Mixed Under `aaa`?

The ergw AAA framework (`ergw_aaa` application) provides common infrastructure for all three concerns:

1. **Unified Transport Management** - Diameter and RADIUS connection handling
2. **Session Lifecycle Hooks** - Start, Interim, Stop phases
3. **Handler Abstraction** - Common pattern for protocol implementations
4. **Configuration Structure** - Shared settings for procedures and applications

Historically, these concerns evolved from simple AAA systems, and the architecture reflects this heritage. While conceptually distinct, they share:
- Transport protocols (Diameter, RADIUS)
- Message sequencing patterns (Start → Interim → Stop)
- Server connection management
- Rate limiting and resilience mechanisms

The helm chart configuration uses `aaa.*` as the namespace for all of these because they are implemented within the same ergw AAA framework.

## Documentation Navigation

Follow this recommended order for the best understanding:

### Start Here: Common Infrastructure

1. **[Diameter Concepts](https://docs.cennso.com/components/smc/latest/guides/aaa/diameter-concepts.md)** - Generic Diameter transport configuration
   - TCP/SCTP transport options
   - Connection management and peer selection
   - Rate limiting and resilience
   - Socket configuration and tuning

All Diameter-based interfaces (Gx, Rf, Ro, NASREQ) build on these concepts.

### True AAA Documentation

2. **[RADIUS Authentication and Accounting](https://docs.cennso.com/components/smc/latest/guides/aaa/authentication/radius.md)**
   - RADIUS server configuration
   - Authentication procedures (Access-Request/Accept/Reject)
   - Accounting phases (Start, Interim, Stop)
   - Attribute handling

3. **[Diameter NASREQ](https://docs.cennso.com/components/smc/latest/guides/aaa/authentication/nasreq.md)**
   - Diameter-based authentication
   - AA-Request/Answer procedures
   - Accounting-Request procedures (ACR)
   - Attribute mapping

### Policy Control Documentation

4. **[Policy Control Overview](https://docs.cennso.com/components/smc/latest/guides/aaa/policy/overview.md)**
   - Policy and Charging Control (PCC) architecture
   - Relationship between policy rules and charging
   - When to use static vs dynamic rules

5. **[PCC Rules Configuration](https://docs.cennso.com/components/smc/latest/guides/aaa/policy/pcc-rules.md)**
   - Rule types (classic vs ADF)
   - Rule parameters (precedence, metering, QoS)
   - Rule bases and static provisioning

6. **[Gx Interface](https://docs.cennso.com/components/smc/latest/guides/aaa/policy/gx.md)**
   - Gx procedures (CCR-Initial/Update/Terminate)
   - Static and dynamic rule installation
   - Supported AVPs and capabilities

7. **[Npcf Interface](https://docs.cennso.com/components/smc/latest/guides/aaa/policy/npcf.md)**
   - 5GC policy control with HTTP/2
   - SmPolicyContextData and SmPolicyDecision
   - Current limitations and unsupported features

### Charging Documentation

8. **[Charging Overview](https://docs.cennso.com/components/smc/latest/guides/aaa/charging/overview.md)**
   - Online vs offline charging
   - CDR generation and triggers
   - Rating groups and metering methods

9. **[Rf Offline Charging](https://docs.cennso.com/components/smc/latest/guides/aaa/charging/rf.md)**
   - Diameter Rf interface for CDR generation
   - Accounting phases and interim intervals
   - Connection monitoring and memory considerations

10. **[Ro Online Charging](https://docs.cennso.com/components/smc/latest/guides/aaa/charging/ro.md)**
    - Diameter Ro interface for real-time credit control
    - CCR-Initial/Update/Terminate procedures
    - OCS Free functionality for service continuity

11. **[RADIUS Charging](https://docs.cennso.com/components/smc/latest/guides/aaa/charging/radius.md)**
    - RADIUS accounting for billing
    - Differences from RADIUS AAA accounting
    - RADIUS vs Diameter charging comparison

## Configuration Patterns

### Minimal Configuration (No External AAA)

Disable all external AAA interfaces. The chart uses a static default handler:

```yaml
aaa:
  gx:
    enabled: false
  rf:
    enabled: false
  ro:
    enabled: false
  radius:
    enabled: false
```

### RADIUS Authentication + Diameter Charging

Common configuration for 4G networks with RADIUS authentication and Diameter offline charging:

```yaml
aaa:
  radius:
    enabled: true
    authenticate:
      enabled: true
    server:
      addr: "{RADIUS_SERVER_IP}"
      type: "ipv4"
      password: "{RADIUS_SECRET}"
      auth:
        port: 1812
  
  rf:
    enabled: true
    standalone: false

  oss:
    destinations:
      - addr: "{DIAMETER_SERVER_IP}"
        port: 3868
    destinationRealm: "{REALM}"
    originFqdn: "{NODE_FQDN}"
    originRealm: "{NODE_REALM}"
```

### 5G Policy with Npcf

Configure Npcf for 5G Standalone policy control:

```yaml
aaa:
  npcf:
    enabled: true
    URI: "http://{PCF_ADDRESS}:8080/npcf-smpolicycontrol/v1/sm-policies"
    timeout: 2000
```

### Hybrid: Authentication, Policy, and Charging

Full configuration with all three concerns:

```yaml
aaa:
  # True AAA
  radius:
    enabled: true
    authenticate:
      enabled: true
    server:
      addr: "{RADIUS_SERVER_IP}"
      type: "ipv4"
      password: "{RADIUS_SECRET}"
      auth:
        port: 1812
  
  # Policy Control
  gx:
    enabled: true
    standalone: false
  
  # Charging
  rf:
    enabled: true
    standalone: false
  
  ro:
    enabled: true
    standalone: false
  
  # Common Diameter settings
  oss:
    destinations:
      - addr: "{DIAMETER_SERVER_IP}"
        port: 3868
    destinationRealm: "{REALM}"
    originFqdn: "{NODE_FQDN}"
    originRealm: "{NODE_REALM}"
```

## Key Distinctions to Remember

The following table summarizes how AAA, policy, and charging differ in the question each answers, the protocols involved, and what each produces:

| Concern | Question Answered | Protocols | Output |
|---|---|---|---|
| **AAA** | Who are you? What can you access? | RADIUS, Diameter NASREQ | Access decisions, session records |
| **Policy** | How should traffic be handled? | Gx (Diameter), Npcf (HTTP/2) | QoS rules, service permissions |
| **Charging** | How much did you use? Do you have credit? | Rf, Ro (Diameter), RADIUS Acct | CDRs, quota management |

**Authentication vs Authorisation vs Policy:**
- **Authentication** confirms identity (`Is this IMSI valid?`)
- **Authorisation** grants access (`Can this user access this APN?`)
- **Policy** controls traffic treatment (`Apply 10 Mbps limit to video`)

**Accounting vs Charging:**
- **Accounting** tracks events for operations (`Session started at 10:00`)
- **Charging** collects billing data (`User consumed 500 MB`)

In SMC, RADIUS and NASREQ accounting are primarily **operational AAA**. Rf, Ro, and RADIUS charging are primarily **billing/revenue**.

> [!TIP]
> When configuring SMC, think about which concern you are addressing: identity (AAA), traffic treatment (policy), or billing (charging). This will guide you to the correct documentation and configuration sections.

## Related Documentation

- [Structured Logging](https://docs.cennso.com/components/smc/latest/guides/structured-logging.md) - Logging configuration for AAA, policy, and charging events
- [Rate Limitation](https://docs.cennso.com/components/smc/latest/guides/rate-limitation.md) - Rate limiting for all AAA interfaces
- [Network Configuration](https://docs.cennso.com/components/smc/latest/guides/networking.md) - Network interfaces for Diameter and RADIUS
- [Troubleshooting](https://docs.cennso.com/components/smc/latest/troubleshooting/verification.md) - Common AAA, policy, and charging issues
