Routing loop prevention in an SR node relies on the evaluation of a set of candidate next hop peers that are returned by each forwarding lookup (which is a realm routing lookup based on destination DI in the request message). The following peers are excluded from this set as next-hop candidates:
Peer from which the request is received
A peer from which a DIAMETER_UNABLE_TO_DELIVER (3002) or DIAMTER_TOO_BUSY (3004) answer was received for the request.
If an error message with the result-code AVP of DIAMETER_UNABLE_TO_DELIVER (3002) or DIAMTER_TOO_BUSY (3004) is received, the Diameter client should use an alternate route to deliver this message (ยง7, example relevant to Figure 7 in RFC 6733, Diameter Base Protocol).
Any peer identified in the Record-Route AVP of received request message (see the Diameter Multi-Chassis Redundancy section).
The remaining peers are evaluated and the one with the numerically lowest preference value is selected as the next-hop peer.