Difference between Session Timeout and Heartbeat in always on What is the difference between Session Timeout and Heartbeat in always on...
My Network is laggy and i get frequent connection timeout error on error logs and also at the I see missed heartbeat errors on the failover cluster errors ....Which settings should I change. Crossing which thresholds forces a failover---Session timeout or heartbeat ?

Will appreciate any help. Thanks
Heartbeat is what will determine if a node is down and initiate a failover.  Session timeout could be from the client, server to server, or other network related issues.  it seems like you are having several network issues.  

You don't have to have a dedicated heartbeat network but if you don't, it does expose you to broadcast storms and other issues that might hit your main network.

AlwaysOn runs on and uses the WSFC APIs but if you have a bad laggy network, it's best to resolve that or at least put your servers on separate network hardware/VLAN/subnet/etc than the clients if that is what is needed to resolve this.  Regardless, you will want to ensure a healthy heartbeat at a minimum.  

WSFC Inter-node Health Detection and Quorum Voting


  Each node in a WSFC cluster participates in periodic heartbeat
  communication to share the node's health status with the other nodes.
  Unresponsive nodes are considered to be in a failed state. A quorum
  node set is a majority of the voting nodes and witnesses in the WSFC
  cluster. The overall health and status of a WSFC cluster is determined
  by a periodic quorum vote. The presence of a quorum means that the
  cluster is healthy and able to provide node-level fault tolerance. +


If you need a quicker bandaid or perhaps you just have to deal with the latency/network issues you can change the value of the timeout to something that works better for your environment. 


  Run command prompt as administrator. Execute the following to change
  the same-site heart beat to 2 seconds (replace clustername with the
  actual WFC name). 


cluster /cluster:clustername /prop SameSubnetDelay=2000:DWORD 



  Execute the following to change the
  cross-site heart beat to 4 seconds (replace clustername with the
  actual WFC name). 


cluster /cluster:clustername /prop CrossSubnetDelay=4000:DWORD 



  Execute the following to change the
  same-site ping loss threshold to 10 lost pings (replace clustername
  with the actual WFC name). 


cluster /cluster:clustername /prop SameSubnetThreshold=10:DWORD 


  Execute the following to change the
  cross-site ping loss threshold to 10 lost pings (replace clustername
  with the actual WFC name). 


cluster /cluster:clustername /prop CrossSubnetThreshold=10:DWORD 


With Powershell:


  Run PowerShell as administrator. Import the FailoverClusters module.


Import-Module FailoverClusters 



  Execute the following to change the
  same-site heart beat to 2 seconds (replace clustername with the actual
  WFC name). (get-cluster).SameSubnetDelay = 2000 Execute the following
  to change the cross-site heart beat to 4 seconds (replace clustername
  with the actual WFC name). 


(get-cluster).CrossSubnetDelay = 4000



  Execute the following to change the same-site ping loss threshold to
  10 lost pings (replace clustername with the actual WFC name).


(get-cluster).SameSubnetThreshold = 10 


  Execute the following to change
  the cross-site ping loss threshold to 10 lost pings (replace
  clustername with the actual WFC name).
  (get-cluster).CrossSubnetThreshold = 10


Note in no way is this a recommendation to run this on your production systems without first testing it and getting the wider group such as network and server admins involved