+ All Categories
Home > Documents > Telematics Chapter 9: Peer to Peer Networks Chapter 9 ... · Chapter 9: Peer to Peer Networks...

Telematics Chapter 9: Peer to Peer Networks Chapter 9 ... · Chapter 9: Peer to Peer Networks...

Date post: 16-Oct-2020
Category:
Upload: others
View: 9 times
Download: 0 times
Share this document with a friend
60
Telematics Chapter 9: Peer to Peer Networks Beispielbild Chapter 9: Peer-to-Peer Networks User watching video clip Server with video clips Presentation Layer Session Layer Application Layer Presentation Layer Session Layer Application Layer Prof. Dr. Mesut Güneş Computer Systems and Telematics (CST) Distributed embedded Systems Data Link Layer Network Layer Transport Layer Data Link Layer Network Layer Transport Layer Data Link Layer Network Layer Distributed, embedded Systems Institute of Computer Science Freie Universität Berlin Data Link Layer Physical Layer Data Link Layer Physical Layer Data Link Layer Physical Layer http://cst.mi.fu-berlin.de
Transcript
Page 1: Telematics Chapter 9: Peer to Peer Networks Chapter 9 ... · Chapter 9: Peer to Peer Networks Beispielbild Chapter 9: - -Peer Networks User watching video clip Server with video clips

TelematicsChapter 9: Peer to Peer Networks

BeispielbildChapter 9: Peer-to-Peer Networks

User watching video clip

Server with video clips

Presentation Layer

Session Layer

Application Layer

Presentation Layer

Session Layer

Application Layer

Prof. Dr. Mesut Güneş

Computer Systems and Telematics (CST)

Distributed embedded Systems Data Link Layer

Network Layer

Transport Layer

Data Link Layer

Network Layer

Transport Layer

Data Link Layer

Network Layer

Distributed, embedded Systems

Institute of Computer Science

Freie Universität Berlin

Data Link Layer

Physical Layer

Data Link Layer

Physical Layer

Data Link Layer

Physical Layer

http://cst.mi.fu-berlin.de

Page 2: Telematics Chapter 9: Peer to Peer Networks Chapter 9 ... · Chapter 9: Peer to Peer Networks Beispielbild Chapter 9: - -Peer Networks User watching video clip Server with video clips

Contents

● Design Issues● Basics of Peer-to-Peer systems● Basics of Peer to Peer systems● First Generation P2P-Systems●Napster●Gnutella● Super-Peer-Networks

● Distributed Hash Tables● Distributed Hash Tables● Concept● Case Study I: Chord● Case Study II: Pastry

● Overlay- vs. physical topology

9.2Prof. Dr. Mesut Güneş ▪ cst.mi.fu-berlin.de ▪ Telematics ▪ Chapter 9: Peer-to-Peer Networks

Page 3: Telematics Chapter 9: Peer to Peer Networks Chapter 9 ... · Chapter 9: Peer to Peer Networks Beispielbild Chapter 9: - -Peer Networks User watching video clip Server with video clips

Design Issuesg

● Two communication principles● Client/Server OSI Reference Model● Client/Server● Peer-to-Peer (P2P)

● Originally the Internet has a P2P d i

Presentation Layer

Application Layer

design● All hosts provide services like● FTP, Telnet, Email

Presentation Layer

Session Layer, e e , a

● With a growing network a more hierarchical network structure was established

Network Layer

Transport Layer

was established● Client/Server applications

● Since 2000 a new wave of P2P

Data Link Layer

Ph sical La eapplications emerged

Physical Layer

9.3Prof. Dr. Mesut Güneş ▪ cst.mi.fu-berlin.de ▪ Telematics ▪ Chapter 9: Peer-to-Peer Networks

Page 4: Telematics Chapter 9: Peer to Peer Networks Chapter 9 ... · Chapter 9: Peer to Peer Networks Beispielbild Chapter 9: - -Peer Networks User watching video clip Server with video clips

Peer-to-Peer: Introduction

● Originally the Arpanet/Internet has a P2P design● All hosts provide services like (FTP, Telnet, …)● All hosts provide services like (FTP, Telnet, …)● All hosts were equal●With increasing number of nodes the structure changed to a Client-Server

hit tarchitecture

9.4Prof. Dr. Mesut Güneş ▪ cst.mi.fu-berlin.de ▪ Telematics ▪ Chapter 9: Peer-to-Peer Networks

Page 5: Telematics Chapter 9: Peer to Peer Networks Chapter 9 ... · Chapter 9: Peer to Peer Networks Beispielbild Chapter 9: - -Peer Networks User watching video clip Server with video clips

Peer-to-Peer: Introduction

● “Opposite” of Client/Server● No central server Information are highly distributed● No central server Information are highly distributed● Each peer is at the same time server and client (servent)● Each peer can query, reply to queries, and forward messages at the same time

● Each peer “speaks” directly with other peers

9.5Prof. Dr. Mesut Güneş ▪ cst.mi.fu-berlin.de ▪ Telematics ▪ Chapter 9: Peer-to-Peer Networks

Page 6: Telematics Chapter 9: Peer to Peer Networks Chapter 9 ... · Chapter 9: Peer to Peer Networks Beispielbild Chapter 9: - -Peer Networks User watching video clip Server with video clips

Peer-to-Peer: Concept p

●Peer-to-Peer networks are overlay-networks●The focus is on the

application layer

● Physical topology of the network

9.6Prof. Dr. Mesut Güneş ▪ cst.mi.fu-berlin.de ▪ Telematics ▪ Chapter 9: Peer-to-Peer Networks

Page 7: Telematics Chapter 9: Peer to Peer Networks Chapter 9 ... · Chapter 9: Peer to Peer Networks Beispielbild Chapter 9: - -Peer Networks User watching video clip Server with video clips

Peer-to-Peer: Some Applicationspp

