While on a camping trip

While on a camping trip two weekends ago, I thought about what I would study in grad school. The answer I came up with is distributed data structures and how they apply to massively multiplayer game engines. so this week i plan on doing some reading about distributed hash tables. I thought it'd be interesting to know how the popular open source P2P nets work. That means only two networks, Gnutella and Freenet. I came across the gnutella protocol specification and read it. Its stunningly simple! Disappointingly simple! Did you know that the only search mechanism supported is a sub-string match? thats it. 'brittany' is as complex of a search as gnutella supports. no searching by genre, file type, upload date, bitrate, none of that.

As a gnutella client (the spec calls them servents), you have a pool of open sockets to other clients. there is no seeding mechanism, you have to start it by hand (although in practice the clients ive tried had a few default hosts). There is an IRC protocol-like connect string, a ping, a pong, a query, a query result, and a push command for firewalled hosts. If you get a query packet from one host, you search your own archives and forward it on to any other hosts you know about, decementing the TTL field. Thats pretty much it. Get a query and forward it to all the other hosts you are connected to.

FreeNet, I expect, will be on the other end of the complexity scale.

tags: