Before we go into the details of the Diameter User Session; first we would try to explain about most common problem that is, What is the difference between Session and Connection.
Now Connection is the Transport layer level activity, such as TCP connection or SCTP connection etc. while session is logical entity between two applications i.e. application layer activity.
There is one more thing which usually conflict with Session State is Transaction state.
Transaction state is different than session states, Transaction state is maintained by the Diameter agents and last only to one message (Request and Response) exchange; means Diameter Agent sends a request and receives the answer for that Request. This is the map maintained by the Diameter Agent per message. For more detail go to Diameter Message Flow. While the life time of the session state can be of one transaction or more than one transactions.
Now i would explain the Session State maintained by Diameter Client and Diameter Server in generic form if both are Stateful.
Suppose that Client initiates a request toward Server. if client wants that whole interaction to be Stateful it MUST send the Session-Id AVP (Unsigned Value (Say 100)) in the Request. which is the indication to the server that now both client and server shall maintain the states. And all Subsequent messages during that session MUST contain the Session-Id AVP with the same value (ie. 100). If Subsequent messages do no contain the same value of Session-Id AVP, then they are supposed as the messages of some other session.
There are various AVPs to define the Duration of the Session ie LIFE-TIME of session. But here we are considering in our example that session is maintained until the Session-Termination-Request is received.
Now Following images will explain, what actually happened and what are the state maintained my Client and Server.
Now Connection is the Transport layer level activity, such as TCP connection or SCTP connection etc. while session is logical entity between two applications i.e. application layer activity.
There is one more thing which usually conflict with Session State is Transaction state.
Transaction state is different than session states, Transaction state is maintained by the Diameter agents and last only to one message (Request and Response) exchange; means Diameter Agent sends a request and receives the answer for that Request. This is the map maintained by the Diameter Agent per message. For more detail go to Diameter Message Flow. While the life time of the session state can be of one transaction or more than one transactions.
Now i would explain the Session State maintained by Diameter Client and Diameter Server in generic form if both are Stateful.
Suppose that Client initiates a request toward Server. if client wants that whole interaction to be Stateful it MUST send the Session-Id AVP (Unsigned Value (Say 100)) in the Request. which is the indication to the server that now both client and server shall maintain the states. And all Subsequent messages during that session MUST contain the Session-Id AVP with the same value (ie. 100). If Subsequent messages do no contain the same value of Session-Id AVP, then they are supposed as the messages of some other session.
There are various AVPs to define the Duration of the Session ie LIFE-TIME of session. But here we are considering in our example that session is maintained until the Session-Termination-Request is received.
Now Following images will explain, what actually happened and what are the state maintained my Client and Server.
![]() |
Client and Server Exchanging Messages during a Session. |

Session State at client Session State at Server
In the same way Authorization and Accounting Session States are maintained, with the help of their specific session AVPs.
Your Comments/Suggestions and Questions are always welcome. We would try to clarify doubts with best of our knowledge. So feel free to put Questions.
Your Comments/Suggestions and Questions are always welcome. We would try to clarify doubts with best of our knowledge. So feel free to put Questions.