hpfeeds is an authenticated publish/subscribe datafeed protocol (by Mark) used by the Honeynet Project. It supports channels and authkeys.
A system for large-scale real-time data-sharing would have to ...
Managing permissions for a large number of users does not scale and also does not correspond to the way we collaborate. Think "Web of Trust" and "Distributed Version Control" (like with git).
Social is the solution!
hpfriends is an evolution of the hpfeeds system. The wire-format is identical, the message broker behaves the same way. The big difference is the data-sharing model and the backend software.
hpfriends supports users and groups. These are connected by sharing relations, representing a web of trust between users who trust each other by sharing their own data as well as data received by third parties.
hpfriends operates on a social graph. Users and groups are nodes, sharing relations are edges.
Edges between users have a type (shares, shares_all) and an attribute, i.e. the channel name.
Group membership is also stored as an edge between a user and group.
Channels behave quite differently than in the original hpfeeds.
We're going to show you ...
Currently, hpfriends uses the Neo4j graph database to store user, group and sharing information. Further information on users / etc is stored within MongoDB.
Screenshot from Neo4j interfaceFor actual message delivery via the feedbroker, sharing relationships are cached for 5-minute intervals for performance.
start usrc=node({srcid}), udst=node({subids})
match p=usrc-[:*1..]->udst, udst-[ra:accepts]->umid
with relationships(p) as rs, udst as udst, ra as ra
where id(last(rs)) = ra.sid
return distinct udst'''
Public hpfriends webif is at hpfriends.honeycloud.net. The webif was built using Meteor, a real-time JavaScript / NodeJS web-framework which takes care of data persistence & synchronization, data binding to the UI, templating, latency compensation and many other things.
struct MsgHeader {
uint32_t messageLength; // total length
uint8_t opCode; // currently five opCodes implemented
};
length | opcode | next | identifier | next | channelname | payload
--------------------------------------------------------------------------
85 3 9 b4aa2@hp1 9 mwcapture 137941a3d8589f9
Full documentation and list of opCodes at github/rep/hpfeeds.