The memcached FAQ links to this document describing the binary protocol:
http://code.google.com/p/memcached/wiki/MemcacheBinaryProtocolUnfortunately, this document is out of date compared to the protocol-binary.xml that ships with 1.4.0. For example, it is missing various opcodes like IncrementQ. Now that 1.4.0 is out, it would be good to update the protocol document on the wiki. -Mat
