Diameter Transport Configuration
Overview
Diameter is an AAA protocol specified in IETF RFC 6733Opens in a new tab. It is the evolution of RADIUS with improved reliability, security, and extensibility. This document covers generic Diameter transport configuration that applies to all Diameter interfaces in SMC.
SMC uses Diameter for multiple interfaces:
- Rf - Offline charging (3GPP TS 32.299) - See Rf Configuration
- Ro - Online charging (3GPP TS 32.299) - See Ro Configuration
- Gx - Policy control (3GPP TS 29.212) - See Gx Configuration
- NASREQ - Network Access Server Requirements (IETF RFC 7155Opens in a new tab) - See NASREQ Configuration
All of these interfaces share common Diameter transport infrastructure documented here.
References:
- IETF RFC 6733Opens in a new tab - Diameter Base Protocol
- AAA Overview - Understanding the three AAA concerns
Transport Configuration
Common Diameter Settings
Diameter interfaces can share common transport settings or use separate per-interface configuration. Common settings are defined under aaa.oss:
Attributes:
interface- Network interface name (referencesnetworking.*configuration)ipv4.addr- Source IPv4 address for Diameter connectionsmtu- Maximum Transmission Unit in bytesdestinations- List of Diameter peer addresses and ports (load balanced)destinationRealm- Realm for Diameter routingoriginFqdn- Fully Qualified Domain Name identifying this nodeoriginRealm- Realm identifying this node
Note
The interface and network parameters reference the networking.* configuration section. See Network Configuration for details.
Per-Interface Configuration
Each Diameter interface (Rf, Ro, Gx, NASREQ) can use the common settings or define its own. The standalone parameter controls this behaviour.
Using Common Settings
When standalone is false (or omitted), the interface uses settings from aaa.oss:
This is efficient when multiple interfaces connect to the same Diameter server (common in test environments).
Using Separate Settings
When standalone is true, the interface uses its own dedicated settings:
Use separate settings when different interfaces connect to different servers (common in production for separating charging from policy control).
Network Settings Association
Network settings (interface, ipv4.addr, mtu) are configured separately under the networking section:
Association rule:
- When
aaa.{interface}.standaloneisfalse→ usesnetworking.oss - When
aaa.{interface}.standaloneistrue→ usesnetworking.{interface}
See Network Configuration for details on network interface configuration.
Transport Protocol
Diameter supports TCP and SCTP (Stream Control Transmission Protocol) as transport protocols.
TCP is widely supported and suitable for most deployments. SCTP provides additional features:
- Multiple streams within a single connection
- Built-in multi-homing for resilience
- Message-oriented delivery
- Head-of-line blocking avoidance
Tip
SCTP is recommended for high-throughput deployments with strict latency requirements. However, ensure network equipment and firewalls support SCTP before enabling.
Default: tcp
Transport Socket Options
Configure transport layer behaviour with transportOpts:
Socket Options
The following table lists the available socket options, the transports they apply to, and what each controls:
reuseaddr
When true, allows the socket to bind to an address that is in TIME_WAIT state from a previous connection. This enables faster restarts but may cause issues if old packets arrive.
Default: false
Tip
Enable reuseaddr in development and test environments for faster restarts. Use with caution in production.
recbuf and sndbuf
Control the kernel socket buffer sizes. Larger buffers improve throughput but consume more memory.
Default: System defaults (typically 128 KB)
Note
Buffer sizes are specified in kilobytes. The actual buffer may be doubled by the kernel.
Tuning guidelines:
- Low latency - Keep default or small buffers (128-512 KB)
- High throughput - Increase buffers (2-8 MB)
- High latency links - Increase buffers based on bandwidth-delay product
nodelay
When true, sends packets immediately rather than batching them. This disables Nagle's algorithm (TCP_NODELAY / SCTP_NODELAY socket options), which reduces message latency at the cost of slightly higher packet overhead.
Impact:
true- Lower latency, higher overhead (more small packets)false- Higher latency, lower overhead (fewer larger packets)
Recommendation: Set to true for Diameter to reduce message latency.
Diameter messages are typically large enough (hundreds of bytes) that Nagle's algorithm provides minimal benefit, while adding latency.
unordered (SCTP only)
Allows SCTP to deliver messages out of order for better performance. Diameter applications must handle out-of-order messages correctly.
Default: false
Caution
When unordered is true, the application must not depend on message ordering within a stream. SMC's Diameter implementation handles out-of-order messages correctly, but external peers must also support this.
netdev
Binds the socket to a specific network device using SO_BINDTODEVICE. This enables
VRF-Lite isolation at the socket level: the operating system routes all traffic from this
socket through the specified device's routing table.
Use netdev when Diameter traffic must be isolated from the default routing domain
without placing the entire interface into a Linux VRF. See
Networking
for background on AAA interface routing constraints.
netns
Opens the socket in a specific Linux network namespace. Provide the full path to the namespace file.
Note
The target network namespace must exist before SMC starts. SMC does not create network namespaces.
Connection Management
Peer Selection
SMC maintains connections to multiple Diameter peers and selects the best peer for each request based on:
- Connection status - Only
upconnections are considered - Outstanding requests - Prefer peers with fewer outstanding requests
- Rate limit tokens - Prefer peers with available rate limit tokens
The peer with the lowest load is selected for each request.
Load balancing algorithm:
This provides simple round-robin behaviour under normal conditions, with automatic failover to healthy peers when issues arise.
Multiple Peers Configuration
Configure multiple peers for load balancing and redundancy:
Behaviour:
- Connections to all peers are established at startup
- Failed connections are retried automatically
- Requests are distributed across healthy peers
- No manual failover required
Connection Monitoring
Monitor Diameter connections using the diameter_connections metric. This metric shows the number of active connections per Diameter service.
Example Prometheus query:
Labels:
svc- Diameter service name (ergw_rf,ergw_ro,ergw_gx,ergw_nasreq)
Expected values:
0- No connections (configuration issue or all peers down)N- Number of configured peers (healthy state)< N- Some peers down (partial connectivity)
Connection Failures
When a connection to a Diameter peer fails, SMC automatically attempts to reconnect. Messages are queued or redirected during the reconnection period.
Failure handling per interface:
Caution
During Rf connection failures, offline charging data is stored in SMC memory. Monitor memory consumption carefully during extended outages.
Automatic reconnection:
- Retry interval starts at 1 second
- Increases exponentially up to 60 seconds
- Continues indefinitely until connection succeeds
- No manual intervention required
Rate Limiting
Per-Peer Rate Limits
Rate limiting prevents overloading Diameter peers. Limits are configured on a per-peer basis using a token bucket algorithm.
rate
Maximum number of requests per second to the peer. The token bucket refills at a constant rate.
Token refill interval:
Example: With rate: 1000, one token is added every 1 ms.
When the rate limit is reached, requests are automatically:
- Sent to a different peer (if available)
- Queued (if no peers available)
- Dropped (if queue is full)
outstanding_requests
Maximum number of requests sent but not yet answered. When this limit is reached, new requests are queued or sent to a different peer.
Purpose: Prevents memory exhaustion from pending requests.
Tuning:
- Low value (1000-2000) - Tight control, may limit throughput
- Medium value (5000-10000) - Balanced performance
- High value (20000+) - Maximum throughput, higher memory usage
Token Bucket Algorithm
Each peer has a token bucket with capacity equal to the rate. Tokens are added at a constant rate:
Each request consumes one token. When tokens are exhausted, requests wait for tokens to become available (if queued) or are sent to a different peer.
Algorithm:
- Check if tokens are available in bucket
- If yes, consume token and send request
- If no, try a different peer
- If no peers have tokens, queue or drop request
Request Retry Across Peers
When a request cannot be sent to a peer (due to rate limiting, connection failure, or timeout), SMC retries the request to a different peer.
Retry conditions:
- Connection to the initial peer is down
- Request times out (fixed timeout: 5000 milliseconds)
- Rate limit reached for the initial peer
Retry behaviour:
- Only one retry attempt per peer
- Retransmitted messages keep the original Hop-by-Hop Identifier
- Retransmit flag (
Tbit) is set in retransmitted messages - Peers already tried for this request are excluded from retry
Note
The fixed timeout of 5000 milliseconds is not configurable.
Monitoring Rate Limits
Rate limit behaviour is not directly exposed via Prometheus metrics. Monitor indirectly through:
Request latency (increases when rate limited):
Connection load distribution (uneven may indicate rate limiting):
If one peer consistently has more outstanding requests than others, it may indicate:
- Rate limiting on other peers
- Connection issues with other peers
- Uneven peer capacity
Example Configurations
Basic TCP Configuration
Simple configuration with single peer:
SCTP with Separate Network
Ro interface using SCTP on a dedicated network interface:
High Availability with Rate Limiting
Multiple peers with rate limiting for high availability and performance:
Total capacity: 6000 requests/second with automatic failover.
Mixed Interface Configuration
Different interfaces connecting to different servers:
Troubleshooting
No Diameter Connections
Symptom: Metric diameter_connections shows 0 connections.
Possible causes:
- Network connectivity issues
- Firewall blocking TCP/SCTP port 3868
- Incorrect peer addresses in
destinations - Diameter realm mismatch
- Certificate issues (if TLS enabled)
Solution:
Verify network connectivity:
bashCheck port connectivity:
bashReview SMC logs for Diameter connection errors:
bashVerify
destinationRealmmatches the peer's realm configurationCheck that
originFqdnandoriginRealmare correctly configured and match peer expectations
High Latency
Symptom: Diameter request latency increases significantly.
Possible causes:
- Rate limiting active (peers overloaded)
- Small socket buffers
- Nagle's algorithm enabled (
nodelay: false) - Network congestion
- Peer processing delays
Solution:
Check peer load distribution (all peers should have similar load):
promqlIncrease socket buffers:
yamlEnable
nodelay:yamlIncrease rate limits if peers can handle more load:
yamlAdd more peers for better load distribution
Memory Growth During Rf Outage
Symptom: SMC memory usage increases significantly when Rf connection is down.
Cause: Offline charging data is queued in memory during Rf outages.
Solution:
Restore Rf connectivity as soon as possible
Monitor memory usage:
promqlIf memory continues to grow towards the limit:
- Increase memory limits temporarily
- Prioritise Rf connection restoration
- As last resort, restart SMC (loses queued charging data)
Important
Restarting SMC during an Rf outage results in loss of offline charging records that were queued in memory.
Uneven Load Distribution
Symptom: One peer receives significantly more requests than others.
Possible causes:
- Other peers experiencing connection issues
- Different rate limits configured per peer
- One peer responding faster than others
Solution:
Check connection status for all peers:
promqlVerify rate limits are consistent:
yamlCheck peer response times (slow peers will accumulate more outstanding requests and receive less load)
If intentional (peers have different capacity), configure appropriate rate limits per peer
Related Documentation
- AAA Overview - Understanding the three AAA concerns
- Network Configuration - Network interface configuration
- Rf Offline Charging - Rf-specific configuration
- Ro Online Charging - Ro-specific configuration
- Gx Policy Control - Gx-specific configuration
- Diameter NASREQ - NASREQ-specific configuration