eXtensible Messaging and Presence Protocol (XMPP) is a protocol to stream XML elements for messaging, presence and request-response services. It is mainly used in building IM and presence based applications. The protocol is not coupled to any network architecture, but it’s generally used in client-server architecture. An XMPP server can communicate with its clients (recommended port: 5222) or with other XMPP servers (recommended port: 5269) over a TCP connection. An example network architecture could be like The gateway is necessary to translate the messages between a non-XMPP server and an XMPP server. All XMPP messaging happens in the form of Streams and Stanzas. Stream is the container for all messages sent from one entity to the other. A stream is initiated with a stream > tag and is destroyed with a / stream > tag. Multiple XML elements can be sent over the connection before the stream is closed. These streams are unidirectional i.e. if a client initiates a stream with the s...