TCP/IP Protocol: Extensible Messaging and Presence Protocol (XMPP)

Discussion in 'Linux Networking' started by Jarret W. Buse, Dec 3, 2013.

  1. Jarret W. Buse

    Jarret W. Buse Well-Known Member Staff Writer

    Messages:
    173
    Likes Received:
    256
    Trophy Points:
    63
    TCP/IP Protocol: Extensible Messaging and Presence Protocol (XMPP)

    TCP/IP has a messaging protocol called Extensible Messaging and Presence Protocol (XMPP). XMPP is a protocol designed for applications for communications such as Instant Messaging (IM).

    XMPP is an open standard so it can be implemented by any person wishing to use it in their application. Implementations have been in such areas as file transfer, gaming, social networking and the like.

    XMPP tracks the presence of a client, which means when a client logs into a system, such as their e-mail, they are noted as being “present”. Clients which are “present” can be contacted since they are online and logged into the server. Clients may optionally specify they are busy so they cannot be disturbed. Each application using XMPP can supply its own “presence” variants. The ability to track a client also allows each client to maintain a contact list. The contact list is a local list of clients for whom the local user wants to be able to see their “presence” and be able to instantly contact the other client. The contact list is usually a list which can be clicked to open communications with the other client.

    XMPP was originally known as “Jabber” and was developed by Jeremie Miller in 1998, but not released until 1999. The first IM based on Jabber was Jabber.org.

    Google introduced Google Talk in 2005 which used XMPP for IM as well as Voice over IP (VOIP) and file transfer. Facebook also uses some XMPP functionality for chatting on its site. Microsoft also uses some XMPP features in its Microsoft Messenger application. Some XMPP support is used by Skype as well.

    XMPP can be utilized not only on the Internet, but within a company Intranet to allow employees IM ability.

    XMPP can be separated from public XMPP by use of security features. The security features are built into XMPP by Simple Authentication and Security Layer (SASL) or Transport Layer Security (TLS).

    SASL is a Protocol which allows applications to use the authentication feature of SASL without requiring the feature to be built-in to the application. SASL features are usually supplemented with TLS as a complimentary service. TLS is an encryption service which works at Layers 5 and 6 of the OSI Model. Layer 5, the Session Layer, performs the handshakes to create the session between the two XMPP clients. Once the Session is established, the TLS portion which operates at Layer 6, the Presentation Layer, encrypts the information.

    NOTE: TLS is the service which came before Secure Sockets Layer (SSL). SSL is a newer version of TLS which also encrypts information. Encryption is sometimes referred to as cryptography.

    So when SASL and TLS are used, SASL allows for authentication of the clients while TLS encrypts the information between the clients so the data is not easily viewed.


    One main requirement for XMPP is an XMPP Server. The server can connect to other servers to allow a larger XMPP number of clients to communicate. The servers are not a central authority, but the system is decentralized. The servers do not keep a central list of user IDs.

    On the Jabber network, a Jabber ID (JID) is used by each client. Each server provides a unique user name or IP Address. A JID is usually a username@XMPP-server.com. Each client can have multiple ways to access their account which are placed in a priority. For example, a client can have an account for Home, Office and Mobile. The Home account may have a higher priority than Office which has a higher priority than Mobile. When a message is sent to username@XMPP-server.com it first attempts the Home, then the Office and finally the Mobile resource. If a message is sent to username@XMPP-server.com/Office it will only go to the Office resource.

    XMPP was originally set up as a TCP transport. TCP provided a guaranteed delivery of messages. Another transport created was HTTP. HTTP allowed XMPP to be used more easily through firewalls by being sent as HTTP requests in the same way a browser requests a web page. The requests required the XMPP application to send requests to the XMPP server at specified intervals to check for messages. The method of the client requesting the data is called polling. The other HTTP method is binding. Binding methods allowed an XMPP server to push the messages to the client when the server receives them. The binding method works faster and better than the polling method which explains why the polling method is considered obsolete.

    A lightweight XMPP Server for Linux is Prosody. It can be installed by typing the following: “sudo apt-get install prosody” and following any instructions.

    Once installed, the configuration file is stored in /etc/prosody/prosody.cfg.lua. In the file there is a section on Global Settings. Here is where you add a line to set up your host names. For host names to be “jbuse.com”, the line would look like VirtualHost “jbuse.com”. Now when a user is added, the JID would be username@jbuse.com. To create an account, there are multiple ways to do it. One way is the command line by typing: “prosodyctl adduser jarret@jbuse.com”. The command adds a user named “jarret”. Once the user name is entered you will be prompted for the password. An XMPP client for Linux, such as Pidgin, works well.

    NOTE: These applications are listed for examples. You may try these applications or look for others that may work better for your needs.

    Attached Files:

    • slide.jpg
      slide.jpg
      File size:
      56.3 KB
      Views:
      209,435
    DevynCJohnson likes this.
  2. Simon Mitchell

    Simon Mitchell New Member

    Messages:
    2
    Likes Received:
    1
    Trophy Points:
    3
    Really enjoyed reading this. I didn't know that you could install lightweight XMPP Server for Linux so easily.
  3. Jarret W. Buse

    Jarret W. Buse Well-Known Member Staff Writer

    Messages:
    173
    Likes Received:
    256
    Trophy Points:
    63
    It is amazing how simple some things can be until you try them. Some apps are made very simple. It all depends on the programmer. Thanks for reading.

Share This Page