An Introduction to XMPP: the Future of Instant Messaging

NOTE: This article is still in beta. Please do not distribute widely.

The State of Instant Messaging

There is no question that instant messaging (IM) has changed how people communicate; unlike e-mail, users can interact in real-time, and with the prevalence of always-on broadband connections in recent years, people can now do so much more conveniently. To facilitate the use of Instant Messaging, companies like America On-Line (AOL), Microsoft, and Yahoo! run services to which people connect and chat with their friends and family. These three companies all manage their own clusters of computers which provide their respective services: AOL Instant Messenger (AIM), MSN Messenger, and Y! IM. Each company also develops an official client which connects only to its service, and typically hosts an advertisement to generate revenue. Since each service is in direct competition with the others, a user of, say, AIM, cannot use the official AIM client to talk to a user of MSN. Instead, for two users to talk to each other, both users would need to have at least one service in common. For this reason, users tend to use the service that most or all of their friends use. Of course, a user is free to run multiple client programs (or one third-party client) to connect to multiple services, if one wishes, but in the interest of simplicity, this is generally avoided. It also seems that the most popular service varies by country—I found that AIM is the most popular in the United States, MSN in Canada, and ICQ (which AOL now controls) in other continents.

So what's wrong with this? I think most users would agree that outages of these services are rare and that they seem to do the job they were designed to do, and that's true for the most part. However, there is a fundamental problem with each of these services: the protocols are all proprietary. In each case, a large corporation controls the protocol 1) and the features it has. This means that it is up to the maintainers of the protocols to add support for useful features like voice and video chatting, or shared whiteboards. Further, in order to use AIM/ICQ, MSN, or Yahoo IM, you must register with the service, and because of that, AOL, Microsoft, and Yahoo control the userbase of today's instant messaging. You therefore cannot trust the security or privacy of your conversations, even if you connect over an encrypted connection, as it is still possible for the services to log what you say for any purpose. As it is, how these services make up the vast majority of instant messaging is analogous to three major telephone companies that cannot interoperate; to speak with a friend on a carrier other than yours, you must subscribe to their carrier. Why do we tolerate this scenario in the IM market, even if the major services are free?

Enter Jabber and XMPP

In 1998, Jeremie Miller created the Jabber project which addresses these issues. The original protocol has evolved into XMPP (eXtensible Messaging and Presence Protocol), which is a well-documented and open protocol (RFC 3920, RFC 3921) with the purpose of providing a standard way to exchange data in a real-time fashion. One of the uses of XMPP is to provide instant messaging capabilities. (More about the names Jabber and XMPP here…)

Why XMPP Is Better Than Legacy IM Services

Free and Open

First and foremost: since XMPP is open and standardized, no company or individual owns rights to it, and it can be implemented by anyone for use in any product without royalties. This means that anyone can run an XMPP server and run his or her own XMPP chat service. It also means that software developers can write XMPP servers and client programs for fun or profit, giving end users the freedom of choice of which client best suits their needs, and no one company has to end up controlling the userbase.

As the name implies, XMPP is extensible, which means software developers add features like shared whiteboards, voice chat and video chat into their client applications. Coccinella is one such XMPP client that has an integrated whiteboard. Users of Coccinella can talk to other XMPP users just fine, and collaboratively draw on a shared whiteboard with fellow users of the program. While this sounds a bit proprietary, such features are under standardization by the Powers That Be; for example, a detailed extension for whiteboards has been proposed. Once approved by the XMPP Standards Foundation, may other clients other than Coccinella can freely implement this idea and seamlessly interoperate with users of all standards-supporting clients. Again, this gives the user freedom of choice.

Secure

Because anyone can run his own XMPP service, some guarantees can be made about the security and privacy of data. That is, if the configuration of the server is managed by a trusted party, and all links to the service are encrypted, man in the middle attacks can be eliminated, and server-side logging of conversations can be controlled or disabled. For this reason, companies 2) and universities 3) tend to find XMPP as an excellent solution for secure and flexible communication for members.

Federated

Even though XMPP services can be run by anyone (companies, organizations, individuals, really anyone), the protocol supports this seamlessly. As long as the parties running XMPP services allow server-to-server communication, they are part of the federated network of XMPP servers. Any user on a federated server should be able to talk to any other user on any other federated server. I explain how this is done in the coming sections with the concept of Jabber IDs.

Features

As briefly mentioned above, XMPP is extensible and puts feature expansion in the hands of developers, and once standardized, the client-indepedent extensions can be implemented by and interoperate with a number of different client applications. Eh? In English, this means that XMPP clients are not restricted to what a single entity (e.g. AOL) decides is sufficient for the service. Take offline messaging for example. If you use AIM, you cannot leave messages for offline buddies without special services or sketchy client features that won't work if you are offline yourself. Most XMPP servers, however, support this feature natively. You can leave messages for your friends while they are offline and those messages will be stored on the server and delivered when they log in. Even the timestamps of the messages are preserved on supporting clients. Of course all of the standard features like away messages and invisibility and file transfers are supported, too, by XMPP. And, as mentioned before with regard to openness, clients can implement features like whiteboards and audio/visual communication on top of XMPP without a problem. Doing so without special support in the protocol is simply not possible in the legacy IM protocols.

Personalization and Branding

While a minor point to most people, the XMPP concept allows for custom branding in the IM market. That is, the namespace of the AIM and Yahoo IM services is global: no two people can share the same “screenname”, which results in ugly, hard to remember names like 'johnsmith52349' or some variation thereof. The equivalents in XMPP-land are called Jabber IDs, which are based on Internet domains, just like email addresses.

