Wps0!01!06 Diameter Protocol Overview Issue 1.01
Wps0!01!06 Diameter Protocol Overview Issue 1.01
Overview
www.huawei.com
Copyright © 2006 Huawei Technologies Co., Ltd. All rights reserved. Page3
References
RFC3588 - [Diameter Base Protocol]
Copyright © 2006 Huawei Technologies Co., Ltd. All rights reserved. Page4
Objectives
Upon completion of this course, you will be able to:
Know the function of Diameter protocol.
Describe the structure of Diameter protocol
Describe Header format and AVP format of Diameter protocol.
Describe the connection mechanisms of Diameter protocol
Copyright © 2006 Huawei Technologies Co., Ltd. All rights reserved. Page5
Contents
1. Diameter Introduction
2. Protocol Overview
3. Diameter Headers & AVPs
4. Diameter Peers
Copyright © 2006 Huawei Technologies Co., Ltd. All rights reserved. Page6
What’s Diameter?
Diameter protocol
Radius, as an AAA protocol, provide Authentication, Authorization and
Accounting (AAA) function
Advanced than “radius”, so it is called “diameter”
Radius Diameter
NAS Diameter client
PPP
DSL WLAN
3G
Traditional network
Future network
Copyright © 2006 Huawei Technologies Co., Ltd. All rights reserved. Page7
New demands on AAA protocols
Failover Auditability
Transmission-level
Transition support
security
Reliable transport Capability negotiation
Peer discovery and
Agent support
configuration
Server-initiated
Roaming support
messages
Copyright © 2006 Huawei Technologies Co., Ltd. All rights reserved. Page8
New demands on AAA protocols
(Cont)
Failover Auditability
Transmission-level
Transition support
security
Reliable transport Capability negotiation
Peer discovery and
Agent support
configuration
Server-initiated
Roaming support
messages
Copyright © 2006 Huawei Technologies Co., Ltd. All rights reserved. Page9
Characteristic
The Diameter base protocol provides the following facilities
Ability to exchange messages and deliver AVPs
Capabilities negotiation
Error notification
Extensibility, through addition of new commands and AVPs
Basic services necessary for applications, such as handling of user
sessions or accounting
Copyright © 2006 Huawei Technologies Co., Ltd. All rights reserved. Page10
Diameter in 3GPP Network
Diameter is mainly used in EPC networks
MME – HSS S6a
MME – EIR S13
EPC-GW – PCRF Gx
EPC_GW – OCS Gy
Copyright © 2006 Huawei Technologies Co., Ltd. All rights reserved. Page11
Contents
1. Diameter Introduction
2. Protocol Overview
3. Diameter Headers & AVPs
4. Diameter Peers
Copyright © 2006 Huawei Technologies Co., Ltd. All rights reserved. Page12
Diameter framework
Diameter specification consists
The Diameter base protocol
Applications
Mobile IPv4 [DIAMMIP] application
NASREQ [NASREQ] application
3GPP based application
……
Diameter Mobile
NASREQ
3GPP
etc
Applications IPv4 application
Copyright © 2006 Huawei Technologies Co., Ltd. All rights reserved. Page13
Role of Diameter Nodes
A Diameter Server is one that handles
AAA requests for a particular realm, a
Diameter Server MUST support
Diameter Diameter applications in addition to the
Server base protocol.
A Diameter Client is a
device at the edge of
the network that
performs access
control. An example of Diameter A Diameter Agent is
a Diameter client is a Node a Diameter node that
NAS or a FA. provides either relay,
Diameter Diameter proxy, redirect or
translation services.
Client Agent
Copyright © 2006 Huawei Technologies Co., Ltd. All rights reserved. Page15
Connections & Sessions
A connection is a transport level connection between two peers, used to
send and receive Diameter messages.
A session is a logical concept at the application layer, and is shared
between an access device and a server, and is identified via the Session-
Id AVP.
User Session x
Copyright © 2006 Huawei Technologies Co., Ltd. All rights reserved. Page16
Role of Diameter Agents
Relay agent Relay Agents are Diameter agents that accept requests and route messages
to other Diameter nodes based on information found in the messages (e.g.,
Destination-Realm).
This routing decision is performed using a list of supported realms, and
known peers.
Proxy agent Similarly to relays, proxy agents route Diameter messages using the
Diameter Routing Table.
However, they differ since proxy agent modify messages to implement
policy enforcement.
Redirect agent Redirect agents are useful in scenarios where the Diameter routing
configuration needs to be centralized.
Redirect agents do not relay messages, and only return an answer with the
information necessary for Diameter agents to communicate directly
Translation agent A translation agent is a device that provides translation between two
protocols (e.g., RADIUS<->Diameter).
Copyright © 2006 Huawei Technologies Co., Ltd. All rights reserved. Page17
Diameter Agents
Relay Agent (Proxy Agent)
Translation Agent
Home
RADIUS Request Translation Diameter Request
NAS Diameter
Agent
Server
RADIUS Answer Diameter Answer
Copyright © 2006 Huawei Technologies Co., Ltd. All rights reserved. Page18
Diameter Agents
Redirect Agent
Redirect
Agent
2. Request 3.Redirection
Notification
Home
1. Request Relay 4. Request
NAS Diameter
Agent
Server
6. Answer 5. Answer
Copyright © 2006 Huawei Technologies Co., Ltd. All rights reserved. Page19
Diameter Packet – Overview
Structure of diameter packet
IP Header
TCP/SCTP Header
Diameter Header
Diameter AVP 1
Diameter AVP 2
Diameter AVP 3
Diameter AVP …
Diameter AVP n
Copyright © 2006 Huawei Technologies Co., Ltd. All rights reserved. Page20
Contents
1. Diameter Introduction
2. Protocol Overview
3. Diameter Headers & AVPs
4. Diameter Peers
Copyright © 2006 Huawei Technologies Co., Ltd. All rights reserved. Page21
Contents
3. Protocol Overview
3.1 Diameter Header
3.2 Diameter AVPs
Copyright © 2006 Huawei Technologies Co., Ltd. All rights reserved. Page22
Diameter Header
0 7 8 15 16 23 24 31
Application-ID
Hop-by-Hop Identifier
End-to-End Identifier
AVPs……
Copyright © 2006 Huawei Technologies Co., Ltd. All rights reserved. Page23
Diameter Header
0 7 8 15 16 23 24 31
Application-ID
Hop-by-Hop Identifier
End-to-End Identifier
AVPs……
Copyright © 2006 Huawei Technologies Co., Ltd. All rights reserved. Page24
Diameter Header
Hop-by-Hop Id & End-to-End Id
We’ve discussed the connections and session previously
User Session x
Hop-by-Hop Hop-by-Hop
Identifier A Identifier B
End-to-End Identifier x
Copyright © 2006 Huawei Technologies Co., Ltd. All rights reserved. Page25
Diameter Header – Command Flags
The Command Flags field is eight bits. The following bits are
assigned:
0 1 2 3 4 5 6 7
R P E T r r r r
Error
Proxiable
Request
Copyright © 2006 Huawei Technologies Co., Ltd. All rights reserved. Page26
Diameter Header – Command Code
Each Request/Answer pair is assigned a command code
Command-Name Abbreviation Command code
Abort-Session-Request/Answer ASR/ASA 274
Accounting-Request/Answer ACR/ACA 271
Capabilities-Exchange-Request/
CER/CEA 257
Answer
Device-Watchdog-Request/Answer DWR/DWA 280
Disconnect-Peer-Request/Answer DPR/DPA 282
Re-Auth-Request/Answer RAR/RAA 258
Session-Termination-Request/
STR/STA 275
Answer
Copyright © 2006 Huawei Technologies Co., Ltd. All rights reserved. Page27
Contents
3. Protocol Overview
3.1 Diameter Header
3.2 Diameter AVPs
Copyright © 2006 Huawei Technologies Co., Ltd. All rights reserved. Page28
Diameter AVPs
Diameter AVP(Attribute-Value-Pairs) carry specific
authentication, accounting, authorization, routing and security
information as well as configuration details for the request and
reply.
An AVP includes:
AVP header
AVP data
Copyright © 2006 Huawei Technologies Co., Ltd. All rights reserved. Page29
AVP Header
0 7 8 15 16 23 24 31
AVP Code
Vendor ID (Optional)
AVP Data ……
Copyright © 2006 Huawei Technologies Co., Ltd. All rights reserved. Page30
AVP Header – AVP Flags
V bit: Vendor-Specific bit, indicates whether the optional Vendor-ID
field is present in the AVP header
P bit: the need for encryption for end-to-end security
M bit: Mandatory bit, indicates whether support of the AVP is required
If an AVP with the 'M' bit set is received by a Diameter client, server, proxy,
or translation agent and either the AVP or its value is unrecognized, the
message MUST be rejected.
Diameter Relay and redirect agents MUST NOT reject messages with
unrecognized AVPs.
Copyright © 2006 Huawei Technologies Co., Ltd. All rights reserved. Page31
Basic AVP Data Formats
The format of the Data field MUST be one of the following base data
types or a data type derived from the base data types.
AVP format AVP Length (*)
OctetString 8 ~ N (**)
Integer32 12
Integer64 16
Unsigned32 12
Unsigned64 16
Float32 12
Float64 16
Grouped 8 ~ M*4 (***)
Copyright © 2006 Huawei Technologies Co., Ltd. All rights reserved. Page32
Derived AVP Data Formats
Applications may define data formats derived from the Basic AVP Data
Formats.
AVP format Derived from; description
Address OctetString; IP address type + IP address
Time OctetString; NTP timestamp
UTF8String OctetString; string coded in UTF-8
DiameterIdentity OctetString; FQDN/realm
DiameterURI OctetString; Uniform Resource Identifiers
Enumerated Integer32; a list of valid values and their interpretation
IPFilterRule OctetString; an ACL for filtering
QoSFilterRule OctetString; used to mark/meter packets
Copyright © 2006 Huawei Technologies Co., Ltd. All rights reserved. Page33
Grouped AVP Values
The Diameter protocol allows AVP values of type 'Grouped.' This
implies that the Data field is actually a sequence of AVPs.
A group AVP is list as the following
Example-AVP ::= < AVP Header: 999999 >
{ Origin-Host }
1*{ Session-Id }
*[ AVP ]
::= defined as
<> Mandatory element
{} Required
[] Optional element
* Repetition
Copyright © 2006 Huawei Technologies Co., Ltd. All rights reserved. Page34
Grouped AVP Values
0 1 2 3 4 5 6 7
e x a m p l e .
......
g r u m p . e x
......
0 a f 3 b 8 2 padding
......
......
Copyright © 2006 Huawei Technologies Co., Ltd. All rights reserved. Page35
Diameter Base Protocol AVPs
The diameter base protocol AVPs are defined in RFC 3588:
Acct-Interim- Accounting- Acct-Multi- Accounting-
Interval Realtime-Required Session-Id Record-Number
Accounting- Acct-Session-Id Accounting-Sub- Acct-
Record-Type Session-Id Application-Id
Auth- Auth-Request-Type Authorization- Auth-Grace-
Application- Lifetime Period
Id
Auth-Session- Re-Auth-Request- Class Destination-
State Type Host
Destination- Disconnect-Cause Error-Message Error-
Realm Reporting-Host
Event- Experimental-Result Experimental- Failed-AVP
Timestamp Result-Code
Copyright © 2006 Huawei Technologies Co., Ltd. All rights reserved. Page36
Diameter Base Protocol AVPs
The diameter base protocol AVPs are defined in RFC 3588:
Firmware- Host-IP-Address Inband-Security- Multi-Round-Time-
Revision Id Out
Origin-Host Origin-Realm Origin-State-Id Product-Name
Proxy-Host Proxy-Info Proxy-State Redirect-Host
Redirect-Host- Redirect-Max- Result-Code Route-Record
Usage Cache-Time
Session-Id Session-Timeout Session-Binding Session-Server-
Failover
Supported- Termination- User-Name Vendor-Id
Vendor-Id Cause
Vendor-
Specific-
Application-Id
Copyright © 2006 Huawei Technologies Co., Ltd. All rights reserved. Page37
Contents
1. Diameter Introduction
2. Protocol Overview
3. Diameter Headers & AVPs
4. Diameter Peers
Copyright © 2006 Huawei Technologies Co., Ltd. All rights reserved. Page38
Contents
4. Diameter Peers
4.1 Peers Connections
4.2 Disconnecting Peer connections
4.3 Transport Failure Detection
Copyright © 2006 Huawei Technologies Co., Ltd. All rights reserved. Page39
Diameter Peers
Connections between diameter peers are established using their
valid DiameterIdentity.
A DiameterIdentity includes:
FQDN and realm
A Diameter node initiating a connection to a peer
MUST know the peer's DiameterIdentity.
A peer might be removed in case of:
Peer unreachable, transport connection is shut down
Not receiving a DWA within an allotted time frame
Copyright © 2006 Huawei Technologies Co., Ltd. All rights reserved. Page40
Peer Connection Establishment
Diameter Establish a
transport Capabilities Connection
Peer connection Exchange Established
Discovery (TCP or SCTP)
Copyright © 2006 Huawei Technologies Co., Ltd. All rights reserved. Page41
Diameter Peer Discovery
There are two peer discovery mechanisms:
Manual configuration
DNS
Diameter peer discovery
Diameter client needs to discover a first-hop Diameter agent
Diameter agent needs to discover another agent for further handling
of a Diameter operation
Copyright © 2006 Huawei Technologies Co., Ltd. All rights reserved. Page42
Peer Discovery Search Order
A node will find its peer in the following order:
Local statically configured peer
Uses SLPv2 (Service Location Protocol) to discover Diameter
services
a NAPTR query for a server in a particular realm
If the DNS server returns no address records, the requestor gives up.
Copyright © 2006 Huawei Technologies Co., Ltd. All rights reserved. Page43
Capability Exchange
Peers MUST exchange the Capabilities Exchange messages
(CER/CEA)
Protocol version number
Supported Diameter applications
Security mechanisms
Typical errors Result-Code AVPs:
DIAMETER_NO_COMMON_APPLICATION
DIAMETER_NO_COMMON_SECURITY
DIAMETER_UNKNOWN_PEER
Copyright © 2006 Huawei Technologies Co., Ltd. All rights reserved. Page44
Capabilities-Exchange-Request
The Capabilities-Exchange-Request (CER), indicated by the
Command-Code set to 257 and the Command Flags' 'R' bit set, is
sent to exchange local capabilities.
When Diameter is run over SCTP, which allows for connections to
span multiple interfaces and multiple IP addresses, the Capabilities-
Exchange-Request message MUST contain one Host-IP-
Address AVP for each potential IP address that MAY be locally
used when transmitting Diameter messages.
Copyright © 2006 Huawei Technologies Co., Ltd. All rights reserved. Page45
Capabilities-Exchange-Request
Message format
<CER> ::= < Diameter Header: 257, REQ >
{ Origin-Host }
{ Origin-Realm }
1*{ Host-IP-Address }
{ Vendor-Id }
{ Product-Name }
[ Origin-State-Id ]
*[ Supported-Vendor-Id ]
*[ Auth-Application-Id ]
*[ Inband-Security-Id ]
*[ Acct-Application-Id ]
*[ Vendor-Specific-Application-Id ]
[ Firmware-Revision ]
*[ AVP ]
Copyright © 2006 Huawei Technologies Co., Ltd. All rights reserved. Page46
Capabilities-Exchange-Request (Cont)
Message format
<CER> ::= < Diameter Header: 257, REQ >
{ Origin-Host }
{ Origin-Realm }
1*{ Host-IP-Address }
{ Vendor-Id }
{ Product-Name }
[ Origin-State-Id ]
*[ Supported-Vendor-Id ]
*[ Auth-Application-Id ]
*[ Inband-Security-Id ]
*[ Acct-Application-Id ]
*[ Vendor-Specific-Application-Id ]
[ Firmware-Revision ]
*[ AVP ]
Copyright © 2006 Huawei Technologies Co., Ltd. All rights reserved. Page47
Capabilities-Exchange-Answer
The Capabilities-Exchange-Answer (CEA), indicated by the
Command-Code set to 257 and the Command Flags' 'R' bit
cleared, is sent in response to a CER message.
Copyright © 2006 Huawei Technologies Co., Ltd. All rights reserved. Page48
Capabilities-Exchange-Answer
Message format
<CEA> ::= < Diameter Header: 257 >
{ Result-Code }
{ Origin-Host }
{ Origin-Realm }
1*{ Host-IP-Address }
{ Vendor-Id }
{ Product-Name }
[ Origin-State-Id ]
[ Error-Message ]
*[ Failed-AVP ]
*[ Supported-Vendor-Id ]
*[ Auth-Application-Id ]
*[ Inband-Security-Id ]
*[ Acct-Application-Id ]
*[ Vendor-Specific-Application-Id ]
[ Firmware-Revision ]
*[ AVP ]
Copyright © 2006 Huawei Technologies Co., Ltd. All rights reserved. Page49
Result-code in CEA
The Result-Code AVP 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 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.
1xxx (Informational)
2xxx (Success)
3xxx (Protocol Errors)
4xxx (Transient Failures)
5xxx (Permanent Failure)
Copyright © 2006 Huawei Technologies Co., Ltd. All rights reserved. Page50
Result-code in CEA
Result-code Meaning
1001 DIAMETER_MULTI_ROUND_AUTH
This informational error is returned by a Diameter server to
inform the access device that the authentication mechanism
being used requires multiple round trips, and a subsequent
request needs to be issued in order for access to be granted.
2001 DIAMETER_SUCCESS
2002 DIAMETER_LIMITED_SUCCESS
When returned, the request was successfully completed, but
additional processing is required by the application in order to
provide service to the user.
Copyright © 2006 Huawei Technologies Co., Ltd. All rights reserved. Page51
Result-code in CEA
Result-code Meaning
3001 DIAMETER_COMMAND_UNSUPPORTED
3002 DIAMETER_UNABLE_TO_DELIVER
3003 DIAMETER_REALM_NOT_SERVED
3004 DIAMETER_TOO_BUSY
3005 DIAMETER_LOOP_DETECTED
3006 DIAMETER_REDIRECT_INDICATION
3007 DIAMETER_APPLICATION_UNSUPPORTED
3008 DIAMETER_INVALID_HDR_BITS
3009 DIAMETER_INVALID_AVP_BITS
3010 DIAMETER_UNKNOWN_PEER
Copyright © 2006 Huawei Technologies Co., Ltd. All rights reserved. Page52
Result-code in CEA
Result-code Meaning
4001 DIAMETER_AUTHENTICATION_REJECTED
The authentication process for the user failed, most likely due to
an invalid password used by the user. Further attempts MUST
only be tried after prompting the user for a new password.
4002 DIAMETER_OUT_OF_SPACE
A Diameter node received the accounting request but was
unable to commit it to stable storage due to a temporary lack of
space.
4003 ELECTION_LOST
The peer has determined that it has lost the election process and
has therefore disconnected the transport connection.
Copyright © 2006 Huawei Technologies Co., Ltd. All rights reserved. Page53
Result-code in CEA
Result-code Meaning
5001 DIAMETER_AVP_UNSUPPORTED
5002 DIAMETER_UNKNOWN_SESSION_ID
5003 DIAMETER_AUTHORIZATION_REJECTED
5004 DIAMETER_INVALID_AVP_VALUE
5005 DIAMETER_MISSING_AVP
5006 DIAMETER_RESOURCES_EXCEEDED
5007 DIAMETER_CONTRADICTING_AVPS
5008 DIAMETER_AVP_NOT_ALLOWED
5009 DIAMETER_AVP_OCCURS_TOO_MANY_TIMES
5010 DIAMETER_NO_COMMON_APPLICATION
Copyright © 2006 Huawei Technologies Co., Ltd. All rights reserved. Page54
Result-code in CEA
Result-code Meaning
5011 DIAMETER_UNSUPPORTED_VERSION
5012 DIAMETER_UNABLE_TO_COMPLY
5013 DIAMETER_INVALID_BIT_IN_HEADER
5014 DIAMETER_INVALID_AVP_LENGTH
5015 DIAMETER_INVALID_MESSAGE_LENGTH
5016 DIAMETER_INVALID_AVP_BIT_COMBO
5017 DIAMETER_NO_COMMON_SECURITY
Copyright © 2006 Huawei Technologies Co., Ltd. All rights reserved. Page55
Contents
4. Diameter Peers
4.1 Peers Connections
4.2 Disconnecting Peer connections
4.3 Transport Failure Detection
Copyright © 2006 Huawei Technologies Co., Ltd. All rights reserved. Page56
Peer Disconnection
Peers may be disconnected in the following cases:
Peer in failure
Node request to disconnect
Messages used for disconnection
Disconnect-Peer-Request
Disconnect-Peer-Answer
Copyright © 2006 Huawei Technologies Co., Ltd. All rights reserved. Page57
Disconnect-Peer-Request
The Disconnect-Peer-Request (DPR), indicated by the Command-
Code set to 282 and the Command Flags 'R' bit set, is sent to a
peer to inform its intentions to shutdown the transport connection.
Message format
Copyright © 2006 Huawei Technologies Co., Ltd. All rights reserved. Page58
Disconnect-Peer-Answer
The Disconnect-Peer-Answer (DPA), indicated by the Command-
Code set to 282 and the Command Flags 'R' bit cleared, is sent as
a response to the Disconnect-Peer-Request message. Upon receipt
of this message, the transport connection is shutdown.
Message format
Copyright © 2006 Huawei Technologies Co., Ltd. All rights reserved. Page59
Disconnect-Cause AVP
A Diameter node MUST include this AVP in the Disconnect-Peer-
Request message to inform the peer of the reason for its intention
to shutdown the transport connection.
Causes:
REBOOTING 0
BUSY 1
DO_NOT_WANT_TO_TALK_TO_YOU 2
Copyright © 2006 Huawei Technologies Co., Ltd. All rights reserved. Page60
Contents
4. Diameter Peers
4.1 Peers Connections
4.2 Disconnecting Peer connections
4.3 Transport Failure Detection
Copyright © 2006 Huawei Technologies Co., Ltd. All rights reserved. Page61
Transport Failure Detection
Diameter use a heart-beat like mechanism to detect transport
failure rapidly, and to provide better failure performance.
Two messages are used for failure detection:
Device-Watchdog-Request
Device-Watchdog-Answer
Copyright © 2006 Huawei Technologies Co., Ltd. All rights reserved. Page62
Device-Watchdog-Request
The Device-Watchdog-Request (DWR), indicated by the
Command-Code set to 280 and the Command Flags 'R' bit set, is
sent to a peer when no traffic has been exchanged between two
peers.
Message format
<DWR> ::= < Diameter Header: 280, REQ >
{ Origin-Host }
{ Origin-Realm }
[ Origin-State-Id ]
Copyright © 2006 Huawei Technologies Co., Ltd. All rights reserved. Page63
Device-Watchdog-Answer
The Device-Watchdog-Answer (DWA), indicated by the
Command-Code set to 280 and the Command Flags 'R' bit cleared,
is sent as a response to the Device-Watchdog-Request message.
Message format
Copyright © 2006 Huawei Technologies Co., Ltd. All rights reserved. Page64
Failover and Failback
Failover
In the event that a transport failure is detected with a peer, it is
necessary for all pending request messages to be forwarded to an
alternate agent.
Failback
a connection request should be periodically attempted with the failed
peer in order to re-establish the transport connection. Once a
connection has been successfully established, messages can once
again be forwarded to the peer.
Copyright © 2006 Huawei Technologies Co., Ltd. All rights reserved. Page65
Failover Mechanisms
Hop-by-Hop Identification
A Diameter node will maintain a pending message queue for a given
peer. When an answer message is received, the corresponding request
is removed from the queue.
The Hop-by-Hop Identifier field is used to match the answer with the
queued request.
Message Queue for Agent_1
Hop-by-hop ID: 6044 Agent_1
Diameter
Node
Copyright © 2006 Huawei Technologies Co., Ltd. All rights reserved. Page66
Failover Mechanisms
Message Queue for Agent_1
X
Hop-by-hop ID: 6044 Agent_1
Diameter
Node
Agent_1
T Flag
Diameter T Flag
T Flag
Node
Copyright © 2006 Huawei Technologies Co., Ltd. All rights reserved. Page67
Summary
Diameter protocol is designed as the successor of RADIUS.
Diameter nodes: client, server and agent.
Diameter header and AVPs.
Diameter connection establishment, disconnection and failover.
Copyright © 2006 Huawei Technologies Co., Ltd. All rights reserved. Page68
Thank you
www.huawei.com