● There are many P2P Applications today● P2P Telephony, e.g., Skype● P2P Telephony, e.g., Skype● P2P Instant Messaging, e.g., ICQ● P2P Content Sharing, e.g., Gnutella, Kazaa, Freenet, BitTorrent● P2P Resource Sharing, e.g., SETI@home● P2P Social Networks, e.g., Krawler● P2P Video Streaming, e.g., P2PTV, PDTP● P2P Video Streaming, e.g., P2PTV, PDTP●…

9.7Prof. Dr. Mesut Güneş ▪ cst.mi.fu-berlin.de ▪ Telematics ▪ Chapter 9: Peer-to-Peer Networks

Page 8: Telematics Chapter 9: Peer to Peer Networks Chapter 9 ... · Chapter 9: Peer to Peer Networks Beispielbild Chapter 9: - -Peer Networks User watching video clip Server with video clips

Peer-to-Peer: Properties and Classificationp

● Peer-to-Peer Networks have some interesting properties●No single point of failure●No single point of failure● Very flexible and adaptive (scalability)● Self-organized● Reduce/eliminate the demand for server clusters● Improve utilization of resources (memory, CPU) ● Information are always up-to-date● Information are always up to date● Provide better anonymity

● Classification of Peer-to-Peer NetworksUnstructured: Data are placed randomly●Unstructured: Data are placed randomly

● Structured: Data are placed systematically, e.g., in a Distributed Hash Table (DHT)

9.8Prof. Dr. Mesut Güneş ▪ cst.mi.fu-berlin.de ▪ Telematics ▪ Chapter 9: Peer-to-Peer Networks

Page 9: Telematics Chapter 9: Peer to Peer Networks Chapter 9 ... · Chapter 9: Peer to Peer Networks Beispielbild Chapter 9: - -Peer Networks User watching video clip Server with video clips

Peer-to-Peer: General Problems

● There are also some problems to solve● Retrieving of information● Retrieving of information●Discovery of other peers●Message routing● Keep network traffic low!

9.9Prof. Dr. Mesut Güneş ▪ cst.mi.fu-berlin.de ▪ Telematics ▪ Chapter 9: Peer-to-Peer Networks

Page 10: Telematics Chapter 9: Peer to Peer Networks Chapter 9 ... · Chapter 9: Peer to Peer Networks Beispielbild Chapter 9: - -Peer Networks User watching video clip Server with video clips

Peer-to-Peer: Overlay Architecture y

● Overlay architecture●Network communications●Network communications● Network characteristics, how is the

node connected

●Overlay node management●Overlay node management● Discovery of peers, routing

● Features management● Security, reliability, fault resilience

● Services-specific level● Application levelApplication level● Tools on top of the P2P overlay

Main issue: The lookup problemWhere to store, and how to find a certain data item in a distributed system

9.10Prof. Dr. Mesut Güneş ▪ cst.mi.fu-berlin.de ▪ Telematics ▪ Chapter 9: Peer-to-Peer Networks

without any centralized control or coordination?

Page 11: Telematics Chapter 9: Peer to Peer Networks Chapter 9 ... · Chapter 9: Peer to Peer Networks Beispielbild Chapter 9: - -Peer Networks User watching video clip Server with video clips

Peer-to-Peer: The Lookup Problemp

I have item X. I want item X.Where to place X?

Where can I find X?X

9.11Prof. Dr. Mesut Güneş ▪ cst.mi.fu-berlin.de ▪ Telematics ▪ Chapter 9: Peer-to-Peer Networks

Page 12: Telematics Chapter 9: Peer to Peer Networks Chapter 9 ... · Chapter 9: Peer to Peer Networks Beispielbild Chapter 9: - -Peer Networks User watching video clip Server with video clips

Peer-to-Peer: Overlay Interface to Applicationsy pp

● Application interface for DHT-based overlay networks

P2P Overlay Application

put(key, value)remove(key)

value=get(key)value

Distributed Hash Table

Peer Peer Peer

9.12Prof. Dr. Mesut Güneş ▪ cst.mi.fu-berlin.de ▪ Telematics ▪ Chapter 9: Peer-to-Peer Networks

Page 13: Telematics Chapter 9: Peer to Peer Networks Chapter 9 ... · Chapter 9: Peer to Peer Networks Beispielbild Chapter 9: - -Peer Networks User watching video clip Server with video clips

First Generation of P2P-SystemsFirst Generation of P2P Systems

9.13Prof. Dr. Mesut Güneş ▪ cst.mi.fu-berlin.de ▪ Telematics ▪ Chapter 9: Peer-to-Peer Networks

Page 14: Telematics Chapter 9: Peer to Peer Networks Chapter 9 ... · Chapter 9: Peer to Peer Networks Beispielbild Chapter 9: - -Peer Networks User watching video clip Server with video clips

Napster (1)p ( )

● Popular system of the 1. Generation (1999)● File Sharing as main application● File Sharing as main application● Not a pure Peer-to-Peer network●Hybrid system

● Each peer sends the list of shared files to a central database● A peer asks the central database when it searches for files

Th t l d t b id li t f hi h t th h d● The central database provides a list of peers which store the searched files

● The peer downloads the searched filed directly from the peer with the e pee do oads t e sea c ed ed d ect y o t e pee t t ebest transfer rate (P2P)

9.14Prof. Dr. Mesut Güneş ▪ cst.mi.fu-berlin.de ▪ Telematics ▪ Chapter 9: Peer-to-Peer Networks

Page 15: Telematics Chapter 9: Peer to Peer Networks Chapter 9 ... · Chapter 9: Peer to Peer Networks Beispielbild Chapter 9: - -Peer Networks User watching video clip Server with video clips

Napster (2)p ( )1. Send request to the

central DB22. PING to all peers

provided from the central DB

Central Napster DB

1. request 2. response

4. pong 4. pong

3. ping3. ping

