Sign up for PayPal and start accepting credit card payments instantly.

Thursday, October 4, 2007

Diameter ( Part 3 )

Error handling

Errors in the Diameter fall into two categories: protocol errors and application errors. Protocol errors refer to something being wrong with the underlying protocol used to carry Diameter messages, perhaps incorrect routing information or temporary network failure.

Applications errors, on the other hand, result from the failure of the Diameter protocol itself, and there are plenty of sources that will cause application errors. For example, when a mandatory AVP is missing in a particular Diameter command, a DIAMETER_MISSING_AVP error code is returned. Every response message in Diameter will carry a Result-Code AVP, and the receiver of a response message can check this AVP to see if the previous message was successfully processed.

To support early connection failure detection, the Diameter protocol defined a Device-Watchdog-Request message. When two connected Diameter nodes don't exchange messages for a certain length of time, this message is sent from either of these nodes to detect possible network problems. The discussion of algorithms to detect transport failures is beyond the scope of this article, but if you are interested in this topic, you can refer to the AAA Transport Profile (see Resources) for more information.

The Diameter protocol shares the same semantics of error code definition as the HTTP protocol. The return status of messages can be easily identified by checking the first digit of the return code:

  1. 1xxx: means the request can't be satisfied and additional information is required for the service to be granted.
  2. 2xxx: means the request was processed successfully.
  3. 3xxx: means there was a protocol error when transmitting a Diameter message. Generally, a Diameter proxy should try to fix this problem by either routing the message to another Diameter server, or by keeping the message in a local cache and sending it again later.
  4. 4xxx: means the requested message cannot be satisfied at the moment, but it might work in the future. An example is a server that temporarily lacks physical storage space to handle any incoming requests.
  5. 5xxx: means there was an application error when the server was processing the request message. The sender should not try to send the same message again. Instead, the sender will have to determine the cause of the application error by checking the error code, and then fix the problem.

Besides the Return-Code AVP, the message sender can also check other AVPs that carry additional information for error handling. The Error-Message AVP carries human readable error messages and can be used to determine the actual cause. The Error-Reporting-Host AVP contains the identity of the host generating the Result-Code. This AVP is very helpful for troubleshooting to spot the location of a problem. The Failed-AVP contains the group of AVPs that caused the exception.

After an error has been detected, the sending node forwards all pending messages to an alternative Diameter node. This process is called FailOver. A pending message is a message that has been sent, but hasn't received its corresponding answer yet. It is required for each Diameter node to keep a local copy of its outgoing messages. The Hop-to-Hop Identification within each message is used to reference out-going messages for each target peer. However, this process may cause a Diameter node to receive an identical message more than one time. As a result, the Diameter node must use the combination of End-to-End Identification message header and Original-Host AVP to uniquely identify a message coming from a specific Diameter node.

Table 2 summarizes some significant changes between the Diameter and RADIUS protocols:

Table 2. Comparison of Diameter and RADIUS protocols

Diameter

RADIUS

Transportation Protocol

Connection-Oriented Protocols (TCP and SCTP)

Connectionless Protocol (UDP)

Security

Hop-to-Hop, End-to-End

Hop-to-Hop

Agent Support

Relay, Proxy, Redirect, Translation

Implicit support, which means the agent behaviors might be implemented in a RADIUS server

Capabilities Negotiation

Negotiate supported applications and security level

Don't support

Peer Discovery

Static configuration and dynamic lookup

Static configuration

Server Initiated Message

Supported. for example, re-authentication message, Session termination

Don't support

Maximum Attribute Data Size

16,777,215 octets

255 octets

Vendor-specific Support

Support both vendor-specific messages and attributes

Support vendor-specific attributes only

In summary

In this article, we have gone through the Diameter base protocol from many aspects, including the role and responsibility of different Diameter nodes, the anatomy of a Diameter message, and how messages are sent and received. You have also been given a brief overview of how AAA and Error Handling are achieved in Diameter.

After reading this article, you should have a sense of how the Diameter protocol works and have the base knowledge for exploring it in more detail.

In addition to SIP, Diameter is the other core protocol used in the IP Multimedia Subsystem (IMS) architecture, both in the service plane and the control plane. IMS defines a set of reference points between different IMS entities and some of them use Diameter as the underlying protocol to exchange subscription-, presence-, and billing-related messages. For example, the Sh reference point in IMS defined a set of Diameter messages for subscription and notification purposes.

As IMS continues to evolve, we believe there will be more Diameter applications to come, as well as Diameter-related implementations.

---------------end-----------------

No comments:

Post a Comment