Diameter Base Protocol - New
Diameter Base Protocol - New
Better Proxying
Hop-by-hop transport failure detection allows failover to occur at the appropriate
place — proxies can locally failover to an alternate next-hop peer.
The proxy automatically does retransmission of pending request messages following
a failover.
An AVP that identifies the ultimate destination allows multiple transactions for a
given session to be routed to the same home server.
Better Security
Hop-by-hop security is provided using IPsec or TLS.
End-to-end security protects the integrity and/or confidentiality of sensitive AVPs
through intermediate proxies.
3). Diameter Stack
The base protocol defines the basic Diameter message format. Data is carried within a
Diameter message as a collection of Attribute Value Pairs (AVPs). An AVP is like a
RADIUS attribute. An AVP consists of multiple fields: an AVP Code, a Length, some
Flags, and Data. Some AVPs are used by the Diameter base protocol; other AVPs are
intended for the Diameter application (e.g. NASREQ); while yet others may be used by
the higher-level end-system application that employs Diameter.
In addition to clients and servers, the Diameter protocol defines relay, proxy, redirect, and
translation agents.
Client
A Diameter Client is a device at the edge of the network that performs access control.
Examples of Diameter clients are Network Access Servers (NAS) and mobility agents
(Foreign Agent).
Server
A Diameter Server is one that handles authentication, authorization, and accounting
requests for a particular realm.
Relay Agent
A Relay Agent routes Diameter messages based on information found in the messages.
This routing decision is performed using a list of supported realms and known peers.
Relay agents are largely transparent. A Relay Agent may modify Diameter messages
only by inserting and/or removing routing information but may not modify any other
portion of a message.
Proxy Agent
A Proxy agent also routes Diameter messages. However, a proxy agent may modify
messages to implement policy decisions, such as controlling resource usage, providing
admission control, and provisioning.
Redirect Agent
A redirect agent also provides a routing function, generally acting as a centralized
source of Realm→Server address mappings for members of a roaming consortium.
Unlike the other agents that relay requests, a redirect agent returns a special type of
answer message to the peer that sent the request. This answer message contains
routing information that allows the peer to resend the request directly to the correct
destination server. The redirect agent is then out of the routing path; a redirect agent
does not relay requests.
Translation Agent
A Translation Agent translates between two protocols, such as RADIUS and Diameter.
In this case, the translation agent supports a RADIUS to Diameter migration, allowing
server conversions to Diameter, for example, while permitting the NASes to be converted at
a slower pace.
A Diameter message consists of the header and the payload. The message header is always
included in every Diameter message, and it contains codes, applications, identifiers and bit flags.
The Message payload contains the AVP data, and each message transported has a specific
command and application.
Hop-by-Hop Identifier – Unique identifier that matches the request and answer message.
Attribute Value-Pairs (AVP)- AVPs contain values related to authentication, routing, security
and configuration, all of which are required for request or response messages.
There are four command flags available in the beginning of a diameter message header:
R-Bit- Indicates whether a message is a request or answer messages.
P-Bit- Indicates whether the message should be sent to a local or remote proxy.
E-Bit- Sent in response messages to indicate an error has occurred.
T-Bit- Sent in failover situations to aid in the processing of duplicate messages.
The next field after the flag is the command code field. One of the benefits of using Diameter is
that it is backward compatible with the RADIUS protocol. The Internet Assigned Numbers
Authority (IANA) has reserved several command codes to support backward compatibility with
RADIUS.
In addition, the IANA also maintains the application-ID numbers that define the application-ID
field for which the message is targeted. These can be standard applications or vendor-specific
applications.
M-Bit– Mandatory AVP that all nodes must support. If M-Bit is not enabled, any unrecognized
code is received. The receiver can treat the M-Bit as if it were for informational purpose only.
Capabilities Exchange
The first Diameter messages exchanged between two Diameter peers, after establishing the
transport connection, are Capabilities Exchange messages.
A Capabilities Exchange message carries a peer's identity and its capabilities (protocol version
number, supported Diameter applications, etc.). A Diameter node only transmits commands to
peers that have advertised support for the Diameter application associated with the given
command.
Transport Failure Detection
Application-level heartbeat messages, called the Device-Watchdog-Request and Device-
Watchdog-Answer messages, are used to proactively detect transport failures.
These messages are sent periodically when a peer connection is idle and when a timely response
has not been received for an outstanding request.
Failover/Failback Procedures
In the event that a transport failure is detected with a peer, a Diameter node attempts to failover
to an alternate peer, which means that all pending request messages sent to the failed peer will be
forwarded to the alternate peer.
A Diameter node periodically attempts to re-establish the transport connection with a failed peer.
Should connection be re-established, a node can failback to this peer, i.e. messages can once
again be forwarded to this peer.
A failover to an alternate proxy agent may result in the reception of duplicate request messages
by the home server.
Each application is defined by an application identifier and can add new command codes and/or
new mandatory AVPs.
The communication between two diameter peers starts the establishment of a transport
connection (TCP or SCTP). The initiator then sends a capabilities-Exchange-Request
(CER) to the other peer, which responds with a Capabilities-Exchange-Answer (CEA).
The connection is then ready for exchanging application messages.
If no messages have been exchanged for some time either side may send a Device-
Watchdog-Request (DWR) and the other peer must respond with Device-Watchdog-
Answer.
Either side may terminate the communication by sending a Disconnect-Peer-Request
(DPR) which the other peer must respond to with Disconnect-Peer-Answer. After that the
transport connection can be disconnected.
CLIENT SERVER
CER Initiated by the PCEF to establish a Diameter connection with the PCRF. It
includes all connection information that a PCRF needs to establish the connection.
Capabilities Exchange Answer (CEA)
Initiated by a Diameter server in response to a Client’s CER request.
CEA Initiated by the PCEF in response to Diameter CEA request by the PCEF. It
advertises peer identity and supported applications.
12). DIAMETER – SESSION COMMANDS
Credit Control Request (CCR)
Sent from Client to Server to request authorization for a given service.
CCR-I Initiated by the PCEF to create and initialize a session on the PCRF. It
includes all session information that PCRF might use to determine applicable
logic and policies.
CCR-U Initiated by the PCEF to send updates for a previously created session,
based on one of the triggers that PCRF set during session initialization.
CCA-U Initiated by the PCRF in response to a CCR-U request. The PCRF has
full control to deny/modify policies on PCEF for an existing subscriber session,
by provisioning any of the rules and applicable.
RAR Initiated by the PCRF to push new policy attributes similar to CCA-I and
CCA-U. A RAR can also be used by the PCRF to request explicit volume usage-
report.
Reauthorization Answer (RAA)
Sent by the client in response to a Reauthorization Request.
RAA Initiated by the PCEF in response to RAR messages, and can be used to
provide current volume usage-report.
Device-Watchdog-Request (DWR)
After the CER/CEA messages are exchanged, if there is no more traffic between
peers for a while, to monitor the health of the connection, DWR message is sent
from the client. The Device Watchdog timer (Tw) is configurable in PCEF/GW
and can vary from 6 through 30 seconds. A very low value will result in
duplication of messages. The default value is 30 seconds. On two consecutive
expiries of Tw without a DWA, the peer is taken to be down.
Device-Watchdog-Answer (DWA )
This is the response to the DWR message from the server. This is used to monitor
the connection state.
Disconnect-Peer-Request (DPR):
This message is sent to the peer to inform to shutdown the connection. PCEF/GW
only receives this message. There is no capability currently to send the message to
the diameter server.
Disconnect-Peer-Answer (DPA):
This message is the response to the DPR request from the peer. On receiving the
DPR, the peer sends DPA and puts the connection state to “DO NOT WANT TO
TALK TO YOU” state and there is no way to get the connection back except for
reconfiguring the peer again.
14). DIAMETER – SESSION ESTABLISHMENT
SGSN/SGW PCEF PCRF SPR
15). DIAMETER – MID-SESSION
PCEF INITIATED
PCRF INITIATED
PCEF PCRF SPR
16). DIAMETER – CCR-I & CCA-I EXAMPLE
17). RESULT-CODE AVP
The Result-Code AVP (AVP Code 268) is of type Unsigned32 and indicates whether a particular
request was completed successfully or an error occurred. All Diameter answer messages in
IETF-defined Diameter application specifications MUST include one Result-Code AVP. A non-
successful Result-Code AVP (one containing a non-2xxx value other than
DIAMETER_REDIRECT_INDICATION) MUST include the Error-Reporting-Host AVP if the
host setting the Result-Code AVP is different from the identity encoded in the Origin-Host AVP.
The Result-Code data field contains an IANA-managed 32-bit address space representing errors.
Diameter provides the following classes of errors, all identified by the thousands digit in the
decimal notation:
1xxx (Informational)
2xxx (Success)
An unrecognized class (one whose first digit is not defined in this section) MUST be handled as
a permanent failure.
3GPP Gx is built on Diameter Credit Control (RFC 3588) but for policy control purposes and so
does not reuse all aspects. For session establishment and policy control over Gx, following
messages are used:
CCA-I : PCRF’s answer to CCR-I request. In this message PCRF includes result-code that
defines if authorization is successful, or not. Also with authorization for session, PCRF provides
set of attributes that PCEF should enforce to subscriber’s session. This can be:
o Result code: defining if PCRF accepts session or terminates it. Valid codes and expected causes
are reused from 3GPP 29.212, RFC 4006 and RFC 3588.
o QoS change and THP/ARP setting change for session
o Event trigger provisioning : setting monitoring points triggers for which PCRF wants to be
notified from PCEF
o PCC rule and/or group of PPC rules install/remove commands: activating/deactivating pre-
defined dynamic rules on PCEF, with option to set predefined future time of automatic activation
and deactivation.
o Volume monitoring & reporting: Setting up thresholds for monitoring keys, which enables PCEF
to count and report counted volume per Service Data Flow (or set of SDFs) or for entire session.
CCR-U : PCEF sends update for session, based on one of the triggers that PCRF set during
session initialization. Update message is sent together with trigger that caused this update
message, and with attributes that are related to the change, for example new RAT TYPE, new
QOS, Usage-Report due to Volume monitoring threshold exceeded, access network gateway
(e.g. SGW/SGSN) change or Revalidation timer.
CCA-U : PCRF answer to CCR-U request. In this message PCRF has full control to
deny/modify policies on PCEF for subscriber session, by setting up result-code and provisioning
any of the rules and applicable modifications with same procedure as in INIT message
(Changing QoS, Setting new event-triggers, installing new rules, setting up or discarding volume
monitoring).
CCR-T : PCEF sends TERMINATE request when subscriber session is closed, due to any
reason (UE PDP disconnection, or administrative disconnect by other entity). In termination
request message, PCEF reports termination-reason, and also any outstanding information that
was valid at session termination stage (Like reporting used volume or active volume-monitoring
threshold).
CCA-T : PCRF answer to CCR-T request which just acknowledges that the request has been
processed. Failure to send a CCA-T can cause the PCEF to retransmit the CCR-T to a secondary
PCRF.