9.15Prof. Dr. Mesut Güneş ▪ cst.mi.fu-berlin.de ▪ Telematics ▪ Chapter 9: Peer-to-Peer Networks

Page 16: Telematics Chapter 9: Peer to Peer Networks Chapter 9 ... · Chapter 9: Peer to Peer Networks Beispielbild Chapter 9: - -Peer Networks User watching video clip Server with video clips

Napster (3)p ( )1. Send request to the

central DB2

Central Napster DB

2. PING to all peers provided from the central DB Central Napster DB

3. (Peer-to-Peer) File Download

1. request 2. response1. request p

5 request file

6. file

5. request file

9.16Prof. Dr. Mesut Güneş ▪ cst.mi.fu-berlin.de ▪ Telematics ▪ Chapter 9: Peer-to-Peer Networks

Page 17: Telematics Chapter 9: Peer to Peer Networks Chapter 9 ... · Chapter 9: Peer to Peer Networks Beispielbild Chapter 9: - -Peer Networks User watching video clip Server with video clips

Napster (4)p ( )

● Advantages● Central database has full

● Disadvantage●High traffic load at the central● Central database has full

knowledge about available items● Very fast retrieval of searched

information in the central database

●High traffic load at the central database

● Available capacity of other peers are not really usedinformation in the central database

● Supports simple and complicated (fuzy) queries

are not really used● Scalability problems● Single point of failure!● Technical as well as juridical

9.17Prof. Dr. Mesut Güneş ▪ cst.mi.fu-berlin.de ▪ Telematics ▪ Chapter 9: Peer-to-Peer Networks

Page 18: Telematics Chapter 9: Peer to Peer Networks Chapter 9 ... · Chapter 9: Peer to Peer Networks Beispielbild Chapter 9: - -Peer Networks User watching video clip Server with video clips

First Generation of P2P-SystemsGnutellaFirst Generation of P2P Systems

9.18Prof. Dr. Mesut Güneş ▪ cst.mi.fu-berlin.de ▪ Telematics ▪ Chapter 9: Peer-to-Peer Networks

Page 19: Telematics Chapter 9: Peer to Peer Networks Chapter 9 ... · Chapter 9: Peer to Peer Networks Beispielbild Chapter 9: - -Peer Networks User watching video clip Server with video clips

Gnutella: Introduction

● The Gnutella-System● Very popular P2P system after

Type Description Information

Messages in Gnutella

● Very popular P2P system after Napster

●Pure Peer-to-Peer SystemN t l

Ping Announce availability and probe for other servents

None

●No central server●Mainly used for file sharing

● Very flexible topology

Pong Response to a Ping IP address and port number of the responding serventNumber and total kB of files sharedy p gy

● Each node can connect to each other

● Very simple protocol

Query Search request Minimum network bandwidth of responding serventSearch criteria

QueryHit Returned by IP address port number● Very simple protocol ●Only 5 different messages

● But

QueryHit Returned by servents that have the requested file

IP address, port number, and network bandwidth of responding serventNumber of results and result set

●No routing-”intelligence” (only Loop-Detection)

●Messages are always broadcast!!

Push File download requests for servents behind firewalls

Servent identifier Index of requested fileIP address and port to send file to

9.19

●Messages are always broadcast!!

Prof. Dr. Mesut Güneş ▪ cst.mi.fu-berlin.de ▪ Telematics ▪ Chapter 9: Peer-to-Peer Networks

Page 20: Telematics Chapter 9: Peer to Peer Networks Chapter 9 ... · Chapter 9: Peer to Peer Networks Beispielbild Chapter 9: - -Peer Networks User watching video clip Server with video clips

Gnutella: Routingg

33

6

query 1

7

q yquery 1

query 1reply 5reply 4 5

reply 6,7 reply 6reply 6,7

15

2query 1 query 1

query 1reply 2

reply 5reply 4,5reply 7

8query 1reply 4

4

9.20Prof. Dr. Mesut Güneş ▪ cst.mi.fu-berlin.de ▪ Telematics ▪ Chapter 9: Peer-to-Peer Networks

Page 21: Telematics Chapter 9: Peer to Peer Networks Chapter 9 ... · Chapter 9: Peer to Peer Networks Beispielbild Chapter 9: - -Peer Networks User watching video clip Server with video clips

Gnutella: Generated Traffic in Byte (1)y ( )T=1 T=2 T=3 T=4 T=5 T=6 T=7 T=8

N=2 166 332 498 664 830 996 1,162 1,328

N=3 249 747 1,743 3,735 7,719 15,687 31,623 63,495

N=4 332 1,328 4,316 13,28 40,172 120,848 362,876 1,088,960

N=5 415 2,075 8,715 35,275 141,515 566,475 2,266,315 9,065,675

N=6 498 2,988 15,438 77,688 388,938 1,945,188 9,726,438 48,632,688

N=7 581 4,067 24,983 150,479 903,455 5,421,311 32,528,447 195,171,263

N=8 664 5,312 37,848 265,600 1,859,864 13,019,712 91,138,648 637,971,200

Number of users connected to the Gnutella network: 2000Parameters

Source: "Why Gnutella Can't Scale. No, Really.", Jordan Ritter

● N = Number of connections open

● T = Number of hops

Query message length: 83 byte

9.21

Only query relaying (no Responses !!)

Prof. Dr. Mesut Güneş ▪ cst.mi.fu-berlin.de ▪ Telematics ▪ Chapter 9: Peer-to-Peer Networks

Page 22: Telematics Chapter 9: Peer to Peer Networks Chapter 9 ... · Chapter 9: Peer to Peer Networks Beispielbild Chapter 9: - -Peer Networks User watching video clip Server with video clips

Gnutella: Generated Traffic in Byte (2)y ( )

T=1 T=2 T=3 T=4 T=5 T=6 T=7 T=8

