Election Process

Here we are discussing what shall happen when both nodes shall send the CER at the same time to each other. 

First message that is exchanged as soon as Transport Connection is established is CER, In general Node acting as a client shall send the CER message toward server. But it is not hard and fast that only client can send the CER; Node acting as a server can also send the CER. Moreover some time it is difficult to judge which is server and which is client; Because both are intermediate nodes. So server can also trigger the CER message.

Now if both nodes shall trigger the CER message at the same time; then two diameter connection shall be established but there is no way to make two diameter connection between two nodes. In this case one diameter connection MUST be dropped. Which connection to be dropped shall be identified by Election Process.

In Election Process; each node lexicographically [Dictionary Order] compares the Origin-Host Id of its own with the Origin-Host Id received in CER message. Node that has Higher Origin host wins ELECTION and terminates the connection initiated by it. The connection on which winner shall send CEA shall be used for further message communication.

In Dictionary Order 'b' succeeds 'a' and 'c' succeeds 'b' so Node with Diameter identity 'b' wins election if node 'a' is peer; then node 'b' shall terminate the DIAMETER connection initiated by it. Identity comparison is case insensitive.


8 comments:

  1. Hi,

    If we don't implement this elect function. Server just assume to wait CER sending from client. Can this be feasible?

    BRs,
    Ryan.

    ReplyDelete
    Replies
    1. Hi Ryan,

      Whatever explained in above article is what suggested by RFC 6733.

      Generally during implementation of DIAMETER server and client. Election Process is skipped, Server just sits waiting for CER from client and replies with CEA. Rather than triggering CER as soon as transport connection is established.

      Thanks for your query.

      Happy to help you again.
      Team-Diameter

      Delete
    2. Thanks Team-Diameter,

      I will keep in touch with you and keep learning with you!

      BRs,
      Ryan.

      Delete
  2. Nice Explanation of Election Poll

    ReplyDelete
  3. When is diameter result code "ELECTION_LOST" sent & in which msg? Since connection is terminated by the host which won the election, how will this error be sent?

    ReplyDelete
  4. But what happens when both have the same origin state id and can it happen?
    PS: I am a newbie.

    ReplyDelete
    Replies
    1. Hi Naresh Bohra,

      Origin-Host value that comes under Origin-Host AVP CER-CEA message shall be used in election process instead of "origin state id".

      If two nodes have same Origin-Host and they exchange CER-CEA that means invalid network planning, Because CER-CEA are exchanged between two immediate peers CER-CEA neither relayed and proxied (Forwarded to third node).

      "origin state id" have some different purpose given in following link.
      http://diameter-protocol.blogspot.in/2011/05/transport-failure-detection.html


      Thanks for your query.
      Happy to help you again.
      Team-Diameter

      Delete
  5. is it possible to send More than one CER concurrently to server from client and skip election process. means send multiple message concurrently.
    We are sending charging request to Diameter from API gateway, so on API gateway there will be more than one charging request at same time, so each time i'm initiating a new connection and after receiving answer from server.

    ReplyDelete