John Chamberlain
Developer Diary
 Developer Diary · You Heard It Here First · 25 November 2003
BEEP, the Ultimate Protocol Tool
If you need to move data or messages from one place to another (who doesn't?), you should take a close look at the standard/tool by Marshall Rose called BEEP. I have not used BEEP so I cannot vouch for its quality but my first impressions are good. BEEP is an IETF standard. The BEEP core libraries provide a low-level API for doing data communications. Rose has written an overview to BEEP which explains some of the detail and philosophy behind it, but the best way to get a sense for it is to read his book "BEEP, the Definitive Guide" published by O'Reilly. You might also want to read Ed Dumbill's introduction to BEEP which is well-written.

The reason for BEEP is that many people when adding a communication protocol to their application either borrow an existing protocol like HTTP or TCP, or write their own protocol. Please don't do this. The problem with borrowing a protocol is that it usually is inappropriate to at least some aspects of your use and lacks features needed by your application (resulting in hacked add-ons). The problem with rolling your own is that you probably won't do it very well the first time you write a protocol. Engineers have been writing protocols for 30 years and BEEP encapsulates a lot of that knowledge.

I particularly am annoyed by people who constantly use TCP (a connection-oriented protocol) for tasks that could be much more efficiently done by UDP. Take chats for example. There is absolutely no reason why you need absolute reliability to chat. If one fragment out of 10,000 fragments gets lost somehow, so what? The obsession with connection-oriented protocols slows everything down because of all the waits on unnecesssary ACKs.

That said, BEEP has a wide range of support for connection-oriented communications. It works with four key object types:

- Sessions
- Channels
- Exchanges
- Messages

You get the idea. Read the above links for more details.

In parting let me emphasize that you will NOT be able to beat BEEP with a custom solution. You can configure BEEP to provide just the features you want and a lot of the features it can support like tunneling, security and asynchronous duplex messaging you will not be able to do yourself without man-years of effort (and mistakes). You can run SOAP on top of BEEP and do a lot of other things as well. There is nothing else like BEEP out there and if you are doing data communications you probably should use it.

Developer Diary · info@johnchamberlain.com · bio · Revised 25 November 2003 · Pure Content