N=3 283.68 1,418.4 4,822.56 13,900.3 36,594.7 91,061.3 218,15 508.638, , , , , ,

N=4 378.24 2,647.68 12,860.2 53,710.1 206,897 758,371 2,688,530 9,306,220

N=5 472.8 4,255.2 26,949.6 147,986 753,17 3,658,050 17,214,200 79,185,000

N=6 567.36 6,240.96 48,793 332,473 2,105,470 12,743,500 74,798,500 429,398,000

N=7 661.92 8,604.96 80,092.3 651,991 4,941,123 35,823,800 252,002,000 1,734,360,000

N=8 756.48 11,347.2 122,55 1,160,440 10,242,000 86,526,900 709,521,000 5,693,470,000

M t f hi h h t t 30%

Source: "Why Gnutella Can't Scale. No, Really.", Jordan Ritter

Mean percentage of users, which share content: 30%Mean percentage of users, which can respond to replies: 40%Mean number of responses per responding user: 10Mean length of responses: 60

"Standard client settings yield a whopping 17MB generated in response to a […] search query "

9.22Prof. Dr. Mesut Güneş ▪ cst.mi.fu-berlin.de ▪ Telematics ▪ Chapter 9: Peer-to-Peer Networks

Page 23: Telematics Chapter 9: Peer to Peer Networks Chapter 9 ... · Chapter 9: Peer to Peer Networks Beispielbild Chapter 9: - -Peer Networks User watching video clip Server with video clips

Gnutella: Graphs …p

9.23Prof. Dr. Mesut Güneş ▪ cst.mi.fu-berlin.de ▪ Telematics ▪ Chapter 9: Peer-to-Peer Networks

Page 24: Telematics Chapter 9: Peer to Peer Networks Chapter 9 ... · Chapter 9: Peer to Peer Networks Beispielbild Chapter 9: - -Peer Networks User watching video clip Server with video clips

Gnutella: Pros & Cons

● Advantages● Simple protocol

● Disadvantages●Message broadcasts lead to● Simple protocol

easy to implement● Low maintenance traffic

Only periodic PING/PONGs

●Message broadcasts lead to network floodinghigh network traffic

l bilit● Only periodic PING/PONGs

●No restriction on overlay topologypoor scalability

9.24Prof. Dr. Mesut Güneş ▪ cst.mi.fu-berlin.de ▪ Telematics ▪ Chapter 9: Peer-to-Peer Networks

Page 25: Telematics Chapter 9: Peer to Peer Networks Chapter 9 ... · Chapter 9: Peer to Peer Networks Beispielbild Chapter 9: - -Peer Networks User watching video clip Server with video clips

First Generation of P2P-SystemsSuper-PeersFirst Generation of P2P Systems

9.25Prof. Dr. Mesut Güneş ▪ cst.mi.fu-berlin.de ▪ Telematics ▪ Chapter 9: Peer-to-Peer Networks

Page 26: Telematics Chapter 9: Peer to Peer Networks Chapter 9 ... · Chapter 9: Peer to Peer Networks Beispielbild Chapter 9: - -Peer Networks User watching video clip Server with video clips

Super-Peersp

● A possible solution of the scalability problem: Super-Peers● Concept used in Gnutella 0.6, Kazaa● Concept used in Gnutella 0.6, Kazaa● Idea: Nodes with high bandwidth, CPU power, etc. become Super-Peers● Super-Peers

N l P● Normal Peers

●Only Super-Peers are involved in the routing process● A “normal” (client) peer connects to a Super-Peer( ) p p● A Super-Peers knows all the contents of its client peers ● Client peers query their super-peers

A S P f d t th S P● A Super-Peer may forward a query to other Super-Peers

9.26Prof. Dr. Mesut Güneş ▪ cst.mi.fu-berlin.de ▪ Telematics ▪ Chapter 9: Peer-to-Peer Networks

Page 27: Telematics Chapter 9: Peer to Peer Networks Chapter 9 ... · Chapter 9: Peer to Peer Networks Beispielbild Chapter 9: - -Peer Networks User watching video clip Server with video clips

Super-Peer: Routingp g

SP

P P

SP

SPPP

P

PP

Pquery

query

SSP

P

P

P

query

queryreply

P SP

P

P

query query

reply

SPP SP

P P P

query query

queryquery

reply

replyreply

SPPP P

P

P

P

P P

query

9.27

P

Prof. Dr. Mesut Güneş ▪ cst.mi.fu-berlin.de ▪ Telematics ▪ Chapter 9: Peer-to-Peer Networks

Page 28: Telematics Chapter 9: Peer to Peer Networks Chapter 9 ... · Chapter 9: Peer to Peer Networks Beispielbild Chapter 9: - -Peer Networks User watching video clip Server with video clips

Super-Peers: Pros & Consp

● Advantages● Reduction of the search process

● Disadvantages●High traffic at the Super-Peers● Reduction of the search process

● Fast retrieval of data●High traffic at the Super Peers●How to select Super-Peers?●What happens when a Super-Peer

b k d ?breaks down?● Content of client peers not always

possible to index● Database contents

9.28Prof. Dr. Mesut Güneş ▪ cst.mi.fu-berlin.de ▪ Telematics ▪ Chapter 9: Peer-to-Peer Networks

Page 29: Telematics Chapter 9: Peer to Peer Networks Chapter 9 ... · Chapter 9: Peer to Peer Networks Beispielbild Chapter 9: - -Peer Networks User watching video clip Server with video clips

Distributed Hash Tables (DHT)Distributed Hash Tables (DHT)

9.29Prof. Dr. Mesut Güneş ▪ cst.mi.fu-berlin.de ▪ Telematics ▪ Chapter 9: Peer-to-Peer Networks

Page 30: Telematics Chapter 9: Peer to Peer Networks Chapter 9 ... · Chapter 9: Peer to Peer Networks Beispielbild Chapter 9: - -Peer Networks User watching video clip Server with video clips

