Static vs ephemeral diffie-hellman I feverishly searched the web and couldn't find a clear explanation about what exactly is &quot;Ephemeral diffie-hellman&quot;. Let's briefly recall how diffie-hellman basically works:

Bob and Alice agree publicly on a generator ($g$) and a prime modulo ($p$)
Bob selects a private integer ($b$) and computes $B=g^b \bmod p$. He then passes $B$ publicly to Alice
Alice selects a private integer ($a$) and computes $A=g^a\bmod p$. She then passes $A$ publicly to Bob.
Bob computes $K = A^b\bmod p$
Alice computes $K = B^a\bmod p$

So now Bob and Alice both have $K$.
The explanations I see on the web are all sorts of:

Ephemeral Diffie-Hellman (DHE in the context of TLS) differs from the static Diffie-Hellman (DH) in the way that static Diffie-Hellman key exchanges always use the same Diffie-Hellman private keys. So, each time the same parties do a DH key exchange, they end up with the same shared secret.

First to verify some issue: Are &quot;private keys&quot; in the context of diffie-hellman refer to the private $a$ and $b$ that Alice and bob privately select respectively? I'll assume they do, if not - correct me please.
Now, what I don't understand here is, what does it mean that &quot;static DH exchanges always use the same Diffie-Hellman private keys.&quot;? I mean:

What is considered an exchange? A session of information exchanging between to parties?
If so, does static DH refer to exchanges between the same two parties?
If not so, considering that, seemingly, using static DH also requires the use of the same $g$ and $p$, how does using static DH will always generate the same $K$?

It'll be great if someone could clarify this whole subject. Thanks
Are &quot;private keys&quot; in the context of diffie-hellman refer to the private $a$ and $b$ that Alice and bob privately select respectively?

Yes, correct. Similarly, $A=g^a\bmod p$ and $B=g^b\bmod p$ are also called the &quot;public keys&quot;.

What is considered an exchange? A session of information exchanging between to parties?

An exchange is an execution of the Diffie-Hellman protocol. This happens whenever either a party feels like it or a party has forgotten the resulting shared secret from the last execution. In the context of the internet this usually means that if you connect to, say, Stack Exchange today it will run a Diffie-Hellman exchange. Then when you shutdown your computer it will &quot;forget&quot; the resulting shared secret $K$ and tomorrow when you connect to Stack Exchange again, it will have to run another Diffie-Hellman exchange.

If so, does static DH refer to exchanges between the same two parties?

In a static exchange usually both parties always reuse their private keys, which implies that if they re-run the Diffie-Hellman exchange more than once with each other they always get the same shared secret $K$.
Indeed getting a shared secret the same shared secret between Alice and Bob and Alice and Charlie has a negligible probability if everyone involved picked their private keys properly and the protocol was followed.