Top Banner
Chord: A Scalable Peer- to-peer Lookup Protocol for Internet Applications Speaker: Cathrin Weiß 11/23/2004 Proseminar Peer-to-Peer Information Systems
25

Chord: A Scalable Peer-to-peer Lookup Protocol for Internet Applications Speaker: Cathrin Weiß 11/23/2004 Proseminar Peer-to-Peer Information Systems.

Dec 16, 2015

Download

Documents

Jaylen Gunn
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Chord: A Scalable Peer-to-peer Lookup Protocol for Internet Applications Speaker: Cathrin Weiß 11/23/2004 Proseminar Peer-to-Peer Information Systems.

Chord: A Scalable Peer-to-peer Lookup Protocolfor Internet Applications

Speaker: Cathrin Weiß11/23/2004Proseminar

Peer-to-Peer Information Systems

Page 2: Chord: A Scalable Peer-to-peer Lookup Protocol for Internet Applications Speaker: Cathrin Weiß 11/23/2004 Proseminar Peer-to-Peer Information Systems.

2

Overview

I. Introduction

II. The Chord Protocol and how it works

III. Disadvantages and Improvements

IV. Applications using Chord

V. Summary

Page 3: Chord: A Scalable Peer-to-peer Lookup Protocol for Internet Applications Speaker: Cathrin Weiß 11/23/2004 Proseminar Peer-to-Peer Information Systems.

3

I. Introduction

Problem: Decentralized network with several peers (clients) How to find specific peer that hosts desired data within this

network?

N5

N3

N2

N1

N4

Looks for data

Networkhas matching data

N9

N6

N7

N8

Page 4: Chord: A Scalable Peer-to-peer Lookup Protocol for Internet Applications Speaker: Cathrin Weiß 11/23/2004 Proseminar Peer-to-Peer Information Systems.

4

I. Introduction

Solution: Routing queries along the network via known peers. (Example: quite inefficient!)

N5

N3

N2

N1

N4

Looks for data

Network

has matching data

Is able to respond!

N6N7

N8

N9

N101

1

1

1

2

2

2

3

4

Page 5: Chord: A Scalable Peer-to-peer Lookup Protocol for Internet Applications Speaker: Cathrin Weiß 11/23/2004 Proseminar Peer-to-Peer Information Systems.

5

Overview

I. Introduction

II. The Chord Protocol and how it works

III. Disadvantages and Improvements

IV. Applications using Chord

V. Summary

Page 6: Chord: A Scalable Peer-to-peer Lookup Protocol for Internet Applications Speaker: Cathrin Weiß 11/23/2004 Proseminar Peer-to-Peer Information Systems.

6

II. The Chord Protocol and how it works

What is Chord?

Efficient Simple Provable Performant Provable Correct Scalable Supporting only one operation: mapping a given key onto a

node

lookup protocol

Page 7: Chord: A Scalable Peer-to-peer Lookup Protocol for Internet Applications Speaker: Cathrin Weiß 11/23/2004 Proseminar Peer-to-Peer Information Systems.

7

II. The Chord Protocol and how it works

Consistent Hashing:

Using SHA1 (secure hash standard) Chord assigns each node and key a m-bit identifierNode (-> hashing IP Address)

N2

N10

N20

N40

N50

N60 k7

k11

k16

k25k39

k46

k58

N63

Keys(->hashing key itself)

Assign each key to its successor

ID Space: 0 to 2m-1

Here: m = 6

=> ID Range 0… 63

Page 8: Chord: A Scalable Peer-to-peer Lookup Protocol for Internet Applications Speaker: Cathrin Weiß 11/23/2004 Proseminar Peer-to-Peer Information Systems.

8

II. The Chord Protocol and how it works

Predecessor: pointer to the previous node on the id circle

Successor: pointer to the succeeding node on the id circle

ask node n to find the successor of id If id between n and it

successor return successor Else forward query to n´s

successor and so on

A first simple (but slow!) lookup algorithm

=>#messages linear in #nodes

Page 9: Chord: A Scalable Peer-to-peer Lookup Protocol for Internet Applications Speaker: Cathrin Weiß 11/23/2004 Proseminar Peer-to-Peer Information Systems.

9

II. The Chord Protocol and how it works

Protocol Improvements

Introduce a routing table m: number of bits in the key/node identifiersn: ID of a node ith entry: the closest node that succeeds node N with ID n

by at least 2i-1 mod 2m

Finger table could contain up to m entries

Each node has a successor list of its r successing nodes

Page 10: Chord: A Scalable Peer-to-peer Lookup Protocol for Internet Applications Speaker: Cathrin Weiß 11/23/2004 Proseminar Peer-to-Peer Information Systems.

10

II. The Chord Protocol and how it works

Finger Table for scalable node localisation: not enough information to find node directly but nodes in direct neighbourhood

Page 11: Chord: A Scalable Peer-to-peer Lookup Protocol for Internet Applications Speaker: Cathrin Weiß 11/23/2004 Proseminar Peer-to-Peer Information Systems.

11

II. The Chord Protocol and how it works

//ask node n to find the successor

//of idn.find_successor(id) if (id in (n,successor]) return successor else n‘ =

closest_preceding_node(id); return n‘.find_successor(id);

More efficient algorithm using finger tables

//search the local table for the //highest predecessor of idn.closest_preceding_node(id) for i=m downto 1 do if (finger[i] in (n,id)) return finger[i]; return n;

Page 12: Chord: A Scalable Peer-to-peer Lookup Protocol for Internet Applications Speaker: Cathrin Weiß 11/23/2004 Proseminar Peer-to-Peer Information Systems.

12

II. The Chord Protocol and how it works

#messages = log(#nodes) !!

Fig. 2.4