Distributed Hash Tables (DHT): General( )

● Efficient Look-Up Services required●DHTs guarantee an upper bound for key look-ups●DHTs guarantee an upper bound for key look ups●DHTs are overlay networks● Each node and each object possesses a unique ID (hash key)● An object is stored on the node which is responsible for the object ID● A node is responsible for an ID if its own ID is the nearest to the object ID

9.30Prof. Dr. Mesut Güneş ▪ cst.mi.fu-berlin.de ▪ Telematics ▪ Chapter 9: Peer-to-Peer Networks

Page 31: Telematics Chapter 9: Peer to Peer Networks Chapter 9 ... · Chapter 9: Peer to Peer Networks Beispielbild Chapter 9: - -Peer Networks User watching video clip Server with video clips

Distributed Hash Tables (DHT): General( )

● Idea: Overlay topology is not randomly● Each node stores in its routing table only the nodes according particular● Each node stores in its routing table only the nodes according particular

requirements

● All DHTs provide two basic routing operations1 l k (k ) d1. lookup(key) node2. put(object, key) node

● Popular DHTs: ● Content Addressable Network (CAN)● Chord● Pastry● Tapestry● Tapestry

9.31Prof. Dr. Mesut Güneş ▪ cst.mi.fu-berlin.de ▪ Telematics ▪ Chapter 9: Peer-to-Peer Networks

Page 32: Telematics Chapter 9: Peer to Peer Networks Chapter 9 ... · Chapter 9: Peer to Peer Networks Beispielbild Chapter 9: - -Peer Networks User watching video clip Server with video clips

Distributed Hash Tables (DHT): General( )

● Each node manages a small number of references to other nodes. ●O(log N) references, N number of nodes●O(log N) references, N number of nodes

● By mapping nodes and data items into a common address space, routing to a node leads to the data items for which a certain node is responsible

● Queries are routed via a small number of nodes to the target node● An item can be located by routing via O(log N) hops.

● Identifiers are distributed on the nodes nearly equally● Identifiers are distributed on the nodes nearly equally ● Load for retrieving items may be balanced among the nodes

● No node plays a particular role ● Formation of hot spots or bottlenecks can be avoided. ●Departure of a node does not have considerable effects on the DHT

DHTs are considered robust against random failures and attacks●DHTs are considered robust against random failures and attacks

● Distributed index provides a definitive answer about results● If a data item is stored in the system, the DHT guarantees that the data is found

9.32

y , g

Prof. Dr. Mesut Güneş ▪ cst.mi.fu-berlin.de ▪ Telematics ▪ Chapter 9: Peer-to-Peer Networks

Page 33: Telematics Chapter 9: Peer to Peer Networks Chapter 9 ... · Chapter 9: Peer to Peer Networks Beispielbild Chapter 9: - -Peer Networks User watching video clip Server with video clips

Distributed Hash Tables (DHT): General( )

9.33Prof. Dr. Mesut Güneş ▪ cst.mi.fu-berlin.de ▪ Telematics ▪ Chapter 9: Peer-to-Peer Networks

Page 34: Telematics Chapter 9: Peer to Peer Networks Chapter 9 ... · Chapter 9: Peer to Peer Networks Beispielbild Chapter 9: - -Peer Networks User watching video clip Server with video clips

Distributed Hash Tables (DHT): General( )

9.34Prof. Dr. Mesut Güneş ▪ cst.mi.fu-berlin.de ▪ Telematics ▪ Chapter 9: Peer-to-Peer Networks

Page 35: Telematics Chapter 9: Peer to Peer Networks Chapter 9 ... · Chapter 9: Peer to Peer Networks Beispielbild Chapter 9: - -Peer Networks User watching video clip Server with video clips

Distributed Hash Tables (DHT): General( )

9.35Prof. Dr. Mesut Güneş ▪ cst.mi.fu-berlin.de ▪ Telematics ▪ Chapter 9: Peer-to-Peer Networks

Page 36: Telematics Chapter 9: Peer to Peer Networks Chapter 9 ... · Chapter 9: Peer to Peer Networks Beispielbild Chapter 9: - -Peer Networks User watching video clip Server with video clips

Distributed Hash Tables (DHT)ChordDistributed Hash Tables (DHT)

9.36Prof. Dr. Mesut Güneş ▪ cst.mi.fu-berlin.de ▪ Telematics ▪ Chapter 9: Peer-to-Peer Networks

Page 37: Telematics Chapter 9: Peer to Peer Networks Chapter 9 ... · Chapter 9: Peer to Peer Networks Beispielbild Chapter 9: - -Peer Networks User watching video clip Server with video clips

Case Study I: Chord (1)y ( )

● The IDs are arranged in a virtual ring from 0 – (2m -1)● Consistent hashing is used● Consistent hashing is used● The addition and removal of slots into the hash does not significantly change the

mapping of the keys

C i H hi ( SHA 1) i h d ( ) d h● Consistent Hashing (e.g. SHA-1) assigns each node (e.g. peer) and each object a m-bit ID in the same overlay ID ring● For nodes the IP address is hashed● For data the data key (e.g. file name) is hashed

● New nodes take their position in the ring according their ID● The key k is assigned to the first node with ID ≥ k

successor(k)● Chord provides an upper bound of O(log N) for the key look-up● Chord provides an upper bound of O(log N) for the key look up●N is the number of peers in the system

9.37Prof. Dr. Mesut Güneş ▪ cst.mi.fu-berlin.de ▪ Telematics ▪ Chapter 9: Peer-to-Peer Networks

Page 38: Telematics Chapter 9: Peer to Peer Networks Chapter 9 ... · Chapter 9: Peer to Peer Networks Beispielbild Chapter 9: - -Peer Networks User watching video clip Server with video clips

Case Study I: Chord (2)y ( )

