如何处理直径的 DPR 以及 DPR 何时发送?发送 DPR 有什么条件吗?

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

我想知道:如何在直径上发送DPR。发送 DPR 有什么特殊条件吗?在我的代码中,我已经完成了 DWR & DWA 和 CEA & CER。 DPR 在 CER 之后或 CEA 之前发送。

DPR 表示 Diameter 对等点想要与其当前连接的 Diameter 对等点断开连接。

它全部在基础 RFC 上。我建议阅读您要执行的每个命令:

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.

或简而言之解释:如果您在不发送 DPR 的情况下切断 TCP/SCTP 连接,另一方会认为存在网络问题,并且很可能会立即尝试重新连接。

使用 DPR,在 Disconnect-Cause AVP 中您可以指定原因:

  • REBOOTING(0) - 您可以重新连接,但听起来像是稍后
  • BUSY(1) - 你不应该重新连接,这个节点超载了,尝试寻找替代方案
  • DO_NOT_WANT_TO_TALK_TO_YOU(2) - 如果您尝试重新连接,它将被拒绝(对等连接很可能未配置)

(不知何故仍然悬而未决的问题:是否真的需要 DPA,对方应该等待多长时间等)