How XMPP Is Different

No Single Service

As it should be clear, there is no single XMPP service that provides access to the XMPP network. To talk to XMPP users, you simply need an account on a federated XMPP server. Perhaps the most popular free XMPP service is the one run by the Jabber Software Foundation. Typically, signing up for an account translates to clicking a 'Register' button in a client program that supports XMPP. More on this later. You may choose any XMPP service provider you wish, or you may run your own. More on this later, too.

Jabber IDs vs. Screennames

Legacy IM services, particularly AIM, have adopted the term “screenname” to refer to account names of people on their services. XMPP also has accounts, as one might expect, but they are a little different. Since there are many services run by many different people, there has to be a fundamental way to separate these domains but still share a common format. These account names are referred to as Jabber IDs, and look exactly like e-mail addresses. Thus, Juliet Capulet might have a Jabber ID of juliet@capulet.com. Here, juliet would be her username on the XMPP service run on capulet.com. If she had registered with the Jabber Software Foundation's XMPP service, her Jabber ID might instead be juliet@jabber.org. Of course, her username on jabber.org would depend on if it were already taken. There is a clear advantage here over traditional screennames: by having IDs that resemble e-mail addresses, it is trivially possible to have identical e-mail addresses and Jabber IDs, thus having only a single identity to remember. In fact, this is the case for Gmail users, as Google Talk uses XMPP, and is a federated service.

Adoption and the Future With XMPP

XMPP got a significant push when Google launched their XMPP-based gtalk, their solution for instant messaging, mail notifications, file transfers, and voice communication. When gtalk was initially launched in August 2005 4), it was was a closed service, meaning only Gmail users could converse on it. However, the engineers flipped the switch in January 2006, opening gtalk to server-to-server communication. Now all gtalk users can talk to any other federated XMPP user, regardless of the other service used. Further, since gtalk is XMPP-compliant, any XMPP client program is capable of logging into Google's XMPP service. If you are a Gmail user, this means you can use the XMPP account you already have with any XMPP client you wish and share the same e-mail address (you@gmail.com) that you already use as your Jabber ID. Again: choice and simplicity for the end user.

The movement to XMPP has not gone unnoticed. Even the IM giant AOL has started working on an XMPP gateway that current AIM/ICQ users can log into. Reports indicate that it is not federated at this time, but hopefully will be in the future.

Using XMPP

I hope I have made the advantages of XMPP clear, and if you've made it to this point, perhaps you are convinced enough to try out this XMPP thing. Thankfully doing so is no more involved or difficult than what you may be used to with other IM services. If you are still a bit reluctant to switch to XMPP because you're not sure that your friends will, note that several major IM clients that you may already use, such as Pidgin, Adium, or iChat, all natively support seamless Jabber/XMPP integration with other IM protocols, so you can be logged into your favorite XMPP service and AIM at the same time, with only one program. Thus, you need switch immediately to XMPP, but instead gradually as more and more if your contacts begin using XMPP as well.

Now we begin.

Picking a Client Application

Just like with the legacy IM protocols, you need a program for your computer can connect to the IM service. However, there is no 'official' XMPP client, so you have some choice here. There is a list of clients on Wikipedia and a more extensive list at jabber.org if you'd like to know all of your options. In this article I will be covering the basics of two clients, covering the three major platforms: Adium (Mac OS X) and Pidgin (Windows, Linux). Other clients are very similar to set up.

Choosing an XMPP Service

Next you will need to find an XMPP service that you like. There is a rather large list of public Jabber servers provided by the Jabber Software Foundation, and another list at jabberes.org. I recommend finding one that at least supports TLS or SSL encryption. However, if you're not too interested in looking, you can stick with the default discussed here, which is jabber.org, run by the JSF. Keep in mind that the service you choose will determine the domain in your Jabber ID (the part following the '@', i.e. you@jabber.org).

Sign Up for an Account

This is the easiest part. Once you have picked out a service and downloaded your client, you need to create an account on that service. This registration is typically done in the client application, but may also be possible via the Web.

Pidgin

  1. Go to Accounts > Manage in the menu.
  2. Click the Add button.
  3. Select XMPP as the protocol.

You should then see something like the following.

Adding an XMPP account in Pidgin

Here, my Jabber ID will end up being f0rked@jabber.org. The screenname and password here are up to you, and the checkbox at the bottom indicates that you wish to create an account on the server. Once you click Save, Pidgin will attempt to register an account with jabber.org. If it is successful, you can check the Enable checkbox in the Accounts window to connect and start adding new contacts just as normal. Just remember that XMPP contacts are always of the form user@domain.

If Pidgin attempts to register and returns a “Read Error”, then the username you chose is probably already taken, and you should try a different username.

Adium

Select Preferences from the Adium menu. Select the Accounts tab.

Adium accounts tab

Click the + in the bottom left, select Jabber

Adium protocol list

Simply enter the desired Jabber ID (the domain must be a valid XMPP server) and password, and click OK.

Adium new account credentials

You should be get something like this in response. Select Register.

Adium register new account

If all goes well, you should now be able to add contacts.

If Adium complains about a “Read Error”, the Jabber ID you chose is probably already taken, try choosing another and reregistering.

More..

  • Resources
  • Openfire/Jabberd2

Article originally written: 2008-03

 
articles/xmpp.txt · Last modified: 2008/08/01 03:40 by f0rked
admin | login | sitemap
Recent changes RSS feed Creative Commons License Valid XHTML 1.0 Valid CSS Driven by DokuWiki