Plenty of information on how to do that, look at the federation documents and choose which option works best for you, and no, messages don't go directly from one client to the other one, all traffic goes through the IM&P server for compliance purposes.
HTH
java
if this helps, please rate