Page 13: Chord: A Scalable Peer-to-peer Lookup Protocol for Internet Applications Speaker: Cathrin Weiß 11/23/2004 Proseminar Peer-to-Peer Information Systems.

13

II. The Chord Protocol and how it works

Node joins and stabilization process

Lookups are expected to be correct (though the set of participating

nodes can change!)

Important: Any node´s successor pointer is always up to date.

Stabilization protocol running periodically in the background and updating Chord´s finger tables and successor pointers

Page 14: Chord: A Scalable Peer-to-peer Lookup Protocol for Internet Applications Speaker: Cathrin Weiß 11/23/2004 Proseminar Peer-to-Peer Information Systems.

14

II. The Chord Protocol and how it works

Stabilize() if n is not its successor´s

predecessor it changes its successor

successor

predecessor

Ny

Nx

Nz

successor Nz

predecessor …

NyAm I your predecessor?

successor Ny

predecessor …

-> No it´s Ny

Page 15: Chord: A Scalable Peer-to-peer Lookup Protocol for Internet Applications Speaker: Cathrin Weiß 11/23/2004 Proseminar Peer-to-Peer Information Systems.

15

II. The Chord Protocol and how it works

Notify()

successor

predecessor

NIL

Nx

Nz

Ny Might be my predecessor!

successor

predecessor

Nx

successor

predecessor

Ny

Fix_fingers() updates finger tables

Nz changes predecessor to Ny because Ny between Nx and Nz.

Nz changes predecessor to Nx because predecessor = nil

Page 16: Chord: A Scalable Peer-to-peer Lookup Protocol for Internet Applications Speaker: Cathrin Weiß 11/23/2004 Proseminar Peer-to-Peer Information Systems.

16

II. The Chord Protocol and how it works

Illustration (Joining node)

a)

b) c)

a) Initial state

b) node 26 enters the system & finds its successor

c) Stabilize procedure updates successor of n21 to n26

Page 17: Chord: A Scalable Peer-to-peer Lookup Protocol for Internet Applications Speaker: Cathrin Weiß 11/23/2004 Proseminar Peer-to-Peer Information Systems.

17

II. The Chord Protocol and how it works

Node failures

It is provable that even if half of the nodes in the network fail, lookups are executed correctly!

Page 18: Chord: A Scalable Peer-to-peer Lookup Protocol for Internet Applications Speaker: Cathrin Weiß 11/23/2004 Proseminar Peer-to-Peer Information Systems.

18

Overview

I. Introduction

II. The Chord Protocol and how it works

III. Disadvantages and Improvements

IV. Applications using Chord

V. Summary

Page 19: Chord: A Scalable Peer-to-peer Lookup Protocol for Internet Applications Speaker: Cathrin Weiß 11/23/2004 Proseminar Peer-to-Peer Information Systems.

19

III. Disadvantages and Improvements

Why is Chord itself no search engine?

Protocols are NO applications Upper layers have to coordinate purposes Chord only supports “exact match“, cannot handle queries

similar to one or more keys

Suitability for use in search engines Chord basically not suitable because specific information about

desired data is needed to be able to compute the query key´s hashvalue

There exist several proposals for modifications to be able to find what is wanted without prior knowledge (meta data search extension)

Page 20: Chord: A Scalable Peer-to-peer Lookup Protocol for Internet Applications Speaker: Cathrin Weiß 11/23/2004 Proseminar Peer-to-Peer Information Systems.

20

III. Disadvantages and Improvements

Chord´s disadvantages asymmetric lookup => lookup from node n to node p

could take a different number of hops than vice versa=> In huge Chord Rings lookup to one of near preceding

nodes routed clockwise over almost complete ring.

Approach for Improvement: S-Chord (->in-place notification of entry changes)

Symmetric Structure: - routing entry symmetry – „if p points to n then n points

to p“ - routing cost symmetrie – lookup paths between to

nodes very likely are equal though they are not the same! (=>no routing symmetry)

- finger table symmetry

Page 21: Chord: A Scalable Peer-to-peer Lookup Protocol for Internet Applications Speaker: Cathrin Weiß 11/23/2004 Proseminar Peer-to-Peer Information Systems.

21

Overview

I. Introduction

II. The Chord Protocol and how it works

III. Disadvantages and Improvements

IV. Applications using Chord

V. Summary

Page 22: Chord: A Scalable Peer-to-peer Lookup Protocol for Internet Applications Speaker: Cathrin Weiß 11/23/2004 Proseminar Peer-to-Peer Information Systems.

22

IV. Applications using Chord

DNS with Chord

Host names hashed to keys, corresponding IP addresses are values

Decentralized (no use for servers) Routing information and host changes can be updated

dynamically

Cooperative mirroring

Multiple providers of the same content Load is spread evenly over all hosts by mapping data blocks

onto hosts

Page 23: Chord: A Scalable Peer-to-peer Lookup Protocol for Internet Applications Speaker: Cathrin Weiß 11/23/2004 Proseminar Peer-to-Peer Information Systems.

23

Overview

I. Introduction

II. The Chord Protocol and how it works

III. Disadvantages and Improvements

IV. Applications using Chord

V. Summary

Page 24: Chord: A Scalable Peer-to-peer Lookup Protocol for Internet Applications Speaker: Cathrin Weiß 11/23/2004 Proseminar Peer-to-Peer Information Systems.

24

V. Summary

Simple, scalable, provable correct and performant

Any lookup requires O(log N) messages in a N node network

Even in unstable systems lookups are correct

Arbitrary implementation provided for developers => extendable in applications

Page 25: Chord: A Scalable Peer-to-peer Lookup Protocol for Internet Applications Speaker: Cathrin Weiß 11/23/2004 Proseminar Peer-to-Peer Information Systems.

25

Thank you

Thank you for your attention!