014

1successor(1)=1

0successor(0)=0

0 12

15

1410

( )

successor(2)=3successor(14)=15

313 210

412

11

10 6

5

89

10

7successor(6)=6

(9) 9

successor(10)=13 6

9.38

successor(9)=9 9

Prof. Dr. Mesut Güneş ▪ cst.mi.fu-berlin.de ▪ Telematics ▪ Chapter 9: Peer-to-Peer Networks

Page 39: Telematics Chapter 9: Peer to Peer Networks Chapter 9 ... · Chapter 9: Peer to Peer Networks Beispielbild Chapter 9: - -Peer Networks User watching video clip Server with video clips

Case Study I: Chord (3)y ( )

● Each node n has a routing table with max. m entries ● Finger table● Finger table

● The i-th entry = first node s with an ID at least 2i-1 larger than n‘s ID● s = successor(node.ID + 2i-1)

● Peer s is the i-th finger of peer node

9.39Prof. Dr. Mesut Güneş ▪ cst.mi.fu-berlin.de ▪ Telematics ▪ Chapter 9: Peer-to-Peer Networks

Page 40: Telematics Chapter 9: Peer to Peer Networks Chapter 9 ... · Chapter 9: Peer to Peer Networks Beispielbild Chapter 9: - -Peer Networks User watching video clip Server with video clips

Case Study I: Chord (4)

14 10 i succ node

1 2 3

2 3 30 12

15

14

2 3 3

3 5 6

4 9 9

313 210

i succ node

4121 14 15

2 15 15

3 1 1

116

5

i succ node

4 5 6

89

10

7

6

6

i succ node

1 10 13

2 11 13

3 13 13

9.40

3 13 13

4 1 1

Prof. Dr. Mesut Güneş ▪ cst.mi.fu-berlin.de ▪ Telematics ▪ Chapter 9: Peer-to-Peer Networks

Page 41: Telematics Chapter 9: Peer to Peer Networks Chapter 9 ... · Chapter 9: Peer to Peer Networks Beispielbild Chapter 9: - -Peer Networks User watching video clip Server with video clips

Case Study I: Chord (5)

14 10i succ node

1 2 3

2 3 30 12

15

14

2 3 3

3 5 6

4 9 9

313 210

412

116

5

89

10

7

6

6

9.41Prof. Dr. Mesut Güneş ▪ cst.mi.fu-berlin.de ▪ Telematics ▪ Chapter 9: Peer-to-Peer Networks

Page 42: Telematics Chapter 9: Peer to Peer Networks Chapter 9 ... · Chapter 9: Peer to Peer Networks Beispielbild Chapter 9: - -Peer Networks User watching video clip Server with video clips

Case Study I: Chord – Routing (1)y g ( )

● Routing: if node n searches for the key k● If successor(k) unknown, forward query to next node n‘ in the finger table( ) , q y g● If n‘ does not know the successor(k), n‘ forwards the query to next node in its

finger tableThis is done until the successor(k) is foundThis is done until the successor(k) is found

● Idea: in each step, the distance to the successor(k) is halvedO(log N) many (overlay-) hops

Chord finds a key in O(log N)

9.42Prof. Dr. Mesut Güneş ▪ cst.mi.fu-berlin.de ▪ Telematics ▪ Chapter 9: Peer-to-Peer Networks

Page 43: Telematics Chapter 9: Peer to Peer Networks Chapter 9 ... · Chapter 9: Peer to Peer Networks Beispielbild Chapter 9: - -Peer Networks User watching video clip Server with video clips

Case Study I: Chord – Routing (2)

015

14 i succ node

1 2 3

2 3 30 12

15

14

2 3 3

3 5 6

4 9 9

313

i succ node

4121 14 15

2 15 15

3 1 1

11

10 6

5

i succ node

4 5 6

89

10

7

i succ node

1 10 13

2 11 13

3 13 13

9.43Prof. Dr. Mesut Güneş ▪ cst.mi.fu-berlin.de ▪ Telematics ▪ Chapter 9: Peer-to-Peer Networks

3 13 13

4 1 1

Page 44: Telematics Chapter 9: Peer to Peer Networks Chapter 9 ... · Chapter 9: Peer to Peer Networks Beispielbild Chapter 9: - -Peer Networks User watching video clip Server with video clips

Case Study I: Chord – Stabilizey

● Each node n performs a stabilize-procedure to correct possible network anomalies●Node n asks its successor for its predecessor p●Node n tests, whether p has to be its successor, i.e., p is between n its successor

N d d i di ll fi hi h i l d d l● Node n updates periodically one finger f which is selected randomly. ● For this node n searches for successor(node.ID + 2x-1) and updates it with the

new successor(node.ID + 2x-1)( )

9.44Prof. Dr. Mesut Güneş ▪ cst.mi.fu-berlin.de ▪ Telematics ▪ Chapter 9: Peer-to-Peer Networks

Page 45: Telematics Chapter 9: Peer to Peer Networks Chapter 9 ... · Chapter 9: Peer to Peer Networks Beispielbild Chapter 9: - -Peer Networks User watching video clip Server with video clips

Chord-based Applicationspp

● On top of Chord many applications can be realized● Cooperative File System (CFS)● Cooperative File System (CFS)● Multiple providers of content cooperate to store data● The total load is spread over all participants

Ch d b d DNS● Chord-based DNS● Distributed DNS lookup service● Host names are keys and IP address are values

9.45Prof. Dr. Mesut Güneş ▪ cst.mi.fu-berlin.de ▪ Telematics ▪ Chapter 9: Peer-to-Peer Networks

Page 46: Telematics Chapter 9: Peer to Peer Networks Chapter 9 ... · Chapter 9: Peer to Peer Networks Beispielbild Chapter 9: - -Peer Networks User watching video clip Server with video clips

