Kamal Kumar
Kamal Kumar

Reputation: 194

how to handle DPR in diameter and when DPR will send? is any condition for sending DPR?

I want to know that: how to send DPR in diameter. Is there any particular condition for sending DPR? In my code I have already done DWR & DWA and CEA & CER. DPR is sent after CER or before CEA.

Upvotes: 0

Views: 2813

Answers (2)

DVingarzan
DVingarzan

Reputation: 21

Or explained in short: if you cut the TCP/SCTP connection without sending DPR, the other side will assume that there was a networking issue and will, most likely, attempt to reconnect immediately.

With DPR, in the Disconnect-Cause AVP you can specify the reason:

  • REBOOTING(0) - you may reconnect, but sounds like later
  • BUSY(1) - you should not reconnect, this node is overloaded, try to find alternatives
  • DO_NOT_WANT_TO_TALK_TO_YOU(2) - if you try to reconnect, it will be rejected (the peer connection was most likely unconfigured)

(The somehow still open questions: is the DPA is really needed, how long should the other side wait for it, etc.)

Upvotes: 1

Oded Itzhaky
Oded Itzhaky

Reputation: 445

DPR means a Diameter peer wants to disconnect from a Diameter peer its currently connected to.

Its all on the base RFC. I suggest to read every command you want to implement:

rfc 6733:

5.4. Disconnecting Peer Connections

When a Diameter node disconnects one of its transport connections, its peer cannot know the reason for the disconnect and will most likely assume that a connectivity problem occurred or that the peer has rebooted. In these cases, the peer may periodically attempt to reconnect, as stated in Section 2.1. In the event that the disconnect was a result of either a shortage of internal resources or simply that the node in question has no intentions of forwarding any Diameter messages to the peer in the foreseeable future, a periodic connection request would not be welcomed. The Disconnection-Reason AVP contains the reason the Diameter node issued the Disconnect-Peer- Request message.

The Disconnect-Peer-Request message is used by a Diameter node to inform its peer of its intent to disconnect the transport layer and that the peer shouldn't reconnect unless it has a valid reason to do so (e.g., message to be forwarded). Upon receipt of the message, the Disconnect-Peer-Answer message is returned, which SHOULD contain an error if messages have recently been forwarded, and are likely in flight, which would otherwise cause a race condition.

The receiver of the Disconnect-Peer-Answer message initiates the transport disconnect. The sender of the Disconnect-Peer-Answer message should be able to detect the transport closure and clean up the connection.

Upvotes: 1

Related Questions