If the client device performs 3 DH key exchanges with the 3 Tor relay devices, how does Tor provide anonymity to the client; wouldn't the IP address of the client be seen during the key exchange?? How does Tor prevent this??
The client only directly talks to the entry node. It talks to the second node through the entry node, and to the third node through the second node. Only the entry node knows the client's IP. The entry node does not know the third node or the final destination that the client is communicating through Tor with.