Distributed Hash Tables (DHT)PastryDistributed Hash Tables (DHT)

9.46Prof. Dr. Mesut Güneş ▪ cst.mi.fu-berlin.de ▪ Telematics ▪ Chapter 9: Peer-to-Peer Networks

Page 47: Telematics Chapter 9: Peer to Peer Networks Chapter 9 ... · Chapter 9: Peer to Peer Networks Beispielbild Chapter 9: - -Peer Networks User watching video clip Server with video clips

Case Study II: Pastry – Introductiony y

● Similar concept as Chord●Nodes are organized in a virtual ID ring from 0 to 2128 – 1●Nodes are organized in a virtual ID ring from 0 to 2 1● Each node and object is assigned a 128 bit key (hash key)● Each ID is sequence of numbers in the base 2b (b=1 binary, b=4 hex)

● But:● The routing is based on prefix matching● Considers the topological distance● Considers the topological distance● Each node maintains● a routing table● a leaf set

9.47Prof. Dr. Mesut Güneş ▪ cst.mi.fu-berlin.de ▪ Telematics ▪ Chapter 9: Peer-to-Peer Networks

Page 48: Telematics Chapter 9: Peer to Peer Networks Chapter 9 ... · Chapter 9: Peer to Peer Networks Beispielbild Chapter 9: - -Peer Networks User watching video clip Server with video clips

Case Study II: Pastry – Routing Table (1)y y g ( )

● Routing table● log2b N rows● log2b N rows● Each row has 2b – 1 entries● Each entry in row n has the same n digit prefix as the current node● Each entry in row n differs on the (n+1)-th position from the current node● Each of these entries has one of the 2b -1 digits on the (n+1)-th position

9.48Prof. Dr. Mesut Güneş ▪ cst.mi.fu-berlin.de ▪ Telematics ▪ Chapter 9: Peer-to-Peer Networks

Page 49: Telematics Chapter 9: Peer to Peer Networks Chapter 9 ... · Chapter 9: Peer to Peer Networks Beispielbild Chapter 9: - -Peer Networks User watching video clip Server with video clips

Case Study II: Pastry – Routing-Table (2)y y g ( )● Routing table● NodeID 34035761, b = 3

0 1 2 3 4 5 6 7

03761261 13541241 27235106 45521251 53610176 65547772 71154601

row

0 03761261 13541241 27235106 45521251 53610176 65547772 71154601

30771255 31521225 32236556 33400741 35716236 36124163 37715026

34102724 34203162 34303735 34404216 34576555 34653437 34734152

0

1

2 34102724 34203162 34303735 34404216 34576555 34653437 34734152

34006624 34012773 34025354 34045631 34050032 34064645 34076214

34030342 34031643 34032346 34033652 34034040 34036123 34037437

2

3

4 34030342 34031643 34032346 34033652 34034040 34036123 34037437

34035073 34035152 34035031 34035070 34035667

34035701 34035717 34035740 34035774

5

634035701 34035717 34035740 34035774

9.49Prof. Dr. Mesut Güneş ▪ cst.mi.fu-berlin.de ▪ Telematics ▪ Chapter 9: Peer-to-Peer Networks

Page 50: Telematics Chapter 9: Peer to Peer Networks Chapter 9 ... · Chapter 9: Peer to Peer Networks Beispielbild Chapter 9: - -Peer Networks User watching video clip Server with video clips

Case Study II: Pastry – Neighborhood Set & Leaf Sety y g

● Leaf set● Contains the L closest nodes● Contains the L closest nodes● L/2 smaller nodes● L/2 larger nodes

● Typical values for |L| are 2b or 2 * 2b

9.50Prof. Dr. Mesut Güneş ▪ cst.mi.fu-berlin.de ▪ Telematics ▪ Chapter 9: Peer-to-Peer Networks

Page 51: Telematics Chapter 9: Peer to Peer Networks Chapter 9 ... · Chapter 9: Peer to Peer Networks Beispielbild Chapter 9: - -Peer Networks User watching video clip Server with video clips

Case Study II: Pastry – Node Statey y

0 1 2 3 4 5 6 7

Routing Table Local Overlay ID: 34035761

0 1 2 3 4 5 6 7

03761261 13541241 27235106 45521251 53610176 65547772 71154601

30771255 31521225 32236556 33400741 35716236 36124163 37715026

34102724 34203162 34303735 34404216 34576555 34653437 34734152

34006624 34012773 34025354 34045631 34050032 34064645 34076214

34030342 34031643 34032346 34033652 34034040 34036123 34037437

34035073 34035152 34035031 34035070 34035667

34035701 34035717 34035740 3403577434035701 34035717 34035740 34035774

smaller 34035667 34035701 34035717 34035740

larger 34035774 34036012 34036042 34036076Leaf Set

9.51

g

Prof. Dr. Mesut Güneş ▪ cst.mi.fu-berlin.de ▪ Telematics ▪ Chapter 9: Peer-to-Peer Networks

Page 52: Telematics Chapter 9: Peer to Peer Networks Chapter 9 ... · Chapter 9: Peer to Peer Networks Beispielbild Chapter 9: - -Peer Networks User watching video clip Server with video clips

Case Study II: Pastry – Routing (1)y y g ( )

● Routing in Pastry●Node n searches the leaf set for nodes which are responsible for key k●Node n searches the leaf set for nodes which are responsible for key k● If the leaf node l is responsible for key k, the query is addressed directly to node

