Can anyone one tell me how to know the message transmission flow?

I want to know the whole flow about sending a message from one user then receiving with another user that’s how is the function called step by step. however there are too many threads in the openfire project so It’s hard to trace the flow by debuging. who can help with this problem? thanks a lot.