You are on page 1of 6

Diameter

RFC & Port:- 6733 & 3868


What is Diameter Protocol
Diameter is a next-generation industry-standard protocol used to Exchange Authentication,
Authorization and Accounting (AAA) information in Long-Term Evolution (LTE) and IP
Multimedia Systems (IMS) networks. It is an offer answer model protocol. It was derived from
and improves upon the widely deployed RADIUS (Remote Authentication Dial-In User
Service) and LDAP (Lightweight Directory Access Protocol) AAA protocols, providing more
reliable, secure and flexible transport mechanisms for mobile data networks. A variety of LTE
and IMS network functions make use of Diameter, including the Policy and Charging Rules
Function (PCRF), Home Subscriber Server (HSS) and Online Charging System (OCS)
elements. The protocol provides a general framework for exchanging AAA messages, and
specifies a standard set of AAA request and response commands and attributes.

* Relationship to SIP: -
Diameter and SIP (Session Initiation Protocol) are the core signaling protocols used in IMS
networks. SIP is used to establish and control real-time IP communications sessions. Diameter
is used to authenticate, authorize and provide accurate billing information for those sessions.

Diameter Protocol Advantages:


 A peer-to-peer architecture for greater flexibility
 Reliable transmission of AAA messages over TCP or SCTP
 Built-in fail-over mechanisms to guarantee message delivery
 Secure transmission of AAA messages using TLS or IPsec

Diameter supports the enhanced policy control, dynamic rules, quality of service, bandwidth
allocation and charging mechanisms needed for contemporary communications service provider
networks. It also provides a more reliable, secure and flexible framework for exchanging AAA
messages.

Peer-to-Peer Architecture: -Diameter is based on a peer-to-peer architecture.


The protocol defines three distinct types of nodes: client, server and agent. The diameter node
that receives the user connection request (i.e. a network access server) is referred to as the
client. The diameter node that processes the request is referred to as the server. Intermediary
nodes are referred to as agents. The protocol defines four distinct agent types: proxy, redirect,
relay, and translation.

Diameter Protocol Agents (Relay & Proxy) Functionality:


 Provide load balancing for scalability and reliability
 Perform value-added request or response processing
 Aggregate, concentrate, sort and forward requests
 Enable inter-working with legacy AAA protocols
 Mitigate multi-vendor interoperability issues

Diameter Initial connection setup call flow: -


The communication between two diameter peers starts with 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). For RFC6733
compliant peers TLS negotiation may optionally happen before the CER/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.
Diameter Structure and Headers:

Version: Version always set to be 1.

Length: It indicate diameter message length (Headers+AVP) Length.

Command Flag: It is a 8 bit integer (0-1-2-3-4-5-6-7) value describe the characteristics of


the diameter message eg: Request Answer Proxyable etc.

0 – It indicate that the message is a Request.

1 - It indicate that the message is a Proxyable. It may be modified.

2 - It indicate that the message is an Error.

3 - It indicate that the message is a potentially Retransmitted.


4 – 7 – Reserved

Command Code: It is used to uniquely identify each diameter messages. It is provided by

IANA. For all Diameter request and response command code must be same.

Eg: UAR/UAA= 300 SAR/SAA= 301 DWR/DWA= 280 MAR/MAA= 303

Used Case: Wireshark diameter filter- for see the diameter message like UAR we used

Diameter.cmd.code == 300

Application ID- It tells at which interface diameter message is flowing. Through it we can
easily identify the interface of a diameter message. Eg: UAR is flowing between ICSCF and
HSS at Cx interface and its application id = 16777216.

Used Case: Wireshark diameter filter- for see the interface of diameter message we used

Diameter.applicationID== 16777216 for Cx interface.

Hope by Hope Identifier: Every diameter message has Hope by Hope id. It changes at
every Hope. It must be same for response. It matches the response at every hope. It is used to
identify the duplicate responses.

End to End Identifier: End the End identifier does not change at every hope it is same
throughout the journey and with same response.

AVP: Attribute Value Pair- It carry the actual information of a diameter message. There
are multiple AVP in diameter message.

Some of the important AVPs listed below.

AVP: User Name- Subscriber identity like IMPI/IMSI

AVP: Public Identity- IMPU

AVP: Origin Realm- It indicated origin UAC requester domain name like Jio.com

AVP: Destination Realm- It indicated UAS receiver domain name.


AVP: Origin Host- It indicated the origin host server at which the request is originated like if
UAR origin from ICSCF.

AVP: Destination Host- It indicated the destination server at the request is received like UAR
received by HSS.

Diameter command Code and Description:

Command Application Diameter


Interface DESCRIPTION
Code Id Message
User Authentication Request/Answer. It is used between
300 16777216 Cx UAR/UAA
ICSCF and HSS to query of the SCSCF Address.
Server Assignment Request/Answer. It is used between
301 16777216 Cx SAR/SAA SCSCF and HSS. It is used to get the subscriber service data
profile.
Location Information Request/Answer. It is used between
302 16777216 Cx LIR/LIA Terminating end ICSCF and HSS. It is used to get the
address of SCSCF.
Multimedia Authentication Request/Answer. It is used
303 16777216 Cx MAR/MAA between SCSCF and HSS. It is used to get the authentication
vector.
User Data Request/Answer. It is used between TAS and
306 16777217 Sh UDR/UDA HSS. It used in third party registration to get the detail of
supplementary services like MMTEL data Sip basic data.
Profile Update Request/Answer. It is used between TAS and
307 16777217 Sh PUR/PUA
HSS. It is used for update the STN-SR.
Subscriber Notification Request/Answer. It is used between
308 16777217 Sh SNR/SNA TAS and HSS.Used to get any notification changes in third
party registration.

AA-Request/Answer. Used for resource allocation and bearer


265 16777236 Rx AAR/AAA setup request in IMS call. It is used between PCSCF and
PCRF.

Diameter common message. It is used every 2or3 sec interval


280 NA NA DWR/DWA
for peer to peer node wakeup status.
Authentication Information Request/Answer. It is used
318 16777251 S6a AIR/AIA between MME and HSS. It is used to get the authentication
vector in LTE attach.
Cancel Location Request/Answer. It is used between MME
317 16777251 S6a CLR/CLA
and HSS. Used for subscriber withdrawal.
Update Location Request/Answer. It is used between MME
316 16777251 S6a ULR/ULA and HSS. It is used during LTE Attach to get the subscriber
info like APN .QOS.

You might also like