lOth i th ti t bl i h d f d ith l fi t hi ( t●Otherwise the routing table is searched for a node with larger prefix matching (at least one more position) as node n

● If such a node does not exists the leaf set is searched for a node which is closer to k

● This process is repeated in each node until the query arrives at the node● This process is repeated in each node until the query arrives at the node which is responsible for key k● Intuitive: with each routing step the matching prefix grows for one position

O(log2b N) (Overlay-) routing effort

9.52Prof. Dr. Mesut Güneş ▪ cst.mi.fu-berlin.de ▪ Telematics ▪ Chapter 9: Peer-to-Peer Networks

Page 53: Telematics Chapter 9: Peer to Peer Networks Chapter 9 ... · Chapter 9: Peer to Peer Networks Beispielbild Chapter 9: - -Peer Networks User watching video clip Server with video clips

Case Study II: Pastry – Routing (2)

D462BA

D46A01key: D469FC

D4213F

D462BA

D1A08E

65A1FC

9.53

65A1FC

Prof. Dr. Mesut Güneş ▪ cst.mi.fu-berlin.de ▪ Telematics ▪ Chapter 9: Peer-to-Peer Networks

Page 54: Telematics Chapter 9: Peer to Peer Networks Chapter 9 ... · Chapter 9: Peer to Peer Networks Beispielbild Chapter 9: - -Peer Networks User watching video clip Server with video clips

Overlay- vs. Physical TopologyOverlay vs. Physical Topology

9.54Prof. Dr. Mesut Güneş ▪ cst.mi.fu-berlin.de ▪ Telematics ▪ Chapter 9: Peer-to-Peer Networks

Page 55: Telematics Chapter 9: Peer to Peer Networks Chapter 9 ... · Chapter 9: Peer to Peer Networks Beispielbild Chapter 9: - -Peer Networks User watching video clip Server with video clips

Overlay vs Physical Topology (1)y y p gy ( )

● DHTs can route very efficient in the overlay network● However there is no relationship between the overlay- and physical● However, there is no relationship between the overlay and physical

topology●Neighbors in the overlay network are rarely neighbors on the physical network●DHTs may show high Overlay Stretch● The ratio of the accumulated physical route during the overlay routing for the search of

a key and the real path length between source and destination nodes

t klil thP thlengthpath RealStretchOverlay =

networkoverlay in length Path

9.55Prof. Dr. Mesut Güneş ▪ cst.mi.fu-berlin.de ▪ Telematics ▪ Chapter 9: Peer-to-Peer Networks

Page 56: Telematics Chapter 9: Peer to Peer Networks Chapter 9 ... · Chapter 9: Peer to Peer Networks Beispielbild Chapter 9: - -Peer Networks User watching video clip Server with video clips

Overlay vs Physical Topology (2)y y p gy ( )

D462BAD46A01

key: D469FC

D4213F

D462BA

D1A08E

65A1FC O l St t h 17/2

9.56

65A1FC Overlay Stretch = 17/2

Prof. Dr. Mesut Güneş ▪ cst.mi.fu-berlin.de ▪ Telematics ▪ Chapter 9: Peer-to-Peer Networks

Page 57: Telematics Chapter 9: Peer to Peer Networks Chapter 9 ... · Chapter 9: Peer to Peer Networks Beispielbild Chapter 9: - -Peer Networks User watching video clip Server with video clips

Overlay vs Physical Topology (3)y y p gy ( )

● Several methods to reduce the overlay stretch●Proximity Neighbor Selection (PNS) in Pastry●Proximity Neighbor Selection (PNS) in Pastry● Each Pastry-node selects periodically a random entry from row i from its routing

tableThi d d li ith th i th f it ti t bl● This random node replies with the i-th row from its routing table

● After the response, the node computes pair wise the distance to the own entries and the entry from the response (e.g. PING/PONG)

● If needed the own entry is replaced by the entry from the response if it is physically closer than the own entry (e.g. hop count, round trip time)

9.57Prof. Dr. Mesut Güneş ▪ cst.mi.fu-berlin.de ▪ Telematics ▪ Chapter 9: Peer-to-Peer Networks

Page 58: Telematics Chapter 9: Peer to Peer Networks Chapter 9 ... · Chapter 9: Peer to Peer Networks Beispielbild Chapter 9: - -Peer Networks User watching video clip Server with video clips

Overlay vs. Physical Topology (4)y y p gy ( )

● Landmarking● Fixed set of Landmark-Nodes● Fixed set of Landmark Nodes● Each node measures periodically its distance to all Landmark-Nodes

Sequence of the Landmark-Nodes

Id N d i h h L d k Di S i h hi h● Idea: Nodes with the same Landmark-Distance-Sequence are with high probability physically close to each otherNodes with same Landmark-Distance-Sequence assign each other numerical

close overlay Ids● Example: 16 Landmark-Nodes in a Pastry-Network with hex IDs●Nodes with the same Landmark-Distance-Sequence assign to each other the●Nodes with the same Landmark Distance Sequence assign to each other the

same overlay-ID-prefix

9.58Prof. Dr. Mesut Güneş ▪ cst.mi.fu-berlin.de ▪ Telematics ▪ Chapter 9: Peer-to-Peer Networks

Page 59: Telematics Chapter 9: Peer to Peer Networks Chapter 9 ... · Chapter 9: Peer to Peer Networks Beispielbild Chapter 9: - -Peer Networks User watching video clip Server with video clips

Summaryy

9.59Prof. Dr. Mesut Güneş ▪ cst.mi.fu-berlin.de ▪ Telematics ▪ Chapter 9: Peer-to-Peer Networks

Page 60: Telematics Chapter 9: Peer to Peer Networks Chapter 9 ... · Chapter 9: Peer to Peer Networks Beispielbild Chapter 9: - -Peer Networks User watching video clip Server with video clips

Summaryy

● The Peer-to-Peer principle is not really new ● However with the growth of the Internet and emerging of new● However, with the growth of the Internet and emerging of new

applications a new wave of P2P applications was created● A P2P network is a overlay network on the Application Layer● In a P2P network all peers have the same role● Server + Client = Servent

9.60Prof. Dr. Mesut Güneş ▪ cst.mi.fu-berlin.de ▪ Telematics ▪ Chapter 9: Peer-to-Peer Networks


Recommended