XMPP vs. IRC

I've been digging XMPP lately, mainly to see if I can replace an IRC daemon I'm running with ejabberd. The result? No go.

XMPP

XMPP, formerly known as jabber, is a protocol for instant messaging (but not only for that), built on the XML. You know, a lot of nested <tags>. It's a serious project and it wants to be something widely used, something that will last. So you have a protocol and a lot of extensions to the protocol (for file sharing, for multi-user chat, for whatever you want). In theory, it could replace IRC. The real cool feature of XMPP is that, always in theory, a single account can talk to all the other account of the world. Exactly like the mail. You can send mail from your domain to a Russian obscure domain without even noticing. So you can run your own pet jabber service and let it talk to the other servers or the world. In practice, you probably want to have multiple accounts, like you probably have more email accounts, one for the serious stuff, one for the fun, one as a puppet account (and possibly more).

IRC

The Internet Relay Chat is another protocol, which in its core is older than the WWW. All the hacker subculture circles around IRC. There's no such thing like “federation” as in Jabber. You (the client) connect to a network with one or more servers, and you can talk only to the persons connected to the same network. The IRC protocol is (relatively) simple. A fully functional IRC client (multiple servers, multiple channels) can be written in less than 3000 line of Emacs lisp (rcirc -- I've used that for a while, it's fine if you don't have to deal with a large amount of channels). While the XMPP (mostly) requires that you register to a server to have an account, on IRC you don't need that. You just open a connection, pick a nickname, and go. Registration, authentication and company are just plain optional. You don't need that, if you don't want. You just need a good client, a guerrilla client (like irssi or weechat) if you live on the IRC a lot.

About hierarchies and politics in the protocols

I've read somewhere that IRC is hierarchical because it requires a range of channel and server operators, while XMPP, being decentralized, is not. This statement is kind of lame. Even in a perfect society, who cares about the house doesn't like if undesirable guests come and shit around. Who lives in the house would pick the “guests” and show them the door. Same happens on IRC. There are thousands of networks out there, some people spend some time caring about the service they provide, and if the shit hits the fan, they act to protect what they built. Fair enough, isn't it? There's nothing inherently authoritarian in the fact that who provides the service defends it against malicious bots or persons.

Same happens on the channels of these networks. There are founders and operators, who have the incredible power of kick out and ban you, if you aren't welcome. Some of them act as if they are the bosses, true. But what does it means? If you go into a channel, you are supposed to want to speak to them. You're free to leave, if you think they are jerks. And your nickname is just a nickname, not a long-lived account. You can change that when you want. Changing an account (like changing mail) is always a pain.

After all, the multi user chat extension of XMPP requires privileges too for some users. XMPP servers have, of course, administrators. So what?

So all this political BS is just smoke in the eyes.

About federation

As stated above, with a single jabber account you can talk to everyone else who has another jabber account. The problem is that sometimes, actually often, the server to server connections have problems (maybe because the server on the other side is overloaded). So you “don't see” your buddy on another network. Very often, due to the way the names of the hosts are resolved (which is kind of DNS black magic), you can't join a “multi-user chat” on another network. And without a registration (i.e., another password to write down), you can't access all these wonders. Maybe on jabber with one account you can go everywhere, but it's true that on IRC a single client and no accounts is enough.

Also, if you are a user of a small network, you start to love it and you're part of a community of persons who care about it because they use it. Having a jabber account is kind of impersonal.

From experience, having a even small IRCd and trying to build some kind of user base is interesting. Running a mail or jabber server is just a burden, because you are not really so important. Google will give you a jabber and a mail account for free, and they are usually more reliable (even if not so desirable) than your single-point-failure server, which you are paying out of your pocket.

About the protocol

IRC is small and simple. Messages are not even parsed by the servers. Encoding and data is left to the clients. While jabber servers work a lot.

See this figure:

 %CPU %MEM  COMMAND
  0.0  1.3  ircd
  0.0  0.5  ssld
  0.0  0.1  bandb
  0.0  0.2  atheme-services

 %CPU %MEM  COMMAND
  0.0  0.0  epmd
  0.0  2.8  beam
  0.0  0.0  inet_gethost
  0.0  0.0  inet_gethost
  0.0  0.0  inet_gethost

Both services have ridiculous low number of clients (a dozen or so). Nevertheless, the ejabberd thing is eating a 40% more memory then a IRCd and its services together. On larger, or much larger networks, the situation get complicated, because the jabber server is storing your contacts. What? Yes, exactly. Your client just ask the server to give you back your contacts. So, if you want to talk about politics, think about this thing once or twice. Also, the <XML> stuff needs always parsing. And your server works. A lot. To nest the <tags> and to see if they are standard-compliant.

About the file sharing

People using IRC are introduced to the DCC protocol. It's a über-dumb protocol to send files. Even large files. Movies, anime, music. If you search well, IRC has plenty of channels where you can get fresh stuff. And it's more safe than the bittorrent protocol, because the only parties involved are you and your peer (the server act only as an intermediary to get you in touch). No middlemen. XMPP has various extensions for file sharing, but I can't really imagine filesharing on XMPP. It can work, but it's not likely. Just too complicated to set up. You need smart clients, which so far don't exist (as far as I know). DCC just works if when you're sending a file remember to open the damned port of your router and to let your client know your own ip (not the one of your internal network). If you're just receiving, you're fine.

On jabber, or you're routing your porn movie through 1 or more servers, encapsulating it in the funny XML tags, or you and your buddy have a very cool client that opens a direct connection (with the same problems of the DCC, so they're reinventing the wheel). Just too complicated.

About the bots

Who says that bots don't matter? I use them a lot. To send headlines of news, to do simple tasks, to host and share files. There are various XMPP frameworks to write bots for XMPP. There is not such institutions as the eggdrop or infobot for XMPP. Maybe it's too early (as the jabber protocol is young and growing), but the feeling is that you'll have services, possible integrated with web sites, not real bots as we know them. The former gozerbot, now jsonbot, works both on IRC and XMPP. But it looks like an exception.

Deploying

XMPP is not going to be a fun thing. It's already used by corporations to build interactive sites and offering state-of-the-art services. Because XMPP is designed to transport everything (the X -- like “extensible” part). So the “instant messaging” is just a piece of the puzzle. The protocol is changing, so it could happen that your client one day is not able to connect any more, or generates errors. Or it's missing the “roster”. You know, just too complicated. And not fun.

What for?

Well, I must say I usually have a good time on IRC. Visiting new servers with new people, looking around to see new channel, is often interesting. If I need some help on tech things, usually IRC is the right place to get it (and to give it). On jabber there is probably only the support for the XMPP-related things (a friend reported that to enter the channel you had to resolve a captcha, go figure...) and some relays from and to other lame IM custom protocol. Oh, yes, Google use it, for gtalk and Wave (which probably failed, who cares about Wave?). Large corporations use it for internal communications.

IRC userbase is declining, for sure, but I don't believe that it's declining because of other IM protocols. Instead, is losing ground against webby trendy things like facebug (which sometimes happen to provide a XMPP chat) but it's not the same. It's not for me, thanks.

IRC is fun and hacky. Jabber isn't.