| advertise add site services publishers database health videos | ![]() | about toolbar stats live show health store more stuff JOIN/LOGIN |
Peer To Peer spinalcordinjury.net | Peer-to-Peer Networking Main Page omahamedical.com | The Center for Peer Review Justice- seeks to correct the inequities in... peerreview.org |
Chord is a peer-to-peer lookup algorithm for finding a single node in a structured network of peers as a rendezvous point for a given key, which is an index for a desired entity of information[1]. It is one of the four original distributed hash table protocols, along with CAN, Tapestry, and Pastry. It was introduced in 2001 by Ion Stoica, Robert Morris, David Karger, Frans Kaashoek, and Hari Balakrishnan, and is developed at MIT[2].
[edit] OverviewUsing the Chord lookup protocol, node keys are arranged in a circle. The circle cannot have more than 2m nodes. The circle can have ids/keys ranging from 0 to 2m − 1. IDs and keys are assigned an m-bit identifier using what is known as consistent hashing. The SHA-1 algorithm is the base hashing function for consistent hashing. The consistent hashing is integral to the probability of the robustness and performance because both keys and IDs (IP addresses) are uniformly distributed and in the same identifier space. Consistent hashing is also necessary to let nodes join and leave the network without disrupting the network. Each node has a successor and a predecessor. The successor to a node or key is the next node in the identifier circle when you move clockwise. The predecessor of a node or key is the next node in the id circle when you move counter-clockwise. If there is a node for each possible ID, the successor of node 2 is node 3, and the predecessor of node 1 is node 0; however, normally there are holes in the sequence, so, for example, the successor of node 153 may be node 167 (and nodes from 154 to 166 will not exist); in this case, the predecessor of node 167 will be node 153. Since the successor (or predecessor) node may disappear from the network (because of failure or departure), each node records a whole segment of the circle adjacent to it, i.e. the K nodes preceding it and the K nodes following it. One successor and predecessor are kept in a list to maintain a high probability that the successor and predecessor pointers actually point to the correct nodes after possible failure or departure of the initial successor or predecessor. [edit] Chord protocolThe Chord protocol is one solution for connecting the peers of a P2P network. Chord consistently maps a key onto a node. Both keys and nodes are assigned an m-bit identifier. For nodes, this identifier is a hash of the node's IP address. For keys, this identifier is a hash of the key. There are many other algorithms in use by P2P, but this is a simple and common approach. A logical ring with positions numbered 0 to 2^(m-1) is formed among nodes. Key k is assigned to node successor(k), which is the node whose identifier is equal to or follows the identifier of k. If there are N nodes and K keys, then each node is responsible for roughly K / N keys. When the (N+1)th node joins or leaves the network, responsibility for O(K/N) keys changes hands. Each node knows the IP address of its successor. If each node knows the location of its successor, you can perform linear search over the network for a particular key. This is a naive method for searching the network. A faster search will require each node to keep a "finger table" containing up to m entries. The i(th) entry of node n will contain the address of successor(n + 2i). The number of node that must be contacted to find a successor in an N-node network is O(log n). Proof: Assume node n wants to resolve a query for key k. Let p be the node that contains k. We will analyze the number of steps to reach p. Let i be such that p is in n + 2i − 1, n + 2i. Node n will contact the smallest node in this interval; call this node f. Fact: f is closer to p than to n. Therefore, in one step, the distance to p decreases by at least half. [edit] Potential uses
[edit] Proof sketchesChord must contact at most O(log N) nodes to find a successor in an N-node network, with high probability Define a node n that has a query for a key k. Suppose node p is the node that the key k maps to in Chord (n If Chord keeps track of r = O(log N) predecessors/successors, then with high probability, if each node has probability of 1/4 of failing, find_successor (see below) and find_predecessor (see below) will return the correct nodes Simply, the probability that all r nodes fail is [edit] PseudocodeDefinitions for pseudocode:
The pseudocode to find the successor node of an id is given below: // ask node n to find the successor of id n.find_successor(id) if (id The pseudocode to stabilize the chord ring/circle after node joins and departures is as follows: // create a new Chord ring. n.create() predecessor = nil; successor = n; // join a Chord ring containing node n'. n.join(n') predecessor = nil; successor = n'.find_successor(n); // called periodically. verifies n’s immediate // successor, and tells the successor about n. n.stabilize() x = successor.predecessor; if (x [edit] See also
[edit] References
[edit] External links |
| ↑ top of page ↑ | about thumbshots |