HxNet (working name) protocol outline Basis: HxNet is a peer to peer based decentralized file sharing system designed for small separate networks. Each node is redundant and connects to a specific network. These smaller networks would work well in a school or a company office. The idea is to create a network of nodes which form a single file system. Users can upload files to the network and they are split up across the nodes. This allows for a bit-torrent like system for download. However there will also be a option to try and download directly from the originator of the file or a mirror which is hosting another full copy of the file. This is only good for smaller files since doing so with large files would use up to much space on the network. The core of each node is split in two. The first part is dedicated to sharing files via p2p. The second have is dedicated to displaying data. This way the p2p file system is running independently from the nodes display section. types of nodes: baseNodes: baseNodes are the simplest of nodes, usually the clients that log onto the network occaionsaly to find a file. They do not form permanent connections to other baseNodes, they do however form semi-permanent connections to 4-6 highNodes. baseNodes only connect to other baseNodes or hubNodes when they need a download or in order to find a highNode. nodeType: BASE highNodes: highNodes are baseNodes who are able to handle a large volume of connections. These nodes can connect to a large volume of baseNodes and to as many hubNodes as possible. HighNodes also have more files stored on them then baseNodes or hubNodes nodeType: HIGH hubNodes: hubNodes act as indexers and organizers of the network. They are capable of connecting to any type of node and indexing the files contained within. HubNodes need to be able to create an index of all the nodes under them. This list of nodes is then sent to every node connected to the hubNode. Each hub node is capable of transferring its hub capabilities to another node. This allows for the most qualified nodes to become hubNodes. It might eventually be possible to give hubs another hub address and create network bridges between different networks. nodeType: HUB connections: CONNECT -Tries to establish a connection to another node. replies: CONNECTION DISCONNECT -tries to disconnect from another node replies: none Management Protocols: NodeList Management: -protocol to manage the nodeLists whenever a node connects to another node they exchange node lists the connecting node sends it's list first. NLIST_EXCHANGE -Asks another node if it wants to exchange node lists replies: NLIST_EXCHANGE_REPLY NLIST_START_EXCHANGE -Notifies a node that it is going to send its nodeList replies: none NLIST_END_EXCHANGE -Notifies another node that it has finished sending its nodeList It includes an md5 checksum in order to verify the list. It then tells the sender if it verified or not. replies: NLIST_END_EXCHANGE_REPLY file Managment: -protocols to manage files on the network. FILE_UPLOAD -uploads a file onto the network. replies: FILE_UPLOAD_REPLY -assetID is a hash of userID, fileName, and fileSize FILE_DOWNLOAD -used to download a file onto the local computer. It can also attempt to download a full copy directly from the source otherwise it just uses a normal p2p chunked download replies: FILE_DOWNLOAD_REPLY FILE_DOWNLOAD_PEERS_REQUEST -used to request a list of peers from a node. This request should properly follow the node structure back up to a hub recursively in order to gain a proper idea of what peers have what files. replies: FILE_DOWNLOAD_PEERS_REPLY FILE_FLAG -used to attach certain flags to certain files nodes implementing this MUST check to see if the user flagging this content owns or has downloaded the file at some point. replies: FILE_FLAG_REPLY user Managment: -protocols to manage user "stuff" NODE_GET_CURRENT_USER -Used to find the active user on a node replies: NODE_GET_CURRENT_USER_REPLY USER_FIND_USER_NODE -finds the node being used by a user replies: USER_FIND_USER_NODE USER_GET_FILES_BY_USERID -asks nodes to return a list of all files created by said userID replies: USER_GET_FILES_BY_USERID_REPLY query Managment: -protocol for querying nodes. The query structure just follows the nodes back to a set level. First the node which initiates the query asks all nodes on a local network about the file. If they do not have the file the starting node sends out the query to all external nodes the query has a TTL so it doesn't take too long to find results. Nodes that recieve the query check if they contain the file, return the results and then forward the query to another node. [[NOTE] queries might return the same result depending on how a file is split up to avoid repeats each chunk of a file has a chunkID. This allows the querier to display only new results. to clarify: all chunks have the same assetID but they each have a different chunkID] QUERY_NETWORK